/* 首页 */
.page-home {
  align-items: center;
  padding-top: 44px;
}

.home-paper {
  width: min(680px, 100%);
  padding: clamp(24px, 5vw, 46px);
  border-radius: 28px;
  background:
    linear-gradient(rgba(255, 252, 247, 0.92), rgba(245, 240, 235, 0.94)),
    repeating-linear-gradient(45deg, rgba(120, 82, 54, 0.04) 0, rgba(120, 82, 54, 0.04) 1px, transparent 1px, transparent 8px);
  border: 1px solid rgba(201, 169, 110, 0.48);
  box-shadow: var(--shadow);
}

.hero {
  text-align: center;
}

.hero__seal {
  display: inline-block;
  margin-bottom: 16px;
  padding: 5px 12px;
  border: 1px solid var(--red);
  border-radius: 4px;
  color: var(--red);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
}

.hero__eyebrow {
  margin: 0 0 8px;
  color: var(--ink-soft);
  letter-spacing: 0.28em;
  font-size: 0.8rem;
}

.hero__title {
  margin: 0;
  color: var(--red);
  font-family: var(--font-title);
  font-size: clamp(2.25rem, 8vw, 4.6rem);
  line-height: 1.08;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 14px rgba(142, 16, 16, 0.13);
}

.hero__subtitle {
  margin: 16px 0 0;
  color: var(--ink);
  font-size: clamp(1rem, 3vw, 1.3rem);
  font-weight: 700;
}

.hero__desc {
  max-width: 480px;
  margin: 14px auto 0;
  color: var(--ink-soft);
  line-height: 1.8;
}

.hero__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 30px;
}

.hero__actions .btn {
  width: 100%;
}

.home-progress {
  margin-top: 28px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: rgba(201, 169, 110, 0.12);
  border: 1px solid rgba(201, 169, 110, 0.30);
}

.home-progress__label {
  color: var(--ink-soft);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
}

.home-progress__count {
  margin: 2px 0 10px;
  color: var(--red);
  font-family: var(--font-title);
  font-size: 1.45rem;
  font-weight: 700;
}

/* 说明页 */
.page-guide {
  align-items: center;
}

.guide-card {
  width: min(680px, 100%);
  padding: clamp(24px, 5vw, 42px);
  border-radius: 24px;
  background: rgba(245, 240, 235, 0.94);
  border: 1px solid rgba(201, 169, 110, 0.48);
  box-shadow: var(--shadow);
}

.guide-list {
  margin: 18px 0 26px;
  padding-left: 22px;
  color: var(--ink-soft);
  line-height: 2;
}

/* 章节剧情 */
.page-chapter-intro {
  padding-top: 16px;
}

.chapter-intro {
  width: min(920px, 100%);
  overflow: hidden;
  border-radius: 26px;
  background: rgba(245, 240, 235, 0.93);
  border: 1px solid rgba(201, 169, 110, 0.48);
  box-shadow: var(--shadow);
}

.chapter-intro__image {
  min-height: 250px;
  background-size: cover;
  background-position: center;
  background-color: rgba(196, 26, 26, 0.16);
  position: relative;
}

.chapter-intro__image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(245, 240, 235, 0.72));
}

.chapter-intro__body {
  padding: 0 clamp(22px, 5vw, 44px) clamp(24px, 5vw, 40px);
}

.chapter-intro__subtitle {
  margin: 10px 0 0;
  color: var(--red);
  font-weight: 700;
  font-family: var(--font-title);
  font-size: 1.2rem;
}

.chapter-intro__quote {
  margin: 18px 0 0;
  padding-left: 14px;
  border-left: 3px solid var(--gold);
  color: var(--ink);
  font-family: var(--font-title);
  font-size: 1.15rem;
  line-height: 1.6;
}

.chapter-intro__story {
  margin: 16px 0 0;
  color: var(--ink-soft);
  line-height: 1.9;
  text-align: justify;
}

.chapter-intro__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: 20px 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

/* 题目 */
.page-question {
  padding-top: 16px;
}

.question-shell {
  width: min(780px, 100%);
  padding: clamp(22px, 5vw, 38px);
  border-radius: 24px;
  background: rgba(245, 240, 235, 0.94);
  border: 1px solid rgba(201, 169, 110, 0.48);
  box-shadow: var(--shadow);
}

.question-meta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.question-title {
  margin: 24px 0 18px;
  font-family: var(--font-title);
  font-size: clamp(1.4rem, 4vw, 2rem);
  line-height: 1.45;
}

.question-reference {
  margin: -6px 0 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(201, 169, 110, 0.14);
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.6;
}

.question-image {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  margin: 0 0 18px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(201, 169, 110, 0.30);
  background: var(--paper-deep);
}

.question-stage {
  margin-top: 18px;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(201, 169, 110, 0.32);
  background: rgba(255, 252, 247, 0.78);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.option:hover {
  border-color: var(--red);
  transform: translateY(-1px);
}

.option__key {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--red);
  background: rgba(196, 26, 26, 0.10);
  font-weight: 700;
}

