:root {
  --bg: #edf5ff;
  --bg-2: #d4e7ff;
  --panel: rgba(255, 255, 255, 0.95);
  --panel-2: rgba(248, 252, 255, 0.98);
  --panel-3: rgba(232, 244, 255, 0.98);
  --line: rgba(64, 115, 190, 0.14);
  --line-strong: rgba(61, 126, 221, 0.3);
  --text: #15263e;
  --text-soft: #4f6686;
  --text-dim: #8095b3;
  --accent: #2f7be8;
  --accent-2: #84c5ff;
  --accent-soft: rgba(47, 123, 232, 0.14);
  --green: #00d67b;
  --green-soft: rgba(0, 214, 123, 0.14);
  --red: #ff5b73;
  --red-soft: rgba(255, 91, 115, 0.14);
  --amber: #f6ba52;
  --amber-soft: rgba(246, 186, 82, 0.14);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
  --max-width: 1420px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Bahnschrift", "DIN Alternate", "PingFang SC", "Microsoft YaHei UI", sans-serif;
  background:
    radial-gradient(circle at 6% 10%, rgba(132, 197, 255, 0.5), transparent 24%),
    radial-gradient(circle at 92% 14%, rgba(47, 123, 232, 0.24), transparent 22%),
    linear-gradient(180deg, #f5faff 0%, var(--bg) 42%, #edf5ff 100%);
}

a,
button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

.app-bg {
  position: fixed;
  inset: auto;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}

.app-bg-left {
  top: -80px;
  left: -120px;
  background: rgba(132, 197, 255, 0.28);
}

.app-bg-right {
  right: -120px;
  bottom: 8%;
  background: rgba(47, 123, 232, 0.22);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(var(--max-width), calc(100vw - 20px));
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 0 calc(92px + env(safe-area-inset-bottom));
}

.topbar,
.workspace-nav,
.panel,
.mobile-dock {
  backdrop-filter: blur(20px);
}

.topbar,
.workspace-nav,
.mobile-dock {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 48px rgba(77, 118, 176, 0.16);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border-radius: 22px;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(47, 123, 232, 0.18), rgba(132, 197, 255, 0.28));
  font-weight: 800;
}

.eyebrow,
.page-kicker,
.label,
.micro,
.mini {
  margin: 0;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.eyebrow,
.page-kicker {
  font-size: 12px;
}

.brand-copy h1,
.page-header h2,
.panel h3,
.panel h4 {
  margin: 0;
}

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

.brand-line h1 {
  font-size: clamp(20px, 2vw, 28px);
}

.status-pill,
.page-badge,
.pill,
.tone-pill,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
}

.status-pill {
  background: rgba(0, 214, 123, 0.12);
  color: #17854d;
  border-color: rgba(0, 214, 123, 0.26);
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(239, 247, 255, 0.98);
  color: var(--text-soft);
  font-size: 12px;
}

.ghost-button,
.action-button,
.secondary-button {
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.ghost-button {
  background: rgba(239, 247, 255, 0.98);
}

.action-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-weight: 700;
}

.secondary-button {
  background: rgba(239, 247, 255, 0.98);
}

.workspace-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
  margin-top: 14px;
  border-radius: 18px;
}

.workspace-tab,
.dock-tab {
  border-radius: 14px;
  padding: 12px 10px;
  color: var(--text-soft);
}

.workspace-tab.is-active,
.dock-tab.is-active {
  background: linear-gradient(135deg, rgba(47, 123, 232, 0.14), rgba(132, 197, 255, 0.16));
  border: 1px solid var(--line-strong);
  color: var(--text);
}

.workspace-stack {
  display: grid;
  gap: 22px;
  margin-top: 18px;
}

.workspace {
  display: none;
  gap: 18px;
}

.workspace.is-active {
  display: grid;
}

