/* ==========================================================================
   2027 国考职位筛选
   ========================================================================== */

:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef2f7;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #e6eaf0;
  --line-2: #cfd8e3;
  --primary: #1d4ed8;
  --primary-2: #2563eb;
  --primary-soft: #eff4ff;
  --primary-ink: #1e40af;
  --red: #b42318;
  --red-soft: #fef3f2;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --green: #047857;
  --green-soft: #ecfdf5;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 6px 20px rgba(16, 24, 40, .09);
  --radius: 12px;
  --row-h: 120px;
  --sidebar-w: 318px;
  --topbar-h: 64px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC",
          -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, select { font-family: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--primary-2);
  outline-offset: 2px;
}

::selection { background: #bfdbfe; }

/* ---------- 图标 ---------- */
.icon {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* ---------- 布局骨架 ---------- */
.app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.topbar {
  height: var(--topbar-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}

.logo {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -1px;
  background: linear-gradient(145deg, #1e3a8a 0%, #2563eb 62%, #3b82f6 100%);
  box-shadow: 0 2px 8px rgba(29, 78, 216, .28), inset 0 1px 0 rgba(255, 255, 255, .25);
  user-select: none;
}
.logo.big { width: 56px; height: 56px; font-size: 28px; border-radius: 16px; }

.brand-text h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .2px;
  line-height: 1.25;
  white-space: nowrap;
}
.brand-text p {
  margin: 1px 0 0;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.searchbox {
  flex: 1;
  max-width: 680px;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px 0 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.searchbox:focus-within {
  background: #fff;
  border-color: var(--primary-2);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.searchbox > .icon { color: var(--faint); width: 17px; height: 17px; }

#q {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  font-size: 13.5px;
  color: var(--text);
  outline: none;
}
#q::placeholder { color: var(--faint); }
#q::-webkit-search-cancel-button { display: none; }

.q-clear {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #e2e8f0;
  color: var(--muted);
  padding: 0;
}
.q-clear .icon { width: 12px; height: 12px; }
.q-clear:hover { background: #cbd5e1; color: var(--text); }

.searchbox kbd {
  font-family: inherit;
  font-size: 11px;
  color: var(--faint);
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0 5px;
  line-height: 17px;
  background: #fff;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .14s, border-color .14s, color .14s, box-shadow .14s;
}
.btn .icon { width: 15px; height: 15px; color: var(--muted); }
.btn:hover { background: var(--surface-2); border-color: var(--line-2); color: var(--text); }
.btn:active { transform: translateY(.5px); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-3); border-color: transparent; }
.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(29, 78, 216, .25);
}
.btn.primary:hover { background: #1e40af; border-color: #1e40af; color: #fff; }
.btn.primary .icon { color: #fff; }
.btn.block { width: 100%; height: 40px; font-size: 13.5px; }
.btn.icon { width: 34px; padding: 0; }
.btn.active { background: var(--primary-soft); color: var(--primary-ink); }

.count-badge {
  min-width: 18px;
  height: 17px;
  padding: 0 5px;
  display: inline-grid;
  place-items: center;
  border-radius: 99px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.btn.active .count-badge, #btn-fav.has-fav .count-badge {
  background: #fef3c7;
  color: #92400e;
}

.mobile-only { display: none !important; }

/* ---------- 主体 ---------- */
.app-body {
  flex: 1;
  display: flex;
  min-height: 0;
}

/* ---------- 侧栏 ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--surface-2);
  border-right: 1px solid var(--line);
}

.sidebar-head {
  height: 50px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.sidebar-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .2px;
}
.active-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-grid;
  place-items: center;
  border-radius: 99px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
}
.link {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  padding: 4px 2px;
  border-radius: 5px;
}
.link:hover { color: var(--primary); background: var(--primary-soft); }

.sidebar-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 14px 26px;
}

/* 折叠区 */
.facet { border-bottom: 1px solid var(--line); }
.facet > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 2px;
  cursor: pointer;
  user-select: none;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}
.facet > summary::-webkit-details-marker { display: none; }
.facet > summary:hover { color: var(--primary); }
.facet > summary > span:first-child { flex: 1; }
.facet > summary::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.6px solid var(--faint);
  border-bottom: 1.6px solid var(--faint);
  transform: rotate(45deg) translateY(-2px);
  transition: transform .18s;
  flex-shrink: 0;
}
.facet[open] > summary::after { transform: rotate(-135deg) translateY(-1px); }

.facet-flag {
  display: none;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  place-items: center;
  border-radius: 99px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
}
.facet-flag.on { display: inline-grid; }

.facet-body {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 0 2px 14px;
}

.sub-label {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}

.sub-facet {
  border-top: 1px dashed var(--line);
  margin-top: 4px;
}
.sub-facet > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 2px 3px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}
.sub-facet > summary::-webkit-details-marker { display: none; }
.sub-facet > summary > span:first-child { flex: 1; }
.sub-facet > summary::after {
  content: "";
  width: 5px;
  height: 5px;
  border-right: 1.5px solid var(--faint);
  border-bottom: 1.5px solid var(--faint);
  transform: rotate(45deg);
  transition: transform .18s;
  flex-shrink: 0;
}
.sub-facet[open] > summary::after { transform: rotate(-135deg); }
.sub-facet > .facet-body { padding: 4px 2px 8px; }

.hint {
  margin: 0;
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--faint);
}
.error { margin: 0; font-size: 12px; color: var(--red); }

/* 控件 */
.input {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 12.5px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.input::placeholder { color: var(--faint); }
.input::-webkit-search-cancel-button { display: none; }

.select {
  width: 100%;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text-2);
  font-size: 12.5px;
  outline: none;
}
.select:focus { border-color: var(--primary-2); box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.select.compact { width: auto; min-width: 132px; height: 32px; font-size: 12px; }

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.check input { accent-color: var(--primary); width: 13px; height: 13px; margin: 0; }

/* 分段控件 */
.seg {
  display: inline-flex;
  padding: 2px;
  background: var(--surface-3);
  border-radius: 7px;
  gap: 1px;
}
.seg button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 5px;
  white-space: nowrap;
  transition: background .12s, color .12s, box-shadow .12s;
}
.seg button:hover { color: var(--text); }
.seg button.on {
  background: #fff;
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.seg.wide { display: flex; }
.seg.wide button { flex: 1; }

/* 药丸型多选 */
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pills.tight { gap: 5px; }
.pills.cols-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text-2);
  font-size: 11.5px;
  line-height: 1.2;
  text-align: center;
  transition: border-color .12s, background .12s, color .12s;
}
.pill em {
  font-style: normal;
  font-size: 9.5px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.pill:hover { border-color: var(--line-2); background: #fbfdff; }
.pill.on {
  border-color: #93b4f5;
  background: var(--primary-soft);
  color: var(--primary-ink);
  font-weight: 600;
}
.pill.on em { color: #3b6fe0; }
.pill.small { padding: 4px 7px; font-size: 11px; }
.pills.cols-3 .pill { padding: 5px 3px; font-size: 11px; }
.pills.cols-3 .pill em { font-size: 9px; }

.quick-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 10.5px;
  color: var(--faint);
}
.quick-row > span { margin-right: 1px; }
.quick-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 6px;
  transition: all .12s;
}
.quick-btn:hover { background: var(--surface-2); border-color: var(--line-2); color: var(--text); }
.quick-btn.on {
  background: var(--primary-soft);
  border-color: #c7d7f7;
  color: var(--primary-ink);
  font-weight: 600;
}

.picker-trigger:disabled {
  opacity: .55;
  cursor: not-allowed;
  background: var(--surface-2);
}

.major-toolbar { align-items: center; gap: 8px; }
.major-list { max-height: 52vh; }
.major-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
}
.major-item:hover { background: #fff; }
.major-item input {
  accent-color: var(--primary);
  width: 14px;
  height: 14px;
  margin: 0;
  flex-shrink: 0;
}
.major-item .major-kind {
  flex-shrink: 0;
  font-size: 9px;
  line-height: 14px;
  padding: 0 4px;
  border-radius: 3px;
  background: var(--surface-3);
  color: var(--muted);
}
.major-item .name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.major-item .code {
  flex-shrink: 0;
  font-size: 9.5px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.major-item .cnt {
  flex-shrink: 0;
  min-width: 34px;
  text-align: right;
  font-size: 10px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.major-item.checked {
  background: var(--primary-soft);
  color: var(--primary-ink);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  max-width: 100%;
  padding: 3px 4px 3px 8px;
  border-radius: 99px;
  background: var(--primary-soft);
  color: var(--primary-ink);
  font-size: 10.5px;
  line-height: 1.5;
}
.chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip button {
  width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #6d8fce;
  font-size: 12px;
  line-height: 1;
  padding: 0;
}
.chip button:hover { background: #dbe7ff; color: var(--primary-ink); }

.chip-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 10.5px;
  padding: 3px 7px;
  border-radius: 99px;
}
.chip-btn:hover { border-color: #b6c9ea; color: var(--primary-ink); background: var(--primary-soft); }
.chip-btn.on {
  border-color: #b6c9ea;
  background: var(--primary-soft);
  color: var(--primary-ink);
  font-weight: 600;
}

.picker-trigger {
  width: 100%;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text-2);
  font-size: 12px;
  text-align: left;
}
.picker-trigger > span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-trigger .icon { color: var(--faint); }
.picker-trigger .chev { width: 14px; height: 14px; margin-left: auto; }
.picker-trigger:hover { border-color: var(--line-2); background: #fbfdff; }

.range-row {
  display: flex;
  align-items: center;
  gap: 7px;
}
.range-row .input { height: 32px; }
.range-row > span { color: var(--faint); font-size: 11px; }

/* 三态要求 */
.req-list { display: flex; flex-direction: column; gap: 6px; }
.req-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
}
.req-name {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.req-row.active .req-name { color: var(--primary-ink); font-weight: 600; }
.req-select {
  height: 31px;
  padding: 0 4px;
  font-size: 11px;
  background: #fff;
}
.req-row.active .req-select {
  border-color: #b6c9ea;
  background: var(--primary-soft);
  color: var(--primary-ink);
}
.tri-summary {
  margin: 0;
  padding: 5px 7px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--faint);
  font-size: 9.5px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}

.notice-warn {
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: #9a3412;
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 10.5px;
  line-height: 1.65;
}
.notice-warn strong {
  display: block;
  margin-bottom: 3px;
  font-size: 11px;
  color: #9a3412;
}
.notice-warn p { margin: 0 0 4px; }
.notice-warn p:last-child { margin-bottom: 0; }

.source-note {
  margin: 18px 2px 0;
  padding: 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
}
.source-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 6px;
}
.source-note p {
  margin: 0 0 5px;
  font-size: 10px;
  line-height: 1.65;
  color: var(--faint);
}
.source-note p:last-child { margin-bottom: 0; }
.source-meta { color: #b6c0cd !important; }

.sidebar-foot {
  flex-shrink: 0;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: #fff;
}

/* ---------- 结果区 ---------- */
.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg);
}

.result-head {
  min-height: 60px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.stats { min-width: 0; }
.stats-main {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stats-main b { color: var(--primary); font-weight: 700; font-variant-numeric: tabular-nums; }
.stats-sub {
  margin-top: 1px;
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.result-tools { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.active-filters {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  max-height: 86px;
  overflow-y: auto;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 4px 3px 9px;
  border-radius: 99px;
  border: 1px solid #d6e2fa;
  background: var(--primary-soft);
  color: var(--primary-ink);
  font-size: 11px;
  max-width: 320px;
}
.filter-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-chip button {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #5c83c9;
  font-size: 13px;
  line-height: 1;
  padding: 0;
}
.filter-chip button:hover { background: #d5e3ff; color: var(--primary-ink); }
.filter-clear-all {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  margin-left: 2px;
  padding: 3px 5px;
  border-radius: 5px;
}
.filter-clear-all:hover { color: var(--red); background: var(--red-soft); }

.list-viewport {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  position: relative;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.list-spacer { width: 1px; pointer-events: none; }
.list-window { position: absolute; top: 0; left: 0; right: 0; will-change: transform; }

.card-slot {
  height: var(--row-h);
  padding: 5px 20px;
}
.card {
  height: 100%;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .13s, box-shadow .13s, transform .13s;
  box-shadow: var(--shadow-sm);
}
.card:hover {
  border-color: #b9c9e6;
  box-shadow: 0 4px 14px rgba(23, 43, 77, .08);
}
.card.active {
  border-color: #7aa2ee;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .13);
}
.card.flash { animation: flash 1.8s ease-out; }
@keyframes flash {
  0%, 22% { background: #eef6ff; border-color: #4c86e8; }
  100% { background: var(--surface); }
}

.card-loc {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding-right: 8px;
  border-right: 1px dashed var(--line);
  min-width: 0;
  text-align: left;
}
.loc-sheet {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: .2px;
}
.loc-num {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.loc-num b {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -.2px;
}

.card-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.card-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 650;
  color: var(--text);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.hire {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  padding: 1.5px 6px;
  border-radius: 99px;
  background: var(--green-soft);
  color: var(--green);
  font-variant-numeric: tabular-nums;
}
.card-sub {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-sub b { color: var(--text-2); font-weight: 600; }
.card-sub .sep { margin: 0 5px; color: #cbd5e1; }

.card-meta {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  align-items: center;
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  min-height: 16px;
}
.meta-item { display: inline-flex; align-items: center; flex-shrink: 0; }
.meta-item + .meta-item::before {
  content: "";
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #b8c2cf;
  margin: 0 6px;
  flex-shrink: 0;
}
.meta-item.loc { color: var(--text-2); font-weight: 500; }
.meta-pill {
  display: inline-block;
  margin-left: 3px;
  margin-right: 0;
  padding: 0 5px;
  border-radius: 4px;
  font-size: 9.5px;
  line-height: 15px;
  background: var(--surface-3);
  color: var(--muted);
}
.meta-pill.police { background: #eef2ff; color: #4338ca; }
.meta-pill.west { background: #fff7ed; color: #c2410c; }

.card-major {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}
.major-label {
  display: inline-block;
  padding: 0 4px;
  margin-right: 4px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: 9px;
  color: var(--faint);
  line-height: 13px;
  vertical-align: 1px;
}
.card-major mark {
  background: #fef3c7;
  color: #92400e;
  border-radius: 2px;
  padding: 0 1px;
}

.hire-meta { display: none !important; }

.star-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #c3ccd9;
  padding: 0;
  transition: color .13s, background .13s;
}
.star-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linejoin: round;
}
.star-btn:hover { background: var(--amber-soft); color: #d97706; }
.star-btn.on { color: #f59e0b; }
.star-btn.on svg { fill: #fbbf24; stroke: #d97706; }

.list-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 30px;
  background: var(--bg);
  text-align: center;
}
.empty-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--faint);
  margin-bottom: 6px;
}
.empty-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}
.list-empty h2 { margin: 0; font-size: 15px; font-weight: 600; }
.list-empty p { margin: 0 0 12px; font-size: 12px; color: var(--muted); }

/* ---------- 详情抽屉 ---------- */
.drawer-scrim {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .32);
  backdrop-filter: blur(1px);
  z-index: 78;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.drawer-scrim.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(620px, 100vw);
  z-index: 80;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  box-shadow: -14px 0 40px rgba(15, 23, 42, .16);
  transform: translateX(103%);
  transition: transform .24s cubic-bezier(.32, .72, .32, 1), visibility 0s linear .24s;
  visibility: hidden;
}
.drawer.open {
  transform: none;
  visibility: visible;
  transition: transform .24s cubic-bezier(.32, .72, .32, 1), visibility 0s;
}

.drawer-head {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfdff, #fff);
}
.drawer-heading { flex: 1; min-width: 0; }
.drawer-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.drawer-badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  white-space: nowrap;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: .2px;
}
.drawer-sheet {
  flex: 1;
  font-size: 10.5px;
  color: var(--faint);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.drawer-head h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: .1px;
  word-break: break-word;
}
.drawer-head p {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  word-break: break-word;
}
.drawer-actions { display: flex; gap: 3px; flex-shrink: 0; }
.icon-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 0;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#d-star.on { color: #f59e0b; background: var(--amber-soft); }
#d-star.on svg { fill: #fbbf24; stroke: #d97706; }

.drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 18px 30px;
}

.loc-box {
  border: 1px solid #d9e6ff;
  background: linear-gradient(135deg, #f2f7ff 0%, #fbfdff 70%);
  border-radius: 11px;
  padding: 12px 13px;
  margin-bottom: 16px;
}
.loc-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}
.loc-box-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-ink);
  letter-spacing: .3px;
}
.loc-copy {
  border: 1px solid #c9dcfb;
  background: #fff;
  color: var(--primary);
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 5px;
}
.loc-copy:hover { background: var(--primary-soft); }
.loc-line {
  display: flex;
  gap: 8px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-2);
}
.loc-line + .loc-line { margin-top: 3px; }
.loc-line .k { color: var(--faint); flex-shrink: 0; min-width: 58px; }
.loc-line .v { font-weight: 500; word-break: break-all; }
.loc-line .v b { color: var(--red); font-variant-numeric: tabular-nums; }

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 16px;
}
.tag {
  font-size: 10.5px;
  padding: 2.5px 7px;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--text-2);
}
.tag.blue { background: var(--primary-soft); color: var(--primary-ink); }
.tag.amber { background: #fff7ed; color: #c2410c; }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.red { background: var(--red-soft); color: var(--red); font-weight: 600; }

.detail-section { margin-top: 20px; }
.detail-section:first-of-type { margin-top: 0; }
.detail-section h3 {
  margin: 0 0 9px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .6px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.detail-section h3::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.kv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
}
.kv { min-width: 0; }
.kv.full { grid-column: 1 / -1; }
.kv dt {
  font-size: 10.5px;
  color: var(--faint);
  margin-bottom: 2px;
}
.kv dd {
  margin: 0;
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.55;
  word-break: break-word;
}
.kv dd.num { font-variant-numeric: tabular-nums; }
.kv dd.strong, .kv.strong dd { font-weight: 700; color: var(--primary); font-size: 14px; }

.req-judge { display: flex; flex-direction: column; gap: 7px; }
.req-judge-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--surface-2);
}
.req-judge-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.req-judge-name { font-size: 12px; font-weight: 600; color: var(--text-2); min-width: 78px; }
.req-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  line-height: 16px;
}
.req-required { background: var(--red-soft); color: var(--red); }
.req-unrestricted { background: var(--green-soft); color: var(--green); }
.req-unknown { background: var(--surface-3); color: var(--muted); }
.req-ev { margin-top: 5px; font-size: 11px; line-height: 1.6; color: var(--muted); }
.req-warn { margin-top: 4px; font-size: 10.5px; color: var(--amber); }

.text-block mark,
.req-ev mark { background: #fef3c7; color: #92400e; border-radius: 2px; padding: 0 1px; }

.text-block {
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 12px;
}
.text-block.mono { font-size: 12px; }

.contact-list { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.contact-list a { color: var(--primary); word-break: break-all; text-decoration: none; }
.contact-list a:hover { text-decoration: underline; }
.contact-row { display: flex; gap: 8px; }
.contact-row .k { color: var(--faint); min-width: 62px; flex-shrink: 0; font-size: 11px; line-height: 1.7; }
.contact-row .v { word-break: break-all; }

.drawer-foot {
  flex-shrink: 0;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 16px calc(env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.drawer-foot .btn { height: 32px; font-size: 12px; }
.drawer-foot .btn:disabled { opacity: .4; cursor: default; }
.drawer-pos {
  font-size: 10.5px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  text-align: center;
  flex: 1;
}

/* ---------- 弹窗 ---------- */
.modal-scrim {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .42);
  z-index: 90;
  animation: fadeIn .16s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } }

.modal {
  position: fixed;
  z-index: 91;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 28px));
  max-height: min(86vh, 760px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
  animation: pop .18s cubic-bezier(.2, .8, .3, 1);
  overflow: hidden;
}
@keyframes pop {
  from { opacity: 0; transform: translate(-50%, -48%) scale(.985); }
}
.modal-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.modal-head h2 { margin: 0; font-size: 15px; font-weight: 700; }
.modal-count { font-size: 11px; font-weight: 500; color: var(--primary); margin-left: 4px; }
.modal-body { padding: 14px 16px 16px; overflow-y: auto; }
.modal-foot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}

.sheet-options {
  display: grid;
  gap: 6px;
  margin: 10px 0 14px;
}
.sheet-option {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px 10px;
  text-align: left;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text-2);
  font-size: 12.5px;
  transition: border-color .12s, background .12s;
}
.sheet-option small {
  grid-column: 1 / -1;
  font-size: 10px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.sheet-option em {
  font-style: normal;
  font-size: 10.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.sheet-option:hover { border-color: var(--line-2); background: var(--surface-2); }
.sheet-option.on {
  border-color: #93b4f5;
  background: var(--primary-soft);
  color: var(--primary-ink);
}
.sheet-option.on em { color: var(--primary); font-weight: 600; }

.locate-form {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}
.locate-form .input { flex: 1; height: 36px; }
.locate-form .seg { flex-shrink: 0; }
.locate-form .btn { height: 36px; padding: 0 16px; }
.locate-range { margin: 7px 0 0; font-size: 10.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
#locate-error { margin-top: 8px; }

.dept-modal { width: min(620px, calc(100vw - 28px)); }
.dept-body { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.dept-search { position: relative; flex-shrink: 0; }
.dept-search .icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
}
.dept-search .input { padding-left: 32px; height: 36px; }
.dept-list {
  overflow-y: auto;
  min-height: 220px;
  max-height: 52vh;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 4px;
  background: var(--surface-2);
}
.dept-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-2);
  cursor: pointer;
}
.dept-item:hover { background: #fff; }
.dept-item input { accent-color: var(--primary); width: 14px; height: 14px; margin: 0; flex-shrink: 0; }
.dept-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dept-item .cnt { font-size: 10px; color: var(--faint); font-variant-numeric: tabular-nums; }
.dept-item.checked { background: var(--primary-soft); color: var(--primary-ink); }
.dept-empty { padding: 26px; text-align: center; font-size: 12px; color: var(--faint); }

/* ---------- 加载 / 提示 ---------- */
.boot {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: var(--bg);
  padding: 24px;
  transition: opacity .25s;
}
.boot.hide { opacity: 0; pointer-events: none; }
.boot-card {
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 30px 26px;
  box-shadow: var(--shadow);
}
.boot-card .logo { margin-bottom: 4px; }
.boot-card h2 { margin: 4px 0 0; font-size: 16px; font-weight: 700; }
.boot-card p { margin: 0; font-size: 11.5px; color: var(--muted); }
.spinner {
  width: 22px;
  height: 22px;
  margin-top: 10px;
  border: 2.5px solid #dbe4f3;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.boot-error {
  width: 100%;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 11.5px;
  line-height: 1.7;
  text-align: left;
  word-break: break-word;
}
.boot-error code {
  display: block;
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 5px;
  background: #fff;
  color: var(--text-2);
  font-size: 11px;
  user-select: all;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px);
  z-index: 300;
  max-width: min(520px, calc(100vw - 32px));
  padding: 9px 15px;
  border-radius: 9px;
  background: rgba(15, 23, 42, .92);
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  box-shadow: 0 8px 26px rgba(15, 23, 42, .3);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s, transform .18s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
body.drawer-open .toast { bottom: 74px; }

/* ---------- 滚动条 ---------- */
.sidebar-scroll::-webkit-scrollbar,
.list-viewport::-webkit-scrollbar,
.drawer-body::-webkit-scrollbar,
.dept-list::-webkit-scrollbar,
.active-filters::-webkit-scrollbar,
.modal-body::-webkit-scrollbar { width: 9px; height: 9px; }
.sidebar-scroll::-webkit-scrollbar-thumb,
.list-viewport::-webkit-scrollbar-thumb,
.drawer-body::-webkit-scrollbar-thumb,
.dept-list::-webkit-scrollbar-thumb,
.active-filters::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
}
.sidebar-scroll::-webkit-scrollbar-thumb:hover,
.list-viewport::-webkit-scrollbar-thumb:hover { background: #94a3b8; background-clip: content-box; }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  :root { --sidebar-w: 292px; }
  .brand-text h1 { font-size: 15px; }
  .topbar { gap: 14px; padding: 0 16px; }
}

@media (max-width: 1024px) {
  :root { --row-h: 124px; --topbar-h: auto; }

  .topbar {
    flex-wrap: wrap;
    height: auto;
    padding: 9px 14px;
    gap: 8px 10px;
  }
  .brand { order: 1; }
  .brand-text h1 { font-size: 15.5px; }
  .brand-text p { display: none; }
  .topbar-actions { order: 2; margin-left: auto; gap: 2px; }
  .searchbox { order: 3; flex-basis: 100%; max-width: none; height: 38px; }
  .searchbox kbd { display: none; }
  .topbar-actions .btn { padding: 0 8px; }

  .app-body { position: relative; }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 76;
    width: min(88vw, 372px);
    background: var(--surface-2);
    transform: translateX(-103%);
    transition: transform .24s cubic-bezier(.32, .72, .32, 1), visibility 0s linear .24s;
    box-shadow: 14px 0 40px rgba(15, 23, 42, .18);
    visibility: hidden;
  }
  .sidebar.open {
    transform: none;
    visibility: visible;
    transition: transform .24s cubic-bezier(.32, .72, .32, 1), visibility 0s;
  }
  .sidebar-head { height: 52px; }
  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 75;
    background: rgba(15, 23, 42, .4);
    animation: fadeIn .18s;
  }
  .mobile-only { display: inline-flex !important; }
  .sidebar-foot.mobile-only { display: block !important; }

  .main { width: 100%; }
  .result-head { padding: 8px 14px; min-height: 56px; }
  .active-filters { padding: 7px 14px; max-height: 74px; }
  .card-slot { padding: 5px 12px; }
  .card { grid-template-columns: 76px minmax(0, 1fr) 32px; gap: 9px; padding: 8px 10px; }
  .card-title { font-size: 14px; }
  .drawer { width: 100%; }
}

