/* Research terminal: the page head and its ⋯ menu (terminal.js), the ⓘ help, article nav and adapter kit (js/views/tc/kit.js):
   key figures, hero figure, pills, rules, notes, time-series legend; and the few site-sheet overrides the shell needs. */
/* key figures: one row of label / value pairs split by hairlines (no tiles inside the card); the first of each row has no rule */
.tc-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); row-gap: 14px; margin: 4px 0 4px -16px; overflow: hidden; }
.tc-stat { padding: 0 16px; margin-left: -1px; border-left: 1px solid var(--border); min-width: 0; }
.tc-stat .k { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-stat .v { font-size: 17px; font-weight: 620; color: var(--text); font-variant-numeric: tabular-nums; margin-top: 2px; overflow-wrap: anywhere; line-height: 1.35; }
.tc-stat .v.up { color: var(--rise); } .tc-stat .v.down { color: var(--fall); }
.tc-stat .h { font-size: 11.5px; color: var(--faint); margin-top: 2px; }
.tc-hero { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 2px 0 12px; }
/* a big figure stays in the text colour; its direction is the small ▲ / ▼ */
.tc-hero-v { font-size: 34px; font-weight: 680; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--text); }
.tc-hero-v.up::before, .tc-hero-v.down::before { font-size: 0.42em; vertical-align: 0.42em; margin-right: 6px; }
.tc-hero-v.up::before { content: "▲"; color: var(--rise); } .tc-hero-v.down::before { content: "▼"; color: var(--fall); }
.tc-hero-k { color: var(--muted); font-size: 13.5px; }
.tc-pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 12px; line-height: 20px;
  background: var(--hover); color: var(--text-2); white-space: nowrap; }
.tc-pill.up { background: var(--rise-soft); color: var(--rise); } .tc-pill.down { background: var(--fall-soft); color: var(--fall); }
.tc-pill.warn { background: var(--warn-soft); color: var(--warn); } .tc-pill.info { background: var(--info-soft); color: var(--info); }
.tc-rules { margin-top: 10px; font-size: 13px; color: var(--text-2); }
.tc-rules summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }
.tc-rules ol { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 4px; }
.tc-notes { margin-top: 10px; font-size: 12px; color: var(--faint); display: grid; gap: 3px; }
.tc-notes p { margin: 0; }
.tc-empty, .tc-more { padding: 8px 12px; }
.tc-panel + .tc-panel, .tc-island + .tc-panel, .tc-panel + .tc-island { margin-top: 16px; }
.tc-head .spacer { flex: 1; }
.tc-fold > summary { cursor: pointer; display: flex; align-items: baseline; gap: 10px; list-style: none; }
.tc-fold > summary::-webkit-details-marker { display: none; }
.tc-fold > summary::before { content: "›"; color: var(--muted); transition: transform 0.15s var(--ease); display: inline-block; }
.tc-fold[open] > summary::before { transform: rotate(90deg); }
.tc-fold-body { margin-top: 12px; }
.tc-seg { display: inline-flex; }
.tc-ts { width: 100%; }
.tc-ts-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; min-height: 20px; margin-bottom: 4px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tc-ts-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; vertical-align: 0; }
.tc-ts-legend b { color: var(--text); font-weight: 600; }
.tc-table td.num, .tc-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
  .tc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tc-hero-v { font-size: 28px; }
}

