:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --ink: #111827;
  --muted: #667085;
  --line: #d9e0e6;
  --panel: #ffffff;
  --soft: #edf2f5;
  --red: #c43c3c;
  --green: #0f8b5f;
  --teal: #107d8c;
  --amber: #b7791f;
  --navy: #121826;
  --shadow: 0 18px 42px rgba(17, 24, 39, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 246, 248, 0.92)),
    radial-gradient(circle at 10% 0%, rgba(16, 125, 140, 0.12), transparent 28%),
    radial-gradient(circle at 90% 0%, rgba(183, 121, 31, 0.1), transparent 32%);
  color: var(--ink);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.topbar,
main,
footer {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 32px 0 20px;
}

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

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--ink) 0 48%, transparent 48%),
    linear-gradient(135deg, var(--teal) 0 58%, var(--amber) 58% 100%);
  box-shadow: inset 0 0 0 1px rgba(17, 24, 39, 0.12);
  flex: 0 0 auto;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 780px;
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 54px);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.18;
}

h3 {
  margin-bottom: 10px;
  font-size: 17px;
}

.date-block {
  min-width: 190px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  text-align: right;
}

.date-block span,
.date-block strong,
.date-block small {
  display: block;
}

.date-block span,
.date-block small {
  color: var(--muted);
  font-size: 12px;
}

.date-block strong {
  margin-top: 4px;
  font-size: 15px;
}

.date-block small {
  margin-top: 6px;
  line-height: 1.4;
}

.refresh-button {
  width: 100%;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.refresh-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.live-status {
  color: var(--muted);
}

.live-status[data-tone="ok"] {
  color: var(--teal);
}

.live-status[data-tone="error"] {
  color: var(--amber);
}

main {
  display: grid;
  gap: 18px;
  padding-bottom: 22px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.9fr);
  gap: 18px;
}

.market-brief,
.risk-panel,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.market-brief {
  padding: clamp(24px, 4vw, 42px);
}

.section-title h2 {
  max-width: 800px;
  font-size: clamp(32px, 5vw, 62px);
  line-height: 1.04;
  letter-spacing: 0;
}

.lead {
  max-width: 880px;
  margin: 24px 0 0;
  color: #344054;
  font-size: 18px;
  line-height: 1.8;
}

.brief-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 30px;
}

.brief-metrics div,
.model-card,
.index-card,
.watch-card,
.backup-card,
.risk-grid div,
.thesis-list article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.brief-metrics div {
  min-height: 86px;
  padding: 16px;
}

.brief-metrics span,
.model-card span,
.index-card span,
.watch-meta span,
.risk-grid span,
.forecast-box span {
  color: var(--muted);
  font-size: 13px;
}

.brief-metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
}

.model-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.model-card {
  min-height: 94px;
  padding: 14px;
}

.model-card span {
  display: block;
  margin-bottom: 12px;
  color: var(--amber);
  font-size: 20px;
  font-weight: 900;
}

.model-card strong {
  font-size: 15px;
}

.risk-panel {
  padding: 24px;
  background: var(--navy);
  color: #f8fafc;
}

.risk-panel h2 {
  margin-bottom: 18px;
}

.risk-panel ul {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #d8e0e8;
  line-height: 1.7;
}

.risk-panel li {
  padding-left: 18px;
  border-left: 3px solid var(--amber);
}

.panel {
  padding: 24px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-head > p {
  max-width: 440px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  text-align: right;
}

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

.index-card {
  min-height: 168px;
  padding: 16px;
}

.index-card strong {
  display: block;
  margin: 8px 0 6px;
  font-size: 24px;
  letter-spacing: 0;
}

.change {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 800;
}

.up,
.red-text {
  color: var(--red);
}

.up {
  background: rgba(196, 60, 60, 0.1);
}

.down,
.green-text {
  color: var(--green);
}

.down {
  background: rgba(15, 139, 95, 0.12);
}

.small-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

.wide-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 18px;
}

.sector-list {
  display: grid;
  gap: 12px;
}

.sector-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 78px;
  align-items: center;
  gap: 12px;
}

.rank {
  color: var(--muted);
  font-weight: 800;
}

.bar-track {
  height: 10px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft);
}

.bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--amber));
}

.sector-name {
  font-weight: 800;
}

.sector-meta {
  color: var(--muted);
  font-size: 12px;
}

.sector-value {
  font-weight: 900;
  text-align: right;
}

.thesis-panel {
  background: #fbfcfd;
}

.thesis-list {
  display: grid;
  gap: 12px;
}

.thesis-list article {
  padding: 18px;
}

.thesis-list span {
  color: var(--amber);
  font-size: 12px;
  font-weight: 900;
}

.thesis-list p,
.report p {
  margin-bottom: 0;
  color: #344054;
  line-height: 1.8;
}

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