@media (max-width: 640px) {
  :root { --row-h: 124px; }

  .brand-text h1 { font-size: 14.5px; letter-spacing: 0; }
  .logo { width: 34px; height: 34px; font-size: 17px; border-radius: 9px; }
  .btn-label { display: none; }
  .topbar-actions .btn { height: 32px; }
  .count-badge { position: static; }

  .result-head { gap: 8px; }
  .stats-main { font-size: 12.5px; }
  .stats-sub { font-size: 10.5px; }
  .checksum { display: none; }
  .select.compact { min-width: 108px; height: 30px; font-size: 11px; padding: 0 4px; }
  .result-tools { gap: 4px; }

  .card { grid-template-columns: 64px minmax(0, 1fr) 30px; gap: 7px; padding: 8px 8px; border-radius: 9px; }
  .card-loc { padding-right: 5px; }
  .loc-sheet { font-size: 9px; }
  .loc-num { font-size: 10px; }
  .loc-num b { font-size: 12px; }
  .card-title { font-size: 13.5px; }
  .hire { display: none; }
  .hire-meta { display: inline-flex !important; color: var(--green); font-weight: 600; }
  .meta-exam, .meta-level { display: none; }
  .card-sub { font-size: 10.5px; }
  .card-meta { font-size: 10px; }
  .req-row { grid-template-columns: 74px minmax(0, 1fr); }
  .req-name { font-size: 10px; }
  .req-select { font-size: 10.5px; }
  .card-major { font-size: 10.5px; }
  .meta-item + .meta-item::before { margin: 0 4px; }
  .star-btn { width: 28px; height: 28px; }
  .star-btn svg { width: 15px; height: 15px; }

  .drawer-head { padding: 13px 14px 12px; }
  .drawer-head h2 { font-size: 15.5px; }
  .drawer-body { padding: 14px 14px 26px; }
  .kv-grid { grid-template-columns: 1fr 1fr; gap: 9px 14px; }
  .drawer-foot { padding: 0 10px env(safe-area-inset-bottom); }
  .drawer-foot .btn { font-size: 11.5px; padding: 0 8px; }

  .modal { width: calc(100vw - 16px); max-height: 90vh; }
  .modal-head { padding: 12px 14px; }
  .modal-body { padding: 12px 14px 14px; }
  .sheet-option { font-size: 11.5px; }
  .locate-form { flex-wrap: wrap; }
  .locate-form .seg { flex-basis: 100%; order: 1; }
  .locate-form .seg button { flex: 1; }
  .locate-form .input { flex: 1; order: 2; }
  .locate-form .btn { order: 3; }
  .dept-list { max-height: 48vh; }
  .active-filters { max-height: 66px; }
  .filter-chip { font-size: 10px; }
  .toast { bottom: 18px; font-size: 11.5px; }
}