/* ------------------------------------------------------------------ page head: title · tag · ⓘ … data day · N 分钟前更新 · 北京时间 · ⋯ */
.term-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; min-height: 36px; }
.term-title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; flex: 1 1 320px; min-width: 0; }
.term-h1 { margin: 0; font-size: 20px; font-weight: 650; line-height: 1.35; letter-spacing: -0.01em; color: var(--text); overflow-wrap: anywhere; }
.term-tag { padding: 0 8px; border-radius: 6px; background: var(--hover); color: var(--muted); font-size: 12px; line-height: 22px; white-space: nowrap; }
.term-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.term-live { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.term-live:empty { display: none; }
.term-day, .term-upd, .term-snap { white-space: nowrap; }
.term-tz { color: var(--faint); white-space: nowrap; cursor: help; }
.term-more { flex: none; }
.term-more > summary.btn { width: 32px; padding: 0; }
.term-more > summary svg { width: 16px; height: 16px; }
.term-menu { display: flex; flex-direction: column; gap: 1px; min-width: 210px; padding: 6px; }
.term-menu > button, .term-menu > a { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px;
  background: none; font: inherit; font-size: 13px; color: var(--text-2); text-align: left; text-decoration: none; cursor: pointer; }
.term-menu > button:hover, .term-menu > a:hover { background: var(--hover); text-decoration: none; }
.term-menu svg { width: 15px; height: 15px; color: var(--muted); flex: none; }
.term-mrow { display: grid; gap: 6px; margin-top: 4px; padding: 10px 10px 6px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.term-mrow > span { display: flex; align-items: center; gap: 10px; }
.term-mrow select { width: 100%; max-width: none; }
@container term-main (max-width: 560px) {
  .term-head { gap: 4px 10px; }
  .term-title { flex-basis: calc(100% - 52px); }
  .term-h1 { font-size: 18px; }
  .term-more { order: 1; }
  .term-meta { order: 2; flex-basis: 100%; gap: 4px 12px; }
}

/* ------------------------------------------------------------------ ⓘ help (kit info / foldFine): one quiet icon, a popover or the help drawer.
   Plain one-line tips use lib help(); this one carries html (the site's fine print, tables, rules) and long text opens a drawer. */
.tc-info { display: inline-flex; align-items: center; vertical-align: middle; flex: none; line-height: 1; }
.tc-info-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 18px; height: 18px; margin: 0; padding: 0;
  border: 0; border-radius: 50%; background: none; color: var(--faint); font: inherit; font-size: 12px; font-weight: 400; letter-spacing: 0;
  text-transform: none; cursor: pointer; }
.tc-info-btn svg { width: 15px; height: 15px; flex: none; }
.tc-info-btn:hover, .tc-info-btn[aria-expanded="true"] { color: var(--muted); }  /* looks like lib help(): one ⓘ across the app */
.tc-info-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.tc-info.text .tc-info-btn { border-radius: 6px; padding: 0 4px 0 2px; margin-left: -2px; }
.tc-info-line { margin-top: 8px; line-height: 1; }
.tc-info-pop { position: fixed; z-index: 70; max-width: min(320px, calc(100vw - 24px)); padding: 10px 12px; border-radius: 10px; background: var(--panel);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg); color: var(--text-2); font-size: 12.5px; line-height: 1.7; overflow-wrap: anywhere;
  animation: fade 0.12s var(--ease); }
/* fine print moved in keeps its words, not its page styling (margins, rules, colours) */
.tc-info-pop.tc-info-pop > *, .tc-help-body.tc-help-body > *, .tc-help-sec.tc-help-sec > :not(h4) { margin: 0; padding: 0; border: 0; border-radius: 0;
  background: none; box-shadow: none; max-width: none; color: inherit; font-size: inherit; line-height: inherit; }
