:root {
  --bg: #f5efe4;
  --panel: rgba(255, 250, 242, 0.88);
  --panel-strong: #fffaf3;
  --line: rgba(86, 62, 39, 0.14);
  --text: #2d241d;
  --muted: #6e604f;
  --accent: #c9653b;
  --accent-deep: #994520;
  --accent-soft: rgba(201, 101, 59, 0.12);
  --danger: #bc3d34;
  --success: #2d7c52;
  --shadow: 0 20px 45px rgba(79, 57, 36, 0.14);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(241, 198, 110, 0.28), transparent 28%),
    radial-gradient(circle at bottom right, rgba(201, 101, 59, 0.18), transparent 26%),
    linear-gradient(145deg, #f7f2e9 0%, #efe5d6 54%, #e7dac8 100%);
}

body {
  padding: 28px;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  max-width: 1320px;
  margin: 0 auto;
  display: grid;
  gap: 20px;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(120deg, rgba(255, 248, 238, 0.92), rgba(255, 244, 230, 0.72)),
    linear-gradient(135deg, rgba(201, 101, 59, 0.08), rgba(234, 176, 93, 0.06));
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -40px -55px auto;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(201, 101, 59, 0.08);
  filter: blur(6px);
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-deep);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.7rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.hero-credit {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  padding: 0;
  color: var(--accent-deep);
  font-size: 13px;
  background: transparent;
  border: 0;
}

.hero p {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

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

.panel {
  border: 1px solid rgba(255, 255, 255, 0.56);
  background: var(--panel);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel-inner {
  padding: 22px;
}

.panel-title {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.panel-desc {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.6;
}

.button,
.ghost-button,
.danger-button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button {
  color: #fffaf5;
  background: linear-gradient(135deg, var(--accent), #df8e53);
  box-shadow: 0 10px 20px rgba(201, 101, 59, 0.26);
}

.ghost-button {
  color: var(--accent-deep);
  background: rgba(201, 101, 59, 0.08);
}

.danger-button {
  color: #fff7f7;
  background: linear-gradient(135deg, #cf5646, #a73737);
}

.danger-pill {
  appearance: none;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 6px 12px;
  color: #fff7f7;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  background: linear-gradient(135deg, #cf5646, #a73737);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover,
.ghost-button:hover,
.danger-button:hover,
.danger-pill:hover {
  transform: translateY(-1px);
}

.button:disabled,
.ghost-button:disabled,
.danger-button:disabled,
.danger-pill:disabled {
  cursor: not-allowed;
  transform: none;
  opacity: 0.56;
  box-shadow: none;
}

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

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

.book-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 250, 244, 0.9);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.book-card.active {
  border-color: rgba(201, 101, 59, 0.45);
  box-shadow: 0 12px 26px rgba(138, 80, 44, 0.12);
}

.book-card:hover {
  transform: translateY(-1px);
}

.book-card h3,
.stat-card h3 {
  margin: 0;
  font-size: 1rem;
}

.meta-row,
.card-actions,
.stats-grid,
.summary-grid,
.input-grid,
.answer-grid,
.exam-grid,
.toolbar {
  display: grid;
  gap: 12px;
}

.meta-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.meta-box,
.stat-card,
.exam-record,
.summary-box {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: rgba(255, 251, 246, 0.96);
  border: 1px solid var(--line);
}

.meta-label,
.tiny-label {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.meta-value,
.big-number {
  margin-top: 6px;
  font-size: 1.25rem;
  font-weight: 700;
}

.card-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.stats-grid,
.summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

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

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

.field input[type="text"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  border: 1px solid rgba(121, 97, 73, 0.18);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(255, 252, 248, 0.96);
  color: var(--text);
}

.field textarea {
  min-height: 90px;
  resize: vertical;
}

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.notice,
.empty,
.result-banner {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  line-height: 1.6;
}

.notice {
  background: rgba(45, 124, 82, 0.1);
  color: var(--success);
  border: 1px solid rgba(45, 124, 82, 0.18);
}

.notice.error {
  color: var(--danger);
  background: rgba(188, 61, 52, 0.1);
  border-color: rgba(188, 61, 52, 0.18);
}

.empty {
  color: var(--muted);
  background: rgba(255, 251, 246, 0.72);
  border: 1px dashed rgba(121, 97, 73, 0.2);
}

.template-box {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(201, 101, 59, 0.09), rgba(234, 176, 93, 0.08));
  border: 1px solid rgba(201, 101, 59, 0.15);
}

.menu-wrap {
  position: relative;
}

.menu-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 5;
  min-width: 220px;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 251, 246, 0.98);
  box-shadow: 0 18px 30px rgba(79, 57, 36, 0.16);
}

.menu-list {
  display: grid;
  gap: 8px;
}

.menu-item {
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text);
  background: rgba(201, 101, 59, 0.08);
}

.menu-item.danger {
  color: #fff7f7;
  background: linear-gradient(135deg, #cf5646, #a73737);
}

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

.option-button {
  width: 100%;
  padding: 14px 16px;
  text-align: left;
  border: 1px solid rgba(121, 97, 73, 0.18);
  border-radius: 16px;
  background: rgba(255, 252, 249, 0.95);
}

.option-button.selected {
  border-color: rgba(201, 101, 59, 0.55);
  background: rgba(201, 101, 59, 0.1);
}

.option-button.correct {
  border-color: rgba(45, 124, 82, 0.36);
  background: rgba(45, 124, 82, 0.1);
}

.option-button.incorrect {
  border-color: rgba(188, 61, 52, 0.3);
  background: rgba(188, 61, 52, 0.1);
}

.question-card {
  padding: 22px;
  border-radius: var(--radius-xl);
  background: rgba(255, 251, 246, 0.92);
  border: 1px solid rgba(121, 97, 73, 0.15);
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.question-title {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.45;
}

.question-content {
  white-space: pre-wrap;
  font-size: 1.16rem;
  line-height: 1.75;
}

.question-footer,
.exam-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.progress {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(121, 97, 73, 0.12);
}

.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(135deg, var(--accent), #edb15d);
}

.result-banner {
  border: 1px solid var(--line);
}

.result-banner.correct {
  color: var(--success);
  background: rgba(45, 124, 82, 0.08);
}

.result-banner.incorrect {
  color: var(--danger);
  background: rgba(188, 61, 52, 0.08);
}

.result-answer {
  color: var(--muted);
  margin-top: 8px;
}

.exam-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.exam-nav-group {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 251, 246, 0.92);
}

.exam-nav-group-title {
  color: var(--muted);
  font-size: 13px;
}

.exam-nav button {
  min-width: 46px;
  height: 46px;
  border: 1px solid rgba(121, 97, 73, 0.18);
  border-radius: 14px;
  background: rgba(255, 251, 246, 0.92);
}

.exam-nav button.current {
  border-color: rgba(201, 101, 59, 0.45);
  background: rgba(201, 101, 59, 0.1);
}

.exam-nav button.answered {
  box-shadow: inset 0 0 0 1px rgba(45, 124, 82, 0.28);
}

.pill {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(201, 101, 59, 0.1);
  color: var(--accent-deep);
  font-size: 13px;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 6px 0;
}

.footer-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

@media (max-width: 1080px) {
  .layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  body {
    padding: 16px;
  }

  .hero,
  .panel-inner,
  .question-card {
    padding: 18px;
  }

  .stats-grid,
  .summary-grid,
  .input-grid,
  .meta-row,
  .card-actions {
    grid-template-columns: 1fr;
  }

  .hero-top,
  .question-header,
  .question-footer,
  .exam-footer {
    flex-direction: column;
    align-items: stretch;
  }
}
