:root {
  --red: #C41A1A;
  --red-dark: #8E1010;
  --gold: #C9A96E;
  --gold-light: #E7D7B7;
  --paper: #F5F0EB;
  --paper-deep: #EDE3D8;
  --ink: #2F221B;
  --ink-soft: #6B5744;
  --white: #FFFCF7;
  --green: #2E7D4F;
  --shadow: 0 18px 48px rgba(62, 24, 18, 0.16);
  --shadow-soft: 0 8px 24px rgba(62, 24, 18, 0.10);
  --radius: 18px;
  --radius-sm: 12px;
  --font-title: "STKaiti", "KaiTi", "FangSong", "Noto Serif SC", "SimSun", serif;
  --font-body: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  font-size: 16px;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(circle at 16% 8%, rgba(196, 26, 26, 0.12), transparent 34%),
    radial-gradient(circle at 86% 16%, rgba(201, 169, 110, 0.16), transparent 30%),
    linear-gradient(160deg, #f8f1e7 0%, #efe2d2 52%, #e6d4c1 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.24;
  background-image:
    repeating-linear-gradient(90deg, rgba(120, 82, 54, 0.04) 0, rgba(120, 82, 54, 0.04) 1px, transparent 1px, transparent 5px),
    repeating-linear-gradient(0deg, rgba(120, 82, 54, 0.04) 0, rgba(120, 82, 54, 0.04) 1px, transparent 1px, transparent 5px);
  mix-blend-mode: multiply;
}

button {
  font: inherit;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

img {
  max-width: 100%;
  display: block;
}

#app {
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.page {
  min-height: 100vh;
  padding: 28px 18px 42px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.page-footer {
  margin-top: 28px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.section-kicker {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.section-title {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-title);
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
}

.subsection-title {
  margin: 0 0 14px;
  color: var(--ink);
  font-family: var(--font-title);
  font-size: 1.45rem;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  width: 100%;
  max-width: 920px;
  margin: 0 auto 16px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid rgba(201, 169, 110, 0.42);
  border-radius: 999px;
  background: rgba(245, 240, 235, 0.9);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
}

.topbar__back {
  border: 0;
  background: transparent;
  color: var(--red);
  cursor: pointer;
  white-space: nowrap;
}

.topbar__title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-title);
  font-weight: 700;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  box-shadow: 0 12px 24px rgba(142, 16, 16, 0.24);
}

.btn-primary:hover {
  box-shadow: 0 16px 32px rgba(142, 16, 16, 0.30);
  transform: translateY(-1px);
}

.btn-ghost {
  color: var(--red);
  background: rgba(255, 252, 247, 0.72);
  border-color: rgba(196, 26, 26, 0.34);
}

.btn-block {
  width: 100%;
  margin-top: 16px;
}

.text-button {
  display: block;
  margin: 18px auto 0;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 0.86rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(107, 87, 68, 0.15);
}

.progress-track__bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), var(--gold));
  transition: width 0.4s ease;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(38, 20, 15, 0.55);
  animation: modal-fade 0.2s ease both;
}

.modal__panel {
  width: min(480px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  padding: 26px;
  border-radius: var(--radius);
  border: 1px solid rgba(201, 169, 110, 0.45);
  background: var(--paper);
  box-shadow: var(--shadow);
  animation: modal-pop 0.24s ease both;
}

.modal__title {
  margin: 8px 0 12px;
  font-family: var(--font-title);
  font-size: 1.5rem;
}

.modal__text {
  margin: 0 0 18px;
  color: var(--ink-soft);
  line-height: 1.8;
}

.modal__actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  z-index: 80;
  transform: translateX(-50%);
  padding: 10px 18px;
  border-radius: 999px;
  color: #fff;
  background: rgba(47, 34, 27, 0.92);
  box-shadow: var(--shadow-soft);
  font-size: 0.9rem;
  animation: modal-fade 0.2s ease both;
}

.noscript-tip {
  padding: 30px;
  text-align: center;
  color: var(--red);
  font-size: 1rem;
}

.is-hidden {
  display: none !important;
}

@keyframes modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

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