/* 投资网页：颜色、字号、间距、组件照样稿 B3 第三版和小程序 pkg-invest 那份样式（一个值不改）。
   桌面：左边窄导航 + 内容区（最宽 1200）；手机宽度：和小程序一样的单列 + 底栏。
   深浅：跟随系统；<html data-theme="light|dark"> 手动指定。红涨绿跌（--up 红、--down 绿）。 */

:root {
  --canvas: #F2F2EF; --card: #FFFFFF; --fill: #EBEBE7; --sep: #E3E3DF;
  --text1: #16171A; --text2: #4E5055; --text3: #696B70;
  --up: #C23A2E; --down: #127548; --attn: #8C6416;
  --bench: rgba(105,107,112,.7); --grid: #D3D3CE; --sel: #F4F4F1;
  --scrim: rgba(0,0,0,.28);
  --sheet: #F2F2EF; --sheet-card: #FFFFFF; --sheet-sep: #E3E3DF;
  --hover: rgba(22,23,26,.04);
  --shadow: 0 1px 0 rgba(0,0,0,.02);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  --ox: 20px;      /* 卡片外的文字（标题、大数字）离边 */
  --cx: 16px;      /* 卡片离边 */
  --top: 44px;     /* 手机顶栏 */
  --tabh: 49px;    /* 手机底栏 */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --canvas: #111214; --card: #202124; --fill: #28292D; --sep: #2F3034;
    --text1: #F2F2EF; --text2: #A9AAAE; --text3: #8A8C91;
    --up: #E8685C; --down: #4CB884; --attn: #D4A55E;
    --bench: rgba(138,140,145,.7); --grid: #34363B; --sel: #28292D;
    --scrim: rgba(0,0,0,.5);
    --sheet: #202124; --sheet-card: #28292D; --sheet-sep: #37393E;
    --hover: rgba(242,242,239,.04);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --canvas: #111214; --card: #202124; --fill: #28292D; --sep: #2F3034;
  --text1: #F2F2EF; --text2: #A9AAAE; --text3: #8A8C91;
  --up: #E8685C; --down: #4CB884; --attn: #D4A55E;
  --bench: rgba(138,140,145,.7); --grid: #34363B; --sel: #28292D;
  --scrim: rgba(0,0,0,.5);
  --sheet: #202124; --sheet-card: #28292D; --sheet-sep: #37393E;
  --hover: rgba(242,242,239,.04);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--canvas); }
body {
  min-height: 100vh; background: var(--canvas); color: var(--text1);
  font-family: var(--sans); font-size: 15px; line-height: 22px;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-align: inherit; -webkit-tap-highlight-color: transparent; }
input { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--text2); outline-offset: 2px; border-radius: 6px; }
button:disabled { cursor: default; }
.pr:active, button.row:active, a.row:active, .mrow:active, .pill:active, .acard:active { opacity: .6; }

/* 涨跌色只在少数位置出现；最高优先级（红涨绿跌） */
.tu { color: var(--up) !important; }
.td { color: var(--down) !important; }
.t2 { color: var(--text2); }
.t3 { color: var(--text3); }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ============ 外框：桌面左导航 / 手机顶栏 + 底栏 ============ */
.shell { display: flex; min-height: 100vh; }
.side { display: none; }
.main { flex: 1; min-width: 0; }
.page { padding: calc(var(--top) + env(safe-area-inset-top) + 12px) 0 calc(var(--tabh) + env(safe-area-inset-bottom) + 40px); }
.page.is-sub { padding-bottom: calc(env(safe-area-inset-bottom) + 40px); }

