:root {
  color-scheme: dark;
  --bg-void: #080a0e;
  --bg-panel: #0d1017;
  --bg-elevated: #121721;
  --bg-hover: #171d2a;
  --line: #1e2533;
  --line-subtle: #161b26;
  --ink: #e7ebf3;
  --ink-secondary: #8c96a9;
  --ink-muted: #5a6477;
  --amber: #e5a93c;
  --amber-bright: #f5c451;
  --amber-dim: rgba(229, 169, 60, 0.14);
  --amber-border: rgba(229, 169, 60, 0.35);
  --up: #f23645;
  --up-bg: rgba(242, 54, 69, 0.12);
  --down: #00b070;
  --down-bg: rgba(0, 176, 112, 0.12);
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", "Roboto Mono", "Menlo", "Consolas", "Liberation Mono", monospace;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  background: var(--bg-void);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg-void);
  color: var(--ink);
  overflow-x: hidden;
  font-size: 12px;
  line-height: 1.4;
}

button, a {
  font: inherit;
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
}

/* 终端主框架：桌面端一屏紧凑布局 */
.terminal-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 1920px;
  margin: 0 auto;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: var(--bg-void);
}

/* 1. 顶部紧凑导航与行情 Ticker */
.site-header {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--line);
  gap: 12px;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.brand-mark {
  width: 24px;
  height: 24px;
  border-radius: 3px;
  background: var(--amber-dim);
  border: 1px solid var(--amber-border);
  color: var(--amber-bright);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 12px;
  display: grid;
  place-items: center;
}

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.brand-text strong {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--ink);
}

.brand-text small {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  color: var(--amber);
}

.header-divider {
  width: 1px;
  height: 18px;
  background: var(--line);
  flex-shrink: 0;
}

.ticker-tape {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 2px;
  background: var(--bg-elevated);
  border: 1px solid var(--line-subtle);
  font-size: 11px;
  white-space: nowrap;
}

.ticker-item.active {
  border-color: rgba(229, 169, 60, 0.28);
}

.ticker-sym {
  font-family: var(--mono);
  font-weight: 700;
  color: var(--amber);
  font-size: 11px;
}

.ticker-name {
  color: var(--ink-secondary);
  font-size: 11px;
}

.ticker-val {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--ink);
}

.ticker-chg {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: var(--ink-secondary);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 100%;
}

.main-nav a {
  height: 100%;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  font-size: 12px;
  color: var(--ink-secondary);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, background-color 0.15s;
}

.main-nav a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.02);
}

.main-nav .nav-active {
  color: var(--amber-bright);
  border-bottom-color: var(--amber);
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.clock-box {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--line-subtle);
  border-radius: 2px;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}

.clock-label {
  color: var(--ink-muted);
  font-size: 10px;
}

.clock-box strong {
  color: var(--ink);
  font-weight: 600;
}

.conn-box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.header-status {
  font-size: 11px;
  color: var(--ink-secondary);
}

.live-dot, .tiny-indicator {
  width: 6px;
  height: 6px;
  background: var(--amber);
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.live-dot.ready, .tiny-indicator.ready {
  background: #00b070;
  box-shadow: 0 0 6px rgba(0, 176, 112, 0.55);
}

.live-dot.error, .tiny-indicator.error {
  background: #f23645;
  box-shadow: 0 0 6px rgba(242, 54, 69, 0.55);
}

.outline-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  padding: 0 10px;
  border-radius: 2px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  transition: border-color 0.15s, background-color 0.15s, color 0.15s;
}

.outline-btn:hover:not(:disabled) {
  border-color: var(--amber);
  color: var(--amber-bright);
  background: var(--bg-hover);
}

.outline-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

/* 顶部提示栏 */
.notice {
  border-bottom: 1px solid rgba(229, 169, 60, 0.35);
  background: rgba(229, 169, 60, 0.09);
  color: var(--amber-bright);
  padding: 6px 12px;
  font-size: 11px;
  line-height: 1.4;
  display: flex;
  align-items: center;
  gap: 8px;
}

.notice[hidden] {
  display: none !important;
}

.notice::before {
  content: "NOTICE";
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  background: rgba(229, 169, 60, 0.2);
  border: 1px solid rgba(229, 169, 60, 0.4);
  border-radius: 2px;
  flex-shrink: 0;
}

/* 主体布局容器 */
.terminal-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* 2. 中间上方：合约核心报价与 OHLC 统计横条 */
.instrument-bar {
  display: grid;
  grid-template-columns: auto 1fr;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--line);
  align-items: stretch;
}

