:root {
  color-scheme: light;
  --ink: #172026;
  --muted: #66737f;
  --line: #d9e2e8;
  --paper: #f7f5ef;
  --panel: #ffffff;
  --green: #1f8a70;
  --blue: #2f6f9f;
  --red: #c65045;
  --gold: #a67522;
  --shadow: 0 18px 48px rgba(32, 48, 64, 0.13);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: stretch;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 34px;
  color: #fff;
  background: linear-gradient(135deg, #9f1d2a 0%, #c93435 48%, #e46a46 100%);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.kicker {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
}

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

h1 {
  margin-bottom: 14px;
  font-size: clamp(36px, 6vw, 68px);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
  line-height: 1.2;
}

.source-line {
  max-width: 560px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.7;
}

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

.hero-panel div,
.card,
.data-band {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(32, 48, 64, 0.08);
}

.hero-panel div {
  display: flex;
  min-height: 92px;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 18px;
}

.hero-panel span {
  color: var(--muted);
  font-size: 14px;
}

.hero-panel strong {
  font-size: 42px;
  line-height: 1;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 0.82fr) minmax(0, 1.18fr);
  gap: 20px;
  margin-top: 20px;
}

.risk-banner {
  display: grid;
  grid-template-columns: minmax(220px, 0.42fr) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-top: 18px;
  border: 1px solid rgba(159, 29, 42, 0.35);
  border-radius: 8px;
  padding: 16px 18px;
  background: #fff3f2;
}

.risk-banner span {
  display: block;
  margin-bottom: 6px;
  color: #8e3a3f;
  font-size: 13px;
  font-weight: 800;
}

.risk-banner strong {
  color: #9f1d2a;
  font-size: 20px;
}

.risk-banner p {
  margin: 0;
  color: #57343a;
  line-height: 1.7;
}

.card,
.data-band {
  padding: 22px;
}

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

label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: #30414c;
  font-size: 14px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #c9d5dd;
  border-radius: 6px;
  padding: 0 12px;
  color: var(--ink);
  background: #fbfcfd;
  font: inherit;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(47, 111, 159, 0.25);
  outline-offset: 2px;
}

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

button {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.primary-button {
  width: 100%;
  color: #fff;
  background: var(--green);
}

.ghost-button {
  padding: 0 14px;
  color: var(--blue);
  background: #eaf2f7;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  padding: 0 12px;
  color: #fff;
  background: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

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

.pill.warn {
  background: var(--gold);
}

.pill.risk {
  background: var(--red);
}

.summary {
  min-height: 86px;
  color: #30414c;
  font-size: 18px;
  line-height: 1.7;
}

.meter {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5edf1;
}

.meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 260ms ease;
}

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

.advice-item {
  min-height: 120px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfd;
}

.advice-item strong {
  display: block;
  margin-bottom: 8px;
  color: var(--blue);
}

.advice-item p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.data-band,
.official-links {
  margin-top: 20px;
}

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

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 15px;
}

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

th {
  color: #324855;
  background: #eef4f2;
}

.text-link,
.official-links a {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

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

.method-grid article,
.audit-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfd;
}

.method-grid strong {
  color: #9f1d2a;
}

.method-grid p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

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

.audit-grid article {
  min-height: 150px;
}

.audit-grid strong {
  display: block;
  margin-bottom: 10px;
  color: var(--ink);
  line-height: 1.35;
}

.audit-grid p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.audit-status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.audit-status.good {
  background: var(--green);
}

.audit-status.warn {
  background: var(--gold);
}

.audit-status.risk {
  background: var(--red);
}


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

.plain-copy {
  margin-bottom: 16px;
  color: #30414c;
  line-height: 1.8;
}

.factor-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.factor-list span,
.source-stack a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 12px;
  background: #fbfcfd;
  color: #30414c;
  font-size: 14px;
  font-weight: 800;
}

.source-stack {
  display: grid;
  align-content: start;
  gap: 10px;
}

.source-stack a {
  border-radius: 6px;
  color: var(--blue);
  text-decoration: none;
}

.match-summary {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  color: #30414c;
  line-height: 1.7;
}

.match-table-wrap {
  margin-top: 10px;
}

.recommend-panel {
  margin-top: 14px;
}

.recommend-empty {
  border: 1px dashed #c9d5dd;
  border-radius: 8px;
  padding: 14px;
  color: var(--muted);
  background: #fbfcfd;
}

.recommend-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fffaf6;
}

.recommend-head strong {
  color: #9f1d2a;
  font-size: 20px;
}

