/* Research-terminal adapters · BTC 链上与资金面 (js/views/tc/onchain.js): chart cards, legends, URPD histogram. */
.tc-oc-grid { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tc-oc-grid.groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); align-items: start; }
.tc-oc-grid.groups > .tc-island:has(> .tc-oc-card.big) { grid-column: 1 / -1; }
.tc-oc-grid > .tc-island { min-width: 0; }
.tc-oc-card { padding: 14px 16px 12px; }

/* card head: title · latest reading · expand */
.tc-oc-ch { display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; min-width: 0; }
.tc-oc-ch .spacer, .tc-oc-tools .spacer, .tc-oc-uhead .spacer { flex: 1; }
.tc-oc-chr { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.tc-oc-title { font-size: 14.5px; font-weight: 650; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.tc-oc-cur { font-size: 19px; font-weight: 680; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.tc-oc-x { height: 26px; padding: 0 8px; font-size: 12px; color: var(--muted); }
.tc-oc-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin: 4px 0 8px; font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.tc-oc-meta .tc-pill { flex: none; }
.tc-oc-stale { font-size: 12px; color: var(--text-2); background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); border-radius: 7px; padding: 5px 9px; margin: 0 0 8px; }
.tc-oc-bad { font-size: 13px; color: var(--text-2); background: var(--fall-soft); border-left: 3px solid var(--fall); border-radius: 0 7px 7px 0; padding: 9px 12px; margin: 4px 0 10px; }
.tc-oc-bad b { color: var(--fall); }

/* tool row: overlay toggles, axis switch */
.tc-oc-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 8px; min-width: 0; }
.tc-oc-tog { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--border); background: transparent;
  color: var(--faint); font: inherit; font-size: 12px; line-height: 20px; cursor: pointer; transition: all 0.15s var(--ease); }
.tc-oc-tog.on { color: var(--text); border-color: var(--accent); background: var(--accent-soft); }
.tc-oc-tog:hover { color: var(--text); }

/* legend: values under the crosshair (or the latest) */
.tc-oc-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; min-height: 22px; margin: 0 0 4px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 0; }
.tc-oc-legend > span, .tc-oc-key { white-space: nowrap; }
.tc-oc-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -0.5px; }
.tc-oc-legend i.ln { width: 14px; height: 0; border-radius: 0; border-top: 2px solid; background: none; vertical-align: 3px; }
.tc-oc-legend i.ln.dashed { border-top-style: dashed; }
.tc-oc-legend i.ln.dotted { border-top-style: dotted; }
.tc-oc-legend b { color: var(--text); font-weight: 620; }
.tc-oc-legend b.up { color: var(--rise); } .tc-oc-legend b.down { color: var(--fall); }
.tc-oc-ld { color: var(--faint); }
.tc-oc-ln { color: var(--text-2); white-space: normal !important; }
.tc-oc-legend.keys { gap: 4px 6px; margin: 0; flex: 1 1 auto; }
.tc-oc-key { display: inline-flex; align-items: center; gap: 0; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel-2);
  color: var(--muted); font: inherit; font-size: 12px; line-height: 20px; cursor: pointer; transition: opacity 0.15s var(--ease), border-color 0.15s var(--ease); }
.tc-oc-key b { margin-left: 4px; }
.tc-oc-key:hover { border-color: var(--accent); }
.tc-oc-key.off { opacity: 0.42; }
.tc-oc-key.off b { color: var(--faint); }
.tc-oc-plot { min-width: 0; }
.tc-oc-plot > .tc-ts-legend { display: none; }
.tc-oc-foot { font-size: 11.5px; line-height: 1.6; color: var(--faint); margin-top: 6px; }
.tc-oc-foot .up { color: var(--rise); } .tc-oc-foot .down { color: var(--fall); }

/* 定价模型: reading card */
.tc-oc-verdict { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 10px 12px; margin-bottom: 10px; border-radius: var(--radius-sm);
  background: var(--accent-soft); color: var(--text-2); font-size: 13.5px; }
