:root {
  --ink: #25343b;
  --muted: #66787e;
  --mist: #edf3f3;
  --paper: rgba(255, 255, 255, 0.62);
  --line: rgba(37, 52, 59, 0.15);
  --blue: #7ea5ad;
  --sage: #a8beb4;
  --shadow: 0 20px 45px rgba(42, 61, 67, 0.1);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--mist); -webkit-text-size-adjust: 100%; }
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 92% 8%, rgba(168, 190, 180, 0.24), transparent 22rem),
    radial-gradient(circle at 5% 29%, rgba(126, 165, 173, 0.18), transparent 25rem),
    var(--mist);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; }
img { display: block; max-width: 100%; -webkit-user-drag: none; }

.loading {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-content: center;
  gap: 12px;
  background: var(--mist);
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-align: center;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.loading img { width: 94px; height: 94px; margin: 0 auto; border-radius: 50%; object-fit: cover; box-shadow: var(--shadow); }
.loading.is-hidden { opacity: 0; visibility: hidden; }

.page-shell { width: min(100%, 720px); min-height: 100svh; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom)); }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: 0.14em; }
.quiet-button { min-width: 48px; min-height: 32px; border: 1px solid var(--line); border-radius: 4px; background: rgba(255,255,255,.35); color: var(--muted); cursor: pointer; }

