/* ==========================================================================
   火麒麟价值投资体系 / HuoQilin Value Investing System
   Light theme, card-based, traffic-light semantics.
   ========================================================================== */

:root{
  /* ---------- 版面：极浅蓝灰而非纯白（长时间看不刺眼） ---------- */
  --bg:#F1F5F9;
  --surface:#FFFFFF;
  --surface-2:#F6FAFC;
  --border:#DCE7F0;
  --border-strong:#C2D3E0;

  --text:#0A1929;            /* 深空蓝黑，比纯黑柔和 */
  --text-2:#40566D;
  --text-3:#8497AB;

  /* ---------- 品牌：水瓶座青蓝 ----------
     #00D2D3 是品牌原色，但白底上对比度只有 1.9:1，做正文/按钮看不清。
     压深到 #00727F（4.7:1，过 WCAG AA）承载文字，亮青仍用于图标与图表。 */
  --brand:#00727F;
  --brand-soft:#E4F3F5;
  --brand-dark:#004F59;
  --brand-bright:#00C2C7;

  /* ---------- 语义 ---------- */
  --on-sale:#0B8A6A;
  --on-sale-soft:#E5F6F1;
  --watch:#6B819B;
  --watch-soft:#EEF3F7;
  --overpriced:#C2414C;
  --overpriced-soft:#FCEBEC;
  --warn:#A1621B;
  --warn-soft:#FDF3E3;

  /* ---------- 涨跌（中国惯例：红涨绿跌，不要"改良"） ---------- */
  --up:#C7353F;
  --down:#0E8F6C;
  --flat:#6B819B;

  /* ---------- 形状 ---------- */
  --radius:12px;
  --radius-sm:8px;
  --shadow:0 1px 2px rgba(10,25,41,.05), 0 2px 8px rgba(10,25,41,.05);
  --shadow-lg:0 6px 18px rgba(10,25,41,.07), 0 18px 44px rgba(10,25,41,.08);

  /* ---------- 字体：全部 SIL OFL 1.1，开源可商用 ----------
     Inter（拉丁/数字，tabular-nums 对齐表格）/ Noto Sans SC（中文）/
     Montserrat（品牌标题）/ JetBrains Mono（等宽）。 */
  --font-sans:"Inter","Noto Sans SC",-apple-system,BlinkMacSystemFont,"Segoe UI",
              "PingFang SC","Microsoft YaHei",sans-serif;
  --font-display:"Montserrat","Noto Sans SC","PingFang SC",sans-serif;
  --font-mono:"JetBrains Mono","SFMono-Regular",Consolas,"Liberation Mono",Menlo,monospace;

  /* ---------- 侧栏（深色，品牌锚点） ---------- */
  --nav-bg:#071626;
  --nav-bg-2:#0C2135;
  --nav-text:#B7C9D9;
  --nav-text-dim:#728CA6;
  --nav-active:#5FE3E7;

  /* ---------- 补齐：曾经被引用但未定义（浏览器静默回退） ---------- */
  --text-1:#0A1929;            /* 与 --text 同值：问候语/强调文字 */
  --muted:#8497AB;             /* SVG 里的弱化文字 */
  --shadow-md:0 2px 6px rgba(10,25,41,.08);
}

*{box-sizing:border-box}
html,body{margin:0;padding:0;height:100%}
body{
  font-family:var(--font-sans);
  font-variant-numeric:tabular-nums;
  background:var(--bg); color:var(--text); font-size:14px; line-height:1.55;
  -webkit-font-smoothing:antialiased;
}
.hidden{display:none !important}
a{color:inherit;text-decoration:none}
.muted{color:var(--text-3)}
.small{font-size:12px}
.mono{font-family:var(--font-mono)}
.right{text-align:right}
.center{text-align:center}
.nowrap{white-space:nowrap}

/* ------------------------------- buttons ------------------------------- */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  border:1px solid var(--border-strong); background:var(--surface); color:var(--text);
  padding:8px 14px; border-radius:var(--radius-sm); font-size:13px; font-weight:500;
  cursor:pointer; transition:background .15s,border-color .15s,transform .05s;
  font-family:inherit; white-space:nowrap;
}
.btn:hover{background:var(--surface-2);border-color:var(--text-3)}
.btn:active{transform:translateY(1px)}
.btn-primary{background:var(--brand);border-color:var(--brand);color:#fff}
.btn-primary:hover{background:var(--brand-dark);border-color:var(--brand-dark)}
.btn-ghost{background:transparent;border-color:var(--border)}
.btn-ghost:hover{background:var(--surface-2)}
.btn-sm{padding:5px 10px;font-size:12px}
.btn-block{width:100%}
.btn[disabled]{opacity:.55;cursor:not-allowed}

/* -------------------------------- login -------------------------------- */
.login-wrap{
  min-height:100vh;display:flex;align-items:center;justify-content:center;
  background:
    radial-gradient(1100px 560px at 8% -12%, rgba(0,194,199,.13) 0%, transparent 62%),
    radial-gradient(900px 520px at 108% 108%, rgba(0,114,127,.10) 0%, transparent 58%),
    radial-gradient(700px 420px at 78% 4%, rgba(95,227,231,.09) 0%, transparent 60%),
    var(--bg);
  padding:32px 16px;
}
.login-card{
  position:relative;width:100%;max-width:430px;background:var(--surface);
  border:1px solid var(--border);border-radius:18px;box-shadow:var(--shadow-lg);padding:34px 32px 30px;
  overflow:hidden;
}
/* 顶部一条青蓝渐变细线：品牌锚点，比整块底色更耐看 */
.login-card::before{
  content:"";position:absolute;left:0;right:0;top:0;height:3px;
  background:linear-gradient(90deg,var(--brand-dark) 0%,var(--brand-bright) 45%,var(--brand) 100%);
}
.login-brand{text-align:center;margin-bottom:22px}
.login-brand h1{font-family:var(--font-display);font-size:24px;font-weight:700;margin:2px 0 6px;letter-spacing:.08em;color:var(--text)}
.login-brand p{margin:0;font-size:12.5px}
.brand-mark{font-size:34px;line-height:1}
.brand-mark.small{font-size:20px}
#login-form label{display:block;margin-bottom:14px}
#login-form label span{display:block;font-size:12.5px;color:var(--text-2);margin-bottom:6px;font-weight:500}
#login-form input{
  width:100%;padding:10px 12px;border:1px solid var(--border-strong);border-radius:var(--radius-sm);
  font-size:14px;font-family:inherit;background:var(--surface);color:var(--text);
}
#login-form input:focus{outline:2px solid var(--brand);outline-offset:-1px;border-color:var(--brand)}
/* ---- 密码框 + 显示/隐藏按钮（2026-10-24）----
   为什么加这个按钮：登录框曾经**预填**着旧默认口令（value="huoqilin"），
   用户打开页面就看到 7 个圆点，很容易没注意自己没改就点登录。
   能切换显示 ⇒ 一眼看出「到底输了几位」，不用猜。 */
.pass-wrap{position:relative;display:block}
.pass-wrap input{padding-right:60px}
.pass-toggle{
  position:absolute;right:6px;top:6px;height:calc(100% - 12px);
  padding:0 10px;border:1px solid var(--border-strong);border-radius:var(--radius-sm);
  background:var(--surface-2);color:var(--text-2);font-size:12px;font-family:inherit;
  cursor:pointer;
}
.pass-toggle:hover{color:var(--brand);border-color:var(--brand)}
.form-error{color:var(--overpriced);font-size:12.5px;margin:10px 0 0}
.login-hint{margin-top:18px;padding-top:16px;border-top:1px solid var(--border)}
.login-hint p{margin:0;font-size:12px;color:var(--text-3);line-height:1.6}
.login-public{display:flex;gap:8px;margin-top:14px}
.login-public .btn{flex:1;font-size:12px}

/* --------------------------------- app --------------------------------- */
.app{display:flex;min-height:100vh}

