/* =========================================================================
   剑网三物价助手 · 样式
   基于 docs/design 数据看板规范：暗色工作台、1px 描边卡片、12 列栅格、
   控件贴数据、颜色即编码、字号层级 400/500/600/700
   ========================================================================= */

:root {
  --brand: #e10600;
  --bg: #020817;
  --card: #020817;
  --panel: #070f20;
  --sidebar: #0f172a;
  --sidebar-text: #e2e8f0;
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --border: #1e293b;
  --border-soft: rgba(148, 163, 184, 0.11);
  --accent: #1e293b;
  --accent-2: rgba(148, 163, 184, 0.08);
  --input-bg: #0b1220;
  --chart-1: #1d6fe0;
  --chart-2: #2e9e78;
  --chart-3: #e88a2e;
  --chart-4: #a75be0;
  --chart-5: #e04a7a;
  --peak: #b36bff;
  --positive: #45d483;
  --warning: #f5b301;
  --danger: #f43f5e;
  --info: #3b82f6;
  --radius: 8px;
  --sidebar-w: 256px;
  --header-h: 64px;
  --content-max: 1920px;
  --shadow-pop: 0 12px 48px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

html.light {
  --bg: #f5f5f5;
  --card: #ffffff;
  --panel: #ffffff;
  --sidebar: #fafafa;
  --sidebar-text: #334155;
  --text: #0f172a;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --border: #e2e8f0;
  --border-soft: rgba(15, 23, 42, 0.07);
  --accent: #f1f5f9;
  --accent-2: rgba(15, 23, 42, 0.04);
  --input-bg: #ffffff;
  --shadow-pop: 0 12px 48px rgba(15, 23, 42, 0.14);
  color-scheme: light;
}

*,
*::before,
*::after { box-sizing: border-box; }

/* 固定字阶：禁止 iOS Safari / Android Chrome 对个别区块做自动字号放大（font boosting），
   否则同屏会出现“某些模块字体特别大”的不一致。用户系统级放大仍可通过缩放生效。 */
html {
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 14px;
  line-height: 20px;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
svg { display: block; width: 1em; height: 1em; flex: none; }
h1, h2, h3, p { margin: 0; }

::selection { background: rgba(29, 111, 224, 0.35); }

:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--info) 70%, white);
  outline-offset: 2px;
}

.tabular, .num { font-variant-numeric: tabular-nums; }
.mono { font-variant-numeric: tabular-nums; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  transform: translateY(-200%);
  background: var(--text);
  color: var(--bg);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}
.skip-link:focus { transform: none; }

/* ------------------------------------------------------------------ */
/* App shell                                                          */
/* ------------------------------------------------------------------ */
.app { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: transform 220ms ease;
}

.brand {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  flex: none;
}
.brand-seal {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--brand);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -1px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  flex: none;
}
.brand-name { font-size: 14px; font-weight: 600; letter-spacing: 0.02em; line-height: 18px; }
.brand-sub { font-size: 9px; letter-spacing: 0.17em; color: var(--muted-2); text-transform: uppercase; line-height: 12px; }

.side-scroll { flex: 1; overflow-y: auto; padding: 8px 10px 12px; scrollbar-width: thin; }

.nav-group-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--muted-2);
  text-transform: uppercase;
  padding: 14px 8px 6px;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 9px;
  border-radius: 6px;
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 500;
  transition: background 150ms ease, color 150ms ease;
  margin-bottom: 2px;
}
.nav-item:hover { background: var(--accent); }
.nav-item.active { background: var(--accent); color: var(--text); }
.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  bottom: 7px;
  width: 2px;
  border-radius: 2px;
  background: var(--brand);
}
.nav-item svg { width: 16px; height: 16px; flex: none; opacity: 0.9; }
.nav-item .nav-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  background: var(--accent-2);
  border: 1px solid var(--border-soft);
  padding: 1px 5px;
  border-radius: 4px;
  font-variant-numeric: tabular-nums;
}

.side-foot { flex: none; border-top: 1px solid var(--border); padding: 8px 10px 10px; }
.side-foot .nav-item { height: 32px; font-size: 12px; color: var(--muted); }
.side-foot .nav-item svg { width: 14px; height: 14px; }
.nav-item .ext { margin-left: auto; font-size: 10px; color: var(--muted-2); }

.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ------------------------------------------------------------------ */
/* Header                                                             */
/* ------------------------------------------------------------------ */
.header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); min-width: 0; }
.crumbs .home { font-weight: 500; }
.crumbs .sep { width: 1px; height: 12px; background: var(--border); }
.crumbs .cur { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.header-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.server-wrap { position: relative; }
.header-version {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 9px;
  border-radius: 4px;
  border: 1px solid var(--border);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.header-version .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--positive); }
.header-version .v { color: var(--text); }

.server-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  font-size: 12px;
  font-weight: 500;
  max-width: 240px;
}
.server-trigger:hover { border-color: color-mix(in srgb, var(--border) 40%, var(--muted)); }
.server-trigger .sname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-trigger .sregion { color: var(--muted-2); font-size: 10px; font-weight: 500; }
.server-trigger .caret { color: var(--muted); flex: none; }

.icon-btn {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
  flex: none;
}
.icon-btn:hover { background: var(--accent); color: var(--text); border-color: var(--border); }
.icon-btn svg { width: 16px; height: 16px; }

.mobile-menu { display: none; }

/* ------------------------------------------------------------------ */
/* Page                                                               */
/* ------------------------------------------------------------------ */
.page {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  /* 顶部状态条已经占了一行，页面上边距收窄，避免顶部大片空白 */
  padding: 12px 24px 24px;
  animation: page-in 240ms ease-out both;
}
@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  min-height: 56px;
}
.page-title { font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; }
.page-sub { margin-top: 5px; font-size: 12px; line-height: 18px; color: var(--muted); max-width: 820px; }
.page-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; padding-top: 2px; }

.section-gap { margin-top: 16px; }

.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; align-items: start; }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-9 { grid-column: span 9; }
.col-12 { grid-column: span 12; }

/* ------------------------------------------------------------------ */
/* Cards                                                              */
/* ------------------------------------------------------------------ */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px 0;
  min-height: 44px;
}
.card-head-main { min-width: 0; }
.card-title { font-size: 15px; line-height: 22px; font-weight: 600; letter-spacing: -0.005em; display: flex; align-items: center; gap: 7px; }
.card-sub { font-size: 12px; line-height: 17px; color: var(--muted); margin-top: 4px; }
.card-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; padding-top: 1px; }
.card-body { padding: 16px 18px 18px; min-width: 0; }
.card-body.flush { padding: 0; }
.card-body.tight { padding: 12px 14px; }
.card-foot {
  border-top: 1px solid var(--border-soft);
  padding: 10px 18px;
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.card-foot .spacer { flex: 1; }

/* ------------------------------------------------------------------ */
/* KPI                                                                */
/* ------------------------------------------------------------------ */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 18px 14px;
  min-width: 0;
  position: relative;
  overflow: hidden;
}
.kpi-label { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 500; color: var(--muted); }
.kpi-label .info { margin-left: auto; color: var(--muted-2); cursor: help; display: inline-flex; }
.kpi-value { margin-top: 9px; font-size: 28px; line-height: 32px; font-weight: 700; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 4px; }
.kpi-unit { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.kpi-meta { margin-top: 7px; display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); min-height: 17px; }
.kpi-meta .up { color: var(--positive); font-weight: 600; }
.kpi-meta .down { color: var(--danger); font-weight: 600; }
.kpi-meta .warn { color: var(--warning); font-weight: 600; }
.kpi-meta .sep { width: 1px; height: 10px; background: var(--border); }
.kpi-spark { position: absolute; right: 12px; bottom: 10px; opacity: 0.8; }
.progress { height: 5px; border-radius: 3px; background: var(--border); overflow: hidden; margin-top: 10px; }
.progress > i { display: block; height: 100%; border-radius: 3px; background: var(--chart-1); transition: width 300ms ease; }
.progress.is-positive > i { background: var(--positive); }
.progress.is-warn > i { background: var(--warning); }

