:root {
  color-scheme: light;
  --paper: #f1ede3;
  --ink: #243c31;
  --muted: #69736b;
  font-family: "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { min-height: 100vh; min-height: 100dvh; margin: 0; background: #dedfd8; color: var(--ink); }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid #375b45; outline-offset: 6px; }
.letter {
  width: min(100%, 440px);
  min-height: 956px;
  margin: 40px auto 0;
  padding: 31px 30px 0;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background-color: var(--paper);
  background-image:
    linear-gradient(180deg, var(--paper) 0%, #f1ede3e6 2.5%, transparent 9%, transparent 90%, #f1ede3e6 97%, var(--paper) 100%),
    linear-gradient(180deg, #f4f0e7df 0%, #f4f0e7cd 28%, #f4f0e7c2 64%, #f4f0e7cd 100%),
    url("/letter/assets/open-field-letter-bg.jpg");
  background-size: cover;
  background-position: center top;
  box-shadow: 0 12px 60px #22372a0b;
}
.masthead { display: flex; align-items: center; justify-content: space-between; padding-bottom: 16px; border-bottom: 1px solid #344a352c; }
.brand { display: inline-flex; align-items: center; gap: 9px; border-radius: 999px; font-family: "Songti SC", "STSong", serif; font-size: 14px; font-weight: 700; letter-spacing: .02em; }
.brand img { display: block; width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #f3eee2; box-shadow: 0 0 0 1px #243c3124; mix-blend-mode: normal; }
.edition { font-size: 10px; letter-spacing: 1.25px; color: var(--muted); }
.letter-heading { margin: 27px 0 20px; }
.kicker { font-size: 12px; letter-spacing: 2px; margin: 0 0 13px; color: var(--muted); }
h1 { font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif; font-size: 32px; line-height: 1.45; letter-spacing: 2px; font-weight: 900; margin: 0; }
.letter-body { font-size: 16px; line-height: 1.76; font-weight: 400; color: #3e4b42; text-align: justify; overflow-wrap: break-word; }
.letter-body p { margin: 0 0 12px; }
.letter-body .salutation { margin-bottom: 8px; }
.marked { font-weight: 700; text-decoration-line: underline; text-decoration-style: wavy; text-decoration-thickness: 1px; text-decoration-color: #a96f47a8; text-underline-offset: 4px; }
.signoff { margin: 24px 0 0; }
.closing { margin: 0 0 20px; font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif; font-size: 19px; font-weight: 600; letter-spacing: .8px; }
.signature { padding-top: 27px; border-top: 1px solid #344a3522; }
.signature p { margin: 0; font-size: 12px; line-height: 1.8; font-weight: 500; letter-spacing: .3px; }
.signature p:first-child { color: var(--muted); }
.paper-space { height: 60px; flex-shrink: 0; }
.audio-dock { position: fixed; z-index: 20; right: max(16px, calc((100vw - 440px) / 2 + 16px)); bottom: max(64px, calc(env(safe-area-inset-bottom) + 60px)); display: flex; align-items: center; gap: 3px; height: 38px; padding: 4px 8px 4px 5px; border: 1px solid #37513f2d; border-radius: 999px; background: #f7f3e8e8; box-shadow: 0 7px 22px #1f332522; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.join-now { position: absolute; top: calc(100% + 8px); right: 0; left: 0; display: flex; align-items: center; justify-content: center; height: 36px; border-radius: 999px; color: #f7f3e8; background: #324d3b; font-size: 12px; font-weight: 700; letter-spacing: 1px; box-shadow: 0 7px 20px #1f332529; -webkit-tap-highlight-color: transparent; }
.join-now:active { transform: translateY(1px); }
.listen-hint { position: absolute; right: 5px; bottom: calc(100% + 10px); display: none; min-width: 84px; padding: 7px 12px; border: 1px solid #37513f26; border-radius: 999px; color: var(--ink); background: #f7f3e8f5; font-family: "Songti SC", "STSong", serif; font-size: 12px; font-weight: 600; letter-spacing: .5px; box-shadow: 0 6px 20px #1f33251c; cursor: pointer; }
.listen-hint::after { content: ""; position: absolute; right: 18px; top: 100%; width: 7px; height: 7px; border-right: 1px solid #37513f26; border-bottom: 1px solid #37513f26; background: #f7f3e8f5; transform: translateY(-4px) rotate(45deg); }
.show-listen-hint .listen-hint { display: block; animation: listen-hint-in .28s ease-out both; }
@keyframes listen-hint-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.audio-toggle { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; overflow: hidden; border: 0; border-radius: 50%; color: var(--ink); background: transparent; cursor: pointer; appearance: none; -webkit-appearance: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.audio-toggle:focus-visible, .audio-credit summary:focus-visible { outline: 2px solid #375b45; outline-offset: 3px; }
.audio-icon { position: relative; width: 27px; height: 27px; display: block; flex: 0 0 27px; border-radius: 50%; color: #f7f3e8; background: #324d3b; pointer-events: none; }
.audio-icon i { display: none; }
.audio-icon::before { content: ""; position: absolute; top: 8px; left: 10px; width: 0; height: 0; border-top: 5.5px solid transparent; border-bottom: 5.5px solid transparent; border-left: 8px solid currentColor; }
.audio-icon::after { content: none; }
.is-playing .audio-icon::before, .is-playing .audio-icon::after { content: ""; position: absolute; top: 8px; width: 3px; height: 11px; border: 0; border-radius: 1px; background: currentColor; }
.is-playing .audio-icon::before { left: 8px; }
.is-playing .audio-icon::after { right: 8px; }
.is-paused .audio-icon, .is-playing .audio-icon { opacity: 1; background: #324d3b; }
.audio-credit { position: relative; }
.audio-credit summary { display: grid; place-items: center; height: 28px; padding: 0 8px 0 5px; border-radius: 999px; color: var(--ink); font-family: "Songti SC", "STSong", serif; font-size: 12px; font-weight: 600; cursor: pointer; list-style: none; }
.audio-credit summary::-webkit-details-marker { display: none; }
.audio-credit p { position: absolute; right: -7px; bottom: 34px; width: 245px; margin: 0; padding: 10px 12px; border: 1px solid #37513f26; border-radius: 10px; background: #f7f3e8f5; color: #526057; font-size: 10px; line-height: 1.6; box-shadow: 0 8px 28px #1f332522; }
.audio-credit a { text-decoration: underline; text-underline-offset: 2px; }
.poster-mode body { background: var(--paper); }
.poster-mode .letter { margin: 0; width: 440px; height: 956px; min-height: 0; padding-top: 27px; display: flex; flex-direction: column; box-shadow: none; }
.poster-mode .letter-heading { margin-top: 21px; margin-bottom: 16px; }
.poster-mode h1 { font-size: 31px; line-height: 1.38; }
.poster-mode .letter-body { font-size: 14px; line-height: 1.7; }
.poster-mode .letter-body p { margin-bottom: 10px; }
.poster-mode .signoff { margin-top: 15px; }
.poster-mode .closing { margin-bottom: 13px; }
.poster-mode .signature { padding-top: 23px; }
.poster-mode .paper-space { height: 30px; }
.poster-mode .audio-dock { display: none; }
@media (max-width: 540px) {
  body { position: relative; background: var(--paper); }
  body::before { content: ""; position: fixed; z-index: 30; top: 0; right: 0; left: 0; height: env(safe-area-inset-top); background: var(--paper); pointer-events: none; }
  .letter { margin-top: 0; padding-top: calc(28px + env(safe-area-inset-top)); box-shadow: none; }
  .safari-browser body { padding-top: max(44px, env(safe-area-inset-top)); }
  .safari-browser .letter { padding-top: 28px; }
  .audio-dock { bottom: max(64px, calc(env(safe-area-inset-bottom) + 60px)); }
}
@media (max-width: 374px) {
  .letter { padding-left: 24px; padding-right: 24px; }
  h1 { font-size: 29px; letter-spacing: 1px; }
  .brand { gap: 7px; font-size: 13px; }
  .brand img { width: 36px; height: 36px; }
  .edition { font-size: 8px; letter-spacing: .45px; }
}
@media print {
  body { background: var(--paper); }
  .letter { margin: 0 auto; box-shadow: none; }
  .audio-dock { display: none; }
}