.quote-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 8px 14px;
  border-right: 1px solid var(--line);
  flex-wrap: wrap;
}

.hero-identity {
  display: flex;
  align-items: center;
  gap: 9px;
}

.symbol-icon {
  width: 32px;
  height: 32px;
  background: rgba(229, 169, 60, 0.12);
  border: 1px solid var(--amber-border);
  border-radius: 3px;
  color: var(--amber-bright);
  font-family: var(--mono);
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.identity-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hero-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.sym-badge {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--amber-bright);
  background: var(--amber-dim);
  border: 1px solid rgba(229, 169, 60, 0.28);
  padding: 0 5px;
  border-radius: 2px;
}

.hero-market {
  color: var(--ink-muted);
  font-size: 10px;
  white-space: nowrap;
}

.hero-price-block {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.hero-price-row {
  display: flex;
  align-items: baseline;
  gap: 3px;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.hero-price-row .currency {
  color: var(--amber);
  font-weight: 600;
  font-size: 15px;
}

.hero-price-row strong {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1;
  color: var(--ink);
}

.price-unit {
  font-size: 11px;
  color: var(--ink-muted);
  margin-left: 2px;
}

.hero-change-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.price-change {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-secondary);
  white-space: nowrap;
}

.change-basis {
  font-size: 10px;
  color: var(--ink-muted);
  white-space: nowrap;
}

/* 中国期货交易所标准：涨红跌绿 */
.up,
.price-change.up,
.asset-price span.up,
.ticker-chg.up,
.hero-price-row strong.up {
  color: var(--up) !important;
}

.down,
.price-change.down,
.asset-price span.down,
.ticker-chg.down,
.hero-price-row strong.down {
  color: var(--down) !important;
}

.hero-status-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding-left: 14px;
  border-left: 1px solid var(--line-subtle);
}

.status-pill {
  font-size: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  color: var(--ink-secondary);
  padding: 2px 7px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 2px;
  font-weight: 600;
  white-space: nowrap;
}

.status-pill i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ink-muted);
}

.status-pill.recent {
  color: #26d08c;
  background: rgba(0, 176, 112, 0.1);
  border-color: rgba(0, 176, 112, 0.3);
}

.status-pill.recent i {
  background: #00b070;
}

.status-pill.delayed {
  background: rgba(229, 169, 60, 0.12);
  color: var(--amber-bright);
  border-color: rgba(229, 169, 60, 0.35);
}

.status-pill.delayed i {
  background: var(--amber);
}

.status-pill.closed,
.status-pill.invalid {
  background: var(--bg-elevated);
  color: var(--ink-secondary);
}

.quote-time {
  color: var(--ink-muted);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 10px;
  white-space: nowrap;
}

/* 核心 OHLC 指标条 */
.key-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: center;
}

.stat-card {
  padding: 7px 12px;
  border-right: 1px solid var(--line-subtle);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  height: 100%;
}

.stat-card:last-child {
  border-right: 0;
}

.stat-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  color: var(--ink-secondary);
  gap: 4px;
  white-space: nowrap;
}

.stat-title span {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-muted);
}

.stat-value {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-foot {
  font-size: 9px;
  color: var(--ink-muted);
  display: none;
}

/* 3. 主工作区：左侧K线主图 + 右侧自选与数据状态 */
.content-grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  border-bottom: 1px solid var(--line);
  min-height: 460px;
}

.panel {
  background: var(--bg-panel);
  min-width: 0;
}

.chart-panel {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  min-width: 0;
}

.chart-toolbar {
  height: 36px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-elevated);
}

.chart-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.kline-badge {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--bg-void);
  background: var(--amber);
  padding: 1px 6px;
  border-radius: 2px;
  flex-shrink: 0;
}

.chart-toolbar h2 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

.chart-sub {
  font-size: 11px;
  color: var(--ink-muted);
  white-space: nowrap;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ma-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}

.ma-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--ink-secondary);
}

.ma-item i {
  width: 8px;
  height: 2px;
  display: inline-block;
}

.ma-item b {
  font-weight: 600;
}