.option__text {
  flex: 1;
  line-height: 1.5;
}

.option.is-selected {
  border-color: var(--red);
  background: rgba(196, 26, 26, 0.08);
}

.option.is-correct {
  border-color: var(--green);
  background: rgba(46, 125, 79, 0.12);
  color: var(--green);
}

.option.is-correct .option__key {
  color: #fff;
  background: var(--green);
}

.option.is-wrong {
  border-color: var(--red);
  background: rgba(196, 26, 26, 0.10);
  color: var(--red);
}

.option.is-wrong .option__key {
  color: #fff;
  background: var(--red);
}

.option__check {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 2px solid rgba(107, 87, 68, 0.36);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.option.is-selected .option__check {
  border-color: var(--red);
  background: var(--red);
}

.option.is-selected .option__check::after {
  content: "";
  width: 7px;
  height: 4px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
}

.text-input,
.text-area {
  width: 100%;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(201, 169, 110, 0.42);
  background: rgba(255, 252, 247, 0.84);
  color: var(--ink);
  font: inherit;
  outline: none;
}

.text-input:focus,
.text-area:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(196, 26, 26, 0.10);
}

.text-input.is-correct,
.text-area.is-correct {
  border-color: var(--green);
  background: rgba(46, 125, 79, 0.08);
}

.text-area {
  resize: vertical;
  min-height: 120px;
  line-height: 1.7;
}

.field-label {
  display: block;
  margin: 14px 0 8px;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

/* 排序 */
.sort-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sort-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(201, 169, 110, 0.36);
  background: rgba(255, 252, 247, 0.82);
}

.sort-item.is-correct {
  border-color: var(--green);
  background: rgba(46, 125, 79, 0.10);
}

.sort-item__order {
  flex: 0 0 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  background: var(--red);
  font-weight: 700;
}

.sort-item__text {
  flex: 1;
  line-height: 1.5;
}

.sort-item__actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sort-action {
  width: 32px;
  height: 26px;
  border: 1px solid rgba(201, 169, 110, 0.40);
  border-radius: 6px;
  background: var(--paper);
  color: var(--red);
  cursor: pointer;
  font-size: 0.7rem;
}

/* 拼图 */
.puzzle-tip {
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.6;
}

.puzzle-board {
  display: grid;
  gap: 6px;
  max-width: 320px;
  margin: 14px auto 0;
  padding: 10px;
  border-radius: 14px;
  background: rgba(201, 169, 110, 0.22);
}