.sidebar{
  width:228px;flex:0 0 228px;
  background:linear-gradient(180deg,var(--nav-bg) 0%,var(--nav-bg-2) 100%);
  border-right:1px solid rgba(255,255,255,.06);
  color:var(--nav-text);
  display:flex;flex-direction:column;position:sticky;top:0;height:100vh;overflow-y:auto;
}
.sidebar-head{display:flex;align-items:center;gap:10px;padding:16px 16px 14px;border-bottom:1px solid rgba(255,255,255,.07)}
.sidebar-title{display:flex;flex-direction:column;line-height:1.2}
.sidebar-title strong{font-size:14.5px;color:#EAF3FA;font-family:var(--font-display);font-weight:700;letter-spacing:.04em}
.sidebar-title span{font-size:10px;letter-spacing:.16em;text-transform:uppercase;color:var(--nav-text-dim)}
.sidebar-nav{padding:10px 8px;flex:1}
.nav-group{
  font-size:10px;text-transform:uppercase;letter-spacing:.14em;color:var(--nav-text-dim);
  padding:14px 12px 6px;font-weight:600;
}
.nav-item{
  display:flex;align-items:center;gap:9px;padding:7px 10px;border-radius:var(--radius-sm);
  color:var(--nav-text);font-size:13px;font-weight:500;margin-bottom:2px;
  transition:background .14s ease,color .14s ease;
}
.nav-item .ico{width:16px;text-align:center;font-size:13px;opacity:.75}
.nav-item:hover{background:rgba(255,255,255,.07);color:#FFFFFF}
.nav-item.active{background:linear-gradient(90deg,rgba(0,194,199,.18),rgba(0,194,199,.06));color:var(--nav-active);font-weight:600;box-shadow:inset 2px 0 0 var(--brand-bright)}
.nav-item.active .ico{opacity:1}
.sidebar-foot{padding:12px;border-top:1px solid rgba(255,255,255,.07)}
.member-badge{
  display:flex;align-items:center;gap:7px;font-size:12px;font-weight:600;
  background:var(--on-sale-soft);color:var(--on-sale);padding:6px 9px;border-radius:20px;
  margin-bottom:9px;
}
.member-badge .dot{width:6px;height:6px;border-radius:50%;background:var(--on-sale)}
.member-badge .muted{font-weight:400}
.version{font-size:10.5px;color:var(--text-3);margin-top:8px;text-align:center}
#logout-btn{width:100%}

.main{flex:1;min-width:0;display:flex;flex-direction:column}
.topbar{
  display:flex;align-items:center;gap:12px;padding:11px 22px;background:var(--surface);
  border-bottom:1px solid var(--border);position:sticky;top:0;z-index:30;
}
.search-wrap{position:relative;flex:1;max-width:520px}
.search-ico{position:absolute;left:11px;top:50%;transform:translateY(-50%);color:var(--text-3);font-size:14px}
#global-search{
  width:100%;padding:9px 12px 9px 32px;border:1px solid var(--border-strong);border-radius:8px;
  font-size:13.5px;font-family:inherit;background:var(--surface-2);color:var(--text);
}
#global-search:focus{outline:2px solid var(--brand);outline-offset:-1px;background:var(--surface);border-color:var(--brand)}
.search-results{
  position:absolute;top:calc(100% + 6px);left:0;right:0;background:var(--surface);
  border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-lg);
  max-height:380px;overflow-y:auto;z-index:50;
}
.sr-item{display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding:9px 12px;cursor:pointer;border-bottom:1px solid var(--border)}
.sr-item:last-child{border-bottom:none}
.sr-item:hover,.sr-item.active{background:var(--surface-2)}
.sr-item .sym{font-family:var(--font-mono);font-weight:600;font-size:12.5px;min-width:82px}
.sr-item .nm{flex:1;font-size:12.5px;color:var(--text-2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fx-probe{margin-top:14px;padding-top:12px;border-top:1px dashed var(--border)}
.fx-probe-title{font-size:12px;color:var(--text-2);margin-bottom:8px}
.fx-probe .row{flex-wrap:wrap}
#fx-probe-out{margin-top:8px;line-height:1.7}
.stock-cache-bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;
  padding:7px 12px;margin-bottom:10px;border:1px solid var(--border);border-radius:9px;
  background:var(--surface-2)}
.stock-cache-bar.stale{border-color:var(--overpriced);color:var(--overpriced)}
.stock-cache-bar .btn{margin-left:auto}
.sr-empty{padding:14px;color:var(--text-3);font-size:12.5px;text-align:center}
.sr-hist-head{display:flex;align-items:center;justify-content:space-between;
  padding:7px 12px;border-bottom:1px solid var(--border);font-size:11.5px;color:var(--text-3)}
.sr-hist-clear{background:none;border:none;padding:0;font-size:11.5px;color:var(--text-3);cursor:pointer}
.sr-hist-clear:hover{color:var(--brand);text-decoration:underline}
.sr-hist-item .nm{flex:1}

/* Which feed matched this candidate.  Provenance, not the feed the page will
   use -- that is what the button next to it offers. */
.sr-via{font-size:11px;color:var(--text-3);font-family:var(--font-mono);white-space:nowrap}
/* The picker.  It sits inside the row, so it must swallow its own clicks. */
.sr-src-btn{
  display:inline-flex;align-items:center;gap:3px;font-family:inherit;font-size:11px;
  color:var(--text-2);background:var(--surface-2);border:1px solid var(--border-strong);
  border-radius:20px;padding:3px 8px;cursor:pointer;white-space:nowrap;
}
.sr-src-btn:hover{border-color:var(--brand);color:var(--brand)}
.sr-src-btn .caret{font-size:9px;color:var(--text-3)}
.sr-menu{
  flex:0 0 100%;margin:8px 0 2px;padding:6px;background:var(--surface-2);
  border:1px solid var(--border);border-radius:var(--radius-sm);
}
.sr-menu.hidden{display:none}
.sr-menu-head{font-size:10.5px;color:var(--text-3);padding:2px 6px 6px}
.sr-opt{
  display:flex;align-items:center;gap:8px;padding:5px 6px;border-radius:var(--radius-sm);
  font-size:12px;cursor:pointer;
}
.sr-opt:hover{background:var(--brand-soft)}
.sr-opt.active{background:var(--brand-soft);color:var(--brand);font-weight:600}
/* Unavailable is a state, not a removal: hiding these lines would make the
   list disagree with the app's own source catalogue. */
.sr-opt.off{color:var(--text-3);cursor:default}
.sr-opt.off:hover{background:transparent}
.sr-opt .o-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sr-opt .o-role{font-size:10.5px;color:var(--text-3);border:1px solid var(--border);
  border-radius:10px;padding:0 6px;white-space:nowrap}
/* 「默认」＝ 不选源时引擎会用的那一行。它必须比「角色」更显眼：角色说的是
   这条线是什么，默认说的是**这一页的数会来自哪里** —— 开了「离线优先」时
   两者指向不同的源（本机离线 vs 主用），用户得能一眼看出用的是哪个。 */
.sr-opt .o-default{font-size:10.5px;color:var(--bg);background:var(--text-2);
  border-radius:10px;padding:0 6px;white-space:nowrap}
.sr-opt .o-note{font-size:10.5px;color:var(--text-3);white-space:nowrap}
/* A connected account of the user's own.  The green dot is the whole point:
   "this feed is on" and "this is *your* account, already signed in" are
   different claims, and a plain label row cannot tell them apart. */
.sr-opt .o-own{color:var(--on-sale);font-size:10px;line-height:1}
.sr-opt.own-on .o-name{font-weight:600}
.sr-opt.own-on .o-note{color:var(--on-sale)}

/* --------------------------------- modal -------------------------------- */
/* Used for the "you just connected an account" prompt.  Fixed rather than
   absolute so it covers the viewport whatever the page has scrolled to, and
   above the toast (200) so an error inside the modal is never hidden by a
   toast that fired first. */
.modal-overlay{
  position:fixed;inset:0;background:rgba(15,23,42,.42);z-index:260;
  display:flex;align-items:center;justify-content:center;padding:24px;
}
.modal{
  background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);
  box-shadow:var(--shadow-lg);padding:22px 24px;max-width:460px;width:100%;
  max-height:88vh;overflow:auto;
}
.modal h3{margin:0 0 10px;font-size:15px}
.modal p{margin:0 0 4px;line-height:1.7}
.modal-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:18px;flex-wrap:wrap}
.btn-sm{padding:4px 10px;font-size:11.5px}

