:root {
  color-scheme: light;
  --ink: #18201c;
  --muted: #6c746f;
  --line: #dfe3dd;
  --paper: #ffffff;
  --canvas: #f2f4ef;
  --green: #174f3a;
  --green-2: #277258;
  --mint: #dcece4;
  --amber: #b57826;
  --danger: #a84035;
  font-family: "Microsoft YaHei UI", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 10%, rgba(39, 114, 88, 0.08), transparent 24rem),
    var(--canvas);
}

button, input, select { font: inherit; }
button { cursor: pointer; }

.topbar {
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 13px;
  display: grid; place-items: center;
  background: var(--green); color: white;
  font-family: "STKaiti", serif; font-size: 25px; font-weight: 700;
}
.brand h1 { font-size: 20px; margin: 0 0 4px; }
.brand p { font-size: 12px; color: var(--muted); margin: 0; }
.top-actions { display: flex; gap: 10px; }

.workspace {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 24px;
  padding: 24px 32px 36px;
  max-width: 1600px;
  margin: 0 auto;
}

.sidebar { display: flex; flex-direction: column; gap: 16px; }
.panel, .data-card, .result-card, .content-head {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
}
.panel { padding: 20px; }
.section-heading { margin-bottom: 18px; }
.section-heading h2, .content-head h2 { margin: 4px 0 0; font-size: 20px; }
.eyebrow {
  color: var(--green-2); font-size: 10px; letter-spacing: 0.14em; font-weight: 800;
}

label {
  display: grid;
  gap: 7px;
  margin: 14px 0;
  font-size: 12px;
  font-weight: 700;
  color: #4e5752;
}
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.two-columns label { margin-top: 8px; margin-bottom: 8px; }
details {
  margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px;
}
summary { font-size: 11px; font-weight: 700; color: var(--green); cursor: pointer; }
input, select {
  width: 100%; height: 42px;
  border: 1px solid #d7dcd6; border-radius: 10px;
  background: #fbfcfa; color: var(--ink);
  padding: 0 12px; outline: none;
}
input:focus, select:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(39,114,88,.1); }
.score-input { position: relative; }
.score-input input { padding-right: 44px; font-size: 20px; font-weight: 800; }
.score-input span { position: absolute; right: 13px; top: 11px; color: var(--muted); }

.rank-card {
  padding: 15px; background: var(--green); color: white; border-radius: 14px;
  display: grid; gap: 5px; margin-top: 16px;
}
.rank-card span { font-size: 11px; opacity: .75; }
.rank-card strong { font-size: 25px; }
.rank-card small { font-size: 10px; opacity: .72; }