.watch-card {
  display: grid;
  gap: 14px;
  min-height: 560px;
  padding: 18px;
}

.watch-title {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.watch-title h3 {
  margin: 0;
  font-size: 21px;
}

.watch-title span {
  color: var(--muted);
  font-size: 13px;
}

.score {
  min-width: 56px;
  padding: 7px 8px;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
}

.score small {
  display: block;
  margin-bottom: 2px;
  color: #d8e0e8;
  font-size: 10px;
  font-weight: 700;
}

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

.watch-meta div,
.forecast-box {
  border-radius: 8px;
  background: var(--soft);
}

.watch-meta div {
  min-height: 60px;
  padding: 10px;
}

.watch-meta strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
}

.spark {
  width: 100%;
  height: 76px;
}

.factor-box {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.factor-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.factor-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft);
}

.factor-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--amber));
}

.factor-row b {
  color: var(--ink);
  text-align: right;
}

.forecast-box {
  display: grid;
  gap: 8px;
  padding: 14px;
  color: #344054;
  font-size: 13px;
  line-height: 1.65;
}

.forecast-box div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.forecast-box p {
  margin: 0;
}

.points {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: #344054;
  font-size: 13px;
  line-height: 1.55;
}

.points li {
  padding-left: 12px;
  border-left: 2px solid var(--teal);
}

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

.report article {
  padding-top: 14px;
  border-top: 3px solid var(--line);
}

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

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

.backup-card {
  display: grid;
  gap: 10px;
  min-height: 188px;
  padding: 16px;
}

.backup-card div {
  display: grid;
  gap: 4px;
}

.backup-card strong {
  font-size: 18px;
}

.backup-card span,
.backup-card small {
  color: var(--muted);
  font-size: 12px;
}

.backup-card > b {
  width: 42px;
  padding: 6px 0;
  border-radius: 8px;
  background: var(--soft);
  color: var(--navy);
  text-align: center;
}

.backup-card p {
  margin: 0;
  color: #344054;
  font-size: 13px;
  line-height: 1.55;
}

.scenario-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.scenario-summary article {
  display: grid;
  gap: 8px;
  min-height: 118px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.scenario-summary strong {
  font-size: 18px;
}

.scenario-summary span {
  color: #344054;
  font-size: 13px;
  line-height: 1.6;
}

.scenario-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.scenario-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 14px;
}

.scenario-table th,
.scenario-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.scenario-table th {
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.scenario-table tbody tr:last-child td {
  border-bottom: 0;
}

.scenario-table td:first-child {
  font-weight: 900;
}

.scenario-notes {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  color: #344054;
  line-height: 1.75;
}

.scenario-notes p {
  margin: 0;
}

.starter-rules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.starter-rules article {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.starter-rules strong {
  font-size: 18px;
}

.starter-rules span {
  color: #344054;
  font-size: 13px;
  line-height: 1.6;
}

.starter-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.starter-trend-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.starter-trend-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.starter-trend-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.starter-trend-head div {
  display: grid;
  gap: 4px;
}

.starter-trend-head strong {
  font-size: 17px;
}

.starter-trend-head span,
.starter-trend-meta span {
  color: var(--muted);
  font-size: 12px;
}

.starter-trend-head b {
  white-space: nowrap;
}

.starter-trend-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
}

.starter-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
  font-size: 14px;
}

.starter-table th,
.starter-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.starter-table th {
  background: var(--soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.starter-table tbody tr:last-child td {
  border-bottom: 0;
}

.starter-table td:nth-child(2) {
  font-weight: 900;
  white-space: nowrap;
}

.starter-table td:nth-child(1),
.starter-table td:nth-child(4),
.starter-table td:nth-child(5),
.starter-table td:nth-child(8) {
  white-space: nowrap;
}

.starter-notes {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  color: #344054;
  line-height: 1.75;
}

.starter-notes p {
  margin: 0;
}

.risk-grid div {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 16px;
}

footer {
  padding: 8px 0 32px;
}

footer p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

@media (max-width: 1120px) {
  .index-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .model-grid,
  .backup-grid,
  .scenario-summary,
  .starter-rules,
  .starter-trend-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 920px) {
  .hero-grid,
  .wide-grid,
  .watch-grid,
  .backup-grid,
  .scenario-summary,
  .starter-rules,
  .starter-trend-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .date-block {
    text-align: left;
  }

  .brief-metrics,
  .model-grid,
  .index-grid,
  .watch-meta,
  .report-grid,
  .risk-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }

  .section-head > p {
    text-align: left;
  }

  .topbar,
  main,
  footer {
    width: min(100% - 24px, 1180px);
  }

  .panel,
  .risk-panel,
  .market-brief {
    padding: 18px;
  }
}