.board-group {
  display: grid;
  gap: 18px;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.page-header h2,
.section-header h3 {
  font-size: clamp(28px, 2.8vw, 40px);
}

.section-header h3 {
  font-size: clamp(24px, 2.4vw, 32px);
}

.section-header .page-copy {
  margin: 6px 0 0;
}

.page-copy {
  margin: 8px 0 0;
  max-width: 860px;
  color: var(--text-soft);
  line-height: 1.7;
}

.page-badge {
  background: rgba(47, 123, 232, 0.1);
  color: #2561b8;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 249, 255, 0.98));
  box-shadow: 0 16px 38px rgba(78, 119, 176, 0.1);
  padding: 18px;
}

.guide-grid,
.overview-hero-grid,
.overview-command-grid,
.dual-grid,
.trade-grid,
.trade-bottom-grid,
.learning-hero-grid,
.summary-grid,
.pool-grid,
.metric-grid {
  display: grid;
  gap: 18px;
}

.guide-grid { grid-template-columns: repeat(4, 1fr); }
.overview-hero-grid { grid-template-columns: 1.5fr 1fr; }
.overview-command-grid { grid-template-columns: 1.2fr 1.8fr; }
.dual-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.trade-grid { grid-template-columns: 1.5fr 0.9fr; align-items: start; }
.trade-main,
.trade-side { display: grid; gap: 18px; }
.trade-bottom-grid { grid-template-columns: 1.1fr 1.1fr 0.8fr; }
.learning-hero-grid { grid-template-columns: 1.3fr 0.9fr; }
.summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pool-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.guide-item {
  padding: 14px 0;
  border-right: 1px solid var(--line);
}

.guide-item:last-child { border-right: 0; }

.panel-header,
.split-row,
.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-header {
  margin-bottom: 14px;
}

.subtle {
  color: var(--text-soft);
}

.grid-2,
.grid-3,
.grid-4 {
  display: grid;
  gap: 12px;
}

.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stat-card,
.mini-card,
.decision-card,
.news-card,
.metric-card,
.info-card,
.watch-card,
.flow-step,
.matrix-row,
.risk-row,
.book-col,
.book-row {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(248, 251, 255, 0.92);
}

.stat-card,
.mini-card,
.decision-card,
.news-card,
.metric-card,
.info-card,
.watch-card,
.flow-step,
.matrix-row,
.risk-row {
  padding: 14px;
}

.stat-value,
.hero-value,
.price-value {
  font-size: clamp(24px, 3vw, 40px);
  font-weight: 800;
}

.green { color: var(--green); }
.red { color: var(--red); }
.amber { color: var(--amber); }
.accent { color: #d9d1ff; }

.tone-long { color: var(--green); }
.tone-short { color: var(--red); }
.tone-watch { color: var(--amber); }

.row-list,
.news-list,
.watch-list,
.signal-list,
.book-grid,
.session-list,
.version-list {
  display: grid;
  gap: 10px;
}

.row-item,
.news-item,
.watch-item,
.signal-item,
.session-item,
.version-item {
  display: grid;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.row-item:last-child,
.news-item:last-child,
.watch-item:last-child,
.signal-item:last-child,
.session-item:last-child,
.version-item:last-child {
  border-bottom: 0;
}

.track {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(70, 120, 180, 0.12);
}

.track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.chart-shell {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(247, 251, 255, 0.98), rgba(236, 245, 255, 0.96));
  min-height: 260px;
  overflow: hidden;
}

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

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(241, 248, 255, 0.98);
  color: var(--text-soft);
}

.chip.is-active {
  background: rgba(47, 123, 232, 0.14);
  border-color: var(--line-strong);
  color: var(--text);
}

.book-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.book-col {
  padding: 12px;
}

.book-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  margin-top: 8px;
}

.book-row.ask { color: #ff90a3; }
.book-row.bid { color: #7ff0bf; }

.form-grid {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 8px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(245, 250, 255, 0.98);
}

.cta-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.success-button,
.danger-button {
  padding: 14px 16px;
  border-radius: 16px;
  font-weight: 800;
}

.success-button {
  background: linear-gradient(135deg, rgba(0,214,123,0.9), rgba(0,184,153,0.82));
  color: white;
}

.danger-button {
  background: linear-gradient(135deg, rgba(255,91,115,0.9), rgba(216,57,82,0.84));
  color: white;
}

.flow-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--text-dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.mobile-dock {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
  border-radius: 18px;
  z-index: 30;
}

.toast-region {
  position: fixed;
  right: 16px;
  bottom: 112px;
  display: grid;
  gap: 10px;
  z-index: 40;
  max-width: min(360px, calc(100vw - 32px));
}

.toast {
  padding: 12px 14px;
  border: 1px solid rgba(255, 91, 115, 0.35);
  border-radius: 14px;
  background: rgba(255, 245, 248, 0.98);
  color: #9f2c44;
}

@media (max-width: 1120px) {
  .guide-grid,
  .overview-hero-grid,
  .overview-command-grid,
  .dual-grid,
  .trade-grid,
  .trade-bottom-grid,
  .learning-hero-grid,
  .summary-grid,
  .pool-grid,
  .metric-grid,
  .flow-grid,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .grid-3,
  .grid-2,
  .book-grid,
  .cta-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  body {
    padding: 0 10px calc(88px + env(safe-area-inset-bottom));
  }

  .app-shell {
    width: min(100vw - 20px, var(--max-width));
    padding-top: max(10px, env(safe-area-inset-top));
  }

  .topbar {
    padding: 12px;
  }

  .topbar,
  .page-header,
  .section-header,
  .panel-header,
  .split-row,
  .card-row {
    flex-direction: column;
    align-items: stretch;
  }

  .workspace-nav {
    display: none;
  }

  .mobile-dock {
    display: grid;
  }

  .page-header h2,
  .section-header h3 {
    font-size: 28px;
  }

  .panel {
    padding: 14px;
    border-radius: 18px;
  }

  .brand-line h1 {
    font-size: 20px;
  }

  .stat-value,
  .hero-value,
  .price-value {
    font-size: 26px;
  }

  .toast-region {
    left: 10px;
    right: 10px;
    bottom: 96px;
    max-width: none;
  }
}
