:root {
  color-scheme: light;
  --bg: #fff8eb;
  --surface: #fffdf8;
  --surface-soft: #fff8ec;
  --surface-strong: #eef7f1;
  --ink: #17221d;
  --muted: #6c7568;
  --line: #e7d8bd;
  --red: #b4261f;
  --red-soft: #fff0e8;
  --green: #0c7a59;
  --green-soft: #eaf8ef;
  --blue: #1f5f99;
  --blue-soft: #edf6ff;
  --amber: #b7791f;
  --amber-soft: #fff5dc;
  --gold: #d6a642;
  --gold-soft: #fff3c8;
  --earth: #8a6a3f;
  --water: #22577a;
  --shadow: 0 14px 34px rgba(102, 69, 22, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background-color: var(--bg);
  background-image:
    linear-gradient(180deg, rgba(255, 243, 200, 0.84) 0, rgba(255, 248, 235, 0.18) 230px, transparent 520px),
    linear-gradient(135deg, rgba(214, 166, 66, 0.1) 0 1px, transparent 1px 36px),
    linear-gradient(45deg, rgba(12, 122, 89, 0.055) 0 1px, transparent 1px 40px);
  background-attachment: fixed;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  line-height: 1.55;
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
}

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

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px clamp(14px, 3.2vw, 40px);
  border-bottom: 1px solid rgba(181, 126, 35, 0.26);
  background: rgba(255, 250, 240, 0.94);
  box-shadow: 0 10px 26px rgba(102, 69, 22, 0.08);
  backdrop-filter: blur(14px);
}

.app-header::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #b4261f, #d6a642, #0c7a59, #22577a, #8a6a3f);
  content: "";
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(214, 166, 66, 0.72);
  border-radius: 8px;
  background: linear-gradient(135deg, #fff7dc 0%, #fff0e8 100%);
  color: #8f1f17;
  font-weight: 900;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.72), 0 8px 18px rgba(180, 38, 31, 0.12);
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.brand strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 18px;
  line-height: 1.25;
}

.nav-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-actions a,
.refresh-button,
.quote-button,
.board-button,
.ths-link {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.94);
  color: var(--ink);
  text-decoration: none;
}

.nav-actions a:hover,
.refresh-button:hover,
.quote-button:hover,
.board-button:hover,
.ths-link:hover {
  border-color: rgba(214, 166, 66, 0.72);
  background: var(--gold-soft);
}

.nav-actions a {
  padding: 0 12px;
  font-size: 13px;
}

.refresh-button {
  width: 38px;
  color: var(--blue);
  cursor: pointer;
}

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

.page-shell {
  width: min(1240px, calc(100% - 28px));
  margin: 18px auto 56px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.52fr) minmax(340px, 0.88fr);
  gap: 16px;
  align-items: stretch;
}

.focus-panel,
.alert-panel,
.learning-panel,
.plan-card,
.summary-card,
.pool-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.focus-panel {
  padding: 18px;
  border-color: rgba(214, 166, 66, 0.55);
  border-top: 4px solid var(--gold);
  background:
    linear-gradient(180deg, rgba(255, 246, 220, 0.72), rgba(255, 253, 248, 0.96) 38%),
    var(--surface);
}

.panel-head,
.focus-title-row,
.plan-top,
.stock-title,
.meta-row,
.pool-main,
.pool-stats,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-kicker,
.subtle,
.price-cell span,
.card-price-grid span,
.status-grid span,
.strategy-link span,
.strategy-link small,
.learning-panel dt,
.pool-code {
  color: var(--muted);
  font-size: 12px;
}

.section-kicker {
  font-weight: 700;
  color: var(--earth);
}

.state-pill,
.role,
.score,
.tag {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.state-pill {
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid rgba(180, 38, 31, 0.12);
}

.state-pill.neutral {
  background: var(--surface-strong);
  color: var(--muted);
}

.state-pill.good {
  background: var(--green-soft);
  color: var(--green);
}

.focus-title-row {
  align-items: flex-start;
  margin-top: 18px;
}

.focus-title-row h1 {
  color: #7b1e18;
  font-size: 32px;
  line-height: 1.15;
}

.quote-button,
.board-button,
.ths-link {
  flex: 0 0 auto;
  padding: 0 12px;
  color: var(--blue);
  font-size: 13px;
}

.focus-action {
  margin-top: 16px;
  min-height: 54px;
  padding: 12px 14px;
  border: 1px solid rgba(180, 38, 31, 0.18);
  border-left: 4px solid var(--red);
  border-radius: 6px;
  background: linear-gradient(90deg, var(--red-soft), #fff9ed);
  color: #681915;
  font-weight: 800;
}

.price-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.price-cell,
.card-price-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fffdf8, var(--surface-soft));
}

