:root {
  --ink: #17324d;
  --muted: #60758a;
  --blue: #3c7cff;
  --purple: #7656e8;
  --green: #29b67a;
  --yellow: #ffc94a;
  --red: #ef5d67;
  --paper: #ffffff;
  --bg: #eef7ff;
  --shadow: 0 18px 45px rgba(38, 88, 132, .16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 211, 91, .35), transparent 26rem),
    radial-gradient(circle at 88% 18%, rgba(118, 86, 232, .18), transparent 28rem),
    linear-gradient(160deg, #f7fcff, var(--bg));
  min-height: 100vh;
}
body::before, body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(1px);
  opacity: .35;
  pointer-events: none;
  animation: float 8s ease-in-out infinite;
}
body::before { width: 110px; height: 110px; background: #65d5c2; left: 5vw; bottom: 8vh; }
body::after { width: 70px; height: 70px; background: #ff8fa1; right: 8vw; bottom: 14vh; animation-delay: -3s; }
button, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.app-shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 80px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 900; letter-spacing: .02em; }
.brand-logo { width: 150px; height: 55px; object-fit: contain; object-position: left center; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; background: rgba(255,255,255,.75); box-shadow: 0 6px 18px rgba(48,91,135,.12); font-weight: 800; }
.card { background: rgba(255,255,255,.92); border: 1px solid rgba(255,255,255,.9); border-radius: 26px; box-shadow: var(--shadow); }
.login-wrap { min-height: calc(100vh - 140px); display: grid; place-items: center; }
.login-card { width: min(620px, 100%); padding: clamp(28px, 6vw, 60px); text-align: center; position: relative; overflow: hidden; }
.login-card::after { content: "🚗"; position: absolute; font-size: 82px; right: -8px; bottom: -22px; transform: rotate(-8deg); opacity: .14; }
.eyebrow { color: var(--purple); font-weight: 900; letter-spacing: .12em; font-size: .8rem; }
h1 { font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1.08; margin: 12px 0; }
h2, h3, p { margin-top: 0; }
.subtitle { color: var(--muted); line-height: 1.8; }
.login-form { display: flex; gap: 12px; margin: 30px auto 14px; max-width: 440px; }
.input { width: 100%; border: 2px solid #dbe9f5; background: #f8fcff; border-radius: 15px; padding: 13px 16px; outline: none; transition: .2s; }
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(60,124,255,.12); }
.btn { border: 0; border-radius: 15px; padding: 13px 20px; font-weight: 900; color: white; background: linear-gradient(135deg, var(--blue), var(--purple)); box-shadow: 0 9px 20px rgba(60,124,255,.25); transition: transform .2s, box-shadow .2s; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 13px 25px rgba(60,124,255,.32); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.secondary { color: var(--ink); background: #edf4fb; box-shadow: none; }
.btn.danger { background: linear-gradient(135deg, #ff766f, #e94767); }
.message { min-height: 24px; color: var(--red); font-weight: 700; }
.quiz-header { padding: 22px 26px; margin-bottom: 24px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.quiz-header h1 { font-size: clamp(1.5rem, 3vw, 2.2rem); margin: 4px 0; }
.group-badge { color: white; background: linear-gradient(135deg, #ffb83e, #ff7e54); border-radius: 18px; padding: 12px 18px; font-weight: 900; white-space: nowrap; }
.timer-card, .navigator { position: fixed; z-index: 10; backdrop-filter: blur(16px); }
.timer-card { top: 18px; left: 18px; padding: 12px 18px; border-radius: 18px; background: rgba(255,255,255,.9); box-shadow: var(--shadow); }
.timer-card small { display: block; color: var(--muted); font-weight: 700; }
.timer-value { font-size: 1.35rem; font-variant-numeric: tabular-nums; font-weight: 1000; }
.navigator { top: 18px; right: 18px; width: 245px; max-height: calc(100vh - 36px); padding: 16px; overflow: auto; background: rgba(255,255,255,.92); border-radius: 22px; box-shadow: var(--shadow); transition: width .22s ease, padding .22s ease; }
.navigator-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; font-weight: 900; }
.navigator-actions { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.navigator-toggle { border: 0; border-radius: 9px; padding: 5px 9px; color: #3970a5; background: #eaf3ff; font-weight: 900; }
.navigator-toggle:hover { background: #dbeaff; }
.nav-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.nav-number { aspect-ratio: 1; border: 0; border-radius: 10px; color: var(--muted); background: #e9f0f7; font-weight: 900; transition: .2s; }
.nav-number.answered { color: white; background: linear-gradient(135deg, var(--green), #21a8a0); }
.nav-number:hover { transform: scale(1.08); }
.navigator.collapsed { width: 190px; overflow: hidden; }
.navigator.collapsed .navigator-head { margin-bottom: 0; }
.navigator.collapsed .nav-grid { display: none; }
.quiz-main { width: min(800px, 100%); margin: 0 auto; }
.question-card { padding: clamp(22px, 4vw, 34px); margin-bottom: 22px; scroll-margin-top: 22px; animation: rise .45s ease both; }
.question-meta { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 14px; }
.question-number { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: white; background: linear-gradient(135deg, var(--blue), var(--purple)); font-weight: 1000; }
.tag { padding: 6px 10px; border-radius: 999px; background: #edf5ff; color: #3970a5; font-size: .8rem; font-weight: 800; }
.question-title { font-size: 1.08rem; line-height: 1.75; font-weight: 900; }
.options { display: grid; gap: 11px; margin-top: 18px; }
.option { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 2px solid #e5eef6; border-radius: 15px; background: #fbfdff; transition: .18s; cursor: pointer; }
.option:hover { border-color: #a9c8ff; transform: translateX(3px); }
.option:has(input:checked) { border-color: var(--blue); background: #eef5ff; box-shadow: 0 7px 16px rgba(60,124,255,.1); }
.option input { accent-color: var(--blue); margin-top: 4px; }
.submit-zone { text-align: center; padding: 28px; margin-top: 30px; }
.submit-zone .btn { font-size: 1.08rem; padding-inline: 36px; }
.result-hero { padding: 38px; text-align: center; margin-bottom: 24px; background: linear-gradient(135deg, #fff, #f4f0ff); }
.score { font-size: clamp(3rem, 8vw, 5.8rem); font-weight: 1000; color: var(--purple); line-height: 1; }
.result-item { padding: 24px; margin-bottom: 16px; border-left: 7px solid var(--green); }
.result-item.wrong { border-left-color: var(--red); }
.answer-line { padding: 9px 12px; margin-top: 8px; border-radius: 10px; background: #f0f6fb; }
.answer-line.correct { background: #e8f8f0; }
.answer-line.wrong { background: #fff0f1; }
.result-options { display: grid; gap: 10px; margin-top: 18px; }
.result-option { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 12px 15px; border: 2px solid #e3ebf2; border-radius: 15px; background: #f8fbfd; }
.result-option-mark { flex: 0 0 30px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; color: #6b7e90; background: #e8eef4; font-weight: 1000; }
.result-option-text { min-width: 0; line-height: 1.6; }
.result-option-status { margin-left: auto; padding: 5px 9px; border-radius: 999px; white-space: nowrap; font-size: .8rem; font-weight: 900; }
.result-option.correct-selected, .result-option.standard-correct { border-color: #65cfa3; background: #e9f9f1; }
.result-option.correct-selected .result-option-mark, .result-option.standard-correct .result-option-mark { color: white; background: var(--green); }
.result-option.correct-selected .result-option-status, .result-option.standard-correct .result-option-status { color: #14754e; background: #c9f0df; }
.result-option.wrong-selected, .result-option.missed-correct { border-color: #f18c93; background: #fff0f1; }
.result-option.wrong-selected .result-option-mark, .result-option.missed-correct .result-option-mark { color: white; background: var(--red); }
.result-option.wrong-selected .result-option-status, .result-option.missed-correct .result-option-status { color: #a52d38; background: #ffd7da; }
.result-explanation { margin: 18px 2px 0; }
.admin-layout { display: grid; grid-template-columns: 340px 1fr; gap: 24px; align-items: start; }
.admin-panel { padding: 24px; }
.field { display: grid; gap: 7px; margin-bottom: 16px; font-weight: 800; }
.switch-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; }
.group-list { display: grid; gap: 12px; }
.group-row { display: grid; grid-template-columns: 84px 1fr auto; gap: 12px; align-items: center; padding: 15px; border: 1px solid #e2edf6; border-radius: 16px; background: white; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; background: #a9b7c4; }
.status-dot.ready { background: var(--green); box-shadow: 0 0 0 5px rgba(41,182,122,.13); }
.status-dot.submitted { background: var(--purple); box-shadow: 0 0 0 5px rgba(118,86,232,.13); }
.dashboard-shell { width: min(1500px, calc(100% - 36px)); margin: 0 auto; padding: 22px 0 60px; }
.dashboard-title { text-align: center; margin-bottom: 26px; }
.dashboard-title h1 { margin-bottom: 4px; }
.dashboard-brand { display: flex; justify-content: center; margin-bottom: 8px; }
.dashboard-logo { width: min(360px, 70vw); height: 105px; object-fit: contain; }
.groups-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.group-tile { position: relative; overflow: hidden; min-height: 190px; padding: 24px; transition: transform .25s; }
.group-tile:hover { transform: translateY(-5px); }
.group-tile::after { content: attr(data-group); position: absolute; right: -5px; bottom: -24px; font-size: 100px; font-weight: 1000; opacity: .06; }
.group-name { font-size: 1.5rem; font-weight: 1000; }
.group-state { margin: 14px 0; font-size: 1.05rem; font-weight: 800; }
.metric { font-size: 2rem; font-weight: 1000; color: var(--purple); }
.modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 18px; background: rgba(14,32,50,.6); backdrop-filter: blur(6px); }
.modal-card { width: min(760px, 100%); max-height: 88vh; overflow: auto; padding: 28px; }
.standard-answers-modal { width: min(1040px, 100%); }
.standard-answers-modal > .topbar { position: sticky; top: -28px; z-index: 2; margin: -28px -28px 22px; padding: 24px 28px 18px; background: rgba(255,255,255,.96); border-bottom: 1px solid #e4edf5; backdrop-filter: blur(12px); }
.standard-answer-item { padding: 22px; border: 1px solid #e2edf6; border-left: 7px solid var(--green); border-radius: 19px; background: #fff; box-shadow: 0 8px 24px rgba(38,88,132,.08); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.no-select { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
@keyframes float { 50% { transform: translateY(-22px) rotate(8deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 1320px) {
  .timer-card { position: sticky; top: 8px; display: inline-block; margin-bottom: 10px; }
  .navigator { position: fixed; top: 12px; right: 12px; width: min(360px, calc(100vw - 24px)); max-height: min(62vh, 480px); margin: 0; }
  .navigator.collapsed { width: 190px; }
  .nav-grid { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 760px) {
  .app-shell { width: min(100% - 20px, 1120px); }
  .topbar { flex-wrap: wrap; }
  .brand { gap: 8px; font-size: .9rem; }
  .brand-logo { width: 108px; height: 44px; }
  .topbar > .pill { margin-left: auto; font-size: .82rem; padding: 8px 11px; }
  .login-form, .quiz-header { flex-direction: column; align-items: stretch; }
  .nav-grid { grid-template-columns: repeat(5, 1fr); }
  .navigator { top: 8px; right: 8px; width: min(330px, calc(100vw - 16px)); padding: 12px; }
  .navigator.collapsed { width: 176px; }
  .navigator-head { font-size: .9rem; }
  .admin-layout { grid-template-columns: 1fr; }
  .group-row { grid-template-columns: 72px 1fr; }
  .group-row .btn { grid-column: 1 / -1; }
  .admin-actions { grid-column: 1 / -1; justify-content: stretch; }
  .admin-actions .btn { flex: 1; }
  .result-option { align-items: flex-start; flex-wrap: wrap; }
  .result-option-status { margin-left: 42px; }
  .standard-answers-modal > .topbar { align-items: flex-start; }
}
