/* Layout: a top bar switching two worlds — a phone-framed customer mailbox, and a three-column writing desk. Single paper-light look by choice. */
:root {
  --paper: #f6efe4;
  --raised: #fffaf2;
  --mailbox: #e3d5bf;
  --ink: #3b2a22;
  --muted: #76604f;
  --line: #d9cbb6;
  --seal: #9b3a3a;
  --seal-soft: #ecd6cf;
  --dusk: #2f3552;
  --moon: #e9d7a8;
  --ok: #3f6b4e;
  --warn: #8f5413;
  --warn-soft: #f3e3cc;
  --serif: 'Songti SC', 'STSong', 'Noto Serif SC', 'Source Han Serif SC', 'SimSun', serif;
  --sans:
    'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', system-ui, sans-serif;
  --r-sm: 4px;
  --r-md: 10px;
  --r-pill: 999px;
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
:focus-visible {
  outline: 2px solid var(--dusk);
  outline-offset: 2px;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: var(--raised);
  border-bottom: 1px solid var(--line);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
}
body::before {
  content: '';
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 30;
  background: var(--raised);
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
}
.brand img {
  width: 26px;
  height: 26px;
}
.brand small {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 0 8px;
}
.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 2px;
  background: var(--paper);
}
.seg button {
  border: 0;
  background: transparent;
  padding: 5px 14px;
  border-radius: var(--r-pill);
  font-size: 14px;
  color: var(--muted);
  white-space: nowrap;
}
.seg button[aria-pressed='true'] {
  background: var(--ink);
  color: var(--raised);
}
.clock {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}
.clock b {
  color: var(--dusk);
  font-variant-numeric: tabular-nums;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--raised);
  color: var(--ink);
  font-size: 14px;
  white-space: nowrap;
}
.btn:hover {
  border-color: var(--muted);
}
.btn.primary {
  background: var(--seal);
  border-color: var(--seal);
  color: #fffaf2;
}
.btn.primary:hover {
  filter: brightness(1.08);
}
.btn.primary[disabled] {
  background: #c9b5aa;
  border-color: #c9b5aa;
  cursor: not-allowed;
  filter: none;
}
.btn.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--seal);
}
.btn.ghost:hover {
  background: var(--seal-soft);
}
.btn.sm {
  min-height: 28px;
  padding: 0 10px;
  font-size: 13px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--r-pill);
  font-size: 12px;
  white-space: nowrap;
  line-height: 1;
}
.pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.pill.done {
  color: var(--ok);
  background: var(--raised);
  border: 1px solid var(--line);
}
.pill.sched {
  background: var(--dusk);
  color: var(--moon);
}
.pill.new {
  background: var(--seal-soft);
  color: var(--seal);
}
.pill.check {
  color: var(--warn);
  background: var(--warn-soft);
}
.pill.now {
  background: var(--seal);
  color: #fffaf2;
}