.price-cell {
  min-height: 86px;
  padding: 12px;
}

.price-cell strong,
.card-price-grid strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-size: 21px;
  line-height: 1.18;
}

.price-cell.entry strong,
.entry {
  color: var(--red);
}

.price-cell.confirm strong,
.confirm {
  color: var(--blue);
}

.price-cell.stop strong,
.stop {
  color: var(--green);
}

.price-cell.avg strong,
.avg {
  color: var(--amber);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tag {
  background: var(--surface-strong);
  color: var(--muted);
}

.side-stack {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(214, 166, 66, 0.34);
  box-shadow: var(--shadow);
}

.status-grid div {
  min-height: 82px;
  min-width: 0;
  padding: 12px;
  background: var(--surface);
}

.status-grid strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.35;
}

.alert-panel {
  min-height: 180px;
  padding: 15px;
  box-shadow: var(--shadow);
}

.alert-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.alert-item {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: linear-gradient(180deg, #fffdf8, var(--surface-soft));
}

.alert-item.action {
  border-left-color: var(--red);
  background: var(--red-soft);
}

.alert-item.warning,
.alert-item.danger {
  border-left-color: var(--amber);
  background: var(--amber-soft);
}

.alert-item strong {
  display: block;
  font-size: 14px;
}

.alert-item p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

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

.strategy-link {
  min-width: 0;
  display: grid;
  gap: 7px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(255, 248, 236, 0.82)),
    var(--surface);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.strategy-link:hover {
  transform: translateY(-1px);
  border-color: rgba(214, 166, 66, 0.7);
}

.strategy-link.short {
  border-top: 4px solid var(--red);
}

.strategy-link.long {
  border-top: 4px solid var(--green);
}

.strategy-link.after {
  border-top: 4px solid var(--blue);
}

.strategy-link.limit {
  border-top: 4px solid var(--gold);
}

.strategy-link strong {
  min-height: 28px;
  overflow-wrap: anywhere;
  font-size: 19px;
}

.discipline-band {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 1px;
  overflow: hidden;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(214, 166, 66, 0.38);
}

.discipline-band div {
  min-width: 0;
  padding: 15px 16px;
  background: var(--surface);
}

.discipline-band p {
  margin-top: 6px;
  color: var(--muted);
}

.section-block {
  margin-top: 28px;
}

.section-head {
  align-items: flex-end;
  margin-bottom: 12px;
}

.section-head.compact {
  align-items: center;
}

.section-head h2 {
  margin-top: 2px;
  font-size: 22px;
}

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

.plan-card {
  min-width: 0;
  padding: 15px;
  box-shadow: var(--shadow);
}

.plan-card.primary {
  border-color: rgba(214, 166, 66, 0.62);
  border-top: 4px solid var(--gold);
  background:
    linear-gradient(180deg, rgba(255, 243, 200, 0.52), rgba(255, 253, 248, 0.96) 34%),
    var(--surface);
}

.role {
  background: var(--blue-soft);
  color: var(--blue);
}

.plan-card.primary .role {
  background: var(--gold-soft);
  color: #7a4d08;
}

.score {
  background: var(--surface-strong);
  color: var(--muted);
}

.stock-title {
  align-items: flex-start;
  margin-top: 13px;
}

.stock-title h3 {
  font-size: 21px;
  line-height: 1.2;
}

.symbol {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.action {
  min-height: 50px;
  margin-top: 13px;
  padding: 10px 12px;
  border-left: 4px solid var(--blue);
  border-radius: 6px;
  background: var(--blue-soft);
  color: #16376f;
  font-weight: 800;
}

.plan-card.primary .action {
  border-left-color: var(--gold);
  background: linear-gradient(90deg, var(--gold-soft), #fffdf8);
  color: #681915;
}

.card-price-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 13px;
}

.card-price-grid div {
  min-height: 70px;
  padding: 10px;
}

.checklist {
  display: grid;
  gap: 8px;
  margin: 13px 0 0;
  padding: 0;
  list-style: none;
}

.checklist li {
  position: relative;
  padding-left: 18px;
  color: #29384b;
  font-size: 13px;
}

.checklist li::before {
  position: absolute;
  left: 0;
  top: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
  content: "";
}

.meta-row {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 13px;
  color: var(--muted);
  font-size: 12px;
}

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

.overnight-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.overnight-card {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.4fr);
  gap: 1px;
  background: var(--line);
}

.overnight-main,
.overnight-detail {
  min-width: 0;
  padding: 16px;
  background: var(--surface);
}

.overnight-main h3 {
  margin-top: 10px;
  overflow-wrap: anywhere;
  font-size: 24px;
}

.overnight-main p,
.overnight-detail p {
  margin-top: 10px;
  color: var(--muted);
}

.overnight-price {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.overnight-price div {
  min-width: 0;
  min-height: 68px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.overnight-price span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.overnight-price strong {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
  font-size: 20px;
}

.reason-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding-left: 18px;
}

.reason-list li {
  color: #29384b;
  font-size: 13px;
}

.summary-card {
  min-width: 0;
  padding: 14px;
  box-shadow: none;
  background: linear-gradient(180deg, #fffdf8, #fff9ef);
}

.summary-card h3 {
  margin-top: 10px;
  overflow-wrap: anywhere;
  font-size: 18px;
}

.summary-card p {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.limit-fast-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 12px;
  margin-top: 12px;
}

.limit-fast-summary,
.limit-fast-list {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.limit-fast-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
}

.limit-fast-summary h3 {
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: 20px;
}

.limit-fast-summary p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.limit-fast-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  gap: 8px;
}

.limit-fast-metrics span {
  min-width: 0;
  padding: 8px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.limit-fast-metrics b {
  display: block;
  color: var(--gold);
  font-size: 20px;
  line-height: 1.1;
}

.limit-fast-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  background: var(--line);
}

.limit-fast-list a {
  min-width: 0;
  padding: 11px 12px;
  background: var(--surface);
  text-decoration: none;
}

.limit-fast-list strong,
.limit-fast-list span {
  display: block;
  overflow-wrap: anywhere;
}

.limit-fast-list span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  gap: 18px;
}

.pool-list {
  display: grid;
  gap: 8px;
}

.pool-row {
  padding: 12px 14px;
  box-shadow: none;
}

.pool-main a {
  min-width: 0;
  text-decoration: none;
}

.pool-name {
  display: block;
  font-weight: 800;
}

.pool-stats {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.pool-stats span {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-strong);
}

.learning-panel {
  padding: 15px;
  box-shadow: none;
  background:
    linear-gradient(180deg, rgba(234, 248, 239, 0.64), rgba(255, 253, 248, 0.95)),
    var(--surface);
}

.learning-panel p {
  color: var(--muted);
}

.learning-panel dl {
  display: grid;
  gap: 12px;
  margin: 16px 0 0;
}

.learning-panel div {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.learning-panel dd {
  margin: 4px 0 0;
}

.empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

@media (max-width: 1060px) {
  .hero-grid,
  .plan-grid,
  .summary-grid,
  .lower-grid,
  .limit-fast-panel {
    grid-template-columns: 1fr;
  }

  .price-board,
  .strategy-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overnight-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px;
  }

  .nav-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .nav-actions a {
    flex: 1 1 auto;
  }

  .page-shell {
    width: calc(100% - 18px);
    margin-top: 10px;
  }

  .brand strong {
    font-size: 16px;
  }

  .focus-panel,
  .alert-panel,
  .plan-card,
  .learning-panel {
    padding: 13px;
  }

  .focus-title-row {
    flex-direction: column;
  }

  .focus-title-row h1 {
    font-size: 25px;
  }

  .quote-button,
  .board-button {
    width: 100%;
  }

  .price-board,
  .status-grid,
  .strategy-links,
  .discipline-band,
  .card-price-grid,
  .overnight-price,
  .limit-fast-summary,
  .limit-fast-list {
    grid-template-columns: 1fr;
  }

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

  .section-head h2 {
    font-size: 20px;
  }

  .price-cell strong,
  .card-price-grid strong {
    font-size: 19px;
  }
}
