/* 黑熊邮局 · 样式 */
:root {
  --night: #0a111d;
  --night-2: #111c2c;
  --paper: #f6ecd7;
  --paper-2: #efe1c4;
  --ink: #2b2118;
  --ink-soft: #5a4a3a;
  --kraft: #c9a97a;
  --kraft-d: #a8855a;
  --wax: #a8402e;
  --gold: #e8c37a;
  --green: #2f5d4f;
  --green-d: #1e4038;
  --serif: "Kaiti SC", "KaiTi", "STKaiti", "Songti SC", "Noto Serif SC", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--night);
  color: #f1e7d6;
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

.view {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
}

[hidden] { display: none !important; }

/* ---------- 通用按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: 999px;
  font-size: 14px;
  letter-spacing: 0.08em;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

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

.btn.primary {
  background: linear-gradient(180deg, #f2d296, #d9a94e);
  color: #2a1c0d;
  font-weight: 600;
  box-shadow: 0 10px 26px rgba(217, 169, 78, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn.quiet {
  background: rgba(255, 255, 255, 0.05);
  color: #f1e7d6;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.btn.ghost-btn {
  background: transparent;
  border: 1px solid rgba(241, 231, 214, 0.25);
  color: #f1e7d6;
  padding: 11px 24px;
  font-size: 13px;
}

/* ---------- 门口 ---------- */

