:root {
  --bg: #f4f7fb;
  --paper: rgba(255, 255, 255, 0.985);
  --ink: #1f2329;
  --muted: #646a73;
  --muted-soft: #8f959e;
  --accent: #3370ff;
  --accent-soft: rgba(51, 112, 255, 0.1);
  --teal: #2f88ff;
  --gold: #b88230;
  --red: #d84b4b;
  --green: #00a870;
  --shadow: 0 10px 24px rgba(31, 35, 41, 0.06);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --font-display: "SF Pro Display", "PingFang SC", "Helvetica Neue", "Hiragino Sans GB", "Noto Sans CJK SC", sans-serif;
  --font-ui: "SF Pro Text", "PingFang SC", "Helvetica Neue", "Hiragino Sans GB", "Noto Sans CJK SC", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-ui);
  background:
    radial-gradient(circle at 18% 14%, rgba(51, 112, 255, 0.08), transparent 24%),
    radial-gradient(circle at 82% 18%, rgba(71, 161, 255, 0.09), transparent 20%),
    linear-gradient(180deg, #f8fbff 0%, #f5f8fd 42%, var(--bg) 100%);
}

.page {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 22px 26px 18px;
  background: linear-gradient(135deg, rgba(247, 251, 255, 0.98), rgba(234, 243, 255, 0.96));
  border: 1px solid rgba(51, 112, 255, 0.1);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.hero-nav {
  position: fixed;
  right: 20px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  z-index: 260;
  pointer-events: none;
}

.hero-nav:empty {
  display: none;
}

.hero::after {
  content: "";
  position: absolute;
  right: -10%;
  bottom: -42%;
  width: 360px;
  height: 260px;
  background: radial-gradient(circle, rgba(51, 112, 255, 0.14) 0%, rgba(51, 112, 255, 0) 68%);
  pointer-events: none;
}

.hero-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.refresh-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(51, 112, 255, 0.14);
  box-shadow: 0 10px 24px rgba(35, 60, 120, 0.08);
  position: relative;
  z-index: 2;
}

.refresh-banner-copy {
  display: grid;
  gap: 4px;
  color: var(--ink);
  font-size: 10px;
  line-height: 1.45;
}

.refresh-banner-copy strong {
  font-size: 10.5px;
  color: var(--accent);
}

.refresh-banner-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.refresh-banner-btn {
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 9.5px;
  font-weight: 650;
  cursor: pointer;
  background: rgba(51, 112, 255, 0.08);
  color: var(--accent);
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(51, 112, 255, 0.1);
  color: var(--accent);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: none;
}

.title {
  margin: 16px 0 8px;
  font-family: var(--font-display);
  font-size: clamp(30px, 3.5vw, 46px);
  line-height: 1.02;
  letter-spacing: -0.06em;
  font-weight: 760;
}

.subtitle {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.52;
  font-size: 10.5px;
  font-weight: 450;
}

.hero-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 6px;
}

.hero-meta-item {
  color: var(--muted-soft);
  font-size: 8px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.hero-meta-item strong {
  color: var(--ink);
  font-size: 9.5px;
  font-weight: 640;
  margin-left: 5px;
}

.replay-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  color: #8a5a16;
  background: rgba(184, 130, 48, 0.12);
  border: 1px solid rgba(184, 130, 48, 0.2);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
  position: relative;
  z-index: 1;
}

.tabs:empty {
  display: none;
}

.tab {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.9);
  color: #3c4655;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(51, 112, 255, 0.12);
}

.tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(51, 112, 255, 0.2);
}

.tab.current {
  cursor: default;
}

.section-tools {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.section-tools:empty {
  display: none;
}

.section-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(51, 112, 255, 0.1);
  color: var(--accent);
  text-decoration: none;
  font-size: 10.5px;
  font-weight: 670;
}

