﻿:root {
  --paper: #fff6ea;
  --surface: #fffdf8;
  --surface-soft: #fff2f7;
  --mint: #d9f7ef;
  --mint-strong: #45aaa0;
  --mint-dark: #247d78;
  --pink: #ff8fb3;
  --pink-soft: #ffe4ee;
  --peach: #ffd9c7;
  --butter: #fff2b8;
  --sky: #e0f5ff;
  --ink: #2c2632;
  --muted: #766f78;
  --line: #efd8c8;
  --line-strong: #e8c6b5;
  --amber: #c57916;
  --red: #c74d44;
  --green: #3e9a72;
  --shadow-soft: 0 18px 42px rgba(120, 78, 48, 0.12);
  --shadow-pop: 0 16px 28px rgba(255, 143, 179, 0.16);
  --radius-xl: 34px;
  --radius-lg: 26px;
  --radius-md: 20px;
  --font-sans: "Microsoft YaHei", "Noto Sans SC", "PingFang SC", sans-serif;
  --font-code: "Cascadia Mono", "Consolas", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 7% 12%, rgba(255, 143, 179, 0.42), transparent 18%),
    radial-gradient(circle at 22% 92%, rgba(255, 242, 184, 0.76), transparent 22%),
    radial-gradient(circle at 82% 14%, rgba(217, 247, 239, 0.9), transparent 24%),
    radial-gradient(circle at 92% 84%, rgba(224, 245, 255, 0.78), transparent 23%),
    linear-gradient(135deg, #fff8ee 0%, #ffeede 42%, #edf9f4 100%);
  font-family: var(--font-sans);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

body::before {
  opacity: 0.42;
  background-image:
    radial-gradient(circle, rgba(255, 143, 179, 0.28) 0 4px, transparent 5px),
    radial-gradient(circle, rgba(69, 170, 160, 0.2) 0 3px, transparent 4px),
    radial-gradient(circle, rgba(255, 242, 184, 0.44) 0 5px, transparent 6px);
  background-position: 34px 38px, 136px 92px, 78px 160px;
  background-size: 220px 220px, 260px 260px, 300px 300px;
}

body::after {
  opacity: 0.45;
  background: linear-gradient(120deg, transparent 0 42%, rgba(255, 255, 255, 0.24) 48%, transparent 56%);
}

button,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none !important;
}

.hidden,
.quiz-panel.hidden,
.stats-panel.hidden,
.submit-overlay.hidden,
.cute-overlay.hidden,
.cute-select-menu.hidden {
  display: none !important;
}

.shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  height: 100dvh;
  padding: 16px 16px 24px;
  overflow: hidden;
}

.side,
.main {
  min-height: 0;
  height: calc(100dvh - 40px);
  max-height: calc(100dvh - 40px);
}

.side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  padding: 20px;
  border: 1px solid rgba(239, 216, 200, 0.92);
  border-radius: 36px;
  background:
    radial-gradient(circle at 12% 4%, rgba(255, 143, 179, 0.3), transparent 28%),
    radial-gradient(circle at 92% 18%, rgba(217, 247, 239, 0.72), transparent 28%),
    linear-gradient(180deg, rgba(255, 251, 244, 0.96), rgba(255, 239, 223, 0.92));
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.side::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.main {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

.brand,
.nav-group,
.section-filter,
.side-actions,
.metric,
.question-workspace,
.attempt-panel,
.stats-panel,
.submit-dialog,
.cute-dialog {
  border: 1px solid rgba(239, 216, 200, 0.92);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.brand,
.nav-group,
.section-filter,
.side-actions {
  border-radius: 30px;
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 242, 184, 0.5), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 244, 236, 0.84));
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
}

.brand-mark,
.cute-mascot {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 18px 18px 22px 22px;
  color: white;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.92) 0 8%, transparent 9%),
    linear-gradient(145deg, var(--pink), var(--mint-strong));
  box-shadow: 0 14px 30px rgba(255, 143, 179, 0.28);
  font-size: 30px;
  font-weight: 900;
}