.topbar { position: fixed; left: 0; right: 0; top: 0; z-index: 10; padding-top: env(safe-area-inset-top); background: var(--canvas); }
.topbar .in { position: relative; height: var(--top); display: flex; align-items: center; justify-content: center; }
.topbar .tt { display: flex; flex-direction: column; align-items: center; }
.topbar .ttl { font-size: 17px; line-height: 24px; font-weight: 600; }
.topbar .stamp { font-size: 11px; line-height: 13px; color: var(--text3); margin-top: 1px; }
.tb-btn { position: absolute; top: 0; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--text1); }
.tb-btn.l { left: 4px; }
.tb-btn.r { right: 4px; }
.tb-btn svg { stroke: currentColor; fill: none; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; height: calc(var(--tabh) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); display: flex; background: var(--canvas); box-shadow: inset 0 .5px 0 var(--sep); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text3); font-size: 10px; line-height: 12px; font-weight: 500; }
.tab svg { width: 24px; height: 24px; margin-bottom: 3px; }
.tab[aria-current="page"] { color: var(--text1); }
.ico { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ico .fl { fill: currentColor; }
.ico .cv { stroke: var(--canvas); }

/* ============ 通用（B3） ============ */
.opn { padding: 0 var(--ox); }
.lbl { font-size: 13px; line-height: 18px; color: var(--text2); font-weight: 400; }
.sub { font-size: 13px; line-height: 18px; color: var(--text2); }
.dot { display: inline-block; flex: none; width: 6px; height: 6px; border-radius: 3px; background: var(--text3); }
.dot.attn { background: var(--attn); }
.mod { margin-top: 32px; }
.sec-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 0 var(--ox); margin-bottom: 12px; }
.sec-h h2 { font-size: 17px; line-height: 24px; font-weight: 600; }
.sec-h h3 { font-size: 15px; line-height: 22px; font-weight: 600; }
.sec-h .m { font-size: 13px; line-height: 18px; color: var(--text2); white-space: nowrap; }
.cap-h { display: flex; justify-content: space-between; align-items: center; padding: 0 var(--ox); margin-bottom: 8px; min-height: 18px; }
.cap-h h2 { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--text2); }
.cap-h .m { font-size: 13px; line-height: 18px; color: var(--text3); display: inline-flex; align-items: center; gap: 6px; }
.cap-h .lnk { height: 44px; margin: -13px -8px -13px 0; padding: 0 8px; display: flex; align-items: center; font-size: 13px; font-weight: 500; color: var(--text1); }
.yr { padding: 0 var(--ox); margin: 0 0 8px; font-size: 13px; line-height: 18px; color: var(--text2); }
.cd + .yr { margin-top: 20px; }
.cd { margin: 0 var(--cx); background: var(--card); border-radius: 14px; overflow: hidden; }

/* 列表行：同类行之间是左缩进 16 的发丝线 */
.row { position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 16px; width: 100%; text-align: left; }
.row.two { min-height: 64px; }
.row + .row::before, .grid2 + .row::before, .grid4 + .row::before, .pp-metrics + .row::before, .only-m > .row + .row::before, .alloc + .row::before, .mrow + .mrow::before, .rule + .rule::before, .addrow + .row::before {
  content: ''; position: absolute; left: 16px; right: 0; top: 0; height: .5px; background: var(--sep);
}
.row .l { flex: 1; min-width: 0; }
.row .l > b { display: block; font-size: 15px; line-height: 22px; font-weight: 400; }
.row .l > small { display: block; font-size: 13px; line-height: 18px; color: var(--text2); }
.row .r { flex: none; text-align: right; }
.row .r > b { display: block; font-size: 15px; line-height: 22px; font-weight: 500; }
.row .r > small { display: block; font-size: 13px; line-height: 18px; color: var(--text2); }
.row.tot .l > b, .row.tot .r > b { font-weight: 600; }
.row.txt .r > b { font-weight: 400; }
.row.tkl .l > b { font-weight: 500; }
.row[aria-current="true"] { background: var(--sel); }
.row[aria-current="true"] small, .row[aria-current="true"] .t3 { color: var(--text2) !important; }
.row[aria-current="true"]::before, .row[aria-current="true"] + .row::before { opacity: 0; }
.cd.mixed > .row:not(button)::after { content: ''; flex: none; width: 3px; }
.chev { flex: none; width: 7px; height: 12px; margin-left: -4px; stroke: var(--text3); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ev-dot { display: flex; align-items: center; gap: 10px; }
.tk { font-size: 17px; line-height: 24px; font-weight: 600; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 16px; padding: 16px; }
.grid2 .val, .grid4 .val { margin-top: 4px; font-size: 20px; line-height: 26px; font-weight: 600; letter-spacing: -.2px; }
.grid2 .ann, .grid4 .ann { margin-top: 2px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr .78fr; gap: 12px; padding: 16px; }
.grid3 .val { margin-top: 4px; font-size: 17px; line-height: 24px; font-weight: 600; letter-spacing: -.2px; }
.info { display: flex; align-items: center; gap: 4px; position: relative; line-height: 18px; }
.info::after { content: ''; position: absolute; inset: -13px -10px; }
.info svg { width: 12px; height: 12px; flex: none; }

/* 状态提示条 */
.note { display: flex; align-items: center; gap: 12px; margin: 0 var(--cx) 20px; padding: 12px 16px; background: var(--fill); border-radius: 12px; }
.note > .dot { align-self: flex-start; margin-top: 8px; }
.note .t { flex: 1; min-width: 0; }
.note .t b { display: block; font-size: 15px; line-height: 22px; font-weight: 500; }
.note .t span { display: block; font-size: 13px; line-height: 18px; color: var(--text2); }
.note .retry { flex: none; height: 44px; margin: -11px -8px; padding: 0 8px; font-size: 15px; font-weight: 600; color: var(--text1); }
.note .retry:disabled { color: var(--text2); font-weight: 400; }

.empty-blk { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--text2); font-size: 15px; line-height: 22px; }
.empty-blk small { display: block; font-size: 13px; line-height: 18px; color: var(--text3); margin-top: 4px; }
.foot { margin-top: 32px; padding: 0 var(--ox); font-size: 12px; line-height: 17px; color: var(--text3); }

