:root {
  color-scheme: light;
  --bg: #fffdf6;
  --paper: #fffdf8;
  --ink: #25211d;
  --muted: #756f67;
  --line: #d9cfc0;
  --soft-line: #ece2d4;
  --accent: #7b6044;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

button,
audio,
summary {
  font: inherit;
}

.page {
  width: min(860px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 42px;
}

.block {
  padding: 30px 0;
}

.block--first {
  padding-top: 18px;
}

.recipient {
  margin-bottom: 22px;
}

.recipient strong,
.recipient span {
  display: block;
}

.recipient strong {
  margin-bottom: 6px;
  font-size: 22px;
  line-height: 1.35;
}

.recipient span {
  width: fit-content;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.label {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
}

h1 {
  margin: 0 0 20px;
  font-size: 24px;
  line-height: 1.3;
  letter-spacing: 0;
}

p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.85;
}

.audio-bar {
  display: block;
  width: 100%;
  height: 48px;
  margin: 0 0 16px;
}

.transcript {
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: var(--paper);
}

.transcript summary {
  min-height: 48px;
  padding: 13px 16px;
  color: var(--accent);
  cursor: pointer;
  font-weight: 700;
}

.transcript__body {
  max-height: 520px;
  overflow: auto;
  padding: 0 16px 16px;
}

.transcript__body p + p {
  margin-top: 12px;
}

.page-break {
  height: 1px;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.gift-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--soft-line);
}

.gift-list li {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--soft-line);
}

.gift-list__name {
  font-weight: 700;
}

.gift-list__note {
  color: var(--muted);
  line-height: 1.7;
}

.gift-list__note small {
  display: block;
  margin-top: 5px;
  font-size: 14px;
  color: #8d8378;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.photo {
  min-height: 190px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  color: #fff;
  cursor: pointer;
  text-align: left;
  box-shadow: inset 0 -86px 64px rgba(0, 0, 0, 0.32);
}

.photo span {
  display: flex;
  height: 100%;
  align-items: flex-end;
  padding: 14px;
  font-weight: 700;
}

.photo--one {
  background-image: url("photo-1-lite.jpg");
}

.photo--two {
  background-image: url("photo-2-lite.jpg");
}

.photo--three {
  background-image: url("photo-3-lite.jpg");
}

.note {
  padding: 24px 0 12px;
  text-align: center;
}

.note p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.from-line {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 6px;
}

.from-line img {
  width: 66px;
  height: 66px;
  object-fit: contain;
  vertical-align: middle;
}

dialog {
  width: min(620px, calc(100% - 32px));
  padding: 16px;
  border: 0;
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 20px 70px rgba(37, 33, 29, 0.22);
}

dialog::backdrop {
  background: rgba(37, 33, 29, 0.42);
}

.dialog-close {
  position: absolute;
  right: 12px;
  top: 10px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--soft-line);
  border-radius: 999px;
  background: var(--paper);
  cursor: pointer;
  font-size: 22px;
}

.dialog-image {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: var(--dialog-image, #f3eadc);
  background-size: cover;
  background-position: center;
}

#photoCaption {
  margin-top: 12px;
}

.stats-page {
  width: min(860px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0;
}

.stats-page h1 {
  font-size: 30px;
}

.section__kicker {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

.hero__copy {
  max-width: 720px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.stat {
  padding: 18px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: var(--paper);
}

.stat strong {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
}

.stat span {
  font-size: 28px;
  font-weight: 800;
}

.stats-actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}

.stats-actions a,
.stats-actions button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}

@media (max-width: 720px) {
  .page {
    width: min(100% - 24px, 860px);
    padding-top: 18px;
  }

  .gift-list li,
  .photo-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .photo {
    min-height: 150px;
  }
}