.brand h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.nav-group,
.section-filter,
.side-actions {
  padding: 16px;
}

.nav-group {
  display: grid;
  gap: 10px;
}

.side-label {
  display: block;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.side-actions {
  margin-top: auto;
}

.nav-btn,
.ghost,
.primary,
.secondary,
.self-grade button,
.option,
.attempt-cell,
.cute-select-trigger,
.cute-select-option,
.reset-btn {
  border: 1px solid rgba(239, 216, 200, 0.95);
  border-radius: 22px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 8px 18px rgba(121, 75, 50, 0.06);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.nav-btn:hover,
.ghost:hover,
.secondary:hover,
.self-grade button:hover,
.option:hover,
.attempt-cell:hover,
.cute-select-trigger:hover,
.cute-select-option:hover,
.reset-btn:hover {
  border-color: rgba(255, 143, 179, 0.72);
  box-shadow: var(--shadow-pop);
  transform: translateY(-2px);
}

.nav-btn {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 62px;
  padding: 9px 12px;
  text-align: left;
}

.nav-btn.active,
.primary {
  border-color: transparent;
  color: white;
  background: linear-gradient(145deg, var(--pink), var(--mint-strong));
  box-shadow: 0 14px 24px rgba(69, 170, 160, 0.2);
}

.primary:hover {
  background: linear-gradient(145deg, #ff7aa6, var(--mint-dark));
}

.nav-icon,
.option-key,
.reset-btn::before,
.cute-select-arrow {
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #6b5143;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.95) 0 20%, transparent 22%),
    linear-gradient(145deg, var(--butter), var(--peach));
  font-weight: 900;
}

.nav-icon {
  width: 42px;
  height: 42px;
  font-size: 18px;
}

.nav-btn.active .nav-icon {
  color: white;
  background: rgba(255, 255, 255, 0.22);
}

.nav-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 900;
}

.nav-count {
  display: none;
  min-width: 30px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--red);
  background: rgba(199, 77, 68, 0.12);
  font-size: 13px;
  font-weight: 900;
  line-height: 28px;
  text-align: center;
}

.nav-count.show {
  display: inline-block;
}

.nav-btn.active .nav-count {
  color: white;
  background: rgba(255, 255, 255, 0.22);
}

.section-filter {
  position: relative;
  display: grid;
  gap: 8px;
}

.section-filter select#sectionSelect {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.cute-select {
  position: relative;
  z-index: 12;
}

.cute-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 54px;
  padding: 0 16px 0 20px;
  border-radius: 999px;
  font-weight: 900;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 242, 184, 0.64), transparent 28%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(255, 238, 246, 0.86));
  box-shadow: 0 12px 22px rgba(121, 75, 50, 0.08), inset 0 0 0 4px rgba(217, 247, 239, 0.5);
}

.cute-select-trigger[aria-expanded="true"] {
  border-color: rgba(255, 143, 179, 0.76);
  box-shadow: 0 16px 26px rgba(255, 143, 179, 0.12), inset 0 0 0 4px rgba(217, 247, 239, 0.72);
}

.cute-select-arrow {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
}

.cute-select-trigger[aria-expanded="true"] .cute-select-arrow {
  transform: rotate(180deg);
}

.cute-select-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 10px);
  z-index: 40;
  display: grid;
  gap: 8px;
  max-height: min(36dvh, 310px);
  overflow-y: auto;
  padding: 10px;
  border: 1px solid rgba(239, 216, 200, 0.96);
  border-radius: 24px;
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 242, 184, 0.72), transparent 30%),
    radial-gradient(circle at 100% 8%, rgba(217, 247, 239, 0.86), transparent 32%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(255, 238, 246, 0.94));
  box-shadow: 0 20px 38px rgba(121, 75, 50, 0.18);
  animation: cute-select-pop 150ms ease-out both;
}

.cute-select-option {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border-color: transparent;
  text-align: left;
  font-weight: 900;
}

.cute-select-option:hover {
  background: rgba(255, 248, 252, 0.96);
  transform: translateX(2px);
}