.data-card { padding: 16px; display: flex; gap: 12px; align-items: flex-start; }
.data-card strong { font-size: 13px; }
.data-card p { margin: 4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.live-dot { width: 9px; height: 9px; background: #22a565; border-radius: 50%; margin-top: 4px; box-shadow: 0 0 0 5px rgba(34,165,101,.12); }

.content { min-width: 0; }
.content-head {
  padding: 22px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  margin-bottom: 16px;
}
.content-head p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.notice {
  max-width: 360px; background: #fff7e9; border: 1px solid #f1ddb9;
  border-radius: 12px; padding: 12px 14px; display: grid; gap: 3px;
}

.mode-switch {
  display: flex; background: #edf1ec; padding: 4px; border-radius: 12px;
}
.mode-button {
  border: 0; background: transparent; color: var(--muted);
  padding: 9px 15px; border-radius: 9px; font-weight: 700; font-size: 12px;
}
.mode-button.active { color: white; background: var(--green); box-shadow: 0 4px 12px rgba(23,79,58,.18); }

.strategy-bar {
  display: flex; align-items: center; gap: 8px; margin: 0 0 14px;
  padding: 10px 12px; background: white; border: 1px solid var(--line); border-radius: 14px;
}
.strategy-bar > span { margin-left: auto; color: var(--muted); font-size: 10px; }
.strategy {
  border: 1px solid var(--line); background: white; border-radius: 999px;
  padding: 7px 12px; font-size: 11px; font-weight: 800; color: var(--muted);
}
.strategy.active { border-color: var(--green); color: var(--green); background: var(--mint); }
.strategy.challenge.active { color: #a54d32; background: #f9e7e0; border-color: #e9b6a5; }
.strategy.steady.active { color: #23649b; background: #e3f0fb; border-color: #b3d0e7; }
.strategy.safe.active { color: #24734d; background: #dff2e7; border-color: #afd7bf; }
.strategy b { margin-left: 3px; }
.notice strong { color: #815818; font-size: 11px; }
.notice span { color: #78664a; font-size: 11px; }

.result-list { display: grid; gap: 12px; }
.result-card {
  padding: 20px 22px;
  display: grid;
  grid-template-columns: minmax(220px, 1.15fr) minmax(260px, 1.35fr) minmax(205px, .85fr) auto;
  gap: 18px; align-items: center;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.result-card:hover { transform: translateY(-1px); border-color: #bfcac2; box-shadow: 0 9px 28px rgba(30,55,43,.07); }
.university-block h3 { font-size: 17px; margin: 0 0 8px; }
.meta-row, .tag-row { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.meta-row { color: var(--muted); font-size: 11px; }
.tag { padding: 4px 8px; background: #edf2ed; color: #536058; border-radius: 999px; font-size: 10px; }
.tag.green { background: var(--mint); color: var(--green); }
.tag.amber { background: #f7ead7; color: #885b1d; }
.major-preview strong { display: block; margin-bottom: 8px; font-size: 12px; }
.major-preview p { margin: 0; color: #59625d; font-size: 12px; line-height: 1.7; }
.history-brief {
  border-left: 1px solid var(--line); padding-left: 16px; display: grid; gap: 5px;
}
.history-brief strong { font-size: 11px; }
.history-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); }
.history-line b { color: var(--ink); font-size: 12px; }
.confidence { font-size: 9px; padding: 3px 6px; border-radius: 999px; background: #edf1ec; color: var(--muted); }
.category-badge {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  border-radius: 10px; font-size: 16px; font-weight: 900;
}
.category-冲 { color: #a54d32; background: #f9e7e0; }
.category-稳 { color: #23649b; background: #e3f0fb; }
.category-保 { color: #24734d; background: #dff2e7; }
.category-待评估, .category-不建议, .category-过度保底 { color: #6c746f; background: #edf1ec; }
.check-row {
  display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px;
  font-size: 10px; color: var(--muted);
}
.check-row label { display: flex; align-items: center; gap: 5px; margin: 0; font-size: 10px; }
.check-row input { width: 15px; height: 15px; padding: 0; }
.risk-row { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 5px; }
.risk-chip { font-size: 9px; border-radius: 999px; padding: 4px 7px; color: #825218; background: #fff1d9; }
.risk-chip.block { color: #9d352b; background: #fde6e3; }
.match-label { font-size: 9px; color: var(--muted); }
.card-actions { display: grid; gap: 8px; min-width: 94px; }

.primary-button, .ghost-button, .wide-button, .danger-button, .icon-button {
  border-radius: 10px; padding: 10px 14px; border: 1px solid transparent;
  font-weight: 700; font-size: 12px;
}
.primary-button { background: var(--green); color: white; }
.primary-button:hover { background: #0f3f2d; }
.ghost-button { background: white; color: var(--ink); border-color: var(--line); }
.wide-button { width: 100%; background: #edf1ec; color: #46504a; }
.wide-button + .wide-button { margin-top: 8px; }
.wide-button.accent { background: var(--green); color: white; }
.danger-button { color: var(--danger); background: #fff2f0; border-color: #f0d1cd; }
.icon-button { font-size: 24px; line-height: 1; background: transparent; color: var(--muted); }
.saved { background: #dfece5 !important; color: var(--green) !important; border-color: #bad2c4 !important; }

.pagination { display: flex; justify-content: center; gap: 14px; align-items: center; padding: 22px; }
.pagination span { font-size: 12px; color: var(--muted); }
.pagination button:disabled { opacity: .4; cursor: default; }

dialog {
  width: min(980px, calc(100vw - 80px)); max-height: calc(100vh - 80px);
  border: 0; border-radius: 20px; padding: 0; color: var(--ink);
  box-shadow: 0 30px 80px rgba(11,28,19,.28);
}
dialog::backdrop { background: rgba(18,28,23,.5); backdrop-filter: blur(5px); }
.dialog-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 24px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: white; z-index: 2;
}
.dialog-head h2 { margin: 5px 0; }
.dialog-head p { color: var(--muted); margin: 0; font-size: 12px; }
.major-table { padding: 8px 24px 24px; }
.history-panel {
  margin: 18px 24px 6px; padding: 16px; border-radius: 14px;
  background: #eef5f1; border: 1px solid #d5e5dc;
}
.history-panel h3 { margin: 0 0 10px; font-size: 13px; }
.history-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.history-box { background: white; padding: 12px; border-radius: 10px; }
.history-box span { display: block; color: var(--muted); font-size: 9px; margin-bottom: 4px; }
.history-box strong { font-size: 13px; }
.risk-panel { margin-top: 12px; font-size: 11px; color: #665b48; }
.major-row {
  display: grid; grid-template-columns: 54px minmax(180px, 1fr) 74px 92px 2fr;
  gap: 12px; padding: 14px 6px; border-bottom: 1px solid #edf0ec; font-size: 12px;
}
.major-row.header { position: sticky; top: 99px; background: white; color: var(--muted); font-size: 10px; font-weight: 800; }
.major-row .notes { color: #626b66; line-height: 1.55; }
.favorite-list { padding: 18px 24px; min-height: 180px; }
.favorite-item { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.favorite-order { width: 30px; height: 30px; display: grid; place-items: center; background: #edf1ec; border-radius: 8px; font-weight: 800; font-size: 11px; }
.favorite-item h3 { font-size: 14px; margin: 0 0 5px; }
.favorite-item p { color: var(--muted); font-size: 11px; margin: 0; }
.plan-toolbar { padding: 12px 24px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); font-size: 10px; color: var(--muted); }
.dialog-footer { padding: 18px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.empty { padding: 48px 20px; text-align: center; background: white; border: 1px dashed #cfd5cf; border-radius: 18px; color: var(--muted); }

@media (max-width: 1160px) {
  .workspace { grid-template-columns: 280px minmax(0,1fr); padding: 20px; }
  .result-card { grid-template-columns: 1fr 1fr auto; }
  .major-preview { grid-column: 1; grid-row: 2; }
  .history-brief { grid-column: 2; grid-row: 1 / 3; }
  .card-actions { grid-column: 3; grid-row: 1 / 3; }
}

@media (max-width: 820px) {
  .topbar {
    height: auto;
    position: static;
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
  }
  .brand-mark { width: 40px; height: 40px; border-radius: 12px; }
  .brand h1 { font-size: 18px; }
  .brand p { line-height: 1.45; }
  .top-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .top-actions .primary-button { grid-column: 1 / -1; }
  .workspace {
    display: block;
    padding: 14px;
  }
  .sidebar { margin-bottom: 14px; }
  .content-head {
    display: grid;
    gap: 14px;
    padding: 18px;
  }
  .mode-switch { width: 100%; }
  .mode-button { flex: 1; }
  .strategy-bar {
    align-items: stretch;
    flex-wrap: wrap;
  }
  .strategy-bar > span {
    width: 100%;
    margin-left: 0;
    line-height: 1.5;
  }
  .result-card {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px;
  }
  .major-preview,
  .history-brief,
  .card-actions {
    grid-column: auto;
    grid-row: auto;
  }
  .history-brief {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 12px 0 0;
  }
  .card-actions {
    grid-template-columns: 1fr 1fr;
  }
  dialog {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }
  .dialog-head,
  .plan-toolbar,
  .dialog-footer {
    padding: 16px;
  }
  .major-table,
  .favorite-list {
    padding: 8px 16px 16px;
  }
  .history-panel {
    margin: 14px 16px 6px;
  }
  .history-grid {
    grid-template-columns: 1fr 1fr;
  }
  .major-row {
    grid-template-columns: 42px minmax(120px, 1fr);
  }
  .major-row span:nth-child(3),
  .major-row span:nth-child(4),
  .major-row span:nth-child(5),
  .major-row.header span:nth-child(3),
  .major-row.header span:nth-child(4),
  .major-row.header span:nth-child(5) {
    grid-column: 2;
  }
  .favorite-item {
    grid-template-columns: 32px 1fr;
  }
  .favorite-item .danger-button {
    grid-column: 2;
    justify-self: start;
  }
}

@media (max-width: 520px) {
  .two-columns { grid-template-columns: 1fr; }
  .top-actions { grid-template-columns: 1fr; }
  .card-actions { grid-template-columns: 1fr; }
  .history-grid { grid-template-columns: 1fr; }
  .strategy { flex: 1; }
  .pagination { padding: 18px 0; }
}