.landing {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  background: radial-gradient(120% 70% at 50% 8%, #17293f 0%, #0b1421 55%, #070c14 100%);
}

.sky {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.stars span {
  position: absolute;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.6);
  opacity: 0.6;
  animation: twinkle var(--d, 4s) ease-in-out infinite alternate;
}

@keyframes twinkle {
  from { opacity: 0.12; transform: scale(0.8); }
  to { opacity: 0.9; transform: scale(1.12); }
}

.moon {
  position: absolute;
  top: 7%;
  right: 11%;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #fff8e2, #f0dfb4 58%, #d9c48e);
  box-shadow: 0 0 38px 12px rgba(240, 223, 180, 0.16);
}

.hills {
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: 0;
  height: 44%;
  background:
    radial-gradient(75% 120% at 12% 100%, #0e1a28 0 42%, rgba(14, 26, 40, 0) 76%),
    radial-gradient(85% 120% at 88% 100%, #0c1622 0 42%, rgba(12, 22, 34, 0) 76%),
    linear-gradient(transparent, rgba(10, 17, 25, 0.9) 66%, #0a1119 82%);
  filter: blur(2px);
}

.fog {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 28%;
  height: 26%;
  background: linear-gradient(transparent, rgba(150, 185, 220, 0.07), transparent);
  filter: blur(8px);
  animation: drift 16s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: translateX(-4%); }
  to { transform: translateX(4%); }
}

.shop {
  position: relative;
  z-index: 2;
  width: min(340px, 84vw);
  margin: 92px auto 0;
}

.awning {
  position: relative;
  height: 26px;
  border-radius: 8px 8px 0 0;
  background: repeating-linear-gradient(90deg, var(--green) 0 26px, #e9d9b8 26px 52px);
  box-shadow: inset 0 -8px 12px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.4);
}

.awning::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -5px;
  height: 6px;
  background: linear-gradient(rgba(0, 0, 0, 0.35), transparent);
  border-radius: 0 0 50% 50%;
}

.awning i {
  display: none;
}

.shop-body {
  position: relative;
  display: grid;
  grid-template-columns: 1.28fr 0.72fr;
  gap: 12px;
  padding: 16px 16px 24px;
  border-radius: 0 0 10px 10px;
  background: linear-gradient(180deg, #3d2e22, #2a1f18);
  box-shadow: 0 32px 60px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.window {
  position: relative;
  height: 134px;
  border-radius: 4px;
  border: 5px solid #241a13;
  background: linear-gradient(180deg, #ffd98e, #e7a94c 62%, #bf8236);
  box-shadow:
    0 0 44px rgba(255, 198, 106, 0.32),
    inset 0 0 24px rgba(120, 60, 10, 0.35);
  overflow: hidden;
}

.window-bear {
  position: absolute;
  left: 50%;
  bottom: -10px;
  width: 88px;
  height: 100px;
  transform: translateX(-50%);
  cursor: pointer;
  filter: drop-shadow(0 6px 10px rgba(60, 20, 0, 0.35));
}

.window-bear svg {
  width: 100%;
  height: 100%;
  display: block;
  animation: breathe 4.2s ease-in-out infinite;
  transform-origin: 50% 100%;
}

@keyframes breathe {
  0%, 100% { transform: scale(1, 1); }
  50% { transform: scale(1.018, 0.985); }
}

.window-bear .eye {
  transform-box: fill-box;
  transform-origin: center;
  animation: blink 6.5s infinite;
}

@keyframes blink {
  0%, 42%, 46%, 100% { transform: scaleY(1); }
  44% { transform: scaleY(0.1); }
}

.window-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 34%, rgba(255, 245, 205, 0.7), transparent 62%);
  mix-blend-mode: screen;
  pointer-events: none;
}

.door {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 6px;
  border-radius: 4px;
  background: linear-gradient(180deg, #2c4038, #1c2c27);
  border: 4px solid #241a13;
  text-align: center;
}

.door-plate {
  writing-mode: vertical-rl;
  font-size: 11px;
  letter-spacing: 4px;
  color: var(--gold);
  border: 1px solid rgba(232, 195, 122, 0.4);
  border-radius: 3px;
  padding: 5px 3px;
}

.door em {
  font-style: normal;
  font-size: 8.5px;
  line-height: 1.5;
  letter-spacing: 0.06em;
  color: rgba(241, 231, 214, 0.5);
}

.sign {
  position: absolute;
  left: 50%;
  top: -74px;
  transform: translateX(-50%) rotate(-1.5deg);
  padding: 9px 20px 7px;
  border-radius: 4px;
  text-align: center;
  background: linear-gradient(180deg, #f3e3c0, #d6bd92);
  border: 1px solid #8a6a42;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.45), inset 0 0 0 2px rgba(90, 60, 30, 0.22);
  z-index: 4;
}

.sign::before,
.sign::after {
  content: "";
  position: absolute;
  top: 100%;
  width: 1px;
  height: 32px;
  background: rgba(214, 189, 146, 0.55);
}

.sign::before { left: 22%; }
.sign::after { right: 22%; }

.sign-cn {
  display: block;
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  color: #3a2a1c;
}

.sign-en {
  display: block;
  margin-top: 2px;
  font-size: 7.5px;
  letter-spacing: 0.28em;
  color: #7a5f3c;
}

.mailbox {
  position: absolute;
  left: -18px;
  bottom: -8px;
  width: 62px;
  height: 98px;
  z-index: 5;
  filter: drop-shadow(0 12px 14px rgba(0, 0, 0, 0.45));
  transition: transform 0.2s ease;
}

.mailbox:active { transform: scale(0.96); }

.mailbox.knock { animation: knock 0.6s ease; }

@keyframes knock {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-5deg) translateY(-2px); }
  55% { transform: rotate(4deg); }
  78% { transform: rotate(-2deg); }
}

.mbox-roof {
  position: absolute;
  top: 0;
  left: 50%;
  width: 74px;
  height: 17px;
  transform: translateX(-50%);
  background: #24483d;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.mbox-body {
  position: absolute;
  top: 14px;
  left: 0;
  width: 62px;
  height: 48px;
  border-radius: 4px;
  background: linear-gradient(180deg, #3a7261, #245044);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.22), inset 0 2px 0 rgba(255, 255, 255, 0.08);
}

.mbox-slot {
  position: absolute;
  top: 13px;
  left: 50%;
  width: 34px;
  height: 5px;
  transform: translateX(-50%);
  border-radius: 2px;
  background: #122019;
  box-shadow: inset 0 1px 2px #000;
}

.mbox-paw {
  position: absolute;
  left: 50%;
  bottom: 7px;
  transform: translateX(-50%);
  font-size: 13px;
  opacity: 0.45;
}

.mbox-post {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 8px;
  height: 38px;
  transform: translateX(-50%);
  border-radius: 2px;
  background: linear-gradient(90deg, #463428, #2c211a);
}

.ground {
  position: relative;
  height: 54px;
  border-radius: 0 0 14px 14px;
  background: linear-gradient(#0d1723, #0a1119);
}

.ground::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 22px;
  background: radial-gradient(120% 90% at 50% 0, rgba(130, 170, 210, 0.1), transparent 65%);
  border-radius: 0 0 14px 14px;
}

.intro {
  position: relative;
  z-index: 2;
  padding: 26px 24px 40px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 10.5px;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: rgba(232, 195, 122, 0.7);
}

.intro h1 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  color: #f8efdb;
  text-shadow: 0 2px 24px rgba(232, 195, 122, 0.16);
}

.lede {
  max-width: 300px;
  margin: 0 auto 24px;
  font-size: 13px;
  line-height: 2;
  color: rgba(241, 231, 214, 0.6);
}

.hint {
  min-height: 16px;
  margin-top: 14px;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: rgba(241, 231, 214, 0.38);
}

.bear-bubble {
  position: absolute;
  left: 50%;
  bottom: 104%;
  transform: translateX(-50%);
  padding: 6px 10px;
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
  font-size: 11px;
  white-space: nowrap;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35);
  animation: pop 0.25s ease both;
}

@keyframes pop {
  from { opacity: 0; transform: translate(-50%, 4px) scale(0.96); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

/* ---------- 信架 ---------- */

.desk {
  background: radial-gradient(130% 60% at 50% 0, #182739 0%, #0c1522 55%, #080e17 100%);
  padding-bottom: 40px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  padding-top: calc(14px + env(safe-area-inset-top, 0px));
  background: linear-gradient(rgba(10, 17, 29, 0.94), rgba(10, 17, 29, 0.55));
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.ghost {
  padding: 6px 2px;
  font-size: 12.5px;
  color: rgba(241, 231, 214, 0.6);
}

.brand {
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: rgba(232, 195, 122, 0.85);
  white-space: nowrap;
}

.count {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(241, 231, 214, 0.42);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.desk-inner {
  max-width: 520px;
  margin: 0 auto;
  padding: 22px 16px 0;
}

.desk-head h2 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.14em;
  color: #f8efdb;
}

.desk-head p {
  margin: 0 0 20px;
  font-size: 12px;
  color: rgba(241, 231, 214, 0.42);
}

.letter-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.env {
  position: relative;
  aspect-ratio: 1.5;
  padding: 0;
  border-radius: 5px;
  text-align: left;
  overflow: hidden;
  background: linear-gradient(155deg, #f4e7c9, #ddc59d);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.34);
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.22s ease, box-shadow 0.22s ease, filter 0.3s ease;
}

.env::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #f9efd8, #e5cfa9);
  clip-path: polygon(0 0, 100% 0, 50% 58%);
  box-shadow: 0 1px 0 rgba(120, 90, 50, 0.22);
}

.env::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 5px;
  border: 1px solid rgba(90, 60, 30, 0.18);
  box-shadow: inset 0 -22px 34px rgba(120, 90, 50, 0.14);
  pointer-events: none;
}

.env:active { transform: rotate(0) scale(0.97); }

.env.locked {
  filter: grayscale(0.35) brightness(0.74) saturate(0.9);
  cursor: not-allowed;
}

.env-seal {
  position: absolute;
  left: 50%;
  top: 46%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #c65a45, #8e2f20);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), inset 0 0 0 2px rgba(255, 255, 255, 0.08);
  color: #f7e3c8;
  font-family: var(--serif);
  font-size: 15px;
}

.env-title {
  position: absolute;
  left: 12px;
  bottom: 25px;
  z-index: 2;
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 0.06em;
  color: #3a2a1c;
}

.env-post {
  position: absolute;
  left: 12px;
  right: 10px;
  bottom: 9px;
  z-index: 2;
  font-size: 9px;
  letter-spacing: 0.04em;
  color: #7a6244;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.env-state {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 9px;
  letter-spacing: 0.08em;
  color: rgba(58, 42, 28, 0.65);
  background: rgba(255, 255, 255, 0.28);
}

.env.read .env-seal { opacity: 0.55; }

.env-lock {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 3;
  padding: 3px 7px;
  border-radius: 4px;
  text-align: right;
  font-size: 9.5px;
  letter-spacing: 0.05em;
  color: #f6e8cd;
  background: rgba(28, 20, 14, 0.6);
  backdrop-filter: blur(2px);
}

.next-info {
  margin-top: 26px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(232, 195, 122, 0.14);
  background: rgba(255, 255, 255, 0.025);
}

.next-line {
  margin: 0 0 4px;
  font-size: 12.5px;
  color: rgba(241, 231, 214, 0.66);
}

.next-timer {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(241, 231, 214, 0.4);
}

.next-timer b {
  font-weight: 500;
  color: rgba(232, 195, 122, 0.85);
  font-variant-numeric: tabular-nums;
}

.empty-bag {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin-top: 18px;
  padding: 16px;
  border-radius: 12px;
  text-align: left;
  border: 1px dashed rgba(232, 195, 122, 0.3);
  background: rgba(232, 195, 122, 0.05);
}

.bag-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(232, 195, 122, 0.12);
  color: var(--gold);
  font-size: 17px;
}

.empty-bag b {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.08em;
}

.empty-bag small {
  font-size: 11px;
  color: rgba(241, 231, 214, 0.42);
}

.empty-bag .arrow {
  margin-left: auto;
  color: rgba(232, 195, 122, 0.7);
}

.foot {
  margin-top: 34px;
  text-align: center;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: rgba(241, 231, 214, 0.26);
}

.foot .dot {
  margin: 0 9px;
  opacity: 0.55;
}

.foot .bag-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 5px;
  padding: 5px 12px;
  border: 1px solid rgba(232, 195, 122, 0.3);
  border-radius: 999px;
  color: rgba(232, 195, 122, 0.72);
  text-decoration: none;
  letter-spacing: 0.1em;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.foot .bag-link::after {
  content: "→";
  font-size: 10px;
  opacity: 0.7;
}

.foot .bag-link:hover {
  color: rgba(232, 195, 122, 0.98);
  border-color: rgba(232, 195, 122, 0.7);
  background: rgba(232, 195, 122, 0.06);
}

.ending-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

a.bag-btn {
  text-decoration: none;
}

/* ---------- 读信 ---------- */

.letter-view {
  background:
    radial-gradient(100% 60% at 50% 0, #1a2739 0%, #0d1623 60%, #080e17 100%);
  padding-bottom: 60px;
}

.letter-stage {
  max-width: 560px;
  margin: 0 auto;
  padding: 26px 18px 0;
}

.stage-env {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 26px;
}

.big-env {
  position: relative;
  width: min(320px, 80vw);
  aspect-ratio: 1.55;
  perspective: 900px;
}

.big-env-body {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: linear-gradient(158deg, #f5e8cb, #dcc49b);
  box-shadow: 0 26px 54px rgba(0, 0, 0, 0.5);
}

.big-env-flap {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 53%;
  z-index: 3;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, #faf0da, #e2cda8);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  backface-visibility: hidden;
  animation: openFlap 0.95s 0.3s cubic-bezier(0.6, 0.05, 0.3, 1) forwards;
}

@keyframes openFlap {
  to { transform: rotateX(-179deg); }
}

.big-to {
  margin-top: -18px;
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: 0.2em;
  color: #46331f;
}

.big-seal {
  position: absolute;
  right: 16px;
  bottom: 14px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #c65a45, #8e2f20);
  color: #f7e3c8;
  font-family: var(--serif);
  font-size: 16px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

.big-from {
  position: absolute;
  left: 14px;
  bottom: 12px;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: rgba(90, 60, 30, 0.55);
}

.stage-tip {
  margin: 26px 0 0;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: rgba(241, 231, 214, 0.36);
}

.paper {
  position: relative;
  padding: 30px 24px 26px;
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
  transform: rotate(-0.3deg);
  animation: paperIn 0.75s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.paper::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 3px;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .34 0 0 0 0 .20 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes paperIn {
  from { opacity: 0; transform: translateY(26px) rotate(-1.2deg); }
  to { opacity: 1; transform: translateY(0) rotate(-0.3deg); }
}

.paper-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.paper-kicker {
  padding-top: 6px;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: #8a6a42;
}

.postmark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  transform: rotate(-9deg);
  border: 2px double rgba(168, 64, 46, 0.42);
  border-radius: 50%;
  text-align: center;
  font-size: 7.5px;
  line-height: 1.45;
  letter-spacing: 0.05em;
  color: rgba(168, 64, 46, 0.6);
  font-family: var(--sans);
}

.paper-title {
  margin: 4px 0 22px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 27px;
  letter-spacing: 0.12em;
  color: #2b2118;
}

.paper-body p {
  margin: 0 0 0.85em;
  font-family: var(--serif);
  font-size: 17.5px;
  line-height: 2.05;
  letter-spacing: 0.015em;
  color: #2f2419;
  opacity: 0;
  transform: translateY(6px);
  animation: rise 0.6s ease forwards;
  animation-delay: calc(var(--i, 0) * 0.14s + 0.12s);
}

.paper-body p:first-child {
  font-size: 19px;
  letter-spacing: 0.08em;
  margin-bottom: 1em;
}

@keyframes rise {
  to { opacity: 1; transform: none; }
}

.paper-sign {
  margin: 20px 0 0;
  text-align: right;
  font-family: var(--serif);
  font-size: 17px;
  color: #4a3826;
}

.paper-ps {
  margin: 20px 0 0;
  padding-top: 12px;
  border-top: 1px dashed rgba(120, 90, 50, 0.3);
  font-family: var(--serif);
  font-size: 13.5px;
  color: #6b5540;
}

.paper-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px dashed rgba(120, 90, 50, 0.22);
}

.paper-actions .btn {
  padding: 10px 18px;
  font-size: 12.5px;
}

.paper-actions .btn.quiet {
  background: rgba(120, 90, 50, 0.08);
  border-color: rgba(120, 90, 50, 0.22);
  color: #5a4632;
}

.paper-actions .btn.primary {
  box-shadow: 0 8px 18px rgba(217, 169, 78, 0.22);
}

.paper-body-p {
  margin: 0;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 2;
}

/* 录音 */

.tape {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 4px;
  padding: 12px 14px;
  border-radius: 10px;
  background: linear-gradient(180deg, #efe0c2, #e6d3ae);
  border: 1px solid rgba(120, 90, 50, 0.25);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.tape-play {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: linear-gradient(180deg, #3a7261, #245044);
  color: #f6ecd7;
  box-shadow: 0 4px 10px rgba(36, 80, 68, 0.35);
}

.tape-play svg { width: 20px; height: 20px; margin-left: 2px; }
.tape-play.playing svg { opacity: 0.65; }

.tape-meta {
  flex: 1;
  min-width: 0;
}

.tape-meta b {
  display: block;
  font-family: var(--serif);
  font-size: 13.5px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: #4a3826;
}

.tape-status {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  color: #8a6a42;
}

.tape-bar {
  height: 3px;
  margin-top: 7px;
  border-radius: 2px;
  background: rgba(120, 90, 50, 0.18);
  overflow: hidden;
}

.tape-bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 2px;
  background: var(--wax);
  transition: width 0.2s linear;
}

.tape.empty {
  justify-content: center;
  border-style: dashed;
  background: rgba(239, 224, 194, 0.5);
  padding: 16px;
}

.tape-empty-note {
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #8a6a42;
}

/* 照片 */

.polaroid {
  width: 86%;
  max-width: 320px;
  margin: 20px auto 6px;
  padding: 9px 9px 32px;
  border-radius: 2px;
  background: #fdfaf1;
  box-shadow: 0 10px 22px rgba(60, 40, 20, 0.22);
  transform: rotate(1.2deg);
}

.polaroid img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 1px;
  background: #e3d5bb;
}

.polaroid figcaption {
  margin-top: 8px;
  text-align: center;
  font-family: var(--serif);
  font-size: 11.5px;
  color: #7a6244;
}

.polaroid.empty { transform: rotate(-1deg); }

.polaroid-blank {
  aspect-ratio: 3 / 2;
  border-radius: 1px;
  border: 1px dashed rgba(120, 90, 50, 0.35);
  background: rgba(230, 215, 185, 0.5);
}

/* ---------- 终章 ---------- */

.ending-view {
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(90% 60% at 50% 20%, #1a2739, #0a111d 70%);
}

.ending {
  width: 100%;
  max-width: 380px;
  padding: 40px 24px;
  text-align: center;
}

.sealed-envelope {
  position: relative;
  width: 210px;
  height: 124px;
  margin: 0 auto 34px;
  border-radius: 4px;
  background: linear-gradient(158deg, #f3e6c8, #d9c098);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.5);
}

.sealed-envelope::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 4px;
  background: linear-gradient(180deg, #f9efd8, #e3cda6);
  clip-path: polygon(0 0, 100% 0, 50% 62%);
}

.seal {
  position: absolute;
  left: 50%;
  top: 52%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #c65a45, #8a2d1e);
  color: #f7e3c8;
  font-family: var(--serif);
  font-size: 18px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
}

.sealed-line {
  position: absolute;
  left: 14px;
  bottom: 12px;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: rgba(90, 60, 30, 0.6);
}

.ending h2 {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 30px;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  color: #f8efdb;
}

.ending-copy {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: 15px;
  line-height: 2.1;
  color: rgba(241, 231, 214, 0.62);
}

.ending-copy em {
  font-style: normal;
  color: rgba(232, 195, 122, 0.8);
}

.meet {
  margin: 26px 0 30px;
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 0.16em;
  color: rgba(232, 195, 122, 0.9);
}

/* ---------- 回信 ---------- */

.reply-view {
  background: radial-gradient(100% 60% at 50% 0, #1a2739, #0a111d 70%);
  padding-bottom: 60px;
}

.reply-paper .paper-body p:first-child {
  font-size: 17.5px;
}

/* ---------- 弹层 ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgba(4, 8, 14, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.sheet {
  width: 100%;
  max-width: 440px;
  padding: 22px 20px 20px;
  border-radius: 18px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
  animation: sheetIn 0.28s ease both;
}

@keyframes sheetIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

.sheet h3 {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 21px;
  letter-spacing: 0.1em;
}

.sheet-tip {
  margin: 0 0 14px;
  font-size: 11.5px;
  line-height: 1.7;
  color: #7a6244;
}

.sheet textarea {
  display: block;
  width: 100%;
  min-height: 140px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(120, 90, 50, 0.28);
  background: #fffaf0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.9;
  resize: vertical;
  outline: none;
}

.sheet textarea:focus { border-color: rgba(168, 64, 46, 0.5); }

.sheet input[readonly] {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(120, 90, 50, 0.28);
  background: #fffaf0;
  color: #5a4632;
  font-size: 11px;
  outline: none;
}

.sheet-row {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}

.sheet-row .btn { padding: 11px 18px; font-size: 13px; }

.sheet .btn.quiet {
  background: rgba(120, 90, 50, 0.08);
  border-color: rgba(120, 90, 50, 0.22);
  color: #5a4632;
}

.sheet .btn.primary {
  background: linear-gradient(180deg, #3a7261, #245044);
  color: #f6ecd7;
  box-shadow: 0 8px 18px rgba(36, 80, 68, 0.25);
}

.sheet-note {
  min-height: 16px;
  margin: 10px 0 0;
  font-size: 11px;
  color: #8a6a42;
}

/* ---------- 提示 ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 200;
  max-width: 80vw;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(16, 24, 36, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(241, 231, 214, 0.9);
  font-size: 12.5px;
  letter-spacing: 0.03em;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

.preview-ribbon {
  position: fixed;
  right: 10px;
  bottom: 10px;
  z-index: 90;
  padding: 4px 9px;
  border-radius: 4px;
  background: rgba(168, 64, 46, 0.72);
  color: #f6e8cd;
  font-size: 10px;
  letter-spacing: 0.06em;
  opacity: 0.85;
}

/* ---------- 减少动效 ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .paper-body p { opacity: 1; transform: none; }
}

@media (max-width: 360px) {
  .intro h1 { font-size: 32px; }
  .paper { padding: 24px 18px 22px; }
  .paper-body p { font-size: 16.5px; }
  .sign { top: -70px; }
}

@media (min-width: 700px) {
  .modal { align-items: center; }
}

/* ---------- 音乐开关 ---------- */

.music-btn {
  position: fixed;
  left: 14px;
  bottom: 18px;
  z-index: 95;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(232, 195, 122, 0.4);
  background: rgba(9, 15, 25, 0.6);
  color: rgba(232, 195, 122, 0.7);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: color 0.3s ease, border-color 0.3s ease, background 0.3s ease, opacity 0.3s ease;
}

.music-btn span {
  display: block;
  transform: translateY(-1px);
}

.music-btn:hover {
  color: var(--gold);
  border-color: rgba(232, 195, 122, 0.7);
}

.music-btn.on {
  color: var(--gold);
  border-color: rgba(232, 195, 122, 0.75);
  background: rgba(232, 195, 122, 0.14);
  box-shadow: 0 0 14px rgba(232, 195, 122, 0.22);
}

.music-btn.on span {
  animation: noteBob 3.6s ease-in-out infinite;
}

@keyframes noteBob {
  0%, 100% { transform: translateY(-1px); }
  50% { transform: translateY(-2.5px); }
}

/* 读信时不挡正文：音乐按钮与预览角标都藏起来（音乐照常放） */
body[data-view="letter"] .music-btn,
body[data-view="letter"] .preview-ribbon {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .music-btn.on span { animation: none; }
}