.cute-select-option.active {
  border-color: rgba(69, 170, 160, 0.56);
  color: #245b58;
  background:
    radial-gradient(circle at 96% 50%, rgba(255, 143, 179, 0.36), transparent 20%),
    linear-gradient(145deg, var(--pink-soft), var(--mint));
}

.reset-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  min-height: 42px;
  padding: 0 14px;
  color: #7b6870;
  font-weight: 900;
}

.side-actions .reset-btn {
  width: 100%;
  min-height: 52px;
}

.reset-btn::before {
  content: "";
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.reset-btn::after {
  content: "";
  width: 10px;
  height: 10px;
  margin-left: -28px;
  margin-right: 18px;
  border: 3px solid #8b5b4d;
  border-left-color: transparent;
  border-radius: 50%;
  transform: rotate(-35deg);
  pointer-events: none;
}

.attempt-head .reset-btn {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 12px;
  font-size: 13px;
}

.attempt-head .reset-btn::before,
.attempt-head .reset-btn::after {
  display: none;
}

.dashboard {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.metric {
  position: relative;
  min-height: 104px;
  overflow: hidden;
  padding: 20px 22px;
  border-radius: 30px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 143, 179, 0.2), transparent 30%),
    linear-gradient(145deg, rgba(255, 252, 246, 0.96), rgba(255, 241, 225, 0.88));
}

.metric::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 18px;
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 25% 50%, rgba(255, 143, 179, 0.38) 0 4px, transparent 5px),
    radial-gradient(circle at 74% 50%, rgba(69, 170, 160, 0.34) 0 4px, transparent 5px);
  opacity: 0.72;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 34px;
  line-height: 1;
}

.quiz-panel,
.stats-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.quiz-panel {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.quiz-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
}

.question-workspace,
.attempt-panel {
  min-height: 0;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 242, 184, 0.5), transparent 25%),
    radial-gradient(circle at 100% 0%, rgba(217, 247, 239, 0.58), transparent 28%),
    linear-gradient(145deg, rgba(255, 253, 248, 0.98), rgba(255, 243, 232, 0.92));
}

.question-workspace {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 30px;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.question-top,
.stats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 999px;
  color: white;
  background: linear-gradient(145deg, var(--pink), var(--mint-strong));
  box-shadow: 0 10px 20px rgba(69, 170, 160, 0.12);
  font-size: 14px;
  font-weight: 800;
}

