:root {
  --bg: #0a0e14;
  --surface: #12171f;
  --text: #e8edf2;
  --muted: #8b949e;
  --border: #2a323d;
  --border-subtle: #1a2129;
  --border-strong: #3a4452;
  --surface-muted: #181f28;
  --surface-subtle: #0a0e14;
  --surface-hover: #222b36;
  --primary: #58a6ff;
  --primary-hover: #79b8ff;
  --accent: #d4a574;
  --accent-ghost: rgba(212, 165, 116, 0.25);
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
  --shadow-elevated: 0 12px 32px rgba(0, 0, 0, 0.38), 0 2px 8px rgba(0, 0, 0, 0.22);
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 4px 20px rgba(0, 0, 0, 0.22);
  --glass: rgba(14, 18, 26, 0.88);
  --nav-active-bg: rgba(88, 166, 255, 0.14);
  --nav-active-ring: rgba(88, 166, 255, 0.28);
  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --layout-max: 1400px;
  --layout-pad-x: 20px;
  --site-header-top-h: 48px;
  --site-header-nav-h: 38px;
  --site-header-h: calc(var(--site-header-top-h) + var(--site-header-nav-h));
  --site-footer-h: 32px;
  --main-vpad: 16px;
  --main-vpad-fit: 10px;
  --page-fit-h: calc(100dvh - var(--site-header-h) - var(--site-footer-h) - var(--main-vpad-fit));
  --scrollbar-size: 4px;
  --scrollbar-thumb: rgba(180, 190, 205, 0.32);
  --scrollbar-thumb-hover: rgba(200, 210, 225, 0.5);
  --scrollbar-color: rgba(180, 190, 205, 0.35) transparent;
  --chart-nav-bg: #0f1419;
}

html {
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #eef0f3;
  --surface: #ffffff;
  --text: #14171b;
  --muted: #5f6b7a;
  --border: #dde1e7;
  --border-subtle: #e8ebef;
  --border-strong: #c5ccd6;
  --surface-muted: #f6f7f9;
  --surface-subtle: #eceff3;
  --surface-hover: #e8ebef;
  --primary: #1565a8;
  --primary-hover: #0f5088;
  --accent: #b85c1a;
  --accent-ghost: rgba(184, 92, 26, 0.18);
  --shadow: 0 2px 12px rgba(15, 20, 30, 0.07);
  --shadow-elevated: 0 12px 36px rgba(15, 20, 30, 0.1), 0 2px 8px rgba(15, 20, 30, 0.05);
  --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.95) inset, 0 4px 24px rgba(15, 20, 30, 0.06);
  --glass: rgba(255, 255, 255, 0.92);
  --nav-active-bg: rgba(21, 101, 168, 0.1);
  --nav-active-ring: rgba(21, 101, 168, 0.22);
  --scrollbar-thumb: rgba(120, 130, 145, 0.4);
  --scrollbar-thumb-hover: rgba(100, 110, 125, 0.65);
  --scrollbar-color: rgba(120, 130, 145, 0.45) transparent;
  --chart-nav-bg: #f6f7f9;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* 全站细滚动条 */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-color);
}

*::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: var(--scrollbar-size);
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

html {
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

body {
  font-family: var(--font);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 120% 70% at 50% -18%, rgba(88, 166, 255, 0.09), transparent 52%),
    radial-gradient(ellipse 55% 45% at 100% 100%, rgba(212, 165, 116, 0.06), transparent 48%);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html[data-theme="light"] body {
  background-image:
    radial-gradient(ellipse 100% 55% at 50% -12%, rgba(21, 101, 168, 0.07), transparent 55%),
    radial-gradient(ellipse 50% 40% at 100% 100%, rgba(184, 92, 26, 0.04), transparent 50%);
}

.site-header { flex-shrink: 0; }
.site-footer { flex-shrink: 0; }

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

/* 键盘焦点（不影响鼠标点击） */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
button:focus-visible,
.theme-toggle:focus-visible,
.cal-nav-btn:focus-visible,
.home-btn:focus-visible {
  border-radius: 6px;
}

@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;
  }
}

.container {
  width: 100%;
  max-width: var(--layout-max);
  margin-inline: auto;
  padding-left: max(var(--layout-pad-x), env(safe-area-inset-left, 0px));
  padding-right: max(var(--layout-pad-x), env(safe-area-inset-right, 0px));
}

.container.main--wide {
  max-width: var(--layout-max);
}

.site-header {
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  padding-top: env(safe-area-inset-top, 0);
}

.header-top {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) auto;
  align-items: center;
  gap: 20px;
  min-height: var(--site-header-top-h);
}

.header-nav-row {
  border-top: 1px solid var(--border-subtle);
  background: transparent;
}

.header-nav-row .nav-main {
  min-height: var(--site-header-nav-h);
}

.header-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  justify-content: center;
}

.header-search-row--with-nav {
  justify-content: flex-start;
}

.header-search-row--with-nav .header-search {
  flex: 1 1 auto;
  max-width: none;
}

.header-nav-toggle-slot[hidden] {
  display: none !important;
}

.header-search {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 480px;
  width: 100%;
}

.header-search-input {
  width: 100%;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  background: var(--surface-muted);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.header-search-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.14);
}

.header-search-input::placeholder {
  color: var(--muted);
  opacity: 0.85;
}

.header-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  min-height: var(--site-header-h);
}

.header-tools {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 10px;
  flex-shrink: 0;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.data-search-input {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 0.92rem;
  background: var(--surface);
  color: var(--text);
}

.data-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 90, 142, 0.12);
}

.search-suggest {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-elevated);
  max-height: 280px;
  overflow-y: auto;
}

.search-suggest-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  color: inherit;
  border-bottom: 1px solid var(--border-strong);
  text-decoration: none;
}

.search-suggest-item:last-child { border-bottom: none; }
.search-suggest-item:hover,
.search-suggest-item.active {
  background: var(--surface-hover);
  color: inherit;
}

.suggest-name { font-weight: 600; font-size: 0.9rem; }
.suggest-meta { font-size: 0.78rem; color: var(--muted); }

.search-page .page-header { border-bottom: none; padding-bottom: 0; margin-bottom: 12px; }
.search-back { margin-bottom: 6px; font-size: 0.88rem; }
.search-back a { color: var(--muted); }
.search-back a:hover { color: var(--primary); }

.search-panel { margin-bottom: 20px; }

.search-panel .search-form-large { margin-bottom: 0; }

.search-results {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.search-result-card { margin-bottom: 0; }

.search-form-large {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: 12px;
}

.search-form-large .search-wrap { flex: 1; min-width: 220px; }

.search-input-large {
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.search-hints { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.search-hint-tag {
  padding: 4px 12px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--primary);
}

.search-hint-tag:hover { border-color: var(--primary); }

.search-result-card {
  padding: 18px 20px;
}

.search-result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.search-result-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.search-result-title:hover { color: var(--primary); }

.search-result-meta { font-size: 0.85rem; margin-bottom: 8px; }
.search-result-meta code {
  font-size: 0.8rem;
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 4px;
}

.search-result-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.search-result-value small { font-size: 0.85rem; font-weight: 500; color: var(--muted); }

.search-result-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

/* Articles */
.articles-page-frame {
  display: grid;
  grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.articles-nav {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--chart-nav-bg, var(--surface-muted));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  position: sticky;
  top: 12px;
}

.articles-nav-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface);
}

.articles-nav-head-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.articles-nav-scroll {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  background: var(--surface);
}

.articles-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px 10px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.articles-nav-item:hover {
  background: var(--nav-active-bg);
  border-color: var(--border);
}

.articles-nav-item.is-active {
  background: var(--nav-active-bg);
  border-color: var(--nav-active-ring);
  box-shadow: inset 3px 0 0 var(--primary);
  padding-left: 11px;
  font-weight: 600;
}

.articles-nav-count {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--nav-active-bg);
  padding: 2px 8px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--nav-active-ring);
}

.articles-main {
  min-width: 0;
  overflow: visible;
}

.articles-main-head { margin-bottom: 12px; }

.articles-page .page-header { border-bottom: none; padding-bottom: 0; margin-bottom: 12px; }

.articles-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.article-card.panel {
  display: block;
  padding: 10px 14px;
  margin-bottom: 0;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}

.article-card:hover {
  border-color: var(--primary);
  background: var(--nav-active-bg);
}

.article-card-line1 {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.article-card-title {
  flex: 1;
  min-width: 0;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}

.article-card:hover .article-card-title {
  color: var(--primary);
}

.article-card-meta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  line-height: 1.4;
  white-space: nowrap;
}

.article-card-sep {
  color: var(--border);
}

.article-card-views {
  color: var(--muted);
}

.article-card-summary {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.article-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }

.article-page .page-header { border-bottom: none; padding-bottom: 0; margin-bottom: 16px; }

.article-back { margin-bottom: 6px; font-size: 0.88rem; }
.article-back a { color: var(--muted); }
.article-back a:hover { color: var(--primary); }

.article-meta { margin-top: 8px; }

.article-lead {
  margin-top: 12px;
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.6;
}

.article-body.prose {
  padding: 24px 28px;
  line-height: 1.75;
  font-size: 0.95rem;
}

.article-body.prose h2 {
  font-size: 1.15rem;
  margin: 1.4em 0 0.6em;
}

.article-body.prose h3 {
  font-size: 1.05rem;
  margin: 1.2em 0 0.5em;
}

.article-body.prose p { margin: 0.75em 0; }

.article-body.prose ul,
.article-body.prose ol {
  margin: 0.75em 0;
  padding-left: 1.4em;
}

.article-body.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 0.9rem;
}

.article-body.prose th,
.article-body.prose td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
}

.article-body.prose th { background: var(--surface); }

.article-related {
  margin-top: 16px;
  padding: 16px 20px;
}

.article-related-title {
  font-size: 0.95rem;
  margin: 0 0 10px;
}

.article-related-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
}

.article-related-list a { font-size: 0.9rem; }

@media (max-width: 768px) {
  .articles-page-frame {
    grid-template-columns: 1fr;
  }

  .articles-nav {
    position: static;
  }

  .articles-nav-scroll {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .articles-nav-item {
    flex: 0 1 auto;
    padding: 8px 12px;
    box-shadow: none;
  }

  .articles-nav-item.is-active {
    padding-left: 12px;
    box-shadow: inset 0 -2px 0 var(--primary);
  }
}

.btn-sm { padding: 6px 12px; font-size: 0.85rem; }

.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-self: start;
  min-width: 0;
}

.header-tagline {
  display: none;
}

.logo {
  display: flex;
  align-items: baseline;
  gap: 2px;
  flex-shrink: 0;
  padding: 0;
  color: inherit;
  text-decoration: none;
}

.logo:hover { color: inherit; }

.logo-main {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1;
}

.logo-sub {
  font-size: 1.15rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary) 0%, #7eb8ff 55%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.01em;
}

.nav-main {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  gap: 4px;
  min-width: 0;
  padding: 4px 0;
}

.nav-main a {
  display: flex;
  align-items: center;
  height: calc(var(--site-header-nav-h) - 8px);
  padding: 0 14px;
  margin: 0;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  border-bottom: none;
  transition: color 0.15s, background 0.15s, box-shadow 0.15s;
}

.nav-main a:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.nav-main a.active {
  color: var(--primary);
  font-weight: 600;
  background: var(--nav-active-bg);
  box-shadow: inset 0 0 0 1px var(--nav-active-ring);
}

.home-page { padding-top: 0; }

.home-dash-head {
  display: block;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.home-dash-head-main {
  text-align: left;
  align-items: flex-start;
}

.home-featured-section {
  margin-top: 0;
}

.home-featured-section .home-dash-head {
  margin-bottom: 8px;
}

.home-dash-head h1 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 2px;
  letter-spacing: -0.02em;
  position: relative;
  padding-left: 12px;
}

.home-dash-head h1::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.12em;
  bottom: 0.12em;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
}

.home-dash-head-main p {
  font-size: 0.82rem;
}

.home-dash-head-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 0.82rem;
  align-items: stretch;
}

.home-dash-head-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 2rem;
  padding: 0 0.625rem;
  line-height: 1.2;
  text-align: center;
  color: var(--muted);
  text-decoration: none;
}

.home-dash-head-links a:hover {
  color: var(--primary);
}

/* 首页行业涨跌热力图 */
.home-heatmap-panel {
  margin-bottom: 14px;
  padding: 16px 18px 14px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.home-heatmap-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.home-heatmap-head h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 2px;
  letter-spacing: -0.02em;
  position: relative;
  padding-left: 12px;
}

.home-heatmap-head h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.12em;
  bottom: 0.12em;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
}

.home-heatmap-desc {
  margin: 0;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.home-heatmap-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.home-heatmap-legend-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.35;
}

.home-heatmap-legend-item--up {
  background: #c0392b;
}

.home-heatmap-legend-item--down {
  background: #1a7f4e;
}

[data-theme="dark"] .home-heatmap-legend-item--up {
  background: #e53935;
}

[data-theme="dark"] .home-heatmap-legend-item--down {
  background: #43a047;
}

.home-heatmap-head-links {
  display: flex;
  gap: 12px;
  font-size: 0.82rem;
}

.home-heatmap-head-links a {
  color: var(--muted);
  text-decoration: none;
}

.home-heatmap-head-links a:hover {
  color: var(--primary);
}

.home-heatmap-chart {
  width: 100%;
  height: clamp(280px, 36vh, 420px);
  min-height: 260px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-subtle);
  overflow: hidden;
}

.home-heatmap-foot {
  margin: 8px 0 0;
  font-size: 0.78rem;
  text-align: center;
}

.page-scroll.home-page .home-heatmap-panel {
  overflow: visible;
}

.home-dash-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}

.home-dash-table .col-spark {
  width: 128px;
  min-width: 100px;
}

.home-dash-table .home-spark {
  height: 16px;
  min-height: 16px;
  width: 100%;
}

.home-dash-table tbody tr {
  cursor: pointer;
}

.home-dash-table tbody tr:hover td {
  background: var(--nav-active-bg);
}

.home-dash-table .fav-cell {
  cursor: default;
}

.home-page.page-fit .home-dash-panel {
  flex: 1;
  min-height: 0;
}

.home-page.page-fit .home-dash-panel .data-table-wrap--fill {
  flex: 1;
  min-height: 0;
  max-height: none;
}

.home-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px 32px;
  flex-wrap: wrap;
  padding-bottom: 20px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-strong);
}

.home-hero-text { flex: 1; min-width: 220px; }

.home-section-title {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
  line-height: 1.2;
}

.home-desc {
  font-size: 0.95rem;
  color: var(--muted);
  max-width: 520px;
  line-height: 1.6;
}

.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  flex-shrink: 0;
}

.home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.home-btn-primary {
  background: var(--primary);
  color: #fff;
}

.home-btn-primary:hover {
  background: var(--primary-hover);
  color: #fff;
}

.home-btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
}

.home-btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.home-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-bottom: 24px;
}

