:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-soft: #f0f3f6;
  --ink: #17202a;
  --muted: #657386;
  --line: #dce2e8;
  --red: #c9342f;
  --green: #16805f;
  --blue: #2764c6;
  --amber: #a36205;
  --shadow: 0 10px 26px rgba(26, 38, 55, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  line-height: 1.55;
}

button,
a {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(16px, 4vw, 42px);
  border-bottom: 1px solid var(--line);
  background: rgba(246, 247, 249, 0.94);
  backdrop-filter: blur(12px);
}

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

.top-nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
}

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

h1 {
  font-size: 24px;
  line-height: 1.2;
}

h2 {
  font-size: 18px;
}

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

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

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}

.icon-button:hover {
  border-color: #b9c4d0;
}

.layout {
  width: min(1180px, calc(100% - 28px));
  margin: 20px auto 48px;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.portal-card,
.summary-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.portal-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  color: inherit;
  text-decoration: none;
}

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

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

.portal-card.short {
  border-top: 3px solid var(--red);
}

.portal-card.long {
  border-top: 3px solid var(--green);
}

.portal-card.limit {
  border-top: 3px solid var(--amber);
}

.status-strip > div {
  min-width: 0;
  padding: 14px 16px;
  background: var(--panel);
}

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

.status-strip strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  font-size: 15px;
}

.market-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 14px;
  margin: 16px 0 24px;
  align-items: stretch;
}

.market-line > div,
.risk-note,
.learning-panel,
.plan-card,
.pool-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.market-line > div,
.risk-note {
  padding: 16px;
}

.market-line p,
.risk-note {
  color: var(--muted);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 22px 0 12px;
}

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

.plan-grid {
  display: grid;
  grid-template-columns: 1.12fr 1fr 1fr;
  gap: 14px;
}

.plan-card {
  min-width: 0;
  padding: 16px;
}

.plan-card.primary {
  border-color: rgba(201, 52, 47, 0.35);
  box-shadow: 0 14px 34px rgba(201, 52, 47, 0.12);
}

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

.role,
.score,
.ths-link,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.role {
  background: #f9e7e5;
  color: var(--red);
  font-weight: 700;
}

.plan-card:not(.primary) .role {
  background: #e8f0fb;
  color: var(--blue);
}

.score {
  background: var(--panel-soft);
  color: var(--muted);
}

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

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

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

.ths-link {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  color: var(--blue);
  text-decoration: none;
}

.action {
  min-height: 42px;
  margin-top: 14px;
  padding: 10px 12px;
  border-left: 3px solid var(--red);
  background: #fbf2f1;
  color: #6e1c18;
  font-weight: 700;
}

.plan-card:not(.primary) .action {
  border-left-color: var(--blue);
  background: #eef4fc;
  color: #173d7a;
}

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

.price-grid div {
  min-height: 70px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
}

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

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

.entry {
  color: var(--red);
}

.confirm {
  color: var(--blue);
}

.stop {
  color: var(--green);
}

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

.checklist li {
  position: relative;
  padding-left: 18px;
  color: var(--ink);
  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 {
  flex-wrap: wrap;
  justify-content: flex-start;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

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

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

.summary-card {
  padding: 14px;
  box-shadow: none;
}

.summary-card h3 {
  margin-top: 12px;
  font-size: 18px;
}

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

.board-link {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--blue);
  background: var(--panel);
  text-decoration: none;
}

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

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

.pool-row a {
  color: inherit;
  text-decoration: none;
}

.pool-name {
  font-weight: 700;
}

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

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

.tag {
  background: var(--panel-soft);
  color: var(--muted);
}

.learning-panel {
  padding: 16px;
}

.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 dt {
  color: var(--muted);
  font-size: 12px;
}

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

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

@media (max-width: 960px) {
  .plan-grid,
  .market-line,
  .two-column,
  .portal-grid,
  .compact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .topbar {
    padding: 14px;
    align-items: flex-start;
    flex-direction: column;
  }

  .top-nav {
    justify-content: flex-start;
  }

  h1 {
    font-size: 21px;
  }

  .layout {
    width: calc(100% - 20px);
    margin-top: 12px;
  }

  .status-strip {
    grid-template-columns: 1fr;
  }

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

  .plan-card,
  .market-line > div,
  .risk-note,
  .learning-panel {
    padding: 14px;
  }

  .price-grid strong {
    font-size: 18px;
  }
}