.pill.light {
  color: #226560;
  background: linear-gradient(145deg, #eefbf7, #ffe8f0);
}

.progress-text {
  color: var(--muted);
  font-size: 18px;
  font-weight: 900;
}

#questionTitle,
.stats-head h2 {
  margin: 24px 0 14px;
  font-size: clamp(27px, 2.3vw, 40px);
  line-height: 1.25;
}

.prompt {
  color: #34313a;
  line-height: 1.85;
  white-space: pre-wrap;
}

.options {
  display: grid;
  gap: 14px;
  margin: 24px 0;
}

.option {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 76px;
  padding: 14px 16px;
  text-align: left;
}

.option-key {
  width: 44px;
  height: 44px;
}

.option.selected {
  border-color: rgba(69, 170, 160, 0.62);
  background:
    radial-gradient(circle at 98% 18%, rgba(217, 247, 239, 0.76), transparent 26%),
    rgba(240, 252, 248, 0.94);
}

.option.correct {
  border-color: rgba(62, 154, 114, 0.74);
  background: linear-gradient(145deg, #eefbf7, #ddf5ed);
}

.option.wrong {
  border-color: rgba(255, 143, 179, 0.74);
  background: linear-gradient(145deg, #fff0f5, #ffe2e2);
}

.option.review-locked {
  cursor: default;
}

.option:disabled {
  color: var(--ink);
}

.option-mark {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.answer-box {
  display: none;
  width: 100%;
  min-height: 160px;
  margin: 18px 0;
  padding: 16px;
  resize: vertical;
  border: 1px solid rgba(239, 216, 200, 0.95);
  border-radius: var(--radius-md);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  line-height: 1.75;
}

.actions,
.self-grade,
.submit-dialog-actions,
.cute-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.actions {
  margin-top: 18px;
}

.ghost,
.primary,
.secondary,
.self-grade button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  line-height: 1.2;
  font-weight: 900;
}

.secondary {
  color: white;
  border-color: transparent;
  background: linear-gradient(145deg, #ffbd5d, #ff8fb3);
}

.ghost.marked {
  color: #9a5a12;
  border-color: rgba(255, 189, 93, 0.7);
  background: linear-gradient(145deg, #fff8dc, #ffe8c8);
}

.feedback {
  display: none;
  margin-top: 20px;
  padding: 20px 22px;
  border: 1px solid rgba(69, 170, 160, 0.18);
  border-left: 6px solid var(--mint-strong);
  border-radius: 28px;
  background:
    radial-gradient(circle at 100% 0%, rgba(217, 247, 239, 0.62), transparent 25%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(255, 247, 238, 0.9));
  line-height: 1.78;
  white-space: pre-wrap;
}

.feedback.compact {
  white-space: normal;
}

.feedback.good {
  border-left-color: var(--green);
}

.feedback.bad {
  border-left-color: var(--red);
}

.self-grade {
  display: none;
  margin-top: 14px;
}

.attempt-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
  padding: 20px;
}

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

.attempt-head strong,
.attempt-head span {
  display: block;
}

.attempt-head strong {
  font-size: 20px;
}

.attempt-head span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
}

.attempt-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-rows: 52px;
  align-content: start;
  align-items: start;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 8px 2px 2px;
  background: transparent;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.attempt-cell {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 52px;
  height: 52px;
  max-height: 52px;
  padding: 0;
  line-height: 1;
  font-size: 18px;
  font-weight: 900;
}

.attempt-cell.current {
  border-color: var(--pink);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.9), transparent 34%),
    linear-gradient(145deg, var(--pink-soft), var(--mint));
  box-shadow: inset 0 0 0 2px rgba(255, 143, 179, 0.22), 0 10px 18px rgba(255, 143, 179, 0.1);
}

.attempt-cell.answered {
  background: linear-gradient(145deg, #eefbf7, #f8fffc);
}

.attempt-cell.flagged::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffbd5d;
  box-shadow: 0 0 0 3px rgba(255, 189, 93, 0.18);
}

.attempt-cell.correct {
  border-color: rgba(62, 154, 114, 0.74);
  background: linear-gradient(145deg, #eefbf7, #ddf5ed);
}

.attempt-cell.wrong {
  border-color: rgba(255, 143, 179, 0.74);
  background: linear-gradient(145deg, #fff0f5, #ffe2e2);
}

.attempt-cell.skipped {
  color: var(--muted);
}

.attempt-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
}

.attempt-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
}

.dot.current {
  background: var(--mint-strong);
}

.dot.answered {
  background: rgba(69, 170, 160, 0.45);
}

.dot.flagged {
  background: var(--amber);
}

.dot.wrong {
  background: var(--red);
}

.stats-panel {
  overflow-y: auto;
  padding: 30px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 242, 184, 0.58), transparent 26%),
    radial-gradient(circle at 100% 4%, rgba(217, 247, 239, 0.72), transparent 30%),
    radial-gradient(circle at 72% 100%, rgba(255, 143, 179, 0.22), transparent 24%),
    linear-gradient(145deg, rgba(255, 253, 248, 0.98), rgba(255, 243, 232, 0.92));
  scrollbar-gutter: stable;
}

.stats-head {
  position: sticky;
  top: -30px;
  z-index: 3;
  margin: -30px -30px 22px;
  padding: 28px 30px 18px;
  border-radius: 34px 34px 24px 24px;
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(255, 253, 248, 0.78));
  backdrop-filter: blur(12px);
}

.stats-head h2 {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0;
}

.stats-head h2::before {
  content: "";
  width: 42px;
  height: 42px;
  border-radius: 16px;
  background:
    radial-gradient(circle at 36% 34%, rgba(255, 255, 255, 0.94) 0 5px, transparent 6px),
    linear-gradient(145deg, var(--pink), var(--mint-strong));
  box-shadow: 0 12px 22px rgba(255, 143, 179, 0.22);
}

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