/* 区间：胶囊 */
.pills { display: flex; gap: 4px; padding: 0 calc(var(--ox) - 12px); margin-top: 4px; }
.pill { height: 44px; display: flex; align-items: center; }
.pill span { display: flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--text2); }
.pill[aria-pressed="true"] span { background: var(--fill); color: var(--text1); }
.pills.even { justify-content: space-between; padding: 0 calc(var(--ox) - 8px); gap: 0; }
.pills.even .pill span { padding: 0 10px; }

/* 图：SVG，按容器宽度画；按住（鼠标悬停）出十字线 */
.chart-box { padding: 0 var(--ox); }
.chart { position: relative; width: 100%; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.chart svg { width: 100%; overflow: visible; }
.chart text { font-family: var(--sans); font-variant-numeric: tabular-nums; }
.c-base { stroke: var(--grid); stroke-width: 1; stroke-dasharray: 2 3; fill: none; }
.c-tick { fill: var(--text3); font-size: 11px; }
.c-main { stroke: var(--text1); stroke-width: 2; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.c-bench { stroke: var(--bench); stroke-width: 1; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.c-dot { fill: var(--text1); }
.c-lab1 { font-size: 12px; font-weight: 600; fill: var(--text1); }
.c-lab2 { font-size: 11px; fill: var(--text2); }
.c-lab1.b, .c-lab2.b { fill: var(--text3); }
.c-x { stroke: var(--text2); stroke-width: 1; }
.c-xm { fill: var(--text1); stroke: var(--canvas); stroke-width: 1.5; }
.c-xb { fill: var(--canvas); stroke: var(--text3); stroke-width: 1.5; }
.spk path { stroke: var(--text2); stroke-width: 1.25; fill: none; stroke-linejoin: round; stroke-linecap: round; }

/* ============ 总览 ============ */
.display { display: flex; align-items: baseline; margin-top: 4px; line-height: 48px; font-weight: 600; white-space: nowrap; }
.display .ccy { font-size: 17px; font-weight: 500; color: var(--text2); margin-right: 4px; }
.display .int { font-size: 40px; letter-spacing: -.6px; }
.display .dec { font-size: 28px; letter-spacing: -.3px; }
.chg { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; min-height: 22px; font-size: 15px; line-height: 22px; font-weight: 500; white-space: nowrap; }
.chg .when { font-size: 13px; font-weight: 400; color: var(--text3); display: inline-flex; align-items: center; gap: 6px; }
.chg .when + .when { margin-left: 4px; }
.chg .nw { font-weight: 400; }
.chg.reading { font-weight: 400; color: var(--text2); gap: 12px; }
.chg.reading b { font-weight: 500; color: var(--text1); }
.chg.reading .d { font-size: 13px; color: var(--text3); }
.chg .dly { display: inline-flex; align-items: center; height: 16px; padding: 0 5px; border-radius: 4px; background: var(--fill); color: var(--text2); font-size: 11px; line-height: 16px; font-weight: 500; }
.rd-row { display: flex; gap: 12px; min-height: 18px; white-space: nowrap; }
.rd-row b { color: var(--text1); font-weight: 500; }

.alloc { display: block; width: 100%; padding: 16px; text-align: left; }
.alloc .top { display: flex; justify-content: space-between; font-size: 13px; line-height: 18px; color: var(--text2); }
.alloc .top b { font-weight: 500; color: var(--text1); margin-left: 4px; }
.alloc .bar { display: flex; gap: 2px; height: 4px; margin-top: 8px; }
.alloc .bar i { display: block; height: 4px; border-radius: 2px; background: var(--text1); }
.alloc .bar i + i { background: var(--text3); }
.alloc .say { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 13px; line-height: 18px; color: var(--text2); }

.ov-head { display: block; }
.ov-chart { margin-top: 24px; }
.halt { flex: none; height: 44px; margin: -11px -8px; padding: 0 8px; font-size: 15px; font-weight: 600; color: var(--text1); }
.halt:disabled { color: var(--text2); font-weight: 400; }

/* ============ 定投 ============ */
.title { font-size: 22px; line-height: 28px; font-weight: 600; letter-spacing: -.2px; margin-top: 4px; }
.prog { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; }
.prog .dots { display: flex; gap: 10px; }
.prog .dots i { width: 8px; height: 8px; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--grid); }
.prog .dots i.done { background: var(--text1); box-shadow: none; }
.prog .dots i.wait { box-shadow: inset 0 0 0 1.25px var(--attn); }
.prog span { font-size: 13px; line-height: 18px; color: var(--text2); }
.rule { position: relative; display: grid; grid-template-columns: 22px 1fr; padding: 14px 16px; }
.rule > span { color: var(--text3); }
.rule b { display: block; font-weight: 600; }
.rule p { color: var(--text2); margin-top: 2px; }
.txtbtn { flex: none; height: 44px; margin: -4px -8px; padding: 0 8px; display: inline-flex; align-items: center; font-size: 15px; font-weight: 600; color: var(--text1); }

/* ============ 日报 ============ */
.dhead { display: flex; align-items: flex-start; justify-content: space-between; padding: 0 calc(var(--ox) - 12px) 0 var(--ox); }
.dhead .title { margin-top: 0; }
.dhead .arrows { display: flex; margin-top: -8px; }
.dhead .arrow { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }
.dhead .arrow svg { stroke: var(--text1); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dhead .arrow:disabled { opacity: .28; }
.dsub { padding: 0 var(--ox); margin-top: 2px; }
.dsum { margin-top: 24px; }
.dsum .big2 { margin-top: 4px; font-size: 28px; line-height: 34px; font-weight: 600; letter-spacing: -.3px; display: flex; gap: 12px; }
.dsum .line { margin-top: 6px; }
.lead { margin-top: 20px; font-size: 15px; line-height: 22px; }
.mk1 .r { display: flex; align-items: baseline; }
.mk1 .r .p { color: var(--text2); font-weight: 400; }
.mk1 .r .c { width: 80px; font-weight: 500; }
.hi .dt small { margin-left: 8px; font-size: 13px; color: var(--text3); }
.hi .r { display: flex; align-items: baseline; }
.hi .r .a { color: var(--text2); font-weight: 400; }
.hi .r .c { width: 80px; font-weight: 500; }
.row.hol .l > b, .row.hol .r { color: var(--text3); }

/* ============ 行情 ============ */
.mrow { position: relative; display: grid; grid-template-columns: 1fr 56px 104px; gap: 12px; align-items: center; min-height: 64px; padding: 0 16px; width: 100%; text-align: left; cursor: pointer; }
.mrow .nm { min-width: 0; }
.mrow .nm b { display: block; font-size: 15px; line-height: 22px; font-weight: 500; }
.mrow .nm span { display: block; font-size: 13px; line-height: 18px; color: var(--text3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mrow .px { text-align: right; }
.mrow .px b { display: block; font-size: 15px; line-height: 22px; font-weight: 500; }
.mrow .px span { display: block; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--text2); }
.mrow.edit { grid-template-columns: 28px 1fr 104px; cursor: default; }
.mrow[aria-current="true"] { background: var(--sel); }
.mrow[aria-current="true"]::before, .mrow[aria-current="true"] + .mrow::before { opacity: 0; }
.rm { width: 44px; height: 44px; margin-left: -12px; display: flex; align-items: center; justify-content: center; }
.rm i { width: 20px; height: 20px; border-radius: 50%; background: var(--up); display: flex; align-items: center; justify-content: center; }
.rm i::after { content: ''; width: 9px; height: 1.6px; background: #fff; border-radius: 1px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; padding: 16px; }
.stats b { display: block; font-size: 15px; line-height: 22px; font-weight: 500; margin-top: 2px; }
.addrow { display: flex; gap: 8px; align-items: center; padding: 12px 16px 0; }
.addrow input, .search input { flex: 1; min-width: 0; height: 44px; border-radius: 10px; border: 0; background: var(--fill); color: var(--text1); padding: 0 12px; font-size: 15px; outline: none; }
.addrow input { text-transform: uppercase; }
.addrow input::placeholder, .search input::placeholder { text-transform: none; color: var(--text2); }
.sugg { display: flex; flex-wrap: wrap; gap: 0 8px; padding: 4px 16px 8px; }
.sugg button { height: 44px; display: flex; align-items: center; }
.sugg button span { display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: 8px; background: var(--fill); color: var(--text2); font-size: 13px; }
.sugg button b { color: var(--text1); font-weight: 500; }
.search { position: relative; display: flex; align-items: center; margin: 0 var(--cx) 24px; }
.search svg { position: absolute; left: 12px; width: 16px; height: 16px; stroke: var(--text3); fill: none; stroke-width: 1.6; stroke-linecap: round; pointer-events: none; }
.search input { padding-left: 36px; }
.search .clr { position: absolute; right: 4px; height: 44px; padding: 0 10px; font-size: 13px; font-weight: 500; color: var(--text2); }
.sres .tag { flex: none; font-size: 12px; line-height: 16px; color: var(--text3); }

/* 行情详情 */
.qh { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 18px; }
.qh .lbl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qh .qw { margin: -13px -8px -13px 0; font-size: 15px; font-weight: 500; }
.qh .qw:disabled { color: var(--text2); font-weight: 400; }
.qtitle { display: none; }
.qrd { margin-top: 24px; }
.qchart { margin-top: 12px; }
.qempty { height: 200px; margin-top: 12px; }

/* 骨架：第一次打开、走势还在取 */
.sk { background: var(--fill); border-radius: 6px; animation: sk 1.6s ease-in-out infinite; }
@keyframes sk { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
.sk-l { width: 64px; height: 12px; margin-top: 3px; }
.sk-big { width: 188px; height: 34px; margin-top: 12px; border-radius: 8px; }
.sk-s { width: 148px; height: 12px; margin-top: 14px; }
.sk-chart { height: 180px; margin: 24px var(--ox) 0; border-radius: 10px; background: var(--fill); opacity: .55; animation: sk 1.6s ease-in-out infinite; }
.qsk { height: 200px; margin-top: 12px; }
.sk-row { display: flex; align-items: center; justify-content: space-between; height: 52px; padding: 0 16px; }
.sk-row + .sk-row { box-shadow: inset 0 .5px 0 var(--sep); }
.sk-a { width: 96px; height: 12px; }
.sk-b { width: 64px; height: 12px; }
@media (prefers-reduced-motion: reduce) { .sk, .sk-chart { animation: none; } }

/* ============ 纸上策略 ============ */
.paper-tag { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 5px; background: var(--fill); color: var(--text2); font-size: 11px; line-height: 18px; font-weight: 500; letter-spacing: .2px; vertical-align: 2px; }
.agrid { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 0 var(--cx); }
.agrid .cd { margin: 0; }
.acard { display: block; width: 100%; padding: 16px 16px 14px; text-align: left; background: var(--card); border-radius: 14px; }
.acard .ah { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.acard .an { font-size: 15px; line-height: 22px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acard .an small { margin-left: 8px; font-size: 13px; font-weight: 400; color: var(--text3); }
.acard .ad { font-size: 12px; line-height: 17px; color: var(--text3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acard .av { margin-top: 12px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.acard .av .n { font-size: 20px; line-height: 26px; font-weight: 600; letter-spacing: -.2px; white-space: nowrap; }
.acard .av .n .ccy { font-size: 13px; font-weight: 500; color: var(--text2); margin-right: 3px; }
.acard .av .nv { font-size: 13px; line-height: 18px; color: var(--text2); white-space: nowrap; }
.acard .am { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.acard .am .lbl { font-size: 12px; line-height: 16px; }
.acard .am b { display: block; font-size: 15px; line-height: 22px; font-weight: 500; margin-top: 1px; }
.acard .sp { margin-top: 12px; height: 40px; }
.acard .sp svg { width: 100%; height: 40px; }
.acard .sp .m { stroke: var(--text1); stroke-width: 1.5; fill: none; stroke-linejoin: round; stroke-linecap: round; }
.acard .sp .b { stroke: var(--bench); stroke-width: 1; fill: none; stroke-linejoin: round; }
.acard .sp .z { stroke: var(--grid); stroke-width: 1; stroke-dasharray: 2 3; }
.ptbl { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 22px; }
.ptbl th { font-size: 12px; line-height: 16px; font-weight: 400; color: var(--text3); text-align: right; padding: 12px 16px 8px; white-space: nowrap; }
.ptbl td { text-align: right; padding: 0 16px; height: 48px; white-space: nowrap; border-top: .5px solid var(--sep); }
.ptbl th:first-child, .ptbl td:first-child, .ptbl th.l, .ptbl td.l { text-align: left; }
.ptbl td.nm { color: var(--text2); max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.ptbl td b { font-weight: 500; }
.ptbl tr:first-child td { border-top: 0; }
.ptbl .side-b { color: var(--text1); }
.lv-bar { position: relative; height: 4px; margin: 10px 0 2px; border-radius: 2px; background: var(--fill); }
.lv-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: var(--text1); }
.tbl-wrap { overflow-x: auto; }
.pp-head .paper-tag { margin-left: 8px; }
.pp-disc { margin-top: 2px; }
.only-d { display: none !important; }

/* ============ 弹层（手机从底下滑上来；桌面从右边） ============ */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 20; opacity: 0; transition: opacity .24s; }
.scrim.in { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-height: 82vh; overflow-y: auto; overscroll-behavior: contain; background: var(--sheet); border-radius: 14px 14px 0 0; padding: 6px 0 calc(16px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .3s cubic-bezier(.2, .8, .2, 1); --sep: var(--sheet-sep); }
.sheet.in { transform: none; }
.sheet:focus { outline: none; }
.sheet .cd { background: var(--sheet-card); }
.sheet .scale .trk { background: var(--canvas); }
.grab { width: 36px; height: 5px; border-radius: 3px; background: var(--grid); margin: 0 auto; }
.sh { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px 16px; }
.sh h3 { font-size: 17px; line-height: 24px; font-weight: 600; }
.sh small { display: block; font-size: 13px; line-height: 18px; color: var(--text2); font-weight: 400; }
.sheet .p { padding: 0 20px; color: var(--text2); }
.sheet .p + .p { margin-top: 12px; }
.sheet .p b { color: var(--text1); font-weight: 600; }
.sheet .cd + .p, .sheet .p + .cd, .sheet .cd + .cd { margin-top: 16px; }
.sheet .after { margin-top: 24px; }
.sheet .cd { margin: 0 16px; }
.sheet .sec-h { padding: 0 20px; }
.scale-w { padding: 16px 0 12px; position: relative; }
.scale-w .lbl { padding: 0 16px 8px; }
.scale { position: relative; height: 30px; margin: 0 16px; }
.scale .trk { position: absolute; left: 0; right: 0; top: 8px; height: 4px; border-radius: 2px; background: var(--fill); }
.scale .band { position: absolute; top: 8px; height: 4px; background: var(--grid); }
.scale .mk { position: absolute; top: 3px; width: 2px; height: 14px; border-radius: 1px; background: var(--text1); transform: translateX(-1px); }
.scale span { position: absolute; top: 18px; font-size: 11px; line-height: 12px; color: var(--text2); transform: translateX(-50%); white-space: nowrap; }
.scale span.s0 { transform: none; }
.scale span.s1 { left: auto !important; right: 0; transform: none; }

/* 确认框 */
.modal { position: fixed; left: 50%; top: 50%; z-index: 31; width: min(300px, calc(100vw - 48px)); transform: translate(-50%, -48%) scale(.98); opacity: 0; transition: opacity .18s, transform .18s; background: var(--sheet); border-radius: 14px; overflow: hidden; text-align: center; }
.modal.in { opacity: 1; transform: translate(-50%, -50%); }
.modal h3 { padding: 22px 20px 20px; font-size: 17px; line-height: 24px; font-weight: 600; }
.modal .btns { display: flex; box-shadow: inset 0 .5px 0 var(--sheet-sep); }
.modal .btns button { flex: 1; height: 48px; font-size: 17px; text-align: center; }
.modal .btns button + button { box-shadow: inset .5px 0 0 var(--sheet-sep); font-weight: 600; }
.scrim.top { z-index: 30; }

/* 设置（外观、退出、示例） */
.seg { display: flex; padding: 2px; border-radius: 9px; background: var(--fill); }
.seg button { flex: 1; height: 28px; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--text2); text-align: center; white-space: nowrap; padding: 0 8px; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--text1); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 28px; padding: 0 10px; border-radius: 8px; background: var(--fill); color: var(--text2); font-size: 12px; display: inline-flex; align-items: center; }
.chip[aria-pressed="true"] { background: var(--text1); color: var(--canvas); }
.set-blk { padding: 0 20px; }
.set-blk + .set-blk { margin-top: 20px; }
.set-blk .lbl { margin-bottom: 8px; }

/* 提示 */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabh) + 21px + env(safe-area-inset-bottom)); z-index: 40; transform: translate(-50%, 8px); background: var(--text1); color: var(--canvas); font-size: 13px; line-height: 18px; font-weight: 500; padding: 9px 16px; border-radius: 18px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; white-space: nowrap; }
.toast.in { opacity: 1; transform: translate(-50%, 0); }

/* ============ 登录 ============ */
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px calc(40px + env(safe-area-inset-bottom)); }
.login .box { width: 100%; max-width: 340px; }
.login .mark { width: 44px; height: 44px; border-radius: 11px; display: block; margin-bottom: 20px; box-shadow: 0 0 0 .5px var(--grid); }
.login h1 { font-size: 28px; line-height: 34px; font-weight: 600; letter-spacing: -.3px; }
.login .lede { margin-top: 6px; font-size: 15px; line-height: 22px; color: var(--text2); min-height: 22px; overflow-wrap: anywhere; }
.login form { margin-top: 28px; }
.fld { display: block; width: 100%; height: 48px; border-radius: 12px; border: 0; background: var(--card); color: var(--text1); padding: 0 16px; font-size: 17px; outline: none; box-shadow: inset 0 0 0 .5px var(--sep); }
.fld:focus { box-shadow: inset 0 0 0 1.5px var(--text2); }
.fld.code { letter-spacing: 6px; font-size: 22px; font-weight: 600; text-align: center; }
.fld.code::placeholder { letter-spacing: 6px; color: var(--text3); font-weight: 400; }
.btn { display: flex; align-items: center; justify-content: center; width: 100%; height: 48px; margin-top: 12px; border-radius: 12px; background: var(--text1); color: var(--canvas); font-size: 17px; font-weight: 600; }
.btn:disabled { opacity: .45; }
.login .msg { margin-top: 12px; min-height: 18px; font-size: 13px; line-height: 18px; color: var(--text2); display: flex; align-items: center; gap: 8px; }
.login .alt { margin-top: 20px; display: flex; justify-content: space-between; font-size: 13px; line-height: 18px; }
.login .alt button, .login .alt a { color: var(--text2); height: 44px; margin: -13px 0; display: inline-flex; align-items: center; }
.login .alt button:disabled { color: var(--text3); }
.login .legal { margin-top: 48px; font-size: 12px; line-height: 17px; color: var(--text3); text-align: center; }

/* 页面状态 */
.state-blk { height: 360px; }
.boot { min-height: 100vh; }

/* ============ 桌面（≥ 960）：左导航 + 宽内容 ============ */
@media (min-width: 960px) {
  :root { --ox: 0px; --cx: 0px; }
  body { font-size: 15px; }
  .topbar, .tabbar { display: none; }
  .side { display: flex; flex-direction: column; flex: none; width: 216px; height: 100vh; position: sticky; top: 0; padding: 28px 12px 20px; border-right: .5px solid var(--sep); }
  .brand { display: flex; align-items: center; gap: 10px; padding: 0 12px; height: 32px; margin-bottom: 24px; }
  .brand img { width: 24px; height: 24px; border-radius: 6px; box-shadow: 0 0 0 .5px var(--grid); }
  .brand b { font-size: 17px; line-height: 24px; font-weight: 600; }
  .nv { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 10px; color: var(--text2); font-size: 15px; font-weight: 500; }
  .nv + .nv { margin-top: 2px; }
  .nv svg { width: 20px; height: 20px; }
  .nv:hover { background: var(--hover); color: var(--text1); }
  .nv[aria-current="page"] { background: var(--fill); color: var(--text1); }
  .side .grow { flex: 1; }
  .side-foot { padding: 0 12px; display: flex; flex-direction: column; gap: 16px; }
  .side-foot .stamp { font-size: 12px; line-height: 17px; color: var(--text3); }
  .side-foot .who { display: flex; align-items: center; justify-content: space-between; font-size: 13px; line-height: 18px; color: var(--text2); }
  .side-foot .who button, .side-foot .who a { height: 32px; margin: -7px -8px; padding: 0 8px; font-size: 13px; font-weight: 500; color: var(--text1); display: inline-flex; align-items: center; }

  .page, .page.is-sub { max-width: 1200px; margin: 0 auto; padding: 36px 48px 64px; }
  .ph { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 32px; margin-bottom: 28px; }
  .ph h1 { font-size: 22px; line-height: 28px; font-weight: 600; letter-spacing: -.2px; display: flex; align-items: center; gap: 10px; }
  .ph .back { display: inline-flex; align-items: center; gap: 6px; height: 32px; margin-left: -6px; padding: 0 6px; border-radius: 8px; color: var(--text2); font-size: 15px; font-weight: 500; }
  .ph .back:hover { color: var(--text1); background: var(--hover); }
  .ph .back svg { width: 8px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .ph .meta { font-size: 13px; line-height: 18px; color: var(--text3); display: inline-flex; align-items: center; gap: 12px; }
  .ph .meta .txtbtn { font-size: 13px; height: 32px; margin: 0 -8px 0 0; }
  .note { margin-bottom: 24px; }
  .cd { border-radius: 14px; }
  button.row:hover, a.row:hover, .mrow:not(.edit):hover, button.alloc:hover { background: var(--hover); }
  .acard:hover { box-shadow: inset 0 0 0 .5px var(--grid); }
  .only-m { display: none !important; }
  .only-d { display: revert !important; }
  .toast { bottom: 32px; left: calc(50% + 108px); }
  .foot { margin-top: 40px; }
  .mod { margin-top: 40px; }

  /* 弹层：右边抽屉 */
  .sheet { left: auto; top: 0; bottom: 0; right: 0; width: 420px; max-height: none; border-radius: 0; padding: 12px 0 32px; transform: translateX(100%); box-shadow: -1px 0 0 var(--sep); }
  .sheet .grab { display: none; }
  .sheet .sh { padding: 20px 24px 20px; }
  .sheet .p, .sheet .sec-h, .set-blk { padding: 0 24px; }
  .sheet .cd { margin: 0 20px; }

  /* 总览 */
  .ov-head { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "hero pills" "chart chart"; align-items: end; column-gap: 24px; }
  .ov-head .hero { grid-area: hero; }
  .ov-head .pills { grid-area: pills; margin: 0; padding: 0; }
  .ov-head .ov-chart { grid-area: chart; margin-top: 28px; }
  .display .int { font-size: 48px; letter-spacing: -.8px; }
  .display .dec { font-size: 32px; }
  .display { line-height: 56px; }
  .grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 20px 16px 18px; }
  .cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
  .cols { margin-top: 40px; }
  .cols > div > .mod:first-child, .cols > div > section:first-child { margin-top: 0; }
  .cols-7-5 { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .cols-5-7 { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }

  /* 定投 */
  .dca-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
  .dca-top .cd { margin-top: 4px; }
  .dca-top > .mod { margin-top: 0; }

  /* 日报：左边正文、右边往期 */
  .rep-wrap { display: grid; grid-template-columns: minmax(0, 7fr) minmax(320px, 5fr); gap: 40px; align-items: start; }
  .rep-side .mod:first-child { margin-top: 0; }
  .dhead { padding: 0; margin-right: -12px; }

  /* 行情：左边列表、右边详情 */
  .mk-wrap { display: grid; grid-template-columns: minmax(360px, 440px) minmax(0, 1fr); gap: 40px; align-items: start; }
  .mk-detail { position: sticky; top: 24px; max-height: calc(100vh - 48px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; background: var(--card); border-radius: 14px; padding: 24px 24px 20px; }
  .mk-detail .qtitle { display: block; font-size: 22px; line-height: 28px; font-weight: 600; letter-spacing: -.2px; margin-bottom: 2px; }
  .mk-detail .cd { background: var(--canvas); }
  .mk-detail .mod { margin-top: 28px; }
  .mk-detail .foot { margin-top: 24px; }
  .mk-detail .sk, .mk-detail .sk-chart { background: var(--fill); }
  .search { margin: 0 0 24px; }

  /* 纸上策略 */
  .agrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0; }
  .pp-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 40px; }
  .pp-cols > .mod { margin-top: 0; }
  .pp-cols > .pp-lv { grid-column: 1 / -1; }
  .pp-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 24px; }
  .pp-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 20px; }
}
@media (min-width: 960px) and (max-width: 1180px) {
  .page, .page.is-sub { padding: 32px 32px 56px; }
  .mk-wrap { grid-template-columns: minmax(340px, 400px) minmax(0, 1fr); gap: 28px; }
}
/* 手机、平板竖屏：单列；平板上居中、最宽 640 */
@media (max-width: 959px) {
  .ph { display: none; }
  .mk-wrap.has-sel .mk-list { display: none; }
  .mk-wrap:not(.has-sel) .mk-detail { display: none; }
  .pp-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 16px; padding: 16px; }
  .grid4 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 16px; padding: 16px; }
  .rep-side { margin-top: 32px; }
  .dca-top > .mod { margin-top: 32px; }
  .ptbl .hide-m { display: none; }
}
@media (min-width: 640px) and (max-width: 959px) {
  .page { max-width: 640px; margin: 0 auto; }
}

/* 纸上策略的指标格 */
.pp-metrics .val { margin-top: 4px; font-size: 20px; line-height: 26px; font-weight: 600; letter-spacing: -.2px; }
.pp-metrics .sub { margin-top: 2px; }