/* ------------------------------------------------------------------ */
/* Controls                                                           */
/* ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
  flex: none;
}
.btn svg { width: 14px; height: 14px; }
.btn:hover { background: var(--accent); border-color: color-mix(in srgb, var(--border) 55%, var(--muted)); }
.btn:active { transform: translateY(0.5px); }
.btn-primary { background: var(--text); border-color: var(--text); color: var(--bg); }
.btn-primary:hover { background: color-mix(in srgb, var(--text) 88%, var(--bg)); border-color: transparent; }
.btn-soft { background: var(--accent); border-color: transparent; color: var(--text); }
.btn-soft:hover { background: color-mix(in srgb, var(--accent) 75%, var(--muted)); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.btn-sm { height: 26px; padding: 0 8px; font-size: 11px; border-radius: 5px; }
.btn-sm svg { width: 12px; height: 12px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.select, .input, .textarea {
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 12px;
  padding: 0 9px;
  transition: border-color 150ms ease, background 150ms ease;
  min-width: 0;
}
.select:hover, .input:hover, .textarea:hover { border-color: color-mix(in srgb, var(--border) 40%, var(--muted)); }
.select:focus, .input:focus, .textarea:focus { outline: none; border-color: var(--info); box-shadow: 0 0 0 2px color-mix(in srgb, var(--info) 20%, transparent); }
.select { padding-right: 26px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 13px) 14px, calc(100% - 9px) 14px; background-size: 4px 4px; background-repeat: no-repeat; }
.textarea { height: auto; padding: 8px 9px; line-height: 18px; resize: vertical; width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; }
.input.is-invalid { border-color: var(--danger); }

.search-box { position: relative; display: inline-flex; align-items: center; }
.search-box svg { position: absolute; left: 9px; width: 13px; height: 13px; color: var(--muted); pointer-events: none; }
.search-box .input { padding-left: 28px; width: 190px; }

.seg { display: inline-flex; align-items: center; gap: 2px; height: 32px; padding: 2px; border-radius: 6px; background: color-mix(in srgb, var(--accent) 55%, transparent); border: 1px solid var(--border); }
.seg button { height: 26px; padding: 0 9px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 11.5px; font-weight: 500; white-space: nowrap; transition: background 150ms ease, color 150ms ease; }
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--text); color: var(--bg); font-weight: 600; }
.seg.seg-sm { height: 28px; }
.seg.seg-sm button { height: 22px; font-size: 11px; padding: 0 8px; }
.seg a { display: inline-flex; align-items: center; height: 26px; padding: 0 9px; border-radius: 4px; color: var(--muted); font-size: 11.5px; font-weight: 500; white-space: nowrap; text-decoration: none; transition: background 150ms ease, color 150ms ease; }
.seg a:hover { color: var(--text); }
.seg a.active { background: var(--text); color: var(--bg); font-weight: 600; }
.seg.seg-sm a { height: 22px; font-size: 11px; padding: 0 8px; }

.switch { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); cursor: pointer; user-select: none; white-space: nowrap; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 30px; height: 17px; border-radius: 999px; background: #334155; position: relative; transition: background 150ms ease; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 13px; height: 13px; border-radius: 50%; background: #fff; transition: transform 150ms ease; }
.switch input:checked + .track { background: var(--chart-1); }
.switch input:checked + .track::after { transform: translateX(13px); }
.switch input:focus-visible + .track { outline: 2px solid var(--info); outline-offset: 2px; }

.check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; }
.check input { accent-color: var(--chart-1); }

/* ------------------------------------------------------------------ */
/* Badges                                                             */
/* ------------------------------------------------------------------ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 10.5px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.badge-neutral { background: var(--accent); color: var(--muted); }
.badge-info { background: color-mix(in srgb, var(--info) 14%, transparent); color: color-mix(in srgb, var(--info) 75%, var(--text)); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.badge-positive { background: color-mix(in srgb, var(--positive) 13%, transparent); color: var(--positive); border-color: color-mix(in srgb, var(--positive) 26%, transparent); }
.badge-danger { background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 26%, transparent); }
.badge-warning { background: color-mix(in srgb, var(--warning) 13%, transparent); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 26%, transparent); }
.badge-peak { background: color-mix(in srgb, var(--peak) 15%, transparent); color: var(--peak); border-color: color-mix(in srgb, var(--peak) 30%, transparent); }
.badge-custom { background: color-mix(in srgb, var(--chart-4) 14%, transparent); color: var(--chart-4); border-color: color-mix(in srgb, var(--chart-4) 28%, transparent); }
.badge-verified { background: color-mix(in srgb, var(--positive) 12%, transparent); color: var(--positive); border-color: color-mix(in srgb, var(--positive) 24%, transparent); }
.badge-outline { border-color: var(--border); color: var(--muted); }
.badge-dot::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.tier-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.tier-badge i { width: 7px; height: 7px; border-radius: 2px; background: var(--tier, var(--muted)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--tier, var(--muted)) 35%, transparent); }

.skill-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text); }
.skill-icon { width: 30px; height: 30px; border-radius: 6px; display: grid; place-items: center; background: color-mix(in srgb, var(--sc, var(--chart-1)) 13%, transparent); color: var(--sc, var(--chart-1)); flex: none; }
.skill-icon svg { width: 15px; height: 15px; }
.skill-icon.lg { width: 38px; height: 38px; border-radius: 8px; }
.skill-icon.lg svg { width: 19px; height: 19px; }
.skill-icon.sm { width: 24px; height: 24px; border-radius: 5px; }
.skill-icon.sm svg { width: 12px; height: 12px; }

/* ------------------------------------------------------------------ */
/* Tables                                                             */
/* ------------------------------------------------------------------ */
.table-wrap { width: 100%; overflow: auto; border-top: 1px solid var(--border-soft); scrollbar-width: thin; }
.table-wrap.tall { max-height: 620px; }
.table-wrap.medium { max-height: 460px; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
table.data thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--card);
  height: 34px;
  padding: 0 10px;
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  user-select: none;
}
table.data thead th.num { text-align: right; }
table.data thead th.sortable { cursor: pointer; }
table.data thead th.sortable:hover { color: var(--text); }
table.data thead th .sort-ind { margin-left: 3px; color: var(--info); font-size: 8px; }
table.data tbody td {
  height: 44px;
  padding: 0 10px;
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
  vertical-align: middle;
}
table.data tbody tr { transition: background 120ms ease; }
table.data tbody tr:hover { background: rgba(148, 163, 184, 0.065); }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr.selected { background: color-mix(in srgb, var(--chart-1) 8%, transparent); box-shadow: inset 2px 0 0 var(--chart-1); }
table.data tbody td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tbody td.name { font-weight: 500; }
table.data tbody td.actions { text-align: right; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .sticky {
  position: sticky;
  left: 0;
  background: var(--card);
  z-index: 2;
}
table.data tbody tr:hover .sticky { background: color-mix(in srgb, var(--card) 94%, var(--muted)); }
table.data.compact tbody td { height: 38px; }
table.data.compact { font-size: 12px; }

.cell-main { display: flex; align-items: center; gap: 9px; min-width: 0; }
/* 首列必须能被压缩：td 是 white-space:nowrap，长副标题会把整列撑到 800px+，
   把后面的数值列全部挤出可视区（表现为“这一行没数据”）。 */
.cell-main .txt { min-width: 0; overflow: hidden; }
.cell-main .t1 { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-main .t2 { font-size: 10.5px; color: var(--muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 行内说明图标：点击/聚焦才弹出说明，避免长文本撑宽首列 */
.cell-main .tip-inline { margin-left: 6px; color: var(--muted-2); cursor: help; display: inline-flex; vertical-align: -2px; }
.cell-main .tip-inline:hover, .cell-main .tip-inline:focus { color: var(--info); }
.cell-sub { display: block; font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.cell-right { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }

.price-input {
  width: 92px;
  height: 28px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 12px;
  text-align: right;
  padding: 0 7px;
  font-variant-numeric: tabular-nums;
  transition: border-color 150ms ease;
}
.price-input:hover { border-color: color-mix(in srgb, var(--border) 40%, var(--muted)); }
.price-input:focus { outline: none; border-color: var(--info); box-shadow: 0 0 0 2px color-mix(in srgb, var(--info) 18%, transparent); }
.price-input.is-missing { border-color: color-mix(in srgb, var(--warning) 45%, var(--border)); }
.price-input.sm { width: 76px; height: 26px; font-size: 11.5px; }

.price-cell { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; }
.price-state { font-size: 9.5px; color: var(--muted-2); border: 1px solid var(--border-soft); border-radius: 3px; padding: 1px 4px; }
.price-state.user { color: var(--positive); border-color: color-mix(in srgb, var(--positive) 30%, transparent); }
.price-state.seed { color: var(--muted); }
.price-state.missing { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 30%, transparent); }
.price-state.ok { color: var(--positive); border-color: color-mix(in srgb, var(--positive) 30%, transparent); }
.price-state.vendor { color: var(--info); border-color: color-mix(in srgb, var(--info) 30%, transparent); }

.pos { color: var(--positive); }
.neg { color: var(--danger); }
.dim { color: var(--muted); }
.muted { color: var(--muted); }
.strong { font-weight: 600; }
.small { font-size: 11px; }
.tiny { font-size: 10px; }
.nowrap { white-space: nowrap; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-col { display: flex; flex-direction: column; gap: 8px; }
.spacer { flex: 1; }
.right { margin-left: auto; }

/* ------------------------------------------------------------------ */
/* Skill navigation                                                   */
/* ------------------------------------------------------------------ */
.skill-nav { display: flex; flex-direction: column; gap: 16px; }
.skill-group-label { display: flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted-2); padding: 0 2px 2px; }
.skill-list { display: flex; flex-direction: column; gap: 4px; }
.skill-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  color: var(--text);
  transition: background 150ms ease, border-color 150ms ease;
  position: relative;
  text-align: left;
  width: 100%;
  background: transparent;
}
.skill-item:hover { background: var(--accent-2); }
.skill-item.active { background: var(--accent); border-color: var(--border); }
.skill-item.active::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 2px; border-radius: 2px; background: var(--chart-1); }
.skill-item .meta { min-width: 0; flex: 1; }
.skill-item .nm { font-size: 12.5px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.skill-item .ds { font-size: 10.5px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skill-item .val { text-align: right; flex: none; }
.skill-item .val b { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; display: block; }
.skill-item .val span { font-size: 9.5px; color: var(--muted); }

.skill-head { display: flex; align-items: flex-start; gap: 12px; }
.skill-head h2 { font-size: 17px; line-height: 24px; font-weight: 600; }
.skill-head p { font-size: 11.5px; line-height: 17px; color: var(--muted); margin-top: 3px; max-width: 640px; }
.skill-stats { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; }
.skill-stat { display: flex; flex-direction: column; gap: 1px; }
.skill-stat b { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.skill-stat span { font-size: 10px; color: var(--muted); }

/* ------------------------------------------------------------------ */
/* Charts                                                             */
/* ------------------------------------------------------------------ */
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-bar, .chart-point, .chart-box { cursor: pointer; }
.chart-bar:hover { opacity: 0.86; }
.chart-point:hover { filter: brightness(1.2); }
.chart-box:hover { filter: brightness(1.15); }
.chart-bar:focus-visible, .chart-point:focus-visible, .chart-box:focus-visible { filter: brightness(1.3); }
.chart-legend { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 10.5px; color: var(--muted); }
.chart-legend .item { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend .swatch { width: 8px; height: 8px; border-radius: 2px; background: var(--sw); }
.chart-legend .line { width: 12px; height: 0; border-top: 1px dashed var(--muted); }
.reading-guide { font-size: 10.5px; line-height: 16px; color: var(--muted-2); padding: 0 18px 15px; }
.chart-card { min-height: 340px; }

/* cost composition */
.cost-bar { display: flex; height: 12px; border-radius: 4px; overflow: hidden; background: var(--border); gap: 1px; }
.cost-bar > span { display: block; height: 100%; min-width: 2px; }
.cost-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin-top: 12px; }
.cost-legend .row { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); min-width: 0; }
.cost-legend .sw { width: 8px; height: 8px; border-radius: 2px; flex: none; background: var(--sw); }
.cost-legend .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cost-legend .vv { margin-left: auto; color: var(--text); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ */
/* Lists / recommendations                                            */
/* ------------------------------------------------------------------ */
.rec-list { display: flex; flex-direction: column; gap: 2px; }
.rec-item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border-soft); }
.rec-item:last-child { border-bottom: 0; }
.rec-rank { width: 20px; height: 20px; border-radius: 4px; background: var(--accent); color: var(--muted); font-size: 10px; font-weight: 700; display: grid; place-items: center; flex: none; }
.rec-item:first-child .rec-rank { background: color-mix(in srgb, var(--peak) 18%, transparent); color: var(--peak); }
.rec-main { min-width: 0; flex: 1; }
.rec-main .nm { font-size: 12.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-main .ds { font-size: 10.5px; color: var(--muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-val { text-align: right; flex: none; }
.rec-val b { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rec-val span { display: block; font-size: 9.5px; color: var(--muted); }

.info-rows { display: flex; flex-direction: column; gap: 0; }
.info-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border-soft); font-size: 12px; }
.info-row:last-child { border-bottom: 0; }
.info-row .k { color: var(--muted); }
.info-row .v { font-weight: 500; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ */
/* Drawer / modal / menus                                             */
/* ------------------------------------------------------------------ */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(2, 8, 23, 0.62);
  backdrop-filter: blur(2px);
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}
.scrim.show { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(560px, 100vw);
  background: var(--panel);
  border-left: 1px solid var(--border);
  box-shadow: -24px 0 64px rgba(0, 0, 0, 0.4);
  z-index: 61;
  transform: translateX(102%);
  transition: transform 220ms cubic-bezier(0.22, 0.61, 0.36, 1);
  display: flex;
  flex-direction: column;
}
.drawer.show { transform: none; }
.drawer-head {
  flex: none;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.drawer-head .t { min-width: 0; flex: 1; }
.drawer-head h2 { font-size: 17px; line-height: 24px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.drawer-head p { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 18px 20px; scrollbar-width: thin; }
.drawer-foot { flex: none; border-top: 1px solid var(--border); padding: 12px 18px; display: flex; align-items: center; gap: 8px; background: var(--panel); }
.drawer-foot .spacer { flex: 1; }

.drawer-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; margin-bottom: 16px; }
.drawer-kpi { padding: 10px 12px; background: var(--accent-2); }
.drawer-kpi span { font-size: 10px; color: var(--muted); display: block; }
.drawer-kpi b { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; display: block; margin-top: 3px; }
.drawer-kpi b small { font-size: 10px; color: var(--muted); font-weight: 500; margin-left: 2px; }

.section-title { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; color: var(--muted); text-transform: uppercase; margin: 18px 0 8px; display: flex; align-items: center; gap: 8px; }
.section-title:first-child { margin-top: 0; }
.section-title .line { flex: 1; height: 1px; background: var(--border-soft); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.form-field.full { grid-column: span 2; }
.form-field > label { font-size: 10.5px; font-weight: 500; color: var(--muted); }
.form-field .input, .form-field .select { width: 100%; height: 34px; }
.form-field .hint { font-size: 10px; color: var(--muted-2); line-height: 15px; }

.mat-row { display: grid; grid-template-columns: 1fr 66px 90px 28px; gap: 6px; align-items: center; margin-bottom: 6px; }
.mat-row .select { width: 100%; height: 30px; }
.mat-row .input { height: 30px; width: 100%; }
.mat-row .sub { font-size: 10.5px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.mat-row .del { width: 28px; height: 28px; border-radius: 4px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; }
.mat-row .del:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.mat-head { display: grid; grid-template-columns: 1fr 66px 90px 28px; gap: 6px; font-size: 9.5px; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 5px; }

.modal-wrap { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 24px; }
.modal-card {
  width: min(700px, 100%);
  max-height: 86vh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-pop);
  animation: modal-in 180ms ease-out both;
}
@keyframes modal-in { from { opacity: 0; transform: scale(0.985) translateY(4px); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 16px 20px 12px; border-bottom: 1px solid var(--border); }
.modal-head h2 { font-size: 17px; font-weight: 600; line-height: 24px; flex: 1; }
.modal-body { padding: 16px 20px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 20px; border-top: 1px solid var(--border); }

.menu {
  position: absolute;
  z-index: 50;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-pop);
  padding: 6px;
  display: none;
}
.menu.open { display: block; }
.excel-menu-wrap { position: relative; }
.excel-menu-wrap > summary { list-style: none; cursor: pointer; }
.excel-menu-wrap > summary::-webkit-details-marker { display: none; }
.excel-menu-wrap[open] > .menu { display: block; }
.excel-menu { min-width: 310px; max-width: min(92vw, 380px); }
.excel-menu .menu-item { text-decoration: none; align-items: flex-start; padding: 9px 10px; }
.excel-menu .menu-item .stack { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.excel-menu .menu-item .name { font-size: 12px; font-weight: 600; color: var(--text); }
.excel-menu .menu-item .desc { font-size: 10px; color: var(--muted); line-height: 1.4; }
.excel-menu .menu-item .ext { margin-left: auto; font-size: 9px; color: var(--muted); border: 1px solid var(--border); padding: 2px 5px; border-radius: 999px; white-space: nowrap; }
.excel-menu .menu-item > svg { flex: 0 0 14px; margin-top: 1px; }
.excel-download-list { display: flex; flex-direction: column; gap: 8px; }
.excel-download-item { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); color: var(--text); text-decoration: none; }
.excel-download-item:hover { border-color: var(--chart-1); background: var(--accent); }
.excel-download-item > svg { flex: 0 0 16px; margin-top: 2px; color: var(--muted); }
.excel-download-item .stack { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.excel-download-item .name { font-size: 13px; font-weight: 600; }
.excel-download-item .desc { font-size: 11px; color: var(--muted); line-height: 1.4; }
.excel-download-item .ext { margin-left: auto; font-size: 9px; color: var(--muted); border: 1px solid var(--border); padding: 2px 6px; border-radius: 999px; white-space: nowrap; }
.menu-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 8px; border-radius: 5px; border: 0; background: transparent; color: var(--text); font-size: 12px; text-align: left; }
.menu-item:hover { background: var(--accent); }
.menu-item.active { background: var(--accent); }
.menu-item .sub { font-size: 10px; color: var(--muted); margin-left: auto; }
.menu-label { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted-2); padding: 8px 8px 4px; }
.menu-sep { height: 1px; background: var(--border); margin: 5px 0; }
.menu-foot { padding: 6px 8px 2px; display: flex; gap: 6px; }

/* ------------------------------------------------------------------ */
/* Empty / skeleton / toast / tooltip                                 */
/* ------------------------------------------------------------------ */
.empty { padding: 46px 24px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty .ic { width: 40px; height: 40px; border-radius: 10px; background: var(--accent); display: grid; place-items: center; color: var(--muted); margin-bottom: 2px; }
.empty .ic svg { width: 20px; height: 20px; }
.empty h3 { font-size: 13px; font-weight: 600; color: var(--text); }
.empty p { font-size: 11.5px; max-width: 360px; line-height: 17px; }
.empty .btn { margin-top: 6px; }

.skeleton { background: linear-gradient(90deg, var(--border) 20%, color-mix(in srgb, var(--border) 55%, var(--muted)) 40%, var(--border) 60%); background-size: 300% 100%; animation: shimmer 1.4s ease-in-out infinite; border-radius: 4px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.sk-line { height: 10px; margin-bottom: 8px; }
.sk-card { height: 120px; }

.toast-root { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.toast {
  pointer-events: auto;
  min-width: 220px;
  max-width: 360px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-pop);
  padding: 10px 12px;
  font-size: 12px;
  line-height: 17px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  animation: toast-in 200ms ease-out both;
}
.toast .ic { color: var(--positive); flex: none; margin-top: 1px; }
.toast.error .ic { color: var(--danger); }
.toast.warn .ic { color: var(--warning); }
.toast .msg { flex: 1; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

#tooltip {
  position: fixed;
  z-index: 95;
  pointer-events: none;
  max-width: 280px;
  background: #0b1220;
  color: #f8fafc;
  border: 1px solid #1e293b;
  border-radius: 8px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
  padding: 8px 10px;
  font-size: 11.5px;
  line-height: 17px;
  white-space: pre-line;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 120ms ease, transform 120ms ease;
}
#tooltip.show { opacity: 1; transform: none; }
html.light #tooltip { background: #0f172a; border-color: #334155; }

/* ------------------------------------------------------------------ */
/* Misc                                                               */
/* ------------------------------------------------------------------ */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--warning) 26%, var(--border));
  background: color-mix(in srgb, var(--warning) 7%, transparent);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 17px;
}
.notice svg { width: 14px; height: 14px; color: var(--warning); flex: none; margin-top: 1px; }
.notice.info { border-color: color-mix(in srgb, var(--info) 24%, var(--border)); background: color-mix(in srgb, var(--info) 6%, transparent); }
.notice.info svg { color: var(--info); }
/* 页面级提示条：上下都要留白，否则会贴住下面的 KPI / 卡片 */
.page-notice { margin: 14px 0 16px; }
.notice .link { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }

.data-foot {
  margin-top: 20px;
  padding: 14px 2px 4px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 10.5px;
  line-height: 16px;
  color: var(--muted-2);
}
.data-foot svg { width: 13px; height: 13px; flex: none; margin-top: 1px; }
.data-foot .links { display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.data-foot a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.data-foot a:hover { color: var(--text); }

.tag-row { display: flex; gap: 6px; flex-wrap: wrap; }
.kv-inline { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.kv-inline b { color: var(--text); font-weight: 600; }

.split-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.split-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.hairline { height: 1px; background: var(--border-soft); margin: 12px 0; }

.verification { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 11px; color: var(--muted); line-height: 16px; }
.verification .ok { color: var(--positive); font-weight: 600; }

.toolbar-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.server-menu { min-width: 300px; max-height: 390px; overflow: auto; }
.server-option { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 5px; width: 100%; border: 0; background: transparent; color: var(--text); font-size: 12px; text-align: left; }
.server-option:hover { background: var(--accent); }
.server-option.active { background: var(--accent); }
.server-option .reg { font-size: 9.5px; color: var(--muted); margin-left: auto; }
.server-option .check { color: var(--chart-1); width: 12px; }

/* ------------------------------------------------------------------ */
/* Responsive                                                         */
/* ------------------------------------------------------------------ */
@media (max-width: 1440px) {
  .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .page { padding: 20px; }
}

@media (max-width: 1280px) {
  .col-3 { grid-column: span 6; }
  .col-4 { grid-column: span 6; }
  .col-5, .col-7, .col-8, .col-9 { grid-column: span 12; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .skill-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
}

@media (max-width: 1100px) {
  .header-version { display: none; }
  .page-head { flex-direction: column; gap: 12px; }
  .page-tools { justify-content: flex-start; }
}

@media (max-width: 1024px) {
  :root { --sidebar-w: 56px; }
  .sidebar { width: 56px; }
  .brand { padding: 0; justify-content: center; }
  .brand-text, .nav-item .label, .nav-item .nav-badge, .nav-group-title, .side-foot .label { display: none; }
.nav-item .nav-ext { margin-left: auto; display: inline-flex; color: var(--muted-2); font-size: 13px; }
.nav-item:hover .nav-ext { color: var(--muted); }
  .side-scroll { padding: 8px 6px; }
  .nav-item { justify-content: center; padding: 0; }
  .nav-item.active::before { left: 2px; }
  .side-foot { padding: 8px 6px; }
  .side-foot .nav-item { justify-content: center; }
  .side-link { justify-content: center; padding: 0; gap: 0; }
  .side-link .ext { display: none; }
  .nav-item .ext { display: none; }
  .sidebar:hover { width: 256px; }
  .sidebar:hover .brand { padding: 0 16px; justify-content: flex-start; }
  .sidebar:hover .brand-text, .sidebar:hover .nav-item .label, .sidebar:hover .nav-item .nav-badge, .sidebar:hover .nav-group-title, .sidebar:hover .side-foot .label { display: block; }
  .sidebar:hover .nav-item { justify-content: flex-start; padding: 0 9px; }
  .sidebar:hover .side-foot .nav-item { justify-content: flex-start; }
  .sidebar:hover .side-link { justify-content: flex-start; padding: 0 7px; gap: 8px; }
  .sidebar:hover .side-link .ext { display: inline-block; }
  .main { margin-left: 56px; }
}

@media (max-width: 860px) {
  .header { padding: 0 16px; }
  .page { padding: 16px; }
  .grid { gap: 12px; }
  .kpi-grid { gap: 12px; }
  .card-head { padding: 14px 14px 0; }
  .card-body { padding: 14px; }
  .split-2 { grid-template-columns: 1fr; }
  .split-3 { grid-template-columns: 1fr; }
  .page-title { font-size: 18px; }
  .mobile-menu { display: inline-grid; }
  .header .crumbs .home { display: none; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { width: 256px; transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .sidebar.open .brand { padding: 0 16px; justify-content: flex-start; }
  .sidebar.open .brand-text, .sidebar.open .nav-item .label, .sidebar.open .nav-item .nav-badge, .sidebar.open .nav-group-title, .sidebar.open .side-foot .label { display: block; }
  .sidebar.open .nav-item { justify-content: flex-start; padding: 0 9px; }
  .sidebar.open .side-link { justify-content: flex-start; padding: 0 7px; gap: 8px; }
  .sidebar.open .side-link .ext { display: inline-block; }
  .main { margin-left: 0; }
  .header { height: 56px; padding: 0 12px; }
  .page { padding: 14px 12px 24px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi { padding: 12px 13px; }
  .kpi-value { font-size: 23px; line-height: 27px; }
  .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9 { grid-column: span 12; }
  .skill-nav { display: flex; flex-direction: row; overflow-x: auto; gap: 8px; padding-bottom: 4px; }
  .skill-group-label { display: none; }
  .skill-list { flex-direction: row; }
  .skill-item { width: auto; min-width: 150px; }
  .skill-item .val { display: none; }
  .page-tools { width: 100%; }
  .search-box .input { width: 140px; }
  .card-tools { gap: 4px; }
  .drawer { width: 100vw; }
  .form-grid { grid-template-columns: 1fr; }
  .form-field.full { grid-column: span 1; }
  .server-trigger .sregion { display: none; }
  .header-version { display: none; }
  .seg { overflow-x: auto; }
  .data-foot { flex-direction: column; }
  .data-foot .links { margin-left: 0; }
}

@media (max-width: 600px) {
  .excel-menu-wrap { position: static; }
  .excel-menu { position: fixed; left: 12px; right: 12px; top: 62px; width: auto; min-width: 0; max-width: none; }
  /* 服务器浮层默认右对齐到触发按钮，窄屏时 290px 宽会溢出到屏幕左侧，
     服务器名整行被裁掉；手机端改成相对页头定位的贴边全宽浮层。 */
  .server-wrap { position: static; }
  .server-menu {
    position: fixed;
    left: 12px;
    right: 12px;
    top: 62px;
    width: auto;
    min-width: 0;
    max-width: none;
    max-height: min(70vh, 460px);
  }
}

@media (max-width: 520px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .page-title { font-size: 17px; }
  .card-tools .btn .txt { display: none; }
  .mat-row, .mat-head { grid-template-columns: 1fr 52px 52px 26px; }
  .mat-row .sub { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 行情更新时间 / 行情检查时间：独立状态条，不进入数据表格 */
/* 状态条现在位于顶栏内，跟在面包屑后面，不再单独占一行 */
.market-status {
  width: auto;
  max-width: none;
  margin: 0 0 0 14px;
  padding: 0;
  box-sizing: border-box;
  min-width: 0;
  display: -webkit-box;
  display: flex;
  -webkit-box-align: center;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 18px;
}
.market-status__item { display: -webkit-box; display: flex; align-items: center; }
.market-status__label { margin-right: 6px; color: var(--muted-2); }
.market-status b {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.market-status__divider {
  width: 1px;
  height: 12px;
  margin: 0 12px;
  background: var(--border);
}
.market-status__check {
  /* 紧跟「行情检查」时间，不再推到行尾，保持顶部信息一组 */
  margin-left: 10px;
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--card);
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
}
.market-status__check:hover { color: var(--text); border-color: var(--muted-2); }
/* 中屏：只保留「检查物价」按钮，时间信息让位给区服选择与图标 */
@media (max-width: 1180px) {
  .market-status { margin-left: 8px; }
  .market-status__item, .market-status__divider { display: none; }
}
@media (max-width: 768px) {
  .market-status { display: none; }
  .market-status__divider { margin: 0 8px; }
  .market-status__check { margin-left: 0; margin-top: 3px; }
}

/* ------------------------------------------------------------------ */
/* 组件补充（页面运行所需）                                            */
/* ------------------------------------------------------------------ */
#page { flex: 1; min-width: 0; }
/* 切换筛选时不再整页压暗（规范里没有 mask，视觉上也显脏）。
   反馈改为：选中态立即生效 + 新内容 240ms ease-out 进入（.page 的 page-in）。 */
#page:focus { outline: none; }

.modal-scrim { z-index: 69; }
.modal-wrap { z-index: 70; pointer-events: none; }
.modal-card { pointer-events: auto; }

.skill-nav-wrap { position: sticky; top: calc(var(--header-h) + 16px); }
.col-9.flex-col, .col-4.flex-col { gap: 16px; }

.form-field > span { font-size: 10.5px; font-weight: 500; color: var(--muted); }
.form-field .input, .form-field .select { width: 100%; height: 34px; }

.mat-row.out, .mat-head.out { grid-template-columns: 1fr 66px 28px; }
.mat-head.out { display: grid; gap: 6px; font-size: 9.5px; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 5px; }
.field-stack { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field-stack .select, .field-stack .input { width: 100%; }
.mat-row .del svg { width: 13px; height: 13px; }

.drawer .table-wrap { max-height: none; }
.drawer .table-wrap table.data tbody td { height: 38px; }
.drawer .empty { padding: 26px 12px; }
.drawer .notice ul { margin: 0; }
.drawer-kpi b.pos, .drawer-kpi b.neg { font-weight: 600; }
.drawer-kpis .drawer-kpi b small { font-weight: 500; }

.badge svg { width: 10px; height: 10px; }
.kpi-meta svg { width: 12px; height: 12px; flex: none; }
.header-version .dot { box-shadow: 0 0 0 3px color-mix(in srgb, var(--positive) 12%, transparent); }
.card-foot a { display: inline-flex; align-items: center; gap: 4px; }
.card-foot a:hover { color: var(--text); }
.card-foot svg { width: 12px; height: 12px; }

.rec-item .rec-rank { flex: none; }
table.data .rec-rank { width: 20px; height: 20px; font-size: 9.5px; }
.table-wrap { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.table-wrap::-webkit-scrollbar { height: 8px; width: 8px; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.table-wrap::-webkit-scrollbar-track { background: transparent; }

.side-scroll::-webkit-scrollbar, .drawer-body::-webkit-scrollbar, .modal-card::-webkit-scrollbar { width: 8px; }
.side-scroll::-webkit-scrollbar-thumb, .drawer-body::-webkit-scrollbar-thumb, .modal-card::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.chart-svg text { font-family: inherit; }
.chart-bar:focus, .chart-point:focus, .chart-box:focus { outline: none; }
.chart-bar:focus-visible rect, .chart-point:focus-visible, .chart-box:focus-visible { stroke: var(--info); stroke-width: 2; }

.menu { max-height: min(70vh, 460px); overflow: auto; }
.server-menu { min-width: 290px; }
.server-option .check svg { width: 12px; height: 12px; }

.drawer .section-title .btn { margin-left: auto; }
.drawer .mat-head .num { text-align: right; }
.drawer .mat-row .sub { align-self: center; }
.drawer .mat-row .input, .drawer .mat-row .select { height: 30px; }
.drawer .mat-row .del { align-self: center; }

.notice b { color: var(--text); }
.notice .link { white-space: nowrap; }

table.data td .badge + .badge { margin-left: 3px; }
table.data th .sort-ind { font-size: 8px; opacity: .85; }
table.data tbody tr.selected td { background: color-mix(in srgb, var(--chart-1) 8%, transparent); }

.toolbar-wrap .switch { margin-left: 2px; }
.verification { flex-wrap: wrap; }

@media (max-width: 1280px) {
  .skill-nav-wrap { position: static; }
  .skill-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
}

@media (max-width: 768px) {
  .skill-nav-wrap { position: static; }
  .skill-nav { display: flex; flex-direction: row; overflow-x: auto; }
  .modal-wrap { padding: 10px; }
  .modal-card { max-height: 92vh; }
  .drawer-kpis { grid-template-columns: 1fr 1fr 1fr; }
  .drawer-kpi { padding: 8px; }
  .drawer-kpi b { font-size: 15px; }
}

/* 图标尺寸兜底：避免 SVG 默认 300×150 撑坏布局 */
.kpi-label svg, .server-trigger svg, .menu-item svg, .card-title svg,
.rec-item svg, .verification svg, .header-version svg { width: 13px; height: 13px; flex: none; }
.server-trigger svg { width: 14px; height: 14px; }
.menu-item svg { width: 14px; height: 14px; }
.kpi-label .info svg { width: 12px; height: 12px; }

/* 图标与数字输入细节 */
.skill-group-label svg { width: 12px; height: 12px; flex: none; }
.price-input::-webkit-outer-spin-button,
.price-input::-webkit-inner-spin-button,
.input[type="number"]::-webkit-outer-spin-button,
.input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.price-input, .input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

html.light .scrim { background: rgba(15, 23, 42, 0.38); }
body.has-drawer .toast-root { right: 600px; }
.price-input.sm { width: 86px; }
.price-input { width: 104px; }
@media (max-width: 768px) {
  body.has-drawer .toast-root { right: 16px; bottom: 82px; }
}
.side-foot .nav-item { width: 100%; }
@media (max-width: 768px) {
  .skill-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
  .skill-stats .skill-stat b { font-size: 15px; }
  table.data thead th[data-sort] { cursor: pointer; }
}

/* 移动端图表：保持字号可读，允许横向查看 */
@media (max-width: 768px) {
  #chart-overview, #chart-analysis, #chart-scatter, #chart-box { overflow-x: auto; overflow-y: hidden; }
  #chart-overview .chart-svg, #chart-analysis .chart-svg, #chart-scatter .chart-svg, #chart-box .chart-svg { min-width: 640px; }
  .reading-guide { padding-left: 14px; padding-right: 14px; }
}
.mobile-only { display: none; }
@media (max-width: 768px) {
  .mobile-only { display: inline; color: var(--muted-2); font-size: 10px; }
}
body.has-drawer, body.has-modal { overflow: hidden; }

/* 页面进入动画只在切换路由时播放；同一页筛选用重绘，不重播动画 */
.page { animation: none; }
.page.page-enter { animation: page-in 240ms ease-out both; }
html { overflow-anchor: none; }

/* 侧栏底部辅助区：按设计规范做低存在感文字链接，而非按钮块 */
.side-foot { padding: 7px 8px 12px; border-top: 1px solid var(--border); }
.side-link {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 30px;
  padding: 0 7px; border: 0; border-radius: 5px; background: transparent;
  color: var(--muted-2); font-size: 11.5px; font-weight: 400; text-align: left;
  transition: background 150ms ease, color 150ms ease;
}
.side-link:hover { background: var(--accent-2); color: var(--text); }
.side-link svg { width: 14px; height: 14px; flex: none; opacity: .8; }
.side-link .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-link .ext {
  flex: none; font-size: 9px; line-height: 14px; letter-spacing: .04em;
  color: var(--muted-2); border: 1px solid var(--border-soft); border-radius: 3px;
  padding: 0 4px;
}
.side-foot .side-link + .side-link { margin-top: 1px; }

/* 采集产出的掉率输入（仅采集配方编辑时显示） */
.chance-line { display: flex; align-items: center; margin-top: 3px; font-size: 9.5px; color: var(--muted-2); }
.chance-line span { margin-right: 4px; }
.chance-line .input { width: 64px; height: 24px; padding: 0 6px; margin-right: 4px; font-size: 10px; }

/* ------------------------------------------------------------------ */
/* Silent price sync indicator                                        */
/* ------------------------------------------------------------------ */
.data-sync {
  position: fixed;
  top: 12px;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 15000;
  display: -webkit-box;
  display: flex;
  -webkit-box-align: center;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: #0b1424;
  border: 1px solid #2a3b55;
  color: #f5f1e8;
  font-size: 12px;
  line-height: 1.4;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.38);
  pointer-events: none;
}

.data-sync[hidden] { display: none !important; }

.data-sync__spinner {
  width: 14px;
  height: 14px;
  margin-right: 8px;
  border-radius: 50%;
  border: 2px solid rgba(148, 163, 184, 0.25);
  border-top-color: #e8543e;
  animation: data-sync-spin 0.8s linear infinite;
  -webkit-box-flex: 0;
  flex: none;
}

.data-sync.is-done { border-color: rgba(95, 240, 164, 0.4); }
.data-sync.is-error { border-color: rgba(244, 63, 94, 0.45); }

.data-sync.is-done .data-sync__spinner,
.data-sync.is-error .data-sync__spinner { display: none; }

.data-sync.is-done::before,
.data-sync.is-error::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: #5ff0a4;
  flex: none;
}

.data-sync.is-error::before { background: #f43f5e; }

@keyframes data-sync-spin { to { transform: rotate(360deg); } }

html.light .data-sync {
  background: #ffffff;
  border-color: #e2e8f0;
  color: #0f172a;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.16);
}

@media (prefers-reduced-motion: reduce) {
  .data-sync__spinner { animation: none; }
}

/* ------------------------------------------------------------------ */
/* 五行石                                                             */
/* ------------------------------------------------------------------ */
.stone-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 22px;
  padding: 0 7px;
  border-radius: 5px;
  border: 1px solid color-mix(in srgb, var(--sc) 34%, transparent);
  background: color-mix(in srgb, var(--sc) 13%, transparent);
  color: var(--sc);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.stone-formula {
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text);
}

.stone-formula-sub {
  margin-top: 2px;
  max-width: 230px;
  font-size: 10px;
  line-height: 13px;
  color: var(--muted);
  white-space: normal;
}

.stone-table td { vertical-align: middle; }
.stone-table tbody tr.selected { box-shadow: inset 2px 0 0 var(--peak); }

.stone-price-table .price-input,
.stone-price-input {
  width: 92px;
  text-align: right;
}

.stone-be-bar {
  height: 3px;
  margin-top: 4px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.stone-be-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--warning), var(--danger));
}

.stone-prob-input {
  width: 72px;
  height: 26px;
  padding: 0 6px;
  text-align: right;
  font-size: 11px;
}

.stone-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.stone-mini {
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 42%, transparent);
}

.stone-mini .k {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
}

.stone-mini .v {
  margin-top: 7px;
  font-size: 21px;
  line-height: 25px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.stone-mini .v small {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0;
}

.stone-mini .v.warn { color: var(--warning); }
.stone-mini .s {
  margin-top: 5px;
  font-size: 10px;
  line-height: 15px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stone-conclusions { display: flex; flex-direction: column; gap: 10px; }
.stone-conclusion { display: flex; gap: 8px; align-items: flex-start; font-size: 11.5px; line-height: 17px; color: var(--muted); }
.stone-conclusion b {
  flex: none;
  min-width: 30px;
  color: var(--text);
  font-weight: 700;
}
.stone-conclusion span { min-width: 0; }

.stone-analysis-table { min-width: 0; }
.stone-analysis-grid > * { min-width: 0; }
.stone-analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.stone-analysis-chart {
  min-width: 0;
}

.stone-edit-rows { display: flex; flex-direction: column; gap: 6px; }
.stone-edit-row { display: flex; align-items: center; gap: 6px; }
.stone-edit-row .select { width: 104px; }
.stone-edit-row .input[type="number"] { width: 90px; }
.stone-edit-row .icon-btn { margin-left: auto; }

@media (max-width: 1000px) {
  .stone-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stone-analysis-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .stone-overview-grid { grid-template-columns: 1fr; }
  .stone-formula { white-space: normal; }
}

table.data.stone-table thead th,
table.data.stone-table tbody td { padding-left: 6px; padding-right: 6px; }
.stone-table .stone-formula { font-size: 11px; }

table.data.analysis-table thead th,
table.data.analysis-table tbody td { padding-left: 6px; padding-right: 6px; }
table.data.analysis-table { font-size: 12px; }

table.data.skill-table thead th,
table.data.skill-table tbody td { padding-left: 6px; padding-right: 6px; }

/* =========================================================================
   突破升级（1→50 晋秩路线）
   ========================================================================= */
.bt-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.bt-tab {
  display: inline-flex; align-items: center; height: 28px; padding: 0 12px;
  border-radius: 6px; border: 1px solid var(--border); background: var(--panel);
  color: var(--muted); font-size: 12px; text-decoration: none; white-space: nowrap;
}
.bt-tab:hover { color: var(--text); border-color: var(--muted-2); }
.bt-tab.active { background: var(--text); border-color: var(--text); color: var(--card); font-weight: 600; }
html.light .bt-tab.active { color: #fff; background: #0f172a; border-color: #0f172a; }
.bt-stratrow { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
/* 突破概览：一张紧凑卡代替 6 个 KPI + 两阶段表 */
.bt-summary .card-body { padding: 12px 16px; }
.bt-summary-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.bt-summary-row + .bt-summary-row { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border-soft); }
.bt-summary-lead { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.bt-summary-lead .k { font-size: 11px; color: var(--muted); }
.bt-summary-lead strong { font-size: 22px; line-height: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bt-summary-lead .u { font-size: 11px; color: var(--muted); }
.bt-summary-facts { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 12px; color: var(--muted); padding-top: 2px; }
.bt-summary-facts b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.bt-chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.bt-chip { font-size: 11.5px; color: var(--muted); background: var(--accent); border: 1px solid var(--border); border-radius: 4px; padding: 2px 8px; white-space: nowrap; }
.bt-chip b { color: var(--text); font-weight: 600; }
.bt-chip em { font-style: normal; font-variant-numeric: tabular-nums; }
.bt-summary-hint { font-size: 11px; color: var(--muted-2); text-align: right; max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-val-sub { display: block; font-style: normal; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 900px) {
  .bt-summary-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .bt-summary-hint { max-width: 100%; text-align: left; white-space: normal; }
}
.bt-seg a { text-decoration: none; }
.bt-seg a.active { }

.bt-row, .bt-gate { border-bottom: 1px solid var(--border-soft); }
.bt-row:last-child, .bt-gate:last-child { border-bottom: 0; }
.bt-row > summary, .bt-gate > summary { list-style: none; cursor: pointer; }
.bt-row > summary::-webkit-details-marker, .bt-gate > summary::-webkit-details-marker { display: none; }
.bt-row-head { display: flex; align-items: center; gap: 10px; padding: 10px 2px; }
.bt-row-head:hover { background: var(--accent-2); border-radius: 6px; }
.bt-band {
  flex: 0 0 78px; font-size: 11px; line-height: 20px; text-align: center;
  color: var(--info); background: color-mix(in srgb, var(--info) 11%, transparent);
  border: 1px solid color-mix(in srgb, var(--info) 28%, transparent);
  border-radius: 4px;
}
html.no-color-mix .bt-band { background: rgba(59, 130, 246, 0.1); border-color: rgba(59, 130, 246, 0.3); }
.bt-main { flex: 1; min-width: 0; }
.bt-main .nm { display: block; font-size: 13px; font-weight: 600; line-height: 19px; color: var(--text); }
.bt-main .ds { display: block; font-size: 11px; line-height: 17px; color: var(--muted); font-style: normal; }
.bt-main .ds small, .bt-main small.ds { font-size: 11px; }
.bt-val { flex: 0 0 auto; text-align: right; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bt-val small { display: block; font-size: 10px; font-weight: 400; color: var(--muted-2); }
.bt-val.pos { color: var(--positive); }

.bt-detail { margin: 0 0 12px 88px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 6px; }
.bt-cols { display: flex; gap: 24px; flex-wrap: wrap; }
.bt-col { flex: 1 1 180px; min-width: 0; }
.bt-col-wide { flex: 1 1 100%; }
.bt-col h4 { margin: 0 0 6px; font-size: 10.5px; font-weight: 600; color: var(--muted-2); letter-spacing: 0.06em; }
.bt-line { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 3px 0; }
.bt-line-main { min-width: 0; }
.bt-line .n { display: block; font-size: 12px; line-height: 17px; color: var(--text); }
.bt-line .s { display: block; font-size: 10.5px; line-height: 15px; color: var(--muted-2); }
.bt-line .v { flex: 0 0 auto; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--text); }
.bt-line .v.warn { color: var(--warning); }
.bt-foot { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border-soft); font-size: 10.5px; color: var(--muted); }

.bt-gate { margin: 8px 0; border: 1px solid color-mix(in srgb, var(--warning) 30%, transparent); border-radius: 6px; background: color-mix(in srgb, var(--warning) 6%, transparent); }
html.no-color-mix .bt-gate { border-color: rgba(245, 179, 1, 0.3); background: rgba(245, 179, 1, 0.05); }
.bt-gate:last-child { margin-bottom: 2px; }
.bt-gate-head { display: flex; align-items: center; gap: 10px; padding: 9px 10px; }
.bt-gate-ic {
  flex: 0 0 26px; height: 26px; border-radius: 5px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--warning) 18%, transparent); color: var(--warning);
  font-size: 11px; font-weight: 700;
}
html.no-color-mix .bt-gate-ic { background: rgba(245, 179, 1, 0.18); }
.bt-gate .chev { color: var(--muted-2); display: inline-flex; }
.bt-gate .chev svg { width: 16px; height: 16px; }
.bt-gate[open] .chev { transform: rotate(180deg); }
.bt-gate .bt-detail { margin: 0 10px 10px; }

.bt-mini-kpis { display: flex; gap: 24px; padding: 4px 2px 8px; flex-wrap: wrap; }
.bt-mini { flex: 1 1 160px; }
.bt-mini .k { display: block; font-size: 10.5px; color: var(--muted); }
.bt-mini .v { display: block; font-size: 20px; font-weight: 700; line-height: 26px; color: var(--text); font-variant-numeric: tabular-nums; }
.bt-mini .s { display: block; font-size: 10.5px; color: var(--muted-2); }
.bt-sum-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 2px;
  border-bottom: 1px solid var(--border-soft); text-decoration: none; color: inherit;
}
.bt-sum-row:last-child { border-bottom: 0; }
.bt-sum-row:hover { background: var(--accent-2); border-radius: 6px; }
.bt-sum-main { flex: 1; min-width: 0; }
.bt-sum-main .nm { display: block; font-size: 12.5px; font-weight: 600; color: var(--text); }
.bt-sum-main .ds { display: block; font-size: 10.5px; color: var(--muted); }
.bt-sum-row .bt-val { font-size: 13px; }

table.data tr.is-current td { background: color-mix(in srgb, var(--info) 7%, transparent); }
html.no-color-mix table.data tr.is-current td { background: rgba(59, 130, 246, 0.07); }

@media (max-width: 768px) {
  .bt-band { flex-basis: 66px; }
  .bt-detail { margin-left: 0; }
  .bt-main .nm { font-size: 12.5px; }
  .bt-main .ds, .bt-main small.ds { font-size: 10.5px; }
  .bt-mini-kpis { gap: 12px; }
  .bt-seg { width: 100%; }
}

/* 突破升级 · 满级行 */
.bt-row.bt-max .nm { color: var(--positive); }
.bt-row.bt-max .ds { color: var(--muted); }

/* 突破：同价三档产量比较与逐级门槛 */
.bt-scenarios { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.bt-scenario { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid var(--border); border-radius: 8px; color: inherit; }
.bt-scenario.active { border-color: var(--info); background: var(--accent-2); }
.bt-scenario strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.bt-experience > summary { cursor: pointer; }
.bt-exp-table { max-height: 360px; overflow: auto; }
@media (max-width: 640px) { .bt-scenarios { grid-template-columns: 1fr; } .bt-scenario strong { font-size: 22px; } }
html.light .bt-scenarios { --positive: #15803d; --warning: #a16207; --danger: #be123c; }
html.light .bt-experience { --positive: #15803d; --warning: #a16207; }

/* 盈亏符号在浅色主题下保持清晰。 */
html.light .bt-page { --positive: #15803d; --danger: #be123c; }
/* docs/design §3/5/7：16px 节奏、24px 数值、单位同行、颜色只编码盈亏。 */
.bt-page .bt-scenarios { gap: 16px; }
.bt-page .bt-scenario { min-width: 0; padding: 16px; border-radius: var(--radius); gap: 8px; transition: background-color 150ms ease-out, border-color 150ms ease-out; }
.bt-page .bt-scenario:hover { background: var(--accent-2); }
.bt-page .bt-scenario.active { border-color: var(--muted); background: var(--accent-2); }
.bt-page .bt-scenario:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }
.bt-page .bt-scenario strong { display: flex; align-items: baseline; gap: 4px; font-size: 24px; line-height: 32px; font-weight: 700; white-space: nowrap; }
.bt-page .bt-scenario strong small { font-size: 12px; line-height: 16px; font-weight: 400; color: var(--muted); }
.bt-page .bt-scenario strong.bt-scenario-empty { font-size: 14px; font-weight: 500; color: var(--muted); }
.bt-page .bt-scenario .tiny { font-size: 12px; line-height: 18px; }
.bt-page .bt-val, .bt-page .kpi-value { white-space: nowrap; }
@media (max-width: 768px) { .bt-page .bt-scenarios { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .bt-page .bt-scenario { transition: none; } }

/* ------------------------------------------------------------------ */
/* 物价走势                                                           */
/* ------------------------------------------------------------------ */
.page.trend-page { padding-top: 16px; }
.trend-page-head { min-height: 0; margin: 0 0 20px; }
.trend-filter-card { position: sticky; top: var(--header-h); z-index: 20; box-shadow: 0 8px 20px rgba(2, 8, 23, .08); }
.trend-filter-card .card-body { padding: 10px 14px; position: relative; }
.trend-filter-toggle { display: none; width: 100%; align-items: center; gap: 8px; padding: 0; border: 0; background: transparent; color: var(--text); font-size: 12px; text-align: left; cursor: pointer; }
.trend-filter-toggle-main { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; flex: none; }
.trend-filter-toggle-main svg { width: 14px; height: 14px; color: var(--muted); }
.trend-filter-toggle-sum { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; color: var(--muted); }
.trend-filter-toggle > svg { width: 14px; height: 14px; color: var(--muted); flex: none; transition: transform 150ms ease; }
.trend-filter-toggle[aria-expanded="true"] > svg { transform: rotate(180deg); }
.trend-filter-body.open { margin-top: 8px; }
.trend-filter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.trend-filter-field { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.trend-filter-field .select { height: 28px; font-size: 11.5px; }
.trend-time-group {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--input-bg);
}
.trend-time-label { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.trend-time-sep { font-size: 11px; color: var(--muted); }
.trend-date { width: 122px; height: 26px; font-size: 11.5px; border: 0; background: transparent; padding: 0 2px; }
.trend-hour { width: 76px; height: 26px; font-size: 11.5px; border: 0; background-color: transparent; padding-left: 6px; padding-right: 22px; }
.trend-price { width: 78px; height: 28px; font-size: 11.5px; padding: 0 7px; }
.trend-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; }

.trend-picker { position: relative; }
.trend-picker-summary {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 9px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--input-bg);
  color: var(--text); font-size: 11.5px; cursor: pointer; list-style: none; white-space: nowrap;
}
.trend-picker-summary::-webkit-details-marker { display: none; }
.trend-picker-summary b { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.trend-picker-summary em { font-style: normal; font-size: 9.5px; color: var(--muted-2); }
.trend-check-all { min-height: 24px; font-weight: 600; }
.trend-picker-summary svg { width: 12px; height: 12px; color: var(--muted); transition: transform 150ms ease; }
.trend-picker[open] .trend-picker-summary svg { transform: rotate(180deg); }
.trend-picker-panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30;
  width: 330px; max-width: calc(100vw - 32px);
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: var(--shadow-pop); padding: 10px;
}
.trend-picker-actions { display: flex; align-items: center; gap: 6px; padding-bottom: 8px; border-bottom: 1px solid var(--border-soft); }
.trend-picker-actions .tiny { margin-left: auto; }
.trend-picker-search { padding: 7px 0 5px; }
.trend-picker-search .input { width: 100%; height: 28px; font-size: 11.5px; }
.trend-picker-list { max-height: 280px; overflow: auto; padding-top: 2px; }
.trend-check {
  display: flex; align-items: center; gap: 7px; min-height: 28px; padding: 0 4px;
  font-size: 12px; color: var(--text); cursor: pointer; border-radius: 4px;
}
.trend-check:hover { background: var(--accent); }
.trend-check[hidden] { display: none; }
.trend-check input { accent-color: var(--chart-1); flex: none; }
.trend-check .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trend-check .tier { margin-left: auto; font-size: 10px; color: var(--muted); flex: none; }

.trend-heat-wrap { overflow: auto; max-height: 440px; border-top: 1px solid var(--border-soft); }
.trend-heatmap {
  width: 100%; border-collapse: separate; border-spacing: 0;
  font-size: 11px; font-variant-numeric: tabular-nums;
}
.trend-heatmap th, .trend-heatmap td { padding: 6px 9px; white-space: nowrap; border-bottom: 1px solid var(--border-soft); }
.trend-heatmap thead th {
  position: sticky; top: 0; z-index: 3; background: var(--card);
  font-size: 10px; font-weight: 500; color: var(--muted); text-align: right;
}
.trend-heatmap thead th:first-child { text-align: left; left: 0; z-index: 4; }
.trend-heatmap tbody th {
  position: sticky; left: 0; z-index: 2; background: var(--card); text-align: left;
  font-weight: 500; color: var(--text);
}
.trend-heatmap tbody tr:hover th, .trend-heatmap tbody tr:hover td { filter: brightness(1.06); }
.trend-heatmap td.is-missing { color: var(--muted-2); }
.trend-heat-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.trend-heatmap .trend-heat-name { display: inline-block; max-width: 170px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.trend-heatmap .trend-heat-tier { display: block; margin-top: 1px; font-size: 9.5px; color: var(--muted-2); }
.trend-heat-legend { display: flex; align-items: center; gap: 9px; font-size: 10.5px; color: var(--muted); }
.trend-heat-legend .item { display: inline-flex; align-items: center; gap: 4px; }
.trend-heat-legend .swatch { width: 9px; height: 9px; border-radius: 2px; background: var(--sw); }

.trend-chart-wrap { overflow-x: auto; overflow-y: hidden; padding: 4px 14px 8px; }
.trend-chart-wrap .chart-svg { display: block; }
.trend-chart-card .card-head { padding-bottom: 0; }
.trend-chart-card .card-tools .info { display: inline-flex; align-items: center; color: var(--muted-2); cursor: help; }
.trend-chart-card .card-tools .info svg { width: 13px; height: 13px; }
.trend-axis-seg { flex: none; }
.trend-axis-seg button { height: 24px; padding: 0 7px; font-size: 10.5px; }

.trend-rank-grid { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--border-soft); }
.trend-rank-col { padding: 10px 18px 14px; min-width: 0; }
.trend-rank-col + .trend-rank-col { border-left: 1px solid var(--border-soft); }
.trend-rank-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 4px 6px; font-size: 12px; font-weight: 600; }
.trend-rank-head .pos { color: var(--positive); }
.trend-rank-head .neg { color: var(--danger); }
.trend-rank-row { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 4px 4px; border-bottom: 1px solid var(--border-soft); cursor: pointer; border-radius: 4px; }
.trend-rank-row:last-child { border-bottom: 0; }
.trend-rank-row:hover { background: var(--accent); }
.trend-rank-no { width: 18px; flex: none; text-align: right; font-size: 10px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.trend-rank-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.trend-rank-change { width: 58px; flex: none; text-align: right; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.trend-rank-price { width: 70px; flex: none; text-align: right; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.trend-rank-empty { padding: 14px 4px; font-size: 11px; color: var(--muted-2); }
.trend-rank-all { border-top: 1px solid var(--border-soft); }
.trend-rank-all > summary { display: flex; align-items: center; gap: 8px; padding: 10px 18px; cursor: pointer; list-style: none; font-size: 12px; font-weight: 600; }
.trend-rank-all > summary::-webkit-details-marker { display: none; }
.trend-rank-all > summary .chev { margin-left: auto; color: var(--muted); transition: transform 150ms ease; }
.trend-rank-all[open] > summary .chev { transform: rotate(180deg); }
.trend-rank-all-wrap { max-height: 360px; overflow: auto; padding: 0 18px 12px; }
.trend-rank-all-wrap table { border-top: 1px solid var(--border-soft); }
.trend-rank-all-row { cursor: pointer; }
.trend-rank-all-row:hover { background: var(--accent); }
.trend-rank-all-row .trend-dot { display: inline-block; vertical-align: middle; margin-right: 5px; }
.trend-whisker { display: inline-block; width: 2px; height: 12px; background: var(--muted); position: relative; }
.trend-whisker::before, .trend-whisker::after { content: ""; position: absolute; left: -3px; width: 8px; height: 1px; background: var(--muted); }
.trend-whisker::before { top: 0; }
.trend-whisker::after { bottom: 0; }
.trend-avg { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--text); border: 1px solid var(--bg); }
.trend-ring-label { display: inline-flex; align-items: center; gap: 6px; }
.trend-rank-card .card-head { padding-bottom: 8px; }
.trend-raw-details { padding: 0; }
.trend-raw-summary {
  display: flex; align-items: center; gap: 10px; padding: 15px 18px; cursor: pointer;
  list-style: none; font-size: 15px; font-weight: 600; color: var(--text);
}
.trend-raw-summary::-webkit-details-marker { display: none; }
.trend-raw-summary .badge { font-weight: 500; }
.trend-raw-summary .chev { margin-left: auto; color: var(--muted); transition: transform 150ms ease; }
.trend-raw-details[open] .trend-raw-summary .chev { transform: rotate(180deg); }
.trend-raw-body { padding: 0 18px 16px; }
.trend-raw-tools { display: flex; align-items: center; gap: 6px; padding: 0 0 10px; }
.trend-raw-note { padding: 10px 12px; border: 1px dashed var(--border); border-radius: 8px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.trend-raw-note code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text); }
.server-range-note { margin-left: 8px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.trend-raw-body .table-wrap { border-top: 1px solid var(--border-soft); }
.trend-node-item { border-top: 1px solid var(--border-soft); }
.trend-node-item > summary { display: flex; align-items: center; gap: 8px; padding: 10px 0; cursor: pointer; list-style: none; font-size: 12px; }
.trend-node-item > summary::-webkit-details-marker { display: none; }
.trend-node-item > summary .chev { margin-left: auto; color: var(--muted); transition: transform 150ms ease; }
.trend-node-item[open] > summary .chev { transform: rotate(180deg); }
.trend-node-time { font-weight: 600; font-variant-numeric: tabular-nums; }
.trend-node-body { padding: 0 0 12px; }
.trend-node-body .table-wrap { max-height: 320px; }

@media (max-width: 900px) {
  .trend-rank-grid { grid-template-columns: 1fr; }
  .trend-rank-col + .trend-rank-col { border-left: 0; border-top: 1px solid var(--border-soft); }
}
@media (max-width: 768px) {
  .trend-filter-toggle { display: flex; }
  .trend-filter-body { display: none; }
  .trend-filter-body.open { display: block; }
  .trend-filter { align-items: flex-start; }
  .trend-time-group { flex: 1 1 100%; }
  .trend-time-sep { display: none; }
  .trend-date { flex: 1; width: auto; min-width: 0; }
  .trend-hour { flex: none; }
  .trend-filter-field { flex: 1 1 100%; }
  .trend-picker { flex: 1 1 100%; }
  .trend-picker-summary { width: 100%; justify-content: space-between; }
  .trend-picker-panel { position: static; width: auto; max-width: none; margin-top: 6px; box-shadow: none; }
  .trend-heatmap .trend-heat-name { max-width: 110px; }
}

/* 开发预览环境标识 */
.dev-badge { align-self: center; margin-right: 2px; letter-spacing: 0.08em; }

/* ------------------------------------------------------------------ */
/* 区服趋势                                                           */
/* ------------------------------------------------------------------ */
.server-filter-card .card-body { padding: 9px 12px; }
.server-filter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.server-filter .seg-sm { flex: none; }
.server-filter .trend-picker { flex: none; }
.server-page-sub { max-width: 760px; }
.server-keywords { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 32px; margin: 10px 0 8px; }
.server-keywords-label { font-size: 9.5px; font-weight: 600; letter-spacing: .06em; color: var(--muted-2); text-transform: uppercase; margin-right: 2px; }
.server-kw {
  display: inline-flex; align-items: center; gap: 5px; height: 25px; padding: 0 8px;
  border: 1px solid var(--border); border-radius: 4px; background: transparent;
  color: var(--muted); font-size: 10px; white-space: nowrap; cursor: default;
}
.server-kw b { font-weight: 600; color: var(--text); }
.server-kw.pos { border-color: rgba(69,212,131,.28); background: rgba(69,212,131,.07); color: var(--positive); }
.server-kw.neg { border-color: rgba(244,63,94,.28); background: rgba(244,63,94,.07); color: var(--danger); }
.server-kw.warn { border-color: rgba(234,179,8,.28); color: var(--warning); }
.server-kw.active { border-color: rgba(91,143,249,.45); background: rgba(91,143,249,.10); color: var(--text); cursor: pointer; }
.server-kw[data-server-keyword] { cursor: pointer; }
.server-kw[data-server-keyword]:hover { border-color: var(--muted-2); color: var(--text); }
.server-keywords-hint { font-size: 8.5px; color: var(--muted-2); margin-left: auto; }
.server-kpis .kpi { min-width: 0; }
.server-kpis .kpi-value { display: flex; align-items: baseline; gap: 2px; white-space: nowrap; }
.server-kpis .kpi-value .server-dot { width: 7px; height: 7px; align-self: center; }
.mini-bar { height: 4px; border-radius: 2px; overflow: hidden; display: flex; background: var(--border); margin-top: 6px; }
.mini-bar i { height: 100%; display: block; }
.server-heat-wrap { overflow: auto; max-height: none; border-top: 1px solid var(--border-soft); }
.server-heatmap { width: 100%; min-width: 760px; }
.server-heatmap tbody tr { cursor: pointer; }
.server-heatmap tbody tr:hover td, .server-heatmap tbody tr:hover th { filter: brightness(1.05); }
.server-heatmap tbody tr.sel td { box-shadow: inset 0 0 0 1px rgba(91,143,249,.32); }
.server-heatmap tbody tr.sel th { box-shadow: inset 2px 0 0 var(--info); }
.server-heatmap .low-badge, .server-skill-table .low-badge { margin-left: 4px; }
.server-rank-wrap { overflow: auto; max-height: 560px; border-top: 1px solid var(--border-soft); }
.server-rank { width: 100%; min-width: 570px; }
.server-rank tbody tr { cursor: pointer; }
.server-rank tbody tr:hover { background: var(--accent); }
.server-rank tbody tr.sel { background: rgba(91,143,249,.08); }
.server-rank tbody tr.sel td:first-child { box-shadow: inset 2px 0 0 var(--info); }
.server-rank-name { margin-left: 5px; }
.server-rank-top { max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
.server-coverage { display: inline-block; width: 28px; height: 3px; border-radius: 2px; background: var(--border); vertical-align: middle; margin-right: 4px; overflow: hidden; }
.server-coverage i { display: block; height: 100%; background: var(--muted); }
.server-skill-wrap { overflow: auto; max-height: 600px; border-top: 1px solid var(--border-soft); }
.server-skill-table { width: 100%; min-width: 1020px; border-collapse: separate; border-spacing: 0; font-size: 10px; font-variant-numeric: tabular-nums; }
.server-skill-table th, .server-skill-table td { height: 27px; padding: 0 7px; border-bottom: 1px solid var(--border-soft); white-space: nowrap; }
.server-skill-table thead th { position: sticky; top: 0; z-index: 3; background: var(--card); font-size: 9px; font-weight: 500; color: var(--muted); text-align: center; }
.server-skill-table thead th:first-child { text-align: left; left: 0; z-index: 4; }
.server-skill-table tbody th { position: sticky; left: 0; z-index: 2; background: var(--card); text-align: left; font-weight: 500; }
.server-skill-table td { text-align: center; cursor: pointer; }
.server-skill-table td small { display: block; margin-top: -2px; font-size: 7.5px; color: var(--muted-2); }
.server-skill-table td.miss { color: var(--muted-2); cursor: default; }
.server-skill-table tbody tr:hover td, .server-skill-table tbody tr:hover th { filter: brightness(1.05); }
.server-skill-table tbody tr.sel th { box-shadow: inset 2px 0 0 var(--info); }
.server-skill-table .stone { color: #c084fc; }
.server-detail-body { padding: 0 16px 14px; border-top: 1px solid var(--border-soft); }
.server-cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px 0; }
.server-cat { border: 1px solid var(--border); border-radius: 5px; padding: 7px 9px; background: rgba(255,255,255,.015); }
.server-cat .k { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.server-cat .v { font-size: 14px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.server-cat .t { font-size: 8.5px; color: var(--muted-2); margin-top: 1px; }
.server-movers { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.server-mover-head { font-size: 10px; font-weight: 600; padding: 2px 0 5px; }
.server-mover-row { display: flex; align-items: center; gap: 8px; height: 27px; border-bottom: 1px solid var(--border-soft); color: var(--text); text-decoration: none; }
.server-mover-row:last-child { border-bottom: 0; }
.server-mover-row:hover { background: var(--accent); }
.server-mover-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-mover-row .chg { width: 56px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.server-mover-row .px { width: 64px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.server-empty { padding: 10px 0; color: var(--muted-2); font-size: 10px; }
.low-badge { display: inline-block; border: 1px solid var(--border); border-radius: 3px; padding: 0 3px; font-size: 8px; color: var(--muted-2); margin-left: 4px; vertical-align: middle; }
.server-page .card-head { padding-bottom: 8px; }
@media (max-width: 900px) {
  .server-filter { align-items: flex-start; }
  .server-filter .seg-sm { flex: 1 1 100%; }
  .server-filter .trend-picker { flex: 1 1 100%; }
  .server-filter .trend-picker-summary { width: 100%; justify-content: space-between; }
  .server-filter .trend-picker-panel { position: static; width: auto; max-width: none; margin-top: 5px; box-shadow: none; }
  .server-filter .filter-note { margin-left: 0; }
  .server-keywords { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 3px; }
  .server-keywords-hint { display: none; }
  .server-kw { flex: none; }
  .server-kpis { grid-template-columns: 1fr 1fr; }
  .server-heatmap { min-width: 680px; }
  .server-rank { min-width: 540px; }
  .server-skill-table { min-width: 960px; }
  .server-cats { grid-template-columns: 1fr 1fr; }
  .server-movers { grid-template-columns: 1fr; gap: 8px; }
  .server-page .card-tools .btn { font-size: 10px; }
}
.server-dot{display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--c,#64748B);flex:none;vertical-align:middle;}
.server-keywords-label{flex:none;white-space:nowrap;}
.server-filter-toggle{display:none;}
@media (max-width: 900px){
  .server-filter-toggle{display:flex;align-items:center;gap:8px;width:100%;height:38px;padding:0 10px;margin-bottom:6px;border:1px solid var(--border);border-radius:5px;background:transparent;color:var(--text);font-size:11px;}
  .server-filter-toggle .sum{flex:1;text-align:left;color:var(--muted);font-size:9.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
  .server-filter-toggle .chev{transition:transform .15s ease;}
  .server-filter-toggle.open .chev{transform:rotate(180deg);}
  .server-filter-body{display:none;}
  .server-filter-body.open{display:block;}
}

/* 区服趋势 · 物品视角 */
.server-view-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 5px; overflow: hidden; height: 28px; margin: 6px 0 0; }
.server-view-switch button { border: 0; border-right: 1px solid var(--border); background: transparent; color: var(--muted); font-size: 10px; padding: 0 11px; }
.server-view-switch button:last-child { border-right: 0; }
.server-view-switch button.on { background: var(--accent); color: var(--text); font-weight: 600; }
.server-item-filter .server-item-picker { min-width: 190px; }
.server-item-panel { width: 360px; }
.server-item-option { display: flex; align-items: center; gap: 7px; width: 100%; min-height: 27px; border: 0; border-bottom: 1px solid var(--border-soft); background: transparent; color: var(--text); text-align: left; padding: 3px 7px; font-size: 10px; }
.server-item-option:last-child { border-bottom: 0; }
.server-item-option:hover { background: var(--accent); }
.server-item-option.on { background: rgba(91,143,249,.10); box-shadow: inset 2px 0 0 var(--info); }
.server-item-option[hidden] { display: none !important; }
.server-item-rank-table tbody tr[hidden] { display: none !important; }
.server-item-option .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.server-item-option .meta { font-size: 8px; color: var(--muted-2); white-space: nowrap; }
.server-item-quick { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 27px; margin: 12px 0 10px; }
.server-item-quick .lab { font-size: 9px; letter-spacing: .05em; color: var(--muted-2); text-transform: uppercase; margin-right: 2px; }
.server-quick-chip { height: 23px; border: 1px solid var(--border); border-radius: 4px; background: transparent; color: var(--muted); font-size: 9.5px; padding: 0 7px; white-space: nowrap; }
.server-quick-chip.on { border-color: rgba(91,143,249,.45); background: rgba(91,143,249,.09); color: var(--text); }
.server-quick-note { margin-left: auto; font-size: 8.5px; color: var(--muted-2); }
.server-kpis.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.server-kpis.five .kpi { min-height: 78px; }
.server-kpis.five .kpi-value { font-size: 22px; }
.server-kpis.five .kpi-value.small-two { font-size: 15px; line-height: 22px; }
.server-low-note { grid-column: 1 / -1; font-size: 9px; color: var(--warning); border: 1px solid rgba(234,179,8,.22); border-radius: 4px; padding: 4px 7px; }
.server-dist-wrap { overflow-x: auto; border-top: 1px solid var(--border-soft); padding: 8px 12px 10px; }
.server-dist-chart { min-width: 600px; }
.server-dist-head { display: flex; align-items: center; gap: 8px; padding: 0 0 5px; margin-left: 126px; font-size: 8.5px; color: var(--muted-2); }
.server-dist-head .sp { flex: 1; }
.server-dist-head .val { width: 58px; text-align: right; }
.server-dist-row { display: grid; grid-template-columns: 118px minmax(0, 1fr) 58px; align-items: center; gap: 8px; height: 26px; border-bottom: 1px solid var(--border-soft); }
.server-dist-row:last-child { border-bottom: 0; }
.server-dist-name { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.server-dist-name .reg { font-size: 8px; color: var(--muted-2); }
.server-dist-track { position: relative; height: 12px; border-radius: 2px; background: var(--accent); overflow: hidden; }
.server-dist-zero { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--muted-2); opacity: .55; }
.server-dist-median { position: absolute; top: -2px; bottom: -2px; width: 1px; background: #93c5fd; z-index: 2; }
.server-dist-bar { position: absolute; top: 3px; height: 6px; border-radius: 2px; opacity: .84; }
.server-dist-bar.pos { left: 50%; background: var(--positive); width: var(--w); }
.server-dist-bar.neg { right: 50%; background: var(--danger); width: var(--w); }
.server-dist-bar.flat { left: calc(50% - 2px); width: 4px; background: var(--muted-2); }
.server-dist-missing { position: absolute; left: 6px; top: 0; font-size: 8px; color: var(--muted-2); line-height: 12px; }
.server-dist-val { text-align: right; font-size: 10px; font-weight: 600; font-variant-numeric: tabular-nums; }
.server-dist-legend { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 8.5px; color: var(--muted-2); padding: 5px 0 0; margin-left: 126px; }
.server-dist-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 3px; vertical-align: -1px; }
.server-dist-legend .median-line { width: 12px; height: 1px; background: #93c5fd; display: inline-block; margin-right: 3px; vertical-align: 3px; }
.server-dist-foot { margin-left: 126px; padding-top: 6px; font-size: 8.5px; color: var(--muted-2); }
.server-rank-search { display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-top: 1px solid var(--border-soft); }
.server-rank-search input { flex: 1; min-width: 0; height: 26px; border: 1px solid var(--border); border-radius: 5px; background: transparent; color: var(--text); font-size: 10px; padding: 0 8px; }
.server-item-rank-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 10px; font-variant-numeric: tabular-nums; }
.server-item-rank-table th, .server-item-rank-table td { height: 28px; padding: 0 7px; border-bottom: 1px solid var(--border-soft); white-space: nowrap; text-align: right; }
.server-item-rank-table thead th { font-size: 8.5px; color: var(--muted-2); font-weight: 500; }
.server-item-rank-table thead th:first-child, .server-item-rank-table tbody td:first-child { text-align: left; }
.server-item-rank-table tbody tr { cursor: pointer; }
.server-item-rank-table tbody tr:hover { background: var(--accent); }
.server-item-rank-table tbody tr.sel { background: rgba(91,143,249,.08); }
.server-item-rank-table tbody tr.sel td:first-child { box-shadow: inset 2px 0 0 var(--info); }
.server-item-rank-table .server-item-name { margin-left: 5px; }
.server-item-rank-table .updown .u, .server-item-rank-table .updown .pos { color: var(--positive); }
.server-item-rank-table .updown .d, .server-item-rank-table .updown .neg { color: var(--danger); }
.server-rank-foot { font-size: 8px; color: var(--muted-2); text-align: right; padding: 0 12px 7px; }
.server-item-table-wrap { overflow-x: auto; border-top: 1px solid var(--border-soft); }
.server-item-table { width: 100%; min-width: 620px; border-collapse: separate; border-spacing: 0; font-size: 10px; font-variant-numeric: tabular-nums; }
.server-item-table th, .server-item-table td { height: 27px; padding: 0 9px; border-bottom: 1px solid var(--border-soft); white-space: nowrap; text-align: right; }
.server-item-table thead th { font-size: 8.5px; color: var(--muted-2); font-weight: 500; }
.server-item-table thead th:first-child, .server-item-table tbody td:first-child { text-align: left; }
.server-item-table tbody tr { cursor: pointer; }
.server-item-table tbody tr:hover { background: var(--accent); }
.server-item-table tbody tr.miss { cursor: default; opacity: .65; }
.server-item-insight { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; background: rgba(255,255,255,.015); }
.server-item-insight .item { font-size: 9.5px; line-height: 15px; color: var(--muted); }
.server-item-insight .item b { color: var(--text); }
.server-item-insight .item:before { content: ""; display: block; width: 14px; height: 2px; border-radius: 1px; background: var(--muted-2); margin-bottom: 5px; }
@media (max-width: 900px) {
  .server-view-switch { width: 100%; margin-top: 5px; }
  .server-view-switch button { flex: 1; }
  .server-item-quick { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .server-quick-chip { flex: none; }
  .server-quick-note { display: none; }
  .server-kpis.five { grid-template-columns: 1fr 1fr; }
  .server-kpis.five .kpi:last-child { grid-column: span 2; }
  .server-item-filter .server-item-picker { min-width: 0; }
  .server-dist-chart { min-width: 620px; }
  .server-item-rank-wrap { max-height: 300px; }
  .server-item-rank-table { min-width: 500px; }
  .server-item-table { min-width: 620px; }
  .server-item-insight { grid-template-columns: 1fr; gap: 8px; }
}
.server-item-rank-wrap{max-height:448px;overflow:auto}
.server-item-rank-wrap thead th{position:sticky;top:0;z-index:2;background:var(--card)}
.server-search-hint{font-size:8px;color:var(--muted-2);padding:4px 8px 2px}

/* 区服趋势 · 字号对齐 docs/design（正文/表格 ≥12，微标签 ≥10，图例 ≥10.5） */
.server-page .filter-group,
.server-page .filter-note,
.server-page .server-filter-toggle,
.server-page .server-filter-toggle .sum { font-size: 12px; }
.server-page .filter-group .flabel { font-size: 11.5px; }
.server-page .seg.seg-sm button { font-size: 12px; }
.server-page .server-view-switch { height: 30px; }
.server-page .server-view-switch button { font-size: 11.5px; }
.server-page .server-keywords-label { font-size: 10.5px; }
.server-page .server-kw { font-size: 11.5px; height: 28px; }
.server-page .server-keywords-hint { font-size: 10.5px; }
.server-page .trend-picker-summary { height: 30px; font-size: 12px; }
.server-page .trend-picker-summary em { font-size: 10.5px; }
.server-page .trend-picker-search .input { height: 30px; font-size: 12px; }
.server-page .trend-check { min-height: 30px; font-size: 12px; }
.server-page .trend-check .tier { font-size: 10.5px; }
.server-page .server-item-option { min-height: 32px; font-size: 12px; }
.server-page .server-item-option .meta { font-size: 10px; }
.server-page .server-search-hint { font-size: 10px; }
.server-page .server-quick-chip { height: 26px; font-size: 11px; }
.server-page .server-item-quick .lab { font-size: 10.5px; }
.server-page .server-quick-note { font-size: 10px; }
.server-page .server-low-note { font-size: 11px; }
.server-page .chart-legend { font-size: 10.5px; }
.server-page .server-heatmap { font-size: 13px; }
.server-page .server-heatmap thead th { font-size: 12px; }
.server-page .server-heatmap th, .server-page .server-heatmap td { height: 32px; }
.server-page .server-rank { font-size: 14px; }
.server-page .server-rank thead th { font-size: 12px; }
.server-page .server-rank tbody td { height: 32px; }
.server-page .server-skill-table { font-size: 14px; }
.server-page .server-skill-table th, .server-page .server-skill-table td { height: 34px; }
.server-page .server-skill-table thead th { font-size: 12px; }
.server-page .server-skill-table td small { font-size: 10px; }
.server-page .server-cat .k, .server-page .server-cat .t { font-size: 10.5px; }
.server-page .server-cat .v { font-size: 15px; }
.server-page .server-mover-head { font-size: 11.5px; }
.server-page .server-mover-row { height: 30px; }
.server-page .server-empty { font-size: 11.5px; }
.server-page .low-badge { font-size: 10px; padding: 1px 4px; }
.server-page .server-dist-head { font-size: 10.5px; }
.server-page .server-dist-row { height: 30px; }
.server-page .server-dist-name { font-size: 12px; }
.server-page .server-dist-name .reg { font-size: 10px; }
.server-page .server-dist-val { font-size: 12.5px; }
.server-page .server-dist-missing { font-size: 10px; }
.server-page .server-dist-legend, .server-page .server-dist-foot { font-size: 10.5px; }
.server-page .server-rank-search input { height: 30px; font-size: 12px; }
.server-page .server-item-rank-table { font-size: 14px; }
.server-page .server-item-rank-table th, .server-page .server-item-rank-table td { height: 32px; }
.server-page .server-item-rank-table thead th { font-size: 12px; }
.server-page .server-rank-foot { font-size: 10px; }
.server-page .server-item-table { font-size: 14px; }
.server-page .server-item-table th, .server-page .server-item-table td { height: 34px; }
.server-page .server-item-table thead th { font-size: 12px; }
.server-page .server-item-insight .item { font-size: 12px; line-height: 18px; }
.server-page .card-tools .btn { font-size: 11.5px; }
.server-page .server-kpis.five .kpi-value { font-size: 24px; }
.server-page .server-kpis.five .kpi-value.small-two { font-size: 16px; line-height: 24px; }
.server-page .page-head > div:first-child { min-width: 0; flex: 1; }
.server-page .server-page-sub { max-width: 100%; overflow-wrap: anywhere; white-space: normal; }

/* 区服趋势 · 去掉页级说明，收紧标题上下节奏 */
.server-page .server-page-sub { display: none; }
.server-page .page-head { min-height: 0; margin: 8px 0 14px; align-items: center; }
.server-page .server-view-switch { margin: 0 0 14px; }

/* ------------------------------------------------------------------ */
/* 制作收益 · 物价 / 精力收益比 Tab                                     */
/* ------------------------------------------------------------------ */
.profit-page-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  /* 与 .section-gap 的 16px 节奏对齐：Tab 上方要有明确留白，不能贴住筛选栏 */
  margin: 16px 0 14px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--accent);
}
.profit-page-tabs button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  line-height: 26px;
  padding: 0 14px;
  cursor: pointer;
}
.profit-page-tabs button.on {
  background: var(--card);
  color: var(--foreground);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
}
.profit-hero-card .card-head { align-items: flex-start; }
.profit-season {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 10px;
  color: var(--muted-foreground);
  white-space: nowrap;
}
.profit-status {
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 10px;
  line-height: 16px;
  font-weight: 600;
  white-space: nowrap;
}
.profit-status.ok { color: var(--positive); background: rgba(69, 212, 131, .12); }
.profit-status.missing { color: var(--warning); background: rgba(245, 158, 11, .12); }
.profit-summary {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.profit-summary .profit-main { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.profit-summary .profit-main .big { font-size: 34px; line-height: 38px; font-weight: 700; font-variant-numeric: tabular-nums; }
.profit-summary .profit-main .unit { font-size: 11px; color: var(--muted-foreground); margin-bottom: 5px; }
.profit-stats { display: grid; grid-template-columns: repeat(4, minmax(100px, 1fr)); gap: 8px; flex: 1; min-width: 360px; }
.profit-stats > div { border: 1px solid var(--border); border-radius: 6px; padding: 7px 9px; background: var(--panel); }
.profit-stats span { display: block; font-size: 10px; color: var(--muted-foreground); }
.profit-stats b { display: block; margin-top: 3px; font-size: 14px; font-variant-numeric: tabular-nums; }
.profit-feasibility {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border: 1px solid rgba(69, 212, 131, .24);
  background: rgba(69, 212, 131, .06);
  border-radius: 6px;
  padding: 7px 9px;
  margin: 4px 0 10px;
  font-size: 10px;
  color: var(--muted-foreground);
}
.profit-feasibility .ok { color: var(--positive); font-weight: 600; }
.profit-feasibility.miss { border-color: rgba(245, 158, 11, .3); background: rgba(245, 158, 11, .06); }
.profit-feasibility .miss { color: var(--warning); font-weight: 600; }
.profit-chart-wrap { border: 1px solid var(--border); border-radius: 6px; background: var(--card); overflow-x: auto; }
.profit-chart-wrap .chart-svg { display: block; }
.profit-legend { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 10px; color: var(--muted-foreground); margin-top: 7px; }
.profit-legend i { display: inline-block; width: 9px; height: 3px; border-radius: 1px; margin-right: 4px; vertical-align: 1px; }
.profit-empty { padding: 30px 14px; text-align: center; font-size: 11px; color: var(--muted-foreground); }
.profit-table-wrap { width: 100%; overflow-x: auto; border-top: 1px solid var(--border); }
.profit-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 11px; font-variant-numeric: tabular-nums; }
.profit-table th, .profit-table td { height: 28px; padding: 0 9px; border-bottom: 1px solid var(--border); white-space: nowrap; text-align: right; }
.profit-table th:first-child, .profit-table td:first-child,
.profit-table th:nth-child(2), .profit-table td:nth-child(2) { text-align: left; }
.profit-table thead th { font-size: 10px; color: var(--muted-foreground); font-weight: 500; background: var(--accent); }
.profit-table tbody tr:hover { background: var(--accent-2); }
.profit-table tr[data-profit-pick] { cursor: pointer; }
.profit-note { border-top: 1px solid var(--border); padding: 7px 14px 9px; font-size: 9.5px; color: var(--muted-foreground); }
.profit-skill-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.profit-skill-tabs button {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted-foreground);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 10px;
  cursor: pointer;
}
.profit-skill-tabs button.on { background: var(--accent); color: var(--text); font-weight: 600; }
.profit-top10-card .card-head { align-items: flex-start; gap: 10px; }
.profit-top10-card .card-tools { max-width: 100%; }

@media (max-width: 760px) {
  .profit-page-tabs { width: 100%; }
  .profit-page-tabs button { flex: 1; }
  .profit-stats { grid-template-columns: 1fr 1fr; min-width: 0; width: 100%; }
  .profit-summary .profit-main .big { font-size: 28px; line-height: 32px; }
  .profit-chart-wrap .chart-svg { min-width: 680px; }
  .profit-table { min-width: 640px; }
  .profit-top10-card .card-head { flex-direction: column; }
}
html:not(.light) .profit-page-tabs button.on { background: #334155; color: #f8fafc; }
@media (max-width: 768px) {
  .landability-kpis { grid-template-columns: 1fr 1fr; }
}

/* 物价历史加载进度 */
.history-loading-card { padding: 18px 20px 16px; }
.history-loading-main { display: flex; align-items: flex-start; gap: 12px; }
.history-loading-main .card-title { margin: 0 0 4px; }
.history-spinner {
  width: 18px; height: 18px; flex: 0 0 18px; margin-top: 3px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--positive) 30%, transparent);
  border-top-color: var(--positive);
  animation: history-spin .8s linear infinite;
}
@keyframes history-spin { to { transform: rotate(360deg); } }
.history-progress { height: 6px; margin-top: 14px; border-radius: 999px; background: var(--accent-2); overflow: hidden; }
.history-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--positive), #2AA5B8); transition: width .25s ease; }
.history-loading-meta { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; font-size: 10.5px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.history-loading-retry { color: var(--warning); }
@media (max-width: 768px) {
  .history-loading-card { padding: 14px; }
  .history-loading-meta { gap: 10px; font-size: 10px; }
}
/* PWA 更新提示：独立命名空间，不依赖应用内组件 */
.pwa-update {
  position: fixed;
  z-index: 10000;
  left: 50%;
  bottom: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: calc(100vw - 28px);
  max-width: 560px;
  width: min(560px, calc(100vw - 28px));
  box-sizing: border-box;
  padding: 15px 18px 14px;
  color: #f5f1e8;
  background: #0b1424;
  border: 1px solid #2a3b55;
  border-top: 3px solid #c8102e;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.52);
  font: 14px/1.5 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  animation: pwa-up 220ms ease-out both;
}

@keyframes pwa-up {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.pwa-update__head {
  display: flex;
  align-items: center;
  font-size: 12px;
  color: #8fa3bf;
}

.pwa-update__tag {
  margin-right: 8px;
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 5px;
  background: #c8102e;
  color: #fff8ec;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.pwa-update__head-text { color: #f5f1e8; font-weight: 600; }

.pwa-update__date { margin-left: auto; font-variant-numeric: tabular-nums; }

.pwa-update__title {
  margin-top: 8px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  color: #ffffff;
}

.pwa-update__notes {
  margin: 8px 0 13px;
  padding: 0;
  list-style: none;
  color: #cfd9e8;
  font-size: 13px;
  line-height: 1.55;
}

.pwa-update__notes li {
  position: relative;
  padding-left: 14px;
  margin-top: 3px;
}

.pwa-update__notes li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #e8543e;
}

.pwa-update__actions {
  display: flex;
  justify-content: flex-end;
}

.pwa-update__actions button + button { margin-left: 8px; }

.pwa-update__later,
.pwa-update__go {
  height: 34px;
  padding: 0 15px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.pwa-update__later {
  background: transparent;
  border-color: #2a3b55;
  color: #9fb2cc;
}

.pwa-update__later:hover { background: #13203a; color: #f5f1e8; }

.pwa-update__go {
  background: #c8102e;
  color: #fff8ec;
}

.pwa-update__go:hover { background: #e0241a; }

.pwa-update__progress {
  margin-top: 12px;
}

.pwa-update__track {
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  overflow: hidden;
}

.pwa-update__track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e8543e, #e8b44a);
  transition: width 280ms ease;
}

.pwa-update__status {
  margin-top: 8px;
  font-size: 12px;
  color: #9fb2cc;
}

html.light .pwa-update__track { background: rgba(100, 116, 139, 0.18); }
html.light .pwa-update__status { color: #64748b; }

html.light .pwa-update {
  background: #ffffff;
  color: #0f172a;
  border-color: #e2e8f0;
  border-top-color: #c8102e;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.2);
}

html.light .pwa-update__head { color: #64748b; }
html.light .pwa-update__head-text,
html.light .pwa-update__title { color: #0f172a; }
html.light .pwa-update__notes { color: #475569; }
html.light .pwa-update__later { border-color: #e2e8f0; color: #64748b; }
html.light .pwa-update__later:hover { background: #f1f5f9; color: #0f172a; }

@media (max-width: 520px) {
  .pwa-update {
    bottom: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    width: calc(100vw - 20px);
    padding: 13px 14px 12px;
    border-radius: 14px;
  }
  .pwa-update__title { font-size: 16px; }
  .pwa-update__notes { font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .pwa-update { animation: none; }
}
/* iOS/Android 添加到桌面引导 */
.pwa-install {
  position: fixed;
  z-index: 10020;
  left: 50%;
  bottom: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  width: calc(100vw - 24px);
  max-width: 520px;
  box-sizing: border-box;
  padding: 15px 16px 13px;
  border-radius: 14px;
  border: 1px solid #2a3b55;
  border-top: 3px solid #c8102e;
  background: #0b1424;
  color: #f5f1e8;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  font: 13px/1.55 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  animation: pwa-install-up 220ms ease-out both;
}
@keyframes pwa-install-up {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.pwa-install__head { display: flex; align-items: center; }
.pwa-install__title { font-size: 15px; font-weight: 700; color: #fff; }
.pwa-install__close {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #94a3b8;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.pwa-install__close:hover { background: #16243a; color: #fff; }
.pwa-install__body { margin-top: 6px; color: #cbd5e1; font-size: 12.5px; }
.pwa-install__body b { color: #fff; font-weight: 600; }
.pwa-install__share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  margin: 0 2px;
  padding: 0 5px;
  border: 1px solid #3b4d66;
  border-radius: 5px;
  color: #f5f1e8;
  font-size: 13px;
  vertical-align: -5px;
}
.pwa-install__actions { display: flex; justify-content: flex-end; margin-top: 10px; }
.pwa-install__ok {
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  background: #c8102e;
  color: #fff8ec;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.pwa-install__ok:hover { background: #e0241a; }
@media (max-width: 520px) {
  .pwa-install { bottom: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); padding: 13px 14px 12px; }
  .pwa-install__body { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { .pwa-install { animation: none; } }