.recommend-head p,
.method-note {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.bucket-grid {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 8px;
}

.bucket-grid span {
  border-radius: 999px;
  padding: 8px 10px;
  color: #fff;
  background: var(--green);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.bucket-grid span:first-child {
  background: var(--gold);
}

.bucket-grid span:last-child {
  background: var(--blue);
}

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

.recommend-item {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

.recommend-item strong {
  color: var(--ink);
  line-height: 1.35;
}

.recommend-item span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.recommend-item em {
  color: #9f1d2a;
  font-style: normal;
  font-weight: 900;
}

.match-table {
  min-width: 0;
  table-layout: fixed;
}

.compact-table {
  min-width: 0;
  table-layout: fixed;
}

.match-table th,
.match-table td,
.compact-table th,
.compact-table td {
  padding: 11px 9px;
}

.match-table th:nth-child(1),
.match-table td:nth-child(1) {
  width: 70px;
}

.match-table th:nth-child(2),
.match-table td:nth-child(2) {
  width: 100px;
}

.match-table th:nth-child(3),
.match-table td:nth-child(3) {
  width: 110px;
}

.match-table th:nth-child(4),
.match-table td:nth-child(4) {
  width: auto;
}

.match-table th:nth-child(5),
.match-table td:nth-child(5) {
  width: 140px;
  color: #9f1d2a;
  font-weight: 900;
}

.match-table th:nth-child(6),
.match-table td:nth-child(6) {
  width: 104px;
  text-align: center;
}

.level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  min-height: 28px;
  border-radius: 999px;
  border: 1px solid currentColor;
  padding: 0 10px;
  background: #fff;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}

.level-badge.rush {
  color: #9a6a00;
  background: #fff8e6;
}

.level-badge.stable {
  color: #237a56;
  background: #eefaf4;
}

.level-badge.safe {
  color: #2f6684;
  background: #eef7fb;
}

.level-badge.neutral {
  color: var(--muted);
  background: #f5f7f8;
  font-size: 12px;
}

.match-table td:nth-child(1),
.match-table td:nth-child(2),
.match-table td:nth-child(3),
.match-table td:nth-child(6),
.compact-table td:nth-child(1),
.compact-table td:nth-child(2),
.compact-table td:nth-child(5),
.compact-table td:nth-child(6) {
  white-space: nowrap;
}

.match-table td:nth-child(4),
.compact-table td:nth-child(3),
.compact-table td:nth-child(4) {
  word-break: break-word;
}

.mobile-match-list {
  display: none;
}

.mobile-empty {
  border: 1px dashed #c9d5dd;
  border-radius: 8px;
  padding: 14px;
  color: var(--muted);
  background: #fbfcfd;
}

.mobile-match-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.mobile-match-card + .mobile-match-card {
  margin-top: 10px;
}

.mobile-match-top,
.mobile-match-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.mobile-match-top span,
.mobile-match-meta span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.mobile-match-top strong {
  color: #9f1d2a;
  font-size: 20px;
}

.mobile-match-card h3 {
  margin: 10px 0 6px;
  font-size: 18px;
  line-height: 1.35;
}

.mobile-match-card p {
  margin-bottom: 10px;
  color: #30414c;
  line-height: 1.55;
}

.school-code {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.official-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.official-links a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: #fff;
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 20px, 720px);
    padding-top: 10px;
  }

  .hero,
  .workspace,
  .method-grid,
  .ranking-layout,
  .risk-banner {
    grid-template-columns: 1fr;
  }

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

  .hero-copy {
    min-height: 220px;
    padding: 24px;
  }

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

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

  .recommend-head,
  .recommend-list,
  .audit-grid {
    grid-template-columns: 1fr;
  }

  .bucket-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .match-table {
    font-size: 14px;
  }

  .match-table th,
  .match-table td,
  .compact-table th,
  .compact-table td {
    padding: 10px 7px;
  }

  .match-table th:nth-child(1),
  .match-table td:nth-child(1) {
    width: 58px;
  }

  .match-table th:nth-child(2),
  .match-table td:nth-child(2) {
    width: 82px;
  }

  .match-table th:nth-child(3),
  .match-table td:nth-child(3) {
    width: 92px;
  }

  .match-table th:nth-child(5),
  .match-table td:nth-child(5) {
    width: 118px;
  }
}

@media (max-width: 520px) {
  .two-grid {
    grid-template-columns: 1fr;
  }

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

  .card,
  .data-band {
    padding: 18px;
  }

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

  .match-table {
    display: none;
  }

  .mobile-match-list {
    display: block;
    margin-top: 10px;
  }

  .compact-table {
    min-width: 560px;
  }
}
