/* 墨与印（2026-10-26 定）：月白灰底、墨线，赭＝房地产、靛＝国有、秋香＝其他，记号与标志用黛（深色用月白）。
   三个类别色对 surface-2 做过色弱校验（dataviz validate_palette.js --pairs all）。 */
:root {
  --bg: #ECEFF1; --surface-1: #DFE3E7; --surface-2: #F5F7F8;
  --text-primary: #1E1C28; --text-secondary: #4B4858; --text-muted: #6C6A78;
  --border: #D2D6DB; --border-strong: #B3B8C0;
  --line: #4B4858; --accent: #4A4266;
  --brand-ink: #4A4266;
  --c-re: #932c21; --c-state: #2677b2; --c-private: #938010; --c-unknown: #A6A9B2;
  --font: "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-serif: "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --bg: #16191D; --surface-1: #2A2F35; --surface-2: #1F2328;
  --text-primary: #E4E8EC; --text-secondary: #A7AEB7; --text-muted: #858C96;
  --border: #2D3238; --border-strong: #404650;
  --line: #6E7580; --accent: #D6ECF0;
  --brand-ink: #D6ECF0;
  --c-re: #b54c3d; --c-state: #2b88c0; --c-private: #a38f28; --c-unknown: #4E535B;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #16191D; --surface-1: #2A2F35; --surface-2: #1F2328;
  --text-primary: #E4E8EC; --text-secondary: #A7AEB7; --text-muted: #858C96;
  --border: #2D3238; --border-strong: #404650;
  --line: #6E7580; --accent: #D6ECF0;
  --brand-ink: #D6ECF0;
  --c-re: #b54c3d; --c-state: #2b88c0; --c-private: #a38f28; --c-unknown: #4E535B;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text-primary);
  font: 15px/1.6 var(--font);
  padding-block: 28px 48px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.wrap { max-width: 1360px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
h1 { margin: 0; font-size: 28px; }
h2 { margin: 0 0 8px; font-size: 18px; }
.draft {
  margin: 4px 0 0; display: inline-block; font-size: 13px; color: var(--text-secondary);
  border: 1px dashed var(--accent); border-radius: 4px; padding: 2px 8px;
}
.controls { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.seg { display: inline-flex; }
.seg button {
  font: inherit; font-size: 14px; min-height: 36px; padding: 4px 14px; cursor: pointer;
  border: 1px solid var(--border-strong); background: transparent; color: var(--text-primary);
}
.seg button + button { border-left: none; }
.seg button:first-child { border-radius: 6px 0 0 6px; }
.seg button:last-child { border-radius: 0 6px 6px 0; }
.seg button[aria-pressed="true"] { background: var(--surface-1); font-weight: 600; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px;
  font-size: 13px; color: var(--text-secondary); }
.legend li { display: flex; align-items: center; gap: 6px; }
figure { margin: 0; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px; }
.scroll { overflow-x: auto; }
svg#chart { display: block; }

.key-line, .edge { stroke: var(--line); stroke-width: 2; fill: none; stroke-linecap: round; }
.dashed, .edge.uncertain { stroke-dasharray: 3 4; }
.edge.cross { stroke-width: 1.5; stroke-dasharray: 1 4; }
.edge, .dot, .label { transition: opacity 400ms ease; }
.band { fill: var(--surface-1); }
.band-label, .axis { fill: var(--text-muted); font-size: 11px; font-family: var(--font-serif); }
.milestone { stroke: var(--border-strong); stroke-dasharray: 2 3; }
.dot { fill: var(--line); }
.hit { fill: transparent; cursor: pointer; }
.label { fill: var(--text-secondary); font-size: 11px; font-family: var(--font-serif); cursor: pointer; }
.label:hover { fill: var(--text-primary); }
.key-dispute, .dispute { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.key-shell, .shell { fill: var(--accent); }
.key-tick, .tick { stroke: var(--text-muted); stroke-width: 1.5; }

/* 选中一条谱系时：其余淡出，选中的用强调色 */
.has-focus .edge, .has-focus .dot, .has-focus .label { opacity: 0.18; }
.has-focus .focus { opacity: 1; }
.has-focus .edge.focus { stroke: var(--accent); }
.has-focus .dot.focus { fill: var(--accent); }
.has-focus .label.focus { fill: var(--text-primary); font-weight: 600; }

.tip {
  position: fixed; z-index: 10; pointer-events: none; max-width: 300px;
  background: var(--surface-2); color: var(--text-primary); border: 1px solid var(--border-strong);
  border-radius: 6px; padding: 8px 10px; font-size: 13px; line-height: 1.5;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.12);
}
.tip strong { display: block; }
.tip .muted { color: var(--text-secondary); }

table { border-collapse: collapse; font-size: 13px; min-width: 900px; }
th, td { text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--text-secondary); font-weight: 600; }
td a { color: var(--text-secondary); }
td { white-space: nowrap; }
td.wrap { white-space: normal; min-width: 180px; }

/* 按股东行业上色（三类资本 + 灰；已用 dataviz 校验器在两种模式下验证） */
.color-industry .edge.ind-re { stroke: var(--c-re); }
.color-industry .edge.ind-state { stroke: var(--c-state); }
.color-industry .edge.ind-private { stroke: var(--c-private); }
.color-industry .edge.ind-unknown { stroke: var(--c-unknown); }
.color-industry .dot.ind-re { fill: var(--c-re); }
.color-industry .dot.ind-state { fill: var(--c-state); }
.color-industry .dot.ind-private { fill: var(--c-private); }
.color-industry .dot.ind-unknown { fill: var(--c-unknown); }
.has-focus.color-industry .edge.focus { stroke-width: 3; }
.color-industry.has-focus .edge.focus.ind-re { stroke: var(--c-re); }
.color-industry.has-focus .edge.focus.ind-state { stroke: var(--c-state); }
.color-industry.has-focus .edge.focus.ind-private { stroke: var(--c-private); }
.color-industry.has-focus .edge.focus.ind-unknown { stroke: var(--c-unknown); }
.swatch { display: inline-block; width: 14px; height: 4px; border-radius: 2px; }
.swatch.ind-re { background: var(--c-re); }
.swatch.ind-state { background: var(--c-state); }
.swatch.ind-private { background: var(--c-private); }
.swatch.ind-unknown { background: var(--c-unknown); }
.pick { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-secondary); }
.pick select {
  font: inherit; color: var(--text-primary); background: var(--surface-2);
  border: 1px solid var(--border-strong); border-radius: 6px; min-height: 36px; padding: 4px 8px; max-width: 60vw;
}
.brand { display: flex; align-items: center; gap: 16px; }
.logo { display: block; line-height: 0; }
.logo svg { height: 88px; width: auto; }
.brand h1 { font-size: 20px; font-weight: 500; color: var(--text-secondary); }