.home-quick a {
  padding: 6px 14px;
  font-size: 0.85rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.home-quick a:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.home-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.home-card {
  display: flex;
  flex-direction: column;
  min-height: 168px;
  padding: 20px 20px 16px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.home-card:hover {
  border-color: var(--primary);
  background: var(--surface-muted);
  color: inherit;
}

.home-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.home-card-fav {
  flex-shrink: 0;
  margin-right: auto;
}

.home-card-fav .fav-btn {
  font-size: 1.15rem;
}

.home-card-cat {
  font-size: 0.78rem;
  color: var(--muted);
}

.home-card-freq {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--surface-muted);
  border: 1px solid var(--border-subtle);
  color: var(--muted);
  flex-shrink: 0;
}

.home-card-name {
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 12px;
  flex: 1;
}

.home-card-metric {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin-bottom: 4px;
}

.home-card-value {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.home-card-value small {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  margin-left: 3px;
}

.home-card-period {
  font-size: 0.82rem;
  color: var(--muted);
}

.home-card-empty { font-size: 0.9rem; }

.home-card-chart {
  flex-shrink: 0;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.home-card-chart .home-spark {
  width: 100%;
  height: 26px;
  min-height: 26px;
  flex-shrink: 0;
}

.home-card-link {
  margin-top: auto;
  padding-top: 12px;
  font-size: 0.82rem;
  color: var(--muted);
  transition: color 0.15s;
}

.home-card:hover .home-card-link { color: var(--primary); }

[data-theme="dark"] .home-card:hover {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  border-color: rgba(91, 163, 217, 0.35);
}

[data-theme="dark"] .home-card-freq { background: #243044; }

.data-page .page-header { align-items: center; }

.data-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 320px;
  min-width: 200px;
}

.data-search .search-wrap { flex: 1; min-width: 0; }

.data-search-input {
  box-sizing: border-box;
  height: 40px;
  padding: 0 14px;
  line-height: 1.35;
}

.data-search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
}

.data-search-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(30, 90, 142, 0.06);
}

.icon-search { display: block; }

.main { flex: 1; padding: 20px 0 40px; min-width: 0; }

.main.main--fit {
  padding: 8px 0 10px;
  max-height: calc(100dvh - var(--site-header-h) - var(--site-footer-h));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.main.main--fit > .page-fit {
  flex: 1;
  min-height: 0;
  max-height: var(--page-fit-h);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* —— 页面级滚动：主滚动条在窗口右侧，减少内容区嵌套滚动 —— */
.main.main--scroll {
  padding: 8px 0 36px;
  max-height: none;
  overflow: visible;
  display: block;
  min-height: 0;
}

.main.main--scroll > .page-shell,
.main.main--scroll > .app-page-frame {
  max-height: none;
  overflow: visible;
  flex: none;
  min-height: 0;
}

.main.main--scroll .app-page-main,
.main.main--scroll .chart-page-main {
  overflow: visible;
  display: block;
  flex: none;
  min-height: 0;
}

.main.main--scroll .app-page-frame {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.main.main--scroll .chart-indicator-nav,
.main.main--scroll .fav-indicator-nav {
  position: static;
  top: auto;
  max-height: none;
  overflow: visible;
}

.main.main--scroll .chart-indicator-nav .chart-nav-scroll,
.main.main--scroll .fav-indicator-nav .chart-nav-scroll {
  flex: none;
  min-height: 0;
  overflow: visible;
}

.page-shell.page-scroll {
  display: block;
  overflow: visible;
  max-height: none;
  min-height: 0;
}

.page-scroll .data-table-wrap,
.page-scroll .data-table-wrap--fill,
.page-scroll .data-panel-fill,
.page-scroll .home-dash-panel,
.page-scroll .industry-panel-fill,
.page-scroll .industry-table-wrap,
.page-scroll .industry-table-body-x,
.page-scroll .industry-table-scroll {
  overflow: visible;
  max-height: none;
  flex: none;
  min-height: 0;
  display: block;
}

.page-scroll .industry-table-body-x,
.page-scroll .industry-table-scroll {
  overflow-x: auto;
  overflow-y: visible;
}

.page-scroll .industry-table-head-x {
  flex: none;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
}

.page-scroll .industry-table-head-x::-webkit-scrollbar {
  display: none;
}

.page-scroll .industry-table-pin {
  flex: none;
  overflow: visible;
}

.page-scroll.data-page,
.page-scroll.home-page,
.page-scroll.industry-page,
.page-scroll.cal-page,
.page-scroll.compare-page,
.page-scroll.favorites-page {
  overflow: visible;
}

.page-scroll.data-page .data-table-wrap,
.page-scroll.data-page .data-table-wrap--fill,
.page-scroll.data-page .data-panel-fill {
  overflow: visible;
  max-height: none;
}

.page-scroll .chart-head-panel {
  max-height: none;
  overflow: visible;
  flex-shrink: 0;
}

.page-scroll.chart-page--dense .chart-head-panel {
  max-height: none;
  overflow: visible;
}

.page-scroll .chart-layout {
  flex: none;
  overflow: visible;
}

.page-scroll .chart-viz-panel,
.page-scroll .compare-chart-fill {
  overflow: visible;
  flex: none;
  min-height: 0;
  display: block;
}

.page-scroll .chart-box--fluid,
.page-scroll #compare-chart {
  flex: none;
  width: 100%;
  height: clamp(400px, 56vh, 720px);
  min-height: 400px;
  max-height: none;
  overflow: hidden;
}

@media (min-width: 721px) {
  .fav-chart-toolbar .chart-range-select,
  .fav-chart-toolbar .chart-mode-select {
    display: none;
  }

  .favorites-page .fav-chart-toolbar .chart-range-group,
  .favorites-page .fav-chart-toolbar .chart-mode-group {
    display: none !important;
  }

  .favorites-page .fav-chart-toolbar .chart-range-select,
  .favorites-page .fav-chart-toolbar .chart-mode-select {
    display: inline-block !important;
    width: auto;
    min-width: 4.75rem;
    min-height: var(--chart-ctrl-h, 32px);
    font-size: var(--chart-ctrl-fs, 0.8125rem);
    padding: 0 1.75rem 0 0.5rem;
    flex-shrink: 0;
  }
}

.page-scroll.favorites-page #fav-main-chart {
  height: clamp(320px, 48vh, 520px);
  min-height: 280px;
  max-height: none;
  overflow: hidden;
}

.page-scroll .industry-body-grid {
  flex: none;
  min-height: 0;
  overflow: visible;
  align-items: stretch;
}

.page-scroll .industry-table-section {
  overflow: visible;
  min-height: 0;
  display: block;
}

.page-scroll .cal-panel {
  flex: none;
  min-height: 0;
  display: block;
}

.page-scroll .cal-grid-wrap {
  flex: none;
  min-height: 0;
  overflow: visible;
}

.page-scroll .fav-page-frame {
  overflow: visible;
  align-items: start;
  flex: none;
  min-height: 0;
}

.page-scroll .fav-page-main {
  overflow: visible;
  min-height: 0;
  display: block;
}

.page-scroll .fav-page-main > .chart-layout {
  flex: none;
  overflow: visible;
}

.breadcrumb--tight { margin-bottom: 8px; }

.page-header--compact {
  margin-bottom: 10px;
  padding-bottom: 10px;
}

.page-header--compact h1 { font-size: 1.35rem; margin-bottom: 4px; }

.filter-bar--compact { margin-bottom: 10px; }

/* —— 图表页左侧指标栏 —— */
.chart-page.page-fit {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.main.main--fit .app-page-main > .page-shell.chart-page.page-fit {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chart-page.page-fit > .breadcrumb--tight {
  flex-shrink: 0;
}

.chart-page > .breadcrumb--tight {
  --breadcrumb-h: 20px;
  flex-wrap: nowrap;
  align-items: center;
  min-height: var(--breadcrumb-h);
  height: var(--breadcrumb-h);
  line-height: 1;
  overflow: hidden;
  font-size: 0.8125rem;
}

.chart-page > .breadcrumb--tight a,
.chart-page > .breadcrumb--tight .breadcrumb-current,
.chart-page > .breadcrumb--tight .breadcrumb-sep {
  display: inline-flex;
  align-items: center;
  height: var(--breadcrumb-h);
  line-height: 1;
  font-size: inherit;
  margin: 0;
  padding: 0;
  white-space: nowrap;
}

.chart-page > .breadcrumb--tight a,
.chart-page > .breadcrumb--tight .breadcrumb-sep {
  flex-shrink: 0;
}

.chart-page > .breadcrumb--tight .breadcrumb-sep {
  opacity: 0.45;
  margin: 0 0.35rem;
}

.chart-page > .breadcrumb--tight .breadcrumb-current {
  flex: 1 1 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 1;
  color: var(--muted);
  font-weight: 500;
}

.app-page-frame,
.chart-page-frame {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  width: 100%;
}

.main.main--fit > .app-page-frame,
.chart-page-frame {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  align-items: stretch;
}

/* 可滚动内容页（首页、搜索等）：主区用块级布局，避免 flex+min-height:0 把内容压没 */
.app-page-main {
  min-width: 0;
  width: 100%;
  display: block;
  overflow: visible;
}

.chart-page-main,
.main.main--fit .app-page-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.main.main--fit .app-page-main > .page-fit {
  flex: 1;
  min-height: 0;
  max-height: var(--page-fit-h);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chart-page-main > .chart-layout {
  flex: 1;
  min-height: 0;
}

/* 图表页左侧：板块手风琴 + 指标名 */
.chart-indicator-nav {
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 220px;
  max-width: 280px;
  overflow: hidden;
  background: var(--chart-nav-bg, var(--surface-muted));
  border: 1px solid var(--border-strong);
  border-radius: 8px;
}

.chart-nav-head {
  flex-shrink: 0;
  padding: 10px 12px 0;
  background: var(--surface);
}

.chart-nav-head-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.chart-nav-search-wrap {
  position: relative;
  flex-shrink: 0;
  padding: 10px 10px 8px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-strong);
}

.chart-nav-search {
  width: 100%;
  padding: 8px 32px 8px 10px;
  font-size: 0.84rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface);
  color: var(--text);
}

.chart-nav-search::placeholder {
  color: var(--muted);
}

.chart-nav-search:focus {
  outline: none;
  border-color: var(--primary);
}

.chart-nav-clear {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.chart-nav-clear:hover {
  color: var(--text);
  background: rgba(0, 0, 0, 0.06);
}

.chart-nav-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}

.chart-nav-footer {
  padding: 8px 12px;
  border-top: 1px solid var(--border-strong);
  background: var(--surface);
  flex-shrink: 0;
}

.chart-nav-fav-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
  user-select: none;
}

.chart-nav-fav-filter input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--accent);
}

.chart-nav-fav-filter-icon {
  color: var(--text-muted, var(--muted));
  font-size: 0.9rem;
}

.chart-nav-fav-filter-text {
  color: var(--text-secondary);
}

.chart-nav-no-fav {
  font-size: 0.8rem;
  color: var(--text-muted, var(--muted));
  text-align: center;
  padding: 8px 0 4px;
}

.chart-nav-region {
  border-bottom: 1px solid var(--border-strong);
}

.chart-nav-region:last-child {
  border-bottom: none;
}

.chart-nav-region-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.chart-nav-region-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 11px 12px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.chart-nav-region--empty .chart-nav-region-head {
  cursor: default;
  opacity: 0.55;
}

.chart-nav-region-head:disabled {
  cursor: default;
}

.chart-nav-flag {
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1;
}

.chart-nav-region-name {
  flex: 1;
  min-width: 0;
}

.chart-nav-count {
  flex-shrink: 0;
  min-width: 1.4rem;
  padding: 1px 6px;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.05);
  border-radius: 999px;
}

.chart-nav-chevron {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
  margin-top: -3px;
  transition: transform 0.15s;
}

.chart-nav-region.is-open .chart-nav-chevron,
.chart-nav-region-head[aria-expanded="true"] .chart-nav-chevron {
  transform: rotate(-135deg);
  margin-top: 2px;
}

.chart-nav-region-body {
  padding: 0 0 6px;
  overflow-anchor: none;
}

/* 二级 subregion（宏观板块下嵌套分类） */
.chart-nav-subregion {
  border-bottom: 1px solid var(--border-light, rgba(0,0,0,.06));
}
.chart-nav-subregion:last-child {
  border-bottom: none;
}

.chart-nav-subregion-head {
  display: flex;
  align-items: center;
  width: 100%;
  border: none;
  background: none;
  padding: 4px 8px 4px 16px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-secondary, #666);
  transition: background 0.15s;
}
.chart-nav-subregion-head:hover {
  background: var(--hover-bg, rgba(0,0,0,.04));
}

