/* ===================================================================
   ccopc 产业追踪工作台 · 样式 v3(深紫 VI · 唯一权威源)
   位置:industry_tracker/site/styles.css,随 deploy 管线发布到 /research/styles.css
   默认深色;浅色仅用户可选([data-theme="light"],theme.js 切换)。
   =================================================================== */
:root {
  color-scheme: dark;
  --bg: #070416;
  --shell: #070416;
  --shell-2: #140b30;
  --paper: #140b30;
  --card: #140b30;
  --surface-2: #1a1140;
  --surface-3: #150c34;
  --ink: #e8edf4;
  --ink-2: #aab6c6;
  --muted: #6b7787;
  --line: #2a2150;
  --line-strong: #3a4658;
  --brand: #6c4be0;
  --blue: #4d8df5;           /* 信息 / 产业 */
  --cyan: #6c4be0;
  --green: #22c58b;          /* 正向 / 景气上行 */
  --amber: #eab23a;          /* 观察 / 待验证 */
  --red: #ff5a52;            /* 风险 / 证伪 */
  --violet: #9a8cf0;         /* 方法论 / 假设 */
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.38);
  --radius: 12px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; color: var(--ink);
  background:
    radial-gradient(circle at 16% -12%, rgba(108, 75, 224, 0.10), transparent 36%),
    radial-gradient(circle at 100% 4%, rgba(77, 141, 245, 0.08), transparent 28%),
    var(--bg);
  font-size: 14px; line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.app { min-height: 100vh; display: grid; grid-template-columns: 264px minmax(0, 1fr); }