/* ---------- envelope (one shape everywhere) ---------- */
.s1 {
  --envc: #ece2d1;
  --envtex: url(/assets/sets/1-yuebai/envelope-texture.webp);
  --lin: url(/assets/sets/1-yuebai/envelope-lining.webp);
  --sealimg: url(/assets/sets/1-yuebai/seal.webp);
  --stampimg: url(/assets/sets/1-yuebai/stamp.webp);
  --ptex: url(/assets/sets/1-yuebai/paper-texture.webp);
  --pc: #fbf4e7;
  --shade: rgba(59, 42, 34, 0.08);
}
.s2 {
  --envc: #e8c9bf;
  --envtex: url(/assets/sets/2-qiangwei/envelope-texture.webp);
  --lin: url(/assets/sets/2-qiangwei/envelope-lining.webp);
  --sealimg: url(/assets/sets/2-qiangwei/seal.webp);
  --stampimg: url(/assets/sets/2-qiangwei/stamp.webp);
  --ptex: url(/assets/sets/2-qiangwei/paper-texture.webp);
  --pc: #fdf2ec;
  --shade: rgba(59, 42, 34, 0.08);
}
.s3 {
  --envc: #373f58;
  --envtex: url(/assets/sets/3-yehang/envelope-texture.webp);
  --lin: url(/assets/sets/3-yehang/envelope-lining.webp);
  --sealimg: url(/assets/sets/3-yehang/seal.webp);
  --stampimg: url(/assets/sets/3-yehang/stamp.webp);
  --ptex: url(/assets/sets/3-yehang/paper-texture.webp);
  --pc: #efecf2;
  --shade: rgba(0, 0, 0, 0.22);
}
.s4 {
  --envc: #c4c9b2;
  --envtex: url(/assets/sets/4-qingtai/envelope-texture.webp);
  --lin: url(/assets/sets/4-qingtai/envelope-lining.webp);
  --sealimg: url(/assets/sets/4-qingtai/seal.webp);
  --stampimg: url(/assets/sets/4-qingtai/stamp.webp);
  --ptex: url(/assets/sets/4-qingtai/paper-texture.webp);
  --pc: #f7f4e9;
  --shade: rgba(59, 42, 34, 0.08);
}
.env {
  position: relative;
  width: var(--w, 160px);
  max-width: 100%;
  aspect-ratio: 3/2;
  perspective: 900px;
  filter: drop-shadow(0 1px 1px rgba(59, 42, 34, 0.16))
    drop-shadow(0 6px 12px rgba(59, 42, 34, 0.12));
}
.env > * {
  position: absolute;
}
.env-back {
  inset: 0;
  border-radius: 4px;
  background: var(--envc) var(--lin) 0 0/128px;
  z-index: 0;
}
.env-paper {
  left: 6%;
  right: 6%;
  top: 6%;
  height: 88%;
  border-radius: 2px;
  background: var(--pc) var(--ptex) 0 0/256px;
  z-index: 1;
  transition: transform 0.7s cubic-bezier(0.3, 0.7, 0.3, 1) 0.75s;
}
.env-paper::before,
.env-paper::after {
  content: '';
  position: absolute;
  left: 14%;
  right: 14%;
  height: 3px;
  border-radius: 2px;
  background: rgba(59, 42, 34, 0.12);
}
.env-paper::before {
  top: 22%;
}
.env-paper::after {
  top: 34%;
  right: 30%;
}
.env-front {
  inset: 0;
  border-radius: 4px;
  background: var(--envc) var(--envtex) 0 0/256px;
  clip-path: polygon(0 0, 50% 56%, 100% 0, 100% 100%, 0 100%);
  z-index: 2;
}
.env-flap {
  left: 0;
  right: 0;
  top: 0;
  height: 56%;
  transform-origin: 50% 0;
  transform-style: preserve-3d;
  z-index: 3;
  transition:
    transform 0.6s ease 0.2s,
    z-index 0s 0.5s;
}
.env-flap i {
  position: absolute;
  inset: 0;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.env-flap .out {
  background:
    linear-gradient(var(--shade), var(--shade)),
    var(--envc) var(--envtex) 0 0/256px;
  border-radius: 4px 4px 0 0;
}
.env-flap .in {
  background: var(--envc) var(--lin) 0 0/128px;
  transform: rotateX(180deg);
}
.env-seal {
  left: 50%;
  top: 56%;
  width: 20%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: var(--sealimg) center/contain no-repeat;
  z-index: 4;
  transition:
    opacity 0.25s,
    transform 0.25s;
  filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.25));
}
.env-stamp {
  right: 7%;
  bottom: 10%;
  width: 13%;
  aspect-ratio: 9/11;
  background: var(--stampimg) center/contain no-repeat;
  z-index: 3;
}
.env.open .env-seal {
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.35);
}
.env.open .env-flap {
  transform: rotateX(180deg);
  z-index: 0;
}
.env.open .env-paper {
  transform: translateY(-58%);
}
.env .dot {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--seal);
  border: 2px solid var(--raised);
  z-index: 6;
}
.env.sched {
  opacity: 0.62;
  filter: saturate(0.75) drop-shadow(0 4px 8px rgba(59, 42, 34, 0.1));
}
.env.isnew {
  outline: 2px solid var(--seal);
  outline-offset: 4px;
  border-radius: 4px;
}
@media (prefers-reduced-motion: reduce) {
  .env-flap,
  .env-paper,
  .env-seal {
    transition: none;
  }
}

/* ---------- letter (customer reading view + admin preview) ---------- */
.letter {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 24px 24px;
  background: var(--pc, var(--raised)) var(--ptex) 0 0/256px;
  border-radius: 2px;
  box-shadow:
    0 1px 2px rgba(59, 42, 34, 0.12),
    0 10px 30px rgba(59, 42, 34, 0.1);
  font-family: var(--serif);
  color: var(--ink);
}
.letter .orn {
  display: block;
  width: calc(100% + 48px);
  max-width: none;
  margin: 0 -24px;
  height: auto;
}
.letter .orn.top {
  margin-bottom: -12%;
}
.letter .orn.bot {
  margin-top: 16px;
}
.l-date,
.l-from {
  margin: 0;
  font-size: 14px;
  line-height: 22px;
  color: var(--muted);
}
.l-from {
  margin-top: 14px;
  letter-spacing: 0.08em;
}
.l-title {
  margin: 6px 0 0;
  font-size: 22px;
  line-height: 32px;
  font-weight: 600;
  text-wrap: balance;
}
.l-body {
  margin: 22px 0 0;
  font-size: 17px;
  line-height: 32px;
  white-space: pre-wrap;
  word-break: break-word;
}
.l-body p {
  margin: 0;
  text-indent: 2em;
}
.l-body p.blank {
  height: 16px;
}

