:root {
  --bg: #fff6f2;
  --panel: rgba(255, 255, 255, 0.96);
  --line: #ffd5d9;
  --text: #2e1916;
  --muted: #8a6d66;
  --brand: #ff3b54;
  --brand-dark: #e50f33;
  --brand-soft: #fff0f1;
  --accent: #ffbd59;
  --good: #168a4d;
  --bad: #cf3d3d;
  --shadow: 0 22px 55px rgba(154, 78, 60, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 59, 84, 0.13), transparent 26%),
    radial-gradient(circle at top right, rgba(255, 189, 89, 0.18), transparent 24%),
    linear-gradient(180deg, #fffefc 0%, var(--bg) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 59, 84, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 59, 84, 0.06) 1px, transparent 1px);
  background-size: 72px 72px;
  opacity: 0.14;
}

.page-shell {
  position: relative;
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 22px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(255, 59, 84, 0.12), rgba(255, 255, 255, 0.96));
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
}

.mixue-logo {
  display: flex;
  align-items: center;
  gap: 18px;
}

.logo-illustration {
  display: block;
  width: min(960px, 100%);
  height: auto;
  max-width: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.logo-wording {
  display: grid;
  gap: 8px;
}

.logo-title {
  color: var(--brand);
  font-size: clamp(46px, 6vw, 82px);
  line-height: 0.9;
  font-weight: 900;
  letter-spacing: 4px;
}

.logo-subtitle {
  color: var(--brand);
  font-size: clamp(14px, 1.9vw, 23px);
  font-weight: 800;
  letter-spacing: 1.4px;
}

.admin-entry {
  flex: 0 0 auto;
  white-space: nowrap;
}

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

.panel {
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--panel);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}

.exam-panel {
  padding: 30px;
}

.exam-title {
  margin: 0 0 10px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.05;
  color: var(--text);
}

.start-block {
  display: flex;
  gap: 14px;
  align-items: end;
  margin: 10px 0 18px;
}

.field {
  display: grid;
  gap: 8px;
  flex: 1;
}

.field-large {
  min-width: 0;
}

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

input,
textarea,
button,
select {
  font: inherit;
}

input[type="text"],
input[type="password"],
input[type="search"],
select {
  width: 100%;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  outline: none;
  background: #fff;
  color: var(--text);
}

input:focus,
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(255, 59, 84, 0.12);
}

.primary-btn,
.secondary-btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 16px;
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
}

.primary-btn {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
}

.secondary-btn {
  background: #ffe8ec;
  color: var(--brand-dark);
}

.ghost-btn {
  background: #fff;
  color: var(--muted);
  border: 1px solid var(--line);
}

.start-btn {
  min-width: 124px;
}

.quiz-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.exam-progress {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1px solid #f1ddd2;
  border-radius: 20px;
  background: linear-gradient(180deg, #fff, #fff9f7);
}

.progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.progress-title {
  font-size: 17px;
  color: var(--text);
}

.progress-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.progress-percentage {
  font-size: 24px;
  font-weight: 900;
  color: var(--brand-dark);
}

.progress-bar {
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #f1ddd2;
  background: #f8e7df;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--brand-dark));
  transition: width 0.25s ease;
}

.progress-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.progress-pill {
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.progress-pill-answered {
  background: #ffe6ea;
  color: var(--brand-dark);
}

.progress-pill-unanswered {
  background: #fff3de;
  color: #8c5303;
}

.pill {
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff4e5;
  color: #8c5303;
  font-size: 13px;
  font-weight: 800;
}

#timerPill {
  background: #ffe1e4;
  color: var(--brand-dark);
}

.exam-root {
  display: grid;
  gap: 14px;
}

.question-card {
  padding: 18px;
  border: 1px solid #f1ddd2;
  border-radius: 20px;
  background: linear-gradient(180deg, #fff, #fff9f7);
}

.question-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.question-title {
  margin: 0;
  font-size: 17px;
  line-height: 1.6;
}

.type-tag {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
  height: fit-content;
}

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

.option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid #f0e2db;
  border-radius: 14px;
  background: #fff;
}

.option input {
  margin: 0;
}

.short-answer textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  padding: 12px 14px;
  border: 1px solid #f0e2db;
  border-radius: 14px;
}

.submit-wrap {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
}

.result-root {
  margin-top: 20px;
  padding: 18px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid #f0e2db;
}

.result-summary {
  display: grid;
  gap: 14px;
}

.submit-warning {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid #ffd58f;
  background: #fff8e8;
  color: #8c5b06;
  font-size: 13px;
  line-height: 1.6;
}

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

.review-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #f1ddd2;
}

.review-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 12px;
}

.review-head h3 {
  margin: 0;
  font-size: 20px;
}