.chart-nav-subregion-name {
  flex: 1;
  text-align: left;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-nav-subregion-count {
  font-size: 0.7rem;
  color: var(--text-muted, #999);
  margin: 0 6px;
  flex-shrink: 0;
}

.chart-nav-subregion-chevron {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--text-muted, #999);
  border-bottom: 1.5px solid var(--text-muted, #999);
  transform: rotate(45deg);
  margin-top: -2px;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.chart-nav-subregion.is-open .chart-nav-subregion-chevron,
.chart-nav-subregion-head[aria-expanded="true"] .chart-nav-subregion-chevron {
  transform: rotate(-135deg);
  margin-top: 2px;
}

.chart-nav-subregion-body {
  padding: 0 0 4px 8px;
  overflow-anchor: none;
}
.chart-nav-subregion-body .chart-nav-item {
  font-size: 0.8rem;
}

.chart-nav-item-row {
  display: flex;
  align-items: stretch;
  min-width: 0;
}

.chart-nav-fav {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding-left: 8px;
  width: 28px;
}

.chart-nav-fav .fav-btn {
  font-size: 1rem;
  padding: 0 2px;
}

.chart-nav-item {
  display: block;
  flex: 1;
  min-width: 0;
  padding: 7px 12px 7px 4px;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.12s, background 0.12s;
}

.chart-nav-item:hover {
  color: var(--primary);
  background: rgba(88, 166, 255, 0.08);
}

.chart-nav-item.is-active {
  color: var(--primary);
  font-weight: 600;
  background: rgba(88, 166, 255, 0.12);
}

html[data-theme="light"] .chart-nav-item:hover {
  background: rgba(30, 90, 142, 0.05);
}

html[data-theme="light"] .chart-nav-item.is-active {
  background: rgba(30, 90, 142, 0.08);
}

.chart-nav-item--with-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chart-nav-item-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-nav-item-meta {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}

.chart-nav-meta-price {
  color: var(--text);
}

.chart-nav-meta-change.is-up {
  color: #c0392b;
}

.chart-nav-meta-change.is-down {
  color: #1a7f4e;
}

[data-theme="dark"] .chart-nav-meta-change.is-up {
  color: #e57373;
}

[data-theme="dark"] .chart-nav-meta-change.is-down {
  color: #66bb6a;
}

[data-theme="dark"] .chart-nav-clear:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* —— 一屏布局（减少整页滚动） —— */
.chart-layout {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.chart-page.page-fit .chart-head-panel {
  margin-bottom: 8px;
  flex-shrink: 0;
  max-height: min(38vh, 360px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.chart-page--dense.page-fit .chart-head-panel {
  flex-shrink: 1;
  min-height: 0;
  max-height: min(34vh, 320px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.chart-page.page-fit .chart-viz-panel {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  padding: 10px 12px 14px;
  overflow: hidden;
}

.chart-viz-panel .chart-toolbar {
  flex-shrink: 0;
}

.chart-box--fluid {
  flex: 1 1 0;
  width: 100%;
  min-height: clamp(220px, 32dvh, 460px);
  height: auto;
  max-height: none;
  overflow: hidden;
  position: relative;
}

.panel-scroll {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
  padding: 12px 14px;
  overflow: hidden;
}

.panel-scroll .panel-title { margin-bottom: 8px; flex-shrink: 0; }

.panel-scroll .history-table-wrap,
.panel-scroll .desc--compact {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.desc--compact { font-size: 0.88rem; line-height: 1.55; }


.data-page.page-fit {
  overflow: hidden;
}

.data-page.page-fit .page-header--compact { flex-shrink: 0; }

.data-page.page-fit .filter-bar--compact { flex-shrink: 0; }

.data-panel-fill {
  flex: 1;
  min-height: 0;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

.data-table-wrap--fill {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  table-layout: fixed;
}

.data-table .col-name { width: 30%; word-break: break-word; }
.data-table .col-num { width: 14%; }
.data-table .col-fav { width: 36px; }
.data-table th,
.data-table td {
  padding: 9px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 宏观指标页（PC）：略紧凑行高，兼顾可读性与一屏行数 */
@media (min-width: 721px) {
  .data-page .data-table {
    font-size: 0.84rem;
  }

  .data-page .data-table th,
  .data-page .data-table td {
    padding: 7px 10px;
    line-height: 1.35;
    vertical-align: middle;
  }

  .data-page .data-table th {
    font-size: 0.75rem;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .data-page .data-table .col-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: normal;
  }

  .data-page .data-table .col-fav {
    width: 34px;
    padding-left: 5px;
    padding-right: 5px;
  }

  .data-page .data-table .fav-btn {
    font-size: 1.1rem;
    padding: 0 2px;
  }

  .data-page .table-tag {
    font-size: 0.72rem;
    padding: 1px 6px;
    line-height: 1.35;
    border-radius: 3px;
  }

  .data-page .badge-stale,
  .data-page .badge-fresh {
    font-size: 0.68rem;
    padding: 1px 5px;
    line-height: 1.35;
    border-radius: 3px;
  }

  .data-page .data-table .table-unit {
    font-size: 0.75em;
    margin-left: 1px;
  }

  .data-page .data-table .col-pub {
    font-size: 0.8rem;
  }

  .data-page .filter-bar--compact {
    margin-bottom: 8px;
    padding: 2px;
  }

  .data-page .filter-bar--compact .filter-chip {
    padding: 4px 11px;
    font-size: 0.82rem;
  }

  .data-page .page-header--compact {
    margin-bottom: 10px;
    padding-bottom: 10px;
  }
}

/* 首页：页面级滚动（侧栏若存在则 sticky，见 .main.main--scroll） */
body.page-home .main.main--scroll > .app-page-frame {
  align-items: start;
}

/* 宏观侧栏：page-scroll 下随页面滚动，不使用内部滑轮 */

.home-page.page-fit {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: 0;
}

.home-page.page-fit .home-hero {
  margin-bottom: 8px;
  padding-bottom: 8px;
  flex-shrink: 0;
  gap: 12px 20px;
}

.home-page.page-fit .home-section-title {
  font-size: clamp(1.2rem, 2.2vw, 1.45rem);
  margin-bottom: 4px;
}

.home-page.page-fit .home-desc {
  font-size: 0.82rem;
  line-height: 1.45;
}

.home-page.page-fit .home-btn {
  padding: 7px 14px;
  font-size: 0.84rem;
}

.home-page.page-fit .home-quick {
  margin-bottom: 8px;
  flex-shrink: 0;
  gap: 6px 8px;
}

.home-page.page-fit .home-quick a {
  padding: 4px 12px;
  font-size: 0.8rem;
}

.home-page.page-fit .home-card-grid {
  flex: 1;
  min-height: 0;
  gap: 10px;
  overflow: hidden;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  align-content: stretch;
}

.home-page.page-fit .home-card {
  min-height: 0;
  padding: 10px 12px 8px;
}

.home-page.page-fit .home-card-head {
  margin-bottom: 6px;
}

.home-page.page-fit .home-card-name {
  font-size: 0.92rem;
  margin-bottom: 4px;
  flex: 0 1 auto;
  min-height: 0;
}

.home-page.page-fit .home-card-value {
  font-size: clamp(1.1rem, 2vw, 1.35rem);
}

.home-page.page-fit .home-card-chart {
  margin-top: 6px;
  padding-top: 6px;
}

.home-page.page-fit .home-card-chart .home-spark {
  height: 22px;
  min-height: 22px;
}

.home-page.page-fit .home-card-link {
  padding-top: 6px;
  font-size: 0.75rem;
}

.home-page.page-fit .home-card:hover {
  transform: none;
}

.compare-page.page-fit .page-header { flex-shrink: 0; margin-bottom: 10px; padding-bottom: 10px; }

.compare-page.page-fit .compare-form {
  flex-shrink: 0;
  margin-bottom: 8px;
  padding: 12px 16px;
}

.compare-page.page-fit .compare-form-grid {
  margin-bottom: 10px;
  gap: 10px 14px;
}

.compare-page.page-fit #compare-warn { flex-shrink: 0; margin-bottom: 8px; }

.compare-page.page-fit .compare-chart-fill {
  flex: 1;
  min-height: 0;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
}

.compare-form--compact .compare-form-grid {
  grid-template-columns: repeat(4, 1fr);
}

.fav-page-header {
  flex-shrink: 0;
  margin-bottom: 14px;
  padding-bottom: 0;
  border-bottom: none;
}

.fav-page-header h1 {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0;
}

.fav-page-header h1::after {
  content: "";
  display: block;
  width: 2.75rem;
  height: 3px;
  margin-top: 10px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.fav-page-desc-desktop {
  margin-top: 10px;
  margin-bottom: 0;
  font-size: 0.9rem;
}

.fav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.fav-tab {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.85rem;
  cursor: pointer;
}

.fav-tab.is-active {
  border-color: var(--primary);
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

.etf-screener-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.etf-screener-label {
  font-size: 0.85rem;
}

.etf-screener-bar .search-hint-tag.is-active {
  border-color: var(--primary);
  color: var(--primary);
}

.etf-screener-divider {
  color: var(--muted);
  margin: 0 4px;
}

.etf-screener-section-label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-left: 4px;
}

.etf-group-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.etf-filter-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
  min-width: 0;
}

.etf-filter-controls {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.etf-scale-bar.etf-filter-row,
.etf-drawdown-bar.etf-filter-row,
.etf-cagr3y-bar.etf-filter-row {
  flex-wrap: nowrap;
}

.etf-scale-bar .etf-filter-controls,
.etf-drawdown-bar .etf-filter-controls,
.etf-cagr3y-bar .etf-filter-controls {
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.etf-factor-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0 8px;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.etf-factor-grid .etf-filter-row {
  border-top: none;
  margin-top: 0;
  padding-top: 2px;
  padding-bottom: 2px;
  gap: 6px;
  min-width: 0;
}

.etf-factor-grid .etf-factor-label {
  width: 4.6rem;
  font-size: 0.78rem;
}

.etf-factor-grid .etf-filter-controls {
  flex: 1 1 auto;
  min-width: 0;
}

.etf-factor-grid .etf-range-group {
  padding: 2px 8px 2px 5px;
}

@media (max-width: 1500px) {
  .etf-factor-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 1200px) {
  .etf-factor-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .etf-factor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  .etf-factor-grid {
    grid-template-columns: 1fr;
  }
}

.etf-factor-label {
  flex: 0 0 auto;
  width: 6.5rem;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--muted);
  white-space: nowrap;
}

.etf-group-buttons {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.etf-range-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  flex-shrink: 0;
  padding: 3px 10px 3px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.etf-range-group:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 22%, transparent);
}

.etf-range-group:has(.etf-range-input:disabled) {
  opacity: 0.55;
}

.etf-page .etf-range-group .etf-range-input,
.etf-range-input {
  box-sizing: content-box;
  flex: 0 0 auto;
  width: 4ch;
  min-width: 0;
  max-width: 4ch;
  padding: 2px 0;
  font-size: 0.85rem;
  line-height: 1.3;
  color: var(--text);
  text-align: center;
  background: transparent;
  border: none;
  border-radius: 0;
}

.etf-range-input:focus {
  outline: none;
}

.etf-range-input:disabled {
  cursor: not-allowed;
}

.etf-range-sep {
  flex: 0 0 auto;
  padding: 0 4px;
  font-size: 0.85rem;
  line-height: 1;
  color: var(--muted);
  user-select: none;
}

.etf-range-unit {
  flex: 0 0 auto;
  margin-left: 2px;
  padding-left: 8px;
  border-left: 1px solid var(--border);
  font-size: 0.85rem;
  line-height: 1.3;
  color: var(--muted);
  white-space: nowrap;
}

.etf-page .etf-group-bar .search-hint-tag,
.etf-page .etf-scale-bar .search-hint-tag,
.etf-page .etf-establish-bar .search-hint-tag {
  cursor: pointer;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
}

.etf-page .etf-group-bar .search-hint-tag:hover:not(:disabled),
.etf-page .etf-scale-bar .search-hint-tag:hover:not(:disabled),
.etf-page .etf-establish-bar .search-hint-tag:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.etf-page .etf-group-bar .search-hint-tag.is-active,
.etf-page .etf-scale-bar .search-hint-tag.is-active,
.etf-page .etf-establish-bar .search-hint-tag.is-active {
  color: var(--primary-contrast, #fff);
  background: var(--primary);
  border-color: var(--primary);
  font-weight: 600;
  box-shadow: 0 1px 4px color-mix(in srgb, var(--primary) 45%, transparent);
}

html[data-theme="light"] .etf-page .etf-group-bar .search-hint-tag.is-active,
html[data-theme="light"] .etf-page .etf-scale-bar .search-hint-tag.is-active,
html[data-theme="light"] .etf-page .etf-establish-bar .search-hint-tag.is-active {
  color: #fff;
}

.etf-page .search-hint-tag {
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.etf-page .search-hint-tag.is-active {
  border-color: var(--primary);
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, var(--surface));
  font-weight: 600;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 35%, transparent);
}

.etf-active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border));
  border-radius: 8px;
  background: color-mix(in srgb, var(--primary) 5%, var(--surface));
}

.etf-active-filters .etf-factor-label {
  min-width: auto;
}

.etf-active-filter-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}

.etf-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--primary);
  background: var(--surface);
  color: var(--primary);
  font-size: 0.82rem;
  cursor: pointer;
  line-height: 1.35;
}

.etf-filter-chip:hover {
  background: color-mix(in srgb, var(--primary) 14%, var(--surface));
}

.etf-filter-chip-x {
  font-size: 1.05rem;
  line-height: 1;
  opacity: 0.8;
}

.etf-filter-count {
  font-size: 0.82rem;
  flex: 0 0 auto;
}

.etf-clear-filters {
  flex: 0 0 auto;
  margin-left: auto;
}

/* 筛选方案（组合收藏） */
.combo-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.combo-select {
  min-width: 140px;
  max-width: 200px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.82rem;
  cursor: pointer;
}

.combo-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.etf-name-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.etf-name-cell .badge-stale {
  font-size: 0.72rem;
  padding: 1px 6px;
}

tr.etf-row-stale td:first-child {
  background: color-mix(in srgb, #f5e6a8 35%, transparent);
}

.chart-related-etfs {
  margin-top: 8px;
}

.fav-empty-state {
  text-align: center;
  padding: 3rem 2rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, var(--surface) 0%, var(--surface-muted) 100%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

.fav-empty-visual {
  width: 4.25rem;
  height: 4.25rem;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(88, 166, 255, 0.16), rgba(212, 165, 116, 0.1));
  border: 1px solid rgba(88, 166, 255, 0.22);
  box-shadow: 0 8px 28px rgba(88, 166, 255, 0.12);
}

html[data-theme="light"] .fav-empty-visual {
  background: linear-gradient(145deg, rgba(21, 101, 168, 0.1), rgba(184, 92, 26, 0.08));
  border-color: rgba(21, 101, 168, 0.18);
  box-shadow: 0 8px 24px rgba(21, 101, 168, 0.08);
}

.fav-empty-icon {
  font-size: 1.85rem;
  color: var(--accent);
  line-height: 1;
  text-shadow: 0 2px 12px rgba(212, 165, 116, 0.35);
}

.fav-empty-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.fav-empty-desc {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
  max-width: 22rem;
  margin-inline: auto;
}

.fav-page-frame {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  gap: 14px;
  overflow: hidden;
}

.fav-page-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.fav-page-main > .chart-layout {
  flex: 1;
  min-height: 0;
}

.fav-indicator-nav {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: var(--chart-nav-bg, var(--surface-muted));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.fav-nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface);
}

.fav-nav-head-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.fav-nav-count {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--nav-active-bg);
  padding: 3px 9px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--nav-active-ring);
}

.fav-nav-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px;
  background: var(--surface);
}

.fav-nav-table-head {
  display: none;
}

.fav-nav-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  margin-bottom: 4px;
  padding: 10px 12px 10px 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.fav-nav-item:hover {
  background: var(--nav-active-bg);
  border-color: var(--border);
}

.fav-nav-item.is-active {
  background: var(--nav-active-bg);
  border-color: var(--nav-active-ring);
  box-shadow: inset 3px 0 0 var(--primary);
  padding-left: 11px;
}

.fav-nav-item-name {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
}

.fav-nav-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  width: 100%;
  font-size: 0.75rem;
  color: var(--muted);
}

.fav-nav-item-val {
  margin-left: auto;
  color: var(--text);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.fav-chart-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin: 0 0 10px;
  padding: 0;
  border-bottom: none;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.fav-chart-toolbar::-webkit-scrollbar {
  display: none;
}

.fav-toolbar-filters {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  flex: 0 1 auto;
  min-width: 0;
}

.fav-toolbar-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  margin-left: auto;
}

.favorites-page .fav-chart-toolbar .chart-range-group,
.favorites-page .fav-chart-toolbar .chart-mode-group {
  display: none;
}

.favorites-page .fav-chart-toolbar .chart-range-select,
.favorites-page .fav-chart-toolbar .chart-mode-select {
  display: inline-block;
  width: auto;
  min-width: 4.75rem;
  flex-shrink: 0;
}

.favorites-page .fav-chart-toolbar .chart-range-btn,
.favorites-page .fav-chart-toolbar .chart-mode-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.favorites-page .fav-chart-toolbar .btn-sm {
  flex-shrink: 0;
  white-space: nowrap;
  padding: 6px 10px;
  font-size: 0.82rem;
}

.fav-chart-card-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  align-items: start;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.favorites-page .fav-chart-card.panel {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.fav-chart-card-title {
  min-width: 0;
}

.fav-chart-card-head .chart-warn {
  grid-column: 1 / -1;
  margin: 0;
}

.fav-chart-card-head .latest-box--inline {
  margin: 0;
  align-self: center;
}

.fav-chart-inline {
  width: 100%;
  margin: 0;
}

.chart-empty-msg {
  padding: 40px;
  text-align: center;
  color: var(--muted);
}

.chart-empty-msg--err {
  color: #c45c26;
}

.favorites-page.page-fit {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.favorites-page.page-fit .fav-page-header {
  flex-shrink: 0;
}

.favorites-page.page-fit .chart-head-panel {
  margin-bottom: 8px;
  flex-shrink: 0;
}

.favorites-page.page-fit .chart-viz-panel {
  flex: 1 1 0;
  min-height: 0;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  padding: 10px 12px 12px;
  overflow: hidden;
}

.favorites-page.page-fit #fav-chart-title {
  font-size: 1.15rem;
}

@media (max-width: 1100px) {
  .main.main--fit .fav-page-frame {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .main.main--fit .fav-indicator-nav {
    max-height: 220px;
  }
  .main.main--scroll .fav-page-frame {
    display: block;
    grid-template-columns: none;
    overflow: visible;
  }
  .main.main--scroll .fav-indicator-nav {
    max-height: min(40vh, 320px);
  }
}

.cal-page.page-fit {
  overflow: hidden;
}

.cal-page.page-fit .cal-page-header {
  flex-shrink: 0;
  margin-bottom: 10px;
  padding-bottom: 10px;
}

.cal-page.page-fit .cal-panel {
  flex: 1;
  min-height: 0;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
}

.cal-page.page-fit .cal-grid-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.cal-page.page-fit .cal-week { min-height: 72px; }

.cal-page.page-fit .cal-cell { min-height: 68px; padding: 3px; }

/* —— 统一页面壳 —— */
.page-shell {
  width: 100%;
  max-width: none;
  margin: 0;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 28px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 4px;
}

.page-header-desc {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.55;
}

.page-header-desc strong { color: var(--text); font-weight: 600; }

.page-header-main { flex: 1; min-width: 200px; }

.page-header-actions {
  flex-shrink: 0;
  align-self: center;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 16px 18px;
  margin-bottom: 12px;
}

.panel-flush { padding: 0; overflow: hidden; }

.panel-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}

.panel-empty { margin-top: 8px; }

.page-grid-2 {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.page-grid-2 .panel { margin-bottom: 0; }

.panel-table { display: flex; flex-direction: column; min-height: 280px; }
.panel-table .history-table-wrap { flex: 1; max-height: none; border: none; border-radius: 8px; background: var(--bg); }

.site-footer {
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-subtle);
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px));
  font-size: 0.78rem;
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

.hero {
  background: linear-gradient(125deg, #1a4f78 0%, #1e5a8e 40%, #2d7ab8 100%);
  color: #fff;
  padding: 40px 40px;
  border-radius: 12px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 80% at 100% 0%, rgba(255,255,255,0.14), transparent 55%),
    radial-gradient(circle at 0% 100%, rgba(0,0,0,0.08), transparent 45%);
  pointer-events: none;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr minmax(200px, 280px);
  gap: 32px 40px;
  align-items: center;
}

.hero-eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 8px;
}

.hero h1 { font-size: 2rem; margin-bottom: 12px; letter-spacing: -0.02em; line-height: 1.25; }
.hero-sub { opacity: 0.92; max-width: 520px; margin-bottom: 22px; line-height: 1.65; font-size: 0.98rem; }

.hero-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 14px;
  backdrop-filter: blur(6px);
}