.tc-oc-verdict b { color: var(--text); font-size: 15px; font-weight: 680; }
.tc-oc-lrow { padding: 9px 0; border-top: 1px solid var(--border); }
.tc-oc-lrow:first-of-type { border-top: 0; }
.tc-oc-lk { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.tc-oc-lk b { color: var(--text); font-size: 13.5px; }
.tc-oc-lrow p { margin: 0; font-size: 13px; line-height: 1.7; color: var(--text-2); }

/* 定价模型 ·「现价在各成本线的位置」: the site's server-rendered card (x-pl-ladder-box). The reading on the left, the table on the
   right: swatch · line · price · distance from the price, the price's own row first. Its sizes arrive unitless and are dropped. */
.term-doc .x-pl-ladder-box { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); align-items: center; gap: 14px 32px; }
.x-pl-ladder-box > div:first-child { min-width: 0; color: var(--text); font-size: 13.5px; line-height: 1.75; }
.x-pl-ladder-box > div:first-child > div { margin-top: 6px; font-size: 11.5px; line-height: 1.7; }
.x-pl-ladder-box > div:last-child { display: flex; flex-direction: column; min-width: 0; font-size: 12.5px; }
.x-pl-ladder-box > div:last-child > div { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 46px; align-items: center; gap: 10px;
  padding: 5px 8px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.x-pl-ladder-box > div:last-child > div:first-child { border-radius: 6px; border-bottom-color: transparent; }
.x-pl-ladder-box > div:last-child > div:last-child { border-bottom: 0; }
.x-pl-ladder-box > div:last-child > div > span:first-child { width: 10px; height: 3px; border-radius: 2px; }
.x-pl-ladder-box > div:last-child > div:first-child > span:first-child { height: 10px; border-radius: 50%; }
.x-pl-ladder-box > div:last-child > div > span:nth-child(3) { color: var(--text); text-align: right; }
/* "绿 = 分界线" and its swatch: the green the 短线客成本 line is drawn in (--fall under 红涨绿跌, --rise under 绿涨红跌), not the
   document's supportive = --rise */
.term-doc .x-pl-ladder-box { --supportive: var(--fall); }
:root.green-up .term-doc .x-pl-ladder-box { --supportive: var(--rise); }

/* 短线客 SOPR 模型 */
.tc-oc-lg { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.tc-oc-lg i.ring { width: 10px; height: 10px; border-radius: 50%; border: 2px solid currentColor; }
.tc-oc-lg i.ring.up { color: var(--rise); } .tc-oc-lg i.ring.down { color: var(--fall); }
.tc-oc-arts { margin-top: 10px; font-size: 12.5px; line-height: 1.7; color: var(--muted); }
.tc-oc-arts b { color: var(--text); font-weight: 620; }

/* URPD 成本分布 */
.tc-oc-uhead { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 4px; }
.tc-oc-sub { font-size: 13px; color: var(--muted); min-width: 0; }
.tc-oc-nav { display: inline-flex; align-items: center; gap: 6px; }
.tc-oc-nav .btn { min-width: 30px; justify-content: center; padding: 0 8px; }
.tc-oc-dpick { width: auto; height: 28px; min-height: 0; padding: 0 8px; font-size: 12.5px; font-weight: 600; border-radius: 8px; font-variant-numeric: tabular-nums; }
.tc-oc-from { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.tc-oc-from .tc-oc-dpick { font-weight: 500; }
.tc-oc-load { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); background: var(--accent-soft); border-radius: var(--radius-sm); padding: 7px 11px; margin: 0 0 10px; }
.tc-oc-load .spinner { flex: none; width: 12px; height: 12px; }
.tc-oc-err { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.tc-oc-err .btn { margin-left: 4px; }
.tc-oc-ubody { transition: opacity 0.2s var(--ease); }
.tc-oc-ubody.dim { opacity: 0.45; }
.tc-oc-hint { font-size: 11.5px; color: var(--faint); margin-bottom: 10px; line-height: 1.7; }
.tc-oc-hint .chip { font-size: 11px; }
.tc-oc-none { display: flex; flex-direction: column; gap: 4px; padding: 18px 4px 8px; font-size: 13px; color: var(--muted); }
.tc-oc-none b { color: var(--text-2); font-weight: 620; }
.tc-oc-urpd .tc-stats { grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); margin-bottom: 12px; }
.tc-stat .v.tc-oc-acc { color: var(--accent); }
.tc-oc-switch { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel);
  color: var(--muted); font: inherit; font-size: 12.5px; cursor: pointer; }
.tc-oc-switch.on { color: var(--text); border-color: var(--accent); }
.tc-oc-switch .dot { position: relative; width: 26px; height: 14px; border-radius: 20px; background: var(--hover); border: 1px solid var(--border); }
.tc-oc-switch .dot::after { content: ""; position: absolute; top: 1px; left: 1px; width: 10px; height: 10px; border-radius: 50%; background: var(--panel); box-shadow: var(--shadow-sm); transition: left 0.15s var(--ease); }
.tc-oc-switch.on .dot { background: var(--accent); border-color: var(--accent); }
.tc-oc-switch.on .dot::after { left: 13px; background: #fff; }
.tc-oc-diff { font-size: 13px; color: var(--text-2); background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.tc-oc-hist { position: relative; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel-2); }
.tc-oc-hscroll { overflow-x: auto; padding: 8px 10px 2px; }
.tc-oc-hscroll svg { display: block; width: 100%; min-width: 680px; height: auto; aspect-ratio: 1000 / 350; }
.tc-oc-b { stroke: none; }
.tc-oc-b.f-up { fill: var(--rise); } .tc-oc-b.f-down { fill: var(--fall); } .tc-oc-b.f-warn { fill: var(--warn); }
.tc-oc-b.f-acc { fill: var(--accent); } .tc-oc-b.f-flat { fill: var(--faint); }
.tc-oc-b.cur { stroke: var(--accent); stroke-width: 1.5; }
.tc-oc-b.hov { stroke: var(--text); stroke-width: 1.5; }
.tc-oc-ax { stroke: var(--border-strong); stroke-width: 1; }
.tc-oc-tk { fill: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.tc-oc-now line { stroke: var(--accent); stroke-width: 2; }
.tc-oc-now rect { fill: var(--panel); stroke: var(--accent); stroke-width: 1; }
.tc-oc-now text { fill: var(--text); font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tc-oc-hit { fill: transparent; cursor: crosshair; }
.tc-oc-tip { position: absolute; z-index: 5; width: 196px; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel);
  box-shadow: var(--shadow-md); font-size: 12px; line-height: 1.55; color: var(--text-2); pointer-events: none; font-variant-numeric: tabular-nums; }
.tc-oc-tip .b { font-weight: 620; color: var(--text); }
.tc-oc-tip .v { margin: 3px 0 1px; font-size: 14px; font-weight: 650; color: var(--text); }
.tc-oc-ufoot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; }
.tc-oc-ufoot b { color: var(--text-2); font-weight: 600; }
.tc-oc-sec { margin: 16px 0 8px; font-size: 13px; font-weight: 640; color: var(--text); }
.tc-oc-accent { color: var(--accent); font-weight: 600; }
@media (max-width: 720px) {
  .term-doc .x-pl-ladder-box { grid-template-columns: minmax(0, 1fr); }
  .tc-oc-card { padding: 12px 12px 10px; }
  .tc-oc-cur { font-size: 17px; }
  .tc-oc-legend { gap: 2px 10px; font-size: 11.5px; }
}
@media (max-width: 520px) {
  .tc-oc-xt { display: none; }
  .tc-oc-key { padding: 1px 7px; font-size: 11.5px; line-height: 18px; }
  .tc-oc-legend.keys { gap: 3px 4px; }
  .tc-oc-urpd .tc-stat { padding: 8px 10px; }
  .tc-oc-urpd .tc-stat .v { font-size: 17px; }
}

/* bull / bear (牛熊周期总览): green = bull, red = bear under either 红涨绿跌 setting, as on the site */
.tc-oc-legend b.bull, .tc-oc-cfoot .bull { color: var(--fall); }
.tc-oc-legend b.bear, .tc-oc-cfoot .bear { color: var(--rise); }
:root.green-up :is(.tc-oc-legend b.bull, .tc-oc-cfoot .bull) { color: var(--rise); }
:root.green-up :is(.tc-oc-legend b.bear, .tc-oc-cfoot .bear) { color: var(--fall); }
/* the line under each chart: colour key · 自 <start> · 滚轮/拖动缩放 (the site's chart footer) */
.tc-oc-cfoot { margin-top: 6px; font-size: 11.5px; line-height: 1.6; color: var(--faint); }
.tc-oc-cfoot .up { color: var(--rise); } .tc-oc-cfoot .down { color: var(--fall); }

/* 指标指南 buttons (js/views/tc/guide.js; quiet like the ⓘ) and the guide drawer */
.tc-guide-btn { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 4px; border: 0; border-radius: 6px; background: none;
  color: var(--faint); font: inherit; font-size: 12px; font-weight: 400; line-height: 1; cursor: pointer; white-space: nowrap; transition: color 0.15s var(--ease); }
.tc-guide-btn svg { width: 14px; height: 14px; }
.tc-guide-btn:hover, .tc-guide-btn:focus-visible { color: var(--accent); outline: none; }
.tc-guide-btn:focus-visible { box-shadow: 0 0 0 3px var(--accent-ring); }
.tc-oc-gline { margin: 0 0 8px; }
.drawer.tc-guide { width: min(680px, 100vw); }
.drawer.tc-guide header h2 { font-size: 15.5px; line-height: 1.4; }
.drawer.tc-guide .scroll { padding: 16px 22px 28px; }
.tc-guide-note { font-size: 12.5px; color: var(--text-2); background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 11px; margin-bottom: 12px; }
.tc-guide-note .up { color: var(--rise); font-weight: 600; } .tc-guide-note .down { color: var(--fall); font-weight: 600; }
.tc-guide-sec + .tc-guide-sec { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.tc-guide-sec h3 { margin: 0 0 6px; font-size: 14.5px; font-weight: 650; color: var(--text); }
.drawer.tc-guide .prose { max-width: none; font-size: 13.5px; line-height: 1.75; }
.drawer.tc-guide .prose p { margin: 0.5em 0; }
.drawer.tc-guide .table-wrap { margin: 8px 0 10px; overflow-x: auto; }
.tc-guide-tbl { font-size: 12.5px; }
.tc-guide-tbl th, .tc-guide-tbl td { white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .drawer.tc-guide .scroll { padding: 14px 16px 24px; } .tc-guide-btn span { display: none; } }

/* URPD: date bar calendar (the site's month grid with ⤒ 最早 / 最新 ⤓), colour key, footnote */
.tc-oc-calw { position: relative; display: inline-flex; }
.tc-oc-dbtn { font-weight: 600; font-variant-numeric: tabular-nums; }
.tc-oc-dbtn.on { border-color: var(--accent); color: var(--accent); }
.tc-oc-calbg { position: fixed; inset: 0; z-index: 29; }
.tc-oc-cal { position: absolute; z-index: 30; top: calc(100% + 6px); right: 0; width: 264px; padding: 10px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--panel); box-shadow: var(--shadow-lg); font-size: 12.5px; }
.tc-oc-from .tc-oc-cal { left: 0; right: auto; }
.tc-oc-calh { display: flex; align-items: center; gap: 2px; margin-bottom: 6px; }
.tc-oc-calh b { flex: 1; text-align: center; color: var(--text); font-weight: 640; }
.tc-oc-calh button, .tc-oc-calg button, .tc-oc-calf button { border: 0; background: transparent; color: var(--text-2); font: inherit; cursor: pointer; border-radius: 7px; }
.tc-oc-calh button { width: 26px; height: 26px; color: var(--muted); }
.tc-oc-calg { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.tc-oc-calg i { font-style: normal; text-align: center; font-size: 11px; color: var(--faint); padding: 2px 0; }
.tc-oc-calg button { height: 30px; font-variant-numeric: tabular-nums; }
.tc-oc-calh button:hover:not(:disabled), .tc-oc-calg button:hover:not(:disabled), .tc-oc-calf button:hover { background: var(--hover); color: var(--text); }
.tc-oc-calg button:disabled, .tc-oc-calh button:disabled { color: var(--faint); opacity: 0.4; cursor: default; }
.tc-oc-calg button.on { background: var(--accent-fill); color: #fff; font-weight: 650; }
.tc-oc-calf { display: flex; justify-content: space-between; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.tc-oc-calf button { padding: 4px 6px; font-size: 11.5px; color: var(--accent); white-space: nowrap; }
.tc-oc-ukey { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; font-size: 11.5px; color: var(--faint); }
.tc-oc-ukey > span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.tc-oc-ukey .sw { width: 9px; height: 9px; border-radius: 2px; }
.tc-oc-ukey .sw.up { background: var(--rise); } .tc-oc-ukey .sw.down { background: var(--fall); } .tc-oc-ukey .sw.warn { background: var(--warn); }
.tc-oc-ukey .sw.acc { background: var(--accent); } .tc-oc-ukey .sw.flat { background: var(--faint); opacity: 0.6; }
.tc-oc-ukey .sw.box { background: transparent; border: 1.5px solid var(--accent); }
.tc-oc-ufoot { margin-top: 6px; font-size: 11.5px; line-height: 1.6; color: var(--faint); font-variant-numeric: tabular-nums; }
@media (max-width: 520px) {
  .tc-oc-ukey { width: 100%; }
  .tc-oc-cal { position: fixed; top: 96px; right: auto; left: 50%; transform: translateX(-50%); }
}

/* BTC 面板 (/): the cards flow down balanced columns (masonry) at least 320px wide — 3 when the page is wide enough, 2 at our
   usual width, 1 on phones — so a short card never leaves a hole beside a long one; a long reading wraps at the right rather
   than crushing its label. (Only this page has a top-level group of 3+ panels.) */
#term-main .term-doc > .x-s-groups:has(> .x-panel:nth-child(3)) { display: block; columns: 3 320px; column-gap: 16px; }
#term-main .term-doc > .x-s-groups:has(> .x-panel:nth-child(3)) > .x-panel { break-inside: avoid; margin: 0 0 16px; }
#term-main .term-doc > .x-s-groups:has(> .x-panel:nth-child(3)) .x-s-item .x-lbl { flex: 1 1 auto; min-width: 4.2em; }
#term-main .term-doc > .x-s-groups:has(> .x-panel:nth-child(3)) .x-s-item .x-val { flex: 0 1 auto; white-space: normal; text-align: right; }
/* 定价模型: the site's ETF-cost footnote under the chart reads as a footnote (small), not as body text */
#term-main .term-doc:has(> .x-pl-ladder-box) > div[style*="--faint"] { font-size: 12px; line-height: 1.7; }
