/* LL SCOPE · 主网行情观测台 —— 深色终端风格，与 Lead-Lag 控制台同族 */

:root {
  --bg: #0b0d10;
  --bg-panel: #101318;
  --line: #1d232c;
  --line-soft: #161b22;
  --text: #d7dde5;
  --text-dim: #7b8694;
  --text-faint: #4c5665;
  --amber: #f0b90b;
  --teal: #3fd0c9;
  --up: #2ebd85;
  --down: #f6465d;
  --warn: #f0b90b;
  --mono: "SF Mono", "JetBrains Mono", "Menlo", "Consolas", monospace;
  --sans: -apple-system, "PingFang SC", "Helvetica Neue", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

/* ---- 顶栏 ---- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(11, 13, 16, 0.92);
  backdrop-filter: blur(8px);
  z-index: 10;
}

.brand-block { display: flex; align-items: center; gap: 12px; }

.brand-mark {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 1px;
  color: var(--text);
}

.brand-mark .cursor {
  color: var(--teal);
  animation: blink 1.2s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.brand-text h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.eyebrow {
  margin: 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--text-faint);
}

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

.window-switch {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

.window-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 12px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}

.window-btn:hover { color: var(--text); }
.window-btn:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; }

.window-btn.active {
  background: var(--line);
  color: var(--text);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
}

.status-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-faint);
  transition: background 200ms ease;
}

.status-pill.live { color: var(--up); }
.status-pill.live .dot { background: var(--up); box-shadow: 0 0 6px var(--up); }
.status-pill.stale { color: var(--warn); }
.status-pill.stale .dot { background: var(--warn); }
.status-pill.down { color: var(--down); }
.status-pill.down .dot { background: var(--down); }

.disk-meter {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 10px;
}

.disk-meter.low { color: var(--warn); border-color: var(--warn); }

/* ---- 市场区块 ---- */

.symbols {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
  max-width: 1440px;
  margin: 0 auto;
}

.symbol-section {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px 18px;
}

.symbol-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.symbol-name {
  margin: 0;
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.stat-grid {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.stat { display: flex; flex-direction: column; min-width: 64px; }

.stat-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-faint);
}

.stat-value {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stat-value.amber { color: var(--amber); }
.stat-value.teal { color: var(--teal); }
.stat-value.up { color: var(--up); }
.stat-value.down { color: var(--down); }
.stat-value.stale { color: var(--warn); }

.chart-block { margin-top: 10px; }

.chart-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.chart-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  color: var(--text-faint);
}

.chart-legend .sw {
  display: inline-block;
  width: 14px;
  height: 2px;
  margin-left: 8px;
  vertical-align: middle;
}

.chart-legend .sw.amber { background: var(--amber); }
.chart-legend .sw.teal { background: var(--teal); }

.chart-frame { position: relative; }

.chart-frame canvas {
  display: block;
  width: 100%;
  touch-action: none;
}

.price-chart { height: 260px; }
.basis-chart { height: 150px; }

.chart-tip {
  position: absolute;
  pointer-events: none;
  background: rgba(13, 16, 21, 0.95);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 9px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text);
  white-space: pre;
  z-index: 5;
  transform: translate(-50%, 0);
}

.chart-tip.hidden { display: none; }

.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 20px 22px;
  border-top: 1px solid var(--line-soft);
  color: var(--text-faint);
  font-family: var(--mono);
  font-size: 11px;
}

/* ---- 响应式 ---- */

@media (max-width: 720px) {
  .topbar { padding: 12px 14px; }
  .symbols { padding: 14px; gap: 14px; }
  .symbol-section { padding: 12px 12px 14px; }
  .stat-grid { gap: 12px; }
  .stat { min-width: 56px; }
  .price-chart { height: 190px; }
  .basis-chart { height: 110px; }
  .brand-text h1 { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .brand-mark .cursor { animation: none; }
  * { transition: none !important; }
}
