:root {
  --bg: #07080a;
  --panel: #0d1014;
  --panel-2: #11151b;
  --border: rgba(255, 255, 255, 0.07);
  --border-2: rgba(255, 255, 255, 0.13);
  --text: #e9ecef;
  --muted: #838c99;
  --dim: #5b6472;
  --accent: #6d8bff;
  --up: #3ddc97;
  --down: #ff6b6b;
  --warn: #f2b45c;
  --violet: #a78bfa;
  --sans: "Inter", "Segoe UI Variable", "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --mono: "SF Mono", "Cascadia Mono", "JetBrains Mono", Consolas, "Roboto Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

/* hidden 属性必须真的隐藏。
 * .account / .replay-bar 这类组件自己写了 display:flex，会盖掉浏览器默认的
 * [hidden]{display:none}——结果就是「退出登录后头像栏还挂着」「没登录就显示
 * 时间轴」。一条 !important 收掉这类问题。 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 480px at 50% -12%, rgba(109, 139, 255, 0.13), transparent 62%),
    radial-gradient(700px 400px at 88% 0%, rgba(167, 139, 250, 0.07), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #07080a; }
::-webkit-scrollbar-thumb { background: #1c2129; border-radius: 6px; border: 2px solid #07080a; }
::-webkit-scrollbar-thumb:hover { background: #2a313b; }

/* ------------------------------------------------------------------ 顶栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 20px;
  height: 60px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 8, 10, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.brand { display: flex; align-items: center; gap: 11px; }

.mark {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  transform: rotate(45deg);
  background: linear-gradient(135deg, #8fa6ff, #6d8bff 55%, #a78bfa);
  box-shadow: 0 0 14px rgba(109, 139, 255, 0.55);
}

.brand-title {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.19em;
  color: #dfe4ea;
  line-height: 1;
}

.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  margin-left: 8px;
}

.seg button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 6px 15px;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.seg button:hover { color: var(--text); }

.seg button.active {
  background: rgba(109, 139, 255, 0.14);
  color: #cfd9ff;
  box-shadow: inset 0 0 0 1px rgba(109, 139, 255, 0.28);
}

.actions { margin-left: auto; display: flex; align-items: center; gap: 16px; }

.stamp {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--dim);
  letter-spacing: 0.04em;
}

.live {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--up);
  box-shadow: 0 0 8px var(--up);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.28; }
}

.btn-refresh {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-2);
  background: linear-gradient(180deg, #171b22, #101319);
  color: #c8cfd8;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
  transition: border-color 0.16s, color 0.16s, transform 0.16s;
}

.btn-refresh:hover { border-color: rgba(109, 139, 255, 0.5); color: #fff; }
.btn-refresh:active { transform: translateY(1px); }
.btn-refresh:disabled { opacity: 0.55; cursor: default; }
.btn-refresh.loading svg { animation: spin 0.9s linear infinite; }

/* ---------------------------------------------------------- 时间回看 */
/* 一条从「实时」往左拖的时间轴。拖动时暂停自动刷新，右上角的时间变成琥珀色，
 * 一眼能看出现在看的不是实时数据。 */
.replay-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 20px;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(23, 27, 34, 0.55), rgba(13, 16, 20, 0.55));
}

.replay-head { display: flex; align-items: center; gap: 12px; }

.replay-label {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--dim);
  text-transform: uppercase;
}

.replay-span {
  padding: 4px 8px;
  border-radius: 7px;
  border: 1px solid var(--border-2);
  background: #101319;
  color: #c8cfd8;
  font-family: var(--sans);
  font-size: 11.5px;
  cursor: pointer;
}

.replay-at {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.replay-at.on { color: var(--warn); }

#replayLive { padding: 4px 10px; font-size: 11.5px; }
#replayCsv { padding: 4px 10px; font-size: 11.5px; }

#replayRange {
  width: 100%;
  height: 20px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

/* 回看状态：顶部那个「实时」绿点要变成琥珀色，不然用户会以为在刷实时数据 */
.stamp.replay { color: var(--warn); }
.stamp.replay .live {
  background: var(--warn);
  box-shadow: 0 0 8px var(--warn);
  animation: none;
}

.png-btn {
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-2);
  background: transparent;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: color 0.16s, border-color 0.16s;
}