.cover { display: flex; min-height: calc(100svh - 72px); flex-direction: column; justify-content: center; padding: 28px 0; animation: fade-up .7s ease both; }
.cover-cats { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.cover-cats img { width: 72px; height: 72px; border: 1px solid rgba(255,255,255,.9); border-radius: 7px; background: rgba(255,255,255,.42); box-shadow: 0 10px 22px rgba(42,61,67,.08); object-fit: cover; }
.cover-cats img:nth-child(2) { transform: translateY(10px); }
.cover-cats img:nth-child(3) { transform: translateY(-2px); }
.eyebrow, .chapter-date { margin: 0; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; }
.cover h1 { max-width: 580px; margin: 10px 0 18px; font-family: "Songti SC", "Noto Serif SC", serif; font-size: clamp(34px, 9vw, 54px); font-weight: 400; letter-spacing: 0; line-height: 1.27; }
.cover-copy { max-width: 570px; margin: 0 0 13px; color: var(--muted); font-family: "Songti SC", "Noto Serif SC", serif; font-size: 17px; line-height: 2; }
.signature { display: flex; justify-content: space-between; gap: 14px; max-width: 570px; margin: 18px 0 20px; padding-top: 13px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.6; }
.primary-button { min-height: 48px; width: fit-content; padding: 0 18px; border: 1px solid var(--ink); border-radius: 4px; background: var(--ink); color: #f6fbfb; cursor: pointer; font-size: 13px; letter-spacing: 0.08em; transition: transform .18s ease, background .18s ease; }
.primary-button:active, .chapter-button:active, .next-button:active, .cameo-card:active { transform: translateY(2px) scale(.99); }

.reader { padding-top: 26px; animation: fade-up .45s cubic-bezier(.2,.85,.25,1) both; }
.reader[hidden], .cover[hidden] { display: none; }
.chapter-nav { display: flex; gap: 8px; margin: 0 -20px 20px; padding: 0 20px 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chapter-nav::-webkit-scrollbar { display: none; }
.chapter-button { flex: 0 0 auto; min-height: 34px; padding: 0 11px; border: 1px solid var(--line); border-radius: 4px; background: rgba(255,255,255,.36); color: var(--muted); cursor: pointer; font-size: 11px; white-space: nowrap; }
.chapter-button.is-active { border-color: rgba(37,52,59,.46); background: rgba(255,255,255,.8); color: var(--ink); }

.letter { padding-bottom: 16px; }
.chapter { display: none; min-height: calc(100svh - 176px); padding-bottom: 20px; }
.chapter.is-active { display: block; animation: chapter-in .45s cubic-bezier(.2,.85,.25,1) both; }
.chapter-header { margin-bottom: 17px; }
.chapter-header h2 { margin: 7px 0 0; font-family: "Songti SC", "Noto Serif SC", serif; font-size: clamp(28px, 7.5vw, 43px); font-weight: 400; line-height: 1.35; }
.chapter-state { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.scene { display: grid; gap: 15px; }
.cat-card { position: relative; width: min(57vw, 250px); margin: 2px auto 2px; padding: 8px; border: 1px solid rgba(255,255,255,.78); border-radius: 7px; background: var(--paper); box-shadow: var(--shadow); cursor: pointer; touch-action: manipulation; transition: transform .22s ease; }
.cat-card img { width: 100%; aspect-ratio: 1; border-radius: 4px; object-fit: cover; }
.cat-card span { display: block; padding-top: 7px; color: var(--muted); font-size: 10px; letter-spacing: .1em; text-align: center; }
.cat-card.is-dodging-right { animation: dodge-right .9s cubic-bezier(.16,.84,.3,1) both; }
.cat-card.is-dodging-left { animation: dodge-left .9s cubic-bezier(.16,.84,.3,1) both; }
.cat-card.is-hugging { animation: hug .9s cubic-bezier(.18,.78,.28,1) both; }
.cat-note { min-height: 20px; margin: -7px 0 0; color: var(--blue); font-size: 12px; line-height: 1.6; text-align: center; }
.cameo-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: min(100%, 296px); gap: 10px; margin: 0 auto; }
.cameo-card { min-width: 0; min-height: 88px; padding: 5px 4px 6px; border: 1px solid rgba(255,255,255,.8); border-radius: 6px; background: rgba(255,255,255,.38); color: var(--muted); box-shadow: 0 8px 18px rgba(42,61,67,.06); cursor: pointer; overflow: hidden; transition: transform .18s ease, background .18s ease; }
.cameo-card img { width: 100%; aspect-ratio: 1; border-radius: 4px; object-fit: cover; }
.cameo-card span { display: block; min-height: 24px; padding: 5px 1px 0; font-size: 9px; line-height: 1.3; text-align: center; }
.interaction-dock { display: grid; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.interaction-title { margin: 0; color: var(--muted); font-family: "Songti SC", "Noto Serif SC", serif; font-size: 14px; line-height: 1.75; }
.cameo-note { min-height: 42px; margin: 0; padding: 9px 10px; border-left: 2px solid rgba(126,165,173,.55); background: rgba(255,255,255,.28); color: var(--blue); font-family: "Songti SC", "Noto Serif SC", serif; font-size: 12px; line-height: 1.65; }
.cameo-card.is-cameo-deliver { animation: cameo-deliver 1.05s cubic-bezier(.16,.84,.3,1) both; }
.cameo-card.is-cameo-listen { animation: cameo-listen 1.1s cubic-bezier(.24,.78,.3,1) both; }
.cameo-card.is-cameo-shy { animation: cameo-shy 1s cubic-bezier(.16,.84,.3,1) both; }
.cameo-card.is-cameo-sweet { animation: cameo-sweet 1.05s cubic-bezier(.16,.84,.3,1) both; }
.source { margin: 0; padding: 13px 14px; border-left: 2px solid var(--blue); background: rgba(255,255,255,.36); color: var(--muted); font-family: "Songti SC", "Noto Serif SC", serif; font-size: 14px; line-height: 1.8; }
.source b { display: block; margin-bottom: 4px; color: var(--ink); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.chapter-copy { display: grid; gap: 12px; padding-top: 15px; border-top: 1px solid var(--line); }
.chapter-copy p { margin: 0; color: #52656b; font-family: "Songti SC", "Noto Serif SC", serif; font-size: 17px; line-height: 2.02; }
.chapter-copy p:first-child::first-letter { color: var(--ink); font-size: 2.45em; line-height: .8; }
.next-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; padding-top: 14px; border-top: 1px solid var(--line); }
.next-row small { color: var(--muted); font-size: 11px; }
.next-button { min-height: 42px; padding: 0 14px; border: 1px solid var(--ink); border-radius: 4px; background: var(--ink); color: #f6fbfb; cursor: pointer; font-size: 12px; letter-spacing: .06em; }
.last-message { margin: 20px 0 0; padding: 19px 16px; border: 1px solid rgba(126,165,173,.38); border-radius: 7px; background: rgba(255,255,255,.46); box-shadow: var(--shadow); }
.last-message p { margin: 0; color: var(--ink); font-family: "Songti SC", "Noto Serif SC", serif; font-size: 17px; line-height: 2; }
.last-message p + p { margin-top: 12px; color: var(--muted); }
.site-footer { display: flex; justify-content: space-between; gap: 16px; padding: 16px 0 5px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; line-height: 1.6; }

.privacy .reader, .privacy .cover { filter: blur(5px) saturate(.65); }
.privacy::after { content: "雾面保护已开启"; position: fixed; right: 18px; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 8; padding: 8px 10px; border-radius: 4px; background: rgba(37,52,59,.9); color: white; font-size: 11px; }
@keyframes fade-up { from { opacity: 0; transform: translateY(12px); filter: blur(5px); } to { opacity: 1; transform: translateY(0); filter: blur(0); } }
@keyframes chapter-in { from { opacity: 0; transform: translateX(14px); filter: blur(5px); } to { opacity: 1; transform: translateX(0); filter: blur(0); } }
@keyframes dodge-right { 0%,100% { transform: translate(0,0) rotate(0); } 24% { transform: translate(32px,-8px) rotate(5deg); } 55% { transform: translate(62px,5px) rotate(8deg); } 76% { transform: translate(28px,-3px) rotate(2deg); } }
@keyframes dodge-left { 0%,100% { transform: translate(0,0) rotate(0); } 24% { transform: translate(-32px,-8px) rotate(-5deg); } 55% { transform: translate(-62px,5px) rotate(-8deg); } 76% { transform: translate(-28px,-3px) rotate(-2deg); } }
@keyframes hug { 0%,100% { transform: translate(0,0) rotate(0); } 25% { transform: translate(-14px,-10px) rotate(-4deg); } 52% { transform: translate(10px,-15px) rotate(4deg); } 74% { transform: translate(5px,3px) rotate(1deg); } }
@keyframes cameo-deliver { 0%,100% { transform: translate(0,0) rotate(0); } 22% { transform: translate(-12px,5px) rotate(-4deg); } 53% { transform: translate(17px,-13px) rotate(6deg); } 76% { transform: translate(8px,-3px) rotate(2deg); } }
@keyframes cameo-listen { 0%,100% { transform: translate(0,0) rotate(0); } 24% { transform: translate(-5px,-8px) rotate(-3deg); } 48% { transform: translate(7px,-11px) rotate(3deg); } 72% { transform: translate(-3px,-4px) rotate(-1deg); } }
@keyframes cameo-shy { 0%,100% { transform: translate(0,0) rotate(0); } 25% { transform: translate(-24px,4px) rotate(-7deg); } 50% { transform: translate(-32px,-7px) rotate(-9deg); } 72% { transform: translate(-9px,-3px) rotate(-2deg); } }
@keyframes cameo-sweet { 0%,100% { transform: translate(0,0) rotate(0); } 22% { transform: translate(7px,-13px) rotate(4deg); } 50% { transform: translate(-7px,-18px) rotate(-4deg); } 76% { transform: translate(4px,-5px) rotate(2deg); } }
@media (min-width: 680px) { .page-shell { padding-left: 34px; padding-right: 34px; } .chapter-nav { margin-left: -34px; margin-right: -34px; padding-left: 34px; padding-right: 34px; } }
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }
