:root {
  --bg: #0b0e11;
  --card: #12161c;
  --ink: #eaecef;
  --muted: #848e9c;
  --line: #2b3139;
  --gold: #f0b90b;
  --gold-soft: #2a2412;
  --up: #f6465d;
  --down: #0ecb81;
  --shadow: none;
  --nav: 3.6rem;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 "WenQuanYi Micro Hei", "PingFang SC", "Noto Sans SC", sans-serif;
  padding-bottom: calc(var(--nav) + 4.6rem + env(safe-area-inset-bottom));
}
a { color: var(--gold); }
.num, .stat b, .pos b, .quote b, .ticker, td, .tipbox b {
  font-family: "Roboto Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}
.wrap { width: min(760px, 100%); margin: 0 auto; padding: 0.6rem 0.75rem 1.2rem; }
.top {
  position: sticky; top: 0; z-index: 6;
  display: flex; gap: 0.6rem; align-items: center;
  background: rgba(11, 14, 17, 0.94);
  padding: 0.45rem 0; border-bottom: 1px solid var(--line);
}
.ticker { margin-left: auto; text-align: right; font-size: 0.82rem; }
.ticker b { font-size: 1rem; }
.pill {
  flex: none; background: var(--gold); color: #1a140c; border-radius: 4px;
  padding: 0.15rem 0.45rem; font-size: 0.72rem; letter-spacing: 0.06em;
}
.eyebrow { margin: 0; color: var(--muted); font-size: 0.72rem; }
h1 { margin: 0; font-size: 1.2rem; line-height: 1.2; font-weight: 650; }
h2 { margin: 0 0 0.35rem; font-size: 0.95rem; letter-spacing: 0.02em; }
.banner, .state {
  margin: 0.7rem 0 0; padding: 0.6rem 0.75rem; border-radius: 6px;
  background: #1a1408; border: 1px solid #3d3420; color: #f6e2b8; font-size: 0.86rem;
}
.banner strong { display: block; margin-bottom: 0.15rem; }
.state.bad { background: #2a1215; border-color: #f6465d; color: #ffd0d6; }
.state.ok { background: #0d2218; border-color: #0ecb81; color: #c8f5de; }
.lead { font-size: 0.95rem; margin: 0.7rem 0 0; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem; margin-top: 0.7rem; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  padding: 0.75rem 0.8rem 0.85rem; margin-top: 0.6rem;
}
.stat { padding: 0.5rem 0.55rem; border-radius: 6px; background: #0e1318; border: 1px solid var(--line); }
.stat span { display: block; color: var(--muted); font-size: 0.7rem; }
.stat b { display: block; margin-top: 0.1rem; font-size: 1.05rem; }
.stat.hero b { font-size: 1.2rem; }
.up, .cn-gain { color: var(--up); }
.down, .cn-loss { color: var(--down); }
.cn-flat { color: var(--muted, #9aa0a6); }
.small { font-size: 0.78rem; color: var(--muted); }
label.fee { display: block; margin-top: 0.5rem; font-size: 0.88rem; }
input[type="number"] {
  width: 4.2rem; font: inherit; padding: 0.3rem 0.35rem; border-radius: 4px;
  border: 1px solid var(--line); background: #0e1318; color: var(--ink);
}
button[disabled] {
  width: 100%; border: 0; border-radius: 6px; padding: 0.85rem 1rem; font: inherit;
  background: #1e2329; color: #848e9c;
}
canvas, #navchart { width: 100%; height: 280px; display: block; }
.toggles { display: flex; gap: 0.35rem; flex-wrap: wrap; margin: 0.35rem 0; }
.toggles button {
  border: 1px solid var(--line); background: #0e1318; border-radius: 4px;
  padding: 0.55rem 0.85rem; min-height: 44px; font: inherit; color: var(--muted);
}
.toggles button[aria-pressed="true"] {
  background: var(--gold); color: #1a140c; border-color: var(--gold); font-weight: 700;
}
.barline { display: grid; grid-template-columns: 7.2rem 1fr auto; gap: 0.4rem; align-items: center; margin: 0.3rem 0; font-size: 0.78rem; }
.track { height: 0.4rem; background: #1e2329; border-radius: 2px; overflow: hidden; }
.track i { display: block; height: 100%; }
.heat { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.25rem; }
.heat b { display: block; font-size: 0.62rem; font-weight: 550; line-height: 1.2; padding: 0.25rem; border-radius: 4px; text-align: center; }
table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
th, td { text-align: left; padding: 0.35rem 0.12rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 0.7rem; }
ol { padding-left: 1.1rem; margin: 0.2rem 0; }
ol li { margin: 0.28rem 0; }
.pos { display: grid; grid-template-columns: 4.4rem 1fr; gap: 0.12rem 0.5rem; margin: 0.3rem 0 0.5rem; }
.pos span { color: var(--muted); font-size: 0.75rem; }
.legend { display: flex; gap: 0.7rem; flex-wrap: wrap; margin: 0.35rem 0 0; font-size: 0.75rem; color: var(--muted); }
.legend i.ln { display: inline-block; width: 18px; height: 0; border-top: 2px solid #f0b90b; margin-right: 4px; vertical-align: middle; }
.legend i.ln.dash { border-top-style: dashed; }
.legend i.ln.grey { border-top-color: #848e9c; }
.legend i.ln.blue { border-top-color: #3b82f6; }
.legend i.ln.gold-ln, .gold-now i.ln.gold-ln { border-top-color: #ff4fd8; }
.gold-now { font-size: 13px; color: #b7bdc6; margin-top: 4px; }
.gold-now i.ln { display: inline-block; width: 14px; height: 0; border-top: 2px solid #ff4fd8; margin-right: 4px; vertical-align: middle; }
.legend i.bx { display: inline-block; width: 8px; height: 10px; margin-right: 4px; vertical-align: middle; background: #848e9c; }
.legend i.bx.up { background: #f6465d; }
.legend i.bx.down { background: #0ecb81; }
details.raw, details.suggest { margin-top: 0.4rem; }
details summary { cursor: pointer; color: var(--muted); }
.quote-table td:last-child, .quote-table th:last-child { text-align: right; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 8;
  display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 0.15rem;
  background: #0b0e11; border-top: 1px solid var(--line);
  padding: 0.35rem 0.4rem calc(0.35rem + env(safe-area-inset-bottom));
}
.tabbar a {
  flex: 0 0 auto; text-decoration: none; color: var(--muted);
  font-size: 0.78rem; padding: 0.4rem 0.65rem; border-radius: 4px; white-space: nowrap;
}
.tabbar a[aria-current="page"] { color: #1a140c; background: var(--gold); font-weight: 700; }
.chart-box { position: relative; width: 100%; max-width: 100%; }
#navchart { width: 100%; max-width: 100%; height: 320px; touch-action: pan-y; }
.ma-legend {
  position: static; display: block; margin: 0 0 0.35rem;
  font-size: 11px; line-height: 1.45;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.ma-legend i { display: inline-block; width: 10px; height: 2px; margin-right: 3px; vertical-align: middle; }
.ma-legend .mas span { margin-right: 0.45rem; white-space: nowrap; }
.tipbox {
  position: absolute; z-index: 4; pointer-events: none;
  background: #1e2329; border: 1px solid #474d57; border-radius: 4px;
  padding: 0.35rem 0.5rem; font-size: 0.75rem; line-height: 1.35; max-width: 12.5rem;
}
.loading { color: var(--muted); }
.returns { width: 100%; border-collapse: collapse; font-size: 0.75rem; }
.returns th, .returns td { padding: 0.28rem 0.15rem; text-align: right; }
.returns th:first-child, .returns td:first-child { text-align: left; }
.legal, .riskline {
  margin: 0.8rem 0 0; text-align: center; font-size: 0.72rem; color: var(--muted);
}
.hscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.hscroll table { min-width: 36rem; }
.rank-cards { display: none; }
.rank-card {
  border: 1px solid var(--line); border-radius: 8px; padding: 0.55rem 0.7rem; margin: 0.4rem 0;
  background: #0e1318;
}
.rank-card p { margin: 0.12rem 0; }
@media (max-width: 480px) {
  .rank-table { display: none; }
  .rank-cards { display: block; }
}
.held-row { background: #2a2412; }
.tag { display: inline-block; border-radius: 4px; padding: 0.05rem 0.35rem; font-size: 0.72rem; }
.tag.on { background: #0d2218; color: #c8f5de; }
.tag.wait { background: #1e2329; color: #848e9c; }
.log-cn { color: #f0b90b; }
.log-us { color: #5ea2ff; }
.log-open { color: #848e9c; }
.strat { display: block; text-decoration: none; color: inherit; }
.tabbar a { flex: 1 1 0; text-align: center; }
code.sym { color: var(--muted); font-size: 0.75rem; }
.stale-tag{color:#b26a00}
#navchart { position: relative; }
.trade-layer { position: absolute; left: 0; top: 0; right: 0; bottom: 0; pointer-events: none; z-index: 3; }
.tri-mark { position: absolute; width: 12px; height: 13px; padding: 0; margin: 0; border: 0; background: none; font-size: 11px; line-height: 13px; text-align: center; cursor: pointer; pointer-events: none; }
.tri.open { color: #4da3ff; }
.tri.close { color: #ff8a3d; }
.tri.switch { color: #c084fc; }
.legend b.tri { margin-right: 3px; font-weight: 400; }
.tag.side-call { background: #4a1f26; color: #ff8a96; border: 1px solid #f6465d; }
.tag.side-put { background: #10324a; color: #7cc4ff; border: 1px solid #3d9df3; }
.held-row.held-call { border-left: 3px solid #f6465d; }
.held-row.held-put { border-left: 3px solid #3d9df3; }
.side-legend .tag { margin-right: 2px; }
/* up63 live NAV panel */
.navpanel { padding-top: 0.8rem; }
.nav-top { display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; color: var(--muted); }
.live-state { display: inline-flex; align-items: center; gap: 5px; font-size: 0.75rem; color: var(--muted); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #5e6673; display: inline-block; }
.live-state.on { color: #0ecb81; }
.live-state.on .live-dot { background: #0ecb81; box-shadow: 0 0 0 3px rgba(14,203,129,0.18); animation: livepulse 1.6s ease-in-out infinite; }
@keyframes livepulse { 50% { box-shadow: 0 0 0 5px rgba(14,203,129,0.05); } }
.nav-big { font-size: 2.1rem; font-weight: 700; line-height: 1.15; margin: 0.15rem 0 0.1rem; font-variant-numeric: tabular-nums; font-family: ui-monospace, Menlo, Consolas, monospace; }
.nav-chg { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.4rem; }
.nav-flat { margin: 0.2rem 0 0.4rem; font-size: 0.85rem; color: #848e9c; }
.nav-note { position: absolute; width: 16px; height: 16px; padding: 0; margin: 0; border-radius: 8px; border: 1px solid #f6465d; background: rgba(11,14,17,0.9); color: #f6465d; font-size: 11px; line-height: 14px; font-weight: 700; text-align: center; pointer-events: none; }
.nav-note-key { display: inline-block; width: 14px; height: 14px; margin-right: 3px; border-radius: 7px; border: 1px solid #f6465d; color: #f6465d; font-size: 10px; line-height: 12px; text-align: center; }
.nav-loading { position: absolute; left: 8px; top: 6px; right: 70px; z-index: 4; margin: 0; padding: 3px 8px; border-radius: 6px; background: rgba(11,14,17,0.85); color: #f0b90b; font-size: 0.75rem; pointer-events: none; }
.nav-now { position: absolute; right: 70px; bottom: 34px; z-index: 5; font-size: 0.75rem; padding: 4px 9px; border-radius: 12px; border: 1px solid #f0b90b; background: rgba(11,14,17,0.88); color: #f0b90b; }
.nav-chips { display: flex; gap: 6px; margin: 0.45rem 0 0.2rem; }
.nav-chips button { font-size: 0.78rem; padding: 3px 12px; border-radius: 12px; border: 1px solid #2b3139; background: transparent; color: var(--muted); }
.nav-chips button[aria-pressed="true"] { border-color: #f0b90b; color: #f0b90b; }
.nav-hint { margin-top: 0.3rem; }
[hidden] { display: none !important; }
.ann { white-space: nowrap; }
.ann-note { display: block; font-size: 0.72rem; color: var(--muted); margin-top: 0.1rem; }
.card.strat p.ret-row { font-size: 0.84rem; letter-spacing: -0.01em; }

/* up81 home catalog */
.tag.test { background: #2a2412; color: #f0b90b; }
.cats { position: sticky; top: 3.1rem; z-index: 5; display: flex; gap: 0.4rem; overflow-x: auto; margin: 0.7rem -0.75rem 0; padding: 0.45rem 0.75rem; background: rgba(11, 14, 17, 0.94); scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cats a { flex: none; display: inline-flex; align-items: center; gap: 0.3rem; min-height: 40px; padding: 0 0.85rem; border: 1px solid var(--line); border-radius: 999px; background: #0e1318; color: var(--ink); text-decoration: none; font-size: 0.88rem; }
.cats a b { color: var(--muted); font-weight: 500; font-size: 0.78rem; }
.count-line { margin: 0.5rem 0 0; }
.legend { list-style: none; margin: 0.35rem 0 0; padding: 0; display: grid; gap: 0.25rem; }
.legend .tag { display: inline-block; min-width: 5.6em; text-align: center; margin-right: 0.5rem; }
.cat { margin-top: 1.1rem; scroll-margin-top: 6.4rem; }
.cat > h2 { font-size: 1.05rem; margin: 0; padding-left: 0.5rem; border-left: 3px solid var(--gold); }
.cat-line { margin: 0.2rem 0 0; }
.sc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
.sc-head h3 { margin: 0; font-size: 1rem; line-height: 1.35; }
.sc-head .tag { flex: none; margin-top: 0.1rem; }
.sc-logic { margin: 0.35rem 0 0; font-size: 0.86rem; color: #c9ced6; }
.sc-grid { margin-top: 0.55rem; grid-template-columns: repeat(3, 1fr); }
.sc-grid .stat b { font-size: 1rem; }
.sc-started { margin: 0.35rem 0 0; }
.sc-since { font-size: 0.8rem; font-family: inherit; }
.sc-books { margin-top: 0.5rem; display: grid; gap: 0.35rem; }
.sc-book { display: flex; flex-wrap: wrap; gap: 0.15rem 0.8rem; align-items: baseline; padding: 0.45rem 0.55rem; border-radius: 6px; background: #0e1318; border: 1px solid var(--line); font-size: 0.86rem; }
.sc-book-name { font-weight: 600; min-width: 5.5em; }
.sc-book .small { flex-basis: 100%; }
.sc-more { display: inline-block; margin-top: 0.55rem; color: var(--gold); font-size: 0.86rem; text-decoration: none; }
.sc-off { opacity: 0.88; }
.sc-off .sc-logic { color: var(--muted); }
.sc-wait { margin-top: 0.5rem; }
body[data-page="home"] .top { background: var(--bg); }
.cats { background: var(--bg); }