.ma5 i { background: #f5c451; }
.ma5 b { color: #f5c451; }
.ma10 i { background: #38bdf8; }
.ma10 b { color: #38bdf8; }
.ma20 i { background: #c084fc; }
.ma20 b { color: #c084fc; }

.segmented {
  display: flex;
  background: var(--bg-void);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 1px;
  gap: 1px;
}

.segmented button {
  font-family: var(--mono);
  font-size: 11px;
  background: transparent;
  border: 0;
  color: var(--ink-secondary);
  padding: 3px 9px;
  border-radius: 1px;
  white-space: nowrap;
  transition: background-color 0.12s, color 0.12s;
}

.segmented button:hover {
  color: var(--ink);
}

.segmented button.selected {
  background: var(--amber-dim);
  color: var(--amber-bright);
  font-weight: 700;
}

/* K线顶部实时 OHLCV 数据条 */
.chart-ohlc-bar {
  height: 28px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line-subtle);
  background: rgba(18, 23, 33, 0.55);
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chart-ohlc-bar::-webkit-scrollbar {
  display: none;
}

.ohlc-item {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}

.ohlc-item small {
  font-family: var(--sans);
  font-size: 10px;
  color: var(--ink-muted);
}

.ohlc-item b {
  font-weight: 600;
  color: var(--ink);
}

/* K线 SVG 画布 */
.chart-canvas {
  flex: 1;
  min-height: 360px;
  position: relative;
  background:
    linear-gradient(180deg, rgba(229, 169, 60, 0.02) 0%, rgba(13, 16, 23, 0) 40%),
    var(--bg-panel);
  user-select: none;
}

.chart-canvas svg {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  color: var(--ink-muted);
  background: rgba(13, 16, 23, 0.86);
}

.chart-placeholder strong {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.chart-placeholder span:last-child {
  font-size: 11px;
}

.chart-empty-icon {
  font-family: var(--mono);
  font-size: 28px;
  color: var(--amber);
}

.chart-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(14, 18, 26, 0.95);
  border: 1px solid var(--amber-border);
  color: var(--ink);
  padding: 7px 10px;
  border-radius: 2px;
  z-index: 5;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  line-height: 1.55;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
}

.chart-tooltip .tip-date {
  font-weight: 700;
  color: var(--amber-bright);
  border-bottom: 1px solid var(--line);
  padding-bottom: 3px;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.chart-tooltip .tip-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.chart-tooltip .tip-row span {
  color: var(--ink-secondary);
}

.chart-bottom {
  height: 28px;
  padding: 0 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--line);
  background: var(--bg-elevated);
  color: var(--ink-muted);
  font-size: 10px;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.legend-candle {
  width: 8px;
  height: 8px;
  display: inline-block;
  border-radius: 1px;
}

.legend-candle.up {
  background: var(--up);
}

.legend-candle.down {
  background: var(--down);
}

.legend-sep {
  color: var(--line);
  margin: 0 2px;
}

.chart-legend small {
  color: var(--ink-muted);
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-date-tag {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink-secondary);
  white-space: nowrap;
}

/* 4. 右侧栏：自选品种列表 + 日内区间 + 真实数据状态 */
.market-panel {
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
}

.side-section {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.side-section:last-child {
  border-bottom: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.section-label {
  color: var(--amber);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.6px;
  font-weight: 700;
}

.side-sub {
  font-size: 10px;
  color: var(--ink-muted);
}

.watchlist-table {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--bg-void);
}

.asset-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-subtle);
  gap: 8px;
}

.asset-row:last-child {
  border-bottom: 0;
}

.asset-row.primary {
  background: rgba(229, 169, 60, 0.04);
  border-left: 2px solid var(--amber);
}

.asset-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.asset-coin {
  width: 26px;
  height: 26px;
  border-radius: 2px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 12px;
}

.goldcoin {
  background: rgba(229, 169, 60, 0.14);
  color: var(--amber-bright);
  border: 1px solid rgba(229, 169, 60, 0.3);
}

.silvercoin {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.asset-title > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.asset-title strong {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.asset-title small {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-muted);
}

.asset-price {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.asset-price strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.asset-price span {
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.ag-mini-metrics {
  margin-top: 6px;
  padding: 5px 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--line-subtle);
  border-radius: 2px;
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.ag-mini-metrics b {
  color: var(--ink-secondary);
  font-weight: 600;
}

/* 日内区间与快照 */
.range-values {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.range-values > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.range-values span {
  font-size: 10px;
  color: var(--ink-muted);
}

.range-values strong {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.right-align {
  text-align: right;
}

.range-track {
  height: 5px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(0, 176, 112, 0.35), rgba(229, 169, 60, 0.45), rgba(242, 54, 69, 0.45));
  border: 1px solid var(--line);
  position: relative;
  margin: 8px 0 10px;
}

.range-cursor {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--amber-bright);
  border: 1px solid var(--bg-void);
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 6px rgba(245, 196, 81, 0.7);
  left: 50%;
}

.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.side-metrics {
  background: var(--bg-elevated);
  border: 1px solid var(--line-subtle);
  border-radius: 2px;
  padding: 5px 7px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side-metrics span {
  color: var(--ink-muted);
  font-size: 10px;
}

.side-metrics strong {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 数据管道状态列表 */
.pipeline-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-subtle);
  background: var(--bg-void);
  border-radius: 2px;
}

.pipeline-row {
  padding: 6px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line-subtle);
  gap: 8px;
}

.pipeline-row:last-child {
  border-bottom: 0;
}

.pipeline-name {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-secondary);
  font-size: 11px;
  white-space: nowrap;
}

.pipeline-row strong {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 10px;
  font-weight: 600;
  color: var(--ink);
  text-align: right;
}

.verify-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
}

.source-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--ink-secondary);
  font-size: 10px;
  font-weight: 600;
  transition: border-color 0.15s, color 0.15s;
}

.source-link span {
  font-family: var(--mono);
  color: var(--amber);
}

.source-link:hover {
  border-color: var(--amber);
  color: var(--ink);
}

/* 5. 底部紧凑采集说明与状态栏 */
.system-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--line);
}

.system-panel {
  padding: 7px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-right: 1px solid var(--line);
  font-size: 11px;
  color: var(--ink-secondary);
  flex-wrap: wrap;
}

.sys-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sys-tag {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--amber);
  background: var(--amber-dim);
  padding: 1px 5px;
  border-radius: 2px;
  flex-shrink: 0;
}

.sys-sep {
  width: 1px;
  height: 12px;
  background: var(--line);
}

.note-panel {
  padding: 7px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(18, 23, 33, 0.6);
}

.note-mark {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border: 1px solid var(--amber-border);
  color: var(--amber-bright);
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  border-radius: 2px;
}

.note-panel p {
  font-size: 10px;
  line-height: 1.45;
  color: var(--ink-muted);
  margin: 0;
}

.note-panel strong {
  color: var(--ink-secondary);
}

/* 页脚状态条 */
.terminal-footer {
  height: 28px;
  padding: 0 12px;
  background: var(--bg-void);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  color: var(--ink-muted);
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-symbol {
  font-family: var(--mono);
  color: var(--amber);
  font-size: 11px;
  font-weight: 700;
}

.footer-logo strong {
  color: var(--ink-secondary);
  font-size: 11px;
}

.footer-logo > span:last-child {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-muted);
}

.footer-links {
  display: flex;
  gap: 14px;
  font-size: 10px;
  color: var(--ink-secondary);
}

.footer-links a:hover {
  color: var(--amber-bright);
}

/* 响应式适配：平板与手机端无横向溢出 */
@media (max-width: 1200px) {
  .ticker-tape {
    display: none;
  }
  .header-divider {
    display: none;
  }
  .instrument-bar {
    grid-template-columns: 1fr;
  }
  .quote-hero {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .content-grid {
    grid-template-columns: minmax(0, 1fr) 290px;
  }
  .system-grid {
    grid-template-columns: 1fr;
  }
  .system-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line-subtle);
  }
}