.stat-row,
.wrong-item {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(239, 216, 200, 0.95);
  border-radius: 26px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 143, 179, 0.18), transparent 28%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(255, 247, 238, 0.88));
  box-shadow: 0 14px 28px rgba(121, 75, 50, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.stat-row {
  min-height: 150px;
  padding: 22px;
}

.stat-row strong,
.wrong-item strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 18px;
}

.bar {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(232, 215, 189, 0.78);
  box-shadow: inset 0 1px 2px rgba(121, 75, 50, 0.08);
}

.bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--pink), var(--mint-strong));
}

.wrong-list {
  display: grid;
  gap: 14px;
  margin-top: 22px;
  padding: 18px;
  border: 1px dashed rgba(255, 143, 179, 0.36);
  border-radius: 30px;
  background: radial-gradient(circle at 0% 0%, rgba(255, 242, 184, 0.38), transparent 26%), rgba(255, 255, 255, 0.36);
}

.wrong-item {
  padding: 18px 20px;
}

.submit-overlay,
.cute-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(65, 47, 41, 0.26);
  backdrop-filter: blur(10px);
}

.submit-dialog,
.cute-dialog {
  position: relative;
  width: min(480px, calc(100vw - 40px));
  padding: 36px 32px 28px;
  border-radius: 34px;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 242, 184, 0.74), transparent 30%),
    radial-gradient(circle at 96% 12%, rgba(217, 247, 239, 0.76), transparent 28%),
    linear-gradient(145deg, #fffaf0 0%, #ffeef4 56%, #eefbf7 100%);
  animation: cute-pop 180ms ease-out both;
}

.submit-dialog::before {
  content: "";
  position: absolute;
  top: -24px;
  left: 24px;
  display: block;
  width: 58px;
  height: 58px;
  border-radius: 22px 22px 26px 26px;
  background:
    radial-gradient(circle at 34% 38%, #ffffff 0 4px, transparent 5px),
    radial-gradient(circle at 66% 38%, #ffffff 0 4px, transparent 5px),
    radial-gradient(ellipse at 50% 66%, rgba(255, 255, 255, 0.9) 0 10px, transparent 11px),
    linear-gradient(145deg, var(--pink), var(--mint-strong));
  box-shadow: 0 14px 28px rgba(255, 143, 179, 0.28);
}

.submit-dialog::after {
  content: "";
  position: absolute;
  top: 20px;
  left: 46px;
  width: 15px;
  height: 7px;
  border-bottom: 3px solid rgba(107, 81, 67, 0.56);
  border-radius: 0 0 999px 999px;
  pointer-events: none;
}

.submit-dialog h2,
.cute-dialog h2 {
  margin: 0 0 12px;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.15;
}

.submit-dialog p,
.cute-dialog p#cuteDialogText {
  color: var(--muted);
  line-height: 1.75;
}

.submit-dialog-actions,
.cute-dialog-actions {
  justify-content: flex-end;
  margin-top: 22px;
}

.cute-dialog::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px dashed rgba(69, 170, 160, 0.22);
  border-radius: 26px;
  pointer-events: none;
}

.cute-mascot {
  position: absolute;
  top: -24px;
  left: 28px;
}

.cute-kicker {
  margin: 0 0 8px 66px;
  color: var(--mint-dark);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.markdown-body {
  display: grid;
  gap: 14px;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol,
.markdown-body pre {
  margin: 0;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 22px;
}

.markdown-body li + li {
  margin-top: 6px;
}

.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  margin: 8px 0 0;
  line-height: 1.35;
}

.markdown-body code {
  padding: 1px 6px;
  border-radius: 8px;
  background: #fff0d0;
  font-family: var(--font-code);
  font-size: 0.92em;
}

.markdown-body pre,
.md-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(239, 216, 200, 0.96);
  border-radius: 22px;
  background: #fffaf3;
}