.puzzle-tile {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(145deg, #a31818, #6f0d0d);
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.puzzle-tile:active {
  transform: scale(0.96);
}

.puzzle-tile.is-empty {
  background: rgba(107, 87, 68, 0.10);
  cursor: default;
}

.puzzle-tile.is-correct {
  background: linear-gradient(145deg, #2E7D4F, #1F5B38);
}

/* 章节完成 */
.page-complete {
  align-items: center;
}

.complete-card {
  width: min(560px, 100%);
  padding: clamp(24px, 5vw, 40px);
  border-radius: 26px;
  background: rgba(245, 240, 235, 0.94);
  border: 1px solid rgba(201, 169, 110, 0.48);
  box-shadow: var(--shadow);
  text-align: center;
}

.badge-unlock {
  margin: 20px 0 22px;
}

.badge-unlock__icon {
  width: 112px;
  height: 112px;
  margin: 0 auto 12px;
  border-radius: 50%;
  box-shadow: 0 12px 30px rgba(142, 16, 16, 0.18);
}

.badge-unlock__name {
  color: var(--ink-soft);
  font-size: 0.82rem;
  letter-spacing: 0.14em;
}

.badge-unlock__title {
  margin-top: 4px;
  color: var(--red);
  font-family: var(--font-title);
  font-size: 1.8rem;
  font-weight: 700;
}

.badge-unlock__desc {
  margin-top: 6px;
  color: var(--ink-soft);
}

.evidence-card {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(201, 169, 110, 0.50);
  background: rgba(255, 252, 247, 0.52);
  text-align: left;
}

.evidence-card__label {
  color: var(--gold);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  font-weight: 700;
}

.evidence-card__title {
  margin-top: 4px;
  font-weight: 700;
}

.easter-card {
  margin: 0 0 20px;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(201, 169, 110, 0.58);
  background: rgba(201, 169, 110, 0.10);
  text-align: left;
}

.easter-card.is-unlocked {
  border-style: solid;
  background: rgba(46, 125, 79, 0.08);
}

.easter-card__label {
  color: var(--gold);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  font-weight: 700;
}

.easter-card__title {
  margin-top: 4px;
  font-weight: 700;
}

.easter-card__content {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* 终章 */
.page-final {
  padding-top: 28px;
}

.final-hero,
.badge-wall,
.certificate-box {
  width: min(920px, 100%);
  margin-bottom: 22px;
  padding: clamp(22px, 5vw, 38px);
  border-radius: 24px;
  background: rgba(245, 240, 235, 0.94);
  border: 1px solid rgba(201, 169, 110, 0.48);
  box-shadow: var(--shadow);
}

.final-hero {
  text-align: center;
}

.final-hero__text {
  max-width: 680px;
  margin: 14px auto 0;
  color: var(--ink-soft);
  line-height: 1.9;
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 14px;
}

.badge-card {
  padding: 16px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(201, 169, 110, 0.30);
  background: rgba(255, 252, 247, 0.76);
  text-align: center;
}

.badge-card img {
  width: 76px;
  height: 76px;
  margin: 0 auto 10px;
  border-radius: 50%;
}

.badge-card.is-locked {
  opacity: 0.5;
  filter: grayscale(0.8);
}

.badge-card__name {
  font-family: var(--font-title);
  font-weight: 700;
}

.badge-card__desc {
  margin-top: 4px;
  color: var(--ink-soft);
  font-size: 0.76rem;
  line-height: 1.4;
}

.certificate-preview {
  margin-top: 18px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(201, 169, 110, 0.42);
  background: #fff;
}

.certificate-preview canvas {
  width: 100%;
  height: auto;
  display: block;
}
/* PRD4.0 终章收集与成就 */
.final-stats,
.artifact-wall,
.achievement-wall,
.timeline-box {
  width: min(920px, 100%);
  margin-bottom: 22px;
  padding: clamp(22px, 5vw, 38px);
  border-radius: 24px;
  background: rgba(245, 240, 235, 0.94);
  border: 1px solid rgba(201, 169, 110, 0.48);
  box-shadow: var(--shadow);
}

.final-stats__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.final-stat {
  padding: 16px 12px;
  text-align: center;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(201, 169, 110, 0.28);
  background: rgba(201, 169, 110, 0.11);
}

.final-stat strong {
  display: block;
  color: var(--red);
  font-family: var(--font-title);
  font-size: 1.9rem;
  line-height: 1.15;
}

.final-stat span {
  display: block;
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.artifact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 14px;
}

.artifact-card {
  padding: 16px 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(201, 169, 110, 0.32);
  background: rgba(255, 252, 247, 0.78);
  text-align: center;
}

.artifact-card.is-locked {
  opacity: 0.52;
  filter: grayscale(0.85);
}

.artifact-card__icon {
  height: 96px;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.artifact-card__icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.artifact-card__name {
  font-family: var(--font-title);
  font-weight: 700;
}

.artifact-card__back {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 0.76rem;
  line-height: 1.45;
}

.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 14px;
}

.achievement-card {
  padding: 16px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(201, 169, 110, 0.32);
  background: rgba(255, 252, 247, 0.78);
  text-align: center;
}

.achievement-card img {
  width: 70px;
  height: 70px;
  margin: 0 auto 10px;
  border-radius: 50%;
}

.achievement-card.is-locked {
  opacity: 0.52;
  filter: grayscale(0.85);
}

.achievement-card__name {
  font-family: var(--font-title);
  font-weight: 700;
}

.achievement-card__desc {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 0.76rem;
  line-height: 1.45;
}

.timeline-box__hint {
  margin: -6px 0 18px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.timeline-slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.timeline-slot {
  min-height: 66px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px dashed rgba(201, 169, 110, 0.58);
  border-radius: var(--radius-sm);
  background: rgba(255, 252, 247, 0.72);
  color: var(--ink-soft);
  cursor: pointer;
  text-align: left;
}

.timeline-slot.is-filled {
  border-style: solid;
  border-color: var(--red);
  background: rgba(196, 26, 26, 0.06);
  color: var(--ink);
}

.timeline-slot__index {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--white);
  background: var(--gold);
  font-weight: 700;
}

.timeline-slot strong {
  font-weight: 700;
}

.timeline-slot__empty {
  opacity: 0.7;
}

.timeline-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.timeline-chip {
  padding: 9px 13px;
  border: 1px solid rgba(196, 26, 26, 0.28);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.9);
  color: var(--red);
  cursor: pointer;
}

.timeline-chip:hover {
  background: rgba(196, 26, 26, 0.08);
}

.timeline-chips__empty {
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.timeline-success {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(46, 125, 79, 0.10);
  border: 1px solid rgba(46, 125, 79, 0.34);
  color: var(--green);
  font-weight: 700;
}

.timeline-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.timeline-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 252, 247, 0.76);
  border: 1px solid rgba(201, 169, 110, 0.28);
}

.timeline-list span {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--white);
  background: var(--red);
  font-weight: 700;
}

@media (max-width: 560px) {
  .timeline-slot {
    min-height: 58px;
  }

  .timeline-chip {
    flex: 1 1 42%;
  }
}
