:root {
  --bg: #f7f8fc;
  --card: #ffffff;
  --ink: #162033;
  --muted: #687386;
  --line: #e6eaf2;
  --primary: #7c3aed;
  --primary-dark: #5b21b6;
  --soft: #f1e8ff;
  --good: #12a150;
  --warn: #d97706;
  --danger: #dc2626;
  --shadow: 0 16px 38px rgba(19, 25, 44, 0.10);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(124, 58, 237, 0.18), transparent 34rem),
    radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.14), transparent 30rem),
    var(--bg);
}

.site-header {
  padding: 42px 20px 24px;
}

.hero {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 24px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.08;
}

.lead {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.hero-card {
  border: 1px solid rgba(124, 58, 237, 0.18);
  border-radius: 24px;
  padding: 22px;
  background: rgba(255,255,255,0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  display: grid;
  gap: 8px;
  justify-items: center;
  text-align: center;
}

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

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px 50px;
}

.panel, .question-card, .result-box, .progress-wrap, .save-status {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(20, 26, 40, 0.05);
}

.panel {
  padding: 22px;
  margin-bottom: 18px;
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 22px;
}

.panel p {
  margin: 8px 0;
  color: var(--muted);
  line-height: 1.8;
}

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

label {
  color: #394457;
  font-weight: 700;
  font-size: 14px;
}

input {
  width: 100%;
  margin-top: 7px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
}

input:focus {
  border-color: rgba(124, 58, 237, .62);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, .12);
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.6;
}

.consent input {
  width: 18px;
  height: 18px;
  margin: 4px 0 0;
}

.progress-wrap {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 14px 16px;
  margin-bottom: 18px;
}

.progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 10px;
}

.progress-bar {
  height: 10px;
  background: #eef1f7;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #7c3aed, #0ea5e9);
  transition: width .25s ease;
}

.quiz {
  display: grid;
  gap: 16px;
}

.question-card {
  padding: 20px;
}

.question-title {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 14px;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.55;
}

.question-no {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--primary-dark);
  font-size: 14px;
}

.options {
  display: grid;
  gap: 10px;
}

.option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
  transition: .15s ease;
  font-weight: 600;
  color: #334155;
}

.option:hover {
  border-color: rgba(124,58,237,.35);
  transform: translateY(-1px);
}

.option input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  box-shadow: none;
}

.option:has(input:checked) {
  border-color: rgba(124,58,237,.75);
  background: #fbf7ff;
}

.actions {
  display: flex;
  gap: 12px;
  margin: 24px 0;
  flex-wrap: wrap;
}

button {
  border: 0;
  cursor: pointer;
  border-radius: 14px;
  font-weight: 800;
  font-size: 15px;
}

.primary-btn {
  padding: 14px 22px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #0ea5e9);
  box-shadow: 0 10px 24px rgba(124,58,237,.24);
}

.secondary-btn {
  padding: 14px 20px;
  background: #eef2ff;
  color: #3730a3;
}

.ghost-btn {
  background: transparent;
  color: var(--primary-dark);
  padding: 7px 10px;
}

button:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.save-status {
  padding: 16px 18px;
  margin: 18px 0;
  font-weight: 800;
}

.save-status.success { border-color: rgba(18, 161, 80, .24); color: var(--good); background: #f0fdf4; }
.save-status.error { border-color: rgba(220, 38, 38, .24); color: var(--danger); background: #fef2f2; }
.save-status.info { border-color: rgba(14, 165, 233, .24); color: #0369a1; background: #eff6ff; }

.result-box {
  padding: 26px;
  margin-top: 20px;
}

.result-hero {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  padding: 20px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(124,58,237,.12), rgba(14,165,233,.12));
  border: 1px solid rgba(124,58,237,.15);
}

.orca-badge svg {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 18px 24px rgba(16, 24, 40, .16));
}

.small-orca {
  width: 116px;
}

.result-hero h2 {
  margin: 0 0 8px;
  font-size: 30px;
}

.result-hero p {
  color: var(--muted);
  line-height: 1.8;
  margin: 10px 0;
}

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

.top-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.top-card strong {
  display: block;
  font-size: 18px;
  margin-bottom: 8px;
}

.score-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.score-row {
  display: grid;
  grid-template-columns: 110px minmax(0,1fr) 50px;
  gap: 12px;
  align-items: center;
}

.score-label {
  font-weight: 800;
}

.score-track {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: #eef1f7;
}

.score-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #7c3aed, #0ea5e9);
}

.major-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.major-list span {
  border-radius: 999px;
  padding: 6px 10px;
  background: #f3e8ff;
  color: #5b21b6;
  font-size: 13px;
  font-weight: 700;
}

.footer {
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

.footer a { color: var(--primary-dark); font-weight: 800; }

@media (max-width: 860px) {
  .hero, .result-hero {
    grid-template-columns: 1fr;
  }

  .hero-card {
    max-width: 320px;
  }

  .student-grid, .top-cards {
    grid-template-columns: 1fr;
  }

  .result-hero {
    text-align: center;
  }

  .result-hero .orca-badge {
    width: 190px;
    margin: 0 auto;
  }
}

@media print {
  .site-header, .panel, .progress-wrap, .quiz, .actions, .footer, .save-status { display: none !important; }
  body { background: #fff; }
  .container { max-width: none; padding: 0; }
  .result-box { box-shadow: none; border: 0; }
}