/* ---------- customer side ---------- */
.cust {
  padding-block: 24px 40px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.cust-note {
  max-width: 420px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
.phone {
  position: relative;
  width: 100%;
  max-width: 400px;
  height: min(820px, calc(100vh - 150px));
  min-height: 620px;
  border-radius: 30px;
  overflow: hidden;
  background: var(--paper);
  box-shadow:
    0 0 0 10px #2b2420,
    0 0 0 11px #4a3f38,
    0 24px 60px rgba(43, 36, 32, 0.35);
}
.screen {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}
.home {
  background: #e9e3df url(/assets/shared/home-bg-mobile.webp) center top/cover;
}
.home-inner {
  position: absolute;
  left: 24px;
  right: 24px;
  top: 26%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.home h1 {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: 0.04em;
}
.code-row {
  display: flex;
  gap: 8px;
  background: rgba(255, 250, 242, 0.9);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 2px 10px rgba(47, 53, 82, 0.12);
}
.code-row input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  font-size: 16px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.code-row input::placeholder {
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}
.code-row input:focus {
  outline: none;
}
.code-row:focus-within {
  box-shadow: 0 0 0 2px var(--dusk);
}
.hint {
  font-size: 12px;
  color: var(--ink);
  background: rgba(255, 250, 242, 0.75);
  border-radius: 8px;
  padding: 6px 10px;
  align-self: flex-start;
}
.hint button {
  border: 0;
  background: none;
  padding: 0 2px;
  color: var(--seal);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 12px;
}
.home-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-family: var(--serif);
  font-size: 14px;
  color: var(--muted);
}
.home-foot img {
  width: 22px;
  height: 22px;
}
.mbox {
  background: var(--mailbox) url(/assets/shared/mailbox-texture.webp) 0 0/256px;
  min-height: 100%;
}
.mb-head {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 16px 18px 12px;
  background: linear-gradient(var(--mailbox) 70%, rgba(227, 213, 191, 0));
  display: flex;
  align-items: center;
  gap: 10px;
}
.iconbtn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--raised);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex: none;
}
.mb-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mb-note {
  margin: 0 18px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 250, 242, 0.82);
  border-radius: 12px;
  padding: 10px 12px;
}
.mb-note img {
  width: 40px;
  height: 40px;
  flex: none;
}
.mb-note div {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--muted);
}
.mb-note b {
  display: block;
  color: var(--ink);
  font-size: 14px;
}
.mb-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 16px;
  padding: 6px 18px 28px;
}
.mb-cell {
  border: 0;
  background: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}