.topbar-right{display:flex;align-items:center;gap:10px;margin-left:auto}
.fx-chip{
  font-size:11.5px;color:var(--text-2);background:var(--surface-2);border:1px solid var(--border);
  padding:5px 9px;border-radius:20px;font-family:var(--font-mono);white-space:nowrap;
}
.select-sm{
  padding:6px 8px;border:1px solid var(--border-strong);border-radius:var(--radius-sm);
  font-size:12.5px;font-family:inherit;background:var(--surface);color:var(--text);cursor:pointer;
}
.lang-toggle{display:flex;border:1px solid var(--border-strong);border-radius:var(--radius-sm);overflow:hidden}
.fx-wrap{display:flex;align-items:center;gap:6px}
#fx-source{max-width:200px}
.fx-strip{
  position:fixed;left:0;right:0;bottom:0;z-index:39;
  display:flex;align-items:center;gap:10px;flex-wrap:wrap;
  padding:5px 12px;background:var(--surface);border-top:1px solid var(--border);
  font-size:11px;color:var(--text-2);box-shadow:0 -2px 8px rgba(0,0,0,.06);
}
.fx-strip-title{font-weight:600;color:var(--text-3);text-transform:uppercase;letter-spacing:.5px;font-size:10px;margin-right:2px}
.fx-pill{display:inline-flex;align-items:center;gap:5px;padding:2px 8px;border:1px solid var(--border);border-radius:14px;white-space:nowrap}
.fx-pill .dot{width:7px;height:7px;border-radius:50%;background:var(--text-3);display:inline-block}
.fx-pill.ok .dot{background:var(--on-sale)}
.fx-pill.nok .dot{background:var(--text-3)}
.fx-pill.err .dot{background:var(--overpriced)}
.fx-pill b{font-family:var(--font-mono);color:var(--text)}
.fx-pill em{font-style:normal;color:var(--text-3);font-size:10px}
.fx-stale{color:var(--warn);font-weight:600}
.lang-toggle button{
  border:none;background:var(--surface);color:var(--text-2);padding:6px 11px;font-size:12px;
  cursor:pointer;font-family:inherit;font-weight:500;
}
.lang-toggle button.active{background:var(--brand);color:#fff}

/* 底部有两条 fixed 栏：.fx-strip（34px，bottom 0）+ .status-dock（34px，bottom 44px），
   合计占掉屏幕底部 78px。原来这里只留 22px ⇒ 任何页面滚到底，最后一行都被压住
   （实测：同步/下载卡的日志框滚到底，最后 3 行看不见 —— 而「自动滚到底」正是
   要读最后几行）。下边距按 22 + 78 给足。 */
.view{padding:22px;padding-bottom:100px;flex:1;max-width:1560px;width:100%}

/* --------------------------------- bits -------------------------------- */
.page-head{display:flex;align-items:flex-start;gap:14px;margin-bottom:18px;flex-wrap:wrap}
.page-head h2{margin:0 0 3px;font-size:20px;letter-spacing:.1px}
.page-head p{margin:0;color:var(--text-2);font-size:13px}
.page-head .spacer{flex:1}

/* -------------------- personalised dashboard widgets -------------------- */
.dash-greeting{margin-top:4px !important;font-size:13.5px;color:var(--text-1);font-weight:600}
.dash-tools{display:flex;gap:8px;flex-wrap:wrap}
.dash-add-menu{
  position:absolute;z-index:40;background:var(--surface);border:1px solid var(--border);
  border-radius:var(--radius);box-shadow:var(--shadow);padding:8px;min-width:190px;
}
.dash-add-menu.hidden{display:none}
.dash-add-item{display:flex;align-items:center;gap:8px;padding:6px 8px;border-radius:8px;font-size:13px;cursor:pointer}
.dash-add-item:hover{background:var(--surface-2)}
.dash-widgets{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-bottom:16px}
@media(max-width:1100px){.dash-widgets{grid-template-columns:1fr}}
.dash-widget{margin-bottom:0}
.dash-widget .card-head{flex-wrap:wrap;row-gap:8px}
.dash-move{display:inline-flex;gap:4px}
.dash-periods{display:inline-flex;gap:4px;flex-wrap:wrap}
.chip-btn{
  border:1px solid var(--border);background:var(--surface);color:var(--text-2);
  border-radius:16px;padding:2px 10px;font-size:11.5px;cursor:pointer;line-height:1.6;
}
.chip-btn:hover{border-color:var(--brand);color:var(--text-1)}
.chip-btn.active{background:var(--brand);border-color:var(--brand);color:#fff}
.dash-spark{width:100%;height:90px;display:block;margin:6px 0 10px}
.dash-index-change{font-size:13px;font-weight:700;margin-top:2px}
.dash-index-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.dash-index-stats .metric{padding:10px}
.dash-index-stats .metric .value{font-size:17px}
.dash-pf{border-top:1px solid var(--border);padding-top:10px;margin-top:10px}
.dash-pf:first-child{border-top:0;padding-top:0;margin-top:0}
.dash-pf-name{font-weight:700;font-size:13.5px;margin-bottom:6px}
.dash-pf-row{display:grid;grid-template-columns:auto 1fr auto auto;gap:10px;align-items:baseline;font-size:13px;padding:3px 0}
.dash-pf-market{color:var(--text-2)}
.dash-pf-value{font-weight:700;font-variant-numeric:tabular-nums}
.dash-pf-gain{font-variant-numeric:tabular-nums}
.dash-pf-count{color:var(--text-3);font-size:11.5px}
.dash-pf-top{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.dash-pf-chip{font-size:11.5px;border:1px solid var(--border);border-radius:14px;padding:1px 8px;font-variant-numeric:tabular-nums}

.card{
  background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);
  box-shadow:var(--shadow);padding:16px;margin-bottom:16px;
}
.card.pad-0{padding:0;overflow:hidden}
.card-head{
  display:flex;align-items:center;gap:10px;margin-bottom:12px;
}
.card-head h3{margin:0;font-size:14.5px;letter-spacing:.1px}
.card-head .spacer{flex:1}
.card-head .hint{font-size:11.5px;color:var(--text-3)}

.grid{display:grid;gap:16px}
.grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.grid-4{grid-template-columns:repeat(4,minmax(0,1fr))}
@media(max-width:1280px){.grid-4{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:980px){.grid-2,.grid-3{grid-template-columns:1fr}}

.metric{
  background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);
  padding:14px;box-shadow:var(--shadow);
}
.metric .label{font-size:11.5px;color:var(--text-3);text-transform:uppercase;letter-spacing:.5px;font-weight:600}
.metric .value{font-size:24px;font-weight:700;margin:5px 0 1px;font-variant-numeric:tabular-nums;letter-spacing:-.4px}
.metric .sub{font-size:11.5px;color:var(--text-3)}

/* ------------------------------ badges --------------------------------- */
.badge{
  display:inline-flex;align-items:center;gap:5px;padding:3px 9px;border-radius:20px;
  font-size:11.5px;font-weight:600;white-space:nowrap;line-height:1.6;
}
.badge .dot{width:6px;height:6px;border-radius:50%;background:currentColor}
.badge-on_sale{background:var(--on-sale-soft);color:var(--on-sale)}
.badge-watch{background:var(--watch-soft);color:var(--watch)}
.badge-overpriced{background:var(--overpriced-soft);color:var(--overpriced)}
.badge-neutral{background:var(--surface-2);color:var(--text-2)}
.badge-warn{background:var(--warn-soft);color:var(--warn)}
.badge-market{background:var(--surface-2);color:var(--text-2);font-family:var(--font-mono);font-size:10.5px}
/* 跨源核对的判定标签。**只读核对**，不参与取值；复用既有语义色变量，
   不新造颜色。agree/warn/bad/info 四种，故意与「一致/口径差/分歧/不可比」一一对应。 */
.badge-ok{background:var(--on-sale-soft);color:var(--on-sale)}
.badge-info{background:var(--surface-2);color:var(--text-2)}
.badge-bad{background:var(--overpriced-soft);color:var(--overpriced)}

.up{color:var(--up)}
.down{color:var(--down)}
.flat{color:var(--flat)}

/* --------------------------- penny-stock alert ------------------------- */
.penny-alert{
  border:2px solid var(--overpriced);border-radius:var(--radius);background:#fff;
  padding:14px 16px;margin-bottom:16px;box-shadow:var(--shadow);
  border-left-width:6px;
}
.penny-alert.warning{border-color:var(--warn)}
.penny-alert-head{display:flex;align-items:center;gap:10px;margin-bottom:8px}
.penny-alert-head .tag{
  background:var(--overpriced);color:#fff;font-size:11px;font-weight:700;
  padding:3px 9px;border-radius:4px;letter-spacing:.4px;
}
.penny-alert.warning .penny-alert-head .tag{background:var(--warn)}
.penny-alert-head strong{font-size:15px;color:var(--overpriced)}
.penny-alert.warning .penny-alert-head strong{color:var(--warn)}
.penny-alert p{margin:0 0 8px;font-size:12.5px;color:var(--text-2);line-height:1.65}
.penny-alert ul{margin:0;padding-left:18px;font-size:12.5px;color:var(--text-2);line-height:1.7}
.penny-alert li{margin-bottom:3px}

/* ---- thin-history (IPO) notice -------------------------------------- */
/* Amber rather than red: the page below is real and open, the price is real.
   Red would say "something is wrong"; what is actually true is "the history
   is too short to score" -- which is a fact about the data, not an alarm. */
.ipo-alert{
  border:2px solid var(--warn);border-radius:var(--radius);background:#fff;
  padding:14px 16px;margin-bottom:16px;box-shadow:var(--shadow);
  border-left-width:6px;
}
.ipo-alert .penny-alert-head .tag{background:var(--warn)}
.ipo-alert .penny-alert-head strong{font-size:15px;color:var(--warn)}
.ipo-alert p{margin:0 0 8px;font-size:12.5px;color:var(--text-2);line-height:1.65}

/* ---- crypto refusal: the whole page is a notice --------------------- */
.refuse-card{border-top:4px solid var(--overpriced)}
.refuse-head{
  font-size:13px;margin:14px 0 4px;color:var(--text);
  text-transform:none;letter-spacing:.2px;
}
.refuse-card p{font-size:13px;color:var(--text-2);line-height:1.7;margin:0 0 6px}

/* The link into the article.  Underlined and brand-coloured so it reads as a
   way out of the page rather than as more body text. */
.learn-more{
  display:inline-block;color:var(--brand);font-size:12.5px;font-weight:600;
  text-decoration:none;border-bottom:1px solid currentColor;padding-bottom:1px;
}
.learn-more:hover{opacity:.75}

/* A refused search hit still occupies a row so the result is visible, but it
   is not clickable into a page: the cursor and hover say so. */
.sr-item.sr-refused{cursor:default;background:var(--surface-2)}
.sr-item.sr-refused:hover{background:var(--surface-2)}
.sr-item.sr-refused .nm{color:var(--overpriced);font-weight:600}

/* ---- article -> page cross-links ------------------------------------ */
/* "Where do I see one of these?"  The card is visually a footnote to the
   article, not a call to action: the reader just finished reading, and the
   point is to let the next step be obvious without being sold. */
.next-card{margin-top:14px;border-left:3px solid var(--brand)}
.next-card .card-head{margin-bottom:8px}
.next-card h3{font-size:13.5px;color:var(--text-2);font-weight:600}

.next-article{margin-top:14px;padding-top:12px;border-top:1px solid var(--border)}
.next-article .learn-more{font-size:12.5px}

/* ------------------------------- tables -------------------------------- */
.table-wrap{overflow-x:auto;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface)}
table.data{width:100%;border-collapse:collapse;font-size:12.5px}
table.data th{
  text-align:left;padding:9px 12px;background:var(--surface-2);border-bottom:1px solid var(--border);
  font-size:11px;text-transform:uppercase;letter-spacing:.4px;color:var(--text-3);font-weight:600;
  white-space:nowrap;position:sticky;top:0;
}
table.data td{padding:9px 12px;border-bottom:1px solid var(--border);vertical-align:middle}
table.data tr:last-child td{border-bottom:none}
table.data tbody tr:hover{background:var(--surface-2)}
table.data .num{text-align:right;font-variant-numeric:tabular-nums;font-family:var(--font-mono)}
table.data .sym{font-family:var(--font-mono);font-weight:600;cursor:pointer}
table.data .sym:hover{color:var(--brand);text-decoration:underline}
table.data td.sticky{position:sticky;left:0;background:var(--surface);z-index:1}

/* -------------------------------- tabs --------------------------------- */
.tabs{display:flex;gap:2px;border-bottom:1px solid var(--border);margin-bottom:18px;overflow-x:auto}
.tab{
  padding:9px 15px;border:none;background:none;cursor:pointer;font-size:13px;font-weight:500;
  color:var(--text-2);border-bottom:2px solid transparent;font-family:inherit;white-space:nowrap;
}
.tab:hover{color:var(--text)}
.tab.active{color:var(--brand);border-bottom-color:var(--brand);font-weight:600}

/* ------------------------------ stock head ----------------------------- */
.stock-head{
  display:flex;align-items:flex-start;gap:18px;flex-wrap:wrap;margin-bottom:14px;
}
.stock-title h2{margin:0;font-size:22px;display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.stock-title .code{font-family:var(--font-mono);color:var(--text-2);font-size:14px;font-weight:600}
.stock-meta{display:flex;gap:8px;flex-wrap:wrap;margin-top:7px;align-items:center}
.stock-price{margin-left:auto;text-align:right}
.stock-price .p{font-size:30px;font-weight:700;font-variant-numeric:tabular-nums;letter-spacing:-.8px;line-height:1.1}
.stock-price .c{font-size:13.5px;font-weight:600;font-variant-numeric:tabular-nums}
.stock-price .cur{font-size:11px;color:var(--text-3);margin-top:3px}

.score-ring{display:flex;flex-direction:column;align-items:center;gap:3px}
.score-ring .n{font-size:22px;font-weight:700;font-variant-numeric:tabular-nums}
.score-ring .l{font-size:10.5px;color:var(--text-3);text-transform:uppercase;letter-spacing:.5px}

/* ------------------------- breakdown / progress ------------------------ */
.bd-row{display:flex;align-items:center;gap:10px;padding:6px 0;font-size:12.5px;border-bottom:1px solid var(--border)}
.bd-row:last-child{border-bottom:none}
.bd-row .k{flex:1;color:var(--text-2)}
.bd-row .v{font-family:var(--font-mono);font-size:12px;color:var(--text-2);min-width:92px;text-align:right}
.bd-row .pts{font-family:var(--font-mono);font-weight:600;min-width:56px;text-align:right}

/* ------------------------- 预测图（Projections） -------------------------
   配色不写死在这里是故意的：模型色必须与 app.js 里 PROJ_COLORS 一一对应，
   两处各写一套的话，改色时只改得动一半，图例就会和曲线对不上。
   所以色值由 JS 以内联 style 传进来，这里只管几何与排版。 */
.proj-sub{margin:-2px 0 12px}
.proj-block{margin:0 0 18px}
.proj-block-title{
  font-size:12px;font-weight:600;color:var(--text-3);
  text-transform:uppercase;letter-spacing:.04em;margin:0 0 6px;
}
.proj-svg{width:100%;height:auto;display:block}
.proj-grid{stroke:var(--border);stroke-width:1}
.proj-axis{fill:var(--text-3);font-size:10px;font-family:var(--font-mono)}
.proj-axis-y{text-anchor:end}
.proj-bar-val{fill:var(--text-2);font-size:10px;font-family:var(--font-mono)}
.proj-legend{
  display:flex;flex-wrap:wrap;gap:6px 16px;
  margin-top:8px;font-size:12px;color:var(--text-2);
}
.proj-legend-item{display:inline-flex;align-items:center;gap:6px}
.proj-swatch{
  width:14px;height:0;flex:0 0 14px;
  border-top:3px solid;                 /* 颜色由 JS 内联给出 */
  border-radius:2px;
}
/* 虚线用 border-style，不叠背景遮罩 —— 内联 style 已经把颜色给了
   border-color，而 background 会与之争夺同一块区域。 */
.proj-swatch.is-dashed{
  border-top-style:dashed;
  border-top-width:3px;
}
.proj-axis-x{text-anchor:middle}
/* 首尾两个刻度贴边，居中会把文字顶出画布 —— 改成靠边对齐。 */
.proj-axis-x:first-of-type{text-anchor:start}
.proj-axis-x:last-of-type{text-anchor:end}
.proj-foot{
  margin-top:4px;padding-top:10px;
  border-top:1px solid var(--border);line-height:1.6;
}
@media (max-width:640px){
  .proj-legend{gap:4px 10px;font-size:11px}
}

/* ------------------------- 北斗七星：合格/不合格整行着色 -------------------------
   颜色沿用主题变量（--on-sale 绿 / --overpriced 红），所以切主题时
   七项配色跟着变，不需要在这里再写一套。
   用 .seven-row 前缀而不是改 .bd-row：后者是全局共用类，
   breakdown / 其它模块也在用，改它会连带变色。 */
.seven-row{
  margin:0 -8px;
  padding:7px 8px;
  border-radius:var(--radius-sm);
  border-bottom-color:transparent;
  border-left:3px solid transparent;
}
.seven-row .k{font-weight:600}
.seven-row .pts{
  padding:1px 7px;border-radius:999px;font-size:11px;
  background:var(--surface);border:1px solid var(--border);
}
.seven-row .seven-mark{
  width:18px;text-align:center;font-weight:700;flex:0 0 18px;
}
/* 合格 —— 绿底 */
.seven-row-yes{
  background:var(--on-sale-soft);
  border-left-color:var(--on-sale);
}
.seven-row-yes .k,.seven-row-yes .seven-mark{color:var(--on-sale)}
.seven-row-yes .v{color:var(--on-sale)}
/* 不合格 —— 红底 */
.seven-row-no{
  background:var(--overpriced-soft);
  border-left-color:var(--overpriced);
}
.seven-row-no .k,.seven-row-no .seven-mark{color:var(--overpriced)}
.seven-row-no .v{color:var(--overpriced)}
/* 无法判定 —— 灰底，不参与红绿视觉噪音 */
.seven-row-na{
  background:var(--surface-2);
  border-left-color:var(--border-strong);
}
.seven-row-na .k,.seven-row-na .seven-mark,.seven-row-na .v{color:var(--text-3)}
.seven-row-na .pts{color:var(--text-3)}
/* 七项之间的行距：加了背景色后，原border-bottom 会割断色块 */
.seven-row + .seven-row{margin-top:2px}
/* EPS 行下面的说明也要跟着缩进，且不吃底色 */
.note-row-seven{
  margin:-2px 0 2px 27px;padding:2px 0 4px;
  border-left:2px solid var(--border);
  padding-left:8px;
}

.bar{height:5px;border-radius:3px;background:var(--border);overflow:hidden;min-width:70px;flex:1;max-width:150px}
.bar>span{display:block;height:100%;border-radius:3px;background:var(--on-sale)}
.bar.low>span{background:var(--overpriced)}
.bar.mid>span{background:var(--warn)}
/* A component that could not be measured gets an empty track and a dashed
   outline.  A filled red bar at zero width would read as "scored badly", which
   is the one thing the payload is careful not to say. */
.bar.na{background:transparent;box-shadow:inset 0 0 0 1px var(--border)}
.bar.na>span{display:none}
.bd-unavailable .k{color:var(--text-3)}

/* ---- 离线批量：进度条与滚动日志框 ----------------------------------
   刻意不复用上面的 .bar：那一套的颜色语义是估值（绿=低估、红=高估），
   拿来画下载进度会被读成「这只票很便宜」。这里用品牌红做中性进度，
   满格不再变色——100% 不是「好」也不是「坏」，只是做完了。 */
.pbar{height:8px;border-radius:4px;background:var(--border);overflow:hidden}
.pbar>span{display:block;height:100%;border-radius:4px;background:var(--brand);transition:width .25s}
/* 宽度只由 paintBulk 写，HTML 里放的是哨兵 99%。哨兵的作用是让断言能
   区分「JS 写了宽度」与「JS 从没写」——任何真实值都不同于它。若换成 0%，
   「写成 0%」和「没写」在计算样式上完全一样，那条断言就永远抓不到它要
   守的缺陷。这里刻意不给任何默认宽度来「兜住」它。 */
.pbar-wrap{display:flex;align-items:center;gap:10px}
.pbar-wrap .pbar{flex:1}
.pbar-pct{font-family:var(--font-mono);font-size:13px;font-weight:600;min-width:56px;text-align:right}
/* 列表还在数（total 未知）时不能画 0% 的空条——那看着像「卡住了」，
   和「刚开始」长得一模一样。 */
.pbar.counting>span{width:100%!important;opacity:.35}

/* 上下滚动框。固定高度 + overflow-y:auto：新日志追加在底部时用
   scrollTop 跟到底，但只在用户本来就在底部时才跟——往上翻看历史时
   被强行拽回底部，日志框就变成了没法用的框。 */
.offlog{
  height:230px;overflow-y:auto;margin-top:8px;padding:8px 10px;
  border:1px solid var(--border);border-radius:6px;
  background:var(--surface-2);font-family:var(--font-mono);font-size:11.5px;
  line-height:1.65;color:var(--text-2);
}
.offlog>div{padding:1px 0;word-break:break-all}
.offlog .lv-err{color:var(--overpriced)}
.offlog .lv-warn{color:var(--warn)}
.offlog .lv-ok{color:var(--on-sale)}
.offlog .lv-ts{color:var(--text-3);margin-right:6px}
.off-bulk-empty{color:var(--text-3);font-size:12px;padding:6px 2px}
/* The published Score lists its checks inline instead of as a separate step
   column, so they need somewhere to wrap. */
.score-checks{display:inline-flex;flex-wrap:wrap;gap:4px 10px;flex:2;min-width:0}
.bd-note{padding:0 0 6px 0;line-height:1.5}

.legend{display:flex;gap:14px;flex-wrap:wrap;font-size:11.5px;color:var(--text-3);margin-bottom:14px}
.legend span{display:inline-flex;align-items:center;gap:5px}
.legend .sw{width:9px;height:9px;border-radius:2px;display:inline-block}

/* ------------------------------- charts -------------------------------- */
.chart-box{width:100%;height:190px;display:block}
.bars{display:flex;align-items:flex-end;gap:6px;height:150px;padding:8px 0}
.bars .col{flex:1;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:4px;min-width:0}
.bars .col .bar2{width:100%;max-width:46px;border-radius:3px 3px 0 0;background:var(--brand);min-height:2px}
.bars .col .yr{font-size:10px;color:var(--text-3);font-family:var(--font-mono)}
.bars .col .val{font-size:10px;color:var(--text-2);font-family:var(--font-mono);white-space:nowrap}

/* -------------------------------- forms -------------------------------- */
.field{margin-bottom:14px}
.field label{display:block;font-size:12.5px;color:var(--text-2);margin-bottom:5px;font-weight:500}
/* ⚠ 必须排除 checkbox / radio：这条规则本意是给文本框做盒子，但复选框也会
   命中 —— 结果是一个 100% 宽、34px 高的「勾选框」，把标签文字挤到左边、
   勾选框漂到右边、行高翻倍。表现就是「勾选不知道对应哪一行」（2026-10-18
   用户截图反馈）。 */
.field input:not([type=checkbox]):not([type=radio]),
.field select,.field textarea{
  width:100%;padding:9px 11px;border:1px solid var(--border-strong);border-radius:var(--radius-sm);
  font-size:13px;font-family:inherit;background:var(--surface);color:var(--text);
}
.field textarea{resize:vertical;min-height:110px;font-family:var(--font-mono);font-size:12px}
.field input:focus,.field select:focus,.field textarea:focus{
  outline:2px solid var(--brand);outline-offset:-1px;border-color:var(--brand);
}
.field .help{font-size:11.5px;color:var(--text-3);margin-top:4px;line-height:1.5}
/* API key row: the input, then the two small buttons that act on it.
   The buttons are a fixed width so the input does not resize when the
   "Show"/"Hide" label swaps -- a jumping box makes the field look like it
   changed state when only its label did. */
.key-row{display:flex;gap:6px;align-items:stretch}
.key-row input{flex:1 1 auto;min-width:0}
.key-row .btn-sm{flex:0 0 auto;min-width:56px;white-space:nowrap}
.key-ok{color:var(--brand);font-weight:600}
/* The mask, printed as visible text.  Monospace so the stars line up with the
   asterisks a password field shows while typing -- the reader is comparing the
   two. */
.key-mask{font-family:var(--font-mono);color:var(--text-2)}
.key-none{color:var(--text-3);font-weight:600}
/* Same box as .field input, for the controls that sit inline in a row. */
.input{
  width:100%;padding:6px 9px;border:1px solid var(--border-strong);border-radius:var(--radius-sm);
  font-size:12.5px;font-family:inherit;background:var(--surface);color:var(--text);
}
.input:focus{outline:none;border-color:var(--brand)}
/* Offline analysis: one indicator per card. */
.big-num{font-size:19px;font-weight:600;font-family:var(--font-mono);margin-top:4px}
.tdx-groups{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:14px}
.tdx-group{border-top:1px solid var(--border);padding-top:8px}
.tdx-group-head{font-size:12.5px;font-weight:600;margin-bottom:6px}
.field-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:14px}

/* Controls that belong on one line (button + input + select). */
.row{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:8px}
.row>*{margin-top:0}
.row .input{width:auto;min-width:80px}

/* 584 fields: a two-column name/value list inside one collapsible group.
   The raw values are yuan, so the value column must never wrap or the
   digits become unreadable — that is the whole point of this layout. */
.tdx-group>summary{
  cursor:pointer;font-size:12.5px;font-weight:600;padding:6px 0;list-style:none;
}
.tdx-group>summary::-webkit-details-marker{display:none}
.tdx-group>summary::before{content:'\25B8  ';color:var(--text-3)}
.tdx-group[open]>summary::before{content:'\25BE  '}
.tdx-fields{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 12px;font-size:12px}
.tdx-fields .fn{
  color:var(--text-2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.tdx-fields .fv{
  text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap;color:var(--text);
}
.tdx-cond{margin-top:6px}

.switch{display:flex;align-items:center;gap:9px;font-size:13px;cursor:pointer}
.switch input{width:auto}

/* ------------------------------- content ------------------------------- */
.article{max-width:860px}
.article h2{margin:0 0 6px;font-size:22px}
.article h3{margin:22px 0 8px;font-size:15.5px}
.article p{margin:0 0 12px;font-size:14px;line-height:1.78;color:var(--text-2)}
.article ul{margin:0 0 14px;padding-left:20px}
.article li{margin-bottom:7px;font-size:14px;line-height:1.75;color:var(--text-2)}
.formula-box{
  font-family:var(--font-mono);background:var(--surface-2);border:1px solid var(--border);
  border-left:3px solid var(--brand);border-radius:var(--radius-sm);padding:12px 14px;
  font-size:13.5px;color:var(--text);margin:14px 0;overflow-x:auto;
}
.kv{display:flex;gap:10px;font-size:12.5px;padding:6px 0;border-bottom:1px solid var(--border)}
.kv:last-child{border-bottom:none}
.kv .k{color:var(--text-3);min-width:130px}
.kv .v{font-family:var(--font-mono);flex:1;word-break:break-word}

.list-link{
  display:block;padding:13px 15px;border-bottom:1px solid var(--border);
  border-left:3px solid transparent;
}
.list-link:last-child{border-bottom:none}
.list-link:hover{background:var(--surface-2);border-left-color:var(--brand)}
.list-link .t{font-weight:600;font-size:13.5px;margin-bottom:3px}
.list-link .d{font-size:12px;color:var(--text-3);line-height:1.6}

.chip-list{display:flex;flex-wrap:wrap;gap:7px}
.chip{
  display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:20px;
  background:var(--surface-2);border:1px solid var(--border);font-size:12px;
}
.chip button{border:none;background:none;cursor:pointer;color:var(--text-3);padding:0;font-size:13px;line-height:1}
.chip button:hover{color:var(--overpriced)}

.empty{
  padding:44px 20px;text-align:center;color:var(--text-3);font-size:13px;
}
.empty .big{font-size:30px;margin-bottom:10px;opacity:.5}

.spinner{
  width:22px;height:22px;border:2.5px solid var(--border);border-top-color:var(--brand);
  border-radius:50%;animation:spin .7s linear infinite;margin:0 auto 12px;
}
@keyframes spin{to{transform:rotate(360deg)}}
.loading{padding:52px 20px;text-align:center;color:var(--text-3);font-size:13px}

.toast{
  position:fixed;bottom:24px;right:24px;background:var(--text);color:#fff;padding:11px 18px;
  border-radius:var(--radius);font-size:13px;box-shadow:var(--shadow-lg);z-index:200;max-width:420px;
}
.toast.err{background:var(--overpriced)}
.toast.ok{background:var(--on-sale)}

/* -------------------------------- misc --------------------------------- */
.warn-strip{
  background:var(--warn-soft);border:1px solid #f7d9a8;color:var(--warn);
  padding:9px 13px;border-radius:var(--radius-sm);font-size:12px;margin-bottom:14px;line-height:1.6;
}
.info-strip{
  background:var(--surface-2);border:1px solid var(--border);color:var(--text-2);
  padding:9px 13px;border-radius:var(--radius-sm);font-size:12px;margin-bottom:14px;line-height:1.6;
}
/* ---- 单源模式的缺口清单（「这个源没有 X，可以换 Y」）------------------ */
.gap-block{margin-bottom:14px}
.gap-head{font-size:12px;color:var(--text-2);margin-bottom:6px}
.gap-row{display:flex;gap:10px;align-items:flex-start;justify-content:space-between;
  border:1px solid var(--border);border-radius:var(--radius-sm);padding:7px 10px;
  margin-bottom:6px;background:var(--surface-2)}
.gap-msg{font-size:12px;line-height:1.55;min-width:0}
.gap-acts{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end;flex:0 0 auto}
.gap-acts a.btn{text-decoration:none}
.gap-badge{display:inline-block;font-size:10.5px;padding:0 6px;border-radius:9px;
  border:1px solid var(--border-strong);color:var(--text-3);margin-right:6px;
  vertical-align:1px;white-space:nowrap}
.gap-badge.gap-field,.gap-badge.gap-layer{
  color:var(--warn);border-color:#f7d9a8;background:var(--warn-soft)}
.gap-badge.gap-bypass{color:var(--text-2)}
.gap-label{font-weight:600;color:var(--text)}
.building{
  background:#E4F3F5;border:1px solid #B7E0E4;color:var(--brand-dark);
  padding:9px 13px;border-radius:var(--radius-sm);font-size:12px;margin-bottom:14px;line-height:1.6;
  animation:pulse-soft 1.8s ease-in-out infinite;
}
@keyframes pulse-soft{0%,100%{opacity:1}50%{opacity:.62}}
@media(prefers-reduced-motion:reduce){.building{animation:none}}
.src-tags{display:flex;gap:6px;flex-wrap:wrap;align-items:center}
.src-tag{
  font-family:var(--font-mono);font-size:10.5px;background:var(--surface-2);border:1px solid var(--border);
  padding:2px 7px;border-radius:4px;color:var(--text-2);
}
.src-tag.paid{background:#E4F3F5;border-color:#B7E0E4;color:var(--brand-dark)}

/* --------------------------- financials module -------------------------- */
/* The three statements share one layout: a group card holding one bar chart
   per metric.  Charts reuse the `.bars/.col/.bar2/.val/.yr` primitives, only
   scaled up -- a statement chart carries more periods than the four-year
   summary it was written for. */
.fin-controls{
  display:flex;flex-wrap:wrap;gap:16px;align-items:flex-start;
  padding:12px 14px;border:1px solid var(--border);border-radius:var(--radius-sm);
  background:var(--surface-2);margin-bottom:16px;
}
.fin-controls .grp{display:flex;flex-direction:column;gap:6px}
.fin-controls .grp > .label{font-size:11.5px;color:var(--text-3);letter-spacing:.5px;font-weight:600;text-transform:uppercase}
.fin-range{display:flex;flex-wrap:wrap;gap:7px}
.fin-range .chip{cursor:pointer;user-select:none;flex-direction:column;align-items:flex-start;gap:0;padding:5px 11px}
.fin-range .chip .sub{font-size:10px;font-family:var(--font-mono);color:var(--text-3);line-height:1.5}
.fin-range .chip.active{background:var(--brand);border-color:var(--brand);color:#fff}
.fin-range .chip.active .sub{color:rgba(255,255,255,.82)}
.fin-toggle{display:inline-flex;border:1px solid var(--border);border-radius:var(--radius-sm);overflow:hidden;background:var(--surface)}
.fin-toggle button{
  background:transparent;border:0;padding:6px 15px;font:inherit;font-size:12.5px;
  color:var(--text-2);cursor:pointer;
}
.fin-toggle button.active{background:var(--brand);color:#fff;font-weight:600}
.fin-stat{display:flex;gap:22px;flex-wrap:wrap}
.fin-stat .item .k{font-size:11.5px;color:var(--text-3);text-transform:uppercase;letter-spacing:.5px;font-weight:600}
.fin-stat .item .v{font-size:13px;font-family:var(--font-mono);font-variant-numeric:tabular-nums}
.fin-group{margin-bottom:16px}
.fin-group-head{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;margin-bottom:2px}
.fin-chart{padding:10px 0 2px;border-top:1px solid var(--border);position:relative}
.fin-chart:first-of-type{border-top:0}
.fin-chart-head{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}
.fin-chart-head h4{margin:0;font-size:13.5px;font-weight:600}
.fin-chart-head .tag{font-size:10.5px;font-family:var(--font-mono);color:var(--text-3)}
.fin-chart .bars{height:186px;gap:4px}
/* Sixty quarterly periods in one "ALL" view will not fit a phone or a laptop;
   scroll them rather than silently truncating the range the user asked for. */
.fin-scroll{overflow-x:auto;overflow-y:hidden;padding-bottom:4px}
.fin-chart .bars .col .bar2{max-width:60px}
.fin-chart .bars .col .val{font-size:10px}
/* Online-vs-offline (TDX) comparison bars.  A solid online bar sits beside a
   ghost offline bar so scale or sign mismatches are visible at a glance; both
   are scaled off the same maxAbs in JS.  The offline bar is dashed + translucent
   so the eye reads it as "reference", not "primary".  A flagged column (the "!"
   trigger) gets a faint amber wash on its labels. */
.barpair{display:flex;align-items:flex-end;gap:2px;width:100%}
.fin-chart .bars .col .barpair .bar2{max-width:none;flex:1;min-width:0}
.bar2.offline{background:repeating-linear-gradient(45deg,var(--text-3) 0 3px,transparent 3px 6px);
  opacity:.5;border:1px dashed var(--text-3)}
.col.warn .yr{color:var(--warn)}
.col.warn .val{color:var(--warn)}
/* The "!" discrepancy button + its popover.  The popover is absolutely
   positioned under the chart head and hidden until its button is clicked. */
.fin-warn{margin-left:auto;width:20px;height:20px;border-radius:50%;border:1px solid var(--warn);
  background:var(--warn-soft);color:var(--warn);font-weight:700;font-family:var(--font-mono);
  cursor:pointer;line-height:18px;padding:0;flex:0 0 auto}
.fin-warn:hover{background:var(--warn);color:#fff}
.fin-warn-pop{display:none;position:absolute;z-index:40;top:34px;right:0;margin-top:0;
  min-width:230px;max-width:340px;background:var(--surface);border:1px solid var(--warn);
  border-radius:8px;box-shadow:0 8px 22px rgba(0,0,0,.18);padding:8px 11px;
  font-size:12px;color:var(--text-2);line-height:1.5}
.fin-warn-pop.open{display:block}
.fin-warn-pop-h{font-weight:700;color:var(--warn);margin-bottom:5px;font-size:12px}
.fin-warn-pop .row{display:flex;flex-direction:column;gap:2px;padding:5px 0;border-top:1px dashed var(--border)}
.fin-warn-pop .row:first-of-type{border-top:0}
.fin-warn-pop .row .muted{font-family:var(--font-mono);font-size:11px}
.fin-axis{
  display:flex;justify-content:space-between;font-size:10.5px;color:var(--text-3);
  font-family:var(--font-mono);padding-top:6px;border-top:1px dashed var(--border);
}
.fin-notes{margin-top:4px}
.fin-notes .row{font-size:12px;color:var(--text-2);padding:3px 0}
/* Generic explanatory line, shared by the Financials notes and Big Dipper's
   earnings-basis line. */
.note-row{font-size:12px;color:var(--text-2);padding:3px 0;line-height:1.65}

/* Futu NiuNiu settings card.
   The card is deliberately the only one with a switch *and* two alternative
   credential paths, so it needs the state line and the mode chips to make the
   current shape legible without reading the prose again. */
#futu-card .card-head .badge{margin-left:auto}
.futu-state{margin:9px 0 2px;font-size:12px;line-height:1.7;word-break:break-word}
.futu-mode{display:flex;gap:7px;flex-wrap:wrap;margin:14px 0 12px}
.futu-mode .chip{cursor:pointer;user-select:none}
.futu-mode .chip:hover{border-color:var(--text-3)}
.futu-mode .chip.active{border-color:var(--brand);color:var(--brand);font-weight:600}
.futu-panel{padding:14px;border:1px solid var(--border);border-radius:10px;background:var(--surface-2)}
.futu-panel .field:last-of-type{margin-bottom:12px}
.futu-row{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap;margin-top:12px}
.futu-test-row .field{margin-bottom:0;flex:0 0 170px}
.futu-link{display:flex;gap:8px;margin-top:8px}
.futu-link input{flex:1;min-width:0;font-family:var(--font-mono);font-size:11.5px}
.futu-ok{margin-top:12px;line-height:1.7}
#futu-test-out .table-wrap{margin-top:10px}
.err-txt{color:var(--overpriced)}


@media(max-width:900px){
  .sidebar{position:fixed;left:-224px;z-index:100;transition:left .2s}
  .sidebar.open{left:0}
  .view{padding:16px}
  .stock-price{margin-left:0;text-align:left}
}

/* ====================== data-source status dock ====================== */
/* Bottom-RIGHT, and COLLAPSED to a small chip by default.

   It used to sit bottom-LEFT at full height (296px x up to 46vh) and was open
   on every page.  On the settings page that landed squarely on top of the
   save button -- the one control that must never be covered -- and the user
   had no way to tell which panel was under their cursor.

   Three changes, all structural rather than cosmetic:

   1. Right side.  The left edge belongs to the sidebar (224px, sticky) and to
      the reading column; the bottom-right corner is empty on every page, and
      it is also where the eye is already trained to look for transient
      chrome.  It clears `.fx-strip`, which is a full-width bar pinned to the
      very bottom.
   2. Collapsed by default.  The panel that CAN cover things is only reachable
      by a deliberate click, and the choice persists in localStorage.
   3. MEASURED, not eyeballed.  A first attempt kept the chip 244px wide and it
      still covered the API-key show/clear buttons on the settings page --
      measured intersection 1051px^2 at 1440x900, by
      tools/dock_geometry_browser.js.  Shrinking it to a 34px dot chip fixed
      it.  "It looks out of the way" is not a measurement; a jsdom test cannot
      catch this at all (no layout engine, every rect is 0x0), which is why
      the geometry test drives a real Chrome.

   `body.dock-forced-close` is the escape hatch: on the settings page the panel
   cannot be open at all.  A panel that can cover a control on that page is a
   bug even if the user opened it on purpose. */
.status-dock{
  position: fixed; right: 12px; bottom: 44px; z-index: 40;
  width: 296px; max-width: calc(100vw - 24px);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  font-size: 12px; color: var(--text); overflow: hidden;
  transition: width .18s ease, box-shadow .18s ease;
}
/* Collapsed: a ~34px chip carrying only the state dot and the chevron.  The
   width has to be small enough to clear anything -- measured, see above. */
.status-dock.collapsed{
  width: 34px; background: var(--surface);
  border-radius: 999px; box-shadow: var(--shadow-md);
}
.status-dock .status-head{
  display: flex; align-items: center; gap: 6px;
  padding: 8px 10px; cursor: pointer; user-select: none;
  background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.status-dock.collapsed .status-head{
  border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); box-shadow: none;
  padding: 6px 0; gap: 0; justify-content: center;
}
.status-dock.collapsed .status-title-text,
.status-dock.collapsed .status-auth,
.status-dock.collapsed .status-chip{ display: none; }
.status-dock.collapsed .status-collapse{ margin-left: 0; }
/* The settings page forbids the open panel outright.  The chip stays -- "the
   feeds are fine" is useful there too -- it just cannot grow into anything. */
body.dock-forced-close .status-dock{ width: 34px; }
body.dock-forced-close .status-dock .status-body{ display: none !important; }
body.dock-forced-close .status-dock .status-head{ border-bottom: none; }
.status-dock .status-head strong{ font-size: 12.5px; }
.status-dock .status-auth{ margin-left: auto; font-size: 11px; color: var(--text-2); }
.status-dock .status-collapse{ margin-left: 6px; color: var(--text-3); transition: transform .15s; }
.status-dock.collapsed .status-collapse{ transform: rotate(-90deg); }
.status-dock.collapsed .status-body{ display: none; }
.status-dock .status-body{ padding: 6px 10px 9px; max-height: 46vh; overflow: auto; }
.status-dock .status-grp-label{
  font-size: 10.5px; color: var(--text-3); text-transform: uppercase;
  letter-spacing: .04em; margin: 7px 0 3px;
}
.status-dock .src-row{ display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.status-dock .src-name{ min-width: 66px; font-weight: 600; }
.status-dock .src-role{ color: var(--text-3); font-size: 10.5px; }
.status-dock .src-stat{ margin-left: auto; }
.status-dock .src-depth{ color: var(--text-2); font-size: 11px; min-width: 86px; text-align: right; }
.status-dock .status-free{
  display: flex; align-items: center; gap: 6px; margin-top: 8px;
  padding-top: 7px; border-top: 1px dashed var(--border); font-size: 11.5px;
}
.status-dock .status-free.connected{ color: var(--on-sale); }
.status-dock .status-free.degraded{ color: var(--warn); }
.status-dock .status-free.disconnected{ color: var(--overpriced); font-weight: 600; }
.status-dock .status-io{ display: flex; gap: 8px; margin-top: 8px; }
.status-dock .io-pill{
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-3); font-size: 11px; opacity: .45;
  transition: opacity .15s, color .15s, border-color .15s;
}
.status-dock .io-pill.active{ opacity: 1; color: var(--brand); border-color: var(--brand); }
.status-dock .io-pill .io-ico{ font-weight: 700; }

/* status dots -- traffic-light semantics shared with the Futu badge */
.dot{ width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: 0 0 auto; background: var(--text-3); }
.dot.connected{ background: var(--on-sale); box-shadow: 0 0 0 3px var(--on-sale-soft); }
.dot.degraded{ background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.dot.disconnected{ background: var(--overpriced); box-shadow: 0 0 0 3px var(--overpriced-soft); }

/* ---- growth-lens comparison card -------------------------------------
   Two columns, same model, different growth input. The active one is the
   lens the verdict actually used, so the reader can see which number the
   traffic light is resting on. */
.lens-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
}
/* Three lenses now: price CAGR (the headline basis), TTM, and the multi-year
   EPS CAGR that only feeds the secondary models.  The third column has no
   margin of safety of its own, so it is dimmed to read as a reference rather
   than as a third verdict. */
.lens-grid-3 {
  grid-template-columns: 1fr 1fr 1fr;
}
@media (max-width: 760px) {
  .lens-grid,
  .lens-grid-3 {
    grid-template-columns: 1fr;
  }
}
.lens-col-ref {
  background: transparent;
  border-style: dashed;
}
.lens-mos-na {
  font-size: 13px;
  font-weight: 600;
  color: var(--sub, var(--text-3));
}
.lens-col {
  border: 1px solid var(--line, var(--border));
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfaf8;
}
.lens-col.active {
  border-color: #c1272d;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}
.lens-head {
  font-size: 12px;
  color: var(--sub, var(--text-2));
  margin-bottom: 4px;
}
.lens-mos {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}
.lens-col .kv {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  padding: 1px 0;
}

/* ---- EPS time axis ---------------------------------------------------
   The values read oldest -> newest with a ✓ next to them, so the arrows
   have to run the same way. The labels sit underneath to make the
   direction unambiguous. */
.eps-axis {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-top: 2px;
  font-size: 10px;
  color: var(--sub, var(--text-3));
  letter-spacing: .02em;
}

/* ---------------------- chart sub-views (chart tab) --------------------- */
/* Quote / candles / line toggle inside the chart card. Same pill language
   as the source picker so the two read as the same kind of control. */
.cview-toggle{display:inline-flex;gap:2px;margin-right:10px}
.cview-btn{
  padding:4px 12px;border:1px solid var(--border);background:none;cursor:pointer;
  font-size:12px;font-family:inherit;color:var(--text-2);white-space:nowrap;
  border-radius:var(--radius-sm, 6px);
}
.cview-btn:hover{color:var(--text)}
.cview-btn.active{color:var(--brand);border-color:var(--brand);font-weight:600;background:var(--brand-soft)}

/* ------------------------------- news tab ------------------------------- */
.news-list{display:flex;flex-direction:column}
.news-item{padding:10px 2px;border-bottom:1px solid var(--border)}
.news-item:last-child{border-bottom:none}
.news-title{font-size:13.5px;font-weight:500;line-height:1.45}
.news-title a{color:var(--text);text-decoration:none}
.news-title a:hover{color:var(--brand)}
.news-meta-row{display:flex;align-items:center;gap:8px;margin-top:4px}
.news-meta-row .badge{font-size:10.5px}

/* ---- 接口监控 / 凭据保管库 / 个股标签栏 ---- */
.dot{width:9px;height:9px;border-radius:50%;display:inline-block;background:var(--text-3)}
.dot.ok{background:var(--on-sale);animation:pulse-soft 2.4s ease-in-out infinite}
.dot.warn{background:var(--warn);animation:pulse-soft 1.3s ease-in-out infinite}
.dot.bad{background:var(--overpriced);animation:pulse-soft .8s ease-in-out infinite}
.dot.off{background:var(--text-3);animation:none;opacity:.55}
.dot.ring{box-shadow:0 0 0 0 rgba(16,137,62,.5);animation:dot-ring 2.4s ease-out infinite}
@keyframes dot-ring{0%{box-shadow:0 0 0 0 rgba(16,137,62,.45)}70%{box-shadow:0 0 0 7px rgba(16,137,62,0)}100%{box-shadow:0 0 0 0 rgba(16,137,62,0)}}
.mon-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:10px}
.mon-kpi{background:var(--surface-2);border:1px solid var(--border);border-radius:10px;padding:10px 12px}
.mon-kpi .k{font-size:11.5px;color:var(--text-3)}
.mon-kpi .v{font-size:19px;font-weight:600;font-variant-numeric:tabular-nums;margin-top:2px}
.mon-table td,.mon-table th{font-size:12.5px}
.mono-sm{font-family:ui-monospace,Consolas,monospace;font-size:11.5px;color:var(--text-2)}
.spark{display:inline-flex;align-items:flex-end;gap:2px;height:20px}
.spark i{width:4px;background:var(--brand);border-radius:1px;display:block;opacity:.75}
.spark i.hi{background:var(--warn);opacity:.9}
.tabs{display:flex;gap:4px;flex-wrap:wrap;border-bottom:1px solid var(--border);margin-bottom:12px}
.tab{padding:6px 12px;cursor:pointer;font-size:13px;color:var(--text-2);border-bottom:2px solid transparent}
.tab:hover{color:var(--brand)}
.tab.active{color:var(--brand);border-bottom-color:var(--brand);font-weight:600}
.tab.disabled{color:var(--text-3);cursor:default;border-bottom-color:transparent}
.vault-card textarea{width:100%;min-height:74px;font-family:ui-monospace,Consolas,monospace;font-size:12px}
.badge-soft{background:var(--surface-2);border:1px solid var(--border);border-radius:999px;padding:1px 8px;font-size:11px;color:var(--text-2)}

/* ---- 通达信离线资产清单（「自动查找」的结果不只一个目录）------ */
.tdx-asset{border:1px solid var(--border);border-radius:8px;padding:8px 10px;margin-bottom:6px;background:var(--surface-2)}
.tdx-asset-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.tdx-asset-path{font-family:var(--font-mono);font-size:11.5px;color:var(--text-2);background:var(--surface);border:1px solid var(--border);padding:1px 6px;border-radius:4px}
.tdx-asset-what{font-size:13px;margin-top:4px;display:flex;gap:8px;align-items:baseline;flex-wrap:wrap}

/* ---------------- provenance tab (local briefs & data sources) --------- */
.badge-tally{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:10px 0 4px}
.sub-h{font-size:12.5px;font-weight:600;color:var(--text-2);margin:16px 0 6px}
.rulebook{margin-top:10px;border-top:1px solid var(--border);padding-top:8px}
.rulebook summary{cursor:pointer;font-size:12.5px;font-weight:600;color:var(--text-2)}
.rulebook ul{margin:8px 0 0;padding-left:18px}
.rulebook li{margin-bottom:8px;font-size:12px;line-height:1.6}
.warn-text{color:var(--warn);margin-top:8px}
.warn-strip ul{margin:6px 0 0;padding-left:18px}
.warn-strip li{margin-bottom:4px}


/* ============================ 4M 信心增强器（向导） ============================
   整屏浮层而不是新路由：向导是"看完就关"的东西，不占地址栏、不进历史，
   关掉就回到个股页原来的位置 —— 用路由实现会把用户的分析结果页挤掉。

   层级 270：在 modal(260) 之上、toast(200) 之上，避免"弹窗里报错被 toast 盖住"
   （这个坑在 .modal-overlay 的注释里已经记过一次）。 */
.t4m-overlay{
  position:fixed;inset:0;background:rgba(15,23,42,.55);z-index:270;
  display:flex;align-items:center;justify-content:center;padding:24px;
}
.t4m-modal{
  background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);
  box-shadow:var(--shadow-lg);width:100%;max-width:640px;max-height:90vh;
  display:flex;flex-direction:column;overflow:hidden;
}
.t4m-head{display:flex;align-items:center;gap:12px;padding:14px 18px 10px}
.t4m-title{font-weight:600;font-size:15px}
.t4m-step{margin-left:auto;font-size:11.5px;color:var(--text-2)}
.t4m-x{
  border:0;background:transparent;font-size:20px;line-height:1;cursor:pointer;
  color:var(--text-2);padding:2px 6px;border-radius:6px;
}
.t4m-x:hover{background:var(--surface-2);color:var(--text)}
.t4m-bar{height:3px;background:var(--surface-2)}
.t4m-bar span{display:block;height:100%;background:var(--accent, var(--brand));
  transition:width .25s ease}
.t4m-body{padding:16px 18px;overflow:auto;flex:1}
.t4m-foot{
  display:flex;align-items:center;gap:10px;padding:12px 18px;
  border-top:1px solid var(--border);background:var(--surface-2)
}
.t4m-foot .spacer{flex:1}

.t4m-h2{margin:0 0 8px;font-size:16px}
.t4m-lead{margin:0 0 10px;line-height:1.75;color:var(--text-2)}
.t4m-q{margin:0 0 12px;padding:8px 10px;border-left:3px solid var(--border);
  background:var(--surface-2);border-radius:0 6px 6px 0;font-size:12px}
.t4m-loading{padding:36px 0;text-align:center;color:var(--text-2)}

.t4m-identity,.t4m-bars,.t4m-block{margin:10px 0}
.t4m-kv{display:flex;gap:10px;padding:5px 0;border-bottom:1px dashed var(--border);font-size:12.5px}
.t4m-kv .k{color:var(--text-2);min-width:150px}
.t4m-kv .v{flex:1;word-break:break-word}
.t4m-steps{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:14px}
.t4m-step-card{border:1px solid var(--border);border-radius:8px;padding:10px 12px;background:var(--surface-2)}
.t4m-step-card .t{font-weight:600;font-size:12.5px;margin-bottom:4px}
.t4m-step-card .d{font-size:11.5px;color:var(--text-2);line-height:1.6}

.t4m-band-row{display:flex;gap:12px;align-items:center;padding:8px 0;border-bottom:1px dashed var(--border)}
.t4m-band-row .range{min-width:80px;color:var(--text-2);font-size:12px}
.t4m-band-row .lbl{font-weight:600;font-size:13px}

.t4m-block-head{
  display:flex;align-items:center;gap:10px;margin:14px 0 6px;
  padding-bottom:5px;border-bottom:1px solid var(--border);
  font-size:12.5px;font-weight:600;
}
.t4m-block-head .mono,.t4m-block-head span:last-child{margin-left:auto;font-weight:500;color:var(--text-2)}
.t4m-item{display:flex;gap:10px;padding:5px 0;font-size:12.5px}
.t4m-item .k{flex:1;color:var(--text-2)}
.t4m-item .v{max-width:56%;text-align:right;word-break:break-word}
.t4m-ev{font-size:11.5px;color:var(--text-2);padding:4px 0 6px 0;line-height:1.6}
.t4m-fine{font-size:11px;color:var(--text-2);line-height:1.65;margin-top:12px;
  padding-top:8px;border-top:1px dashed var(--border)}
.t4m-note{margin:10px 0;padding:8px 10px;border-radius:6px;font-size:12px;
  background:var(--surface-2);color:var(--text-2);line-height:1.65}
.t4m-note.warn{background:rgba(245,158,11,.12);color:#a16207}
.t4m-note.ok{background:rgba(34,197,94,.12);color:#15803d}
.t4m-actions{display:flex;gap:8px;margin:12px 0 0;flex-wrap:wrap}

.t4m-opts{display:flex;flex-direction:column;gap:6px;margin:10px 0}
.t4m-opt{display:flex;align-items:center;gap:8px;padding:8px 10px;border:1px solid var(--border);
  border-radius:8px;cursor:pointer;font-size:12.5px}
.t4m-opt.on{border-color:var(--accent, var(--brand));background:var(--surface-2)}
.t4m-field{display:flex;align-items:center;gap:10px;margin:10px 0;font-size:12.5px;flex-wrap:wrap}
.t4m-field>span:first-child{min-width:210px;color:var(--text-2)}
.t4m-field input{width:110px;padding:5px 8px;border:1px solid var(--border);
  border-radius:6px;background:var(--surface);color:var(--text)}
.t4m-field .hint{font-size:11px;color:var(--text-2)}

.t4m-alpha{font-size:30px;font-weight:600;line-height:1.2;margin:6px 0}
.t4m-alpha.up{color:var(--up,#dc2626)}
.t4m-alpha.down{color:var(--down,#16a34a)}

.t4m-total{text-align:center;padding:14px 0 10px;border-bottom:1px solid var(--border);margin-bottom:10px}
.t4m-total .n{font-size:34px;font-weight:600;line-height:1.15}
.t4m-total .l{font-size:13px;color:var(--text-2);margin-top:2px}
.t4m-total.band-high .n{color:#15803d}
.t4m-total.band-mid .n{color:#a16207}
.t4m-total.band-low .n{color:#b91c1c}

/* ===================== 市场选股器（对齐基准平台） ===================== */
.scr-actions{display:flex;gap:8px;align-items:flex-start;flex-wrap:wrap}
.scr-actions>.btn{flex:0 0 auto}
.scr-bar{display:flex;gap:14px;flex-wrap:wrap;align-items:flex-end}
.scr-bar .field{margin:0;min-width:132px}
.scr-bar-actions{display:flex;align-items:flex-end;flex-wrap:wrap}
.scr-summary{margin:14px 0 10px;font-size:13px;color:var(--text-2)}
.scr-dim{color:var(--text-3);font-size:12px;line-height:1.6}
/* 表格：表头吸顶 + 数字等宽。列很多，横向滚动是常态。 */
.scr-table-wrap{overflow:auto;max-height:68vh;border:1px solid var(--border);
  border-radius:var(--radius);background:var(--surface);box-shadow:var(--shadow)}
.scr-table{border-collapse:separate;border-spacing:0;width:100%;font-size:12.5px}
.scr-table th{position:sticky;top:0;z-index:2;background:var(--surface-2);
  text-align:left;padding:8px 10px;white-space:nowrap;cursor:pointer;
  border-bottom:1px solid var(--border);font-weight:600}
.scr-table th:hover{color:var(--brand)}
.scr-table td{padding:7px 10px;border-bottom:1px solid var(--border);white-space:nowrap}
.scr-table tbody tr:hover{background:var(--surface-2)}
.scr-table td .num{display:inline-block;text-align:right;min-width:54px;
  font-variant-numeric:tabular-nums}
.scr-th-off{color:var(--text-3)}
.scr-na{color:var(--text-3);font-size:11.5px;cursor:help;
  border-bottom:1px dotted var(--text-3)}
.scr-flag{color:var(--warn);font-weight:700}
/* 筛选面板：一列一个条件。★ 三个细节都是为了「对齐」——
   ① minmax 从 212 提到 248：212 宽里两个数字输入 + 中间的 – 挤在一起，
      上下相邻两行的输入框看上去就是错开的；
   ② label 固定 18px 行高并单行省略：否则「fiveYearlyPriceChange」这种长标签
      会折成两行，把整行往下推；
   ③ 输入框 flex:1 1 0 + min-width:0：flex 子项默认 min-width:auto，
      数字框的内容宽度会把它们撑出容器，看起来像右边那个掉出去了。 */
.scr-filters{display:grid;grid-template-columns:repeat(auto-fill,minmax(248px,1fr));
  gap:14px 16px;align-items:start}
.scr-filter{min-width:0}
.scr-unit{color:var(--text-3);font-size:11px;font-weight:400;margin-left:2px;white-space:nowrap}
/* 标题行是「名称 + 已选N」两列。计数必须 flex:none —— 长名称（例如
   「最近年度每股派现」）要截断的是名称那一列，不能把计数挤出容器。 */
.scr-filter > label{display:flex;align-items:center;justify-content:space-between;
  gap:8px;height:18px;line-height:18px;font-size:12px;
  color:var(--text-2);margin-bottom:5px;white-space:nowrap;overflow:hidden}
.scr-filter-name{overflow:hidden;text-overflow:ellipsis;min-width:0}
.scr-multi-count{flex:none;height:16px;line-height:16px;padding:0 6px;
  border-radius:8px;font-size:11px;font-weight:600;
  background:color-mix(in srgb,var(--brand) 14%,transparent);color:var(--brand)}
/* flex 子项自带 display 会盖掉 [hidden] 的默认 display:none，必须显式写。 */
.scr-multi-count[hidden]{display:none}
.scr-filter-off{opacity:.55}
.scr-range{display:flex;align-items:center;gap:6px;min-width:0}
.scr-range input{flex:1 1 0;width:auto;min-width:0}
.scr-multi{max-height:200px;overflow:auto;border:1px solid var(--border);
  border-radius:var(--radius-sm);padding:4px;display:flex;flex-direction:column;
  gap:0}
/* 勾选框尺寸**所有地方一致**：下面两套布局都靠这条，不能让浏览器默认尺寸
   参与排版（默认尺寸在不同缩放比下还不一样，行与行就会错开）。 */
.scr-chk input[type="checkbox"]{width:14px;height:14px;padding:0;margin:0;
  flex:none;accent-color:var(--brand);cursor:pointer}
/* ★ 筛选面板里的多选：每行「勾选框 + 文字」**两列、行高固定**。
   真因：`.field input` 的 `width:100%;padding:9px 11px` 把复选框也撑成
   100% 宽 34px 高，于是勾选框被推到文字右边、各行高度还不齐 ——
   扫视时根本看不出勾的是哪一行（这正是截图里的错位）。
   用 grid 把两列钉死，勾选框永远落在同一条竖线上。
   斑马纹与选中底色是辅助：只靠 14px 的框，仍然容易把它看成上下行之间的东西。 */
.scr-multi .scr-chk{display:grid;grid-template-columns:15px minmax(0,1fr);
  align-items:center;gap:8px;font-size:12.5px;cursor:pointer;
  min-height:24px;padding:2px 6px;border-radius:4px;line-height:1.35}
.scr-multi .scr-chk > span{white-space:nowrap;overflow:hidden;
  text-overflow:ellipsis}
.scr-multi .scr-chk:hover{background:var(--surface-2)}
.scr-multi .scr-chk:nth-child(even){
  background:color-mix(in srgb,var(--surface-2) 60%,transparent)}
.scr-multi .scr-chk:has(input:checked){
  background:color-mix(in srgb,var(--brand) 10%,transparent)}
.scr-multi .scr-chk:has(input:checked) > span{color:var(--text);font-weight:600}
/* ★ 列选择面板不能套用上面那条：这一行是「勾选框 + 列名 + （可选）」三块，
   再加右侧上下箭头。两列网格会把第三块挤到第二行 —— 修一处坏一处。
   所以这里保持 flex，只复用统一的勾选框尺寸。 */
.scr-col-row .scr-chk{display:flex;align-items:center;gap:7px;
  font-size:12.5px;cursor:pointer;min-width:0}
.scr-cols{display:grid;grid-template-columns:repeat(auto-fill,minmax(246px,1fr));gap:4px}
.scr-col-row{display:flex;align-items:center;justify-content:space-between;gap:8px;
  padding:4px 6px;border-radius:var(--radius-sm)}
.scr-col-row:hover{background:var(--surface-2)}
.scr-col-btns{display:flex;gap:4px}
.scr-star{background:none;border:0;cursor:pointer;font-size:15px;color:var(--text-3);
  padding:0 2px}
.scr-star.on{color:var(--brand)}
.scr-star[disabled]{opacity:.35;cursor:not-allowed}
.scr-prog{height:8px;background:var(--border);border-radius:99px;overflow:hidden;
  margin:6px 0 8px}
.scr-prog-fill{height:100%;background:var(--brand);transition:width .3s}
.scr-empty{text-align:center;color:var(--text-3);padding:24px}
.scr-job .card-head h3{margin:0}

/* 浏览器网桥提示卡：说明 + 一个动作按钮。刻意不像告警条那么刺眼 ——
   它是「怎么让它能用」，不是「出错了」。 */
/* ---- 选股器：本次数据来自哪个源（口径声明，不是装饰）------------------ */
.scr-src{
  display:flex;gap:10px;align-items:baseline;flex-wrap:wrap;
  background:var(--surface-2);border:1px solid var(--border);
  padding:9px 13px;border-radius:var(--radius-sm);font-size:12px;
  color:var(--text-2);margin-bottom:14px;line-height:1.6;
}
.scr-src-dot{
  width:7px;height:7px;border-radius:50%;background:var(--brand);
  display:inline-block;flex:0 0 auto;
}
.scr-src[data-src="tdx"]{border-color:#C9DEEA;background:#EEF6FA}
.scr-src[data-src="tdx"] .scr-src-dot{background:var(--brand-bright)}
.scr-src-text{flex:1 1 260px}
.scr-src-hint{color:var(--text-3);font-size:11px;white-space:nowrap}
.scr-opt-off{color:var(--text-3)}
.scr-bridge { padding:12px 14px; margin-bottom:12px; }.scr-bridge-h { font-weight:600; margin-bottom:6px; }
.scr-bridge p { margin:4px 0; }
.scr-bridge-actions { display:flex; align-items:center; gap:10px; margin-top:8px; flex-wrap:wrap}
.scr-bridge code { font-size:11px; word-break:break-all; }

/* 榜单页（#/rankings）：榜单切换 chip + 控制条。
   复用既有 `.chip` 视觉，只是把「点选」态显式化（榜单是一组互斥选项）。 */
.rk-chips { display:flex; flex-wrap:wrap; gap:7px; margin-bottom:4px; }
.rk-chip { cursor:pointer; }
.rk-chip.active { background:var(--brand); border-color:var(--brand); color:#fff; }
.rk-controls { margin-top:10px; align-items:center; }
.rk-controls label { display:flex; align-items:center; gap:6px; font-size:12px; color:var(--text-2); }
.rk-controls select { padding:4px 6px; border-radius:6px; }
.rk-desc { flex:1 1 220px; text-align:right; }

/* 一年走势缩略图（选股器「Chart (1Y)」列）。纯内联 SVG，无外部依赖。 */
.scr-spark { display:block; }
.scr-table td .scr-spark { margin:0 auto; }

/* 美股数据镜像卡片（设置页 + 个股页）。
   与既有卡片同视觉，只加两处：文件表的小按钮、以及「载入」那一行。 */
.hf-card .note-row { margin-top:2px; }
.hf-card .row .hf-load { flex:0 0 auto; }
.btn-xs { padding:2px 7px; font-size:11px; line-height:1.5; }

/* ===================== 投资组合概览 ===================== */
.pf-tabs{display:flex;gap:4px;border-bottom:1px solid var(--border);margin:0 0 14px}
.pf-tab{background:none;border:none;padding:9px 14px;font-size:13px;color:var(--text-2);
  cursor:pointer;border-bottom:2px solid transparent;margin-bottom:-1px}
.pf-tab:hover{color:var(--text)}
.pf-tab.active{color:var(--brand);border-bottom-color:var(--brand);font-weight:600}

.pf-total{padding:18px 20px}
.pf-total-row{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap}
.pf-total-num{font-size:34px;font-weight:700;letter-spacing:-.5px}
.pf-cur{font-size:15px;font-weight:500;color:var(--text-3)}
.pf-total-delta{font-size:14px}
.pf-total-note{margin-top:6px}

.pf-note{margin:12px 0;padding:12px 14px;border-radius:9px;
  background:#EFF6FF;border:1px solid #BFDBFE;color:#1E3A8A;
  font-size:12.5px;line-height:1.7}

.pf-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:14px}
.pf-grid3{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}
@media (max-width:1100px){.pf-grid,.pf-grid3{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:720px){.pf-grid,.pf-grid3{grid-template-columns:1fr}}

.pf-card{min-height:196px;height:100%;display:flex;flex-direction:column}
.pf-card .card-head{margin-bottom:10px}
.pf-card .card-head h3{font-size:13px;font-weight:600;color:var(--text-2)}
.pf-center{display:flex;align-items:center;justify-content:center;flex:1;padding:6px 0}
.pf-cov{font-size:11px;color:var(--text-3);margin-top:6px;text-align:center;display:block}
.pf-na{font-size:12px;color:var(--text-3);line-height:1.7;padding:10px 0}

.pf-pie{border-radius:50%;flex:0 0 auto}
.pf-dist{display:flex;align-items:center;gap:16px}
.pf-legend{flex:1;min-width:0;display:flex;flex-direction:column;gap:6px}
.pf-legend-row{display:flex;align-items:center;gap:8px;font-size:12px}
.pf-legend-row i{width:9px;height:9px;border-radius:2px;flex:0 0 auto}
.pf-legend-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pf-legend-val{color:var(--text-2);font-variant-numeric:tabular-nums}
.pf-legend-more{font-size:11px;color:var(--text-3)}

.pf-hex{width:112px;height:124px}
.pf-ring{width:118px;height:118px;border-radius:50%;display:flex;align-items:center;
  justify-content:center;position:relative}
.pf-ring-in{width:86px;height:86px;border-radius:50%;background:var(--surface);
  display:flex;align-items:baseline;justify-content:center;gap:2px}
.pf-ring-in b{font-size:24px;font-weight:700}
.pf-ring-in span{font-size:11px;color:var(--text-3)}
.pf-ring-na{background:#F0F0F0;color:var(--text-3);font-size:22px}

.pf-mos{display:flex;flex-direction:column;gap:6px;padding-top:4px}
.pf-mos-row{display:flex;justify-content:space-between;font-size:12px;color:var(--text-2)}
.pf-mos-v{font-variant-numeric:tabular-nums;color:var(--text)}
.pf-mos-bar{height:7px;border-radius:4px;background:var(--surface-2);overflow:hidden}
.pf-mos-bar i{display:block;height:100%;border-radius:4px}
.pf-mos-price{background:var(--brand)}
.pf-mos-fair{background:var(--on-sale)}
.pf-mos-foot{margin-top:8px;font-size:12px;color:var(--text-2)}
.pf-mos-foot b{font-size:17px;margin-left:4px}

.pf-seven{display:flex;flex-direction:column;gap:10px;padding-top:6px}
.pf-seven-num{font-size:30px;font-weight:700}
.pf-seven-num span{font-size:13px;color:var(--text-3);font-weight:500}
.pf-seven-track{height:8px;border-radius:4px;background:var(--surface-2);overflow:hidden}
.pf-seven-track i{display:block;height:100%;background:var(--brand);border-radius:4px}
.pf-seven-legend{display:flex;justify-content:space-between;font-size:11px;color:var(--text-3)}

.pf-mix{display:flex;flex-direction:column;gap:4px}
.pf-mix-row{display:flex;justify-content:space-between;align-items:center;
  padding:7px 10px;border-radius:8px;background:var(--surface-2);font-size:12px}
.pf-mix-row b{font-variant-numeric:tabular-nums}
.pf-mix-total{background:color-mix(in srgb,var(--brand) 12%,transparent)}
.pf-mix-op{text-align:center;color:var(--text-3);font-size:12px}

.pf-bars{display:flex;align-items:flex-end;gap:28px;height:150px;padding:8px 6px 0}
.pf-bar-col{flex:1;display:flex;flex-direction:column;align-items:center;height:100%;
  justify-content:flex-end;gap:6px}
.pf-bar-val{font-size:12.5px;font-weight:600;font-variant-numeric:tabular-nums}
.pf-bar{width:64px;border-radius:6px 6px 0 0;background:var(--brand)}
.pf-bar.pos{background:var(--on-sale)}
.pf-bar.neg{background:var(--overpriced)}
.pf-bar-label{font-size:11.5px;color:var(--text-3)}
.pf-bar-na .pf-bar{background:var(--surface-2)}

.pf-manage{margin-top:16px;margin-bottom:76px}
.pf-manage>summary{cursor:pointer;font-size:13px;color:var(--text-2);padding:4px 0}
.pf-manage-body{padding-top:12px}
.pf-manage-list{margin-top:12px;border-top:1px solid var(--border)}
.pf-manage-item{display:flex;align-items:center;gap:12px;padding:8px 0;
  border-bottom:1px solid var(--border);font-size:12.5px}
.pf-manage-item span:first-child{flex:1}

/* 交易流水表单：7 个短字段排一行，窄屏自动折成两列。 */
.pf-tx-form{display:grid;grid-template-columns:repeat(auto-fit,minmax(110px,1fr));
  gap:10px;align-items:end}
.pf-bt-chart{width:100%;height:180px;display:block;margin:8px 0 4px}
.pf-bt-legend{display:flex;gap:16px;font-size:12px;color:var(--text-2)}
.pf-bt-legend i{display:inline-block;width:10px;height:3px;margin-right:5px;
  vertical-align:middle;border-radius:2px}
.pf-bt-cmp{display:flex;align-items:center;gap:10px;margin-top:10px;
  font-size:12.5px;color:var(--text-2)}
.pf-bt-cmp b{font-size:15px;font-variant-numeric:tabular-nums}
.pf-warn{margin:10px 0 0;padding-left:18px;font-size:12px;color:var(--text-2)}
.pf-warn li{margin:2px 0}

/* ---------------- 分析总览 / 4M 强化器 / AI 助手 ---------------- */
.an-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin-bottom:14px}
.an-card{padding:14px 16px}
.an-card-label{font-size:12px;color:var(--text-2)}
.an-card-value{font-size:26px;font-weight:600;font-variant-numeric:tabular-nums;margin:2px 0}
.an-card-hint{font-size:11.5px;color:var(--text-3)}
.an-bars{display:flex;flex-direction:column;gap:8px;padding:4px 0}
.an-bar-row{display:grid;grid-template-columns:64px 1fr 56px;align-items:center;gap:10px}
.an-bar-label{font-size:12px;color:var(--text-2);font-variant-numeric:tabular-nums}
.an-bar-track{height:10px;background:var(--surface-2);border-radius:5px;overflow:hidden}
.an-bar-track i{display:block;height:100%;background:var(--brand);border-radius:5px}
.an-bar-val{font-size:12px;text-align:right;font-variant-numeric:tabular-nums}
.scr-proj{display:flex;gap:18px;align-items:center;font-size:12.5px;color:var(--text-2);
  margin:-4px 0 10px;flex-wrap:wrap}
.scr-proj i{font-style:normal;font-weight:600;font-variant-numeric:tabular-nums}

.ai-shell{padding:14px 16px}
.ai-agents{display:flex;gap:6px;margin-bottom:10px}
.ai-agent{border:1px solid var(--border);background:transparent;color:var(--text-2);
  padding:5px 12px;border-radius:14px;font-size:12.5px;cursor:pointer}
.ai-agent.active{background:var(--brand);border-color:var(--brand);color:#fff}
.ai-ctx{display:grid;grid-template-columns:auto 160px auto 140px;gap:8px;
  align-items:center;margin-bottom:10px}
.ai-ctx label{white-space:nowrap}
.ai-log{height:46vh;min-height:240px;overflow-y:auto;border:1px solid var(--border);
  border-radius:8px;padding:12px;background:var(--surface-2);display:flex;
  flex-direction:column;gap:10px}
.ai-msg{max-width:78%;padding:9px 12px;border-radius:10px;font-size:13px;
  line-height:1.6;white-space:pre-wrap;word-break:break-word}
.ai-msg.me{align-self:flex-end;background:var(--brand);color:#fff}
.ai-msg.ai{align-self:flex-start;background:var(--surface);border:1px solid var(--border)}
.ai-hint{margin:auto;text-align:center;max-width:80%}
.ai-input{display:flex;gap:8px;margin-top:10px;align-items:flex-end}
.ai-input textarea{flex:1;resize:vertical;font-family:inherit;font-size:13px;
  padding:8px 10px;border:1px solid var(--border);border-radius:8px;
  background:var(--surface);color:var(--text)}
@media (max-width:720px){
  .ai-ctx{grid-template-columns:1fr 1fr}
  .an-bar-row{grid-template-columns:56px 1fr 48px}
}
.ai-status{font-size:12.5px;color:var(--text-2);margin:-4px 0 10px}
.ai-status a{margin-left:6px}
.card.flash{animation:card-flash 1.6s ease-out}
@keyframes card-flash{0%{box-shadow:0 0 0 2px var(--brand)}100%{box-shadow:0 0 0 0 transparent}}

/* 未评分的分项：理由很长，必须整块换行，否则左侧标签会被挤成一字一行。 */
.bd-row.bd-unavailable{flex-wrap:wrap;align-items:flex-start}
.bd-row.bd-unavailable .k{flex:1 1 100%;min-width:0}
.bd-why{flex:1 1 100%;color:var(--text-2);font-size:12px;line-height:1.65;
  margin:2px 0 4px;max-width:78ch}
.bd-why b{color:var(--text)}

/* ---------------- 品牌 logo ---------------- */
.brand-logo{width:30px;height:34px;object-fit:contain;flex:0 0 auto;filter:drop-shadow(0 2px 6px rgba(0,194,199,.28))}
.login-logo{width:132px;height:auto;display:block;margin:0 auto 12px;
  filter:drop-shadow(0 6px 16px rgba(7,22,38,.16))}

/* ---------------- 同步看板（Clone Bisync 监控，2026-10-28） ----------------
   服务器线不再提供「填参数 + 点开始」，只剩「状态 + 日志」。
   徽标用色块而不是纯文字：几十秒才刷一次数据时，色块最先被看见。 */
.sync-badge{display:inline-flex;align-items:center;gap:6px;padding:3px 10px;
  border-radius:999px;font-size:11.5px;font-weight:600;white-space:nowrap;
  border:1px solid transparent}
.sync-badge.idle{background:var(--watch-soft);color:var(--watch);border-color:var(--border)}
.sync-badge.run{background:var(--on-sale-soft);color:var(--on-sale);border-color:#BFE6DA}
.sync-badge.off{background:var(--overpriced-soft);color:var(--overpriced);border-color:#F3C9CC}
.sync-badge.run::before{content:'';width:7px;height:7px;border-radius:50%;
  background:var(--on-sale);animation:syncPulse 1.3s ease-in-out infinite}
@keyframes syncPulse{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.25;transform:scale(.8)}}

.sync-pair{color:var(--text-3);word-break:break-all;line-height:1.6}
.sync-loghead{display:flex;align-items:center;justify-content:space-between;
  gap:10px;margin:0 0 6px;color:var(--text-3)}
.sync-follow{display:inline-flex;align-items:center;gap:5px;cursor:pointer;
  user-select:none;color:var(--text-2)}
.sync-log{margin:0;padding:10px 12px;height:280px;overflow:auto;
  background:#0E1620;color:#C9D4E0;border-radius:10px;
  border:1px solid #1B2735;
  font-family:var(--font-mono);font-size:12px;line-height:1.6;
  white-space:pre-wrap;word-break:break-all;
  scrollbar-width:thin;scrollbar-color:#2C3B4D transparent}
.sync-log:empty::after{content:'（暂无日志）';color:#5A6878}
.sync-log::-webkit-scrollbar{width:8px}
.sync-log::-webkit-scrollbar-thumb{background:#2C3B4D;border-radius:4px}
.sync-adv{margin-top:12px;border-top:1px dashed var(--border);padding-top:10px}
.sync-adv summary{cursor:pointer;list-style:none}
.sync-adv summary::-webkit-details-marker{display:none}
.sync-adv summary::before{content:'▸ ';color:var(--text-3)}
.sync-adv[open] summary::before{content:'▾ '}