.hero-panel-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.hero-panel-item--wide { grid-column: 1 / -1; }

.hero-panel-value {
  font-size: 1.5rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.hero-panel-value--sm { font-size: 0.95rem; font-weight: 600; }
.hero-panel-warn { color: #ffd4a8; }
.hero-panel-label { font-size: 0.72rem; opacity: 0.8; letter-spacing: 0.03em; }

.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.stat-value { font-size: 1.35rem; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.stat-value.stat-sm { font-size: 0.95rem; font-weight: 600; }
.stat-value.stat-warn { color: var(--accent); }

.card-body-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.card-main { flex: 1; min-width: 0; }
.card-value small { font-size: 0.85rem; font-weight: 500; color: var(--muted); margin-left: 2px; }
.card-spark { width: 72px; height: 28px; flex-shrink: 0; color: var(--primary); opacity: 0.75; }
.spark-svg { width: 100%; height: 100%; display: block; }

.theme-toggle {
  margin-left: 0;
  padding: 4px 10px;
  font-size: 0.78rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

.theme-toggle:hover { border-color: var(--primary); color: var(--primary); }

.btn {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
}

.btn-primary {
  background: #fff;
  color: var(--primary);
}

.btn-primary:hover { background: #f0f4f8; }

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }

.btn-outline-light {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.7);
  padding: 10px 22px;
  border-radius: 6px;
  font-weight: 600;
}

.btn-outline-light:hover { background: rgba(255,255,255,0.15); color: #fff; }

.hero-sync { font-size: 0.85rem; opacity: 0.85; margin-top: 8px; }

.btn-outline {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  background: var(--surface-muted);
  font-size: 0.9rem;
  transition: border-color 0.15s, color 0.15s, background 0.15s, box-shadow 0.15s;
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(88, 166, 255, 0.12);
}

.chart-viz-panel {
  padding: 14px 16px 16px;
  border-radius: var(--radius-lg);
}

.chart-page:not(.page-fit) .chart-viz-panel { margin-bottom: 16px; }

.chart-page.page-fit .chart-viz-panel { margin-bottom: 0; }

.chart-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--border-strong);
  background: transparent;
  border-radius: 0;
  --chart-ctrl-h: 32px;
  --chart-ctrl-fs: 0.8125rem;
  --chart-ctrl-fw: 500;
  --chart-ctrl-radius: 6px;
  --chart-ctrl-px: 0.625rem;
}

.chart-toolbar .chart-series-source,
.chart-toolbar .btn.btn-outline.btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: var(--chart-ctrl-h);
  min-height: var(--chart-ctrl-h);
  padding: 0 var(--chart-ctrl-px);
  font-size: var(--chart-ctrl-fs);
  font-weight: var(--chart-ctrl-fw);
  line-height: 1;
  border: 1px solid var(--border-strong);
  border-radius: var(--chart-ctrl-radius);
  background: var(--surface);
  color: var(--text);
  white-space: nowrap;
}

.chart-toolbar .chart-series-source.muted {
  color: var(--text);
}

.chart-toolbar .btn.btn-outline.btn-sm {
  margin: 0;
  cursor: pointer;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
}

@media (max-width: 720px) {
  .chart-page .chart-toolbar .chart-range-group,
  .chart-page .chart-toolbar .chart-mode-group {
    display: none !important;
  }

  .chart-page .chart-toolbar .chart-range-select,
  .chart-page .chart-toolbar .chart-mode-select {
    display: block !important;
  }
}

@media (min-width: 721px) {
  .chart-page .chart-toolbar .chart-range-select,
  .chart-page .chart-toolbar .chart-mode-select {
    display: none !important;
  }
}

.toolbar-label { font-size: 0.8rem; color: var(--muted); margin-right: 2px; }
.toolbar-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }

.chart-range-btn,
.chart-mode-btn {
  padding: 5px 12px;
  font-size: 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--text);
  cursor: pointer;
}

.chart-range-btn:hover,
.chart-mode-btn:hover { border-color: var(--primary); color: var(--primary); }

.chart-range-btn.active,
.chart-mode-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ===== 区间涨幅信息条 ===== */
.chart-interval-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  margin-bottom: 8px;
  background: var(--surface);
  border: 1px solid var(--primary);
  border-radius: 8px;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}

.chart-interval-icon {
  font-size: 1rem;
}

.chart-interval-period {
  color: var(--muted);
  font-size: 0.82rem;
}

.chart-interval-pct {
  font-weight: 700;
  font-size: 1.05rem;
  white-space: nowrap;
}

.chart-interval-pct.is-up { color: #c0392b; }
.chart-interval-pct.is-down { color: #1a7f4e; }

[data-theme="dark"] .chart-interval-pct.is-up { color: #e57373; }
[data-theme="dark"] .chart-interval-pct.is-down { color: #66bb6a; }

.chart-interval-clear {
  margin-left: auto;
  padding: 0 6px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
  border-radius: 4px;
  transition: color 0.15s;
}

.chart-interval-clear:hover {
  color: var(--text);
  background: var(--surface-muted);
}

.compare-form { margin-bottom: 16px; }

.compare-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 18px;
  margin-bottom: 16px;
}

.compare-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
  min-width: 0;
}

.compare-form .label-text {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.8rem;
}

.compare-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

.compare-form select {
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-size: 0.9rem;
  background: var(--surface);
  color: var(--text);
}

.compare-limit { max-width: 120px; flex: 0; min-width: 100px; }

/* 个股搜索框 */
.compare-search-wrap { margin-bottom: 4px; }
.compare-search-input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-size: 0.82rem;
  background: var(--surface);
  color: var(--text);
  box-sizing: border-box;
}
.compare-search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-ghost);
}

.section { margin-bottom: 40px; }
.section-title { font-size: 1.2rem; margin-bottom: 16px; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  color: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
}

.card:hover {
  border-color: var(--primary);
  color: inherit;
}

