:root {
  --bg: #f5f1e8;
  --panel: #fffaf1;
  --panel-strong: #f0e0c8;
  --ink: #1d1b18;
  --muted: #6f6557;
  --line: rgba(74, 61, 42, 0.16);
  --accent: #af3e2f;
  --accent-dark: #7f261b;
  --green: #2f7d4f;
  --green-soft: rgba(47, 125, 79, 0.12);
  --red: #b44a3a;
  --red-soft: rgba(180, 74, 58, 0.12);
  --shadow: 0 24px 60px rgba(71, 53, 34, 0.12);
  --mono: "SFMono-Regular", "JetBrains Mono", "Menlo", monospace;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(175, 62, 47, 0.22), transparent 30%),
    radial-gradient(circle at top right, rgba(47, 125, 79, 0.18), transparent 22%),
    linear-gradient(180deg, #f7f1e5 0%, #efe7da 100%);
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.hero,
.card,
.symbol-tabs,
.symbol-browser {
  backdrop-filter: blur(10px);
  background: rgba(255, 250, 241, 0.82);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  border-radius: 28px;
  margin-bottom: 18px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1,
.card h2 {
  margin: 0;
  font-weight: 700;
}

.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1;
}

.hero-text {
  max-width: 680px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.hero-actions {
  min-width: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 12px;
}

.primary-button {
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  cursor: pointer;
}

.primary-button:disabled {
  cursor: progress;
  opacity: 0.7;
}

.refresh-status {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.symbol-browser {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
  gap: 16px;
  padding: 16px 18px;
  border-radius: 22px;
  margin-bottom: 18px;
}

.symbol-search-panel,
.common-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.search-label,
.common-label {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

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

.symbol-search-input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 15px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
}

.symbol-search-input:focus {
  outline: 2px solid rgba(175, 62, 47, 0.18);
  border-color: rgba(175, 62, 47, 0.4);
}

.secondary-button {
  border: 1px solid rgba(175, 62, 47, 0.24);
  border-radius: 16px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-dark);
  background: rgba(255, 255, 255, 0.72);
  cursor: pointer;
}

.secondary-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(175, 62, 47, 0.24);
  color: var(--accent-dark);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.72);
  font-weight: 700;
}

.search-hint {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
}

.symbol-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0;
  border-radius: 0;
  margin-bottom: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.tab-button {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.tab-name {
  font-weight: 600;
}

.tab-code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.tab-button:hover {
  transform: translateY(-1px);
  border-color: rgba(175, 62, 47, 0.35);
}

.tab-button.active {
  background: linear-gradient(135deg, rgba(175, 62, 47, 0.12), rgba(127, 38, 27, 0.2));
  border-color: rgba(175, 62, 47, 0.35);
  font-weight: 700;
}

.content-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 18px;
}

.card {
  border-radius: 28px;
  padding: 22px;
}

.headline-card,
.forecast-card {
  min-height: 260px;
}

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

.date-badge,
.mode-badge {
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--panel-strong);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
}

.pulse-code {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}

.pulse-bit {
  width: 64px;
  height: 84px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 34px;
  font-weight: 700;
  border: 1px solid var(--line);
}

.pulse-bit.is-one {
  background: linear-gradient(180deg, rgba(47, 125, 79, 0.18), rgba(47, 125, 79, 0.08));
  color: var(--green);
}

.pulse-bit.is-zero {
  background: linear-gradient(180deg, rgba(180, 74, 58, 0.18), rgba(180, 74, 58, 0.08));
  color: var(--red);
}

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

.legend-item {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.legend-item strong {
  display: block;
  margin-bottom: 6px;
}

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

.forecast-text {
  margin: 0;
  white-space: pre-wrap;
  font-family: var(--sans);
  line-height: 1.8;
  color: var(--ink);
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  padding: 14px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

th {
  color: var(--muted);
  font-weight: 600;
}

.bit-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  border-radius: 999px;
  font-family: var(--mono);
  font-weight: 700;
}

.bit-pill.one {
  color: var(--green);
  background: var(--green-soft);
}

.bit-pill.zero {
  color: var(--red);
  background: var(--red-soft);
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-item {
  display: grid;
  grid-template-columns: 100px 110px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.68);
}

.history-item code {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
}

.history-item .muted {
  color: var(--muted);
  font-size: 13px;
}

.empty-state {
  padding: 20px;
  border-radius: 16px;
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
}

.report-shell {
  padding-bottom: 48px;
}

.report-browser {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
}

.report-focus-input {
  width: 100%;
  min-height: 112px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  font: inherit;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
}

.report-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
  margin-top: 18px;
}

.common-card {
  margin-top: 18px;
}

.report-summary {
  line-height: 1.8;
}

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

.summary-item {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
}

.summary-item span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.summary-item strong {
  font-size: 14px;
  line-height: 1.7;
}

.summary-item-wide {
  grid-column: 1 / -1;
}

.report-output-card {
  min-height: 640px;
}

.report-output {
  min-height: 520px;
}

.report-page {
  background:
    linear-gradient(180deg, #f7f6f2 0%, #f1efe8 100%);
}

.minimalist-shell {
  width: min(980px, calc(100% - 28px));
}

.minimalist-hero,
.report-card {
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 16px 32px rgba(38, 34, 28, 0.06);
  border-color: rgba(74, 61, 42, 0.1);
}

.minimalist-hero {
  align-items: flex-end;
}

.minimalist-link {
  min-height: 42px;
}

.report-stack {
  display: grid;
  gap: 16px;
}

.report-card {
  border-radius: 24px;
}

.report-input-card,
.report-style-card,
.common-card {
  padding: 18px 20px;
}

.compact-head {
  margin-bottom: 12px;
}

.style-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.style-chip {
  border: 1px solid rgba(74, 61, 42, 0.12);
  border-radius: 999px;
  padding: 10px 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.style-chip.active {
  background: #1d1b18;
  color: #fff;
  border-color: #1d1b18;
}

.minimalist-tabs {
  gap: 8px;
}

.minimalist-output-card {
  min-height: 680px;
}

.report-output-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.minimalist-summary {
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(74, 61, 42, 0.08);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

@media (max-width: 960px) {
  .hero {
    flex-direction: column;
  }

  .symbol-browser,
  .content-grid,
  .report-grid {
    grid-template-columns: 1fr;
  }

  .pulse-legend {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .hero,
  .card {
    border-radius: 22px;
    padding: 18px;
  }

  .symbol-browser {
    padding: 16px;
  }

  .search-row {
    flex-direction: column;
  }

  .report-output-actions {
    width: 100%;
    justify-content: space-between;
  }

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

  .pulse-code {
    gap: 8px;
  }

  .pulse-bit {
    width: 48px;
    height: 68px;
    font-size: 26px;
  }

  .history-item {
    grid-template-columns: 1fr;
  }
}
