:root {
  color-scheme: light;
  --ink: #17201d;
  --muted: #5d6762;
  --soft: #eef2ed;
  --line: #d7ddd5;
  --paper: #f6f3eb;
  --panel: #ffffff;
  --green: #0f6b4f;
  --green-dark: #0a4c3c;
  --blue: #225e8a;
  --amber: #b46a19;
  --red: #a94035;
  --shadow: 0 18px 48px rgba(23, 32, 29, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

body.drawer-open {
  overflow: hidden;
}

body.locked {
  overflow: hidden;
}

body.locked .app-shell {
  display: none;
}

body.auth-unlocked .auth-screen {
  display: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.hero-band {
  position: relative;
  overflow: hidden;
  display: flex;
  min-height: 250px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid rgba(215, 221, 213, 0.8);
  border-radius: 8px;
  padding: 32px;
  background:
    linear-gradient(90deg, rgba(11, 38, 31, 0.82), rgba(11, 38, 31, 0.34)),
    url("./assets/chongqing-data-hero.png") center / cover;
  box-shadow: var(--shadow);
}

.hero-copy {
  max-width: 760px;
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.24);
}

.eyebrow {
  margin: 0 0 8px;
  color: #f5c878;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0;
}

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

h1 {
  margin-bottom: 10px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 21px;
  line-height: 1.18;
}

.hero-text {
  max-width: 700px;
  margin-bottom: 0;
  font-size: 18px;
  line-height: 1.72;
}

.auth-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 18px;
  background:
    linear-gradient(90deg, rgba(11, 38, 31, 0.86), rgba(11, 38, 31, 0.45)),
    url("./assets/chongqing-data-hero.png") center / cover;
}

.auth-card {
  width: min(560px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  padding: 28px;
  color: #fff;
  background: rgba(10, 35, 29, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.auth-card h1 {
  margin-bottom: 12px;
  font-size: clamp(32px, 6vw, 52px);
}

.auth-copy {
  margin-bottom: 20px;
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.7;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label {
  color: #fff;
}

.auth-message {
  min-height: 20px;
  margin: 0;
  color: #ffd59a;
  font-size: 13px;
  font-weight: 800;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.control-panel {
  position: sticky;
  top: 16px;
  padding: 20px;
}

.panel-title {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.panel-title.compact {
  margin-bottom: 14px;
}

.panel-title p,
.toolbar p,
.source-panel p,
.live-panel p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.step-mark {
  display: grid;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  font-size: 14px;
  font-weight: 900;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
  color: #26312d;
  font-size: 13px;
  font-weight: 800;
}

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

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 11px;
  color: var(--ink);
  background: #fbfcfa;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(15, 107, 79, 0.12);
}

.quick-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.quick-row button,
.ghost-action,
.primary-action {
  min-height: 42px;
  border-radius: 6px;
  font-weight: 850;
}

.quick-row button {
  border: 1px solid var(--line);
  color: var(--green-dark);
  background: #f7faf6;
}

.primary-action {
  border: 0;
  color: #fff;
  background: var(--green);
}

.primary-action:hover {
  background: var(--green-dark);
}

.ghost-action {
  border: 1px solid var(--line);
  padding: 0 14px;
  color: var(--ink);
  background: #fff;
}

.source-note {
  margin-top: 16px;
  border-left: 4px solid var(--amber);
  border-radius: 6px;
  padding: 12px;
  background: #fff7ea;
}

.source-note strong {
  display: block;
  margin-bottom: 5px;
}

.source-note p {
  margin: 0;
  color: #5d4935;
  font-size: 13px;
  line-height: 1.58;
}

.result-zone {
  display: grid;
  gap: 16px;
}

.summary-panel,
.results-panel,
.detail-panel,
.live-panel,
.source-panel {
  padding: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.stats-grid > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfa;
}

.stats-grid span,
.score-line span,
.offer-card span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stats-grid strong {
  display: block;
  font-size: 28px;
  line-height: 1;
}

.stats-grid small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

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

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

.school-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}

.school-card:hover,
.school-card.active {
  border-color: rgba(15, 107, 79, 0.55);
  box-shadow: 0 0 0 3px rgba(15, 107, 79, 0.09);
}

.school-main h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag,
.risk {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 850;
}

.tag {
  color: #30403a;
  background: var(--soft);
}

.risk {
  color: #fff;
}

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

.risk.稳妥 {
  background: var(--blue);
}

.risk.保底 {
  background: var(--green);
}

.risk.风险较高 {
  background: #68635d;
}

.score-line {
  display: grid;
  min-width: 132px;
  justify-items: end;
}

.score-line strong {
  font-size: 26px;
  line-height: 1;
}

.score-line small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.detail-grid {
  pointer-events: none;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  background: rgba(18, 28, 24, 0.36);
}

.drawer-backdrop.open {
  display: block;
}

.detail-panel {
  position: fixed;
  top: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 50;
  width: min(900px, calc(100vw - 24px));
  overflow-y: auto;
  transform: translateX(calc(100% + 24px));
  transition: transform 180ms ease;
  pointer-events: auto;
}

.detail-panel.open {
  transform: translateX(0);
}

.drawer-close {
  position: sticky;
  top: 0;
  z-index: 2;
  float: right;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  font-weight: 850;
}

.school-detail {
  display: grid;
  gap: 14px;
}

.profile-block {
  display: grid;
  gap: 14px;
  margin-bottom: 4px;
}

.profile-summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfa;
}

.profile-summary h3,
.profile-block h3 {
  margin-bottom: 8px;
}

.profile-summary p,
.profile-source,
.life-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.profile-grid,
.life-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.profile-grid > div,
.life-grid > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.profile-grid span,
.life-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.profile-grid strong {
  display: block;
  line-height: 1.45;
}

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

.campus-list li {
  display: grid;
  gap: 4px;
  border-left: 4px solid var(--blue);
  border-radius: 6px;
  padding: 10px 12px;
  background: #f3f7fa;
}

.campus-list span {
  color: var(--muted);
  line-height: 1.5;
}

.profile-source {
  font-size: 12px;
}

.profile-source a {
  color: var(--green-dark);
  font-weight: 850;
}

.empty-state {
  display: grid;
  min-height: 170px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.detail-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.detail-facts div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfcfa;
}

.detail-facts span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.detail-list li {
  border-left: 4px solid var(--green);
  border-radius: 6px;
  padding: 9px 11px;
  background: #f3f8f5;
  color: #28332f;
  line-height: 1.55;
}

.major-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.major-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: #fff;
}

.major-table th,
.major-table td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

.major-table th {
  color: #34443e;
  background: #f2f6f1;
  font-weight: 900;
}

.major-table td strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.major-table td small {
  display: block;
  color: var(--muted);
  line-height: 1.45;
}

.live-panel {
  display: grid;
  align-content: start;
  gap: 14px;
}

.offer-card {
  border-radius: 8px;
  padding: 16px;
  color: #fff;
  background: var(--green-dark);
}

.offer-card span,
.offer-card p {
  color: rgba(255, 255, 255, 0.82);
}

.offer-card strong {
  display: block;
  font-size: 28px;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.source-grid a {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--green-dark);
  background: #fbfcfa;
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}

@media (max-width: 1050px) {
  .hero-band,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .workspace,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .control-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 10px;
  }

  .hero-band {
    padding: 20px;
  }

  .form-grid,
  .stats-grid,
  .detail-facts,
  .profile-grid,
  .life-grid,
  .source-grid {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    inset: 0;
    width: 100vw;
    border-radius: 0;
  }

  .quick-row {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .score-line {
    justify-items: start;
  }
}
