/* Listed-fund views: keep identifiers stable while switching metric columns. */
#premColumnTools{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:12px 10px 0;padding:10px 0;background:var(--panel)}
.prem-view-buttons{display:flex;gap:4px;padding:3px;border:1px solid var(--line);border-radius:9px;background:var(--bg)}
.prem-view-buttons button{border:0;border-radius:6px;background:transparent;color:var(--muted);font:inherit;font-size:13px;padding:7px 15px;cursor:pointer}
.prem-view-buttons button.on{background:var(--accent);color:var(--panel);font-weight:600}
.prem-view-buttons button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.prem-view-hint,#premDataDates{font-size:11px;color:var(--muted)}
#premDataDates{padding:3px 10px 8px;line-height:1.8}
#tab-prem #premTable .prem-group{margin-top:10px;margin-bottom:18px}
#tab-prem #premTable .prem-group-title{padding:11px 14px;font-size:14px}
#tab-prem #premTable td{padding:8px 10px;height:41px;white-space:nowrap}
#tab-prem #premTable th{padding:10px;font-size:11px;white-space:nowrap}
#tab-prem #premTable table{width:100%;table-layout:fixed}
#tab-prem #premTable th,#tab-prem #premTable td{text-align:center;vertical-align:middle;font-variant-numeric:tabular-nums}
#tab-prem #premTable td{overflow:hidden;text-overflow:ellipsis}
#tab-prem #premTable .prem-group-body{overflow-x:auto}
#tab-prem #premTable .nm-wrap{align-items:center}
#tab-prem #premTable .nm-heading{justify-content:center;max-width:100%}
#tab-prem #premTable th:nth-child(3),#tab-prem #premTable td:nth-child(3){width:auto;min-width:0;max-width:none}
#tab-prem #premTable th:nth-child(4),#tab-prem #premTable td:nth-child(4){border-right:1px solid var(--line)}
.prem-status-dot{font-size:12px;color:var(--warn);cursor:help}
@media(max-width:640px){.prem-view-buttons button{padding:7px 9px;font-size:12px}.prem-view-hint{display:none}}

/* theme.css —— 全站配色与基础排版的唯一来源
 *
 * 改造前：portfolio / tx / holdings / settings / quick / returns / health /
 * attribution / index 九个页面各自内联了一份 :root，改一个颜色要改九处。
 * 实测九份内容只差一个变量、无任何冲突值，因此可以安全合并成这一份。
 *
 * 用法：<link rel="stylesheet" href="/theme.css"> 放在页面自己的 <style> 之前，
 * 页面样式仍可覆盖这里的任何变量。
 *
 * ★ 新增颜色请加在这里，不要写回页面内联样式。
 */
:root {
  /* 背景与面板 */
  --bg: #f4f6f9;
  --bg2: #eef1f6;
  --panel: #ffffff;
  --panel2: #f6f8fb;
  --chart-tip-bg: color-mix(in srgb, var(--panel) 70%, transparent);
  --chart-tip-shadow: 0 1px 5px rgba(28,35,48,.08);

  /* 描边 */
  --line: #e3e7ee;
  --line2: #d3d9e4;

  /* 文字：主 / 次 / 更淡 */
  --txt: #1c2330;
  --muted: #68738a;
  --faint: #94a0b4;

  /* 强调色 */
  --accent: #2563eb;
  --accent2: #1d4ed8;

  /* ★ 涨跌配色改为美股习惯：涨绿跌红。2026-08-28 用户要求全站统一。 */
  --up: #16a34a;
  --down: #dc2626;

  /* 状态色 */
  --warn: #d97706;
  --hot: #e11d48;
  --cool: #059669;
  --green: #16a34a;
  /* ★ --red 此前从未定义，但 attribution/health/settings 三个页面都在用。
     CSS 变量未定义是【静默失效】：颜色直接没了，不报错。取值与 --up 一致。 */
  --red: #dc2626;

  --radius: 13px;

  /* ---- 语义色：信号页 / 股票列表页用 ---- */
  /* 中性强调（按钮、选中态、排序箭头）。与 --accent 的区别：--accent 是品牌蓝，
     --blue 是控件蓝，两者刻意保持接近但不相等。 */
  --blue: #315fce;

  /* ★ 市场状态标签（Bull/Buy、Bear/Sell）。注意这里用的是【欧美约定】：牛=绿 熊=红，
     与本站价格涨跌的【A股约定】（--up 红 / --down 绿）方向相反。
     这不是笔误：Bull 是"市场状态"标签，不是"今天涨了"。
     若要改成与涨跌一致（看涨=红），改这两行即可，全站生效。 */
  --bull: #1f9d68;
  --bear: #d24b59;

  /* 信号等级 L1~L4：绿→黄→橙→红，级别越高越紧急 */
  --l1: #28a875;
  --l2: #e1a326;
  --l3: #e66f32;
  --l4: #c13f52;
}