.png-btn:hover { color: #fff; border-color: rgba(109, 139, 255, 0.5); }

.panel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

/* ------------------------------------------------------------- 健康提示 */
/* 采集器停了、行情抓不到的时候，页面不能只是「数据不动」——用户会以为市场清淡。 */
.health-bar {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(242, 180, 92, 0.35);
  background: rgba(242, 180, 92, 0.08);
  color: #f2c884;
  font-size: 12px;
  line-height: 1.5;
}

.health-bar[data-level="error"] {
  border-color: rgba(255, 107, 107, 0.45);
  background: rgba(255, 107, 107, 0.09);
  color: #ffb3b3;
}

.health-bar[data-level="info"] {
  border-color: rgba(109, 139, 255, 0.4);
  background: rgba(109, 139, 255, 0.08);
  color: #b9c6ff;
}

.health-bar .link-btn {
  margin-left: 10px;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  font-size: 11px;
  cursor: pointer;
}

/* ---------------------------------------------------------- 只读 API key */
.api-panel {
  position: fixed;
  top: 62px;
  right: 22px;
  z-index: 40;
  width: min(420px, calc(100vw - 32px));
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-2);
  background: #0d1014;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

.api-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 600;
  color: #dfe4ea;
  margin-bottom: 8px;
}

.api-panel-desc, .api-panel-hint {
  margin: 0 0 10px;
  font-size: 11px;
  line-height: 1.6;
  color: var(--muted);
}

.api-panel-hint {
  margin: 10px 0 0;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  word-break: break-all;
}

.api-key {
  display: block;
  padding: 8px 10px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--up);
  word-break: break-all;
}

.api-key.empty { color: var(--dim); }