.tc-info-pop.tc-info-pop > * + *, .tc-help-sec.tc-help-sec > * + :not(h4) { margin-top: 6px; }
.tc-info-pop p, .tc-help-body p { margin: 0 0 4px; }
.tc-info-pop :is(b, strong), .tc-help-body :is(b, strong) { color: var(--text); font-weight: 600; }
.tc-info-pop .tc-info-more { color: var(--accent); }
.drawer.tc-help { width: min(540px, 100vw); }
.tc-help-body { display: grid; gap: 20px; font-size: 13.5px; line-height: 1.8; color: var(--text-2); }
.tc-help-body.tc-help-body > .tc-help-lead { color: var(--text); }
.tc-help-sec h4 { margin: 0 0 6px; font-size: 14px; font-weight: 620; color: var(--text); }
.tc-help-body :is(ol, ul) { margin: 4px 0; padding-left: 20px; display: grid; gap: 4px; }
.tc-help-body table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.tc-help-body :is(th, td) { padding: 5px 8px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.tc-help-body th { color: var(--muted); font-weight: 500; }

/* ------------------------------------------------------------------ article nav (kit artNav) and the reader */
.tc-artnav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.tc-artnav:empty { display: none; }
.tc-artnav .tc-artsel { flex: 0 1 380px; width: auto; min-width: 0; }
.tc-artn { font-size: 12px; color: var(--faint); white-space: nowrap; }
.tc-artnav .tc-art-next { margin-left: auto; }
.tc-artnav [aria-disabled="true"] { opacity: 0.4; pointer-events: none; box-shadow: none; }
.term-arts .card-body { padding-top: 12px; padding-bottom: 12px; }
@container term-main (max-width: 560px) {
  .tc-artnav .tc-artsel { order: -1; flex: 1 1 100%; }
  .tc-artn { display: none; }
}
.tc-reader-meta { font-size: 12.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
/* a paragraph the writer set all in bold reads as a lead line, not a shout */
.tc-reader .prose p.tc-lead { font-weight: 400; color: var(--text); }

/* AI 解读: no card until there is one (or one is being written); folded, it is one line */
.term-ai:empty { display: none; }
.term-ai-in:not(.open) > .card-head { padding-bottom: 14px; border-bottom: 0; }

/* ------------------------------------------------------------------ site-sheet overrides (the id outranks the mirrored sheet, loaded later) */
/* block labels read as card titles: the site's spaced grey caps become a plain heading */
#term-main .x-blocklabel { font-family: var(--font); font-size: 14px; font-weight: 620; letter-spacing: 0; color: var(--text); margin: 24px 0 10px; }
#term-main .x-blocklabel::after { opacity: 0.6; }
#term-main .x-blocklabel a { font-size: 12.5px; font-weight: 400; color: var(--muted); }
#term-main .x-blocklabel a:hover { color: var(--accent); }
#term-main :is(.xm-heroLab, .x-railcap) { letter-spacing: 0; }
#term-main .x-panel > .x-blocklabel:first-child { margin-top: 2px; }
/* a row's explanation is one line until clicked (terminal.js toggles .open) */
#term-main .x-s-item .x-ctx { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
#term-main .x-s-item .x-ctx.open { display: block; -webkit-line-clamp: unset; }
/* 主线地图: phase labels are states, not up / down — neutral ink; the board reads as one ranked table on wide screens */
#term-main .xm-life { color: var(--text-2) !important; border-color: var(--border-strong); }
#term-main .xm-gate.xm-ok { background: var(--ok-soft); color: var(--ok); }  /* a passed gate is a state, not a rise */
@container term-main (min-width: 640px) {
  #term-main .xm-rows { gap: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--panel); }
  #term-main .xm-row { display: grid; grid-template-columns: minmax(200px, 1.5fr) minmax(90px, 1fr) minmax(250px, 1.6fr); align-items: center; gap: 18px;
    padding: 7px 14px; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: none; box-shadow: none; }
  #term-main .xm-row:first-child { border-top: 0; }
  #term-main .xm-row.xm-main { background: var(--accent-soft); }
  #term-main .xm-row > .xm-bar { margin: 0; }
  #term-main .xm-row > .xm-meta { margin: 0; flex-wrap: nowrap; justify-content: flex-start; white-space: nowrap; }
}
/* 牛熊周期总览: the one-line conclusion of the page's state card reads as its headline */
#term-main .term-doc > .x-panel > .x-ctx:first-child + div[style*="font-weight"] { font-size: 22px; line-height: 1.35; margin-top: 4px; }
#term-main .term-doc > .x-panel > .x-ctx:empty { display: none; }