/* ---- 基础排版：九个页面原本也各写一遍 ---- */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Microsoft YaHei", sans-serif;
  /* tnum：等宽数字。金额列不对齐会看得很难受。 */
  font-feature-settings: "tnum" 1, "cv01" 1;
}

/* 涨跌语义类，配合 sign() 使用 */
.pos { color: var(--up); }
.neg { color: var(--down); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }

/* Asset workspace surfaces */
:root {
--ink:var(--txt);--blue:var(--accent);--green:var(--up);
--aw-color-0:#fff;
--aw-color-1:#1d4dcd;
--aw-color-2:#22334a;
--aw-color-3:#265cec;
--aw-color-4:#28a98b;
--aw-color-5:#42618d;
--aw-color-6:#4268a8;
--aw-color-7:#647286;
--aw-color-8:#6f8eed;
--aw-color-9:#7b8799;
--aw-color-10:#8190a4;
--aw-color-11:#8190a7;
--aw-color-12:#8290a4;
--aw-color-13:#8895a8;
--aw-color-14:#8a96a7;
--aw-color-15:#8a96a9;
--aw-color-16:#8b97a9;
--aw-color-17:#94a0b0;
--aw-color-18:#97a0ae;
--aw-color-19:#9daed3;
--aw-color-20:#a8bfff;
--aw-color-21:#aa7627;
--aw-color-22:#b7c7e9;
--aw-color-23:#b9c9f7;
--aw-color-24:#dce3ef;
--aw-color-25:#e5f5ed;
--aw-color-26:#eaf0fb;
--aw-color-27:#eaf7f1;
--aw-color-28:#edf0f5;
--aw-color-29:#edf1f8;
--aw-color-30:#edf2fc;
--aw-color-31:#edf2ff;
--aw-color-32:#edf3ff;
--aw-color-33:#eff4ff;
--aw-color-34:#f0f3f7;
--aw-color-35:#f3f5f8;
--aw-color-36:#f3f5f9;
--aw-color-37:#f3f6fc;
--aw-color-38:#f4f7fb;
--aw-color-39:#f4f7ff;
--aw-color-40:#f6f8fc;
--aw-color-41:#f8faff;
--aw-color-42:#fafbfd;
--aw-color-43:#fff6e5;
--aw-color-44:#18314a20;
--aw-color-45:#192b4420;
}

