/* Risk Policy Workspace · 应用外壳（导航、工具栏、设置、登录、弹窗、动效）
   2026-09-29 界面改版。表格与数据标记在 style.css，这一层不给单元格重新上色。
   设计取向：企业数据平台的克制 —— 中性灰蓝、单一强调色、清晰的层次与边线，
   动效短促（120–240ms）、只用于反馈，不做装饰性动画。 */

:root {
  --ui-bg: #f4f6f9;
  --ui-bg-deep: #eceff4;
  --ui-surface: #ffffff;
  --ui-surface-2: #f8fafc;
  --ui-ink: #16202c;
  --ui-secondary: #4d5b6c;
  --ui-muted: #7c8797;
  --ui-faint: #a6afbb;
  --ui-border: #e3e8ef;
  --ui-border-strong: #cdd5df;
  --ui-blue: #1e56b8;
  --ui-blue-hover: #174a9f;
  --ui-blue-soft: #e9f0fb;
  --ui-blue-ring: rgba(30, 86, 184, .28);
  --ui-ok: #1f7a5c;
  --ui-ok-soft: #e8f5ef;
  --ui-warn: #8a6428;
  --ui-warn-soft: #fbf4e8;
  --ui-danger: #b8402c;
  --ui-danger-soft: #fdf0ed;
  --ui-shadow-1: 0 1px 2px rgba(22, 32, 44, .05);
  --ui-shadow-2: 0 4px 14px -6px rgba(22, 32, 44, .12), 0 1px 3px rgba(22, 32, 44, .06);
  --ui-shadow-3: 0 24px 64px -24px rgba(22, 32, 44, .32), 0 4px 12px rgba(22, 32, 44, .08);
  --ui-radius-sm: 6px;
  --ui-radius: 10px;
  --ui-radius-lg: 14px;
  --ui-ease: cubic-bezier(.2, .7, .2, 1);
  --ui-fast: 120ms;
  --ui-base: 200ms;
  --ui-sidebar-width: 224px;
  --ui-mono: "SF Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, "JetBrains Mono", monospace;
}

body[data-theme="dark"] {
  color-scheme: dark;
  --ui-bg: #0f1620;
  --ui-bg-deep: #0b1119;
  --ui-surface: #161e2a;
  --ui-surface-2: #1b2532;
  --ui-ink: #e6ecf5;
  --ui-secondary: #aab6c6;
  --ui-muted: #7f8ca0;
  --ui-faint: #5d6a7d;
  --ui-border: #243040;
  --ui-border-strong: #33425a;
  --ui-blue: #7fa6ef;
  --ui-blue-hover: #9dbcf5;
  --ui-blue-soft: rgba(127, 166, 239, .14);
  --ui-blue-ring: rgba(127, 166, 239, .35);
  --ui-ok: #62b894;
  --ui-ok-soft: rgba(98, 184, 148, .14);
  --ui-warn: #d9a75a;
  --ui-warn-soft: rgba(217, 167, 90, .14);
  --ui-danger: #ef8a78;
  --ui-danger-soft: rgba(239, 138, 120, .14);
  --ui-shadow-1: 0 1px 2px rgba(0, 0, 0, .3);
  --ui-shadow-2: 0 4px 14px -6px rgba(0, 0, 0, .5), 0 1px 3px rgba(0, 0, 0, .3);
  --ui-shadow-3: 0 24px 64px -24px rgba(0, 0, 0, .7), 0 4px 12px rgba(0, 0, 0, .35);
}

/* ---------- 基础 ---------- */