@media (max-width: 380px) {
  .stat-people { display: none; }
  .brand-text h1 { font-size: 13.5px; }
  .topbar { padding: 8px 10px; }
  .result-head { padding: 7px 10px; }
  .card-slot { padding: 4px 8px; }
  .stats-sub { display: none; }
  .select.compact { min-width: 96px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- 专业目录树 ---------- */
.major-path {
  margin: 0;
  font-size: 10px;
  line-height: 1.55;
  color: var(--primary-ink);
  word-break: break-all;
}
.major-path:empty { display: none; }

.major-tree {
  max-height: 52vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
  background: #fff;
}
.major-tree details.mnode { margin: 1px 0; }
.major-tree summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-2);
  user-select: none;
}
.major-tree summary::-webkit-details-marker { display: none; }
.major-tree summary:hover { background: var(--surface-2); }
.major-tree summary::before {
  content: "";
  width: 5px;
  height: 5px;
  flex-shrink: 0;
  border-right: 1.5px solid var(--faint);
  border-bottom: 1.5px solid var(--faint);
  transform: rotate(-45deg);
  transition: transform .15s;
}
.major-tree details[open] > summary::before { transform: rotate(45deg); }
.major-tree .mchildren { padding-left: 13px; }
.major-tree .mname {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.major-tree .mtag {
  flex-shrink: 0;
  font-size: 9px;
  line-height: 14px;
  padding: 0 4px;
  border-radius: 3px;
  background: var(--surface-3);
  color: var(--muted);
  white-space: nowrap;
}
.major-tree .mcount {
  flex-shrink: 0;
  min-width: 32px;
  text-align: right;
  font-size: 9.5px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.major-tree .mleaf {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 6px 6px 16px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}
.major-tree .mleaf:hover { background: var(--surface-2); }
.major-tree .mleaf.selected {
  background: var(--primary-soft);
  color: var(--primary-ink);
  font-weight: 600;
}
.major-tree .mleaf .mname { padding-left: 0; }

.major-results {
  max-height: 52vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
  background: #fff;
}
.major-result {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.major-result:hover { background: var(--surface-2); }
.major-result.selected { background: var(--primary-soft); color: var(--primary-ink); }
.major-result .mr-main { flex: 1; min-width: 0; }
.major-result .mr-name { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.major-result .mr-path {
  margin-top: 2px;
  font-size: 9.5px;
  color: var(--faint);
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.major-result.selected .mr-path { color: var(--primary-ink); opacity: .75; }
.major-result .mr-count {
  flex-shrink: 0;
  font-size: 10px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}

.major-foot { align-items: center; gap: 10px; }
.major-selected {
  flex: 1;
  min-width: 0;
  font-size: 10px;
  color: var(--faint);
  line-height: 1.5;
}
.major-selected b { display: block; color: var(--text); font-size: 11px; }
.major-selected span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.major-foot-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

@media (max-width: 640px) {
  .major-tree, .major-results { max-height: calc(100vh - 330px); }
  .major-tree .mleaf { font-size: 12.5px; padding-top: 7px; padding-bottom: 7px; }
  .major-result .mr-name { font-size: 12.5px; }
  .major-foot { flex-wrap: wrap; }
  .major-selected { flex-basis: 100%; }
  .major-foot-actions { width: 100%; justify-content: flex-end; }
}

.major-parse {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: -2px 0 10px;
  font-size: 10px;
  line-height: 1.6;
  color: var(--faint);
}
.major-parse .k { flex-shrink: 0; color: var(--muted); }
.major-parse .v { display: flex; flex-wrap: wrap; gap: 4px; }
.major-parse .tag { white-space: nowrap; }
.major-parse .muted { color: var(--faint); }

/* ---------- 省份下的城市 ---------- */
.city-wrap {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px dashed var(--line);
}
.city-wrap .sub-label { margin: 0 0 5px; }
.city-group-label {
  margin: 6px 0 3px;
  color: var(--faint);
  font-size: 9.5px;
}
.city-group-label:first-child { margin-top: 0; }
.city-pills { gap: 4px; }
.city-pills .pill {
  font-size: 10px;
  padding: 4px 6px;
}
.city-pills .pill .n { margin-left: 3px; }
.city-pills .pill.zero {
  opacity: .48;
  cursor: not-allowed;
}

/* x/y 选项计数 */
.pill em { white-space: nowrap; }
.major-tree .mcount { min-width: 54px; }
.major-result .mr-count { white-space: nowrap; }

.filter-legend {
  margin: 0 0 2px;
  padding: 0 2px;
  color: var(--faint);
  font-size: 9.5px;
  line-height: 1.5;
}
