/* BTC 主题账 · AlphaBrain-inspired light SaaS skin */

:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-soft: #dbeafe;
  --accent: #7c3aed;
  --accent-soft: #ede9fe;
  --positive: #059669;
  --negative: #dc2626;
  --warn: #d97706;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.04);
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

/* Top nav */
.topnav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}

.topnav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #38bdf8);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-left: 0.5rem;
}

.nav-pill {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

a.nav-pill:visited { color: var(--text-muted); }

.nav-pill:hover { background: #f1f5f9; color: var(--text); }

.nav-pill.active {
  background: var(--primary);
  color: #fff;
}

a.nav-pill.active:visited { color: #fff; }

.topnav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.status-chip {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
}

.status-chip.status-live {
  color: #047857;
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.status-chip.status-error {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}

.card-footnote {
  margin: 0.75rem 0 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.factor-details {
  margin-top: 0.65rem;
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
}

.factor-details summary {
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  user-select: none;
}

.factor-list {
  margin-top: 0.4rem;
  max-height: 220px;
  overflow: auto;
}

.factor-list li {
  font-size: 0.78rem;
  line-height: 1.4;
}

.btn {
  border: none;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
}

.btn-ghost {
  background: transparent;
  color: var(--text);
}

.btn-ghost:hover { background: #f1f5f9; }

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover { background: #1d4ed8; }

.btn-accent {
  background: var(--accent);
  color: #fff;
}

.btn-accent:hover { background: #6d28d9; }

/* Shell layout — single column (no sidebar) */
.shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.25rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.content { min-width: 0; }

.panel { display: none; }
.panel.active { display: block; }

.hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem 1.6rem;
  margin-bottom: 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}

.hero h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  letter-spacing: -0.03em;
  color: #0f172a;
}

.hero .sub {
  margin: 0;
  color: var(--text-muted);
  max-width: 52rem;
  font-size: 0.95rem;
}

.section-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
  margin: 1.5rem 0 0.9rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 1100px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .card-grid { grid-template-columns: 1fr; }
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem 1.15rem;
  min-height: 220px;
  display: flex;
  flex-direction: column;
}

.metric-card h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}

.metric-card .dual {
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.gauge-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 0.35rem;
}

.gauge {
  width: 180px;
  height: 110px;
  position: relative;
}

.gauge svg { width: 100%; height: 100%; overflow: visible; }

.gauge-center {
  position: absolute;
  left: 50%;
  top: 58%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.gauge-center .val {
  font-size: 1.85rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
}

.gauge-center .lbl {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.card-foot {
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
}

.surface-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}

.surface-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.muted { color: var(--text-muted); font-size: 0.85rem; }

.chart-box { width: 100%; min-height: 280px; }
.chart-tall { min-height: 360px; }
.chart-3d { min-height: 420px; }

.skel {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: inherit;
  color: #94a3b8;
  font-size: 0.875rem;
}

.input-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.input-grid label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.input-grid input {
  width: 100%;
  margin-top: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem 0.65rem;
  font: inherit;
  background: #fff;
  color: var(--text);
}

.sat-follow { color: #047857; }
.sat-hold { color: #b45309; }

.expiry-alert {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid #fcd34d;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.9rem;
  line-height: 1.45;
}

.stress-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 56px;
  margin-top: 0.5rem;
}

.stress-bars span {
  flex: 1;
  min-width: 2px;
  background: #94a3b8;
  border-radius: 2px 2px 0 0;
}

.stress-bars span.tail {
  background: #f59e0b;
}

.street-card.is-active {
  border-color: #93c5fd;
  background: #eff6ff;
  box-shadow: 0 0 0 1px #bfdbfe inset;
}

.street-card.is-done {
  opacity: 0.85;
}

.street-actions .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.street-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.street-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem;
  text-align: center;
  background: #f8fafc;
}

.street-card .n {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary);
}

.ev-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.ev-box {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem;
  background: #f8fafc;
}

.advice-buy { color: var(--positive) !important; }
.advice-sell { color: var(--negative) !important; }
.advice-hold { color: var(--warn) !important; }

.notes {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.footer {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 1.25rem 2rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.footer a { text-decoration: underline; }

#max-pain-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

#max-pain-tabs button {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

#max-pain-tabs button.active,
#max-pain-tabs button.bg-violet-600 {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary);
}

.context-strip-light {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