.hero-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(51, 112, 255, 0.12);
  box-shadow: 0 10px 24px rgba(35, 60, 120, 0.14);
  backdrop-filter: blur(12px);
  pointer-events: auto;
}

.floating-back-link {
  color: #245bdb;
}

.floating-back-link:hover {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(35, 60, 120, 0.16);
}

.hero-back-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: rgba(51, 112, 255, 0.08);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.hero-back-label {
  white-space: nowrap;
  line-height: 1;
  letter-spacing: 0.01em;
}

.range-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(51, 112, 255, 0.12);
}

.range-option {
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.range-option.active {
  background: var(--accent);
  color: #fff;
}

.section {
  margin-top: 30px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(21px, 2.2vw, 28px);
  letter-spacing: -0.04em;
  line-height: 1.02;
  font-weight: 750;
}

.section-meta {
  color: var(--muted-soft);
  font-size: 8.5px;
  line-height: 1.45;
  margin-top: 4px;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.decision-banner {
  margin-bottom: 16px;
}

.decision-inner {
  display: grid;
  gap: 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(245, 250, 255, 0.96));
}

.decision-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.decision-label {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(51, 112, 255, 0.1);
  color: var(--accent);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.07em;
}

.decision-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(21px, 2.4vw, 30px);
  letter-spacing: -0.04em;
  line-height: 1.04;
  font-weight: 750;
}

.decision-copy {
  max-width: 860px;
  font-size: 10.5px;
  line-height: 1.52;
  color: var(--ink);
  font-weight: 450;
}

.decision-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(51, 112, 255, 0.1);
  font-size: 10px;
  font-weight: 650;
}

.chip .label {
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.95fr);
  gap: 18px;
  align-items: start;
}

.main-stack,
.sidebar-stack {
  display: grid;
  gap: 14px;
}

