/* 股票工作台 — 界面样式。亮色为主，跟随系统切换暗色。
 * 颜色：中国习惯红涨绿跌；环节综合分用蓝色深浅（t1 低 → t5 高），高价值环节用金色描边。 */
:root {
  --bg: #f5f6f8; --panel: #ffffff; --panel2: #f3f4f7; --hover: #eef0f4; --line: #e3e6eb; --line2: #eceef2;
  --text: #121826; --muted: #5d6677; --faint: #9aa1ae;
  --accent: #2563eb; --accent-2: #4f7cf5; --accent-soft: rgba(37, 99, 235, .08); --on-accent: #fff;
  --up: #e03b3b; --down: #14995a; --gold: #d4930a; --gold-soft: rgba(212, 147, 10, .12);
  --t1: #f7f8fa; --t2: #f0f4fd; --t3: #e4ecfd; --t4: #d5e1fd; --t5: #c3d4fc;
  --s1: #e9ecf1; --s2: #e1e7f3; --s3: #c9d7f6; --s4: #4f7cf5; --s5: #2563eb;
  --track: rgba(18, 24, 38, .09);
  --orange: #e8890c;
  --h1: #f3f5f8; --h1t: #94a3b8; --h2: #e8effc; --h2t: #475569; --h3: #c7dafc; --h3t: #1e3a8a; --h4: #5b8def; --h4t: #fff; --h5: #1d4ed8; --h5t: #fff;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14), 0 2px 6px rgba(16, 24, 40, .06);
  --r: 8px; --r-lg: 12px;
  font-size: 13px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1014; --panel: #15181e; --panel2: #1b1f27; --hover: #20252e; --line: #272c36; --line2: #20242d;
    --text: #e8eaef; --muted: #9aa2b2; --faint: #5f6776;
    --accent: #5b8cff; --accent-2: #7aa2ff; --accent-soft: rgba(91, 140, 255, .12);
    --up: #f0545a; --down: #22b573; --gold: #f2b53a; --gold-soft: rgba(242, 181, 58, .12);
    --t1: #171a21; --t2: #191f2b; --t3: #1c2438; --t4: #202c4a; --t5: #26365e;
    --s1: #2a2f3a; --s2: #2d3546; --s3: #34456b; --s4: #4a72d9; --s5: #5b8cff;
    --track: rgba(255, 255, 255, .1);
    --orange: #f0a43a;
    --h1: #1a1e26; --h1t: #5f6776; --h2: #1e2636; --h2t: #8e9ab0; --h3: #253a66; --h3t: #b9cdfc; --h4: #3460c8; --h4t: #eef2ff; --h5: #5b8cff; --h5t: #fff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased; line-height: 1.5; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 10px; outline: none; transition: border-color .12s, box-shadow .12s; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
a { color: var(--accent); text-decoration: none; cursor: pointer; }
a:hover { text-decoration: underline; }
b, strong { font-weight: 600; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.up { color: var(--up); } .down { color: var(--down); }
.num, td { font-variant-numeric: tabular-nums; }
.ic { width: 15px; height: 15px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--faint); }

/* ---------- 框架 ---------- */
#app { display: grid; grid-template-columns: 212px 1fr; height: 100vh; }
#sidebar { background: var(--panel); border-right: 1px solid var(--line); padding: 0 10px 10px; display: flex; flex-direction: column; overflow: hidden; position: relative; }
.drag { height: 34px; -webkit-app-region: drag; flex-shrink: 0; }
.brand { font-weight: 650; font-size: 14.5px; padding: 0 6px 12px; display: flex; align-items: center; gap: 8px; letter-spacing: .2px; }
.brand::before { content: ''; width: 18px; height: 18px; border-radius: 5px; background: linear-gradient(135deg, var(--accent-2), var(--accent) 60%, #1e3a8a); box-shadow: inset 0 -6px 0 rgba(255,255,255,.18); flex-shrink: 0; }
#search { width: 100%; background: var(--panel2); border-color: transparent; padding: 6px 10px 6px 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa1ae' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 14px; background-position: 9px 50%; }
#search:focus { background-color: var(--panel); }
#search-results { position: absolute; left: 10px; right: 10px; top: 108px; z-index: 30; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 4px; }
#search-results:empty { display: none; }
#search-results div { padding: 6px 8px; cursor: pointer; display: flex; justify-content: space-between; border-radius: 6px; }
#search-results div:hover { background: var(--hover); }
#nav { flex: 1; overflow-y: auto; margin-top: 8px; }
.nav-group { color: var(--faint); font-size: 11px; font-weight: 600; letter-spacing: .4px; padding: 14px 8px 4px; display: flex; justify-content: space-between; align-items: center; }
.nav-group button { background: none; border: none; color: var(--faint); padding: 0 2px; display: flex; border-radius: 4px; }
.nav-group button:hover { color: var(--text); background: var(--hover); }
.nav-group a { font-weight: 400; letter-spacing: 0; }
.nav-item { height: 30px; padding: 0 8px; border-radius: 6px; cursor: pointer; display: flex; gap: 8px; align-items: center; color: var(--muted); margin: 1px 0; white-space: nowrap; }
.nav-item .ic { color: var(--faint); }
.nav-item .emo { width: 16px; text-align: center; font-size: 13px; filter: saturate(.85); }
.nav-item:hover { background: var(--hover); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item.active .ic { color: var(--accent); }
.nav-item .cnt { margin-left: auto; color: var(--faint); font-size: 11.5px; font-weight: 400; }
.nav-item .badge { margin-left: auto; background: var(--up); color: #fff; border-radius: 9px; font-size: 10.5px; font-weight: 600; padding: 0 6px; line-height: 17px; }
#status { font-size: 11px; color: var(--faint); padding: 8px 8px 0; line-height: 1.55; border-top: 1px solid var(--line2); margin-top: 6px; }

main { overflow-y: auto; padding: 0 24px 40px; }
.page-head { position: sticky; top: 0; background: var(--bg); z-index: 5; padding: 22px 0 12px; -webkit-app-region: drag; }
.page-head * { -webkit-app-region: no-drag; }
.page-head h1 { margin: 0; font-size: 18px; font-weight: 650; display: flex; align-items: center; gap: 8px; letter-spacing: .2px; }
.page-head .desc { color: var(--muted); max-width: 1000px; line-height: 1.6; margin-top: 4px; font-size: 12.5px; }
.ph-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ph-tools { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ch-ico { font-size: 17px; }
.toolbar { display: flex; gap: 6px; align-items: center; margin-top: 10px; flex-wrap: wrap; }

/* ---------- 按钮、标签 ---------- */
.btn { height: 28px; display: inline-flex; align-items: center; gap: 5px; background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 0 10px; font-size: 12.5px; color: var(--text); white-space: nowrap; box-shadow: 0 1px 1px rgba(16,24,40,.03); transition: background .12s, border-color .12s; }
.btn:hover { background: var(--hover); }
.btn .ic { width: 14px; height: 14px; color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary .ic { color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.on { background: var(--gold-soft); border-color: var(--gold); color: var(--gold); }
.btn.small { height: 24px; padding: 0 8px; font-size: 12px; }
.btn.danger { color: var(--up); }
.icon-btn { width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border: none; background: none; color: var(--faint); border-radius: 5px; padding: 0; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn .ic { width: 14px; height: 14px; }
.legend { display: flex; gap: 12px; color: var(--muted); font-size: 11.5px; align-items: center; flex-wrap: wrap; }
.legend .ramp { display: inline-flex; gap: 2px; vertical-align: -1px; }
.legend .ramp i { width: 14px; height: 10px; border-radius: 2px; display: inline-block; border: 1px solid var(--line2); }
.legend .gold-key { display: inline-block; width: 12px; height: 10px; border: 1.5px solid var(--gold); border-radius: 3px; vertical-align: -1px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.chip { font-size: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; cursor: pointer; white-space: nowrap; line-height: 20px; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.lead { border-color: var(--gold); background: var(--gold-soft); }
.chip .p { margin-left: 4px; }
.tag { font-size: 10.5px; color: var(--muted); background: var(--panel2); border-radius: 4px; padding: 0 5px; margin-left: 6px; font-weight: 400; line-height: 17px; display: inline-block; vertical-align: 1px; }
.dots { letter-spacing: 1px; font-size: 9px; white-space: nowrap; }
.dots b { color: var(--accent); font-weight: normal; } .dots span { color: var(--track); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex-shrink: 0; }
.dot.red { background: var(--up); } .dot.green { background: var(--down); } .dot.blue { background: var(--accent); } .dot.gold { background: var(--gold); } .dot.gray { background: var(--faint); }

/* ---------- 产业链：切换排版 ---------- */
.segc { display: inline-flex; gap: 2px; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 2px; margin-right: 4px; }
.segc button { border: 0; background: none; height: 22px; padding: 0 11px; border-radius: 6px; font-size: 12.5px; color: var(--muted); }
.segc button:hover { color: var(--text); }
.segc button.on { background: var(--panel); color: var(--accent); font-weight: 600; box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }
.no { font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 5px; padding: 0 5px; line-height: 18px; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.star { color: var(--gold); font-size: 12px; line-height: 17px; }
.sc { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; min-width: 30px; height: 18px; padding: 0 5px; border-radius: 5px; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--s1); color: var(--muted); }
.sc .trend { font-style: normal; margin-left: 1px; font-size: 10px; }
.trend-big { font-size: 12px; font-weight: 600; margin-left: 6px; }
.score-log { font-size: 12.5px; line-height: 1.7; }
.sc.s2 { background: var(--s2); } .sc.s3 { background: var(--s3); color: var(--accent); } .sc.s4 { background: var(--s4); color: #fff; } .sc.s5 { background: var(--s5); color: #fff; }
.legend .ramp i.s1 { background: var(--s1); } .legend .ramp i.s2 { background: var(--s2); } .legend .ramp i.s3 { background: var(--s3); } .legend .ramp i.s4 { background: var(--s4); } .legend .ramp i.s5 { background: var(--s5); }
.map-foot { display: flex; align-items: center; gap: 16px; margin-top: 10px; color: var(--faint); font-size: 11.5px; flex-wrap: wrap; }

/* ---------- 产业链：地图（每层一行，上游在上） ---------- */
.cmap { display: flex; flex-direction: column; gap: 9px; }
.crow { position: relative; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 6px; box-shadow: var(--shadow); }
.crow:not(:last-child)::after { content: ''; position: absolute; left: 42px; bottom: -7px; width: 10px; height: 10px; background: var(--panel); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: rotate(45deg); z-index: 1; }
.crow-h { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; padding: 3px 6px 3px 5px; border-right: 1px dashed var(--line); }
.crow-h b { font-size: 13px; line-height: 1.3; word-break: break-all; }
.crow-h em { font-style: normal; font-size: 11px; color: var(--faint); }
.crow-tools { display: flex; margin-top: auto; opacity: 0; transition: opacity .12s; }
.crow:hover .crow-tools { opacity: 1; }
.tiles { display: grid; grid-template-columns: repeat(var(--cols, 6), minmax(0, 1fr)); gap: 8px; align-content: start; }
.tile { position: relative; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 9px; padding: 6px 9px 6px 13px; cursor: pointer; transition: border-color .12s, box-shadow .12s, transform .12s; }
.tile::before { content: ''; position: absolute; left: 4px; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--s1); }
.tile.t2::before { background: var(--s2); } .tile.t3::before { background: var(--s3); } .tile.t4::before { background: var(--s4); } .tile.t5::before { background: var(--s5); }
.tile:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-1px); }
.tile.gold { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); background: linear-gradient(180deg, var(--gold-soft), var(--panel) 70%); }
.tile.dim { opacity: .3; }
.tile-h { display: flex; align-items: flex-start; gap: 4px; }
.tile-n { flex: 1; min-width: 0; font-weight: 600; font-size: 12.5px; line-height: 17px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-wrap: balance; }
.tile-m { display: flex; gap: 10px; font-size: 10.5px; color: var(--muted); margin: 3px 0 3px; white-space: nowrap; }
.pips { display: inline-flex; gap: 2px; margin-left: 4px; }
.pips i { width: 6px; height: 6px; border-radius: 50%; background: var(--track); }
.pips i.on { background: var(--accent-2); }
.tlead { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; line-height: 19px; border-radius: 4px; margin: 0 -4px; padding: 0 4px; }
.tlead:hover { background: rgba(127, 127, 127, .12); }
.tlead > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tile-add { justify-self: start; width: 32px; min-height: 56px; padding: 0; border: 1px dashed var(--line); border-radius: 9px; background: none; color: var(--faint); display: flex; align-items: center; justify-content: center; }
.tile-add:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- 产业链：表格（热力对比） ---------- */
.ctbl-bar { display: flex; align-items: center; gap: 14px; margin: 0 0 8px; font-size: 12px; }
.ctbl-bar label.check { margin: 0; }
.ctbl-wrap { overflow-x: auto; }
table.ctbl th, table.ctbl td { text-align: center; }
table.ctbl th.l, table.ctbl td.name, table.ctbl td.layer, table.ctbl td.leads-c { text-align: left; }
table.ctbl th.on { color: var(--accent); }
table.ctbl td { height: 32px; padding: 0 8px; }
table.ctbl tbody tr { cursor: pointer; }
table.ctbl tr.grp-end td { border-bottom-color: var(--line); }
table.ctbl td.layer { vertical-align: top; padding: 7px 10px; background: var(--panel2); border-right: 1px solid var(--line2); white-space: normal; line-height: 1.4; font-weight: 600; }
table.ctbl tbody tr:hover td.layer { background: var(--panel2); }
table.ctbl td.layer .no { margin-right: 6px; }
table.ctbl td.layer.flat { vertical-align: middle; padding: 0 10px; background: none; border-right: 0; font-weight: 400; color: var(--muted); white-space: nowrap; }
table.ctbl td.name { font-weight: 600; }
table.ctbl td.name .star { margin-left: 4px; }
table.ctbl tr.gold td.name { background: linear-gradient(90deg, var(--gold-soft), transparent); }
.heat { display: inline-block; width: 30px; height: 20px; line-height: 20px; border-radius: 5px; font-style: normal; font-weight: 600; font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; }
.heat.h1 { background: var(--h1); color: var(--h1t); } .heat.h2 { background: var(--h2); color: var(--h2t); } .heat.h3 { background: var(--h3); color: var(--h3t); }
.heat.h4 { background: var(--h4); color: var(--h4t); } .heat.h5 { background: var(--h5); color: var(--h5t); }
.legend .ramp i.heat { width: 14px; height: 10px; border: 0; }
.lead-c { display: inline-flex; gap: 5px; margin-right: 12px; padding: 0 3px; border-radius: 4px; cursor: pointer; }
.lead-c:hover { background: var(--hover); color: var(--accent); }

/* ---------- 产业链：上下游（流程图） ---------- */
.fempty { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--accent-soft); color: var(--muted); font-size: 12.5px; }
.fempty > .ic { width: 18px; height: 18px; color: var(--accent); }
.fempty > span { flex: 1; }
.fgraph-wrap { overflow-x: auto; border-radius: var(--r-lg); }
.fgraph { position: relative; min-width: calc(var(--n) * 108px + (var(--n) - 1) * 28px + 40px); padding: 10px 14px 32px 26px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.fcols { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(var(--n), minmax(108px, 230px)); justify-content: space-between; gap: 28px; }
.fcol { min-width: 0; }
.fcol-h { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; white-space: nowrap; overflow: hidden; }
.fcol-h b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.fnodes { display: flex; flex-direction: column; justify-content: center; gap: 8px; min-height: var(--h); }
.fn { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px 5px; cursor: pointer; box-shadow: var(--shadow); transition: border-color .12s, box-shadow .12s; }
.fn:hover { border-color: var(--accent); }
.fn-1 { display: flex; align-items: center; gap: 4px; font-weight: 600; font-size: 12.5px; line-height: 18px; }
.fn-n, .fn-l { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fn-2 { display: flex; align-items: center; gap: 4px; font-size: 11px; line-height: 17px; color: var(--muted); }
.fn .sc { min-width: 28px; height: 16px; padding: 0 4px; font-size: 10.5px; }
.fn.sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: color-mix(in srgb, var(--accent) 7%, var(--panel)); }
.fn.up1 { border-color: color-mix(in srgb, var(--accent) 75%, var(--panel)); background: color-mix(in srgb, var(--accent) 4%, var(--panel)); }
.fn.up2 { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.fn.dn1 { border-color: var(--orange); background: color-mix(in srgb, var(--orange) 6%, var(--panel)); }
.fn.dn2 { border-color: color-mix(in srgb, var(--orange) 40%, var(--line)); }
.fn.fade { border-color: var(--line2); box-shadow: none; }
.fn.fade .fn-1 { color: var(--faint); font-weight: 500; }
.fn.fade .fn-2 { color: var(--faint); opacity: .75; }
.fn.fade .sc, .fn.fade .star { opacity: .45; }
.fn-empty { font-size: 12px; }
svg.fedges { position: absolute; left: 0; top: 0; z-index: 0; overflow: visible; pointer-events: none; }
.fe { fill: none; stroke: var(--faint); stroke-width: 1.1; opacity: .45; }
.fe.u1 { stroke: var(--accent); stroke-width: 2.2; opacity: 1; }
.fe.u2 { stroke: var(--accent); stroke-width: 1.5; opacity: .45; }
.fe.d1 { stroke: var(--orange); stroke-width: 2.2; opacity: 1; }
.fe.d2 { stroke: var(--orange); stroke-width: 1.5; opacity: .5; }
.fa { fill: var(--faint); } .fa.u1, .fa.u2 { fill: var(--accent); } .fa.d1, .fa.d2 { fill: var(--orange); }
.fhint { position: absolute; right: 16px; bottom: 8px; z-index: 2; display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); }
.fhint i, .fcard h3 i { display: inline-block; width: 16px; height: 3px; border-radius: 2px; vertical-align: 3px; margin-right: 5px; }
.k-up { background: var(--accent); } .k-dn { background: var(--orange); }
.fdetail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1fr); gap: 12px; margin-top: 12px; align-items: start; }
.fcard { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px 14px; box-shadow: var(--shadow); }
.fcard h3 { margin: 0 0 6px; font-size: 13px; display: flex; align-items: center; }
.frow { display: flex; align-items: center; gap: 6px; margin: 0 -4px; padding: 4px; font-size: 12px; border-top: 1px solid var(--line2); border-radius: 4px; cursor: pointer; }
.frow:first-of-type { border-top: 0; }
.frow:hover { background: var(--hover); }
.frow .nm { min-width: 0; max-width: 46%; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frow .sc { min-width: 28px; height: 17px; font-size: 10.5px; }
.frow .cos { display: flex; gap: 10px; margin-left: auto; min-width: 0; white-space: nowrap; overflow: hidden; }
.frow .cos > span:hover, .fleads > span:hover { color: var(--accent); }
.frow .cos > span > span, .fleads > span > span { margin-left: 4px; }
.fmore { margin-top: 8px; font-size: 12px; line-height: 1.9; color: var(--muted); }
.fmore a { color: var(--text); background: var(--panel2); border-radius: 5px; padding: 1px 6px; white-space: nowrap; }
.fmore a:hover { color: var(--accent); text-decoration: none; }
.fbig { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 650; }
.fmet { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 6px 0; font-size: 12px; color: var(--muted); }
.fmet b { color: var(--text); }
.fleads { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; }
.fleads > span { cursor: pointer; }
.fcos { margin-top: 8px; padding-top: 7px; border-top: 1px dashed var(--line); font-size: 12px; line-height: 1.7; }
.fcos b { margin-right: 8px; color: var(--muted); font-weight: 500; }
.fcos a { color: var(--text); } .fcos a:hover { color: var(--accent); }
.fbtns { display: flex; gap: 6px; margin-top: 10px; }
.link-row { display: flex; align-items: baseline; gap: 10px; margin-top: 4px; }
.link-row > span { flex-shrink: 0; font-size: 12px; }
.link-row .chips { margin-top: 0; }
.block h4 a { font-weight: 400; margin-left: 6px; }
@media (prefers-color-scheme: dark) {
  .segc { background: var(--bg); }
  .segc button.on { background: var(--hover); box-shadow: none; }
}

/* ---------- 面板、抽屉 ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
#drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(1000px, 74vw); background: var(--bg); border-left: 1px solid var(--line); z-index: 20; overflow-y: auto; box-shadow: var(--shadow-lg); }
#drawer-body { padding: 26px 26px 50px; }
.d-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.d-head h2 { margin: 0 6px 0 0; font-size: 19px; font-weight: 650; display: flex; align-items: center; }
.d-head .close { margin-left: auto; }
.crumbs { font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.rating-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.rating { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 12px; min-width: 0; }
.rating .k { font-size: 11px; color: var(--muted); } .rating .v { font-size: 16px; font-weight: 650; margin-top: 1px; white-space: nowrap; }
.rating .v .dots { font-size: 10px; }
.block { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; margin: 8px 0; line-height: 1.65; }
.block h4 { margin: 0 0 3px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.settings .block { padding: 14px 16px; margin: 0 0 12px; }
.settings .block > h4 { font-size: 13px; color: var(--text); margin-bottom: 10px; }
.sec-title { font-weight: 650; font-size: 13.5px; margin: 22px 0 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.quote-big { display: flex; align-items: baseline; gap: 10px; margin-top: 10px; }
.quote-big .price { font-size: 26px; font-weight: 650; letter-spacing: -.3px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin-top: 10px; }

/* ---------- 表格 ---------- */
table.cmp { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
table.cmp th { text-align: right; font-weight: 600; font-size: 11.5px; color: var(--muted); padding: 0 10px; height: 34px; border-bottom: 1px solid var(--line); cursor: pointer; white-space: nowrap; user-select: none; position: sticky; top: 0; background: var(--panel2); z-index: 1; }
table.cmp th:hover { color: var(--text); }
table.cmp th:first-child, table.cmp td:first-child { text-align: left; }
table.cmp td { text-align: right; padding: 0 10px; height: 36px; border-bottom: 1px solid var(--line2); white-space: nowrap; }
table.cmp tbody tr:last-child td { border-bottom: none; }
table.cmp tbody tr:hover td { background: var(--hover); }
table.cmp td.best { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
table.cmp td.best .up, table.cmp td.best .down { font-weight: 650; }
table.cmp td.worst { color: var(--faint); }
table.cmp .cname { cursor: pointer; font-weight: 600; } table.cmp .cname:hover { color: var(--accent); }
.verdict { margin-top: 10px; font-size: 12.5px; color: var(--muted); line-height: 1.75; }

/* ---------- 机会雷达 ---------- */
.radar { display: grid; grid-template-columns: 250px 1fr; gap: 18px; align-items: start; }
.watch-list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 6px; }
.watch-list .nav-group { padding: 12px 8px 4px; }
.watch-list .w { padding: 5px 8px; border-radius: 6px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 6px; min-height: 30px; }
.watch-list .w > div { display: flex; align-items: center; gap: 7px; min-width: 0; }
.watch-list .w .ic { color: var(--faint); width: 14px; height: 14px; }
.watch-list .w:hover { background: var(--hover); }
.watch-list .w.active { background: var(--accent-soft); color: var(--accent); }
.watch-list .w small { color: var(--faint); display: block; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.watch-list .w .wname { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.watch-list .w a { font-size: 11.5px; opacity: 0; }
.watch-list .w:hover a { opacity: 1; }
.watch-list .cnt { font-size: 11.5px; font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: 6px; }
.tab { padding: 5px 10px; border-radius: 6px; cursor: pointer; color: var(--muted); }
.tab.active { background: var(--panel2); color: var(--text); font-weight: 600; }
.feed { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 0 16px; }
.news { border-bottom: 1px solid var(--line2); padding: 11px 0; }
.news:last-child { border-bottom: none; }
.news .t { font-weight: 600; line-height: 1.5; cursor: pointer; font-size: 13.5px; }
.news .t:hover { color: var(--accent); }
.news .meta { font-size: 11.5px; color: var(--muted); margin-top: 4px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.news .meta .chip { font-size: 11.5px; line-height: 18px; }
.news .opp { background: var(--up); color: white; border-radius: 4px; padding: 0 5px; font-size: 10.5px; font-weight: 700; vertical-align: 1px; }
.news .new { color: var(--gold); font-size: 10.5px; font-weight: 700; }
.news .ai { white-space: pre-wrap; background: var(--panel2); border-radius: var(--r); padding: 10px 12px; margin-top: 8px; font-size: 12.5px; line-height: 1.65; }
.news .ai .due { color: var(--accent); background: var(--accent-soft); border-radius: 4px; padding: 0 5px; font-size: 11.5px; }
.ev-more { margin: 6px 0 0 2px; padding-left: 10px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 3px; }
.ev-item { font-size: 12.5px; line-height: 1.5; display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.ev-item .t2 { cursor: pointer; }
.ev-item .t2:hover { color: var(--accent); }
.ev-item .faint { font-size: 11.5px; }
.empty { color: var(--muted); padding: 40px 0; text-align: center; }

/* ---------- 弹窗 ---------- */
#modal { position: fixed; inset: 0; background: rgba(10, 14, 22, .42); z-index: 50; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(2px); }
.modal-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; width: 560px; max-width: 92vw; max-height: 88vh; overflow-y: auto; padding: 20px 22px; box-shadow: var(--shadow-lg); }
.modal-card h3 { margin: 0 0 14px; font-size: 15px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 500; }
.field input, .field textarea, .field select { width: 100%; }
.field textarea { min-height: 70px; resize: vertical; }
.field .hint { font-size: 11px; color: var(--faint); margin-top: 3px; }
.checks { display: flex; flex-direction: column; gap: 8px; max-height: 240px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; }
.checks-g { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.checks-g > span { width: 100%; font-size: 11px; color: var(--faint); }
.field .checks label { display: inline-flex; align-items: center; gap: 4px; margin: 0; padding: 2px 8px 2px 5px; border-radius: 6px; background: var(--panel2); font-size: 12px; font-weight: 400; color: var(--text); cursor: pointer; }
.field .checks input { width: auto; margin: 0; }
.stars { display: flex; gap: 4px; }
.stars span { cursor: pointer; font-size: 18px; color: var(--line); } .stars span.on { color: var(--gold); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
.sugg div { padding: 6px 8px; cursor: pointer; border-radius: 6px; font-size: 13px; } .sugg div:hover { background: var(--hover); }
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 8px 16px; border-radius: var(--r); font-size: 12.5px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 60; box-shadow: var(--shadow-lg); }
#toast.show { opacity: 1; }

pre.code { white-space: pre-wrap; word-break: break-all; background: var(--panel2); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; margin: 6px 0 0; font: 11.5px/1.6 ui-monospace, "SF Mono", Menlo, monospace; user-select: text; }
.radar-health { color: var(--muted); font-size: 12px; line-height: 1.7; margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: var(--panel2, rgba(127,127,127,.06)); max-width: 1000px; }
.radar-health b { font-weight: 600; }

/* ---------- 0.13：通用小件 ---------- */
.grow { flex: 1; min-width: 0; }
.hstat { color: var(--muted); font-size: 12px; font-weight: 400; }
.hstat a { margin-left: 8px; }
.dot.orange { background: var(--orange); }
.dot.star { background: none; width: auto; height: auto; border-radius: 0; }
.dot.star::before { content: '★'; color: var(--gold); font-style: normal; font-size: 12px; line-height: 1; }
.due { color: var(--accent); background: var(--accent-soft); border-radius: 4px; padding: 0 6px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.tag.dual { color: var(--accent); background: var(--accent-soft); cursor: help; }
.k2 { font-size: 10.5px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpis.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
td.heat7 a { white-space: nowrap; }
.block.hot { margin: 0 0 4px; }
.radar-help { margin-top: 8px; }
.sec-desc { font-weight: 400; font-size: 12px; }

/* 智能体署名：每个智能体一个固定颜色的胶囊，头像圆点 + 名字 */
.sig { --c: #475569; display: inline-flex; align-items: center; gap: 5px; font-weight: 650; font-size: 12px; color: var(--c); background: color-mix(in srgb, var(--c) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 32%, transparent); border-radius: 999px; padding: 0 9px 0 2px; line-height: 20px; white-space: nowrap; vertical-align: middle; }
.sig i { font-style: normal; width: 16px; height: 16px; border-radius: 50%; background: var(--c); color: #fff; font-size: 10px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.sig.sm { font-size: 11px; line-height: 17px; padding-right: 7px; }
.sig.sm i { width: 13px; height: 13px; font-size: 9px; }
/* 结论 */
.vb { font-weight: 700; font-size: 11.5px; border-radius: 5px; padding: 0 6px; line-height: 20px; color: #fff; white-space: nowrap; display: inline-block; }
.vb.t { background: var(--up); } .vb.d { background: var(--gold); } .vb.n { background: #9aa1ae; } .vb.k { background: var(--accent); }
.split { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--orange); background: color-mix(in srgb, var(--orange) 10%, transparent); border-radius: 5px; padding: 0 6px; line-height: 20px; white-space: nowrap; }
.old { font-size: 11px; color: var(--muted); border: 1px dashed var(--faint); border-radius: 5px; padding: 0 5px; line-height: 17px; white-space: nowrap; cursor: help; }
.pk-mark { font-size: 11px; font-weight: 650; color: var(--gold); background: var(--gold-soft); border-radius: 5px; padding: 0 6px; line-height: 20px; white-space: nowrap; }

/* ---------- 机会雷达：本周精选卡片 ---------- */
.sec-title .lang-pick { margin-left: auto; display: inline-flex; gap: 4px; }
.picks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pick { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; line-height: 1.55; min-width: 0;
  box-shadow: inset 3px 0 0 var(--gold); }
.pk-h { display: flex; align-items: center; gap: 4px; min-width: 0; }
.pk-h b { font-size: 13.5px; }
.pk-n { width: 18px; height: 18px; border-radius: 50%; background: var(--gold); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; margin-right: 2px; flex-shrink: 0; }
.pk-p { margin-left: auto; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.pk-t { font-weight: 600; }
.pk-t[data-link] { cursor: pointer; }
.pk-t[data-link]:hover { color: var(--accent); }
.pk-l { color: var(--text); overflow-wrap: anywhere; }
.pk-l .k { color: var(--muted); font-size: 11px; font-weight: 600; margin-right: 6px; }
.pk-l .k.bad { color: var(--up); }
.pk-ev { font-size: 12px; color: var(--muted); margin-left: 2px; }
.pk-f { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 4px; font-size: 12px; }
.pick-empty { background: var(--panel); border: 1px dashed var(--line); border-radius: var(--r-lg); padding: 14px 16px; color: var(--muted); font-size: 12.5px; line-height: 1.7; }

/* ---------- 机会雷达：一件事两行 ---------- */
.vfeed { padding: 0 14px; }
.vrow { border-bottom: 1px solid var(--line2); padding: 10px 0 9px; }
.vrow:last-child { border-bottom: none; }
.vr1 { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.vt { font-weight: 600; font-size: 13.5px; cursor: pointer; line-height: 1.5; }
.vt:hover { color: var(--accent); }
.vrow .opp { background: var(--up); color: #fff; border-radius: 4px; padding: 0 5px; font-size: 10.5px; font-weight: 700; line-height: 18px; }
.vrow .new { color: #fff; background: var(--gold); border-radius: 4px; padding: 0 4px; font-size: 10.5px; font-weight: 700; line-height: 16px; }
.orig { font-size: 11.5px; color: var(--faint); margin-top: 2px; }
.vr2 { display: flex; gap: 12px; align-items: center; margin-top: 4px; font-size: 12.5px; flex-wrap: wrap; }
.vs { color: var(--text); }
.ben { display: inline-flex; gap: 5px; align-items: center; flex-wrap: wrap; font-size: 12px; }
.ben .chip { font-size: 11.5px; line-height: 18px; }
.vr3 { display: flex; gap: 10px; align-items: center; margin-top: 3px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.vr3 a { font-size: 11.5px; }
a.rej { color: var(--up); }
.vrow.open { background: color-mix(in srgb, var(--accent) 3%, transparent); margin: 0 -14px; padding-left: 14px; padding-right: 14px; }
.vdetail { margin: 8px 0 4px; font-size: 12.5px; line-height: 1.7; background: var(--panel2); border-radius: var(--r); padding: 8px 12px; overflow-wrap: anywhere; }
.vhist { margin-top: 4px; }
.vhist > div { display: flex; gap: 8px; align-items: center; margin-top: 3px; flex-wrap: wrap; }
.vpx { margin-top: 4px; }

/* ---------- 打回窗口 ---------- */
.rej-card { width: 600px; }
.rej-card h3 { display: flex; align-items: center; gap: 8px; }
.rj-item { background: var(--panel2); border-radius: var(--r); padding: 8px 12px; margin-bottom: 14px; font-size: 12.5px; line-height: 1.7; }
.rj-t { font-weight: 600; font-size: 13.5px; }
.field label.radio { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--text); font-weight: 400; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; margin: 6px 0 0; line-height: 1.5; cursor: pointer; }
.field label.radio.on { border-color: var(--accent); background: var(--accent-soft); }
.field label.radio input { width: auto; margin-top: 3px; }
.field label.radio span { flex: 1; }
.rej-card textarea { min-height: 76px; line-height: 1.6; }

/* ---------- 设置：改动记录按智能体、按天折叠；长期规则；提醒 ---------- */
.cg { border: 1px solid var(--line); border-radius: var(--r); margin: 6px 0; }
.cg-h { display: flex; align-items: center; gap: 8px; padding: 7px 10px; cursor: pointer; flex-wrap: wrap; user-select: none; }
.cg-h:hover { background: var(--hover); border-radius: var(--r); }
.cg-h .tri { color: var(--muted); width: 12px; font-size: 13px; }
.cg-h .faint { font-size: 12px; }
.cg.open .cg-h { border-bottom: 1px solid var(--line2); background: var(--panel2); border-radius: var(--r) var(--r) 0 0; }
.cg-b { padding: 4px 12px 8px 30px; }
.cr { padding: 6px 0; border-bottom: 1px dashed var(--line2); }
.cr:last-of-type { border-bottom: 0; }
.cr.undone { opacity: .6; }
.cr-h { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.cr-h .ct { font-weight: 650; font-variant-numeric: tabular-nums; }
.cg-more { display: inline-block; margin-top: 6px; font-size: 12px; }
.rule-row { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-bottom: 1px dashed var(--line2); font-size: 12.5px; }
.rule-row:last-of-type { border-bottom: 0; }
.rule-row .faint { font-size: 11.5px; margin-top: 2px; }
.rule-row > a { flex-shrink: 0; font-size: 12px; }
.notice-row { display: flex; gap: 10px; align-items: flex-start; padding: 7px 6px; margin: 0 -6px; border-radius: 6px; cursor: pointer; font-size: 12.5px; line-height: 1.55; }
.notice-row:hover { background: var(--hover); }
.notice-row + .notice-row { border-top: 1px dashed var(--line2); }
.notice-row .ni { width: 20px; text-align: center; flex-shrink: 0; }
.notice-row .faint { font-size: 11.5px; }

/* ---------- 观察池：表格 + 右侧逻辑卡 ---------- */
.pool2 { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.tbl-wrap { overflow-x: auto; border-radius: var(--r-lg); }
table.pool-t tbody tr { cursor: pointer; }
table.pool-t tr.sel td, table.pool-t tbody tr.sel:hover td { background: var(--accent-soft); }
table.pool-t td.tt { text-align: left; white-space: normal; width: 30%; max-width: 0; }
td .ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st { font-size: 11px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 4px; padding: 0 6px; line-height: 18px; white-space: nowrap; display: inline-block; }
.st.buy { color: var(--down); background: color-mix(in srgb, var(--down) 12%, transparent); }
.tside { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px 14px; font-size: 12.5px; line-height: 1.6; }
.tside .block { margin: 8px 0 0; padding: 8px 12px; background: var(--panel2); border-color: transparent; }
.tside .kpis { margin-top: 8px; gap: 6px; }
.tside .rating { padding: 6px 10px; }
.tside .rating .v { font-size: 14px; }
.tside .tl { margin-top: 3px; line-height: 1.5; }
.tside .tl .t2 { cursor: pointer; }
.tside .tl .t2:hover { color: var(--accent); }
.tc-h { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.tc-h b { font-size: 15px; }
.tc-sub { font-size: 11.5px; margin-top: 2px; }
.tc-f { display: flex; gap: 12px; align-items: center; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line2); font-size: 12px; flex-wrap: wrap; }
h4.bad, .block h4.bad { color: var(--up); }
.rv-line { margin-top: 3px; font-size: 12px; }
.alert-line { display: flex; gap: 4px 10px; align-items: center; flex-wrap: wrap; padding: 3px 0; }
.alert-line > * { white-space: nowrap; }
.pool-pend { margin-top: 8px; padding: 6px 10px; border-radius: 8px; font-size: 12px; color: var(--accent); background: var(--accent-soft); }

@media (max-width: 1240px) {
  .pool2 { grid-template-columns: 1fr; }
  .tside { position: static; max-height: none; }
  .picks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-color-scheme: dark) {
  .sig { color: color-mix(in srgb, var(--c) 55%, #fff); border-color: color-mix(in srgb, var(--c) 55%, transparent); background: color-mix(in srgb, var(--c) 18%, transparent); }
  .vb.n { background: #5f6776; }
  .tside .block { background: var(--bg); }
}