@media (max-width: 860px) {
  .main-nav {
    display: none;
  }
  .content-grid {
    grid-template-columns: 1fr;
  }
  .chart-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .key-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .stat-card:nth-child(-n+3) {
    border-bottom: 1px solid var(--line-subtle);
  }
  .chart-toolbar {
    height: auto;
    padding: 8px 10px;
    flex-wrap: wrap;
  }
  .toolbar-right {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
  }
}

@media (max-width: 560px) {
  .site-header {
    padding: 0 8px;
    gap: 6px;
  }
  .brand-text small,
  .header-status,
  .clock-label,
  .chart-sub {
    display: none;
  }
  .quote-hero {
    padding: 10px;
    gap: 10px;
  }
  .hero-status-block {
    width: 100%;
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--line-subtle);
    padding-top: 6px;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
  .key-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat-card {
    border-bottom: 1px solid var(--line-subtle);
  }
  .ma-legend {
    font-size: 10px;
    gap: 6px;
  }
  .segmented {
    width: 100%;
  }
  .segmented button {
    flex: 1;
    text-align: center;
  }
  .chart-canvas {
    min-height: 300px;
  }
  .chart-legend small {
    display: none;
  }
  .terminal-footer {
    height: auto;
    padding: 8px 10px;
    flex-wrap: wrap;
    gap: 6px;
  }
  .footer-copy {
    width: 100%;
    order: 3;
  }
}