.mb-cell .env {
  --w: 100%;
}
.mb-cell span {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.empty {
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
.empty img {
  width: 220px;
  max-width: 80%;
  display: block;
  margin: 0 auto 6px;
}
.open-scr {
  background: var(--mailbox) url(/assets/shared/mailbox-texture.webp) 0 0/256px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 24px;
}
.open-scr .env {
  --w: 300px;
}
.open-scr .seal-hit {
  position: absolute;
  left: 50%;
  top: 56%;
  width: 28%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 0;
  background: transparent;
  z-index: 8;
}
.open-cap {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--muted);
  transition: opacity 0.3s;
}
.letter-scr {
  background: var(--mailbox) url(/assets/shared/mailbox-texture.webp) 0 0/256px;
  padding: 18px 14px 28px;
}
.letter-scr .letter {
  animation: rise 0.6s ease both;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .letter-scr .letter {
    animation: none;
  }
}
.l-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.nf {
  background: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
}
.nf img {
  width: 260px;
  max-width: 85%;
}
.nf p {
  margin: 0;
  font-family: var(--serif);
  font-size: 16px;
}
.sheet {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: rgba(43, 36, 32, 0.42);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 14px;
}
.note-card {
  position: relative;
  width: 100%;
  max-width: 372px;
  aspect-ratio: 4/3;
  background: url(/assets/shared/note-paper.webp) center/100% 100% no-repeat;
  transition:
    transform 0.7s ease,
    opacity 0.7s ease;
}
.note-card textarea {
  position: absolute;
  left: 15%;
  right: 13%;
  top: 20%;
  bottom: 18%;
  border: 0;
  background: transparent;
  resize: none;
  font-family: var(--serif);
  font-size: 16px;
  line-height: 24px;
  color: var(--ink);
  padding: 0;
}
.note-card textarea:focus {
  outline: none;
}
.note-card .cnt {
  position: absolute;
  right: 14%;
  bottom: 9%;
  font-size: 11px;
  color: var(--muted);
}
.notepaper.fly {
  transform: translate(40%, -130%) rotate(18deg) scale(0.4);
  opacity: 0;
  transition:
    transform 0.7s ease,
    opacity 0.7s ease;
}
.note-card.fly {
  transform: translate(40%, -130%) rotate(18deg) scale(0.4);
  opacity: 0;
}
.sheet-box {
  width: 100%;
  max-width: 372px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sheet-msg {
  background: var(--raised);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--muted);
}
.sheet-msg b {
  color: var(--ink);
}
.sheet-btns {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.toast {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 50;
  background: var(--ink);
  color: var(--raised);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 14px;
  white-space: nowrap;
  max-width: 90%;
}

/* ---------- 3D moments ---------- */
.night3d {
  background:
    radial-gradient(
      ellipse 80% 46% at 50% 56%,
      rgba(255, 206, 150, 0.3),
      rgba(255, 206, 150, 0) 70%
    ),
    linear-gradient(180deg, #1d2140 0%, #2f3552 48%, #4a3f4f 100%);
}
.c3d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: manipulation;
}
.o3-top {
  position: absolute;
  left: 0;
  right: 0;
  top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  pointer-events: none;
  color: rgba(255, 244, 226, 0.75);
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 15px;
}
.o3-top button {
  pointer-events: auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 250, 242, 0.4);
  background: rgba(255, 250, 242, 0.12);
  color: #fff4e2;
  font-size: 18px;
}
.o3-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 56px;
  margin: 0;
  text-align: center;
  pointer-events: none;
  transition: opacity 0.5s;
}
.o3-hint b {
  display: block;
  font-family: 'Long Cang', 'Kaiti SC', cursive;
  font-weight: 400;
  font-size: 24px;
  color: #f3dca8;
}
.o3-hint span {
  font-family: 'ZCOOL XiaoWei', var(--serif);
  font-size: 14px;
  letter-spacing: 0.24em;
  color: rgba(255, 244, 226, 0.62);
}
.fly3d {
  position: absolute;
  inset: 0;
  z-index: 45;
}
.arr3d {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 30;
  pointer-events: none;
}
.mb-cell.arr {
  visibility: hidden;
}
.mb-cell.landed {
  animation: landin 0.5s ease both;
}
@keyframes landin {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- admin ---------- */
.adm {
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 16px 96px;
}
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  overflow-x: auto;
}
.tabs button {
  border: 0;
  background: none;
  padding: 8px 14px;
  font-size: 15px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tabs button[aria-selected='true'] {
  color: var(--ink);
  border-bottom-color: var(--seal);
  font-weight: 600;
}
.badge {
  display: inline-block;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--seal);
  color: #fffaf2;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  margin-left: 4px;
  font-weight: 600;
}
.desk {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 380px;
  gap: 16px;
  align-items: start;
}
@media (max-width: 1180px) {
  .desk {
    grid-template-columns: 250px minmax(0, 1fr);
  }
  .desk .pv {
    grid-column: 1/-1;
  }
}
@media (max-width: 760px) {
  .desk {
    grid-template-columns: minmax(0, 1fr);
  }
}
.card {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  min-width: 0;
}
.card-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.card-h b {
  color: var(--ink);
  font-size: 14px;
}
.card-b {
  padding: 14px;
}
.bl-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 2px 10px;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}
.bl-item:last-child {
  border-bottom: 0;
}
.bl-item[aria-current='true'] {
  background: var(--seal-soft);
}
.bl-num {
  grid-row: span 2;
  align-self: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper);
  font-size: 12px;
  line-height: 22px;
  text-align: center;
  color: var(--muted);
}
.bl-who {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  min-width: 0;
}
.bl-who span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bl-line {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.paste textarea {
  width: 100%;
  min-height: 210px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper);
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
}
.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.row.between {
  justify-content: space-between;
}
.chk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.field > label,
.flabel {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.field input[type='text'],
.field textarea,
.field select,
.field input[type='datetime-local'] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper);
  padding: 8px 10px;
  font-size: 15px;
}
.field textarea {
  min-height: 170px;
  line-height: 1.7;
  resize: vertical;
  font-family: var(--serif);
  font-size: 16px;
}
.field .sub {
  font-size: 12px;
  color: var(--muted);
}
.rec-ok {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper);
}
.rec-ok b {
  font-size: 15px;
}
.rec-ok small {
  color: var(--muted);
}
.match {
  border: 1px solid var(--warn);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--paper);
}
.match-h {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--warn);
  background: var(--warn-soft);
}
.match-h b {
  color: var(--ink);
}
.m-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 2px 10px;
  align-items: center;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  text-align: left;
}
.m-row:hover {
  background: var(--raised);
}
.m-radio {
  width: 16px;
  height: 16px;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
}
.m-name {
  font-size: 15px;
}
.m-name mark {
  background: none;
  color: var(--seal);
  font-weight: 600;
}
.m-meta {
  grid-column: 2;
  font-size: 12px;
  color: var(--muted);
}
.m-via {
  grid-row: 1;
  grid-column: 3;
  font-size: 12px;
  color: var(--muted);
}
.m-other {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}
.m-other select,
.m-other input {
  flex: 1;
  min-width: 120px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--raised);
  padding: 6px 8px;
  font-size: 14px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--paper);
  font-size: 13px;
}
.chip:hover {
  border-color: var(--muted);
}
.chip[aria-pressed='true'] {
  background: var(--dusk);
  border-color: var(--dusk);
  color: var(--moon);
}
.chip.now[aria-pressed='true'] {
  background: var(--seal);
  border-color: var(--seal);
  color: #fffaf2;
}
.when {
  font-size: 13px;
  color: var(--muted);
}
.when b {
  color: var(--dusk);
}
.pv-tabs {
  display: flex;
  gap: 6px;
  align-items: center;
}
.pv-stage {
  background: var(--mailbox) url(/assets/shared/mailbox-texture.webp) 0 0/256px;
  padding: 16px;
  border-radius: 0 0 var(--r-md) var(--r-md);
  min-height: 420px;
}
.pv-stage .letter {
  max-width: 100%;
}
.pv-cap {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 10px;
}
.pv-counts {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.pv-counts b {
  color: var(--ink);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.pv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 16px 12px;
}
.pv-grid .cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.pv-grid .env {
  --w: 100%;
}
.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 15;
  background: var(--raised);
  border-top: 1px solid var(--line);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-top: 10px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  flex-wrap: wrap;
}
.dock .sum {
  font-size: 13px;
  color: var(--muted);
  margin-right: auto;
}
.dock .sum b {
  color: var(--ink);
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(43, 36, 32, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal .card {
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 32px);
  overflow: auto;
}
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.tbl th {
  text-align: left;
  font-weight: 400;
  font-size: 12px;
  color: var(--muted);
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
}
.tbl td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.tbl td.num {
  font-variant-numeric: tabular-nums;
}
.scroll-x {
  overflow-x: auto;
}
.notice {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper);
  margin-bottom: 12px;
  overflow: hidden;
}
.notice pre {
  margin: 0;
  padding: 12px 14px;
  white-space: pre-wrap;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.7;
}
.notice .card-h {
  background: var(--raised);
}
.cl-wrap {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 820px) {
  .cl-wrap {
    grid-template-columns: minmax(0, 1fr);
  }
}
.cl-search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper);
  padding: 8px 10px;
}
.cl-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  text-align: left;
}
.cl-item[aria-current='true'] {
  background: var(--seal-soft);
}
.cl-item small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.ed {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 10px 14px;
  align-items: center;
  font-size: 15px;
}
.ed .k {
  font-size: 12px;
  color: var(--muted);
}
.ed .v {
  min-height: 32px;
  padding: 4px 8px;
  margin: 0 -8px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  cursor: text;
}
.ed .v:hover {
  border-color: var(--line);
  background: var(--paper);
}
.ed .v[contenteditable='true'] {
  border-color: var(--dusk);
  background: var(--paper);
  outline: none;
}
.ed .hintline {
  grid-column: 2;
  font-size: 12px;
  color: var(--muted);
  margin-top: -6px;
}
.stepper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.stepper b {
  min-width: 24px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.swatch {
  display: inline-block;
  width: 14px;
  height: 10px;
  border-radius: 2px;
  background: var(--envc);
  vertical-align: middle;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}
.nt {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 16px;
  padding: 14px;
  border-top: 1px solid var(--line);
}
.nt:first-child {
  border-top: 0;
}
.nt q {
  font-family: var(--serif);
  font-size: 16px;
  quotes: '「' '」';
}
.nt small {
  color: var(--muted);
  font-size: 12px;
}
.muted {
  color: var(--muted);
}
.mt8 {
  margin-top: 8px;
}
.mt16 {
  margin-top: 16px;
}
.gap {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* ================= v2 skin — "暮色信笺" (matches the design canvas) ================= */
:root {
  --display: 'ZCOOL XiaoWei', 'Songti SC', 'STSong', serif;
  --hand: 'Long Cang', 'Kaiti SC', 'STKaiti', 'KaiTi', cursive;
  --letter: 'Noto Serif SC', 'Songti SC', 'STSong', serif;
  --num: 'Cormorant Garamond', 'Songti SC', serif;
  --gold: #c9a35f;
  --seal-deep: #7e2c2f;
}
.t-display {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: 0.06em;
}
.t-hand {
  font-family: var(--hand);
  font-weight: 400;
}
.t-num {
  font-family: var(--num);
  font-style: italic;
  letter-spacing: 0.02em;
}
.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gold);
  font-size: 13px;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(201, 163, 95, 0),
    rgba(201, 163, 95, 0.7),
    rgba(201, 163, 95, 0)
  );
}
.night {
  background:
    radial-gradient(
      ellipse 70% 42% at 50% 54%,
      rgba(255, 206, 150, 0.34),
      rgba(255, 206, 150, 0) 70%
    ),
    linear-gradient(180deg, #1f2340 0%, #2f3552 46%, #4a3f4f 100%);
  color: #f6ead2;
}
.desk-scene {
  background:
    url(/assets/shared/home-bg-mobile.webp) center -40px/100% auto no-repeat,
    #e3d5bf url(/assets/shared/mailbox-texture.webp) 0 0/256px;
}
.desk-scene::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 150px;
  bottom: 0;
  min-height: calc(100% - 150px);
  background:
    linear-gradient(rgba(227, 213, 191, 0), #e3d5bf 190px) 0 0/100% 240px no-repeat,
    linear-gradient(#e3d5bf, #e3d5bf) 0 240px/100% 100% no-repeat;
  pointer-events: none;
}
.desk-scene {
  background-attachment: local;
}
.desk-scene::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 390px;
  bottom: 0;
  background: url(/assets/shared/mailbox-texture.webp) 0 0/256px;
  opacity: 0.9;
  pointer-events: none;
}
.desk-scene > *,
.night > * {
  position: relative;
}
.desk-scene > * {
  z-index: 1;
}
.desk-scene::before,
.desk-scene::after {
  z-index: 0;
}
.stars {
  position: absolute !important;
  left: 0;
  right: 0;
  top: 0;
  height: var(--sh, 100%);
  pointer-events: none;
  overflow: hidden;
}
.stars::before,
.stars::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #fff6dc;
}
.stars::before {
  box-shadow:
    34px 52px #fff6dc,
    92px 118px rgba(255, 246, 220, 0.7),
    150px 40px #fff6dc,
    214px 96px rgba(255, 246, 220, 0.6),
    268px 30px #fff6dc,
    330px 84px rgba(255, 246, 220, 0.8),
    58px 196px rgba(255, 246, 220, 0.5),
    180px 170px #fff6dc,
    300px 210px rgba(255, 246, 220, 0.6),
    366px 150px #fff6dc,
    120px 260px rgba(255, 246, 220, 0.45),
    240px 280px rgba(255, 246, 220, 0.5);
  animation: twinkle 3.6s ease-in-out infinite;
}
.stars::after {
  width: 3px;
  height: 3px;
  box-shadow:
    70px 80px #ffe9b8,
    250px 60px #ffe9b8,
    350px 190px #ffe9b8,
    140px 220px rgba(255, 233, 184, 0.8),
    20px 140px #ffe9b8;
  animation: twinkle 4.8s ease-in-out 1.2s infinite;
}
@keyframes twinkle {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}
.frost {
  background: rgba(255, 250, 242, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 8px 24px rgba(47, 53, 82, 0.14);
}
.rise {
  animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: var(--d, 0s);
}
.float {
  animation: float 5s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(var(--r, 0deg));
  }
  50% {
    transform: translateY(-7px) rotate(var(--r, 0deg));
  }
}
.petal {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 7px;
  border-radius: 100% 0 100% 0;
  background: var(--c, #f0c9c3);
  opacity: 0.85;
  pointer-events: none;
  animation: fall var(--t, 9s) linear infinite;
  animation-delay: var(--d, 0s);
}
@keyframes fall {
  0% {
    transform: translate(0, 0) rotate(0);
  }
  100% {
    transform: translate(var(--x, -40px), 900px) rotate(540deg);
  }
}
.spark {
  position: absolute;
  width: 10px;
  height: 10px;
  pointer-events: none;
  animation: spark 2.6s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}
.spark::before {
  content: '';
  position: absolute;
  inset: 0;
  background: #ffe9b8;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
}
@keyframes spark {
  0%,
  100% {
    opacity: 0;
    transform: scale(0.4) rotate(0);
  }
  50% {
    opacity: 1;
    transform: scale(1) rotate(45deg);
  }
}
/* customer buttons */
.phone .btn {
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid rgba(201, 163, 95, 0.55);
  background: rgba(255, 250, 242, 0.9);
  font-size: 15px;
  letter-spacing: 0.04em;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
.phone .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(59, 42, 34, 0.12);
}
.phone .btn.primary {
  background: var(--seal);
  border-color: var(--seal);
  color: #fff4ea;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 6px 16px rgba(126, 44, 47, 0.28);
}
.phone .btn.primary:hover {
  background: var(--seal-deep);
  filter: none;
}
.phone .btn.sm {
  min-height: 34px;
  padding: 0 14px;
  font-size: 13px;
}
.phone .btn.night-ghost {
  border-color: rgba(233, 215, 168, 0.45);
  background: rgba(255, 250, 242, 0.08);
  color: #f6ead2;
}
.phone .btn[disabled] {
  background: #cdb9b0;
  border-color: #cdb9b0;
  color: #fff7f0;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
.seal-ico {
  width: 26px;
  height: 26px;
  margin-left: -8px;
  background: url(/assets/sets/2-qiangwei/seal.webp) center/contain no-repeat;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));
}
.phone .iconbtn {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 250, 242, 0.5);
  background: rgba(255, 250, 242, 0.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fffaf2;
  font-size: 20px;
}
.env .dot {
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(155, 58, 58, 0.45);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(155, 58, 58, 0);
  }
}
/* home */
.home2 {
  display: flex;
  flex-direction: column;
}
.home2 .hero {
  position: absolute;
  left: 24px;
  right: 24px;
  top: 21%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.home2 h1 {
  margin: 0;
  font-size: 32px;
  line-height: 44px;
  color: var(--ink);
}
.pillform {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 7px 7px 14px;
  border-radius: 999px;
}
.pillform input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 8px 4px;
  font-size: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.pillform input::placeholder {
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}
.pillform input:focus {
  outline: none;
}
.pillform:focus-within {
  box-shadow:
    0 0 0 2px var(--dusk),
    0 8px 24px rgba(47, 53, 82, 0.14);
}
.home2 .hint {
  background: rgba(255, 250, 242, 0.7);
  margin-left: 10px;
}
.home2 .foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.home2 .foot img {
  width: 30px;
  height: 30px;
}
/* mailbox */
.mbox2 {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding-bottom: 22px;
}
.mbox2 .mb-head2 {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 20px 0;
}
.mbox2 .mb-head2 h2 {
  margin: 0;
  font-size: 26px;
  line-height: 34px;
  color: #fff6e6;
  font-weight: 400;
}
.mbox2 .mb-head2 .sub {
  font-size: 20px;
  color: #f3dca8;
}
.mbox2 .notecard {
  margin: 46px 20px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 12px;
  border-radius: 18px;
}
.mbox2 .notecard img {
  width: 46px;
  height: 46px;
  flex: none;
}
.mbox2 .notecard .tx {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 12px;
  color: var(--muted);
}
.mbox2 .notecard .tx b {
  font-family: var(--display);
  font-weight: 400;
  font-size: 16px;
  color: var(--ink);
  letter-spacing: 0.04em;
}
.mbox2 .notecard .tx em {
  font-style: normal;
  font-family: var(--num);
  font-size: 15px;
  color: var(--seal);
}
.mbox2 .notecard.off img {
  opacity: 0.5;
  filter: grayscale(0.6);
}
.mbox2 .notecard.off .tx b {
  color: var(--muted);
}
.mb-grid {
  gap: 26px 20px;
  padding: 6px 22px 10px;
}
.mb-cell span {
  font-size: 12px;
  color: var(--muted);
}
.mb-cell span .t-num {
  font-size: 14px;
}
.mb-cell .float {
  width: 100%;
}
.mbox2 .empty2 {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 10px 24px;
}
.mbox2 .empty2 img {
  width: 240px;
  max-width: 78%;
}
.mbox2 .divider {
  margin: 22px 40px 0;
}
/* letter */
.letter {
  font-family: var(--letter);
  box-shadow:
    0 1px 2px rgba(59, 42, 34, 0.12),
    0 18px 40px rgba(35, 39, 66, 0.22);
}
.l-date {
  font-family: var(--num);
  font-style: italic;
  font-size: 15px;
  letter-spacing: 0.04em;
}
.l-from {
  margin-top: 12px;
  font-family: var(--hand);
  font-size: 24px;
  line-height: 30px;
  color: var(--seal);
  letter-spacing: 0;
}
.l-title {
  margin-top: 8px;
  font-family: var(--display);
  font-weight: 400;
  font-size: 24px;
  line-height: 34px;
  letter-spacing: 0.04em;
}
.l-body {
  margin-top: 18px;
  font-size: 16.5px;
}
.l-sign {
  margin: 14px 0 0;
  text-align: right;
  font-family: var(--hand);
  font-size: 22px;
  color: var(--muted);
}
.letter-scr.night {
  background:
    radial-gradient(
      ellipse 70% 42% at 50% 54%,
      rgba(255, 206, 150, 0.34),
      rgba(255, 206, 150, 0) 70%
    ),
    linear-gradient(180deg, #1f2340 0%, #2f3552 46%, #4a3f4f 100%);
  padding: 22px 16px 28px;
}
.letter-scr .letter {
  animation: unfold 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  transform-origin: 50% 0;
}
@keyframes unfold {
  from {
    opacity: 0;
    transform: translateY(26px) scaleY(0.9);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.letter-scr .l-actions {
  margin-top: 20px;
}
/* hand-over from the 3D sheet: same 360-unit sheet, scaled to where the 3D letter came to rest */
.letter .l-title {
  letter-spacing: 0;
  text-wrap: wrap;
}
.letter-scr.handed {
  padding: 0 0 28px;
}
.letter.handed {
  width: 360px;
  max-width: none;
  margin: 0;
  zoom: var(--z);
  min-height: 498px;
  display: flex;
  flex-direction: column;
  animation: none !important;
}
.letter.handed .orn.bot {
  margin-top: auto;
  padding-top: 16px;
}
/* not found */
.nf2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 28px;
}
.nf2 img {
  width: 280px;
  max-width: 86%;
  margin-top: 190px;
}
/* note sheet */
.sheet.night {
  align-items: stretch;
  padding: 0;
}
.dock .btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.sheet2 {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  padding: 0 0 28px;
}
.sheet2 .top {
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 0;
}
.notepaper {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: url(/assets/shared/note-paper.webp) center/100% 100% no-repeat;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.35));
}
.notepaper textarea {
  position: absolute;
  left: 15%;
  right: 13%;
  top: 19%;
  bottom: 32%;
  border: 0;
  background: transparent;
  resize: none;
  padding: 0;
  font-family: var(--hand);
  font-size: 23px;
  line-height: 30px;
  color: var(--ink);
}
.notepaper textarea:focus {
  outline: none;
}
.notepaper .use {
  position: absolute;
  left: 15%;
  bottom: 19%;
  font-family: var(--hand);
  font-size: 15px;
  line-height: 18px;
  color: var(--seal);
}
.notepaper .cnt {
  position: absolute;
  right: 15%;
  bottom: 19%;
  font-family: var(--num);
  font-style: italic;
  font-size: 12px;
  line-height: 18px;
  color: var(--muted);
}
.sheet2 .sheet-msg {
  background: none;
  padding: 0 36px;
  margin-top: 40px;
  text-align: center;
  font-size: 13px;
  line-height: 20px;
  color: rgba(246, 234, 210, 0.75);
}
.sheet2 .sheet-msg b {
  color: #f3dca8;
}
.sheet2 .acts {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.sheet2 .linkbtn {
  border: 0;
  background: none;
  font-size: 14px;
  color: rgba(246, 234, 210, 0.75);
}
.toast {
  font-family: var(--display);
  letter-spacing: 0.06em;
  background: rgba(35, 39, 66, 0.9);
  color: #f6ead2;
  border-radius: 999px;
  padding: 10px 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
/* admin v2 */
.adm .tabs {
  border: 0;
  margin: -16px calc(-1 * max(16px, env(safe-area-inset-left, 0px))) 18px;
  padding: 12px max(16px, env(safe-area-inset-left, 0px));
  gap: 6px;
  background:
    linear-gradient(rgba(35, 39, 66, 0.72), rgba(47, 53, 82, 0.82)),
    url(/assets/shared/home-bg-desktop.webp) center 18% / cover;
}
.adm .tabs button {
  border: 0;
  border-radius: 999px;
  padding: 7px 16px;
  color: rgba(246, 234, 210, 0.75);
}
.adm .tabs button[aria-selected='true'] {
  background: #f6ead2;
  color: var(--dusk);
}
.adm .card,
.modal .card {
  border-radius: 16px;
  background: #fffaf3;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 10px 28px rgba(59, 42, 34, 0.07);
  overflow: hidden;
}
.adm .card-h {
  padding: 13px 16px;
}
.adm .card-h b,
.modal .card-h b {
  font-family: var(--display);
  font-weight: 400;
  font-size: 17px;
  letter-spacing: 0.06em;
}
.adm .btn,
.modal .btn,
.dock .btn {
  border-radius: 999px;
}
/* login */
.login {
  min-height: calc(100vh - 60px);
  display: flex;
  flex-wrap: wrap;
  margin: -16px calc(-1 * max(16px, env(safe-area-inset-left, 0px))) -96px;
}
.login .pic {
  position: relative;
  flex: 999 1 520px;
  min-height: 300px;
  overflow: hidden;
  background: #e9e3df url(/assets/shared/home-bg-desktop.webp) center/cover;
}
.login .pic .words {
  position: absolute;
  left: 48px;
  top: 56px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-shadow: 0 1px 10px rgba(35, 39, 66, 0.55);
}
.login .side {
  flex: 1 1 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 28px;
}
.login form {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.login input[type='password'] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbf6ee;
  padding: 10px 12px;
  font-size: 16px;
}
.login .err {
  margin: 0;
  font-size: 13px;
  color: var(--seal);
}
/* settings */
.set-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
  max-width: 1240px;
}
.set-main {
  flex: 999 1 520px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.set-side {
  flex: 1 1 320px;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 76px;
}
.tpl textarea {
  width: 100%;
  min-height: 118px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbf6ee;
  padding: 10px 12px;
  font-family: var(--letter);
  font-size: 15px;
  line-height: 1.8;
  resize: vertical;
}
.tpl textarea:focus {
  outline: none;
  border-color: var(--dusk);
  background: #fffdf8;
  box-shadow: 0 0 0 3px rgba(47, 53, 82, 0.12);
}
.vchips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.vchip {
  border: 0;
  border-radius: 6px;
  background: var(--seal-soft);
  color: var(--seal);
  font-size: 13px;
  padding: 3px 8px;
}
.vchip:hover {
  filter: brightness(0.97);
}
.wx {
  padding: 18px 16px 22px;
  background: #ededed;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wx .who {
  align-self: center;
  font-size: 12px;
  color: #9a9a9a;
}
.wx .row2 {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: flex-start;
}
.wx .bub {
  margin: 0;
  max-width: 270px;
  padding: 10px 12px;
  border-radius: 6px;
  background: #95ec69;
  font-size: 15px;
  line-height: 1.65;
  color: #1a1a1a;
  white-space: pre-wrap;
  word-break: break-all;
}
.wx img {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: #fff;
  flex: none;
}
.vars {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 14px;
  font-size: 13px;
  align-items: baseline;
}

/* Long note replies use the same wrapping in the reader and measured 3D sheet. */
.l-title,
.nt q,
.bl-item {
  overflow-wrap: anywhere;
  word-break: break-word;
}
#ed-title {
  min-height: 72px;
  resize: vertical;
}
.cust button[aria-busy='true'] {
  opacity: 0.65;
  cursor: progress;
}

/* ---------- letter scene: opening and reading share one sky, one top bar ----------
   The reader shows the very sheet the 3D scene unfolded (a pixel copy, lit and creased),
   with the letter's text laid over it invisibly for selection, copying and screen readers. */
.letter-scene {
  overflow: hidden;
}
.letter-scene .c3d {
  z-index: 2;
}
.letter-scene .o3-top,
.letter-scene .o3-hint {
  z-index: 3;
}
.letter-scene .reader {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  pointer-events: none;
}
.letter-scene .reader.live {
  pointer-events: auto;
}
.letter-scene .o3-top::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -16px;
  height: 78px;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(29, 33, 64, 0.94),
    rgba(29, 33, 64, 0.62) 55%,
    rgba(29, 33, 64, 0)
  );
  opacity: 0;
  transition: opacity 0.3s;
}
.letter-scene.scrolled .o3-top::before {
  opacity: 1;
}
.reader-pages {
  position: relative;
  width: 100%;
}
.leaf {
  position: absolute;
}
.leaf.s1 {
  --plit: url(/assets/sets/1-yuebai/paper-lit.webp);
}
.leaf.s2 {
  --plit: url(/assets/sets/2-qiangwei/paper-lit.webp);
}
.leaf.s3 {
  --plit: url(/assets/sets/3-yehang/paper-lit.webp);
}
.leaf.s4 {
  --plit: url(/assets/sets/4-qingtai/paper-lit.webp);
}
.leaf-paper {
  position: absolute;
  inset: 0;
  border-radius: 2px;
  background:
    var(--plit) 0 0 / 100% 100% no-repeat,
    var(--pc) var(--ptex) 0 0 / 256px;
  box-shadow:
    0 1px 2px rgba(12, 10, 26, 0.28),
    6px 14px 30px rgba(12, 10, 26, 0.34);
}
.leaf.snapped .leaf-paper {
  visibility: hidden;
}
.leaf-text {
  position: absolute;
  left: 0;
  top: 0;
  width: 360px;
  height: 498px;
  transform-origin: 0 0;
}
.leaf-text span {
  position: absolute;
  white-space: pre;
  line-height: 1;
  transform: translateY(-50%);
}
.leaf-text span.end {
  transform: translate(-100%, -50%);
}
.leaf.snapped .leaf-text span {
  color: transparent !important;
}
.leaf-text span::selection {
  background: rgba(155, 58, 58, 0.24);
}
.leaf-snap {
  position: absolute;
  pointer-events: none;
}
.leaf-snap.focus {
  opacity: 0;
  transition: opacity 0.45s ease;
}
.leaf-snap.focus.in {
  opacity: 1;
}
.reader .later {
  opacity: 0;
  transition: opacity 0.6s ease;
}
.reader.settled .later {
  opacity: 1;
}
.reader-actions {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 0 16px;
}
.reader.plain .leaf[data-page='0'] {
  animation: sheet-in 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.legacy-letter {
  padding: 66px 16px 40px;
}
@media (prefers-reduced-motion: reduce) {
  .reader.plain .leaf[data-page='0'] {
    animation: none;
  }
  .reader .later {
    transition: none;
  }
}