.markdown-body pre {
  padding: 14px;
}

.markdown-body pre code {
  display: block;
  padding: 0;
  background: transparent;
  white-space: pre;
}

.markdown-body table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  background: white;
}

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

.markdown-body th {
  background: #fff0d0;
  font-weight: 900;
}

.markdown-body tr:last-child td {
  border-bottom: 0;
}

.markdown-body th:last-child,
.markdown-body td:last-child {
  border-right: 0;
}

.nav-btn:focus-visible,
.ghost:focus-visible,
.primary:focus-visible,
.secondary:focus-visible,
.reset-btn:focus-visible,
.cute-select-trigger:focus-visible,
.cute-select-option:focus-visible,
.option:focus-visible,
.attempt-cell:focus-visible,
.self-grade button:focus-visible {
  outline: 3px solid rgba(255, 143, 179, 0.28);
  outline-offset: 3px;
}

.question-workspace::-webkit-scrollbar,
.attempt-grid::-webkit-scrollbar,
.stats-panel::-webkit-scrollbar,
.cute-select-menu::-webkit-scrollbar {
  width: 10px;
}

.question-workspace::-webkit-scrollbar-track,
.attempt-grid::-webkit-scrollbar-track,
.stats-panel::-webkit-scrollbar-track,
.cute-select-menu::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 232, 240, 0.58);
}