/* OTC research: compact controls and contained horizontal scrolling. */
.otc-heading{display:flex;align-items:baseline;gap:12px;padding:0 16px}
#tabs{max-width:100%;min-width:0;overflow-x:auto;box-sizing:border-box}
.otc-heading h3{padding-left:0}
.otc-heading #otcCount{font-size:12px;color:var(--muted)}
.otc-tools button{padding:7px 12px;border:1px solid var(--line);border-radius:8px;color:var(--txt);background:var(--panel);cursor:pointer;font:inherit}
.otc-tools{display:flex;gap:12px;align-items:center;flex-wrap:wrap;padding:0 16px 14px;border-bottom:1px solid var(--line)}
.otc-search{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:12px}
.otc-search input{width:240px;padding:8px 10px;border:1px solid var(--line);border-radius:8px;background:var(--panel);color:var(--txt)}
#otcWatchOnly[aria-pressed=true]{color:var(--accent);border-color:var(--accent);background:var(--panel2)}
.otc-method{margin-left:auto;max-width:680px;font-size:12px;color:var(--muted)}
.otc-method summary{cursor:pointer;padding:7px 0}
.otc-method div{padding:10px 0;line-height:1.8}
#tab-compare .prem-group-body{overflow-x:auto;border:1px solid var(--line);border-radius:9px;overscroll-behavior-x:contain}
#tab-compare .prem-group{margin:0 10px 20px}
#tab-compare .prem-group-title{margin-top:16px}
#tab-compare th:focus-visible,.otc-tools :focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
#tab-compare td{font-variant-numeric:tabular-nums}
@media(max-width:640px){.otc-tools{gap:8px}.otc-search{width:100%}.otc-search input{flex:1;min-width:0}.otc-method{margin-left:0}#tab-compare .prem-group{margin-left:2px;margin-right:2px}#tab-compare .otc-tablebox table th:nth-child(2),#tab-compare .otc-tablebox table td:nth-child(2){min-width:150px;width:150px}}
@media(max-width:640px){.topbar .status{width:100%;overflow-x:auto;white-space:nowrap;gap:8px}.topbar .status>*{flex-shrink:0}}

/* Fund research: a distinct heading and contained table for every category. */
#tab-prem .prem-group,#tab-compare .prem-group{margin:18px 10px 26px;border:1px solid var(--line);border-radius:12px;background:var(--panel);overflow:hidden}
#tab-prem .prem-group-title,#tab-compare .prem-group-title{margin:0;padding:17px 18px;display:flex;align-items:center;gap:12px;background:var(--panel2);border-bottom:1px solid var(--line);font-size:17px;font-weight:700;line-height:1.3;letter-spacing:0}
#tab-prem .prem-group-title:before,#tab-compare .prem-group-title:before{display:none}
.fund-group-label{border-left:4px solid var(--accent);padding-left:10px}
#tab-prem .prem-group-n,#tab-compare .prem-group-n{font-size:12px;font-weight:500;padding:3px 9px;border:1px solid var(--line2);border-radius:20px;background:var(--panel);color:var(--muted)}
#tab-prem .prem-group-body,#tab-compare .prem-group-body{overflow-x:auto;border:0;border-radius:0;overscroll-behavior-x:contain}
#tab-prem .tablebox,#tab-compare .otc-tablebox{overflow:visible}
#tab-prem .tablebox th,#tab-compare .otc-tablebox th{padding:12px 11px;background:var(--panel2);font-size:12px;color:var(--muted);border-bottom:1px solid var(--line2)}
#tab-prem .tablebox td,#tab-compare .otc-tablebox td{padding:9px 11px;font-variant-numeric:tabular-nums}
#tab-prem .tablebox tbody tr:nth-child(even) td,#tab-compare .otc-tablebox tbody tr:nth-child(even) td{background:var(--panel2)}
#tab-prem .tablebox tbody tr:hover td,#tab-compare .otc-tablebox tbody tr:hover td{background:var(--bg2)}
.fund-method{margin:0 20px 12px;color:var(--muted);font-size:12px;line-height:1.7}
.fund-method summary{cursor:pointer;width:fit-content}.fund-method div{padding-top:8px}
@media(max-width:640px){#tab-prem .prem-group,#tab-compare .prem-group{margin:12px 2px 20px}#tab-prem .prem-group-title,#tab-compare .prem-group-title{padding:14px 12px;font-size:16px}}

/* Unified fund scores: one compact column, details on demand. */
/* 不再需要为「收益 61 · 夏普 67 · 回撤 59」那行小字预留宽度 */
.fund-score-cell{text-align:center!important;min-width:84px}.fund-score{border:0;background:transparent;color:var(--muted);cursor:pointer;font-size:12px;padding:2px 9px;border-radius:5px}.fund-score.ready{font-size:18px;font-weight:700;color:var(--accent)}.fund-score:hover{background:var(--bg2)}
#fundScoreDetails{width:min(650px,90vw);max-height:85vh;overflow:auto;padding:24px;border:1px solid var(--line);border-radius:14px;background:var(--panel);color:var(--txt);font:13px/1.7 system-ui}#fundScoreDetails::backdrop{background:rgba(15,23,42,.35)}#fundScoreDetails p{white-space:normal;color:var(--muted);margin:12px 0}#fundScoreDetails h3{margin:0 50px 20px 0}.score-close{float:right}.score-detail-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.score-detail-grid div{padding:12px;background:var(--panel2);border-radius:8px}.score-detail-grid b{display:block;font-size:24px;color:var(--accent)}.score-detail-grid small{display:block;color:var(--muted)}

/* Valuation: keep both PE panels visible and audit details compact. */
#tab-valuation .valuation-charts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
#tab-valuation .valuation-charts .panel { min-width:0; }
#tab-valuation .valuation-charts details > div { max-height:120px; overflow:auto; }
#notionSyncPanel .tablebox { max-height:300px; overflow:auto; }
#notionSyncPanel th, #notionSyncPanel td { padding:6px 8px; }
#notionSyncPanel [data-status] { padding:8px 0; font-weight:600; }
#notionSyncPanel [data-detail] { overflow-x:auto; }
@media(max-width:1000px) { #tab-valuation .valuation-charts { grid-template-columns:1fr; } }

#notionSyncPanel { padding:12px 16px; }
#notionSyncPanel h3 { padding:0; }
#notionSyncPanel .toolbar label { display:inline-flex; align-items:center; gap:6px; }
#notionSyncPanel .toolbar input { min-width:0; width:auto; }
#notionSyncPanel button { border:1px solid var(--line); border-radius:6px; background:var(--panel); color:var(--txt); padding:5px 9px; cursor:pointer; }
#notionSyncPanel button:hover { border-color:var(--accent); color:var(--accent); }
#notionSyncPanel td:nth-child(1), #notionSyncPanel td:nth-child(3), #notionSyncPanel td:nth-child(4) { text-align:left; }

/* Notion research review: local table scrolling, explicit provenance and readable warnings. */
#notionSyncPanel{padding:22px;min-width:0;color:var(--txt)}
#notionSyncPanel .ns-heading{display:flex;justify-content:space-between;align-items:center;gap:16px}
#notionSyncPanel .ns-eyebrow{font-size:12px;letter-spacing:.08em;color:var(--muted)}
#notionSyncPanel h3,#notionSyncPanel h4{margin:6px 0 12px;padding:0;font-size:20px;color:var(--txt)}
#notionSyncPanel h5{font-size:15px;margin:0 0 12px}
#notionSyncPanel [data-status]{color:var(--muted);font-size:13px;font-weight:400}
#notionSyncPanel .ns-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:14px 0 20px}
#notionSyncPanel .ns-stats>div{padding:14px 18px;border:1px solid var(--line);border-radius:10px;background:var(--panel2)}
#notionSyncPanel .ns-stats span,#notionSyncPanel .ns-sentiment span{display:block;font-size:13px;color:var(--muted)}
#notionSyncPanel .ns-stats strong{font-size:26px;font-weight:600;line-height:1.6}
#notionSyncPanel .ns-toolbar,#notionSyncPanel .ns-actions{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin:12px 0}
#notionSyncPanel label{display:inline-flex;align-items:center;gap:8px;font-size:14px}
#notionSyncPanel input{width:auto;min-width:0;padding:7px;border:1px solid var(--line);border-radius:6px;background:var(--panel);color:var(--txt)}
#notionSyncPanel button{padding:8px 12px;font-size:13px;line-height:1.4}
#notionSyncPanel button:disabled{opacity:.5;cursor:wait}
#notionSyncPanel button.ns-primary{background:var(--accent);color:var(--panel);border-color:var(--accent)}
#notionSyncPanel :focus-visible{outline:2px solid var(--accent);outline-offset:2px}
#notionSyncPanel .ns-tools{margin-left:auto;font-size:13px}
#notionSyncPanel summary{cursor:pointer;padding:8px 0;color:var(--txt);font-weight:600}
#notionSyncPanel .ns-table{overflow:auto;max-width:100%;border:1px solid var(--line);border-radius:8px}
#notionSyncPanel [data-jobs]{max-height:330px;border:0}
#notionSyncPanel table{font-size:14px;color:var(--txt);width:100%;white-space:nowrap}
#notionSyncPanel th,#notionSyncPanel td{padding:11px 14px;text-align:right;line-height:1.55;font-variant-numeric:tabular-nums}
#notionSyncPanel th{color:var(--muted);font-size:12px;background:var(--panel2);cursor:default}
#notionSyncPanel th:first-child,#notionSyncPanel td:first-child{text-align:left}
#notionSyncPanel [data-jobs] td{text-align:left}
#notionSyncPanel small{display:block;color:var(--muted);font-size:12px;font-weight:400}
#notionSyncPanel summary small,#notionSyncPanel h5 small{display:inline;margin-left:8px}
#notionSyncPanel .ns-badge{display:inline-block;padding:3px 8px;border-radius:5px;background:var(--panel2);color:var(--muted);font-size:13px}
#notionSyncPanel .ns-ok{color:var(--accent);border:1px solid var(--line)}
#notionSyncPanel .ns-job-error{max-width:430px;white-space:normal}
#notionSyncPanel .ns-detail{border-top:2px solid var(--line);margin-top:22px;padding-top:22px}
#notionSyncPanel .ns-dates{display:flex;flex-wrap:wrap;gap:24px;font-size:13px;color:var(--muted)}
#notionSyncPanel .ns-dates b{margin-left:8px;color:var(--txt)}
#notionSyncPanel .ns-explanation,#notionSyncPanel .ns-empty{font-size:13px;color:var(--muted);line-height:1.7;white-space:normal}
#notionSyncPanel .ns-notice{border-left:3px solid var(--warn);background:var(--panel2);padding:12px 16px;margin:16px 0;font-size:14px}
#notionSyncPanel li{white-space:normal;line-height:1.8;color:var(--txt);font-size:14px}
#notionSyncPanel .ns-section{border-top:1px solid var(--line);margin-top:16px;padding-top:12px}
#notionSyncPanel .ns-sentiment{display:flex;flex-wrap:wrap;gap:24px;background:var(--panel2);border-radius:8px;padding:16px;margin-top:16px}
#notionSyncPanel .ns-sentiment strong{font-size:23px;line-height:1.7}
#notionSyncPanel .ns-sentiment p{flex:1;min-width:180px;white-space:normal;color:var(--muted);font-size:13px;line-height:1.8}
#notionSyncPanel .ns-images img{display:block;width:100%;height:auto;margin:16px 0;border:1px solid var(--line);border-radius:6px}
#notionSyncPanel pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:13px;max-height:400px;overflow:auto}
#notionSyncPanel .ns-error{color:var(--bear)}
@media(max-width:640px){#notionSyncPanel{padding:14px}#notionSyncPanel .ns-stats{gap:7px}#notionSyncPanel .ns-stats>div{padding:10px}#notionSyncPanel .ns-tools{margin-left:0}#notionSyncPanel summary small{display:block;margin-left:0}#notionSyncPanel .ns-actions button{flex:1}#notionSyncPanel .ns-dates{gap:8px}}

#notionSyncPanel .ns-section .ns-table{max-height:420px}
#notionSyncPanel .ns-section .ns-table th{position:sticky;top:0;z-index:1}

/* Valuation workspace: one primary metric, concise source comparison, quiet charts. */
:root{--val-pe:#3568c8;--val-notion:#168879;--val-point:#a0abba;--val-wash:rgba(53,104,200,.07)}
#tab-valuation .valuation-stack{gap:22px;margin-top:22px}
#tab-valuation .valuation-row{border-radius:16px;border:1px solid var(--line);box-shadow:0 3px 14px rgba(28,35,48,.025)}
#tab-valuation .valuation-row-head{padding:22px 24px 16px;align-items:center;border-bottom:1px solid var(--line)}
#tab-valuation .val-kicker{display:block;font-size:11px;letter-spacing:.13em;font-weight:600;color:var(--muted);margin-bottom:7px}
#tab-valuation .valuation-row-head h3{font-size:19px;letter-spacing:-.025em;font-weight:650}
#tab-valuation .valuation-row-head h3 em{font-size:14px;color:var(--muted);font-style:normal;font-weight:400;margin-left:10px;letter-spacing:0}
#tab-valuation .valuation-row-head .sub{font-size:12px;color:var(--muted)}
#tab-valuation .valuation-row-grid{grid-template-columns:minmax(0,1fr) 344px}
#tab-valuation .valuation-row-chart{padding:14px 8px 8px;border-right:1px solid var(--line);min-width:0}
#tab-valuation .valuation-row-chart .chartwrap{padding:0}
#tab-valuation .valuation-row-chart .chart{height:500px}
#tab-valuation .valuation-row-values{display:block;padding:22px 24px;background:var(--panel);min-width:0}
#tab-valuation .val-asof{display:flex;align-items:center;justify-content:space-between;font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}

#tab-valuation .val-details{border-top:1px solid var(--line)}
#tab-valuation .val-detail-row{display:flex;gap:12px;justify-content:space-between;align-items:flex-start;padding-top:14px;font-size:13px}
#tab-valuation .val-detail-row>span{min-width:0;color:var(--muted)}
#tab-valuation .val-detail-row strong{font-size:15px;font-weight:550;font-variant-numeric:tabular-nums;white-space:nowrap;color:var(--txt)}
#tab-valuation .val-detail-row small{display:block;font-size:11px;line-height:1.5;color:var(--faint);margin-top:5px;white-space:normal}
#tab-valuation .val-section-label{display:flex;justify-content:space-between;color:var(--muted);font-size:12px;margin-bottom:6px}
#tab-valuation .val-section-label>span{font-size:10px;color:var(--faint)}
#tab-valuation .val-source-comparison{border-top:1px solid var(--line);padding:14px 0}
#tab-valuation .val-source-row{display:flex;justify-content:space-between;align-items:center;padding:7px 0;font-size:13px}
#tab-valuation .val-source-row strong{font-weight:550;font-variant-numeric:tabular-nums;font-size:16px}
#tab-valuation .val-source-row small{display:block;padding-left:15px;color:var(--faint);font-size:11px;margin-top:3px}
#tab-valuation .val-source-row i{display:inline-block;width:8px;height:3px;margin-right:7px;vertical-align:middle;border-radius:1px}
#tab-valuation .val-key-notion{background:var(--val-notion)}
#tab-valuation .val-key-pe{background:var(--val-pe)}

#tab-valuation .val-coverage{font-size:11px;color:var(--muted);margin:4px 16px 8px;line-height:1.7}
#tab-valuation .val-coverage summary{cursor:pointer;user-select:none}
#tab-valuation .val-coverage>div{max-height:90px;overflow:auto;overflow-wrap:anywhere}
#tab-valuation .val-extra{margin-top:16px;color:var(--muted);font-size:12px}
#tab-valuation .val-extra summary{cursor:pointer}
.val-tip-date{font-size:12px;color:var(--muted);border-bottom:1px solid var(--line);padding-bottom:8px;margin-bottom:8px}
.val-tip-row{display:flex;align-items:center;justify-content:space-between;gap:22px;line-height:1.9;font-size:12px}
.val-tip-row b{font-weight:600;font-variant-numeric:tabular-nums}
.val-tip-pe{color:var(--val-pe)}
.val-tip-notion{color:var(--val-notion)}
.val-tip-note{font-size:11px;color:var(--faint);margin-top:7px}
@media(max-width:1000px){#tab-valuation .valuation-row-grid{grid-template-columns:minmax(0,1fr) 300px}#tab-valuation .valuation-row-values{padding:20px 18px}#tab-valuation .valuation-row-head .sub{display:none}}
@media(max-width:760px){#tab-valuation .valuation-row-grid{grid-template-columns:minmax(0,1fr)}#tab-valuation .valuation-row-head{padding:18px}#tab-valuation .valuation-row-chart{border-right:0;border-bottom:1px solid var(--line);padding:10px 0}#tab-valuation .valuation-row-chart .chart{height:400px}#tab-valuation .valuation-row-values{padding:20px}#tab-valuation .valuation-row-head h3{font-size:17px}}

#tab-valuation .val-source-empty{margin:6px 0 0;font-size:13px;color:var(--muted)}

/* 估值页：页头「数据条」—— 主值 / 分位口径 / 数据截止 */
#tab-valuation .val-databar{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px 18px;margin:0 0 16px;padding:11px 16px;
  border:1px solid var(--line);border-radius:12px;background:var(--panel);font-size:12px;color:var(--muted)}
#tab-valuation .val-databar>b{font-size:15px;color:var(--txt)}
#tab-valuation .val-databar .val-db-item{display:inline-flex;align-items:baseline;gap:7px}
#tab-valuation .val-databar .val-db-item i{font-style:normal;color:var(--muted)}
#tab-valuation .val-databar .val-db-item strong{font-size:17px;color:var(--txt);letter-spacing:-.02em}
#tab-valuation .val-databar .val-db-item em{font-style:normal;color:var(--muted)}
#tab-valuation .val-databar .val-db-win{margin-left:auto}
#tab-valuation .val-databar .val-db-asof{order:1;width:100%;color:var(--muted)}
#tab-valuation .val-databar .val-db-asof u{text-decoration:none;color:var(--txt)}
#tab-valuation .val-databar .val-db-asof.is-old{color:#b4453a}
#tab-valuation .val-databar.is-stale{border-color:#e3b8b3;background:#fdf7f6}
#tab-valuation .val-databar .val-db-warn{color:#b4453a}

/* 估值页：图表加载 / 失败态角标（图不重画时也要能看出"这份是不是新的"） */
#tab-valuation .valuation-row-chart{position:relative}
#tab-valuation .valuation-row-chart .chartwrap{transition:opacity .15s}
#tab-valuation .valuation-row-chart.is-loading .chartwrap{opacity:.45}
#tab-valuation .valuation-row-chart.is-loading::after,
#tab-valuation .valuation-row-chart.is-stale::after{position:absolute;top:10px;right:16px;z-index:5;
  font-size:11px;padding:4px 9px;border-radius:999px;pointer-events:none}
#tab-valuation .valuation-row-chart.is-loading::after{content:"加载中…";color:var(--muted);background:var(--val-wash)}
#tab-valuation .valuation-row-chart.is-stale::after{content:"数据未更新 · 下方为上一次结果";color:#b4453a;background:#fdf1ef;
  border:1px solid #e3b8b3}
/* 右侧面板同理：失败后面板里的值来自上一次成功响应（悬停还会按旧数据重画），也得挂角标 */
#tab-valuation .valuation-row-values{position:relative}
#tab-valuation .valuation-row-values.is-stale::after{content:"上一次结果 · 本次读取失败";position:absolute;top:10px;right:12px;z-index:5;
  font-size:11px;padding:4px 9px;border-radius:999px;pointer-events:none;color:#b4453a;background:#fdf1ef;border:1px solid #e3b8b3}

/* ---- 估值页 TTM：两套来源（作者日频 / 蛋卷）同构并列（2026-09-24）----
   原来是「一个大号主值 + 旁边一行小字对照」，看着只有一套数据；现在换成两块结构完全
   对称的块：左边来源名 + 口径小字，右边大号 PE，下面一条分位条 + 本站分位。
   颜色与图上曲线一一对应：作者日频 = --val-pe（蓝），蛋卷 = --val-notion（青）。 */
#tab-valuation .val-key-author{background:var(--val-pe)}
#tab-valuation .val-key-danjuan{background:var(--val-notion)}
#tab-valuation .val-cmp{border-top:1px solid var(--line);padding:15px 0 3px}
#tab-valuation .val-cmp-head{display:flex;align-items:baseline;gap:10px}
#tab-valuation .val-cmp-head>span{flex:1;min-width:0;font-size:13.5px;color:var(--txt)}
#tab-valuation .val-cmp-head>span small{display:block;font-size:11px;line-height:1.45;color:var(--faint);margin-top:3px}
#tab-valuation .val-cmp-head>span i{display:inline-block;width:8px;height:3px;margin-right:7px;vertical-align:middle;border-radius:1px}
#tab-valuation .val-cmp-head>strong{font-size:34px;line-height:1;font-weight:600;letter-spacing:-.04em;font-variant-numeric:tabular-nums}
#tab-valuation .val-cmp-head>em{font-size:12px;font-style:normal;color:var(--muted)}
#tab-valuation .val-cmp.is-author .val-cmp-head>strong{color:var(--val-pe)}
#tab-valuation .val-cmp.is-danjuan .val-cmp-head>strong{color:var(--val-notion)}
#tab-valuation .val-cmp.is-missing .val-cmp-head>strong{color:var(--muted)}
#tab-valuation .val-cmp-pcts{display:flex;flex-direction:column;gap:7px;margin-top:11px}
#tab-valuation .val-cmp-pct{display:flex;align-items:center;gap:10px}
#tab-valuation .val-cmp-bar{flex:1;height:6px;border-radius:2px;background:var(--line);overflow:hidden}
#tab-valuation .val-cmp-bar i{display:block;height:100%;border-radius:2px;background:var(--val-pe)}
#tab-valuation .val-cmp.is-danjuan .val-cmp-bar i{background:var(--val-notion)}
#tab-valuation .val-cmp-pct>b{font-size:15px;font-weight:600;font-variant-numeric:tabular-nums;min-width:46px;text-align:right}
#tab-valuation .val-cmp-bar.is-all i{opacity:.45}
#tab-valuation .val-cmp-pct>span{font-size:11px;color:var(--faint);white-space:nowrap}
/* 悬停条里的分位小行：跟着上一行的来源走，缩进 + 弱化 */
.val-tip-sub span{padding-left:10px;color:var(--faint)}
.val-tip-sub b{font-weight:500;color:var(--muted)}
@media(max-width:1000px){#tab-valuation .val-cmp-head>strong{font-size:27px}}

/* 估值页普通字体整体 +1 号（2026-09-25，用户反馈"普通字体太小"）：
   上面 #tab-valuation / #notionSyncPanel 范围内 9~14px 的字号统一加大一号；
   页面顶部那几个控件用的是全站公共样式（标题副标 / 区间按钮 / 下拉），
   只在本页覆盖，避免影响其它页。大号展示数字（PE 大值、分位百分数）不动。 */
#tab-valuation .panel .sub{font-size:13px}
#tab-valuation .rbtn{font-size:13.5px}
#tab-valuation select{font-size:14px}
#tab-valuation table{font-size:13.5px}

/* 右侧三块与主图三条线一一对应（2026-09-25）：指数点位（灰）/ 作者日频 PE（蓝）/ 蛋卷 PE（青），
   两个 PE 下面各两条分位（区间 / 全历史）。 */
#tab-valuation .val-key-point{background:var(--val-point)}
#tab-valuation .val-cmp.is-point .val-cmp-head>strong{color:var(--txt)}
#tab-valuation .val-cmp-pct>span.k{font-size:11px;color:var(--faint);flex:none;width:112px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#tab-valuation .val-cmp.is-point .val-cmp-head>span{font-size:12.5px}

/* 指数点位：背景信息，压成一行（22px 灰），不再跟 PE 抢 34px 大号数字（2026-09-25） */
#tab-valuation .val-point-row{display:flex;align-items:baseline;gap:8px;padding:4px 0 13px}
#tab-valuation .val-point-row>span{flex:1;min-width:0;font-size:12.5px;color:var(--txt)}
#tab-valuation .val-point-row>span small{display:block;font-size:11px;color:var(--faint);margin-top:2px}
#tab-valuation .val-point-row>strong{font-size:22px;font-weight:600;letter-spacing:-.02em;font-variant-numeric:tabular-nums;color:var(--txt)}
#tab-valuation .val-point-row>em{font-size:11px;font-style:normal;color:var(--muted)}

/* 前瞻块：图上那条 Forward PE 用的是 --val-pe，颜色保持一致（2026-09-25） */
#tab-valuation .val-key-fwd{background:var(--val-pe)}
#tab-valuation .val-cmp.is-fwd .val-cmp-head>strong{color:var(--val-pe)}

/* Native valuation legend shares the indicator caption layout. */
:root { --valuation-pe:#2563eb; --valuation-rank:#d97706; --valuation-event:#7c3aed; --pane-separator:var(--line); --pane-separator-hover:#93b5ec; --pane-grid:#edf1f7; }
.valuation-pe { color:var(--valuation-pe); } .valuation-rank { color:var(--valuation-rank); }
#stockValuationPanel { display:flex; align-items:center; gap:8px; right:calc(var(--plot-right,0px) + 5px); pointer-events:none; overflow:hidden; white-space:nowrap; font-size:11px; }
#stockValuationPanel[hidden] { display:none; }
#stockValuationPanel select,#stockValuationPanel label { pointer-events:auto; }
#stockValuationPanel > select { flex:none; }
#stockValuationPanel .native-valuation-note { overflow:hidden; text-overflow:ellipsis; min-width:0; }
#stockValuationPanel select[hidden] { display:none; }
#stockValuationPanel select { font-size:11px; color:var(--txt); background:var(--panel); border:1px solid var(--line); border-radius:3px; padding:0 3px; height:20px; }
#stockValuationPanel label { display:inline-flex; align-items:center; gap:3px; font-weight:400; flex:none; cursor:pointer; }
#stockValuationReadout { overflow:hidden; text-overflow:ellipsis; min-width:0; }
.native-valuation-note { color:var(--muted); font-weight:400; }
.native-valuation-report { position:absolute; bottom:36px; right:78px; max-width:min(580px,80%); z-index:20; padding:12px 32px 12px 12px; font-size:12px; line-height:1.6; border:1px solid var(--line); border-radius:6px; background:var(--panel); box-shadow:0 3px 14px #0002; }
.native-valuation-report[hidden] { display:none; }
.native-valuation-report button { position:absolute; top:3px; right:5px; border:0; background:none; color:var(--muted); cursor:pointer; font-size:20px; }


/* Stock workspace: consistent panel captions, readouts, and visible-range extrema. */
.lw-workspace { --pane-caption-bg:rgba(255,255,255,.93); --pane-tip-bg:var(--chart-tip-bg); --pane-tip-shadow:var(--chart-tip-shadow); }
.lw-workspace .toolbar { background:var(--panel2); border-bottom:1px solid var(--line); gap:4px; padding-top:5px; padding-bottom:5px; }
.lw-workspace .toolbar .tbtn { border-radius:6px; }
.lw-workspace .toolbar .grp-label { font-size:11px; color:var(--muted); }
.lw-workspace .charthead { border-bottom:1px solid var(--line); }
.lw-workspace .head-metrics { font-variant-numeric:tabular-nums; }
.lw-workspace .subcap { background:var(--pane-caption-bg); border-radius:4px; padding:2px 6px; font-size:11.5px; line-height:1.55; }
.lw-workspace .subcap .lbl { letter-spacing:.015em; }
.lw-workspace .subcap .v { font-weight:550; }
.lw-workspace #stockValuationPanel { gap:7px; }
.lw-workspace #stockValuationPanel .lbl { margin-right:0; }
.lw-workspace .valuation-pe-value { color:var(--valuation-pe); font-size:12px; font-weight:650; }
.lw-workspace .valuation-secondary { color:var(--muted); font-weight:450; }
.lw-workspace .native-valuation-note { font-size:10px; border:1px solid var(--line); padding:0 4px; border-radius:4px; }
.lw-workspace .ch-tip { max-width:calc(100% - var(--plot-left,0px) - var(--plot-right,0px) - 12px); background:var(--pane-tip-bg); border-color:var(--line2); box-shadow:var(--pane-tip-shadow); font-size:12px; z-index:7; }
.lw-workspace .ch-tip-sub { padding:3px 8px; }
.lw-workspace .ch-tip-sub strong { font-weight:650; }
.lw-workspace .ch-secondary { font-size:11px; color:var(--muted); }
.lw-workspace .ch-tip .ch-time { color:var(--muted); border-color:var(--line); font-weight:500; }
.pane-extrema-layer { position:absolute; left:var(--plot-left,0px); right:var(--plot-right,0px); pointer-events:none; z-index:4; overflow:hidden; --extreme-color:var(--accent); }
.pane-extrema-layer[hidden] { display:none; }
.pane-extreme { position:absolute; display:block; padding:1px 5px; border:1px solid var(--line); border-radius:4px; background:var(--pane-caption-bg); color:var(--txt); font:500 10.5px/16px system-ui,'Segoe UI',Arial,sans-serif; white-space:nowrap; font-variant-numeric:tabular-nums; }
.pane-extreme-dot { position:absolute; width:6px; height:6px; transform:translate(-50%,-50%); border-radius:50%; background:var(--extreme-color); box-shadow:0 0 0 2px var(--panel); }
@media(max-width:900px) { .lw-workspace .subcap { font-size:11px; } .lw-workspace #stockValuationPanel { gap:5px; } .lw-workspace .ch-secondary { font-size:10.5px; } }

/* Chart workspace palette; financial up/down semantics elsewhere are unchanged. */
:root{--chart-up:#089981;--chart-down:#f06469;--chart-grid:#edf0f4;--chart-drawing:#6682aa;--chart-drawing-fill:rgba(49,95,206,.035);}

/* Strategy state backgrounds, shared by workbench parameter tables. */
:root{--state-low-bg:#f0faf6;--state-ml-bg:#f4f8fe;--state-mh-bg:#fffdf3;--state-h-bg:#fff7f0;--state-vh-bg:#fff3f3;}