.card-top { display: flex; justify-content: space-between; margin-bottom: 8px; }
.card-cat { font-size: 0.75rem; color: var(--muted); }
.card-freq { font-size: 0.75rem; background: #243044; padding: 2px 8px; border-radius: 4px; color: #cbd5e1; }

html[data-theme="light"] .card-freq {
  background: #eef3f8;
  color: var(--text);
}
.card-name { font-size: 1.05rem; margin-bottom: 8px; }
.card-value { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.card-meta { font-size: 0.85rem; color: var(--muted); margin-top: 4px; }

.tag-list { display: flex; flex-wrap: wrap; gap: 10px; }
.tag {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 16px;
  border-radius: 20px;
  color: var(--text);
  font-size: 0.9rem;
}

.tag:hover { border-color: var(--primary); color: var(--primary); }

.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: 1.6rem; }
.muted { color: var(--muted); }

.table-tag {
  display: inline-block;
  font-size: 0.78rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: #243044;
  border: 1px solid var(--border);
  color: #cbd5e1;
}

html[data-theme="light"] .table-tag {
  background: var(--surface-muted);
  border-color: var(--border-subtle);
  color: var(--text);
}

.table-unit {
  font-size: 0.82em;
  font-weight: 500;
  color: var(--muted);
  margin-left: 2px;
}

.data-table .col-fav { width: 40px; }
.data-table .col-name a { font-weight: 600; color: var(--text); }
.data-table .col-name a:hover { color: var(--primary); }
.data-table .col-num { white-space: nowrap; }
.data-table .col-pub {
  max-width: 140px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@media (max-width: 1280px) {
  .data-table .col-freq { display: none; }
}

@media (max-width: 1100px) {
  .data-table .col-date { display: none; }
  .main.main--fit .app-page-frame,
  .main.main--fit .chart-page-frame {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .main.main--fit .chart-indicator-nav {
    max-height: 200px;
  }
  .main.main--scroll .app-page-frame {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .main.main--scroll .chart-indicator-nav,
  .main.main--scroll .fav-indicator-nav {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .main.main--scroll .chart-indicator-nav .chart-nav-scroll,
  .main.main--scroll .fav-indicator-nav .chart-nav-scroll {
    overflow: visible;
  }
  .desc--head {
    -webkit-line-clamp: 3;
  }
}

.data-table tbody tr:hover td { background: rgba(88, 166, 255, 0.08); }

html[data-theme="light"] .data-table tbody tr:hover td {
  background: rgba(30, 90, 142, 0.07);
}

/* —— 行业板块列表 —— */
.industry-page.page-fit {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.industry-page.page-fit .page-header--compact {
  flex-shrink: 0;
  margin-bottom: 8px;
  padding-bottom: 8px;
}

.industry-page.page-fit .industry-status-bar {
  flex-shrink: 0;
}

.industry-status-bar {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px;
  margin: 0 0 10px;
  padding: 8px 12px;
  background: var(--surface-muted, rgba(30, 90, 142, 0.04));
  border: 1px solid var(--border-strong, var(--border));
  border-radius: 8px;
}

.industry-status-text {
  margin: 0;
  flex: 0 0 auto;
  font-size: 0.82rem;
  line-height: 1.45;
  min-width: 0;
}

.industry-status-bar .industry-full-actions {
  flex: 0 0 auto;
  margin: 0;
}

.industry-progress--inline {
  flex: 1 1 12rem;
  min-width: 10rem;
  margin: 0;
}

.industry-progress--inline .industry-progress-track {
  margin-top: 2px;
}

.industry-progress--inline .industry-progress-text {
  margin: 4px 0 0;
}

.industry-body-grid {
  display: block;
  flex: 1;
  min-height: 0;
  min-width: 0;
}

.industry-table-section {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  padding: 0;
  overflow: hidden;
}

.industry-chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.industry-chart-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.industry-chart-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.industry-chart-meta {
  margin: 4px 0 0;
}

/* 行业走势弹窗（挂到 body，避免被页面壳层裁剪） */
.industry-chart-modal-root {
  z-index: 1250;
}

.industry-chart-modal-root:not([hidden]) {
  display: block;
  pointer-events: auto;
}

.industry-chart-modal-root .industry-chart-dialog {
  position: fixed;
  left: 50%;
  top: 50%;
  right: auto;
  bottom: auto;
  z-index: 1;
  width: min(96vw, 1080px);
  max-height: min(92vh, 860px);
  margin: 0;
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  transform: translate(-50%, -48%) scale(0.96);
  opacity: 0;
  visibility: hidden;
  transition:
    transform 0.24s ease,
    opacity 0.22s ease,
    visibility 0.22s ease;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.industry-chart-modal-root.is-open .industry-chart-dialog {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  visibility: visible;
}

body.industry-chart-modal-open {
  overflow: hidden;
}

.industry-chart-modal-root .industry-chart-toolbar {
  flex-shrink: 0;
}

.industry-chart-modal-root .industry-chart-box {
  flex: 1;
  min-height: clamp(300px, 52vh, 560px);
  height: clamp(300px, 52vh, 560px);
  width: 100%;
}

.industry-chart-toolbar {
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-strong);
}

.industry-chart-toolbar .chart-range-btn {
  padding: 4px 10px;
  font-size: 0.8rem;
}

.industry-chart-box {
  min-height: 0;
  height: 100%;
  width: 100%;
}

.industry-data-table tbody tr.industry-row {
  cursor: pointer;
}

.industry-data-table tbody tr.industry-row.is-selected td {
  background: rgba(30, 90, 142, 0.12) !important;
}

.industry-data-table tbody tr.industry-row.is-selected .col-name {
  z-index: 2;
  background: rgba(30, 90, 142, 0.12) !important;
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.06), inset 3px 0 0 var(--primary);
}

.industry-data-table tbody tr:nth-child(even).industry-row.is-selected .col-name {
  background: rgba(30, 90, 142, 0.12) !important;
}

@media (max-width: 1100px) {
  .industry-page.page-fit,
  .industry-page.page-scroll {
    overflow: visible;
    max-height: none;
  }

  .industry-table-section {
    min-height: min(40vh, 420px);
  }

  .industry-chart-modal-root .industry-chart-dialog {
    width: min(100vw - 16px, 100%);
    max-height: min(94vh, 900px);
    padding: 12px 12px 14px;
  }

  .industry-chart-modal-root .industry-chart-box {
    min-height: clamp(240px, 46vh, 480px);
    height: clamp(240px, 46vh, 480px);
  }

  .industry-status-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .industry-progress--inline {
    flex: 1 1 auto;
    width: 100%;
  }
}

.industry-full-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.industry-loading {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 10rem;
  padding: 24px;
  text-align: center;
  line-height: 1.6;
}

.industry-table-section > .industry-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: var(--surface);
}

.industry-table-section > .industry-loading[hidden] {
  display: none !important;
  pointer-events: none;
}

.industry-loading.is-error .industry-error-title {
  color: #c0392b;
  font-size: 0.95rem;
  max-width: 28rem;
  margin: 0 auto 12px;
}

[data-theme="dark"] .industry-loading.is-error .industry-error-title {
  color: #e57373;
}

.industry-progress:not(.industry-progress--inline) {
  margin: 0 0 12px;
}

.industry-progress-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(30, 90, 142, 0.12);
  overflow: hidden;
}

.industry-progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent, #1e5a8e);
  transition: width 0.35s ease;
}

.industry-progress-fill.is-indeterminate {
  width: 38%;
  transition: none;
  transform: translateX(-120%);
  animation: industry-progress-indeterminate 1.1s ease-in-out infinite;
}

@keyframes industry-progress-indeterminate {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}

.industry-progress-text {
  margin: 6px 0 0;
  font-size: 0.82rem;
}

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

.industry-toolbar-actions .data-search-input {
  width: min(100%, 16rem);
  min-width: 10rem;
}

@media (max-width: 720px) {
  .industry-page .page-header--compact {
    align-items: stretch;
  }

  .industry-toolbar-actions {
    width: 100%;
  }

  .industry-toolbar-actions .data-search-input {
    flex: 1;
    width: auto;
  }
}

/* ===== 大宗商品页面 ===== */
.commodity-page,
.forex-page {
  max-width: 1200px;
  margin: 0 auto;
}

.commodity-status-bar,
.forex-status-bar {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px;
  margin: 0 0 10px;
  padding: 8px 12px;
  background: var(--surface-muted, rgba(30, 90, 142, 0.04));
  border: 1px solid var(--border-strong, var(--border));
  border-radius: 8px;
}

.commodity-status-text,
.forex-status-text {
  font-size: 0.8rem;
  color: var(--text-muted, #6b7280);
  margin: 0;
}

.commodity-toolbar-actions,
.forex-toolbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.commodity-toolbar-actions .data-search-input,
.forex-toolbar-actions .data-search-input {
  width: min(100%, 16rem);
  min-width: 10rem;
}

.commodity-body-grid,
.forex-body-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.commodity-table-section,
.forex-table-section {
  padding: 0;
}

.commodity-table-body-x,
.commodity-table-scroll,
.forex-table-body-x,
.forex-table-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.commodity-data-table,
.forex-data-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  table-layout: auto;
}

.commodity-data-table th,
.forex-data-table th,
.commodity-data-table td,
.forex-data-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.commodity-data-table th,
.forex-data-table th {
  background: var(--surface-muted, rgba(30, 90, 142, 0.04));
  font-weight: 600;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

.commodity-td-name,
.forex-td-name {
  font-weight: 500;
  min-width: 100px;
}

.commodity-td-exchange,
.forex-td-symbol {
  font-size: 0.8rem;
}

.commodity-td-price,
.forex-td-price {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 80px;
}

.commodity-td-change,
.forex-td-change {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-width: 70px;
}

.commodity-td-change.pos,
.forex-td-change.pos {
  color: var(--up-color, #dc2626);
}

.commodity-td-change.neg,
.forex-td-change.neg {
  color: var(--down-color, #16a34a);
}

.commodity-loading,
.forex-loading {
  padding: 40px;
  text-align: center;
  color: var(--text-muted, #6b7280);
}

.sticky-col-left {
  position: sticky;
  left: 0;
  background: inherit;
  z-index: 2;
}

.commodity-data-table th.sticky-col-left,
.forex-data-table th.sticky-col-left {
  background: var(--surface-muted, rgba(30, 90, 142, 0.08));
  z-index: 3;
}

.commodity-data-table td.sticky-col-left,
.forex-data-table td.sticky-col-left {
  background: var(--surface);
}

.commodity-data-table tbody tr.commodity-row {
  cursor: pointer;
}

.commodity-data-table tbody tr.commodity-row:hover td {
  background: rgba(30, 90, 142, 0.06);
}

.commodity-data-table tbody tr.commodity-row.is-selected td {
  background: rgba(30, 90, 142, 0.12) !important;
}

.forex-data-table tbody tr.forex-row {
  cursor: pointer;
}

.forex-data-table tbody tr.forex-row:hover td {
  background: rgba(30, 90, 142, 0.06);
}

.forex-data-table tbody tr.forex-row.is-selected td {
  background: rgba(30, 90, 142, 0.12) !important;
}

.commodity-chart-modal-root,
.forex-chart-modal-root {
  position: fixed;
  inset: 0;
  z-index: 1250;
  pointer-events: none;
}

.commodity-chart-modal-root:not([hidden]),
.forex-chart-modal-root:not([hidden]) {
  display: block;
  pointer-events: auto;
}

.commodity-chart-backdrop,
.forex-chart-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.commodity-chart-modal-root.is-open .commodity-chart-backdrop,
.forex-chart-modal-root.is-open .forex-chart-backdrop {
  opacity: 1;
}

.commodity-chart-modal-root .commodity-chart-dialog,
.forex-chart-modal-root .forex-chart-dialog {
  position: fixed;
  left: 50%;
  top: 50%;
  right: auto;
  bottom: auto;
  z-index: 1;
  width: min(96vw, 1080px);
  max-height: min(92vh, 860px);
  margin: 0;
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  transform: translate(-50%, -48%) scale(0.96);
  opacity: 0;
  visibility: hidden;
  transition:
    transform 0.24s ease,
    opacity 0.22s ease,
    visibility 0.22s ease;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.commodity-chart-modal-root.is-open .commodity-chart-dialog,
.forex-chart-modal-root.is-open .forex-chart-dialog {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  visibility: visible;
}

body.commodity-chart-modal-open,
body.forex-chart-modal-open {
  overflow: hidden;
}

.commodity-chart-modal-root .commodity-chart-toolbar,
.forex-chart-modal-root .forex-chart-toolbar {
  flex-shrink: 0;
}

.commodity-chart-modal-root .commodity-chart-box,
.forex-chart-modal-root .forex-chart-box {
  flex: 1;
  min-height: clamp(300px, 52vh, 560px);
  height: clamp(300px, 52vh, 560px);
  width: 100%;
}

.commodity-chart-head,
.forex-chart-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 4px;
}

.commodity-chart-title,
.forex-chart-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.commodity-chart-meta,
.forex-chart-meta {
  margin: 4px 0 0;
}

.commodity-chart-head-actions,
.forex-chart-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.commodity-chart-close,
.forex-chart-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--surface-muted);
  border-radius: 6px;
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
}

.commodity-chart-close:hover,
.forex-chart-close:hover {
  background: var(--border-strong);
}

.commodity-chart-toolbar,
.forex-chart-toolbar {
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-strong);
}

.commodity-chart-toolbar .chart-range-btn,
.forex-chart-toolbar .chart-range-btn {
  padding: 4px 10px;
  font-size: 0.8rem;
}

.commodity-chart-box,
.forex-chart-box {
  min-height: 0;
  height: 100%;
  width: 100%;
}

@media (max-width: 720px) {
  .commodity-chart-modal-root .commodity-chart-dialog,
  .forex-chart-modal-root .forex-chart-dialog {
    width: min(100vw - 16px, 100%);
    max-height: min(94vh, 900px);
    padding: 12px 12px 14px;
  }

  .commodity-chart-modal-root .commodity-chart-box,
  .forex-chart-modal-root .forex-chart-box {
    min-height: clamp(240px, 46vh, 480px);
    height: clamp(240px, 46vh, 480px);
  }

  .commodity-page .page-header--compact,
  .forex-page .page-header--compact {
    align-items: stretch;
  }

  .commodity-toolbar-actions,
  .forex-toolbar-actions {
    width: 100%;
  }

  .commodity-toolbar-actions .data-search-input,
  .forex-toolbar-actions .data-search-input {
    flex: 1;
    width: auto;
  }

  .commodity-data-table,
  .forex-data-table {
    font-size: 0.8rem;
  }

  .commodity-data-table th,
  .forex-data-table th,
  .commodity-data-table td,
  .forex-data-table td {
    padding: 6px 8px;
  }
}

/* 列设置侧滑抽屉 */
.industry-drawer-root {
  position: fixed;
  inset: 0;
  z-index: 1200;
  pointer-events: none;
}

.industry-drawer-root:not([hidden]) {
  pointer-events: auto;
}

.industry-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  transition: opacity 0.22s ease;
}

.industry-drawer-root.is-open .industry-drawer-backdrop {
  opacity: 1;
}

.industry-columns-panel.industry-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(100%, 400px);
  max-width: min(92vw, 400px);
  margin: 0;
  padding: 14px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  transform: translateX(100%);
  transition: transform 0.26s ease;
  box-shadow: -6px 0 28px rgba(0, 0, 0, 0.12);
}

.industry-drawer-root.is-open .industry-drawer {
  transform: translateX(0);
}

.industry-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.industry-drawer-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.industry-drawer-desc {
  margin: 4px 0 0;
}

.industry-drawer-close {
  flex-shrink: 0;
  border: none;
  background: var(--surface-muted, rgba(30, 90, 142, 0.08));
  border-radius: 8px;
  width: 2rem;
  height: 2rem;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.industry-drawer-close:hover {
  color: var(--text);
  background: rgba(30, 90, 142, 0.12);
}

.industry-drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}

body.industry-drawer-open {
  overflow: hidden;
}

.industry-drawer .industry-columns-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.industry-drawer .industry-columns-list {
  list-style: none;
  margin: 0;
  padding: 2px 0 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.industry-columns-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.industry-col-preset.is-active {
  border-color: var(--accent, #1e5a8e);
  color: var(--accent, #1e5a8e);
  background: rgba(30, 90, 142, 0.08);
}

.industry-col-group-head {
  margin: 8px 0 2px;
  padding: 0 2px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-transform: none;
}

.industry-col-group-head:first-child {
  margin-top: 0;
}

.industry-col-group-title {
  display: block;
}

.industry-col-group-desc {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-muted, var(--muted));
  line-height: 1.35;
}

.industry-col-coverage {
  margin-left: auto;
  flex-shrink: 0;
  font-size: 0.72rem;
  line-height: 1.2;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(30, 90, 142, 0.08);
  color: var(--muted);
}

.industry-col-coverage.is-full {
  color: #166534;
  background: rgba(22, 101, 52, 0.1);
}

.industry-col-coverage.is-partial {
  color: #92400e;
  background: rgba(146, 64, 14, 0.1);
}

.industry-col-coverage.is-empty {
  color: #991b1b;
  background: rgba(153, 27, 27, 0.08);
}

.industry-col-item.is-empty-data {
  border-style: dotted;
}

.industry-drawer .industry-col-item {
  width: 100%;
  border-radius: 8px;
  justify-content: flex-start;
}

.industry-col-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 6px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: grab;
  white-space: nowrap;
  font-size: 0.86rem;
  line-height: 1.35;
}

.industry-col-item.is-unchecked {
  opacity: 0.72;
  border-style: dashed;
}

.industry-col-item.is-dragging {
  opacity: 0.45;
}

/* 表头拖拽排序 */
.industry-data-table th.is-th-dragging {
  opacity: 0.35;
}

.industry-data-table th.is-th-drop-target {
  box-shadow: inset 2px 0 0 var(--primary);
}

.industry-col-drag {
  color: var(--muted);
  user-select: none;
  font-size: 0.75rem;
  letter-spacing: -1px;
}

.industry-col-item label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  white-space: nowrap;
}

.industry-col-item input[type="checkbox"] {
  flex-shrink: 0;
  margin: 0;
}

/* 列设置 - 更新频率标签 */
.col-fresh-badge {
  display: inline-block;
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 500;
  line-height: 1.5;
  flex-shrink: 0;
  margin-left: auto;
}

.col-fresh-badge.is-daily {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

.col-fresh-badge.is-weekly {
  background: #e3f2fd;
  color: #1565c0;
  border: 1px solid #90caf9;
}

.col-fresh-badge.is-quarterly {
  background: #e3f2fd;
  color: #1565c0;
  border: 1px solid #90caf9;
}

[data-theme="dark"] .col-fresh-badge.is-daily {
  background: rgba(46, 125, 50, 0.2);
  color: #81c784;
  border-color: rgba(129, 199, 132, 0.35);
}

[data-theme="dark"] .col-fresh-badge.is-weekly {
  background: rgba(21, 101, 192, 0.2);
  color: #64b5f6;
  border-color: rgba(100, 181, 246, 0.35);
}

[data-theme="dark"] .col-fresh-badge.is-quarterly {
  background: rgba(21, 101, 192, 0.2);
  color: #64b5f6;
  border-color: rgba(100, 181, 246, 0.35);
}

.col-fresh-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  font-size: 0.75rem;
  color: var(--text-muted, var(--muted));
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  margin-top: 4px;
}

.col-fresh-legend .col-fresh-badge {
  margin-left: 0;
}

.stock-return-settings {
  padding: 0 12px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.stock-return-settings-head {
  margin-bottom: 8px;
}

.stock-return-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.stock-return-preset.is-active {
  color: var(--accent, #1e5a8e);
  border-color: var(--accent, #1e5a8e);
  background: rgba(30, 90, 142, 0.08);
}

.stock-return-custom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.stock-return-custom-label {
  font-size: 0.78rem;
  color: var(--muted);
}

.stock-return-custom-input {
  width: 5.5rem;
}

.stock-return-selected {
  margin: 0;
}

.col-fresh-legend-text {
  margin-right: 10px;
}

.btn-icon {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
  font-size: 0.85rem;
}

.btn-icon:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.industry-pct.is-up { color: #c0392b; }
.industry-pct.is-down { color: #1a7f4e; }

[data-theme="dark"] .industry-pct.is-up { color: #e57373; }
[data-theme="dark"] .industry-pct.is-down { color: #66bb6a; }

.industry-panel-fill {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.industry-table-wrap {
  flex: 1;
  min-height: 0;
  max-height: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.industry-table-pin {
  flex-shrink: 0;
}

.industry-table-head-x,
.industry-table-body-x,
.industry-table-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.industry-data-table--head {
  margin-bottom: 0;
}

.industry-data-table--body {
  margin-top: 0;
}

/* 行业表不用全局 .data-table，避免 table-layout:fixed 与 ellipsis */
.industry-data-table {
  table-layout: auto;
  width: max-content;
  min-width: 100%;
  font-size: 0.84rem;
  border-collapse: separate;
  border-spacing: 0;
}

.industry-data-table th,
.industry-data-table td {
  padding: 9px 12px;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.industry-data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  font-size: 0.8rem;
  line-height: 1.35;
  font-weight: 600;
  background: var(--surface-alt, rgba(30, 90, 142, 0.06));
  color: var(--text-muted, var(--muted));
  box-shadow: 0 1px 0 var(--border), 0 2px 6px rgba(15, 23, 42, 0.06);
}

.industry-data-table th.is-sortable {
  cursor: pointer;
  user-select: none;
  padding-right: 1.35rem;
  position: sticky;
  top: 0;
  z-index: 2;
}

.industry-data-table th.is-sortable:hover {
  color: var(--primary);
}

.industry-data-table th .sort-indicator {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.7rem;
  opacity: 0.45;
  line-height: 1;
}

.industry-data-table th.is-sorted .sort-indicator {
  opacity: 1;
  color: var(--primary);
}

.industry-data-table tbody tr:nth-child(even) td {
  background: rgba(30, 90, 142, 0.03);
}

.industry-data-table tbody tr:hover td {
  background: rgba(30, 90, 142, 0.07);
}

.industry-data-table .col-seq {
  width: 3rem;
  min-width: 3rem;
  text-align: center;
}

.industry-data-table .col-code {
  min-width: 5.5rem;
  font-variant-numeric: tabular-nums;
}

.industry-data-table .col-name {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 12rem;
  max-width: 22rem;
  background: var(--surface);
  box-shadow: 2px 0 6px rgba(0, 0, 0, 0.06);
  white-space: nowrap;
}

.industry-data-table thead .col-name {
  left: 0;
  z-index: 4;
  max-width: none;
  background: var(--surface-alt, rgba(30, 90, 142, 0.06));
}

[data-theme="dark"] .industry-data-table thead th {
  box-shadow: 0 1px 0 var(--border), 0 2px 8px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .industry-data-table thead .col-name {
  background: var(--surface-alt, var(--surface));
}

.industry-data-table tbody tr:nth-child(even) .col-name {
  background: var(--surface-alt, var(--surface));
}

.industry-data-table .col-name a {
  font-weight: 600;
  color: var(--primary);
  display: inline;
  line-height: inherit;
  max-width: 100%;
}

.industry-data-table td.num,
.industry-data-table td .industry-pct {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.industry-data-table th.num {
  text-align: right;
}

.industry-data-table .fav-cell {
  width: 32px;
  min-width: 32px;
  text-align: center;
  padding: 6px 4px;
}

.industry-data-table .fav-cell .fav-btn {
  font-size: 1rem;
  padding: 0 1px;
}

.industry-table-hint {
  flex-shrink: 0;
  margin: 0;
  padding: 6px 12px;
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--surface-muted, rgba(30, 90, 142, 0.04));
  border-bottom: 1px solid var(--border-strong, var(--border));
}

/* 个股分页导航 */
.page-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 0.78rem;
  background: var(--surface-muted, rgba(30, 90, 142, 0.04));
  border-bottom: 1px solid var(--border-strong, var(--border));
  flex-shrink: 0;
}
.page-nav .page-info {
  color: var(--muted);
  min-width: 80px;
  text-align: center;
}
.page-nav .page-btn {
  font-size: 0.75rem;
  padding: 2px 10px;
}
.page-nav .page-size-select {
  margin-left: auto;
  font-size: 0.75rem;
  padding: 2px 6px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

@media (max-width: 1100px) {
  .industry-data-table {
    font-size: 0.8rem;
  }
}

.small { font-size: 0.82rem; }

.filter-bar {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: 12px;
  padding: 3px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.filter-chip {
  padding: 5px 12px;
  border-radius: 3px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
}

.filter-chip.active {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--primary);
  font-weight: 600;
  box-shadow: var(--shadow-elevated);
}

.filter-chip:hover:not(.active) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="light"] .filter-chip:hover:not(.active) {
  background: rgba(255, 255, 255, 0.55);
}

.data-table-wrap {
  overflow: auto;
  max-height: min(70vh, 720px);
}

.panel-flush .data-table-wrap {
  border: none;
  box-shadow: none;
  border-radius: 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th, .data-table td {
  padding: 9px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #1e2836;
  font-weight: 600;
  color: #cbd5e1;
  font-size: 0.78rem;
  text-transform: none;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-strong);
}

html[data-theme="light"] .data-table th {
  background: var(--surface-muted);
  color: var(--muted);
}

.data-table tbody tr:nth-child(even) td {
  background: rgba(30, 40, 56, 0.45);
}

html[data-theme="light"] .data-table tbody tr:nth-child(even) td {
  background: rgba(243, 246, 250, 0.7);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table .num { font-weight: 600; font-variant-numeric: tabular-nums; }

.breadcrumb {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
}

.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb-sep { margin: 0 6px; opacity: 0.5; }

.chart-head-panel { margin-bottom: 12px; }

.chart-head-compact { padding: 14px 18px; }

.chart-head-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px 28px;
  align-items: start;
}

.chart-head-main {
  min-width: 0;
}

.chart-head-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin-top: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

.chart-head-desc {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  max-width: 720px;
}

.chart-category-bar {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.chart-category-bar--solo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  --category-bar-head-h: 22px;
  min-height: var(--category-bar-head-h);
}

.chart-category-bar--solo .chart-category-bar-label,
.chart-category-bar--solo .chart-category-bar-name {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--category-bar-head-h);
  line-height: 1;
  font-size: 0.8125rem;
  margin: 0;
  padding: 0;
  text-align: center;
}

.chart-category-bar-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  --category-bar-head-h: 22px;
  min-height: var(--category-bar-head-h);
}

.chart-category-bar-label,
.chart-category-bar-name,
.chart-category-bar-meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--category-bar-head-h);
  line-height: 1;
  font-size: 0.8125rem;
  margin: 0;
  padding: 0;
  text-align: center;
}

.chart-category-bar-label {
  font-weight: 600;
  color: var(--muted);
}

.chart-category-bar-name {
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}

.chart-category-bar-name:hover {
  text-decoration: underline;
}

.chart-category-bar-meta {
  font-weight: 500;
  color: var(--muted);
}

.chart-category-peers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 6px;
  width: 100%;
  align-items: stretch;
}

.chart-category-peers-wrap[data-collapsed="true"] .chart-category-peers {
  display: none;
}

.chart-category-bar--strip .chart-category-peers-wrap:not([data-collapsed="true"]) .chart-category-peers {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  max-height: 2.6rem;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  align-items: stretch;
}

.chart-category-bar--strip .chart-category-peers-wrap:not([data-collapsed="true"]) {
  max-height: 3.5rem;
  overflow: hidden;
}

.chart-category-bar--strip .category-peer-chip {
  width: auto;
  min-width: 8.5rem;
  flex-shrink: 0;
}

.category-peer-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  font-size: 0.8rem;
  line-height: 1.2;
  color: var(--text);
  text-decoration: none;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}

.category-peer-chip:hover {
  color: var(--primary);
  border-color: rgba(30, 90, 142, 0.35);
  background: rgba(30, 90, 142, 0.04);
}

.category-peer-chip.is-active {
  color: var(--primary);
  font-weight: 600;
  border-color: rgba(30, 90, 142, 0.45);
  background: rgba(30, 90, 142, 0.08);
}

[data-theme="dark"] .chart-nav-count {
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .category-peer-chip:hover {
  background: rgba(91, 163, 217, 0.08);
}

[data-theme="dark"] .category-peer-chip.is-active {
  background: rgba(91, 163, 217, 0.12);
}

.desc--head {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.chart-meta-sep { opacity: 0.5; }

.chart-head-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.chart-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: stretch;
  margin-top: 0;
}

.chart-head-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 2rem;
  padding: 0 0.75rem;
  line-height: 1.2;
  text-decoration: none;
  vertical-align: middle;
}

.chart-head-actions button.btn {
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.chart-warn { margin-top: 12px; margin-bottom: 0; }

.latest-box--inline {
  margin-bottom: 0;
  justify-content: flex-end;
  text-align: right;
}

.chart-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  flex: 1;
  min-width: 200px;
}

.chart-title-row h1 { margin: 0; font-size: 1.2rem; font-weight: 600; }

.badge {
  font-size: 0.75rem;
  background: #eef3f8;
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 4px;
}

.badge-outline { background: var(--surface-muted); border: 1px solid var(--border-strong); color: var(--text); }

.latest-box {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.latest-label { font-size: 0.85rem; color: var(--muted); }
.latest-value { font-size: 2rem; font-weight: 700; color: var(--accent); }
.latest-value small { font-size: 1rem; font-weight: 500; margin-left: 4px; }
.latest-period { color: var(--muted); }

.publisher { margin-top: 4px; }

.chart-box {
  height: min(56vh, 540px);
  min-height: 380px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 0;
}

.chart-box--inset {
  border: none;
  background: var(--bg);
}

.chart-page.page-fit .chart-box--inset {
  min-height: 0;
}

.chart-box--tall {
  height: min(58vh, 560px);
  min-height: 400px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

@media (max-width: 768px) {
  .two-col { grid-template-columns: 1fr; }
  .page-grid-2 { grid-template-columns: 1fr; }
  .hero { padding: 32px 24px; }
}

.desc { font-size: 0.95rem; line-height: 1.75; }

.history-table-wrap {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.data-table-sm th, .data-table-sm td { padding: 8px 12px; font-size: 0.85rem; }

.empty-state {
  padding: 32px;
  text-align: center;
  color: var(--muted);
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* —— 财经月历网格 —— */
.cal-page { width: 100%; }

.cal-page-header { margin-bottom: 16px; }
.cal-meta-line { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.cal-panel {
  padding: 0;
  overflow: hidden;
  margin-bottom: 24px;
  border-color: var(--border-strong);
}

.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border-strong);
  border-radius: 0;
}

.cal-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
  flex: 1;
  text-align: center;
}

.cal-nav-btn {
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.9rem;
  white-space: nowrap;
  font-weight: 500;
}

.cal-nav-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(30, 90, 142, 0.04);
}

.cal-filter-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
}

.cal-filter-toggle {
  display: none;
}

.cal-today-btn {
  padding: 6px 12px;
  font-size: 0.85rem;
  border: 1px solid var(--primary);
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.08);
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
}

.cal-filter-label {
  font-size: 0.82rem;
  color: var(--muted);
  white-space: nowrap;
}

.cal-filter-chips {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  margin-bottom: 0;
  padding: 3px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.cal-filter-chips::-webkit-scrollbar {
  display: none;
}

.cal-cat-chip {
  cursor: pointer;
  font: inherit;
  line-height: 1.2;
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 5px 8px;
  border-radius: 3px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.cal-cat-chip:not(.active) {
  color: var(--muted);
}

.cal-meta { margin: 10px 0 14px; font-size: 0.85rem; }

.cal-grid-wrap {
  background: var(--surface);
  overflow: hidden;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border-strong);
}

.cal-weekday {
  text-align: center;
  padding: 10px 4px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}

.cal-weeks { display: flex; flex-direction: column; }

.cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  min-height: 120px;
}

.cal-cell {
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  min-height: 118px;
  padding: 6px 8px 8px;
  vertical-align: top;
  background: var(--surface);
}

.cal-week .cal-cell:nth-child(7) { border-right: none; }
.cal-weeks .cal-week:last-child .cal-cell { border-bottom: none; }

.cal-cell--empty {
  background: var(--surface-subtle);
  min-height: 80px;
}

.cal-cell--today {
  background: #fffaf3;
  box-shadow: inset 0 0 0 2px rgba(30, 90, 142, 0.28);
}

.cal-cell-head {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 4px;
  min-height: 20px;
}

.cal-day-num {
  font-size: 0.82rem;
  color: #64748b;
  font-weight: 600;
}

.cal-day-today {
  font-size: 0.82rem;
  color: #c62828;
  font-weight: 700;
}

.cal-cell-events {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cal-ev {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 3px;
  min-width: 0;
  min-height: 1.125rem;
  overflow: hidden;
  font-size: 0.72rem;
  line-height: 1.15;
  padding: 1px 4px;
  background: var(--surface-muted);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
}

.cal-ev-time {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 0 3px;
  background: #e53935;
  color: #fff;
  font-size: 0.64rem;
  border-radius: 2px;
  line-height: 1.15;
  white-space: nowrap;
}

.cal-ev-region {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  color: #e53935;
  font-size: 0.64rem;
  font-weight: 500;
  line-height: 1.15;
  white-space: nowrap;
}

.cal-ev-fav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
}

.cal-ev-fav .fav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  line-height: 1;
  padding: 0;
  min-height: 0;
  height: 1em;
  width: 1em;
}

.cal-ev-title {
  flex: 1;
  min-width: 0;
  color: var(--text);
  font-size: 0.72rem;
  line-height: 1.15;
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-ev-title:hover { color: var(--primary); }

.cal-ev--released .cal-ev-title { color: var(--muted); }

.cal-more {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 5px 8px;
  background: rgba(30, 90, 142, 0.08);
  color: var(--primary);
  border: 1px dashed rgba(30, 90, 142, 0.45);
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.cal-more:hover {
  background: rgba(30, 90, 142, 0.14);
  border-color: var(--primary);
  color: var(--primary-hover);
}

.cal-dialog-body .cal-ev {
  margin-bottom: 6px;
}

.cal-dialog-body .cal-ev:last-child {
  margin-bottom: 0;
}

.cal-dialog {
  border: none;
  border-radius: var(--radius);
  padding: 0;
  max-width: 480px;
  width: 92vw;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.cal-dialog::backdrop { background: rgba(0, 0, 0, 0.35); }

.cal-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-strong);
  background: #f5f6f8;
}

.cal-dialog-head h2 { margin: 0; font-size: 1rem; }

.cal-dialog-close {
  border: none;
  background: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}

.cal-dialog-body {
  padding: 12px 16px 16px;
  max-height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cal-dialog-group-title {
  margin: 4px 0 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.cal-dialog-group-title:first-child {
  margin-top: 0;
}

.cal-dialog-group-count {
  font-weight: 500;
  color: var(--text);
}

.cal-dialog-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cal-dialog-group + .cal-dialog-group-title {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

@media (max-width: 900px) {
  .cal-week { min-height: 100px; }
  .cal-cell { min-height: 90px; padding: 4px; }
  .cal-ev { font-size: 0.65rem; }
  .cal-toolbar { flex-wrap: wrap; }
  .cal-title { order: -1; width: 100%; margin-bottom: 4px; }
}

.cal-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cal-ws-status {
  font-size: 0.8rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eee;
  color: var(--muted);
}
.cal-ws-status[data-state="connecting"] { background: #fff3cd; color: #856404; }
.cal-ws-status[data-state="live"] { background: #d4edda; color: #155724; }
.cal-ws-status[data-state="off"] { background: #f0f0f0; color: var(--muted); }

.badge-stale {
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: #fff3cd;
  color: #856404;
  white-space: nowrap;
}
.badge-stale--warn {
  background: #fff3cd;
  color: #856404;
}
.badge-stale--critical {
  background: #fde8e8;
  color: #b42318;
  font-weight: 600;
}
.chart-warn--critical {
  background: #fde8e8;
  border-color: #f5c2c2;
  color: #9b1c1c;
}
.badge-fresh {
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: #e8f4e8;
  color: #264;
}
.data-table th { user-select: none; }
.data-table th:hover { color: var(--primary); }

.warn-box {
  background: #fff8e6;
  border: 1px solid #e6d9a8;
  color: #7a5c00;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.admin-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
}

.admin-panel label { display: block; margin-bottom: 12px; font-size: 0.9rem; }
.admin-panel input[type="password"] {
  display: block;
  width: 100%;
  max-width: 320px;
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.admin-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }

.admin-key-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.fav-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  color: #ccc;
  padding: 0 4px;
}

.fav-btn.is-on { color: #e6a817; }
.fav-btn:hover { color: #e6a817; }

.fav-cell { width: 36px; text-align: center; }

.compare-fav-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 10px;
  padding: 8px 12px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.88rem;
}

.compare-fav-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.compare-fav-name {
  color: var(--muted);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-auth {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 0;
  font-size: 0.85rem;
}

.nav-auth a { color: var(--muted); }
.nav-login:hover { color: var(--primary); }
.nav-register {
  padding: 5px 12px;
  border-radius: 6px;
  background: var(--primary);
  color: #fff !important;
  font-weight: 600;
}
.nav-register:hover { background: var(--primary-hover); color: #fff !important; }
.nav-user { color: var(--muted); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-user-short { display: none; }
.nav-user-full { display: inline; }

.nav-logout { display: inline; margin: 0; }
.nav-logout button {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 0.88rem;
  padding: 0;
}

.auth-card {
  max-width: 400px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
}

.auth-card h1 { margin-bottom: 20px; font-size: 1.4rem; }

.auth-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  justify-content: center;
  margin-top: 1rem;
  font-size: 0.88rem;
}

.auth-footer-register {
  color: var(--muted);
}

.auth-form label {
  display: block;
  margin-bottom: 16px;
  font-size: 0.9rem;
  color: var(--muted);
}

.auth-form input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
}

.auth-form .btn { width: 100%; margin-top: 8px; border: none; cursor: pointer; }

.auth-error {
  background: #fde8e8;
  color: #a32;
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.auth-info {
  background: #e8f4e8;
  color: #264;
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.nav-user { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--primary); }

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

.admin-log {
  background: #1a2332;
  color: #e2e8f0;
  padding: 14px;
  border-radius: 6px;
  font-size: 0.82rem;
  overflow: auto;
  max-height: 280px;
  white-space: pre-wrap;
}

[data-theme="dark"] .hero {
  background: linear-gradient(135deg, #0d3d5c 0%, #1a5a82 50%, #0f2d44 100%);
}

[data-theme="dark"] .filter-chip { color: var(--muted); }
[data-theme="dark"] .filter-chip.active {
  color: var(--primary);
  background: var(--surface);
  border-color: var(--border-strong);
}
[data-theme="dark"] .panel { box-shadow: none; border-color: var(--border); }
[data-theme="dark"] .home-dash-table tbody tr:hover td {
  background: rgba(88, 166, 255, 0.08);
}
[data-theme="dark"] .home-card { border-color: var(--border); }
[data-theme="dark"] .chart-toolbar { border-bottom-color: var(--border); }
[data-theme="dark"] .card-freq,
[data-theme="dark"] .badge,
[data-theme="dark"] .cal-region { background: #243044; }
[data-theme="dark"] .cal-toolbar { background: #1e2836; }
[data-theme="dark"] .cal-nav-btn { background: var(--surface); border-color: var(--border-strong); }
[data-theme="dark"] .cal-cell { background: var(--surface); border-color: var(--border-subtle); }
[data-theme="dark"] .cal-cell--empty { background: #151c26; }
[data-theme="dark"] .cal-cell--today { background: #1a2638; box-shadow: inset 0 0 0 2px rgba(91, 163, 217, 0.35); }
[data-theme="dark"] .cal-weekdays { background: #1a2332; border-bottom-color: var(--border-strong); }
[data-theme="dark"] .cal-weekday { color: #cbd5e1; }
[data-theme="dark"] .cal-ev { background: #1e2836; border-color: var(--border-subtle); }
[data-theme="dark"] .cal-more {
  background: rgba(91, 163, 217, 0.1);
  border-color: rgba(91, 163, 217, 0.45);
  color: var(--primary);
}
[data-theme="dark"] .cal-more:hover {
  background: rgba(91, 163, 217, 0.18);
  border-color: var(--primary);
}
[data-theme="dark"] .badge-outline { background: transparent; border-color: var(--border); color: var(--muted); }
[data-theme="dark"] .badge-stale { background: #3d3520; color: #e6c878; }
[data-theme="dark"] .badge-stale--critical { background: #3d2020; color: #f5a8a8; }
[data-theme="dark"] .badge-fresh { background: #1e3d28; color: #8fd4a0; }
[data-theme="dark"] .chart-warn--critical { background: #3d2020; border-color: #6b3030; color: #f5a8a8; }
[data-theme="dark"] .warn-box { background: #2d2818; border-color: #4d4428; color: #e6d9a8; }

@media (max-width: 900px) {
  body.page-home {
    height: auto;
    overflow: auto;
  }

  /* iOS 聚焦输入框时不自动放大页面 */
  .header-search-input,
  .chart-nav-search,
  .data-search-input,
  .search-input-large,
  .compare-form select,
  .compare-form input[type="text"],
  .compare-form input[type="search"] {
    font-size: 16px;
  }

  .header-top {
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 6px 0;
  }

  .header-search-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
  }

  .header-search {
    max-width: 100%;
  }

  .header-tools {
    justify-self: end;
  }

  .header-nav-row .nav-main {
    margin: 0 calc(var(--layout-pad-x) * -1);
    padding: 0 var(--layout-pad-x);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
  }

  .header-inner {
    grid-template-columns: 1fr auto;
    padding: 8px 0;
  }
  .header-tagline { display: none; }
  .logo { padding: 0; }
  .header-tools { grid-column: 2; justify-self: end; }
  .nav-main {
    grid-column: 1 / -1;
    justify-self: stretch;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-top: 1px solid var(--border);
    margin: 0 calc(var(--layout-pad-x) * -1);
    padding: 0 var(--layout-pad-x);
  }
  .nav-main a {
    height: auto;
    min-height: 44px;
    padding: 10px 14px;
  }

  .theme-toggle,
  .nav-logout button,
  .nav-register,
  .nav-login {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .chart-range-btn,
  .chart-mode-btn,
  .cal-nav-btn,
  .filter-chip {
    min-height: 40px;
    padding: 8px 12px;
  }
  .page-header { flex-direction: column; align-items: stretch; }
  .page-header-actions { width: 100%; }
  .data-search { flex: 1 1 100%; max-width: none; }
  .compare-form-grid { grid-template-columns: 1fr; }
  .chart-head-grid {
    grid-template-columns: 1fr;
  }
  .chart-head-side {
    align-items: flex-start;
    width: 100%;
  }
  .latest-box--inline {
    text-align: left;
    justify-content: flex-start;
  }
  .chart-head-actions { justify-content: flex-start; }
  .data-table .col-pub { display: none; }
}

/* 矮屏 / 小屏：优先保证图表区高度，头部可滚动 */
@media (max-height: 820px) {
  .chart-page.page-fit .chart-head-panel {
    max-height: min(32vh, 280px);
  }

  .chart-page--dense.page-fit .chart-head-panel {
    max-height: min(28vh, 240px);
  }

  .chart-box--fluid {
    min-height: clamp(160px, 32dvh, 360px);
  }
}

@media (max-height: 640px) {
  .chart-page.page-fit .chart-head-panel {
    max-height: min(28vh, 220px);
  }

  .chart-box--fluid {
    min-height: clamp(140px, 38dvh, 300px);
  }
}

@media (max-width: 720px) {
  :root {
    --layout-pad-x: 12px;
    --page-gutter-x: var(--layout-pad-x);
    --site-header-top-h: 44px;
  }

  .container,
  .container.main--wide {
    max-width: 100%;
  }

  .main { padding: 12px 0 calc(28px + env(safe-area-inset-bottom, 0px)); }
  .main.main--scroll {
    padding: 6px 0 calc(32px + env(safe-area-inset-bottom, 0px));
  }

  .page-scroll.data-page .data-table-wrap,
  .page-scroll.home-page .home-dash-panel .data-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }

  .main.main--fit {
    max-height: none;
    overflow: visible;
  }
  .main.main--fit > .page-fit {
    max-height: none;
    overflow: visible;
  }

  .logo-main,
  .logo-sub {
    font-size: 1.05rem;
  }

  .home-dash-head {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .home-dash-head-main {
    text-align: left;
    align-items: flex-start;
  }

  .home-dash-head-links {
    width: 100%;
    gap: 8px 12px;
    align-items: stretch;
  }

  .home-dash-head-links a {
    min-height: 44px;
  }

  .page-header {
    margin-bottom: 14px;
    padding-bottom: 12px;
  }

  .page-header h1 {
    font-size: 1.1rem;
  }

  .page-header-desc {
    font-size: 0.86rem;
  }

  .panel:not(.panel-flush) {
    padding: 12px;
  }

  .data-table .col-cat,
  .data-table .col-stale { display: none; }

  .data-table th,
  .data-table td {
    padding: 8px 10px;
    font-size: 0.84rem;
  }

  .home-dash-table {
    min-width: 28rem;
  }

  .home-dash-table .col-spark {
    width: 96px;
    min-width: 80px;
  }

  .home-dash-table .home-spark {
    height: 14px;
    min-height: 14px;
  }

  .home-heatmap-panel {
    padding: 12px 12px 10px;
    margin-bottom: 10px;
  }

  .home-heatmap-head {
    align-items: flex-start;
  }

  .home-heatmap-chart {
    height: clamp(240px, 42vh, 360px);
    min-height: 220px;
  }

  .main.main--scroll .chart-indicator-nav,
  .main.main--scroll .fav-indicator-nav {
    position: static;
    max-height: none;
    overflow: visible;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    margin-bottom: 10px;
  }

  .main.main--scroll .chart-indicator-nav .chart-nav-scroll,
  .main.main--scroll .fav-indicator-nav .chart-nav-scroll {
    overflow: visible;
  }

  .page-scroll .chart-box--fluid,
  .page-scroll #compare-chart {
    height: clamp(320px, 48vh, 560px);
    min-height: 320px;
  }

  .page-scroll.favorites-page #fav-main-chart {
    height: clamp(280px, 42vh, 440px);
    min-height: 240px;
  }

  .page-scroll .industry-chart-box {
    height: clamp(240px, 38vh, 400px);
    min-height: 240px;
  }

  .chart-toolbar {
    gap: 6px;
    margin-bottom: 10px;
    padding-bottom: 10px;
  }

  .toolbar-sep {
    display: none;
  }

  .chart-head-compact {
    padding: 12px 14px;
  }

  .chart-viz-panel {
    padding: 10px 12px 12px;
  }

  .nav-user {
    max-width: 9rem;
  }

  .card-grid { grid-template-columns: 1fr; }
  .home-card-grid { grid-template-columns: 1fr; }
  .home-hero { align-items: flex-start; }
  .home-section-title { font-size: 1.45rem; }
}

/* 超窄屏（手机竖屏） */
@media (max-width: 480px) {
  :root {
    --layout-pad-x: 12px;
  }

  .header-top {
    gap: 8px;
  }

  .header-search-input::placeholder {
    font-size: 14px;
  }

  .home-dash-table .col-spark,
  .home-dash-table th.col-spark {
    display: none;
  }

  .home-dash-table {
    min-width: 22rem;
  }

  .data-table .col-pub {
    display: none;
  }

  .cal-week {
    min-height: 0;
  }

  .cal-cell {
    min-height: 4.5rem;
    padding: 2px 3px;
  }

  .cal-cell--empty {
    min-height: 2.5rem;
  }

  .cal-weekday {
    font-size: 0.72rem;
    padding: 6px 2px;
  }

  .cal-weekday:nth-child(n+6) {
    color: var(--accent);
  }

  .cal-day-num,
  .cal-day-today {
    font-size: 0.7rem;
  }

  .cal-ev {
    font-size: 0.6rem;
    padding: 1px 2px;
    line-height: 1.15;
    min-height: 1rem;
  }

  .cal-toolbar {
    padding: 10px 0;
    gap: 8px;
  }

  .cal-title {
    font-size: 1rem;
  }

  .cal-filter-bar {
    padding: 8px 0;
  }

  .compare-limit {
    min-width: 0;
    flex: 1;
    max-width: none;
  }

  .latest-box--inline {
    font-size: 0.88rem;
  }

  .search-suggest {
    max-height: min(50vh, 240px);
  }
}

@media (min-width: 721px) and (max-width: 960px) {
  .home-card-grid { grid-template-columns: repeat(2, 1fr); }

  .home-page.page-fit .home-card-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, minmax(0, 1fr));
  }
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.admin-tab {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  font-size: 0.9rem;
}

.admin-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.admin-tab-panel { margin-bottom: 32px; }

.ops-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.ops-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.ops-num {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
}

.ops-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.users-table th,
.users-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.users-table-wrap { overflow-x: auto; }

.btn-sm {
  padding: 4px 10px;
  font-size: 0.8rem;
}

.account-plan {
  margin: 20px 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.account-plan h2 { font-size: 1.1rem; margin-bottom: 10px; }

.pricing-card { max-width: 480px; }

.pricing-plan { margin: 16px 0; }

.pricing-price {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 8px 0 16px;
}

.pricing-features {
  margin: 0 0 20px 1.2rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.ops-top-title {
  font-size: 0.95rem;
  margin: 12px 0 8px;
  font-weight: 600;
}

.ops-top-ol {
  margin: 0 0 16px 1.2rem;
  padding: 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.ops-usage-grid { margin-bottom: 20px; }

.ops-usage-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

/* —— 运营后台：单屏无整页滚动 —— */
.admin-body {
  --admin-fs-xs: 0.78rem;
  --admin-fs-sm: 0.875rem;
  --admin-fs-md: 0.9375rem;
  --admin-fs-lg: 1.2rem;
  --admin-fs-hero: 1.65rem;
  --admin-gap: 12px;
  --page-fit-h: calc(100dvh - var(--site-header-h) - var(--main-vpad-fit));
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.admin-body .site-footer { display: none; }

.admin-body .header-tagline { display: none; }

.admin-body .header-nav-row {
  display: none;
}

.admin-body .header-search {
  display: none;
}

.admin-body .header-top {
  grid-template-columns: minmax(0, 1fr) auto;
}

.admin-body .header-brand {
  justify-self: start;
}

.admin-body .header-tools--admin {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.admin-header-link {
  font-size: 0.875rem;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  padding: 4px 0;
}

.admin-header-link:hover {
  color: var(--primary);
}

.admin-body .header-tools--admin .theme-toggle {
  flex-shrink: 0;
}

.admin-unlock-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100dvh - var(--site-header-h) - var(--main-vpad-fit) * 2);
}

.admin-unlock-card {
  width: 100%;
  max-width: 360px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.admin-unlock-card h1 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.admin-unlock-hint {
  margin: 0 0 16px;
  font-size: var(--admin-fs-sm, 0.875rem);
  color: var(--muted);
}

.admin-unlock-form label {
  display: block;
  margin-bottom: 6px;
  font-size: var(--admin-fs-sm, 0.875rem);
  color: var(--muted);
}

.admin-unlock-form .admin-key-input {
  width: 100%;
  margin-bottom: 12px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: var(--admin-fs-sm, 0.875rem);
}

.admin-unlock-form .btn {
  width: 100%;
}

.admin-logout-form {
  margin: 0;
  display: inline;
}

.admin-body .app-page-frame,
.admin-body .app-page-main {
  display: block;
  width: 100%;
  max-width: var(--layout-max);
  margin-inline: auto;
}

.admin-body .main.admin-page,
.admin-body .main.admin-unlock-page {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: var(--layout-max);
  margin-inline: auto;
  padding: var(--main-vpad-fit) 0 10px;
  overflow: hidden;
  box-sizing: border-box;
}

.admin-body .main.admin-page.main--fit {
  max-height: calc(100dvh - var(--site-header-h));
}

.admin-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  width: 100%;
  max-width: 100%;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  margin-bottom: 6px;
}

.admin-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.admin-tabs {
  display: flex;
  gap: 4px;
  margin: 0;
}

.admin-tab {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
  font-size: var(--admin-fs-sm);
}

.admin-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.admin-status {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: var(--admin-fs-xs);
  font-weight: 600;
  white-space: nowrap;
}

.admin-status--pending { background: #f3f4f6; color: #6b7280; }
.admin-status--ok { background: #dcfce7; color: #166534; }
.admin-status--err { background: #fee2e2; color: #991b1b; }

.admin-updated {
  font-size: var(--admin-fs-xs);
  color: var(--muted);
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-auth-mini {
  position: relative;
  font-size: var(--admin-fs-sm);
}

.admin-auth-mini summary {
  cursor: pointer;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  list-style: none;
}

.admin-auth-mini summary::-webkit-details-marker { display: none; }

.admin-auth-pop {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 20;
  margin-top: 4px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 220px;
}

.admin-key-input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.8rem;
}

.admin-key-error {
  margin: 0 0 4px;
  padding: 6px 8px;
  font-size: var(--admin-fs-sm);
  border-radius: 4px;
}

.admin-viewport {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.admin-tab-panel {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

.admin-dashboard {
  height: 100%;
  min-height: 0;
}

.admin-bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: auto minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--admin-gap);
  height: 100%;
  width: 100%;
  align-items: stretch;
}

.admin-panel-block {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 12px 14px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.admin-panel-block--reg,
.admin-panel-block--active,
.admin-panel-block--online,
.admin-panel-block--quality,
.admin-panel-block--fav,
.admin-panel-block--usage {
  grid-column: span 4;
}

.admin-metric-group {
  display: grid;
  gap: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface-muted);
  flex-shrink: 0;
}

.admin-metric-group--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-metric-group--4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-metric-group--6 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-metric-group .admin-stat {
  min-height: 48px;
  background: transparent;
}

.admin-metric-group--3 .admin-stat {
  border-bottom: none;
}

.admin-metric-group--3 .admin-stat:nth-child(3n) {
  border-right: none;
}

.admin-metric-group--4 .admin-stat:nth-child(2n) {
  border-right: none;
}

.admin-metric-group--4 .admin-stat:nth-child(-n + 2) {
  border-bottom: 1px solid var(--border-subtle);
}

.admin-metric-group--6 .admin-stat:nth-child(3n) {
  border-right: none;
}

.admin-metric-group--6 .admin-stat:nth-child(n + 4) {
  border-bottom: none;
}

.admin-panel-head {
  margin: 0 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--admin-fs-sm);
  font-weight: 600;
  flex-shrink: 0;
}

.admin-panel-head span {
  font-weight: 400;
  color: var(--muted);
  font-size: var(--admin-fs-xs);
}

.admin-stat-grid {
  display: grid;
  gap: 0;
  flex: 1;
  min-height: 0;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  overflow: hidden;
  align-content: start;
}

.admin-panel-block--quality .admin-stat-grid {
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: auto;
  align-self: start;
}

.admin-stat-grid--3 {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto;
}

.admin-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 8px 10px;
  background: transparent;
  border-right: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  min-height: 52px;
}

.admin-panel-block--quality .admin-stat {
  border-bottom: none;
}

.admin-panel-block--quality .admin-stat:nth-child(5n) {
  border-right: none;
}

.admin-stat-l {
  font-size: var(--admin-fs-xs);
  color: var(--muted);
  line-height: 1.2;
}

.admin-stat-v {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.admin-panel-foot {
  margin: 8px 0 0;
  font-size: var(--admin-fs-xs);
  color: var(--muted);
  flex-shrink: 0;
}

.admin-panel-split {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--admin-gap);
  align-items: stretch;
}

.admin-panel-split .admin-metric-group {
  flex: none;
}

.admin-rank-list {
  margin: 0;
  padding: 0;
  list-style: none;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
}

.admin-rank-list--inset {
  background: var(--surface-muted);
}

.admin-rank-empty {
  color: var(--muted);
  font-size: var(--admin-fs-sm);
  padding: 4px 0;
}

.admin-rank-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--admin-fs-sm);
  line-height: 1.35;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-subtle);
}

.admin-rank-list li:last-child {
  border-bottom: none;
}

.admin-rank-list .rank-no {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background: var(--surface-subtle);
  color: var(--muted);
  font-size: var(--admin-fs-xs);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-rank-list .rank-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-rank-list .rank-cnt {
  flex-shrink: 0;
  font-size: var(--admin-fs-sm);
  font-weight: 700;
  color: var(--text);
}

.admin-usage-cols {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--admin-gap);
}

.admin-usage-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.admin-usage-col h4 {
  margin: 0 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: var(--admin-fs-xs);
  font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.admin-usage-col .admin-rank-list {
  flex: 1;
  background: var(--surface-muted);
}

.admin-scroll-panel {
  overflow: auto;
  padding: 4px;
}

.admin-scroll-panel .users-table {
  font-size: var(--admin-fs-sm);
}

.admin-scroll-panel .users-table th,
.admin-scroll-panel .users-table td {
  padding: 6px 8px;
}

.admin-sync-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  min-height: 0;
  overflow: auto;
  padding: 4px 2px;
}

.admin-sync-all-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--surface-muted);
  flex-shrink: 0;
}

.admin-sync-all-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: var(--admin-fs-sm);
}

.admin-sync-types {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  flex-shrink: 0;
}

.admin-sync-type-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--surface);
}

.admin-sync-type-head h3 {
  margin: 0;
  font-size: var(--admin-fs-md);
  font-weight: 600;
}

.admin-sync-type-desc {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: var(--admin-fs-xs);
  line-height: 1.4;
}

.admin-sync-type-status {
  margin: 0;
  font-size: var(--admin-fs-sm);
  color: var(--muted);
}

.admin-sync-type-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-sync-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}

.admin-sync-job {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  font-size: var(--admin-fs-sm);
  flex-shrink: 0;
}

.admin-sync-job--running {
  border-color: var(--primary);
  color: var(--primary);
}

.admin-sync-job--done {
  border-color: #16a34a;
  color: #166534;
}

.admin-sync-job--fail {
  border-color: #dc2626;
  color: #991b1b;
}

.admin-sync-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  flex-shrink: 0;
}

.admin-sync-summary .admin-stat {
  min-height: 52px;
}

.admin-sync-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  flex: 1;
  min-height: 180px;
}

.admin-sync-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  overflow: hidden;
}

.admin-sync-card--errors {
  border-color: #fecaca;
}

[data-theme="dark"] .admin-sync-card--errors {
  border-color: #7f1d1d;
}

.admin-sync-card-title {
  margin: 0 0 8px;
  font-size: var(--admin-fs-md);
  font-weight: 600;
  flex-shrink: 0;
}

.admin-sync-table-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.admin-sync-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--admin-fs-sm);
}

.admin-sync-table th,
.admin-sync-table td {
  padding: 5px 6px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}

.admin-sync-table th {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

.admin-sync-table .col-time {
  white-space: nowrap;
  color: var(--muted);
  font-size: var(--admin-fs-xs);
}

.admin-sync-table .col-id {
  font-family: ui-monospace, monospace;
  font-size: var(--admin-fs-xs);
}

.admin-sync-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: var(--admin-fs-xs);
  font-weight: 600;
}

.admin-sync-badge--ok {
  background: #dcfce7;
  color: #166534;
}

.admin-sync-badge--err {
  background: #fee2e2;
  color: #991b1b;
}

[data-theme="dark"] .admin-sync-badge--ok {
  background: #14532d;
  color: #86efac;
}

[data-theme="dark"] .admin-sync-badge--err {
  background: #7f1d1d;
  color: #fecaca;
}

.admin-sync-empty {
  color: var(--muted);
  font-size: var(--admin-fs-sm);
  margin: 0;
}

.admin-sync-raw {
  flex-shrink: 0;
  font-size: var(--admin-fs-xs);
  color: var(--muted);
}

.admin-sync-raw-pre {
  margin: 6px 0 0;
  padding: 8px;
  max-height: 160px;
  overflow: auto;
  font-size: 0.7rem;
  background: var(--surface-muted);
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
}

@media (max-width: 960px) {
  .admin-sync-summary {
    grid-template-columns: repeat(2, 1fr);
  }
  .admin-sync-panels {
    grid-template-columns: 1fr;
  }
  .admin-sync-types {
    grid-template-columns: 1fr;
  }
  .admin-sync-all-bar {
    flex-direction: column;
    align-items: stretch;
  }
}

.warn-box--compact {
  margin: 4px 0 0;
  padding: 6px 8px;
  font-size: var(--admin-fs-sm);
}

[data-theme="dark"] .admin-status--pending {
  background: var(--surface-muted);
  color: var(--muted);
}

@media (max-width: 960px) {
  .admin-bento {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    overflow-y: auto;
  }
  .admin-metric-group--6,
  .admin-metric-group--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-metric-group--3 {
    grid-template-columns: 1fr;
  }
  .admin-panel-block--reg,
  .admin-panel-block--active,
  .admin-panel-block--online,
  .admin-panel-block--quality,
  .admin-panel-block--fav,
  .admin-panel-block--usage {
    grid-column: span 1;
  }
  .admin-panel-split {
    grid-template-columns: 1fr;
  }
  .admin-body { height: auto; overflow: auto; }
  .admin-body .main.admin-page { overflow: visible; }
}

@media (max-width: 720px) {
  .admin-metric-group--6,
  .admin-metric-group--4,
  .admin-metric-group--3 {
    grid-template-columns: 1fr;
  }
  .admin-metric-group .admin-stat {
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }
  .admin-metric-group .admin-stat:last-child {
    border-bottom: none;
  }
}

/* 登录页Tab切换 */

.site-toast {
  position: fixed;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  z-index: 10000;
  max-width: min(92vw, 420px);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.45;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(120%);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.site-toast.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.site-toast--success {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.site-toast--error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.site-toast--dev {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  cursor: pointer;
  text-align: left;
}

.site-toast-code {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.site-toast-hint,
.site-toast-label {
  font-size: 0.78rem;
  color: var(--muted);
}

[data-theme="dark"] .site-toast--success {
  background: rgba(22, 101, 52, 0.15);
  color: #86efac;
}

[data-theme="dark"] .site-toast--error {
  background: rgba(153, 27, 27, 0.15);
  color: #fecaca;
}

.login-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.login-tabs .tab-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted, var(--muted));
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.login-tabs .tab-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.login-tabs .tab-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* 验证码输入组 */
.code-input-group {
  margin-bottom: 16px;
}

.code-input-group .code-label {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.code-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.code-input-row input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
  transition: all 0.2s;
  font-family: monospace;
  letter-spacing: 2px;
}

.code-input-row input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.code-input-row .send-code-btn {
  flex-shrink: 0;
  width: 110px;
  padding: 12px 10px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted, var(--muted));
  cursor: pointer;
  transition: all 0.2s ease;
}

.code-input-row .send-code-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(59, 130, 246, 0.1);
}

.code-input-row .send-code-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.code-input-row .send-code-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.03);
}

.code-input-row .send-code-btn.sending {
  color: var(--primary);
}

.code-input-row .send-code-btn.countdown {
  color: var(--text-muted, var(--muted));
  border-color: var(--border-subtle);
}

/* 设置密码页面提示信息 */
.auth-info {
  background: rgba(59, 130, 246, 0.1);
  border-left: 3px solid var(--primary);
  padding: 12px 16px;
  margin-bottom: 20px;
  border-radius: 0 6px 6px 0;
  font-size: 0.88rem;
  color: var(--text-muted, var(--muted));
}

/* 认证表单优化 */
.auth-card {
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), #8b5cf6, #ec4899);
}

.auth-form input {
  transition: all 0.2s;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 移动端适配 */
@media (max-width: 480px) {
  .login-tabs {
    gap: 6px;
    padding: 3px;
  }
  
  .login-tabs .tab-btn {
    padding: 8px 12px;
    font-size: 0.85rem;
  }
  
  .code-input-row {
    flex-direction: column;
    gap: 8px;
  }
  
  .code-input-row .btn {
    width: 100%;
    padding: 12px;
  }
  
  .auth-card {
    margin: 0 16px;
    padding: 24px;
  }
}

/* ========== 个股图表指标面板 ========== */
.chart-stock-metrics {
  margin-top: 1rem;
  padding: 1rem 1.25rem;
}
.chart-stock-metrics-head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.chart-stock-metrics-head h2 {
  margin: 0;
  font-size: 1rem;
}
.chart-stock-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
}
.chart-stock-metric-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0.6rem;
  background: var(--surface-muted);
  border-radius: 6px;
  border: 1px solid var(--border, #333);
}
.chart-stock-metric-label {
  font-size: 0.8rem;
  color: var(--muted, #888);
}
.chart-stock-metric-value {
  font-size: 0.9rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.chart-stock-metric-value.is-up { color: #ef5350; }
.chart-stock-metric-value.is-down { color: #26a69a; }

/* 个股信息条 */
.chart-stock-info-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.stock-info-tag {
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--surface-muted);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.stock-info-tag strong {
  color: var(--text);
  font-weight: 600;
}
.stock-info-rank {
  color: var(--accent);
  border-color: var(--accent-ghost);
}

/* ── 个股详情页 ── */
.stock-detail-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px 20px 40px;
}
.breadcrumb-nav {
  margin-bottom: 12px;
}
.breadcrumb-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
}
.breadcrumb-link:hover {
  color: var(--primary);
}
.stock-detail-hero {
  padding: 20px 24px;
  margin-bottom: 16px;
}
.stock-detail-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.stock-detail-name {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--text);
}
.stock-detail-code {
  font-weight: 400;
  margin-left: 8px;
}
.stock-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.stock-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 500;
}
.stock-tag--board { background: rgba(88,166,255,0.12); color: var(--primary); }
.stock-tag--exchange { background: rgba(212,165,116,0.12); color: var(--accent); }
.stock-tag--industry { background: rgba(139,148,158,0.12); color: var(--muted); }
.stock-tag--area { background: rgba(139,148,158,0.08); color: var(--muted); }
.stock-detail-hero-price {
  text-align: right;
}
.stock-detail-price {
  font-size: 1.8rem;
  font-weight: 700;
  display: block;
}
.stock-detail-change {
  font-size: 1rem;
  font-weight: 600;
}
.stock-detail-hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.stock-detail-stat {
  background: var(--surface-muted, rgba(30,90,142,0.04));
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  text-align: center;
}
.stock-detail-stat-label {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 4px;
}
.stock-detail-stat-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.stock-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
@media (max-width: 640px) {
  .stock-detail-grid { grid-template-columns: 1fr; }
}
.stock-detail-card {
  padding: 16px 20px;
}
.stock-detail-card .panel-title {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: var(--muted);
}
.stock-detail-source {
  font-size: 0.7rem;
  margin: 0 0 10px;
}
.stock-detail-fin-grid,
.stock-detail-returns-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.stock-detail-fin-item,
.stock-detail-return-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  background: var(--surface-muted, rgba(30,90,142,0.03));
  border-radius: var(--radius-sm);
}
.stock-detail-fin-label,
.stock-detail-return-label {
  font-size: 0.78rem;
  color: var(--muted);
}
.stock-detail-fin-value,
.stock-detail-return-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}
.stock-detail-chart {
  padding: 16px 20px;
}
.stock-detail-chart .panel-title {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: var(--muted);
}
/* ============ 营收构成 ============ */
.stock-detail-comp-card {
  grid-column: 1 / -1;
}
.stock-detail-comp-tabs {
  display: flex;
  gap: 4px;
  margin: 8px 0 12px;
}
.comp-tab {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  padding: 4px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  font-family: inherit;
}
.comp-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.comp-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.stock-detail-comp-table-wrap {
  overflow-x: auto;
}
.stock-detail-comp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  line-height: 1.6;
}
.stock-detail-comp-table thead th {
  color: var(--muted);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  padding: 6px 8px;
  text-align: left;
  white-space: nowrap;
}
.stock-detail-comp-table tbody td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--border-subtle, var(--border));
  color: var(--text);
}
.stock-detail-comp-table .num-col {
  text-align: right;
  white-space: nowrap;
}
.stock-detail-comp-table .num-col.is-up { color: #c0392b; }
.stock-detail-comp-table .num-col.is-down { color: #1a7f4e; }

[data-theme="dark"] .stock-detail-comp-table .num-col.is-up { color: #e57373; }
[data-theme="dark"] .stock-detail-comp-table .num-col.is-down { color: #66bb6a; }
/* ============ 公司概况 ============ */
.stock-detail-profile-card {
  grid-column: 1 / -1;
}
.stock-detail-profile {
  margin-top: 2px;
}
/* 两栏布局 */
.spf-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 32px;
}
.spf-left {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.spf-right {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ===== 左侧：基础信息项 ===== */
.spf-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 14px;
  border-left: 3px solid transparent;
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.2s, border-color 0.2s;
}
/* 公司全称 - 首项加重 */
.spf-item:first-child {
  padding: 14px 14px;
  border-left-color: var(--primary);
  background: var(--surface-muted);
  border-radius: 8px 8px 0 0;
}
.spf-item:first-child .spf-label {
  font-size: 0.8rem;
  font-weight: 700;
}
.spf-item:first-child .spf-val {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
}
.spf-item:last-child {
  border-bottom: none;
}
.spf-item:hover {
  background: var(--surface-hover);
  border-left-color: var(--primary);
}
.spf-item .spf-label {
  flex: 0 0 auto;
  min-width: 85px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.03em;
  padding-top: 1px;
}
.spf-item .spf-val {
  flex: 1;
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.55;
  word-break: break-all;
}
.spf-item .spf-val a.spf-link {
  color: var(--primary);
  text-decoration: none;
  word-break: break-all;
  border-bottom: 1px dashed var(--primary);
  transition: border-color 0.2s;
}
.spf-item .spf-val a.spf-link:hover {
  border-bottom-style: solid;
}

/* ===== 右侧：长文本卡片 ===== */
.spf-block {
  background: var(--surface-muted);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 16px 18px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.spf-block:hover {
  border-color: var(--border);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}
.spf-label--block {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
}
.spf-label--block::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--primary);
  flex-shrink: 0;
}
.spf-text {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.78;
  white-space: pre-line;
}
.spf-text--fold {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* 展开/收起按钮 */
.spf-expand {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 4px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.spf-expand::after {
  content: "▾";
  font-size: 0.7rem;
  transition: transform 0.2s;
}
.spf-expand:hover {
  background: var(--surface-hover);
  border-color: var(--primary);
}
.spf-block:not(:has(.spf-text--fold)) .spf-expand::after {
  transform: rotate(180deg);
}

/* 链接样式 */
.spf-link {
  color: var(--primary, #58a6ff);
  text-decoration: none;
  word-break: break-all;
}
.spf-link:hover {
  text-decoration: underline;
}

/* 响应式：小屏单列 */
@media (max-width: 640px) {
  .spf-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .spf-item .spf-label {
    min-width: 72px;
    font-size: 0.74rem;
  }
  .spf-item .spf-val {
    font-size: 0.86rem;
  }
}
.chart-embed {
  position: relative;
  min-height: 200px;
}
.chart-embed canvas {
  display: block;
  width: 100%;
}
.stock-chart-loading {
  text-align: center;
  padding: 60px 0;
}