.api-panel-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.acc-api {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.06em;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ 布局 */
main {
  position: relative;
  z-index: 1;
  max-width: 1420px;
  margin: 0 auto;
  padding: 34px 28px 40px;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 26px;
}

.eyebrow {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 10px;
}

.price {
  font-family: var(--mono);
  font-size: 44px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.chips { display: flex; gap: 8px; margin-top: 14px; }

.chip {
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

.chip.up { color: var(--up); border-color: rgba(61, 220, 151, 0.24); background: rgba(61, 220, 151, 0.07); }
.chip.down { color: var(--down); border-color: rgba(255, 107, 107, 0.24); background: rgba(255, 107, 107, 0.07); }

.hero-side { text-align: right; padding-bottom: 6px; }
.regime {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #cfd6e0;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.regime::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(109, 139, 255, 0.9);
}

/* ------------------------------------------------------------------ KPI */
.kpis {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.kpi {
  position: relative;
  min-width: 0;
  padding: 15px 16px 14px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #101319 0%, #0b0d11 100%);
  overflow: hidden;
  transition: border-color 0.18s, transform 0.18s;
}

.kpi:hover { border-color: var(--border-2); transform: translateY(-1px); }

.kpi-label {
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-value {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.kpi-value.up { color: var(--up); }
.kpi-value.down { color: var(--down); }
.kpi-value.warn { color: var(--warn); }
.kpi-value.accent { color: var(--accent); }

.kpi-sub {
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.05);
}

.kpi-bar i {
  display: block;
  height: 100%;
  background: currentColor;
  opacity: 0.75;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ------------------------------------------------------------------ 面板 */
.panel {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #0f1217 0%, #0a0c10 100%);
  padding: 16px 18px 14px;
  min-width: 0;
}

.conclusion { margin-bottom: 12px; }

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  min-width: 0;
}

.panel-head h2, .panel-head h3 {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #dfe4ea;
}

.panel-head h2 { font-size: 13px; }

.panel-note {
  font-size: 10px;
  color: var(--dim);
  letter-spacing: 0.02em;
  text-align: right;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.insights {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 7px;
}

.insights li {
  position: relative;
  padding-left: 16px;
  font-size: 12.5px;
  line-height: 1.65;
  color: #c2c9d2;
}

.insights li::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 8px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(109, 139, 255, 0.7);
}

.insights li:nth-child(2)::before { background: var(--violet); box-shadow: 0 0 8px rgba(167, 139, 250, 0.6); }
.insights li:nth-child(3)::before { background: var(--warn); box-shadow: 0 0 8px rgba(242, 180, 92, 0.6); }
.insights li:nth-child(4)::before { background: var(--up); box-shadow: 0 0 8px rgba(61, 220, 151, 0.55); }
.insights li:nth-child(5)::before { background: var(--down); box-shadow: 0 0 8px rgba(255, 107, 107, 0.55); }

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

/* ---------------------------------------------------------------- 关键价位 */
.levels {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.level {
  padding: 13px 15px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.018);
  transition: border-color 0.18s, background 0.18s;
}

.level:hover {
  border-color: var(--border-2);
  background: rgba(255, 255, 255, 0.03);
}

.level.accent {
  border-color: rgba(109, 139, 255, 0.32);
  background: rgba(109, 139, 255, 0.055);
}

.level-type {
  font-size: 9.5px;
  letter-spacing: 0.15em;
  color: var(--dim);
  text-transform: uppercase;
}

.level-price {
  font-family: var(--mono);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 7px;
  font-variant-numeric: tabular-nums;
}

.level-dist {
  display: inline-block;
  margin-top: 9px;
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 5px;
  letter-spacing: 0.02em;
}

.level-dist.up { color: var(--up); background: rgba(61, 220, 151, 0.09); }
.level-dist.down { color: var(--down); background: rgba(255, 107, 107, 0.09); }

.level-note {
  font-size: 10px;
  color: var(--muted);
  margin-top: 8px;
}

.levels-panel { margin-bottom: 10px; }

/* ---------------------------------------------------------------- 杠杆 */
.leverage { margin-bottom: 10px; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.stat {
  padding: 10px 13px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.018);
}

.stat-label {
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--dim);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-value {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 600;
  margin-top: 6px;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.stat-sub {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  margin-top: 5px;
  letter-spacing: 0.02em;
}

.subpanel {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px 10px;
  background: rgba(255, 255, 255, 0.012);
  min-width: 0;
}

.sub-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 10.5px;
  color: #b9c1cc;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.sub-head span:last-child {
  font-size: 9.5px;
  color: var(--dim);
}

.chart.sm { height: 186px; }

.chart-panel.wide { grid-column: 1 / -1; }
.chart { width: 100%; height: 250px; position: relative; }
.chart-panel.wide .chart { height: 228px; }
.chart svg { display: block; }
.chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--dim);
  letter-spacing: 0.03em;
}

/* ------------------------------------------------------------------ 其他 */
footer {
  display: flex;
  justify-content: space-between;
  margin-top: 22px;
  font-size: 10px;
  color: #454d59;
  letter-spacing: 0.04em;
  font-family: var(--mono);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px);
  padding: 10px 18px;
  border-radius: 9px;
  border: 1px solid rgba(255, 107, 107, 0.35);
  background: rgba(30, 12, 14, 0.95);
  color: #ffb4b4;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s, transform 0.22s;
  max-width: 80vw;
  z-index: 50;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

.skeleton {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.08) 37%, rgba(255, 255, 255, 0.04) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.5s ease infinite;
  border-radius: 4px;
  color: transparent !important;
}

@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.fade-in { animation: fadeIn 0.32s ease both; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- 账户 */
.account {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 3px 3px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.acc-user { font-family: var(--mono); font-size: 11px; color: #cfd6e0; }
.acc-exp { font-family: var(--mono); font-size: 9.5px; color: var(--dim); }

.acc-out {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.acc-out:hover { background: rgba(255, 255, 255, 0.06); color: var(--down); }

/* ---------------------------------------------------------------- 登录 / 激活 */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 6, 8, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.auth-overlay[hidden] { display: none; }

.auth-card {
  width: min(392px, 100%);
  padding: 30px 28px 24px;
  border-radius: 18px;
  border: 1px solid var(--border-2);
  background: linear-gradient(180deg, #12161c 0%, #0a0c10 100%);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: rise 0.3s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to { opacity: 1; transform: none; }
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.18em;
  color: #dfe4ea;
}

.auth-tabs {
  display: flex;
  gap: 2px;
  padding: 3px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
}

.auth-tabs button {
  flex: 1;
  padding: 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 12px;
  cursor: pointer;
}

.auth-tabs button.active {
  background: rgba(109, 139, 255, 0.14);
  color: #cfd9ff;
  box-shadow: inset 0 0 0 1px rgba(109, 139, 255, 0.28);
}

.field { display: block; margin-bottom: 14px; }

.field span {
  display: block;
  margin-bottom: 7px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}

.field input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.field input:focus {
  border-color: rgba(109, 139, 255, 0.55);
  background: rgba(109, 139, 255, 0.05);
}

.field input::placeholder { color: #4a515c; }

.auth-msg {
  min-height: 18px;
  margin-bottom: 10px;
  font-size: 11.5px;
  color: var(--down);
}

.auth-submit {
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, #7b95ff, #5c78f0);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
}

.auth-submit:hover { filter: brightness(1.08); }
.auth-submit:active { transform: translateY(1px); }
.auth-submit:disabled { opacity: 0.6; cursor: default; }

.auth-foot, .auth-desc {
  margin: 16px 0 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--dim);
}

.auth-link {
  display: block;
  margin: 14px auto 0;
  padding: 6px;
  border: 0;
  background: none;
  color: var(--dim);
  font-size: 11px;
  cursor: pointer;
}

.auth-link:hover { color: var(--muted); text-decoration: underline; }

@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .levels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  main { padding: 24px 16px 32px; }
  .topbar { padding: 0 14px; gap: 8px; }
  .brand-title { font-size: 10.5px; letter-spacing: 0.12em; }
  .seg { margin-left: 0; }
  .seg button { padding: 6px 12px; }
  .stamp { display: none; }
  .hero { flex-direction: column; align-items: flex-start; gap: 14px; }
  .hero-side { text-align: left; }
  .price { font-size: 34px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .seg button { padding: 6px 10px; }
  .btn-refresh { padding: 7px 10px; }
  .btn-refresh span { display: none; }
  .brand-title { font-size: 9.5px; letter-spacing: 0.08em; }
  .panel { padding: 14px 12px 12px; }
}

/* ---------------------------------------------------------------- 左侧导航 */
.app-shell {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  max-width: 1520px;
  margin: 0 auto;
  padding: 0 28px;
  position: relative;
  z-index: 1;
}
.app-shell > main {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 34px 0 40px;
}

.app-side {
  position: sticky;
  top: 76px;
  flex: 0 0 178px;
  width: 178px;
  margin-top: 24px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(22, 27, 34, .92), rgba(13, 16, 20, .92));
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
  max-height: calc(100vh - 100px);
  overflow: auto;
}
.app-side-title {
  color: var(--dim);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 3px 10px 9px;
}
.app-side-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 10px;
  margin-bottom: 2px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #b7c0cd;                       /* 未选中也别发灰 */
  font: inherit;
  font-size: 13px;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: background .13s, color .13s, box-shadow .13s;
}
.app-side-item svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  opacity: .7;
  transition: opacity .13s, color .13s;
}
.app-side-item:hover { background: rgba(255, 255, 255, .055); color: #fff; }
.app-side-item:hover svg { opacity: 1; }
.app-side-item.active {
  background: linear-gradient(180deg, rgba(109, 139, 255, .22), rgba(109, 139, 255, .12));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(109, 139, 255, .30);
}
.app-side-item.active svg { opacity: 1; color: #a9bcff; }

@media (max-width: 900px) {
  .app-shell { flex-direction: column; gap: 0; padding: 0 16px; }
  .app-shell > main { padding: 24px 0 32px; }
  .app-side {
    display: flex;
    flex-direction: row;
    gap: 6px;
    position: static;
    flex: 1 1 auto;
    width: auto;
    max-height: none;
    margin-top: 12px;
    padding: 8px;
    overflow: visible;
  }
  .app-side-title { display: none; }
  .app-side-item { width: auto; margin-bottom: 0; }
}

/* ------------------------------------------------------------ 视图切换 */
.app-view[hidden] { display: none; }

/* ------------------------------------------------------------ 订单流视图 */
.of-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.of-toolbar .stamp { margin-left: auto; }

.of-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin: 0 0 8px; }
@media (max-width: 980px) { .of-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.of-kpi { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 13px 14px; }
.of-kpi .k { color: var(--muted); font-size: 11.5px; letter-spacing: .06em; }
.of-kpi .v { font-family: var(--mono); font-size: 19px; margin-top: 7px; letter-spacing: -.01em; }
.of-kpi .s { color: var(--dim); font-size: 11px; margin-top: 5px; font-family: var(--mono); }
.of-kpi .up { color: var(--up); }
.of-kpi .down { color: var(--down); }
.up { color: var(--up); } .down { color: var(--down); } .warn { color: var(--warn); }
.of-panels { display: grid; grid-template-columns: 1.35fr 1fr; gap: 14px; margin-top: 16px; }
@media (max-width: 980px) { .of-panels { grid-template-columns: 1fr; } }
.of-panel { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px 16px; }
.of-panel h3 { margin: 0 0 4px; font-size: 13.5px; font-weight: 600; letter-spacing: .02em; }
.of-panel .hint { color: var(--dim); font-size: 11.5px; margin-bottom: 10px; }
.of-panel.full { grid-column: 1 / -1; }
canvas.foot { width: 100%; height: 320px; display: block; border-radius: 8px; }
table.of { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12px; }
table.of th { text-align: left; color: var(--muted); font-weight: 500; font-size: 11px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
table.of td { padding: 6px 8px; border-bottom: 1px solid rgba(255,255,255,.035); }
table.of tr:hover td { background: rgba(255,255,255,.025); }
.of-scroll { max-height: 320px; overflow: auto; }
.of-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); margin-top: 8px; flex-wrap: wrap; }
.of-legend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.of-note { margin-top: 22px; color: var(--dim); font-size: 11.5px; line-height: 1.7; }
.of-panels > .of-note { grid-column: 1 / -1; margin-top: 0; }
.of-empty { color: var(--dim); font-size: 12.5px; padding: 18px 0; }
.of-read { margin: 4px 0 0; padding-left: 18px; color: var(--text); font-size: 13px; line-height: 1.85; }
.of-read li::marker { color: var(--accent); }



/* ============================ 资金流 ============================ */
/* 六个因子和上面的「流动性度量 / 微观阻力指数」是同一级的卡：
 * 同一套 .of-panel 样式，单列铺满，没有外层「组」容器。 */
.fl-bar {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 4px 0 0;
}
.fl-bar .seg { margin-left: auto; }
.fl-bar .of-legend { flex: 1 1 auto; }
.fl-stack {
  grid-column: 1 / -1;
  position: relative; cursor: crosshair;
  display: flex; flex-direction: column; gap: 14px;
}
.fl-card { padding-bottom: 10px; }
.fl-card h3 { margin-bottom: 2px; }
.fl-card .hint { margin-bottom: 8px; }
.fl-card canvas { display: block; width: 100%; border-radius: 8px; background: rgba(255,255,255,.012); }

/* 资金流盘面：十字光标 + 悬浮读数 */
.fl-xhair {
  position: absolute; top: 0; bottom: 0; width: 1px; display: none;
  background: rgba(200, 206, 214, .38); pointer-events: none; z-index: 4;
}
.fl-tip {
  position: absolute; display: none; z-index: 5; pointer-events: none;
  min-width: 178px; padding: 7px 10px; border-radius: 6px;
  background: rgba(18, 20, 24, .95); border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
  font: 11px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text, #cfd3da);
}
.fl-tip b { display: block; margin-bottom: 4px; color: #8b93a1; font-weight: 500;
  padding-bottom: 3px; border-bottom: 1px solid rgba(255,255,255,.07); }
.fl-tip .r { display: flex; justify-content: space-between; gap: 14px; white-space: nowrap; }
.fl-tip .r span { color: var(--dim, #7d8695); }
.fl-tip em { font-style: normal; color: var(--text, #cfd3da); }

/* ============================ 公告栏 ============================ */
.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 216px;
  gap: 14px;
  align-items: start;
}
.dash-main { min-width: 0; }

.ann-panel {
  position: sticky;
  top: 88px;
  margin-top: 0;
  padding: 10px 11px 6px;
  background: linear-gradient(180deg, rgba(22, 27, 34, .92), rgba(13, 16, 20, .92));
  border: 1px solid var(--border);
  border-radius: 12px;
}
.ann-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--dim); font-family: var(--mono);
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.ann-count { font-size: 10px; color: var(--muted); }
.ann-list { max-height: calc(100vh - 180px); overflow: auto; }
.ann-item { padding: 8px 0 7px; border-bottom: 1px dashed rgba(255,255,255,.07); }
.ann-item:last-child { border-bottom: 0; }
.ann-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: #e6eaf0; line-height: 1.45;
}
.ann-body {
  margin-top: 4px; font-size: 11.5px; color: var(--muted); line-height: 1.65;
  white-space: pre-wrap; word-break: break-word;
}
.ann-time { margin-top: 5px; font-size: 10px; color: var(--dim); font-family: var(--mono); }
.ann-tag {
  flex: 0 0 auto; font-size: 9px; line-height: 1.5; padding: 0 5px;
  border-radius: 4px; border: 1px solid currentColor;
}
.ann-item[data-level="warn"] .ann-tag { color: #f2b45c; }
.ann-item[data-level="critical"] .ann-tag { color: #ff6b6b; }
.ann-item[data-level="info"] .ann-tag { color: #6d8bff; }
.ann-pin { flex: 0 0 auto; font-size: 9px; color: #f2b45c; }
.ann-empty { padding: 9px 0 3px; font-size: 11px; color: var(--dim); }
/* 没有公告时不要留一个大空盒：一条细线收住 */
.ann-panel.is-empty { padding-bottom: 8px; }
.ann-panel.is-empty .ann-list { max-height: none; }

@media (max-width: 1180px) {
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .ann-panel { position: static; margin-top: 18px; }
  .ann-list { max-height: none; }
}