.question-workspace::-webkit-scrollbar-thumb,
.attempt-grid::-webkit-scrollbar-thumb,
.stats-panel::-webkit-scrollbar-thumb,
.cute-select-menu::-webkit-scrollbar-thumb {
  border: 3px solid rgba(255, 250, 243, 0.96);
  border-radius: 999px;
  background: linear-gradient(180deg, #ffabc4, #8bd8ce);
}

@keyframes cute-pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes cute-select-pop {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 980px) {
  html,
  body {
    height: auto;
    overflow: auto;
  }

  .shell {
    display: block;
    height: auto;
    min-height: 100dvh;
    padding: 12px;
    overflow: visible;
  }

  .side,
  .main {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .side {
    margin-bottom: 12px;
  }

  .main {
    display: grid;
  }

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

  .quiz-layout {
    grid-template-columns: 1fr;
    height: auto;
    overflow: visible;
  }

  .question-workspace,
  .attempt-panel,
  .stats-panel {
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .attempt-grid {
    max-height: 42dvh;
  }

  .cute-select-menu {
    position: relative;
    top: 8px;
  }
}

@media (max-width: 560px) {
  .dashboard,
  .section-stats {
    grid-template-columns: 1fr;
  }

  .question-top,
  .stats-head,
  .attempt-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .question-workspace,
  .attempt-panel,
  .stats-panel,
  .side {
    padding: 18px;
    border-radius: 28px;
  }

  #questionTitle,
  .stats-head h2 {
    font-size: 24px;
  }

  .option {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .option-mark {
    grid-column: 2;
  }

  .submit-dialog,
  .cute-dialog {
    padding: 34px 22px 22px;
    border-radius: 28px;
  }

  .submit-dialog-actions,
  .cute-dialog-actions {
    flex-direction: column-reverse;
  }

  .submit-dialog-actions button,
  .cute-dialog-actions button {
    width: 100%;
  }
}

/* Markdown content should not inherit pre-wrap from feedback cards. */
.markdown-body {
  white-space: normal;
}

/* No-shadow mode: keep kawaii gradients, remove muddy shadow layers entirely. */
:root {
  --shadow-soft: none;
  --shadow-pop: none;
}

.side,
.main,
.brand,
.nav-group,
.section-filter,
.side-actions,
.metric,
.question-workspace,
.attempt-panel,
.stats-panel,
.submit-dialog,
.cute-dialog,
.nav-btn,
.ghost,
.primary,
.secondary,
.self-grade button,
.option,
.attempt-cell,
.cute-select-trigger,
.cute-select-option,
.cute-select-menu,
.reset-btn,
.feedback,
.stat-row,
.wrong-item,
.bar,
.brand-mark,
.cute-mascot,
.submit-dialog::before,
.stats-head h2::before {
  box-shadow: none !important;
}

.metric::after,
.stat-row::after,
.attempt-cell.flagged::after {
  box-shadow: none !important;
}

.nav-btn:hover,
.ghost:hover,
.secondary:hover,
.self-grade button:hover,
.option:hover,
.attempt-cell:hover,
.cute-select-trigger:hover,
.cute-select-option:hover,
.reset-btn:hover,
.primary:hover,
.wrong-item:hover {
  box-shadow: none !important;
}

.attempt-cell.current {
  box-shadow: inset 0 0 0 2px rgba(255, 143, 179, 0.24) !important;
}

/* Compact typography and smart chapter dropdown direction. */
.brand h1 {
  font-size: 19px;
  line-height: 1.18;
}

.brand p {
  font-size: 13px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  font-size: 28px;
}

.nav-title {
  font-size: 16px;
}

.nav-btn {
  min-height: 58px;
}

.nav-icon {
  width: 38px;
  height: 38px;
  font-size: 17px;
}

.metric strong {
  font-size: 30px;
}

#questionTitle,
.stats-head h2 {
  font-size: clamp(24px, 2vw, 34px);
  line-height: 1.26;
}

.cute-select-menu {
  max-height: var(--cute-menu-max-height, min(36dvh, 310px));
  transform-origin: top center;
}

.cute-select.open-up .cute-select-menu {
  top: auto;
  bottom: calc(100% + 10px);
  transform-origin: bottom center;
}

@media (max-width: 980px) {
  .cute-select.open-up .cute-select-menu {
    top: 8px;
    bottom: auto;
  }
}

/* Sidebar density pass: keep reset action visible without vertical clipping. */
@media (min-width: 981px) {
  .side {
    gap: 10px;
    padding: 14px;
  }

  .brand,
  .nav-group,
  .section-filter,
  .side-actions {
    border-radius: 24px;
  }

  .brand {
    gap: 12px;
    padding: 12px 14px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 15px 15px 18px 18px;
    font-size: 25px;
  }

  .brand h1 {
    font-size: 18px;
  }

  .brand p {
    margin-top: 2px;
    font-size: 12px;
  }

  .nav {
    gap: 10px;
  }

  .nav-group,
  .section-filter {
    gap: 7px;
    padding: 12px;
  }

  .side-label {
    margin-bottom: 7px;
    font-size: 12px;
  }

  .nav-btn {
    min-height: 50px;
    padding: 6px 10px;
    border-radius: 20px;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 9px;
  }

  .nav-icon {
    width: 34px;
    height: 34px;
    border-radius: 13px;
    font-size: 16px;
  }

  .nav-title {
    font-size: 15px;
  }

  .nav-count {
    min-width: 26px;
    height: 24px;
    line-height: 24px;
    font-size: 12px;
  }

  .cute-select-trigger {
    min-height: 46px;
    padding-left: 16px;
    border-radius: 22px;
  }

  .cute-select-arrow {
    width: 26px;
    height: 26px;
    font-size: 17px;
  }

  .side-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin-top: 0;
    padding: 10px 12px;
    background:
      radial-gradient(circle at 10% 0%, rgba(255, 242, 184, 0.58), transparent 34%),
      linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(255, 244, 236, 0.9));
  }

  .side-actions .reset-btn {
    min-height: 44px;
    border-radius: 22px;
  }
}
.archive-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.archive-btn {
  min-height: 34px;
  border: 1px solid rgba(255, 185, 204, 0.58);
  border-radius: 18px;
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 255, 255, 0.9), transparent 34%),
    linear-gradient(135deg, rgba(255, 240, 172, 0.78), rgba(255, 201, 218, 0.58), rgba(178, 232, 226, 0.7));
  color: #544652;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.archive-btn:hover,
.archive-btn:focus-visible {
  border-color: rgba(255, 143, 179, 0.82);
  color: #2e2634;
  outline: none;
}

.storage-hint {
  margin: 7px 4px 0;
  color: rgba(90, 78, 94, 0.74);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
}

