:root { color-scheme: dark; font-family: "Microsoft YaHei", "PingFang SC", sans-serif; color: #f5f3f0; background: #152641; --amber: #e9c297; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; height: 100dvh; overflow: hidden; }
button, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, textarea:focus-visible { outline: 2px solid #f3d3ae; outline-offset: 5px; }
[hidden] { display: none !important; }
.landscape, .atmosphere, #snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.landscape { overflow: hidden; }
.landscape picture { display: block; width: 100%; height: 100%; }
.landscape img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 60% 55%; transform: scale(1.025) translate(var(--pan-x, 0px), var(--pan-y, 0px)); transition: transform 1.8s ease-out; }
.atmosphere { background: linear-gradient(180deg, rgba(9,18,35,.23), transparent 43%, transparent 66%, rgba(8,17,34,.52)), linear-gradient(90deg, rgba(15,22,40,.1), transparent 25%, transparent 75%, rgba(15,22,40,.1)); }
#snow { z-index: 2; }
.masthead { position: absolute; z-index: 3; inset: max(30px, env(safe-area-inset-top)) 48px auto; display: flex; justify-content: space-between; align-items: center; }
.wordmark { display: inline-flex; align-items: center; gap: 13px; color: inherit; text-decoration: none; font: 400 21px Georgia, serif; letter-spacing: 4px; }
.wordmark svg { width: 28px; height: 28px; }
.wordmark-dot { color: var(--amber); }
.masthead-caption { font-size: 11px; letter-spacing: 4px; color: #e2e5edb0; }
.poem { position: absolute; z-index: 3; top: 19.5%; left: 0; width: 100%; text-align: center; pointer-events: none; animation: arrive 1.8s ease both; }
.eyebrow { margin: 0 0 22px; font: 400 10px Georgia, serif; letter-spacing: 5px; color: #e7e9f1b8; }
h1 { font-family: "Songti SC", "STSong", "SimSun", serif; font-weight: 400; font-size: clamp(32px, 3.2vw, 53px); letter-spacing: .15em; line-height: 1.5; margin: 0 0 17px; text-shadow: 0 3px 25px #101e3566; }
h1 span { margin-left: -.1em; color: #f4dec3; }
.intro { margin: 0; font-size: 12px; letter-spacing: 4px; color: #e8eaf1ce; }
.poem-divider { display: block; width: 1px; height: 30px; background: linear-gradient(#e9e4d580, transparent); margin: 25px auto 0; }
.keepsake { position: absolute; z-index: 3; left: 50%; bottom: 210px; transform: translateX(-50%); max-width: min(75vw, 660px); margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; text-align: center; font: 16px/1.9 "Songti SC", "SimSun", serif; letter-spacing: 2px; text-shadow: 0 2px 14px #050d21; color: #fff1df; }
.footer { position: absolute; z-index: 4; bottom: max(25px, env(safe-area-inset-bottom)); left: 0; width: 100%; display: flex; flex-direction: column; align-items: center; }
.scene-caption { display: flex; align-items: center; gap: 10px; font-family: "Songti SC", "SimSun", serif; font-size: 13px; letter-spacing: 3px; color: #f0e5d5dc; margin: 0 0 22px; }
.warm-dot { width: 4px; height: 4px; border-radius: 50%; background: #f4cf96; box-shadow: 0 0 10px #e5ab5e; }
.controls { position: relative; display: flex; align-items: center; gap: 7px; padding: 6px 10px; border: 1px solid #dce4f126; border-radius: 40px; background: #111c2f77; box-shadow: 0 6px 25px #0710201a; backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.controls button { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 40px; padding: 0 14px; border: 0; border-radius: 28px; background: transparent; color: #e7eaf2d9; font-size: 12px; letter-spacing: 1px; white-space: nowrap; transition: background .2s, color .2s; }
.controls button:hover { background: #edf0ff0e; color: #fff; }
.controls button[aria-pressed="true"] { color: #ffe0b9; }
svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.controls .chevron { width: 12px; height: 12px; margin-left: 2px; transition: transform .2s; }
button[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.control-divider { width: 1px; height: 17px; background: #dce4f129; }
.controls .icon-button { width: 40px; padding: 0; }
.signature { margin: 17px 0 0; color: #e1e6ef78; font-size: 9px; letter-spacing: 1.8px; }
.signature span { padding: 0 6px; }
.snow-menu { position: absolute; bottom: calc(100% + 14px); left: 0; width: 245px; padding: 20px; border: 1px solid #e5eaff26; border-radius: 18px; background: #17243bf2; box-shadow: 0 10px 40px #060e214d; }
.snow-menu p { margin: 0 0 15px; font: 14px "Songti SC", "SimSun", serif; letter-spacing: 2px; color: #e7eaf2b3; }
.snow-options { display: flex; gap: 7px; }
.snow-options button { min-height: 36px; padding: 0 12px; border: 1px solid #dce4f129; font-size: 11px; }
.snow-options button[aria-pressed="true"] { border-color: #e9c29766; background: #e9c2970f; }
.sound-wave { display: none; }
#sound-button[aria-pressed="true"] .sound-wave { display: block; }
#sound-button[aria-pressed="true"] .sound-off { display: none; }
dialog { position: fixed; width: min(440px, calc(100vw - 38px)); padding: 35px; border: 1px solid #e7eaf133; border-radius: 22px; background: #14223cf5; color: #f2f0ef; box-shadow: 0 15px 80px #040b204d; }
dialog::backdrop { background: #050c1f80; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.dialog-close { position: absolute; top: 15px; right: 15px; display: grid; place-items: center; width: 30px; height: 30px; border: 0; background: transparent; color: #ced4e0; }
dialog .eyebrow { font-size: 8px; letter-spacing: 2px; margin: 9px 0 20px; }
h2 { margin: 0 0 25px; font: 400 24px/1.6 "Songti SC", "SimSun", serif; letter-spacing: 2px; }
textarea { width: 100%; padding: 15px; line-height: 1.9; font-size: 14px; color: #f9e9d7; background: #ffffff05; border: 1px solid #dae2f129; border-radius: 10px; resize: none; }
textarea::placeholder { color: #b8c2d279; font-size: 12px; }
.note-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 11px; color: #adb9ce; font-size: 10px; }
.note-actions { display: flex; justify-content: space-between; margin-top: 26px; gap: 14px; }
.note-actions button { border: 0; border-radius: 25px; padding: 11px 16px; background: transparent; color: #c3ccdc; font-size: 12px; }
.note-actions .save-note { background: #efd6b9; color: #293449; }
.save-note span { padding-left: 10px; }
.toast { position: fixed; z-index: 6; bottom: 185px; left: 50%; transform: translateX(-50%); max-width: 85vw; padding: 12px 20px; border: 1px solid #dce4f126; border-radius: 25px; background: #14223cf5; text-align: center; color: #f5e8d9; font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.noscript-note { position: fixed; top: 70px; width: 100%; text-align: center; font-size: 12px; }
@keyframes arrive { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 600px) {
  .masthead { inset: max(25px, env(safe-area-inset-top)) 24px auto; }
  .wordmark { font-size: 18px; gap: 9px; letter-spacing: 3px; }
  .wordmark svg { width: 25px; height: 25px; }
  .masthead-caption { font-size: 9px; letter-spacing: 2px; }
  .poem { top: 20%; }
  .eyebrow { font-size: 8px; letter-spacing: 3px; margin-bottom: 19px; }
  h1 { font-size: clamp(27px, 7.4vw, 36px); letter-spacing: .1em; margin-bottom: 14px; }
  .intro { font-size: 10px; letter-spacing: 2px; }
  .poem-divider { height: 24px; margin-top: 20px; }
  .scene-caption { font-size: 11px; letter-spacing: 2px; margin-bottom: 18px; }
  .controls { gap: 2px; padding: 5px 7px; }
  .controls button { font-size: 10px; gap: 6px; padding: 0 9px; min-height: 38px; letter-spacing: 0; }
  .controls svg { width: 17px; height: 17px; }
  .controls .chevron { width: 10px; margin-left: 0; }
  .controls .icon-button { width: 30px; }
  .signature { font-size: 8px; letter-spacing: 1.1px; margin-top: 18px; }
  .keepsake { bottom: 188px; font-size: 13px; max-height: 105px; overflow: auto; }
  dialog { padding: 30px 24px; }
  h2 { font-size: 22px; }
}
@media (max-aspect-ratio: 4/5) { .landscape img { object-position: 50% 55%; } }
@media (max-height: 520px) and (min-aspect-ratio: 4/5) {
  .masthead { top: 18px; }
  .poem { top: 18%; }
  .eyebrow { margin-bottom: 8px; }
  h1 { font-size: 28px; margin-bottom: 8px; }
  .poem-divider { display: none; }
  .footer { bottom: 13px; }
  .scene-caption { display: none; }
  .signature { margin-top: 8px; }
  .keepsake { bottom: 95px; font-size: 12px; max-height: 55px; overflow: auto; }
  dialog { padding: 20px 25px; }
  dialog .eyebrow { display: none; }
  h2 { font-size: 20px; margin-bottom: 12px; }
  textarea { height: 85px; }
  .note-actions { margin-top: 12px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .landscape img { transform: none; } }