html { overflow: hidden; }
body {
  display: block;
  width: 100%;
  min-width: 320px;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  color: var(--ui-ink);
  background: var(--ui-bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}

[hidden] { display: none !important; }
button, input, select { font-family: inherit; }
button, a, input { touch-action: manipulation; }
a { color: var(--ui-blue); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--ui-blue);
  outline-offset: 2px;
}
button:disabled { cursor: not-allowed; }
svg { flex-shrink: 0; }
[data-icon] { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; line-height: 1; }
[data-icon] > svg { display: block; width: 16px; height: 16px; }
kbd {
  display: inline-block;
  padding: 0 5px;
  font-family: var(--ui-mono);
  font-size: 10px;
  line-height: 16px;
  color: var(--ui-muted);
  background: var(--ui-surface);
  border: 1px solid var(--ui-border-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
}

/* ---------- 布局 ---------- */

.workspace-shell {
  display: grid;
  grid-template-columns: var(--ui-sidebar-width) minmax(0, 1fr);
  height: 100%;
  overflow: hidden;
}

/* 侧栏 */
.workspace-sidebar {
  position: relative;
  z-index: 45;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 20px 12px 16px;
  background: var(--ui-surface);
  border-right: 1px solid var(--ui-border);
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; text-decoration: none; }
.brand-symbol, .launch-symbol {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background: linear-gradient(150deg, #3d78d8 0%, #1e56b8 60%, #16418c 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), var(--ui-shadow-1);
}
.brand-symbol { width: 36px; height: 36px; border-radius: 10px; }
.brand-symbol svg { width: 22px; height: 22px; }
.brand-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.brand-copy strong { color: var(--ui-ink); font-size: 14px; letter-spacing: .02em; font-weight: 650; white-space: nowrap; }
.brand-copy small { color: var(--ui-muted); font-size: 9.5px; letter-spacing: .14em; }
.nav-group-label { margin: 0 12px 6px; color: var(--ui-faint); font-size: 10.5px; font-weight: 600; letter-spacing: .1em; }
.workspace-sidebar nav { display: grid; gap: 2px; }
.workspace-sidebar a[data-route] {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 7px 10px;
  color: var(--ui-secondary);
  border-radius: var(--ui-radius-sm);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background var(--ui-fast), color var(--ui-fast);
}
.workspace-sidebar a[data-route]:hover { color: var(--ui-ink); background: var(--ui-surface-2); }
.workspace-sidebar a[data-route]:active { background: var(--ui-bg-deep); }
.workspace-sidebar a[data-route][aria-current="page"], .workspace-sidebar a[data-route].is-active {
  color: var(--ui-blue);
  background: var(--ui-blue-soft);
  font-weight: 600;
}
.workspace-sidebar a[data-route][aria-current="page"]::before, .workspace-sidebar a[data-route].is-active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--ui-blue);
}
.nav-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  color: var(--ui-muted);
  transition: color var(--ui-fast);
}
.nav-icon svg { width: 17px; height: 17px; }
[aria-current="page"] > .nav-icon, .is-active > .nav-icon { color: var(--ui-blue); }
.sidebar-footer { margin: auto 4px 0; padding-top: 18px; color: var(--ui-muted); font-size: 11px; line-height: 1.6; }
.sidebar-footer p { margin: 8px 0 0; color: var(--ui-faint); font-size: 10.5px; }
.sidebar-meta { display: flex; flex-direction: column; gap: 3px; padding: 9px 10px; background: var(--ui-surface-2); border: 1px solid var(--ui-border); border-radius: var(--ui-radius-sm); font-size: 11px; }
.sidebar-meta-row { display: flex; align-items: center; gap: 6px; color: var(--ui-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-meta-row:empty { display: none; }
#sidebar-updated { color: var(--ui-muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.meta-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ui-ok); box-shadow: 0 0 0 3px var(--ui-ok-soft); }

/* 主区域 */
.workspace-stage { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
#data-main { display: flex; flex-direction: column; flex: 1 1 0; min-width: 0; min-height: 0; overflow: hidden; }
.workspace-topbar {
  position: relative;
  z-index: 35;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: 0 0 auto;
  min-height: 52px;
  padding: 8px 28px;
  background: var(--ui-surface);
  border-bottom: 1px solid var(--ui-border);
}
.welcome-line { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--ui-muted); font-size: 12px; white-space: nowrap; overflow: hidden; }
.welcome-line #crumb-page { color: var(--ui-ink); font-weight: 500; }
.crumb-sep { color: var(--ui-faint); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-search-hint {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 4px 8px 4px 10px;
  color: var(--ui-muted);
  background: var(--ui-surface-2);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: border-color var(--ui-fast), color var(--ui-fast), background var(--ui-fast);
}
.topbar-search-hint:hover { color: var(--ui-ink); border-color: var(--ui-border-strong); background: var(--ui-surface); }
.topbar-search-hint [data-icon] > svg { width: 14px; height: 14px; }
.identity-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 3px 8px 3px 4px;
  color: var(--ui-ink);
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: 20px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  transition: border-color var(--ui-fast), background var(--ui-fast), box-shadow var(--ui-fast);
}
.identity-button:hover { border-color: var(--ui-border-strong); box-shadow: var(--ui-shadow-1); }
.identity-button:active { background: var(--ui-surface-2); }
.identity-avatar { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: var(--ui-blue); background: var(--ui-blue-soft); }
.identity-avatar svg { width: 14px; height: 14px; }
.identity-chevron { color: var(--ui-faint); }
.identity-chevron svg { width: 13px; height: 13px; }

.view-pane { flex: 1 1 0; min-height: 0; min-width: 0; padding: 18px 28px 0; overflow: auto; scrollbar-gutter: stable; }
.view-pane.is-entering { animation: workspace-enter var(--ui-base) var(--ui-ease) both; }
.view-pane.is-leaving { animation: workspace-leave 110ms ease-out both; pointer-events: none; }
@keyframes workspace-enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes workspace-leave { from { opacity: 1; } to { opacity: 0; } }

.workspace-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex: 0 0 auto; margin: 0 0 14px; }
.heading-copy { min-width: 0; }
.eyebrow { margin: 0 0 6px; color: var(--ui-muted); font-size: 10px; font-weight: 650; letter-spacing: .16em; text-transform: uppercase; }
.workspace-heading h1 { margin: 0; color: var(--ui-ink); font-size: 21px; line-height: 1.3; font-weight: 650; letter-spacing: -.01em; }
.workspace-heading p:not(.eyebrow), .page-lede { margin: 3px 0 0; color: var(--ui-muted); font-size: 12.5px; line-height: 1.6; }

/* ---------- 数据工作台 ---------- */

#data-view { display: flex; flex-direction: column; overflow: hidden; scrollbar-gutter: auto; }
.data-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
  box-shadow: var(--ui-shadow-2);
  overflow: hidden;
}
.data-toolbar {
  position: relative;
  z-index: 33;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-height: 54px;
  padding: 10px 12px 10px 12px;
  background: var(--ui-surface);
  border-bottom: 1px solid var(--ui-border);
}
.data-toolbar .search-field { position: relative; display: flex; align-items: center; flex: 0 1 300px; min-width: 140px; }
.data-toolbar .search-icon { position: absolute; left: 11px; color: var(--ui-muted); pointer-events: none; }
#search {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 6px 32px 6px 32px;
  color: var(--ui-ink);
  background: var(--ui-surface-2);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-sm);
  font: inherit;
  font-size: 13px;
  outline: none;
  -webkit-appearance: none;
  transition: background var(--ui-fast), border-color var(--ui-fast), box-shadow var(--ui-fast);
}
#search::-webkit-search-cancel-button, #search::-webkit-search-decoration { -webkit-appearance: none; display: none; }
#search::placeholder { color: var(--ui-muted); }
#search:hover { border-color: var(--ui-border-strong); }
#search:focus { background: var(--ui-surface); border-color: var(--ui-blue); box-shadow: 0 0 0 3px var(--ui-blue-ring); }
#search:disabled { opacity: .6; }
.search-clear {
  position: absolute;
  right: 5px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  color: var(--ui-muted);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: background var(--ui-fast), color var(--ui-fast);
}
.search-clear:hover { color: var(--ui-ink); background: var(--ui-border); }
.search-clear svg { width: 13px; height: 13px; }

.toolbar-status { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; font-size: 12px; color: var(--ui-muted); overflow: hidden; }
.toolbar-status .stat { color: var(--ui-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.toolbar-status #status-updated { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.toolbar-status #status-rows, .toolbar-status .badge { flex: 0 0 auto; }
.toolbar-status .stat + .stat::before {
  content: "";
  display: inline-block;
  width: 1px;
  height: 11px;
  margin-right: 10px;
  vertical-align: -1px;
  background: var(--ui-border-strong);
}
.badge {
  padding: 2px 8px;
  color: var(--ui-warn);
  background: var(--ui-warn-soft);
  border: 1px solid transparent;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: .02em;
}
.badge.live { color: var(--ui-ok); background: var(--ui-ok-soft); }
.sort-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 24px;
  padding: 2px 6px 2px 9px;
  color: var(--ui-blue);
  background: var(--ui-blue-soft);
  border: 1px solid transparent;
  border-radius: 20px;
  font: inherit;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  animation: chip-in var(--ui-base) var(--ui-ease);
  transition: background var(--ui-fast), border-color var(--ui-fast);
}
.sort-chip:hover { border-color: var(--ui-blue-ring); }
.sort-chip #sort-chip-label { overflow: hidden; text-overflow: ellipsis; }
.sort-chip-reset { padding: 0 6px; border-left: 1px solid var(--ui-blue-ring); color: var(--ui-blue); font-weight: 600; }
@keyframes chip-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

.toolbar-actions { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  margin: 0;
  padding: 6px 11px;
  color: var(--ui-secondary);
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-sm);
  box-shadow: none;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--ui-fast), border-color var(--ui-fast), color var(--ui-fast), transform var(--ui-fast);
}
.btn:hover { color: var(--ui-ink); border-color: var(--ui-border-strong); background: var(--ui-surface-2); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--ui-surface-2); border-color: transparent; }
.legend-btn.on { color: var(--ui-blue); background: var(--ui-blue-soft); }

.legend-pop {
  position: absolute;
  top: calc(100% + 6px);
  right: 10px;
  z-index: 50;
  min-width: 300px;
  max-width: calc(100vw - 30px);
  padding: 12px 14px 10px;
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow-3);
  animation: pop-in 160ms var(--ui-ease);
  color: var(--ui-secondary);
}
.legend-title { margin: 0 0 6px; color: var(--ui-muted); font-size: 10.5px; font-weight: 650; letter-spacing: .08em; }
.legend-row { display: flex; align-items: center; gap: 9px; padding: 4px 0; font-size: 12px; color: var(--ui-secondary); }
.legend-foot { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--ui-border); font-size: 11.5px; line-height: 1.6; color: var(--ui-muted); }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px) scale(.985); } to { opacity: 1; transform: none; } }

/* 所属等级筛选条：一排可多选的小胶囊 */
.tier-filter { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; flex: 0 0 auto; min-height: 40px; padding: 6px 12px; background: var(--ui-surface); border-bottom: 1px solid var(--ui-border); }
.tier-filter:empty { display: none; }
.tier-filter-label { margin-right: 2px; color: var(--ui-muted); font-size: 11.5px; font-weight: 600; letter-spacing: .04em; }
.tier-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 2px 9px 2px 8px;
  color: var(--ui-secondary);
  background: var(--ui-surface-2);
  border: 1px solid var(--ui-border);
  border-radius: 20px;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--ui-fast), border-color var(--ui-fast), color var(--ui-fast), transform var(--ui-fast);
}
.tier-chip:hover { color: var(--ui-ink); border-color: var(--ui-border-strong); background: var(--ui-surface); }
.tier-chip:active { transform: scale(.97); }
.tier-chip.on { color: var(--ui-blue); background: var(--ui-blue-soft); border-color: var(--ui-blue-ring); font-weight: 600; }
.tier-chip-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ui-border-strong); }
.tier-chip[data-tier="一级分行"] .tier-chip-dot { background: #1E5AA8; }
.tier-chip[data-tier="二级分行"] .tier-chip-dot { background: #7C8797; }
.tier-chip[data-tier="县域支行"] .tier-chip-dot { background: #1F7A5C; }
.tier-chip-count { padding: 0 5px; border-radius: 9px; background: rgba(120, 135, 155, .14); color: var(--ui-muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.tier-chip.on .tier-chip-count { color: var(--ui-blue); background: rgba(30, 86, 184, .12); }
body[data-theme="dark"] .tier-chip.on .tier-chip-count { background: rgba(127, 166, 239, .18); }

/* 数据说明行：一行摘要，可展开看全文 */
.statusbar { display: flex; align-items: stretch; flex: 0 0 auto; min-height: 0; background: var(--ui-warn-soft); border-bottom: 1px solid var(--ui-border); }
.notice {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 6px 12px;
  color: var(--ui-warn);
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition: background var(--ui-fast);
}
.notice:hover { background: rgba(138, 100, 40, .06); }
body[data-theme="dark"] .notice:hover { background: rgba(217, 167, 90, .08); }
.notice-icon { color: inherit; opacity: .8; }
.notice-icon svg { width: 14px; height: 14px; }
.notice-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-toggle { flex: 0 0 auto; padding: 1px 7px; border: 1px solid currentColor; border-radius: 12px; font-size: 10.5px; opacity: .8; }
.notice.on { align-items: flex-start; padding-top: 8px; padding-bottom: 9px; }
.notice.on .notice-icon { margin-top: 2px; }
.notice.on .notice-text { white-space: normal; line-height: 1.75; animation: panel-in var(--ui-base) var(--ui-ease); }
@keyframes panel-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.sheet-wrap {
  position: relative;
  min-height: 120px;
  min-width: 0;
  isolation: isolate;
  flex: 1 1 0;
  overflow: auto;
  color-scheme: light;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #b9c5d6 #f3f5f8;
  -webkit-overflow-scrolling: touch;
}
.sheet-wrap::-webkit-scrollbar { width: 10px; height: 10px; }
.sheet-wrap::-webkit-scrollbar-track { background: #f3f5f8; }
.sheet-wrap::-webkit-scrollbar-thumb { background: #c4cfde; border: 2px solid #f3f5f8; border-radius: 8px; }
.sheet-wrap::-webkit-scrollbar-thumb:hover { background: #a9b7cb; }
.sheet { color-scheme: light; }
/* Row density is presentation only. State backgrounds, borders and labels stay intact. */
body[data-density="compact"] .sheet tbody td { padding-top: 5px; padding-bottom: 5px; font-size: 13px; }
body[data-density="compact"] .sheet td.num { font-size: 12.5px; }

.workspace-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: 0 0 auto; min-height: 34px; padding: 8px 2px; color: var(--ui-muted); font-size: 11px; line-height: 1.5; }
.workspace-footer p { margin: 0; }
.workspace-footer span { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.workspace-footer .footer-hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-footer svg { width: 12px; height: 12px; }

.tip { color-scheme: light; }
.tip:not([hidden]) { animation: tooltip-enter 140ms var(--ui-ease); }
.tip.is-above:not([hidden]) { animation-name: tooltip-enter-up; }
@keyframes tooltip-enter { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
@keyframes tooltip-enter-up { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.table-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 230px; padding: 40px 25px; color: #62748e; background: #fff; font-size: 12.5px; text-align: center; }
.table-loading p { max-width: 390px; margin: 0; line-height: 1.8; }
.table-loading .loading-title { color: #273d5d; font-size: 14px; font-weight: 600; }
.skeleton-line { display: block; width: min(310px, 80%); height: 10px; border-radius: 5px; background: linear-gradient(90deg, #eef1f6 0%, #e2e7ee 50%, #eef1f6 100%); background-size: 200% 100%; animation: skeleton-shimmer 1.2s ease-in-out infinite; }
.skeleton-line:nth-child(2) { width: min(260px, 67%); animation-delay: 120ms; }
.skeleton-line:nth-child(3) { width: min(200px, 52%); animation-delay: 240ms; }
@keyframes skeleton-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- 设置 ---------- */

.settings-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, 1fr); align-items: start; gap: 16px; max-width: 1080px; padding-bottom: 24px; }
.settings-group { min-width: 0; overflow: hidden; color: var(--ui-ink); background: var(--ui-surface); border: 1px solid var(--ui-border); border-radius: var(--ui-radius-lg); box-shadow: var(--ui-shadow-1); }
.settings-group > h2, .settings-group > h3, .settings-group-title { margin: 0; padding: 14px 18px 8px; color: var(--ui-muted); font-size: 11px; font-weight: 650; letter-spacing: .08em; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; position: relative; min-height: 64px; margin: 0 18px; padding: 13px 0; border-bottom: 1px solid var(--ui-border); }
.setting-row:last-child { border-bottom: 0; }
.setting-copy { flex: 1 1 auto; min-width: 0; }
.setting-title { display: block; margin: 0 0 2px; color: var(--ui-ink); font-size: 13px; font-weight: 600; }
.setting-note { display: block; margin: 0; color: var(--ui-muted); font-size: 11.5px; line-height: 1.6; overflow-wrap: anywhere; }
.setting-value { color: var(--ui-secondary); font-size: 12px; text-align: right; overflow-wrap: anywhere; }
button.setting-link { width: calc(100% - 36px); border-top: 0; border-right: 0; border-left: 0; border-radius: 0; font: inherit; text-align: left; background: transparent; cursor: pointer; color: inherit; transition: background var(--ui-fast); }
button.setting-link .setting-copy { margin-right: auto; }
button.setting-link:hover .setting-title { color: var(--ui-blue); }
button.setting-link:hover .setting-chevron { color: var(--ui-blue); transform: translateX(2px); }
button.setting-link:focus-visible { outline-offset: -2px; border-radius: var(--ui-radius-sm); }
.setting-chevron { display: inline-flex; color: var(--ui-faint); flex: 0 0 auto; transition: transform var(--ui-fast), color var(--ui-fast); }
.setting-chevron svg { width: 14px; height: 14px; }
.setting-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--ui-blue-soft); color: var(--ui-blue); flex: 0 0 auto; }
.setting-icon svg { width: 17px; height: 17px; }
.segment-control { display: inline-flex; gap: 2px; flex: 0 0 auto; padding: 3px; background: var(--ui-surface-2); border: 1px solid var(--ui-border); border-radius: 8px; }
.segment-control button { min-width: 50px; min-height: 28px; padding: 3px 10px; color: var(--ui-muted); background: transparent; border: 1px solid transparent; border-radius: 6px; font-size: 12px; cursor: pointer; transition: color var(--ui-fast), background var(--ui-fast), box-shadow var(--ui-fast); }
.segment-control button:hover { color: var(--ui-ink); }
.segment-control button[aria-pressed="true"] { color: var(--ui-ink); background: var(--ui-surface); border-color: var(--ui-border); box-shadow: var(--ui-shadow-1); font-weight: 600; }
.preference-switch { position: relative; flex: 0 0 auto; width: 40px; height: 24px; padding: 0; background: var(--ui-border-strong); border: 0; border-radius: 20px; cursor: pointer; transition: background var(--ui-base) var(--ui-ease); }
.preference-switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(22, 32, 44, .3); transition: transform var(--ui-base) var(--ui-ease); }
.preference-switch[aria-checked="true"] { background: var(--ui-blue); }
.preference-switch[aria-checked="true"]::after { transform: translateX(16px); }
.settings-group .primary-button, .settings-group .secondary-button { flex-shrink: 0; }
.settings-footnote { max-width: 780px; padding: 0 2px 24px; color: var(--ui-muted); font-size: 11.5px; line-height: 1.8; }
.id-value { font-family: var(--ui-mono); font-size: 11px; letter-spacing: -.02em; overflow-wrap: anywhere; }

/* ---------- 登录 ---------- */

.login-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); align-items: center; gap: clamp(24px, 4vw, 72px); max-width: 1020px; min-height: min(540px, 72vh); padding: 12px 8px 40px; }
.login-intro { min-width: 0; }
.login-intro .brand-symbol { width: 56px; height: 56px; border-radius: 16px; margin-bottom: 26px; }
.login-intro .brand-symbol svg { width: 34px; height: 34px; }
.login-intro h1, .login-intro h2 { max-width: 530px; margin: 0 0 16px; color: var(--ui-ink); font-size: clamp(26px, 2.8vw, 38px); font-weight: 650; line-height: 1.35; letter-spacing: -.02em; }
.login-intro p { max-width: 400px; color: var(--ui-secondary); font-size: 13.5px; line-height: 1.85; }
.login-intro .eyebrow { color: var(--ui-muted); font-size: 10px; line-height: 1.5; }
.login-card { width: 100%; padding: 28px 28px 24px; border: 1px solid var(--ui-border); border-radius: var(--ui-radius-lg); background: var(--ui-surface); box-shadow: var(--ui-shadow-2); }
.login-card h2 { margin: 0 0 6px; font-size: 19px; font-weight: 650; letter-spacing: -.01em; }
.login-card > p { margin: 0 0 20px; color: var(--ui-muted); font-size: 12.5px; line-height: 1.7; }
.login-card label { display: block; margin: 14px 0 6px; color: var(--ui-secondary); font-size: 12.5px; font-weight: 550; }
.login-card input { display: block; width: 100%; height: 42px; padding: 10px 12px; color: var(--ui-ink); background: var(--ui-surface-2); border: 1px solid var(--ui-border); border-radius: var(--ui-radius-sm); font-size: 14px; transition: border-color var(--ui-fast), background var(--ui-fast), box-shadow var(--ui-fast); }
.login-card input::placeholder { color: var(--ui-muted); font-size: 13px; }
.login-card input:hover { border-color: var(--ui-border-strong); }
.login-card input:focus { outline: none; background: var(--ui-surface); border-color: var(--ui-blue); box-shadow: 0 0 0 3px var(--ui-blue-ring); }
.login-card input:disabled { opacity: .55; cursor: not-allowed; }
.password-field { position: relative; }
.password-field input { padding-right: 46px; }
.password-field > .icon-button { position: absolute; right: 5px; top: 5px; width: 32px; min-height: 32px; background: transparent; }
.login-card .primary-button { width: 100%; margin-top: 20px; min-height: 42px; }
.login-card .secondary-button { width: 100%; margin-top: 10px; }
.login-note { display: flex; align-items: flex-start; gap: 7px; margin: 16px 0 0; color: var(--ui-muted); font-size: 11.5px; line-height: 1.7; }
.login-note svg { margin-top: 2px; width: 14px; height: 14px; }
/* 提示框：没内容就不占位（原版会留一个空灰框） */
.form-message { margin-top: 14px; padding: 10px 12px; color: var(--ui-secondary); background: var(--ui-surface-2); border: 1px solid var(--ui-border); border-radius: var(--ui-radius-sm); font-size: 12.5px; line-height: 1.65; overflow-wrap: anywhere; animation: panel-in var(--ui-base) var(--ui-ease); }
.form-message:empty { display: none; }
.form-message[data-kind="error"] { color: var(--ui-danger); background: var(--ui-danger-soft); border-color: transparent; }
.form-message[data-kind="success"] { color: var(--ui-ok); background: var(--ui-ok-soft); border-color: transparent; }
#signed-in .signed-in-name { margin: 0 0 4px; font-size: 16px; font-weight: 650; color: var(--ui-ink); }
#signed-in .signed-in-id { margin: 0 0 8px; color: var(--ui-muted); }

.primary-button, .secondary-button, .icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: var(--ui-radius-sm);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--ui-fast), background var(--ui-fast), box-shadow var(--ui-fast), border-color var(--ui-fast);
}
.primary-button { color: #fff; background: var(--ui-blue); box-shadow: var(--ui-shadow-1); }
.primary-button:hover { background: var(--ui-blue-hover); }
body[data-theme="dark"] .primary-button { color: #0f1620; }
.secondary-button { color: var(--ui-blue); background: var(--ui-blue-soft); }
.secondary-button:hover { background: var(--ui-blue-ring); }
.icon-button { width: 32px; min-height: 32px; padding: 6px; color: var(--ui-secondary); background: var(--ui-surface-2); border-radius: 50%; }
.icon-button svg { width: 16px; height: 16px; }
.icon-button:hover { color: var(--ui-ink); background: var(--ui-border); }
.primary-button:active, .secondary-button:active, .icon-button:active { transform: scale(.97); }
.primary-button:disabled, .secondary-button:disabled { opacity: .5; box-shadow: none; transform: none; }
.primary-button.is-busy { position: relative; color: transparent; }
.primary-button.is-busy::after { content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 弹窗 ---------- */

#detail-dialog {
  position: fixed;
  width: min(600px, calc(100vw - 40px));
  max-height: min(760px, calc(100dvh - 60px));
  margin: auto;
  padding: 0;
  overflow: auto;
  color: var(--ui-ink);
  background: var(--ui-surface);
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius-lg);
  box-shadow: var(--ui-shadow-3);
}
#detail-dialog[open] { animation: dialog-enter 180ms var(--ui-ease); }
#detail-dialog.is-closing { animation: dialog-leave 140ms ease-out both; }
#detail-dialog::backdrop { background: rgba(16, 24, 36, .42); animation: backdrop-enter 180ms ease-out; }
.dialog-header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 20px 14px; background: var(--ui-surface); border-bottom: 1px solid var(--ui-border); }
.dialog-header h2 { margin: 0; font-size: 16px; font-weight: 650; }
.dialog-body { padding: 18px 20px 22px; color: var(--ui-secondary); font-size: 13px; line-height: 1.75; overflow-wrap: anywhere; }
.dialog-body > :first-child { margin-top: 0; }
.dialog-body > :last-child { margin-bottom: 0; }
.dialog-body h3 { margin: 18px 0 6px; color: var(--ui-muted); font-size: 11px; font-weight: 650; letter-spacing: .08em; }
.dialog-body dl { display: grid; grid-template-columns: minmax(80px, auto) minmax(0, 1fr); gap: 7px 14px; margin: 12px 0 0; }
.dialog-body dt { color: var(--ui-muted); font-size: 12px; }
.dialog-body dd { margin: 0; }
.dialog-body code { color: var(--ui-ink); font-family: var(--ui-mono); font-size: 11.5px; }
.dialog-body .column-title { margin: 0; font-size: 15px; font-weight: 600; color: var(--ui-ink); }
.dialog-body .column-hint, .dialog-body .snapshot-notice { margin: 14px 0 0; padding: 10px 12px; background: var(--ui-surface-2); border-radius: var(--ui-radius-sm); font-size: 12px; line-height: 1.8; color: var(--ui-muted); }
.activity-entry { padding: 14px 0; border-bottom: 1px solid var(--ui-border); }
.activity-entry:first-child { padding-top: 4px; }
.activity-entry:last-child { margin-bottom: 16px; }
.activity-entry strong { color: var(--ui-ink); font-weight: 600; }
.activity-entry p { margin: 3px 0; font-size: 11.5px; color: var(--ui-muted); }
.activity-entry summary { cursor: pointer; color: var(--ui-blue); font-size: 11.5px; }
.activity-list + .secondary-button { margin-top: 6px; }
/* Original provenance cards keep the same data colors in every theme. */
.dialog-body .cell-detail-content { padding: 16px; border: 1px solid #e7dac4; border-radius: var(--ui-radius); color: var(--ink); background: #fffefb; color-scheme: light; }
.dialog-body .cell-detail-content a { color: var(--accent); }
.dialog-body .cell-detail-content .tip-context { margin: -4px -4px 10px; }
.dialog-body .cell-detail-content .tip-head { color: var(--ink); }
.dialog-body .cell-detail-content .tip-meta, .dialog-body .cell-detail-content .tip-facts, .dialog-body .cell-detail-content .tip-calc { color: var(--ink-2); }
.dialog-body .cell-detail-content a.source-link, .dialog-body .source-link { display: inline-flex; align-items: center; margin-top: 16px; gap: 6px; padding: 7px 12px; color: #fff; background: var(--accent); border-radius: var(--ui-radius-sm); font-size: 12.5px; font-weight: 600; text-decoration: none; transition: background var(--ui-fast); }
.dialog-body .cell-detail-content a.source-link:hover, .dialog-body .source-link:hover { background: var(--accent-dark); color: #fff; }
@keyframes dialog-enter { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes dialog-leave { to { opacity: 0; transform: translateY(6px) scale(.99); } }
@keyframes backdrop-enter { from { opacity: 0; } to { opacity: 1; } }

/* ---------- 启动页 / 提示 ---------- */

.launch-screen { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 18px; color: var(--ui-secondary); background: var(--ui-bg); opacity: 1; }
.launch-symbol { width: 56px; height: 56px; border-radius: 16px; animation: launch-breathe 640ms ease-in-out infinite alternate; }
.launch-symbol svg { width: 32px; height: 32px; }
.launch-copy { color: var(--ui-muted); font-size: 12px; letter-spacing: .1em; }
.launch-screen.is-leaving { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 200ms ease-out, visibility 0s 200ms; }
@keyframes launch-breathe { from { opacity: .6; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }
.workspace-mobile-nav { display: none; }
.mobile-table-controls, .mobile-scroll-hint { display: none; }
.toast { position: fixed; left: calc(50% + var(--ui-sidebar-width) / 2); bottom: 22px; z-index: 150; max-width: min(460px, calc(100vw - 32px)); padding: 10px 16px; color: #fff; background: #1f2b3a; border: 1px solid rgba(255, 255, 255, .06); border-radius: var(--ui-radius); box-shadow: var(--ui-shadow-3); font-size: 12.5px; transform: translateX(-50%); }
body[data-theme="dark"] .toast { color: var(--ui-ink); background: var(--ui-surface-2); border-color: var(--ui-border-strong); }
.toast:not([hidden]) { animation: toast-enter 200ms var(--ui-ease); }
@keyframes toast-enter { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- 响应式 ---------- */

@media (min-width: 1700px) { :root { --ui-sidebar-width: 240px; } .workspace-topbar { padding-right: 36px; padding-left: 36px; } .view-pane { padding-right: 36px; padding-left: 36px; } }
@media (max-width: 1150px) {
  :root { --ui-sidebar-width: 196px; }
  .workspace-sidebar { padding-right: 10px; padding-left: 10px; }
  .sidebar-brand { padding-right: 6px; padding-left: 6px; gap: 8px; }
  .brand-copy strong { font-size: 13px; }
  .brand-copy small { font-size: 8px; }
  .workspace-topbar { padding: 8px 20px; }
  .view-pane { padding-left: 20px; padding-right: 20px; }
  .settings-grid { grid-template-columns: minmax(0, 1fr); max-width: 760px; gap: 14px; }
  .login-layout { grid-template-columns: minmax(0, 1fr) minmax(270px, 340px); gap: 25px; padding-right: 0; padding-left: 0; }
  .login-card { padding: 24px 22px; }
  .topbar-search-hint { display: none; }
  .data-toolbar .search-field { flex-basis: 230px; }
}
@media (max-width: 850px) {
  :root { --ui-sidebar-width: 0px; }
  .workspace-shell { display: block; }
  .workspace-sidebar { display: none; }
  .workspace-stage { height: 100%; padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }
  .workspace-topbar { min-height: 50px; padding: 8px 16px; }
  .view-pane { padding: 14px 16px 0; }
  .workspace-heading { margin-bottom: 12px; }
  .workspace-heading h1 { font-size: 20px; }
  .workspace-mobile-nav { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); background: var(--ui-surface); border-top: 1px solid var(--ui-border); box-shadow: 0 -4px 16px -8px rgba(22, 32, 44, .18); }
  .workspace-mobile-nav a { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px; min-height: 48px; padding: 5px 6px; color: var(--ui-muted); border-radius: var(--ui-radius-sm); text-decoration: none; font-size: 11px; font-weight: 500; transition: color var(--ui-fast), background var(--ui-fast); }
  .workspace-mobile-nav .nav-icon { width: 24px; height: 24px; color: inherit; background: transparent; }
  .workspace-mobile-nav a[aria-current="page"], .workspace-mobile-nav a.is-active { color: var(--ui-blue); background: var(--ui-blue-soft); font-weight: 600; }
  .toast { left: 50%; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .login-layout { min-height: auto; padding-top: 12px; }
  .workspace-footer .footer-hint { display: none; }
}
@media (max-width: 600px) {
  .workspace-topbar { gap: 9px; min-height: 48px; padding: 6px 14px; }
  .welcome-line { font-size: 11px; }
  .identity-button { min-height: 30px; padding: 2px 8px 2px 3px; gap: 5px; font-size: 11.5px; }
  .identity-avatar { width: 22px; height: 22px; }
  .view-pane { padding: 12px 12px 0; }
  .workspace-heading { margin: 0 2px 12px; }
  .workspace-heading h1 { font-size: 19px; }
  .workspace-heading p:not(.eyebrow), .page-lede { margin-top: 2px; font-size: 11.5px; }
  .eyebrow { font-size: 9px; margin-bottom: 6px; }
  .data-panel { border-radius: 12px; }
  .data-toolbar { flex-wrap: wrap; gap: 6px 8px; min-height: 0; padding: 8px; }
  .data-toolbar .search-field { flex: 1 1 100%; order: 0; }
  .toolbar-status { flex: 1 1 auto; order: 1; gap: 8px; font-size: 11px; }
  .toolbar-actions { order: 2; }
  #search { height: 38px; font-size: 16px; }
  #search::placeholder { font-size: 13px; }
  .data-toolbar .btn { min-height: 32px; padding: 5px 8px; gap: 4px; font-size: 11.5px; }
  .tier-filter { padding: 6px 8px; gap: 5px; }
  .tier-chip { min-height: 28px; font-size: 11.5px; }
  .notice { font-size: 11.5px; padding: 6px 10px; }
  .workspace-footer { min-height: 30px; padding: 6px 2px; font-size: 10.5px; gap: 7px; }
  .legend-pop { left: 0; right: 0; min-width: 0; max-width: none; }
  .settings-grid { gap: 12px; padding-bottom: 20px; }
  .settings-group { border-radius: 12px; }
  .settings-group > h2, .settings-group > h3, .settings-group-title { padding-left: 14px; padding-right: 14px; }
  .setting-row { gap: 12px; min-height: 60px; margin: 0 14px; padding: 12px 0; }
  button.setting-link { width: calc(100% - 28px); }
  .setting-title { font-size: 12.5px; }
  .setting-note { font-size: 11px; }
  .segment-control button { min-width: 44px; min-height: 30px; padding-right: 6px; padding-left: 6px; font-size: 11.5px; }
  .settings-footnote { font-size: 11px; }
  .login-layout { display: flex; flex-direction: column; align-items: stretch; gap: 18px; padding: 3px 3px 30px; }
  .login-intro .brand-symbol { width: 44px; height: 44px; border-radius: 13px; margin-bottom: 16px; }
  .login-intro .brand-symbol svg { width: 27px; height: 27px; }
  .login-intro h1, .login-intro h2 { margin-bottom: 10px; max-width: 320px; font-size: 25px; line-height: 1.35; }
  .login-intro p { font-size: 12.5px; line-height: 1.8; margin-bottom: 0; }
  .login-card { padding: 22px 18px; border-radius: 14px; }
  .login-card h2 { font-size: 18px; }
  .login-card input { font-size: 16px; }
  .login-card > p { margin-bottom: 16px; font-size: 12px; }
  #detail-dialog { width: 100%; max-width: none; max-height: calc(90dvh - env(safe-area-inset-top, 0px)); margin: auto 0 0; border-radius: 18px 18px 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  #detail-dialog[open] { animation-name: mobile-dialog-enter; }
  .dialog-header { padding: 20px 18px 14px; }
  .dialog-header::before { content: ""; position: absolute; top: 7px; left: calc(50% - 17px); width: 34px; height: 4px; border-radius: 4px; background: var(--ui-border-strong); }
  .dialog-header h2 { font-size: 15px; }
  .dialog-body { padding: 16px 18px 24px; font-size: 12.5px; }
  .dialog-body .cell-detail-content { padding: 12px; }
  @keyframes mobile-dialog-enter { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: translateY(0); } }
}
@media (max-width: 370px) {
  .welcome-line { font-size: 10px; }
  .identity-button { font-size: 10px; }
  .data-toolbar .btn { padding: 5px 5px; font-size: 10.5px; }
  .setting-row { flex-wrap: wrap; gap: 10px; }
  .setting-row > .segment-control { margin-left: auto; }
}
/* On a phone, one frozen city column leaves room to read and swipe values.
   The same geometry is used in a short landscape viewport. No value or state
   marker is hidden, recolored or reformatted. */
@media (max-width: 600px), (max-width: 950px) and (max-height: 500px) {
  :root { --w-city: 76px; --w-region: 64px; }
  .mobile-table-controls { display: flex; align-items: stretch; gap: 6px; flex: 0 0 auto; min-width: 0; margin: 0; padding: 8px 8px 0; }
  .column-picker { display: flex; flex-direction: column; justify-content: center; gap: 0; flex: 1 1 0; min-width: 0; height: 42px; padding: 3px 10px; color: var(--ui-muted); background: var(--ui-surface-2); border: 1px solid var(--ui-border); border-radius: var(--ui-radius-sm); }
  .column-picker > span { font-size: 9px; line-height: 1.25; }
  .column-picker select { display: block; width: 100%; min-width: 0; height: 24px; padding: 0; color: var(--ui-ink); background: transparent; border: 0; border-radius: 4px; font-family: inherit; font-size: 16px; line-height: 1.4; text-overflow: ellipsis; cursor: pointer; }
  .column-picker select:focus-visible { outline-width: 2px; outline-offset: 1px; }
  .mobile-table-controls > button { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 42px; width: 42px; height: 42px; padding: 0; color: var(--ui-blue); background: var(--ui-surface-2); border: 1px solid var(--ui-border); border-radius: var(--ui-radius-sm); font: inherit; font-size: 22px; font-weight: 450; cursor: pointer; transition: background var(--ui-fast); }
  .mobile-table-controls > button:hover { background: var(--ui-surface); }
  .mobile-table-controls > button:active { background: var(--ui-blue-soft); }
  .mobile-table-controls > button:disabled { color: var(--ui-muted); opacity: .4; }
  .mobile-table-controls > #table-expand { font-size: 11px; font-weight: 600; }
  .mobile-scroll-hint { display: block; flex: 0 0 auto; margin: 0; padding: 6px 10px 6px; color: var(--ui-muted); font-size: 10.5px; line-height: 1.5; }
  /* 手机端不显示「所属等级」列（筛选条仍可用），城市列回到最左并单独冻结 */
  .sheet thead th.th-tier, .sheet tbody td.cell-tier { display: none; }
  .sheet-wrap { border-top: 1px solid var(--ui-border); scroll-padding-inline-start: calc(var(--w-city) + 12px); scroll-padding-block-start: 108px; }
  .sheet thead th, .sheet tbody td { min-width: 100px; max-width: 136px; padding-left: 8px; padding-right: 8px; }
  .sheet thead th { height: 100px; padding-top: 8px; padding-bottom: 8px; font-size: 12px; cursor: pointer; }
  .sheet tbody td { height: 44px; padding-top: 10px; padding-bottom: 10px; font-size: 12px; }
  .sheet td.num { font-size: 12px; }
  .sheet .th-inner, .sheet th.num .th-inner { display: grid; grid-template-rows: 34px 14px 28px; align-items: end; justify-items: end; gap: 3px; height: 82px; }
  .sheet .th-title { grid-row: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; max-height: 34px; line-height: 17px; overflow: hidden; overflow-wrap: anywhere; }
  .sheet .th-unit { grid-row: 2; max-width: 100%; font-size: 10px; line-height: 14px; white-space: nowrap; overflow: hidden; }
  .sheet .th-cut { grid-row: 3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 10px; max-height: 28px; white-space: normal; overflow: hidden; overflow-wrap: anywhere; line-height: 14px; }
  .sheet thead th.th-city .th-inner, .sheet thead th.th-region .th-inner { display: flex; align-items: flex-start; justify-content: flex-end; }
  .sheet thead th.th-city, .sheet tbody td.cell-key { left: 0; width: var(--w-city); min-width: var(--w-city); max-width: var(--w-city); }
  .sheet thead th.th-city, .sheet tbody td.cell-key:not(.cell-gov) { box-shadow: 1px 0 0 var(--line), 6px 0 9px -7px rgba(47, 65, 98, .44); }
  .sheet thead th.th-region, .sheet tbody td.cell-region { left: auto; width: var(--w-region); min-width: var(--w-region); max-width: var(--w-region); font-size: 12px; }
  .sheet thead th.th-region { position: sticky; top: 0; z-index: 2; }
  .sheet-wrap.is-scrolled-x .sheet thead th.th-region, .sheet-wrap.is-scrolled-x .sheet tbody td.cell-region { box-shadow: none; }
  .sheet tbody td.cell-region { position: relative; z-index: auto; }
  .sheet tbody td.cell-flagged { white-space: normal; overflow: visible; text-overflow: clip; }
  .sheet td.cell-flagged .city-flag { display: block; width: max-content; max-width: 100%; height: auto; min-height: 13px; margin: 3px 0 0; padding: 0 3px; line-height: 13px; white-space: normal; }
  .sheet td.cell-key.cell-lag { position: sticky; }
  .sheet td.cell-key, .sheet td.cell-region { scroll-margin-inline-start: 8px; }
  .th-sort { top: 6px; left: 6px; }
  .th-info { top: 4px; right: 4px; }
  body[data-density="compact"] .sheet tbody td { height: 44px; padding-top: 8px; padding-bottom: 8px; }
  body.table-focus #data-view { position: fixed; inset: 0; z-index: 80; display: flex; min-width: 0; min-height: 0; padding-top: calc(8px + env(safe-area-inset-top, 0px)); padding-right: max(8px, env(safe-area-inset-right, 0px)); padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); padding-left: max(8px, env(safe-area-inset-left, 0px)); color: var(--ui-ink); background: var(--ui-bg); }
  body.table-focus #data-view > .workspace-heading, body.table-focus #data-view > .workspace-footer, body.table-focus .data-panel > .data-toolbar, body.table-focus .data-panel > .statusbar, body.table-focus .data-panel > .tier-filter { display: none; }
  body.table-focus .mobile-table-controls { margin-top: 0; }
  body.table-focus .data-panel { border-radius: 12px; }
}
@media (max-width: 950px) and (max-height: 500px) {
  #data-view:not([hidden]) { overflow-y: auto; }
  #data-view > .data-panel { flex: 1 0 240px; }
  body.table-focus #data-view { overflow: hidden; }
  body.table-focus #data-view > .data-panel { flex: 1 1 0; min-height: 0; }
}
@media (max-height: 630px) and (min-width: 851px) {
  .workspace-topbar { min-height: 44px; padding-top: 5px; padding-bottom: 5px; }
  .view-pane { padding-top: 12px; }
  .workspace-heading { margin-bottom: 10px; }
  .workspace-heading h1 { font-size: 19px; }
  .workspace-heading p:not(.eyebrow) { display: none; }
  .workspace-footer { min-height: 28px; padding: 5px 0; }
}
body[data-motion="reduced"] *, body[data-motion="reduced"] *::before, body[data-motion="reduced"] *::after {
  animation-duration: .01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .01ms !important;
  scroll-behavior: auto !important;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .launch-symbol { opacity: 1; transform: none; }
}
@media (prefers-contrast: more) {
  .workspace-sidebar, .workspace-mobile-nav, .settings-group, .login-card, .data-panel { border-color: var(--ui-muted); }
  .setting-note, .welcome-line, .workspace-footer { color: var(--ui-secondary); }
}
@media print {
  html, body { height: auto; overflow: visible; background: #fff; }
  .workspace-shell, .workspace-stage, #data-view, .data-panel { display: block; height: auto; padding: 0; overflow: visible; border: 0; box-shadow: none; }
  .workspace-sidebar, .workspace-mobile-nav, .workspace-topbar, .launch-screen, .data-toolbar, .statusbar, .tier-filter, .workspace-footer, .tip, #link-layer, .mobile-table-controls, .mobile-scroll-hint { display: none !important; }
  .sheet-wrap { overflow: visible; height: auto; border: 0; box-shadow: none; }
}
