:root {
  color: #172033;
  font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-synthesis: none;
  --primary: #006be6;
  --primary-dark: #005bc3;
  --muted: #6b7280;
  --border: #e6eaf0;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: #fff;
}

button, input { font: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.search-header {
  height: 76px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(115deg, #0750a7, #1976dd);
  color: #fff;
}

.header-inner,
.results-shell {
  width: min(1160px, calc(100% - 48px));
  margin: 0 auto;
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  color: #fff;
  text-decoration: none;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 1px;
  white-space: nowrap;
}

.home-link {
  flex: 0 0 auto;
  text-decoration: none;
  font-size: 14px;
  opacity: 0.9;
}
.home-link:hover { opacity: 1; }

.search-form {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  width: 600px;
  height: 45px;
  padding-left: 15px;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 5px 16px rgba(0, 32, 84, 0.18);
}

.search-icon {
  width: 18px;
  height: 18px;
  border: 2px solid #7d8a9d;
  border-radius: 50%;
  position: relative;
  flex: 0 0 auto;
}
.search-icon::after {
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 7px;
  height: 2px;
  background: #7d8a9d;
  content: "";
  transform: rotate(45deg);
}

.search-form input {
  min-width: 0;
  flex: 1;
  height: 100%;
  padding: 0 14px;
  border: 0;
  outline: 0;
  color: #1f2937;
  font-size: 14px;
}
.search-form input::placeholder { color: #a0a8b5; }

.search-form button {
  align-self: stretch;
  min-width: 82px;
  border: 0;
  border-radius: 0 6px 6px 0;
  background: #ff7a1a;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 2px;
}
.search-form button:hover { background: #e9680b; }
.results-shell { min-height: 450px; padding: 36px 0 68px; }
.filter-shell {
  width: min(1160px, calc(100% - 48px));
  margin: 28px auto 0;
  padding: 18px 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(22, 56, 100, .06);
}
.filter-row { display: flex; min-height: 42px; align-items: center; gap: 16px; }
.filter-row + .filter-row { margin-top: 12px; padding-top: 12px; border-top: 1px dashed #e8edf3; }
.filter-label { flex: 0 0 auto; color: #667085; font-size: 14px; }
.scope-label { margin-left: auto; }
.filter-options { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-options button, .search-history button, .feedback-card button {
  border: 0; border-radius: 4px; background: transparent; color: #475467; cursor: pointer;
}
.filter-options button { padding: 7px 13px; font-size: 14px; }
.filter-options button:hover, .filter-options button.is-active { background: #e8f1ff; color: var(--primary); }
.date-filter { display: flex; align-items: center; gap: 8px; margin-left: auto; color: #667085; font-size: 14px; }
.date-picker { position: relative; }
.date-picker-trigger { display: flex; width: 260px; height: 34px; align-items: center; justify-content: space-between; padding: 0 12px; border: 1px solid #d9d9d9; border-radius: 6px; background: #fff; color: #98a2b3; cursor: pointer; font-size: 13px; text-align: left; }
.date-picker-trigger:hover, .date-picker-trigger[aria-expanded="true"] { border-color: var(--primary); }
.date-picker-trigger input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: inherit; cursor: pointer; font: inherit; }
.date-picker-arrow { width: 9px; height: 9px; margin-top: -5px; border-right: 2px solid #4b5563; border-bottom: 2px solid #4b5563; transform: rotate(45deg); transition: transform .16s ease; }
.date-picker-trigger[aria-expanded="true"] .date-picker-arrow { margin-top: 5px; transform: rotate(225deg); }
.date-picker-panel { position: absolute; z-index: 10; top: calc(100% + 10px); right: 0; width: 260px; padding: 15px; border: 0; border-radius: 14px; background: #fff; box-shadow: 0 12px 30px rgba(15, 23, 42, .18); color: #30343b; }
.date-quick-options { display: flex; gap: 6px; padding-bottom: 14px; border-bottom: 1px solid #d9d9d9; }
.date-quick-options button { flex: 1; height: 30px; padding: 0; border: 1px solid #cfe0f4; border-radius: 4px; background: #f3f8ff; color: var(--primary); cursor: pointer; font-size: 12px; line-height: 1; white-space: nowrap; }
.date-quick-options button:hover { border-color: var(--primary); background: var(--primary); color: #fff; }
.date-custom-range { display: grid; gap: 13px; padding: 21px 0 18px; }
.date-custom-range strong { font-size: 13px; font-weight: normal; }
.date-custom-range input { box-sizing: border-box; width: 100%; height: 35px; padding: 0 12px; border: 1px solid #dedede; border-radius: 6px; background: #fff; color: #475467; font-size: 13px; }
.date-custom-range input:focus { border-color: var(--primary); outline: 0; }
.mini-date-field { position: relative; }
.mini-date-field input { padding-right: 34px; cursor: pointer; }
.mini-date-field.is-open input { border-color: var(--primary); }
.mini-date-icon { position: absolute; top: 50%; right: 12px; width: 16px; height: 16px; margin-top: -8px; color: #98a2b3; pointer-events: none; }
.mini-date-panel { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: 100%; min-width: 232px; padding: 12px; border: 0; border-radius: 10px; background: #fff; box-shadow: 0 12px 30px rgba(15, 23, 42, .18); }
.mdp-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mdp-header button { width: 24px; height: 24px; border: 0; border-radius: 4px; background: transparent; color: #606266; cursor: pointer; font-size: 16px; line-height: 1; }
.mdp-header button:hover { background: #f2f6fc; color: var(--primary); }
.mdp-title { color: #303133; font-size: 14px; font-weight: 500; }
.mdp-weekdays, .mdp-days { display: grid; grid-template-columns: repeat(7, 1fr); }
.mdp-weekdays { padding-bottom: 4px; color: #909399; font-size: 12px; text-align: center; }
.mdp-days { gap: 2px; }
.mdp-day { display: flex; height: 28px; align-items: center; justify-content: center; border-radius: 50%; color: #606266; cursor: pointer; font-size: 13px; }
.mdp-day:hover { background: #f2f6fc; color: var(--primary); }
.mdp-day.is-other-month { color: #c0c4cc; cursor: default; }
.mdp-day.is-other-month:hover { background: transparent; color: #c0c4cc; }
.mdp-day.is-today { color: var(--primary); font-weight: 600; }
.mdp-day.is-selected { background: var(--primary); color: #fff; }
.mdp-day.is-disabled { color: #c0c4cc; cursor: not-allowed; }
.mdp-day.is-disabled:hover { background: transparent; color: #c0c4cc; }
.date-picker-actions { display: flex; justify-content: center; gap: 20px; }
.date-picker-actions button { min-width: 90px; height: 36px; border: 0; border-radius: 6px; background: #275b9b; color: #fff; cursor: pointer; font-size: 14px; }
.date-picker-actions button:hover { background: #1f4d85; }
.date-picker-actions .date-cancel { background: #ff7a1a; }
.date-picker-actions .date-cancel:hover { background: #e9680b; }
.specified-sites { display: flex; align-items: flex-start; gap: 14px; padding-top: 13px; margin-top: 13px; border-top: 1px dashed #e8edf3; color: #667085; font-size: 14px; }
.specified-sites-label { height: 32px; display: inline-flex; align-items: center; white-space: nowrap; }
.site-selector-wrap { flex: 1; min-width: 0; }
.site-selector { display: flex; flex-wrap: wrap; gap: 8px; min-height: 32px; }
.site-option { height: 32px; padding: 0 13px; border: 1px solid #d9e2ef; border-radius: 4px; background: #f8fafc; color: #475467; cursor: pointer; font-size: 14px; transition: all .16s ease; }
.site-option:hover { border-color: #8db8ec; background: #f0f7ff; color: var(--primary); }
.site-option.is-selected { border-color: var(--primary); background: #e8f1ff; color: var(--primary); box-shadow: inset 0 0 0 1px rgba(23, 105, 210, .08); }
.catalog-picker { position: relative; width: 300px; flex: 0 0 300px; }
.catalog-picker-trigger { display: flex; width: 100%; height: 32px; align-items: center; justify-content: space-between; padding: 0 10px 0 13px; border: 1px solid #d9e2ef; border-radius: 4px; background: #fff; color: #475467; cursor: pointer; font-size: 14px; text-align: left; }
.catalog-picker-trigger:hover, .catalog-picker-trigger[aria-expanded="true"] { border-color: var(--primary); }
.catalog-picker-arrow { width: 7px; height: 7px; margin-left: 10px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.catalog-picker-trigger[aria-expanded="true"] .catalog-picker-arrow { transform: rotate(225deg) translateY(-2px); }
.catalog-picker-menu { position: absolute; z-index: 5; top: calc(100% + 5px); left: 0; width: 100%; max-height: 240px; overflow-y: auto; padding: 6px 0; border: 1px solid #d9e2ef; border-radius: 4px; background: #fff; box-shadow: 0 8px 18px rgba(16, 24, 40, .12); }
.catalog-picker-menu.specified-picker-menu { display: grid; width: 600px; max-height: 340px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: 0; overflow: hidden; }
.specified-picker-panel { min-height: 180px; max-height: 280px; overflow-y: auto; padding: 6px 0; }
.specified-picker-panel + .specified-picker-panel { border-left: 1px solid #e6ebf2; }
.specified-picker-title { display: block; padding: 6px 12px 8px; color: #667085; font-size: 13px; font-weight: 600; }
.specified-configuring { margin: -3px 12px 8px; color: var(--primary); font-size: 13px; }
.specified-select-all { display: flex; height: 34px; align-items: center; gap: 9px; padding: 0 12px; border-bottom: 1px solid #edf0f4; color: #344054; cursor: pointer; font-size: 14px; font-weight: 600; }
.specified-select-all input { width: 14px; height: 14px; margin: 0; accent-color: var(--primary); }
.specified-picker-site { display: block; width: 100%; min-height: 34px; padding: 0 12px 0 calc(12px + var(--catalog-level, 0) * 22px); border: 0; background: transparent; color: #475467; cursor: pointer; font-size: 14px; text-align: left; }
.specified-picker-site:hover, .specified-picker-site.is-active { background: #f0f7ff; color: var(--primary); }
.specified-picker-site.is-selected::after { float: right; color: var(--primary); content: '✓'; }
.specified-picker-empty { margin: 54px 0; color: #98a2b3; font-size: 13px; text-align: center; }
.specified-picker-actions { display: flex; grid-column: 1 / -1; justify-content: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid #e6ebf2; background: #fff; }
.specified-picker-actions button { min-width: 58px; height: 30px; border: 1px solid #d9e2ef; border-radius: 4px; background: #fff; color: #475467; cursor: pointer; font-size: 13px; }
.specified-picker-actions button.is-primary { border-color: var(--primary); background: var(--primary); color: #fff; }
.catalog-picker-option { display: flex; min-height: 34px; align-items: center; gap: 9px; padding: 0 12px 0 calc(12px + var(--catalog-level, 0) * 22px); color: #475467; cursor: pointer; font-size: 14px; }
.catalog-picker-option:hover { background: #f0f7ff; color: var(--primary); }
.catalog-picker-option input { width: 14px; height: 14px; margin: 0; accent-color: var(--primary); }
.catalog-select-all { display: flex; height: 34px; align-items: center; gap: 9px; padding: 0 12px; border-bottom: 1px solid #edf0f4; color: #344054; cursor: pointer; font-size: 14px; font-weight: 600; }
.catalog-select-all input { width: 14px; height: 14px; margin: 0; accent-color: var(--primary); }
.catalog-picker-option.is-branch { padding-left: calc(12px + var(--catalog-level, 0) * 22px); color: #344054; cursor: default; font-weight: 600; }
.catalog-picker-option.is-branch:hover { background: transparent; color: #344054; }
.catalog-selected-option { display: inline-flex; align-items: center; gap: 8px; }
.catalog-remove { font-size: 17px; font-weight: 300; line-height: 1; }
#site-selector-tip { display: block; margin-top: 9px; color: #98a2b3; font-size: 12px; }
.result-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 26px; align-items: start; }
.search-aside { display: grid; gap: 16px; position: sticky; top: 18px; font-size: 14px; }
.aside-card { padding: 20px; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.aside-heading { display: flex; justify-content: space-between; align-items: center; }
.aside-card h2 { margin: 0; color: #344054; font-size: 14px; font-weight: 500; }
.aside-heading button { border: 0; background: transparent; color: #98a2b3; cursor: pointer; font-size: 13px; }
.search-history { display: grid; gap: 6px; margin-top: 14px; }
.search-history p { margin: 5px 0; color: #98a2b3; font-size: 13px; }
.search-history button { overflow: hidden; padding: 9px 10px; background: #f6f8fb; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.search-history button:hover { color: var(--primary); }
.feedback-card > div { display: flex; gap: 8px; margin-top: 15px; }
.feedback-card button { flex: 1; padding: 6px; background: #f6f8fb; font-size: 14px; }
.feedback-card button:hover { background: #e8f1ff; color: var(--primary); }
.feedback-card p { margin: 12px 0 0; color: #16815b; font-size: 13px; }
.result-summary {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}
.result-summary strong { color: #e85f0b; font-weight: 600; }

.state-panel {
  display: flex;
  min-height: 310px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-align: center;
}
.state-panel h2 { margin: 20px 0 8px; color: #344054; font-size: 20px; font-weight: 500; }
.state-panel p { margin: 0; font-size: 14px; }

.state-icon {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  border-radius: 50%;
  background: #edf5ff;
  color: var(--primary);
}
.search-state::before {
  width: 20px;
  height: 20px;
  border: 3px solid currentColor;
  border-radius: 50%;
  content: "";
  transform: translate(-2px, -2px);
}
.search-state::after {
  width: 12px;
  height: 3px;
  margin: -18px 0 0 24px;
  background: currentColor;
  content: "";
  transform: rotate(45deg);
}
.empty-icon::before { content: "—"; font-size: 28px; }
.error-icon { background: #fff1f0; color: #d92d20; font-size: 25px; font-weight: 700; }

.loader {
  width: 42px;
  height: 42px;
  border: 3px solid #dbeafe;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.secondary-button {
  margin-top: 22px;
  padding: 9px 24px;
  border: 1px solid var(--primary);
  border-radius: 4px;
  background: #fff;
  color: var(--primary);
  cursor: pointer;
}

.result-list { margin: 0; padding: 0; list-style: none; }
.result-item { padding: 26px 4px; border-bottom: 1px solid var(--border); }
.result-title { margin: 0 0 10px; font-size: 19px; font-weight: 500; line-height: 1.55; }
.result-title a { color: #1f3b64; text-decoration: none; }
.result-title a:hover { color: var(--primary); text-decoration: underline; }
.result-snippet { margin: 0 0 13px; color: #5d6675; font-size: 14px; line-height: 1.85; }
.highlight { color: #e85f0b; font-weight: 600; }
.result-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; color: #89919d; font-size: 13px; line-height: 1.6; }
.result-meta b { color: #5d6675; font-weight: 500; }
.result-url { max-width: 100%; overflow: hidden; color: #16815b; text-overflow: ellipsis; white-space: nowrap; }

.pagination { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding-top: 36px; }
.page-button {
  min-width: 38px;
  height: 38px;
  padding: 0 11px;
  border: 1px solid #dfe3e8;
  border-radius: 4px;
  background: #fff;
  color: #475467;
  cursor: pointer;
}
.page-button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.page-button.active { border-color: var(--primary); background: var(--primary); color: #fff; }
.page-button:disabled { cursor: default; opacity: .42; }
.page-ellipsis { align-self: center; color: #98a2b3; }

.search-footer {
  padding: 28px 24px;
  border-top: 1px solid #edf0f4;
  background: #f8fafc;
  color: #98a2b3;
  text-align: center;
  font-size: 13px;
}

@media (max-width: 640px) {
  .header-inner, .results-shell { width: calc(100% - 32px); }
  .search-header { height: 66px; }
  .header-inner { gap: 10px; }
  .search-form { height: 38px; padding-left: 11px; }
  .search-form input { padding: 0 13px; font-size: 15px; }
  .search-form button { min-width: 62px; letter-spacing: 1px; }
  .home-link { display: none; }
  .results-shell { padding-top: 26px; }
  .result-item { padding: 22px 0; }
  .result-title { font-size: 17px; }
  .result-meta { flex-direction: column; gap: 6px; }
  .filter-shell { width: calc(100% - 32px); padding: 14px; }
  .filter-row { align-items: flex-start; flex-wrap: wrap; gap: 8px; }
  .scope-label, .date-filter { margin-left: 0; }
  .catalog-picker { width: min(300px, 100%); flex-basis: min(300px, 100%); }
  .catalog-picker-menu.specified-picker-menu { width: min(600px, calc(100vw - 48px)); }
  .date-filter { width: 100%; flex-wrap: wrap; }
  .date-picker-trigger { max-width: calc(100vw - 64px); }
  .date-picker-panel { right: auto; left: 0; width: min(260px, calc(100vw - 48px)); }
  .specified-sites { flex-wrap: wrap; gap: 8px; }
  .site-selector-wrap { flex-basis: 100%; }
  .result-layout { grid-template-columns: 1fr; }
  .search-aside { position: static; grid-template-columns: 1fr; }
}

@media (max-width: 900px) and (min-width: 641px) {
  .result-layout { grid-template-columns: 1fr; }
  .search-aside { position: static; grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .loader { animation-duration: 1.6s; }
}