.review-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.review-list {
  display: grid;
  gap: 12px;
}

.review-card {
  border-radius: 18px;
  border: 1px solid #f1ddd2;
  background: linear-gradient(180deg, #fff, #fffaf8);
  padding: 16px;
}

.review-card.wrong {
  border-color: rgba(207, 61, 61, 0.28);
  background: linear-gradient(180deg, #fff, #fff4f4);
}

.review-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.review-index {
  font-weight: 800;
  color: var(--text);
}

.review-question {
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 12px;
}

.review-answer-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px dashed #edd8cf;
  color: var(--muted);
}

.review-answer-line strong {
  color: var(--text);
  text-align: right;
}

.result-score {
  font-size: 44px;
  font-weight: 900;
  line-height: 1;
}

.pass {
  color: var(--good);
}

.fail {
  color: var(--bad);
}

.hidden {
  display: none !important;
}

.empty-state {
  padding: 16px;
  border-radius: 16px;
  color: var(--muted);
  background: #fffaf8;
  border: 1px dashed #edd3c7;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(55, 22, 20, 0.45);
  backdrop-filter: blur(4px);
  z-index: 30;
}

.modal-card {
  width: min(520px, 100%);
  border-radius: 24px;
  border: 1px solid #f1ddd2;
  background: #fff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.18);
  padding: 22px;
}

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

.modal-head h3 {
  margin: 0 0 8px;
  font-size: 24px;
}

.modal-head p {
  margin: 0;
  color: var(--muted);
}

.modal-close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #fff4f6;
  color: var(--brand-dark);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.modal-form {
  display: grid;
  gap: 14px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.modal-note {
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.modal-note code {
  padding: 2px 6px;
  border-radius: 8px;
  background: #fff6ea;
  color: #8c5b06;
}

.admin-panel {
  padding-top: 0;
}

.admin-shell .hero {
  align-items: center;
}

.admin-auth-panel {
  padding: 24px;
}

.admin-login-card {
  display: grid;
  gap: 16px;
}

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

.admin-note-card {
  display: grid;
  gap: 6px;
}

.admin-note-card strong {
  font-size: 16px;
}

.admin-note-card span {
  color: var(--muted);
  font-size: 13px;
}

.admin-empty-state {
  background: linear-gradient(180deg, #fffaf8, #fff3f4);
}

.admin-panel-card {
  padding: 24px;
}

.admin-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.admin-user-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid #f1ddd2;
  background: linear-gradient(180deg, #fff, #fffaf8);
}

.admin-label {
  font-size: 12px;
  color: var(--muted);
}

.admin-filters {
  flex-wrap: wrap;
}

.admin-filters input {
  flex: 1 1 260px;
}

.status-select {
  min-width: 132px;
}

.records-summary {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

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

.records-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  border: 1px solid #f1ddd2;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
}

.records-table thead th {
  padding: 14px 16px;
  text-align: left;
  font-size: 13px;
  color: var(--muted);
  background: #fff7f4;
  border-bottom: 1px solid #f1ddd2;
}

.records-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f5e5dc;
  vertical-align: middle;
}

.records-table tbody tr:last-child td {
  border-bottom: 0;
}

.score-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 900;
}

.score-chip.pass {
  background: rgba(22, 138, 77, 0.12);
  color: var(--good);
}

.score-chip.fail {
  background: rgba(207, 61, 61, 0.12);
  color: var(--bad);
}

.summary-card,
.record-card {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid #f1ddd2;
  background: linear-gradient(180deg, #fff, #fffaf8);
}

.summary-card strong,
.record-card strong {
  display: block;
  font-size: 18px;
}

.record-card {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.record-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.record-meta {
  color: var(--muted);
  font-size: 13px;
}

.status-pass {
  color: var(--good);
  font-weight: 800;
}

.status-fail {
  color: var(--bad);
  font-weight: 800;
}

@media (max-width: 960px) {
  .hero,
  .start-block,
  .admin-panel-head,
  .record-head,
  .review-head,
  .modal-head {
    flex-direction: column;
  }

  .hero {
    align-items: flex-start;
  }

  .admin-entry {
    align-self: flex-end;
  }

  .progress-head {
    flex-direction: column;
  }
}

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

  .exam-panel,
  .admin-panel-card {
    padding: 18px;
  }

  .logo-illustration {
    width: 100%;
    height: auto;
  }

  .logo-title {
    font-size: 42px;
  }

  .logo-subtitle {
    font-size: 13px;
  }

  .question-top {
    flex-direction: column;
  }

  .result-stats {
    grid-template-columns: 1fr;
  }

  .exam-progress {
    padding: 14px;
  }

  .records-table {
    min-width: 680px;
  }

  .admin-login-grid {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    flex-direction: column;
  }
}