.rail {
  position: sticky; top: 0; height: 100vh; padding: 18px 14px; color: #e8eef8;
  background: linear-gradient(180deg, var(--shell-2), var(--shell));
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.brand { padding: 6px 10px 16px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.brand-mark {
  display: inline-grid; place-items: center; width: 34px; height: 34px; margin-bottom: 10px;
  border-radius: 9px; background: linear-gradient(135deg, #9473cd, #6c4be0); color: #0a0e15; font-weight: 900;
}
.brand b { display: block; font-size: 17px; line-height: 1.18; }
.brand span { display: block; margin-top: 5px; color: #8aa0bd; font-size: 12px; font-weight: 700; }
.nav { display: grid; gap: 6px; margin-top: 16px; }
.nav a {
  display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 10px;
  min-height: 40px; padding: 8px 10px; border-radius: 8px; color: #c9d5e5; font-weight: 700;
}
.nav a.active, .nav a:hover { color: #fff; background: rgba(108, 75, 224, 0.18); }
.nav a.active { box-shadow: inset 2px 0 0 var(--brand); }
.nav i {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px;
  background: rgba(255,255,255,0.08); font-style: normal; font-size: 11px; font-weight: 900;
}
.nav small { color: #7f92ad; font-size: 11px; }
.rail-foot { margin-top: auto; padding: 11px; border: 1px solid rgba(255,255,255,0.08); border-radius: 10px; background: rgba(255,255,255,0.04); }
.rail-foot strong { display: block; color: #fff; font-size: 12px; }
.rail-foot span { color: #92a6bf; font-size: 11px; font-weight: 700; }
.main { min-width: 0; padding: 20px 26px 40px; }
.topline { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 14px; }
.crumb { color: var(--muted); font-size: 12px; font-weight: 800; }
.chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.chip, .tag {
  display: inline-flex; align-items: center; min-height: 24px; padding: 3px 9px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2);
  color: var(--ink-2); font-size: 12px; font-weight: 800; white-space: nowrap;
}
.chip::before { content: ""; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--blue); }
.chip.green::before { background: var(--green); }
.chip.amber::before { background: var(--amber); }
.chip.red::before { background: var(--red); }
.chip.violet::before { background: var(--violet); }
.tag { border-radius: 7px; background: rgba(77,141,245,0.14); color: #9fc1f7; border-color: rgba(77,141,245,0.30); }
.tag.green { color: #5fe0ae; background: rgba(34,197,139,0.15); border-color: rgba(34,197,139,0.32); }
.tag.amber { color: #f2c766; background: rgba(234,178,58,0.15); border-color: rgba(234,178,58,0.32); }
.tag.red { color: #ff8a84; background: rgba(255,90,82,0.15); border-color: rgba(255,90,82,0.32); }
.tag.violet { color: #bdb2f7; background: rgba(154,140,240,0.15); border-color: rgba(154,140,240,0.32); }
.tag.dark { color: #0a0e15; background: var(--brand); border-color: var(--brand); }
h1, h2, h3 { margin: 0; line-height: 1.18; }
h1 { font-size: clamp(26px, 3vw, 38px); }
.page-head { margin-bottom: 16px; }
.eyebrow { color: var(--brand); font-size: 12px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.lead { max-width: 860px; margin: 10px 0 0; color: var(--ink-2); font-size: 14px; font-weight: 600; }
.head-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.grid-2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; }
.section { margin-top: 14px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.card-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  min-height: 48px; padding: 11px 14px; border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: var(--radius) var(--radius) 0 0;
}
.card-head h2 { font-size: 17px; }
.card-body { padding: 13px 14px; }
.rows { display: grid; gap: 8px; }
.row {
  display: grid; grid-template-columns: 86px minmax(0,1fr) auto; gap: 10px; align-items: center;
  min-height: 46px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-3);
}
.row.overdue { border-color: rgba(255,90,82,0.45); background: rgba(255,90,82,0.08); }
.row span { color: var(--muted); font-size: 12px; font-weight: 800; }
.row b { color: var(--ink); font-size: 13px; font-weight: 700; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.metric { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); min-height: 96px; padding: 13px; }
.metric span { color: var(--muted); font-size: 12px; font-weight: 800; }
.metric b { display: block; margin-top: 9px; font-size: 28px; line-height: 1; font-variant-numeric: tabular-nums; }
.metric small { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; font-weight: 700; }
.metric.green b { color: var(--green); }
.metric.amber b { color: var(--amber); }
.metric.red b { color: var(--red); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 11px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); background: var(--surface-2); font-size: 12px; font-weight: 900; white-space: nowrap; }
td { color: var(--ink-2); font-size: 13px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: none; }
.map-panel { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.map-stage { position: relative; min-height: 150px; padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-3); }
.map-stage::after { content: ""; position: absolute; right: -11px; top: 46px; width: 20px; height: 2px; background: var(--line-strong); }
.map-stage:last-child::after { display: none; }
.stage-title { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.stage-title i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--blue); color: #fff; font-style: normal; font-weight: 900; font-size: 12px; }
.stage-title h3 { font-size: 14px; }
.stage-body { color: var(--ink-2); font-size: 13px; }
.score-grid { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 8px; }
.score { min-height: 74px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-3); text-align: center; }
.score b { display: block; font-size: 24px; line-height: 1; color: var(--brand); font-variant-numeric: tabular-nums; }
.score span { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; font-weight: 800; }
.kv { display: grid; gap: 8px; }
.kv > div { display: grid; grid-template-columns: 110px minmax(0,1fr); gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.kv > div:last-child { border-bottom: none; }
.kv span { color: var(--muted); font-size: 12px; font-weight: 800; }
.kv b { color: var(--ink); font-size: 13px; font-weight: 700; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.filter-bar button {
  padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2);
  color: var(--ink-2); font-size: 12px; font-weight: 800; cursor: pointer;
}
.filter-bar button.on { color: #0a0e15; background: var(--brand); border-color: var(--brand); }
.disclaimer { margin-top: 22px; color: var(--muted); font-size: 12px; font-weight: 600; border-top: 1px solid var(--line); padding-top: 14px; }
.note { color: var(--muted); font-size: 12px; font-weight: 600; }
.card-link { display: block; }
.card-link:hover { border-color: var(--brand); }
.card-link:hover .card-head h2 { color: var(--brand); }
@media (max-width: 1180px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; }
  .nav { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .grid-2, .grid-3, .map-panel, .metric-grid { grid-template-columns: 1fr; }
  .map-stage::after { display: none; }
}
@media (max-width: 720px) {
  .main { padding: 14px 12px 28px; }
  .nav, .score-grid { grid-template-columns: 1fr; }
  .topline { align-items: flex-start; flex-direction: column; }
  .chips { justify-content: flex-start; }
  .row { grid-template-columns: 1fr; }
}

/* ===== 浅色主题(可选,默认深色)data-theme="light" ===== */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f0fa;
  --paper: #ffffff;
  --card: #ffffff;
  --surface-2: #ece8f8;
  --surface-3: #f7f5fc;
  --ink: #1b1440;
  --ink-2: #453a78;
  --muted: #6f6a92;
  --line: #ddd7f0;
  --line-strong: #c9c1e8;
  --blue: #2f6fe0;
  --green: #0e8f5f;
  --amber: #a06f13;
  --red: #d13a34;
  --violet: #6e5fe0;
  --shadow: 0 10px 30px rgba(27, 20, 64, 0.10);
  /* 侧栏保持深色壳(--shell 不覆盖) */
}
[data-theme="light"] body {
  background:
    radial-gradient(circle at 16% -12%, rgba(108, 75, 224, 0.07), transparent 36%),
    radial-gradient(circle at 100% 4%, rgba(77, 141, 245, 0.05), transparent 28%),
    var(--bg);
}
[data-theme="light"] .tag { color: #3a55b4; background: rgba(47, 111, 224, 0.10); border-color: rgba(47, 111, 224, 0.26); }
[data-theme="light"] .tag.green { color: #0b7a50; background: rgba(15, 169, 104, 0.12); border-color: rgba(15, 169, 104, 0.30); }
[data-theme="light"] .tag.amber { color: #8a5f0e; background: rgba(185, 130, 26, 0.12); border-color: rgba(185, 130, 26, 0.30); }
[data-theme="light"] .tag.red { color: #b02f2a; background: rgba(226, 59, 54, 0.10); border-color: rgba(226, 59, 54, 0.28); }
[data-theme="light"] .tag.violet { color: #584bc0; background: rgba(110, 95, 224, 0.10); border-color: rgba(110, 95, 224, 0.28); }
[data-theme="light"] .tag.dark { color: #ffffff; }
[data-theme="light"] .chip { background: #ffffff; }
[data-theme="light"] .filter-bar button.on { color: #ffffff; }