.card {
  background: var(--paper);
  border: 1px solid rgba(51, 112, 255, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.card-inner {
  padding: 16px 16px 14px;
}

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

.ai-background-label {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.04em;
  margin: 2px 0 -2px;
}

.briefing-card {
  min-height: 0;
}

.briefing-card .card-inner {
  display: grid;
  gap: 10px;
}

.briefing-card-headline {
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.16;
  letter-spacing: -0.03em;
  font-weight: 760;
  color: var(--ink);
}

.briefing-card-copy {
  color: var(--ink);
  font-size: 10px;
  line-height: 1.56;
  max-width: 32em;
}

.briefing-card-meta {
  display: grid;
  gap: 6px;
}

.briefing-card-meta-line {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.chart-card {
  min-height: 332px;
  overflow: hidden;
}

.comparison-card {
  min-height: 220px;
}

.metric-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 10px;
}

.metric-pair > div {
  border: 1px solid rgba(31, 90, 104, 0.12);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.74);
}

.metric-label {
  display: block;
  color: var(--muted);
  font-size: 9px;
  margin-bottom: 8px;
}

.metric-pair strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.chart-empty {
  min-height: 128px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed rgba(31, 90, 104, 0.18);
  border-radius: 18px;
}

.chart-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.chart-title {
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: -0.03em;
  line-height: 1.16;
  font-weight: 730;
  margin: 0;
}

.chart-badge {
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(51, 112, 255, 0.08);
  color: #5a78c9;
  font-size: 7.5px;
  font-weight: 680;
  letter-spacing: 0.04em;
}

.chart-current {
  font-size: 24px;
  font-family: var(--font-display);
  margin-bottom: 5px;
  letter-spacing: -0.03em;
  line-height: 1;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.chart-sub {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.42;
  margin-bottom: 10px;
}

.chart-shell {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  padding: 10px 0 30px;
}

.y-axis-item {
  font-size: 11px;
  color: var(--muted);
  line-height: 1;
}

.spark-wrap {
  min-width: 0;
  position: relative;
}

.chart-gridlines {
  position: absolute;
  inset: 10px 0 30px 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
}

.chart-gridlines span {
  display: block;
  border-top: 1px dashed rgba(51, 112, 255, 0.12);
}

.home-role-card .chart-current {
  font-size: 18px;
  margin-bottom: 8px;
  line-height: 1.12;
}

.home-copy {
  color: var(--ink);
  font-size: 10px;
  line-height: 1.5;
  min-height: 56px;
  max-width: 31em;
  font-weight: 430;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.chart-note {
  margin-top: 12px;
  color: var(--ink);
  font-size: 10px;
  line-height: 1.54;
  max-width: 36em;
  font-weight: 440;
  display: grid;
  gap: 5px;
}

.chart-note-line {
  color: var(--ink);
}

.chart-note-line:first-child {
  font-weight: 580;
  color: #2b63de;
}

.chart-footer {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.chart-link {
  color: var(--teal);
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
}

.spark {
  width: 100%;
  height: 128px;
  display: block;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.spark text {
  font-family: var(--font-ui);
  letter-spacing: 0;
}

.x-axis-grid {
  display: grid;
  gap: 4px;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
}

.x-axis-item {
  min-width: 0;
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}

.x-axis-item.muted {
  color: rgba(100, 114, 133, 0.26);
}

.axis-summary {
  margin-top: 8px;
  color: var(--muted-soft);
  font-size: 8px;
  line-height: 1.4;
}

.analysis-card {
  min-height: 208px;
}

.analysis-lines,
.list {
  display: grid;
  gap: 10px;
}

.analysis-line {
  padding: 12px 12px 11px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.985), rgba(249, 251, 255, 0.97));
  border: 1px solid rgba(51, 112, 255, 0.06);
  max-width: 52em;
  display: grid;
  gap: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.analysis-title {
  font-size: 12px;
  line-height: 1.34;
  font-weight: 760;
  color: #1f2329;
  letter-spacing: -0.01em;
}

.analysis-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.analysis-label {
  font-size: 8.5px;
  line-height: 1.45;
  color: #7f8794;
  font-weight: 760;
  letter-spacing: 0.04em;
}

.analysis-copy {
  font-size: 10px;
  line-height: 1.58;
  color: #343b45;
  font-weight: 450;
}

.list-item {
  padding: 13px 13px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.975);
  border: 1px solid rgba(51, 112, 255, 0.08);
}

.list-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.list-title {
  margin: 0;
  flex: 1 1 180px;
  min-width: 0;
  font-size: 12.5px;
  line-height: 1.44;
  font-weight: 700;
  max-width: none;
}

.list-copy {
  color: #5f6773;
  font-size: 10px;
  line-height: 1.6;
  max-width: none;
}

.list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.recovery-item {
  display: grid;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px dashed rgba(17, 28, 45, 0.08);
}

.recovery-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.recovery-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.recovery-title {
  margin: 0;
  font-size: 10px;
  line-height: 1.58;
  color: var(--ink);
  font-weight: 700;
}

.recovery-copy {
  font-size: 9px;
  line-height: 1.62;
  color: var(--muted);
}

.recovery-summary {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.recovery-summary-line {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(247, 250, 255, 0.98);
  border: 1px solid rgba(51, 112, 255, 0.08);
}

.recovery-summary-label {
  color: #8a93a1;
  font-size: 8px;
  line-height: 1.55;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding-top: 2px;
}

.recovery-summary-copy {
  color: #2f3742;
  font-size: 9px;
  line-height: 1.65;
}

.task-accordion {
  margin-top: 12px;
  border: 1px solid rgba(51, 112, 255, 0.1);
  border-radius: 14px;
  background: rgba(247, 250, 255, 0.98);
  overflow: hidden;
}

.task-accordion summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 14px;
  font-size: 10.5px;
  line-height: 1.46;
  font-weight: 700;
  color: var(--ink);
}

.task-accordion summary::-webkit-details-marker {
  display: none;
}

.task-accordion-body {
  padding: 0 14px 14px;
  display: grid;
  gap: 10px;
}

.task-detail-item {
  border-top: 1px dashed rgba(17, 28, 45, 0.08);
  padding-top: 12px;
}

.task-detail-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.task-detail-index {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.task-detail-title {
  flex: 1;
  font-size: 9.5px;
  line-height: 1.58;
  color: var(--ink);
  max-width: 34em;
}

.task-detail-copy,
.task-detail-meta,
.task-detail-foot {
  font-size: 9px;
  line-height: 1.5;
  color: var(--muted);
}

.pill {
  font-size: 9.5px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(51, 112, 255, 0.075);
  border: 1px solid rgba(51, 112, 255, 0.08);
  color: #5677d8;
  white-space: nowrap;
  font-weight: 650;
}

.pill.red {
  background: rgba(160, 50, 35, 0.09);
  border-color: rgba(160, 50, 35, 0.08);
  color: var(--red);
}

.pill.gold {
  background: rgba(155, 107, 22, 0.09);
  border-color: rgba(155, 107, 22, 0.08);
  color: var(--gold);
}

.pill.green {
  background: rgba(47, 106, 66, 0.09);
  border-color: rgba(47, 106, 66, 0.08);
  color: var(--green);
}

.pill.teal {
  background: rgba(28, 107, 104, 0.09);
  border-color: rgba(28, 107, 104, 0.08);
  color: var(--teal);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.actions:empty {
  display: none;
}

.action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 10.5px;
  font-weight: 670;
  color: var(--accent);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(51, 112, 255, 0.1);
}

.action.primary {
  background: #3370ff;
  color: white;
  border-color: transparent;
  box-shadow: 0 6px 14px rgba(51, 112, 255, 0.18);
}

.empty {
  padding: 20px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--muted);
  line-height: 1.6;
  font-size: 12px;
  border: 1px solid rgba(51, 112, 255, 0.08);
}

@media (max-width: 1180px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .chart-grid {
    grid-template-columns: 1fr;
  }

  .hero-meta {
    width: 100%;
    justify-content: flex-start;
  }

  .refresh-banner {
    align-items: flex-start;
  }

  .chart-shell {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .chart-card {
    min-height: 0;
  }

}

@media (max-width: 720px) {
  .page {
    padding: 18px 14px 28px;
  }

  .hero {
    padding: 22px 18px 20px;
  }

  .refresh-banner-actions {
    width: 100%;
  }

  .refresh-banner-btn {
    flex: 1 1 calc(50% - 10px);
    text-align: center;
  }

  .hero-nav {
    right: 14px;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
  }

  .hero-back-link {
    min-height: 40px;
    width: auto;
    padding: 0 12px 0 10px;
    justify-content: center;
    gap: 6px;
    font-size: 10px;
  }

  .hero-back-label {
    display: inline;
    font-size: 10px;
  }

  .hero-back-icon {
    width: 18px;
    height: 18px;
  }

  .tabs {
    gap: 8px;
  }

  .tab {
    flex: 1 1 calc(50% - 8px);
    text-align: center;
  }

  .section-tools {
    width: 100%;
    justify-content: flex-start;
  }

  .range-switch {
    width: 100%;
    justify-content: space-between;
  }

  .decision-copy {
    font-size: 11.5px;
    line-height: 1.64;
  }

  .analysis-line {
    padding: 13px 12px 12px;
    gap: 8px;
  }

  .analysis-title {
    font-size: 11.5px;
  }

  .analysis-row {
    grid-template-columns: 50px minmax(0, 1fr);
    gap: 6px;
  }

  .analysis-label {
    font-size: 9px;
  }

  .analysis-copy {
    font-size: 10px;
    line-height: 1.58;
  }

  .actions {
    flex-direction: column;
  }

  .action {
    width: 100%;
  }
}
