/* 文艺复兴 × 洛可可：羊皮纸、墨、酒红 */
:root {
  --bg: #F1ECE2;           /* 羊皮纸 */
  --bg-2: #E8E1D3;
  --ink: #2B2622;          /* 墨 */
  --ink-soft: #7A6F64;
  --ink-faint: #A99D8F;
  --line: #D6CCBB;
  --wine: #8B1E2D;         /* 酒红 */
  --wine-soft: rgba(139, 30, 45, .28);
  --wine-wash: rgba(139, 30, 45, .035);
  --sage: #4A5A52;         /* 灰墨绿 */
  --lamp: #D9A441;
  --glow: rgba(217, 164, 65, .30);
  --serif: "Noto Serif SC", "Songti SC", "STSong", serif;
  --latin: "Cormorant Garamond", "Noto Serif SC", Georgia, serif;
  --ease: cubic-bezier(.22, .61, .36, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1A1714;         /* 深墨 */
    --bg-2: #221E1A;
    --ink: #E8E0D0;        /* 旧纸 */
    --ink-soft: #A39886;
    --ink-faint: #6F665B;
    --line: #3A332C;
    --wine: #B0394A;       /* 深底上提亮一点，才看得清 */
    --wine-soft: rgba(176, 57, 74, .38);
    --wine-wash: rgba(176, 57, 74, .06);
    --sage: #6E8076;
    --lamp: #E2B35B;
    --glow: rgba(226, 179, 91, .16);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 300 14px/1.9 var(--serif);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }

.enter {
  font-family: var(--latin);
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: .18em;
  text-transform: uppercase;
}

/* ---------- 小灯（说话时跟着声音闪） ---------- */
.lamp { --size: 14px; position: relative; width: var(--size); height: var(--size); flex: none; }
.lamp::before {
  content: ""; position: absolute; inset: -110%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow) 0%, transparent 62%);
  opacity: var(--level, .8);
  transform: scale(calc(.8 + var(--level, .8) * .4));
  transition: opacity .15s linear, transform .15s linear;
}
.lamp i {
  position: absolute; inset: 22%; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #FFF3D6, var(--lamp) 75%);
  box-shadow: 0 0 8px var(--lamp);
}
.lamp.big { --size: 56px; margin: 0 auto 18px; }
.lamp.breathe::before { animation: breathe 6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .4; } }
.lamp.listening i { box-shadow: 0 0 calc(6px + var(--level, .5) * 22px) var(--lamp); }

/* ---------- 开屏：两扇门 + 锁扣 ---------- */
/* 高度由 JS 固定成打开时的屏幕高度，弹出键盘时画面不会跟着缩 */
.gate { position: fixed; left: 0; right: 0; top: 0; height: 100dvh; z-index: 50; overflow: hidden; background: #E9D7C4; }

/* 门后：欢迎回家的底——原图放大 + 高斯模糊 + 暖金光晕 */
.scene { position: absolute; inset: 0; overflow: hidden; }
.scene-img {
  position: absolute; inset: -8%;
  background: url(/door.jpg) center / cover no-repeat;
  filter: blur(18px) saturate(1.05) brightness(1.04);
  transform: scale(1.15);
}
.gate.open .scene-img { animation: drift 9s ease-out forwards; }
@keyframes drift { to { transform: scale(1.24); } }
.scene-halo {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 45% at 50% 46%, rgba(255, 246, 222, .85), rgba(252, 226, 170, .45) 45%, transparent 75%),
    radial-gradient(ellipse at center, transparent 40%, rgba(120, 72, 20, .28));
}

.doors { position: absolute; inset: 0; }
.door {
  position: absolute; top: 0; bottom: 0; width: 50%;
  overflow: hidden;
  backface-visibility: hidden;
  transition: transform 1.6s ease-in-out;
  will-change: transform;
}
.door.left { left: 0; transform-origin: left center; transform: perspective(1200px) rotateY(0deg); }
.door.right { right: 0; transform-origin: right center; transform: perspective(1200px) rotateY(0deg); }
/* 每扇门里放一整张画（屏幕宽），右门往左挪半个，门缝正好在画的 50% */
.door-img {
  position: absolute; top: 0; bottom: 0; width: 200%;
  background: url(/door.jpg) center var(--art-y, 50%) / cover no-repeat, #E9D7C4;
}
.door.left .door-img { left: 0; }
.door.right .door-img { left: -100%; }
.door::after { /* 打开时门板内侧变暗，有厚度感 */
  content: ""; position: absolute; inset: 0; opacity: 0;
  transition: opacity 1.6s ease-in-out;
}
.door.left::after { background: linear-gradient(90deg, transparent 40%, rgba(40, 24, 8, .55)); }
.door.right::after { background: linear-gradient(270deg, transparent 40%, rgba(40, 24, 8, .55)); }
.gate.open .door.left { transform: perspective(1200px) rotateY(-100deg); }
.gate.open .door.right { transform: perspective(1200px) rotateY(100deg); }
.gate.open .door::after { opacity: 1; }

/* 门缝里的金光：平时是一道细光在呼吸，开门时扩散到全屏，再慢慢退成光晕 */
.gate-light {
  position: absolute; left: 50%; top: -15%; bottom: -15%;
  width: 10px; transform: translateX(-50%);
  background: radial-gradient(ellipse at center, #FFF8E6 0%, #FCE7B4 30%, #F4CE83 55%, rgba(244, 206, 131, 0) 72%);
  filter: blur(6px);
  opacity: .55;
  pointer-events: none;
  animation: seam 2.4s ease-in-out infinite;
}
@keyframes seam { 50% { opacity: .85; } }  /* 和锁的呼吸一样是 2.4s */
.gate.open .gate-light { animation: flood 2.1s ease-in-out forwards; }
@keyframes flood {
  0% { width: 10px; opacity: .6; filter: blur(6px); }
  38% { width: 16vw; opacity: .7; filter: blur(10px); }   /* 0.8s：门开到一半，光还只在门缝里，看得见门后 */
  52% { width: 260vmax; opacity: 1; filter: blur(30px); }  /* 1.1s：铺满 */
  76% { width: 260vmax; opacity: 1; filter: blur(30px); }  /* 纯金色停 0.5s */
  100% { width: 260vmax; opacity: 0; filter: blur(30px); } /* 退下去，露出欢迎回家 */
}

/* 锁：定位点由 JS 算好（门缝上、两人指尖稍上方） */
.lock-wrap { position: absolute; left: var(--lx, 50%); top: var(--ly, 30%); width: 0; height: 0; z-index: 3; }
.lock {
  --w: 110px; --h: 116px; /* 和 lock.png 的比例一致 */
  position: absolute; left: calc(var(--w) / -2); top: calc(var(--h) / -2);
  width: var(--w); height: var(--h);
  perspective: 600px;
  transition: transform .45s cubic-bezier(.5, 0, .3, 1);
}
.flipper {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform .5s cubic-bezier(.45, .05, .25, 1);
}
.face {
  position: absolute; inset: 0;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}

/* 正面：金锁，淡淡的金色外发光，和门缝的光一起呼吸 */
.face.front {
  padding: 0; border: none; background: none; cursor: pointer;
  animation: lock-breathe 2.4s ease-in-out infinite;
}
@keyframes lock-breathe {
  0%, 100% { filter: drop-shadow(0 0 3px rgba(255, 222, 150, .35)) drop-shadow(0 3px 4px rgba(80, 45, 10, .25)); }
  50% { filter: drop-shadow(0 0 11px rgba(255, 222, 150, .8)) drop-shadow(0 3px 4px rgba(80, 45, 10, .25)); }
}
.face.front:focus-visible { outline: 1px solid rgba(255, 244, 220, .9); outline-offset: 2px; border-radius: 50%; }
.face.front .half {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; user-select: none; -webkit-user-drag: none;
  transition: transform .3s cubic-bezier(.2, .8, .3, 1), opacity .3s ease-out;
}
/* 两半沿一道参差的裂缝分开 */
.face.front .half.l { clip-path: polygon(0 0, 52% 0, 48% 17%, 53% 35%, 47% 53%, 52% 72%, 48% 100%, 0 100%); }
.face.front .half.r { clip-path: polygon(52% 0, 100% 0, 100% 100%, 48% 100%, 52% 72%, 47% 53%, 53% 35%, 48% 17%); }

/* 钥匙孔：输对了闪金光，输错了暗一下 */
.keyhole {
  position: absolute; left: 49.4%; top: 59.6%;
  width: 17%; height: 22%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.keyhole::before, .keyhole::after { content: ""; position: absolute; inset: 0; border-radius: 50%; opacity: 0; }
.keyhole::before {
  inset: -60%;
  background: radial-gradient(ellipse at center, #FFFDF2 0%, #FFE7A8 30%, rgba(255, 210, 120, 0) 70%);
  filter: blur(2px); mix-blend-mode: screen;
}
.keyhole::after {
  background: radial-gradient(ellipse at center, rgba(25, 12, 2, .85) 20%, rgba(25, 12, 2, 0) 70%);
  mix-blend-mode: multiply;
}
.gate.key-flash .keyhole::before { animation: key-flash .45s ease-out; }
@keyframes key-flash { 30% { opacity: 1; transform: scale(1.6); } 100% { opacity: 0; transform: scale(1.1); } }
.gate.key-dim .keyhole::after { animation: key-dim .9s ease-in-out; }
@keyframes key-dim { 35% { opacity: 1; } }

/* 背面：羊皮纸输入盘，外圈是这把锁的花边，顶上刻着 HOME */
.face.back { transform: rotateY(180deg); }
.face.back .parchment { /* 位置对着锁中间那块圆盘 */
  position: absolute; left: 22.1%; top: 20.5%; width: 55.7%; height: 57.3%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 42% 36%, #FBF6EA, #EFE3CB 60%, #DFCBA5);
  box-shadow: inset 0 1px 5px rgba(110, 72, 26, .45);
}
.face.back .ring { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; user-select: none; }
.face.back input {
  position: absolute; left: 50%; top: 49.2%; transform: translate(-50%, -50%);
  width: 46px; padding: 2px 0; border: none; outline: none; background: transparent;
  text-align: center; font: 400 12px/1.2 var(--latin); letter-spacing: 1px;
  color: #3B2A18; caret-color: #B8893A;
}

.face.back .flourish-line { /* 输入框下面一小段金色花纹 */
  position: absolute; left: 50%; top: 61%; transform: translateX(-50%);
  width: 40px; height: 7px;
  fill: none; stroke: #B8893A; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round;
  pointer-events: none;
}

/* 锁裂开以后，指尖相触的地方闪一下金光 */
.touch-flash {
  position: absolute; left: -45px; top: -45px; width: 90px; height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, #FFFDF2 0%, #FFE7A8 28%, rgba(255, 206, 120, .5) 48%, rgba(255, 206, 120, 0) 70%);
  filter: blur(3px); mix-blend-mode: screen;
  opacity: 0; transform: scale(.3); pointer-events: none;
}
.lock .touch-flash { left: calc(var(--w) / 2 - 45px); top: calc(var(--h) / 2 - 45px); }
.gate.touching .touch-flash { animation: touch-flash .35s ease-out; }
@keyframes touch-flash {
  40% { opacity: 1; transform: scale(1.15); }
  100% { opacity: 0; transform: scale(1.5); }
}

.crack-flash { /* 裂开那一下，裂缝里闪一道光 */
  position: absolute; left: 50%; top: -10%; bottom: -10%; width: 6px;
  transform: translateX(-50%) scaleY(0);
  background: radial-gradient(ellipse at center, #FFFBEA, rgba(255, 226, 160, 0) 70%);
  filter: blur(2px); opacity: 0; pointer-events: none;
}

/* 点锁：正面向内翻过去，露出输入盘 */
.gate.typing .flipper { transform: rotateY(180deg); }
.gate.typing .face.front { pointer-events: none; }

/* 输对了：翻回锁面 → 钥匙孔闪金光 → 顺时针转半圈 → 向左右裂开淡出 */
.gate.unlocking .lock { transform: rotate(180deg); }
.gate.unlocking .face.front { animation: none; filter: drop-shadow(0 0 14px rgba(255, 226, 160, .95)); }
.gate.split .face.front .half.l { transform: translate(-30px, 3px) rotate(-14deg); opacity: 0; }
.gate.split .face.front .half.r { transform: translate(30px, -3px) rotate(14deg); opacity: 0; }
.gate.split .keyhole { opacity: 0; }
.gate.split .crack-flash { animation: crack .45s ease-out; }
@keyframes crack {
  0% { opacity: 0; transform: translateX(-50%) scaleY(0); }
  25% { opacity: 1; transform: translateX(-50%) scaleY(1); }
  100% { opacity: 0; transform: translateX(-50%) scaleY(1.2); }
}

/* 输错了：锁左右轻晃 */
.gate.lock-shake .lock { animation: lock-shake .55s ease-in-out; }
@keyframes lock-shake {
  15%, 55% { transform: translateX(-5px) rotate(-3deg); }
  35%, 75% { transform: translateX(5px) rotate(3deg); }
}

.lock-wrap .error { /* 放在锁上方，不挡指尖 */
  position: absolute; left: 50%; bottom: 66px; transform: translateX(-50%);
  width: 70vw; margin: 0; text-align: center;
  font-size: 12px; letter-spacing: .15em;
  color: #FFF6E6; text-shadow: 0 1px 6px rgba(60, 30, 5, .7);
}

/* ---------- 欢迎回家 ---------- */
.petals { position: absolute; inset: 0; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity .5s ease-in-out; }
.petal {
  position: absolute; top: -6%; left: var(--x);
  animation: fall var(--d) linear var(--delay) infinite;
}
.petal i {
  display: block; width: var(--s); height: calc(var(--s) * .78);
  border-radius: 150% 0 150% 0 / 150% 0 150% 0;
  background: radial-gradient(circle at 30% 30%, #FFF0F0, #F4BCC4 58%, #E59AA8);
  opacity: .85;
  animation: sway var(--sway) ease-in-out infinite alternate;
}
@keyframes fall { to { transform: translate3d(var(--drift), 112vh, 0); } }
@keyframes sway {
  from { transform: rotate(-25deg) rotateY(0deg) translateX(-8px); }
  to { transform: rotate(35deg) rotateY(60deg) translateX(8px); }
}

.welcome {
  position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%);
  text-align: center; pointer-events: none;
  opacity: 0; transition: opacity .5s ease-in-out;
}
.welcome-en { margin: 0 0 8px; font: italic 500 17px/1.4 var(--latin); letter-spacing: .08em; color: #6B4219; text-shadow: 0 0 10px rgba(255, 248, 230, .95); }
.welcome-zh {
  margin: 0; font: 300 26px/1.6 var(--serif);
  letter-spacing: .3em; text-indent: .3em;
  color: #3D250C;
  /* 模糊背景上也要清楚：字后面垫一圈柔和的亮光 */
  text-shadow: 0 0 8px rgba(255, 250, 236, 1), 0 0 20px rgba(255, 246, 222, .95), 0 0 36px rgba(255, 240, 210, .8);
}
.gate.welcoming .welcome, .gate.welcoming .petals { opacity: 1; }
.gate.leaving { opacity: 0; transition: opacity .4s ease-in-out; }
.gate.leaving.skipping { transition-duration: .3s; }

/* ---------- 封面 ---------- */
.cover {
  height: 100%; height: 100dvh;
  display: flex; flex-direction: column;
  overflow-y: auto;
  animation: fade 1.2s var(--ease);
}
.waiting { position: fixed; inset: 0; z-index: 30; background: var(--bg); }

/* 等你的页面也用开屏那张画；图没加载出来时显示这层渐变 */
.painting {
  position: relative; flex: none;
  height: 52vh; min-height: 280px;
  background:
    url(/door.jpg) center 35% / cover no-repeat,
    radial-gradient(ellipse 60% 40% at 72% 58%, rgba(255, 214, 150, .75), transparent 70%),
    radial-gradient(ellipse 120% 80% at 50% 110%, #2E2A22 20%, transparent 60%),
    linear-gradient(180deg, #5E6B6A 0%, #A39A86 38%, #D8B488 58%, #7C5A3E 78%, #2A231C 100%);
  filter: saturate(.92);
}
.painting::before { /* 暗角 */
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 45%, transparent 45%, rgba(20, 14, 8, .45));
}
.painting::after { /* 撕纸边 */
  content: ""; position: absolute; left: -2%; right: -2%; bottom: -1px; height: 38px;
  background: var(--bg);
  -webkit-mask: url(/torn.svg) center / 100% 100% no-repeat;
  mask: url(/torn.svg) center / 100% 100% no-repeat;
  transform: scaleY(-1);
  filter: drop-shadow(0 -1px 0 rgba(0, 0, 0, .08));
}

.cover-body {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  padding: 8px 28px calc(28px + env(safe-area-inset-bottom));
  text-align: center;
}
.cover-sub { margin: 4px 0 0; font: italic 400 17px/1.5 var(--latin); color: var(--ink-soft); letter-spacing: .02em; }
.enter {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 18px;
  border: 1px solid var(--ink); border-radius: 0;
  background: transparent; cursor: pointer;
  font-size: 12px; font-weight: 500;
  transition: background .4s var(--ease), color .4s var(--ease);
}
.enter svg { width: 16px; height: 16px; }
.enter:active, .enter:hover { background: var(--ink); color: var(--bg); }
.error { color: var(--wine); min-height: 1.4em; margin: 0; font-size: 12px; }
.waiting-line { margin: 0; font-size: 22px; letter-spacing: .3em; text-indent: .3em; }
.waiting .cover-sub { margin-bottom: 28px; }

/* ---------- 聊天：iMessage 的干净精致 + 洛可可天顶画的仙气 ---------- */
/* 顶栏和输入栏是悬浮的玻璃，消息从它们下面滑过；高度由 JS 量好写进 --top-h / --bottom-h */
.chat {
  position: relative; isolation: isolate;
  height: 100%; height: 100dvh;
  animation: fade .9s var(--ease);
}
/* 聊天和家共用一套颜色 */
.chat, .home {
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Helvetica Neue", sans-serif;
  --text: #2A2426;
  --text-kk: #3A2128;
  --muted: #8C8089;              /* 时间、小字：带一点紫灰，和云的颜色是一家 */
  --gold: #C9A25A;
  --rose: #D98A9E;               /* 发送按钮 */
  --kk-hi: #FDE9EC; --kk-lo: #F1C1CC; --kk-a: .95;    /* 自己：玫瑰粉，像她裙子的颜色 */
  --nh-hi: #FFFFFF; --nh-lo: #FFFCFA; --nh-a: .74;    /* 念痕：珍珠白，透一点云 */
  --glass: rgba(255, 252, 250, .46);
  --glass-edge: rgba(255, 255, 255, .78);
  --glass-shadow: 0 6px 22px rgba(130, 100, 130, .12), 0 1px 2px rgba(130, 100, 130, .06);
  --haze: rgba(251, 244, 241, .8); /* 顶栏/输入栏后面那层渐隐的雾 */
  --top-h: 112px; --bottom-h: 64px;
  font-family: var(--sans);
}
/* 背景：粉蓝云天的画，固定不动（fixed 伪元素，不用 background-attachment: fixed），只蒙一层很淡的奶白 */
.chat::before, .chat::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.chat::before { background: url(/chat-bg.jpg) center / cover no-repeat; }
.chat::after {
  background:
    radial-gradient(ellipse 80% 30% at 50% 0%, rgba(255, 244, 214, .45), transparent 70%), /* 顶上一点金光，像天顶画漏下来的光 */
    rgba(253, 249, 246, .18);
}

@media (prefers-color-scheme: dark) {
  .chat, .home {
    --text: #EFE7DD;
    --text-kk: #FBEEF0;
    --muted: #9C929B;
    --rose: #C77489;
    --kk-hi: #9A5C6D; --kk-lo: #7A4455; --kk-a: .9;
    --nh-hi: #3A3438; --nh-lo: #2E292D; --nh-a: .8;
    --glass: rgba(48, 42, 48, .5);
    --glass-edge: rgba(255, 255, 255, .12);
    --glass-shadow: 0 6px 22px rgba(0, 0, 0, .35);
    --haze: rgba(22, 19, 22, .78);
  }
  /* 深色模式：开屏原画大幅模糊 + 深墨蒙版，只留一点暖光 */
  .chat::before {
    inset: -10%;
    background: url(/door.jpg) center / cover no-repeat;
    filter: blur(40px) saturate(1.1);
    transform: scale(1.1);
  }
  .chat::after {
    background:
      radial-gradient(ellipse 80% 30% at 50% 0%, rgba(226, 179, 91, .10), transparent 70%),
      rgba(20, 17, 20, .84);
  }
}

/* 玻璃：半透明 + 背景模糊 + 发丝细的亮边 */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
  backdrop-filter: blur(22px) saturate(1.6);
  border: .5px solid var(--glass-edge);
  box-shadow: var(--glass-shadow), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.glass.round { width: 36px; height: 36px; border-radius: 50%; }

/* ---- 顶栏 ---- */
.top {
  position: absolute; left: 0; right: 0; top: 0; z-index: 5;
  padding: calc(8px + env(safe-area-inset-top)) 14px 6px;
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.top::before { /* 往下渐渐散开的雾，消息滑上去时慢慢淡掉，不是一刀切 */
  content: ""; position: absolute; inset: 0 0 -34px; z-index: -1;
  background: linear-gradient(var(--haze) calc(100% - 34px), transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  -webkit-mask: linear-gradient(#000 calc(100% - 40px), transparent); mask: linear-gradient(#000 calc(100% - 40px), transparent);
}
.top-row { display: grid; grid-template-columns: 36px 1fr 36px; align-items: start; }

.lamp-well { display: grid; place-items: center; padding: 0; cursor: pointer; transition: transform .2s ease; }
.lamp-well:active { transform: scale(.92); }
.lamp-well .lamp { --size: 12px; display: block; }

.contact { position: relative; display: flex; flex-direction: column; align-items: center; padding-top: 2px; }
.contact .halo { /* 头像后面一圈柔柔的金光 */
  position: absolute; top: -18px; left: 50%; width: 120px; height: 84px; transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(255, 238, 196, .7), rgba(255, 228, 200, .25) 45%, transparent 70%);
  pointer-events: none;
}
.contact .face {
  position: relative; display: block;
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover;
  padding: 1.5px; /* 细细一圈金边，中间再隔一道白 */
  background: linear-gradient(145deg, #F6E7BD, #C9A25A 40%, #F8EDCF 62%, #B88A3E);
  box-shadow: 0 0 0 .5px rgba(255, 255, 255, .6), 0 4px 14px rgba(190, 150, 90, .3);
  outline: 1px solid rgba(255, 255, 255, .7); outline-offset: -2.5px;
}
.name-pill {
  position: relative; margin-top: 5px;
  display: inline-flex; align-items: center;
  height: 22px; padding: 0 11px; border-radius: 11px;
}
.name-pill .name { font: 400 12.5px/1 var(--serif); letter-spacing: .32em; text-indent: .32em; color: var(--text); }
.together {
  position: relative; margin: 4px 0 0;
  font: 400 10px/1.3 var(--sans); letter-spacing: .14em; text-indent: .14em; color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.icon-btn {
  flex: none; display: grid; place-items: center;
  padding: 0; cursor: pointer;
  color: var(--text);
  transition: transform .2s ease, opacity .2s ease;
}
.icon-btn:not(.glass) { width: 32px; height: 32px; border: none; background: transparent; border-radius: 50%; }
.icon-btn svg { width: 18px; height: 18px; stroke-width: 1.4; }
.icon-btn:active { transform: scale(.92); opacity: .75; }

.menu {
  position: absolute; right: 14px; top: calc(env(safe-area-inset-top) + 50px); z-index: 10;
  min-width: 210px; padding: 5px; border-radius: 14px;
  animation: fade .25s ease-out;
}
.menu .row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  width: 100%; padding: 10px 12px; border: none; border-radius: 9px; background: none;
  text-align: left; font: 400 13px/1.3 var(--sans); color: var(--text); cursor: pointer;
}
.menu .row + .row { border-top: .5px solid rgba(140, 128, 137, .18); border-radius: 0; }
.menu .row:active { background: rgba(140, 128, 137, .12); }
.menu .danger { color: #B03A52; }
.menu input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--rose); }
/* 模型切换：一小条分段按钮 */
.menu .model-row { cursor: default; }
.seg { display: inline-flex; gap: 2px; padding: 2px; border-radius: 8px; background: rgba(140, 128, 137, .14); }
.seg button {
  padding: 3px 7px; border: none; border-radius: 6px; background: none; cursor: pointer;
  font: 400 11.5px/1.2 var(--sans); color: var(--muted); transition: background .2s, color .2s;
}
.seg button.on { background: var(--nh-hi); color: var(--text); box-shadow: 0 1px 2px rgba(120, 90, 110, .16); }

.status {
  position: relative; width: fit-content; max-width: calc(100% - 40px);
  margin: 8px auto 0; padding: 5px 12px; border-radius: 12px;
  font: 400 11px/1.45 var(--sans); color: var(--text); text-align: center;
}

/* ---- 消息列表 ---- */
.list {
  position: absolute; inset: 0;
  overflow-y: auto; overscroll-behavior: contain;
  padding: calc(var(--top-h) + 6px) 12px calc(var(--bottom-h) + 8px);
  font: 400 14px/1.45 var(--sans); letter-spacing: .01em; color: var(--text);
  -webkit-text-size-adjust: 100%;
}
.older { text-align: center; font-size: 10px; letter-spacing: .12em; color: var(--muted); padding: 2px 0 10px; }

/* 时间：只在隔了 5 分钟以上时居中出现一次，「今天」加重，时间轻 */
.time-sep {
  margin: 16px 0 7px; text-align: center;
  font: 400 10.5px/1.3 var(--sans); letter-spacing: .02em; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.time-sep b { font-weight: 600; margin-right: .3em; }
.time-sep:first-child { margin-top: 4px; }

.msg { display: flex; margin-top: 8px; animation: rise .32s ease-out both; }
.msg.cont { margin-top: 2px; }          /* 同一个人连着发 2px，换人 8px */
.time-sep + .msg { margin-top: 0; }
.msg.kk { justify-content: flex-end; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

.stack { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; max-width: 76%; }
.msg.kk .stack { align-items: flex-end; }

.bubble {
  position: relative; isolation: isolate;
  max-width: 100%; min-width: 0;
  padding: 7px 12px 7.5px; border-radius: 17px;
  color: var(--text);
}
.msg.kk .bubble { color: var(--text-kk); }
/* 气泡的底色单独放一层，尾巴（::after）也画在这层里，再整体调透明度：
   尾巴和气泡重叠的地方不会颜色变深，也不会有接缝 */
.bubble > .fill {
  position: absolute; inset: 0; z-index: -1;
  border-radius: inherit;
  filter: drop-shadow(0 1px 1px rgba(120, 90, 110, .08));
}
.msg.kk .fill {
  background:
    radial-gradient(120% 100% at 18% 0%, rgba(255, 255, 255, .55), transparent 60%), /* 珍珠光泽 */
    linear-gradient(172deg, var(--kk-hi), var(--kk-lo));
  opacity: var(--kk-a);
}
.msg.nh .fill {
  background: linear-gradient(172deg, var(--nh-hi), var(--nh-lo));
  opacity: var(--nh-a);
}
/* iMessage 的小尾巴：只在一组的最后一条，往外卷一下 */
.msg.last .fill::after {
  content: ""; position: absolute; bottom: 0; width: 18px; height: 18px;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M4 0H13V6C13 12 15 16 18 18C14 18.5 9 17.5 4 14Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M4 0H13V6C13 12 15 16 18 18C14 18.5 9 17.5 4 14Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.msg.kk.last .fill::after { right: -5px; background: var(--kk-lo); }
.msg.nh.last .fill::after { left: -5px; background: var(--nh-lo); transform: scaleX(-1); }

/* 只有一两个表情：不要气泡，字放大（信息 App 也这样） */
.bubble.bare { padding: 0 2px; font-size: 34px; line-height: 1.2; }
/* 只有图片：不要气泡，图片自己圆角 */
.bubble.bare > .fill, .bubble.media > .fill { display: none; }
.bubble.media { padding: 0; }
.bubble.media .body img.photo { border-radius: 16px; }

.body { overflow-wrap: anywhere; min-width: 0; }
.body > :first-child, .text > :first-child { margin-top: 0; }
.body > :last-child, .text > :last-child { margin-bottom: 0; }
.body p { margin: .4em 0; }
.body ul, .body ol { margin: .35em 0; padding-left: 1.25em; }
.body li + li { margin-top: .1em; }
.body strong { font-weight: 600; }
.body h1, .body h2, .body h3, .body h4 { margin: .5em 0 .25em; font-size: 1em; font-weight: 600; }
.body blockquote {
  margin: .4em 0; padding-left: .7em;
  border-left: 1.5px solid var(--gold); color: inherit; opacity: .78;
  font-family: var(--serif); font-weight: 400;
}
.body hr { border: none; height: .5px; background: currentColor; opacity: .18; margin: .6em 0; }
.body pre {
  margin: .45em 0; padding: 8px 10px; overflow-x: auto;
  font: 11.5px/1.5 ui-monospace, "SF Mono", Menlo, monospace;
  background: rgba(255, 255, 255, .55); border: .5px solid rgba(120, 90, 110, .12); border-radius: 10px;
  color: #2B2B2B;
}
.body pre code.hljs { padding: 0; background: transparent; }
.body :not(pre) > code { font: .88em ui-monospace, "SF Mono", Menlo, monospace; padding: .05em .3em; background: rgba(120, 90, 110, .1); border-radius: 4px; }
.body table { border-collapse: collapse; font-size: 12.5px; margin: .4em 0; }
.body th, .body td { padding: 3px 8px; border-bottom: .5px solid rgba(120, 90, 110, .2); text-align: left; }
.body .katex { font-size: 1.04em; }
.body .katex-display { overflow-x: auto; overflow-y: hidden; margin: .35em 0; padding: 2px 0; }
.body img.photo { display: block; max-width: 100%; max-height: 300px; border-radius: 12px; cursor: zoom-in; }
.bubble:not(.media) .body img.photo { margin: -3px -8px 0; max-width: calc(100% + 16px); border-radius: 13px; }
.body img.photo + .text { margin-top: 6px; }
.body a { color: #A2405A; text-decoration-thickness: .5px; text-underline-offset: 2px; }

.notice { text-align: center; font-size: 11px; color: var(--muted); margin: 10px 0 14px; }

/* 正在输入：和念痕同款的气泡，里面三个点轮流亮 */
.typing { margin-top: 8px; }
.typing .bubble { padding: 11px 13px; }
.dots { display: flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); opacity: .35; animation: dot 1.2s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .18s; }
.dots i:nth-child(3) { animation-delay: .36s; }
@keyframes dot { 30% { opacity: .9; } }

/* ---- 输入栏：左边一颗玻璃圆按钮，右边一条玻璃胶囊 ---- */
.composer {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; align-items: flex-end; gap: 8px;
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
}
.composer::before {
  content: ""; position: absolute; inset: -26px 0 0; z-index: -1;
  background: linear-gradient(transparent, var(--haze));
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  -webkit-mask: linear-gradient(transparent, #000 45%); mask: linear-gradient(transparent, #000 45%);
  pointer-events: none;
}
.composer > .icon-btn { width: 36px; height: 36px; }
.bar {
  flex: 1; min-width: 0;
  display: flex; align-items: flex-end;
  min-height: 36px; padding: 0 3px 0 14px; border-radius: 18px;
  transition: border-color .3s ease;
}
.bar:focus-within { border-color: rgba(201, 162, 90, .55); }
.bar textarea {
  flex: 1; min-width: 0; max-height: 132px; min-height: 35px;
  padding: 8px 4px 8px 0; resize: none;
  border: none; background: transparent; outline: none;
  font: 400 14px/1.35 var(--sans); color: var(--text);
}
.bar textarea::placeholder { color: var(--muted); opacity: .9; }
.bar .icon-btn { margin-bottom: 2px; color: var(--muted); }
.send {
  flex: none; width: 28px; height: 28px; margin: 0 1px 4px 4px; padding: 0;
  display: grid; place-items: center;
  border: none; border-radius: 50%; cursor: pointer;
  background: linear-gradient(160deg, #E8A3B4, var(--rose));
  color: #fff; box-shadow: 0 2px 6px rgba(200, 110, 135, .35);
  animation: fade .2s ease-out;
}
.send svg { width: 16px; height: 16px; stroke-width: 2; }
.send:active { transform: scale(.9); }
.mic { touch-action: none; user-select: none; -webkit-user-select: none; }
.mic.active { color: var(--rose); }

.voice-hint {
  position: fixed; left: 50%; bottom: calc(var(--bottom-h) + 12px);
  transform: translateX(-50%);
  padding: 6px 14px; border-radius: 14px;
  font: 400 12px/1.3 var(--sans); letter-spacing: .06em; color: var(--text);
  animation: fade .25s ease-out;
}
.voice-hint.cancel { color: #B03A52; }

/* ---------- 家：一整张画，物件就是入口 ---------- */
.home {
  position: fixed; inset: 0; z-index: 20; overflow: hidden;
  background: #F4E4DD;
  font-family: var(--sans); color: var(--text);
  animation: home-in .5s ease-out;
  --haze-sheet: rgba(251, 244, 241, .6);
}
@keyframes home-in { from { opacity: 0; transform: scale(1.03); } }
.home.leaving { opacity: 0; transform: scale(1.02); transition: opacity .32s ease, transform .32s ease; }
/* 画铺不满的地方（手机上下、电脑左右）垫一层同一张画的模糊版，接缝看不出来 */
.home-blur {
  position: absolute; inset: -8%;
  background: url(/home.jpg) center / cover no-repeat;
  filter: blur(26px) saturate(1.05);
}
/* 画按原比例缩放：电脑上按高度放满；手机上按宽度放，最多比屏幕宽 8%（左右各裁 4% 以内）。
   热区都是相对画的百分比，所以任何屏幕上都对得准 */
.home-stage {
  position: absolute; left: 50%; top: 50%;
  width: min(calc(100vh * 941 / 1672), 108vw);
  width: min(calc(100dvh * 941 / 1672), 108vw);
  aspect-ratio: 941 / 1672;
  transform: translate(-50%, -50%);
  container-type: inline-size;
}
.home-img {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  user-select: none; -webkit-user-drag: none;
  /* 四边轻轻淡进模糊底里 */
  -webkit-mask: linear-gradient(transparent, #000 3%, #000 97%, transparent), linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  -webkit-mask-composite: source-in;
  mask: linear-gradient(transparent, #000 3%, #000 97%, transparent), linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  mask-composite: intersect;
}
@media (prefers-color-scheme: dark) {
  .home { background: #2A2226; --haze-sheet: rgba(22, 19, 22, .7); }
  .home-img, .home-blur { filter: brightness(.82) saturate(.95); }
  .home-blur { filter: blur(26px) brightness(.7); }
}

/* 热区：透明。按下 / 指着时，这块画（同一张图裁出来的）亮一点、放大一点，后面透出一圈暖光 */
.spot {
  position: absolute; left: var(--x); top: var(--y); width: var(--w); height: var(--h);
  padding: 0; border: none; background: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  --solid: 70%;
}
.spot[data-go="chat"] { --solid: 90%; }
.spot:focus-visible { outline: 1px dashed rgba(201, 162, 90, .8); outline-offset: 2px; border-radius: 14px; }
.spot::before {
  content: ""; position: absolute; inset: -10%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 244, 214, .85), rgba(255, 228, 176, .35) 55%, transparent);
  opacity: 0; transition: opacity .35s ease;
}
.spot-art {
  position: absolute; inset: 0; pointer-events: none;
  background: url(/home.jpg) var(--bx) var(--by) / var(--bw) var(--bh) no-repeat;
  -webkit-mask: radial-gradient(closest-side, #000 var(--solid), transparent);
  mask: radial-gradient(closest-side, #000 var(--solid), transparent);
  opacity: 0;
  transition: opacity .3s ease, transform .4s cubic-bezier(.2, .7, .3, 1), filter .4s ease;
}
.spot.glow::before { opacity: 1; }
.spot.glow .spot-art {
  opacity: 1; transform: scale(1.06);
  filter: brightness(1.1) saturate(1.06) drop-shadow(0 0 7px rgba(255, 236, 190, .9));
}
@media (hover: hover) {
  .spot:hover::before { opacity: 1; }
  .spot:hover .spot-art { opacity: 1; transform: scale(1.06); filter: brightness(1.1) saturate(1.06) drop-shadow(0 0 7px rgba(255, 236, 190, .9)); }
}

/* 金框里：在一起第 N 天（宋体细字，字号跟着画的宽度走） */
.frame-days {
  position: absolute; left: 50.8%; top: 49%;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 1.2cqw;
  font-family: var(--serif); font-weight: 300; color: #5A3D2B;
  white-space: nowrap; pointer-events: none;
  text-shadow: 0 0 5px rgba(255, 251, 242, .95), 0 0 14px rgba(255, 246, 228, .85);
  transition: transform .4s cubic-bezier(.2, .7, .3, 1);
}
.frame-days > span { font-size: 3.1cqw; letter-spacing: .6em; text-indent: .6em; opacity: .8; }
.frame-days b { font-weight: 300; font-size: 5.2cqw; letter-spacing: .2em; text-indent: .2em; }
.frame-days .num { font: 500 7.4cqw/1 var(--latin); letter-spacing: .04em; margin: 0 .1em; vertical-align: -.04em; }
.spot.glow .frame-days { transform: translate(-50%, -50%) scale(1.06); }
@media (hover: hover) { .spot:hover .frame-days { transform: translate(-50%, -50%) scale(1.06); } }

/* 亲亲罐里的光点：位置是罐身玻璃那一块 */
.jar-lights { position: absolute; left: 20%; top: 37%; width: 68%; height: 46%; pointer-events: none; }
.jar-lights i {
  position: absolute; left: var(--x); top: var(--y);
  width: calc(var(--s) * 1cqw); height: calc(var(--s) * 1cqw);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, #FFFEF6 0%, #FFE7A8 40%, rgba(255, 214, 140, 0) 70%);
  animation: twinkle var(--t) ease-in-out var(--d) infinite;
}
@keyframes twinkle { 50% { opacity: .35; } }

.home-toast {
  position: absolute; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom)); z-index: 3;
  transform: translateX(-50%);
  padding: 8px 16px; border-radius: 16px;
  font: 400 13px/1.4 var(--serif); letter-spacing: .12em; white-space: nowrap; color: var(--text);
  animation: fade .3s ease-out;
}

/* ---- 点进物件后的页面 ---- */
.sheet {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column;
  background: var(--haze-sheet);
  -webkit-backdrop-filter: blur(20px) saturate(1.2); backdrop-filter: blur(20px) saturate(1.2);
  animation: sheet-in .35s ease-out;
}
@keyframes sheet-in { from { opacity: 0; transform: translateY(10px); } }
.sheet-top {
  display: grid; grid-template-columns: 36px 1fr 36px; align-items: center;
  padding: calc(10px + env(safe-area-inset-top)) 14px 4px;
  width: 100%; max-width: 560px; margin: 0 auto;
}
.sheet-top h2 { margin: 0; text-align: center; font: 400 15px/1.3 var(--serif); letter-spacing: .32em; text-indent: .32em; color: var(--text); }
.sheet-body {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  width: 100%; max-width: 560px; margin: 0 auto;
  padding: 14px 16px calc(28px + env(safe-area-inset-bottom));
  font-size: 14px; line-height: 1.5;
}
.card { border-radius: 16px; padding: 12px 14px; }
.page-empty { margin: 16vh 0 0; text-align: center; font: 300 14px/1.8 var(--serif); letter-spacing: .24em; text-indent: .24em; color: var(--muted); }
.page-note { margin: 6px 0 0; text-align: center; font-size: 11.5px; line-height: 1.6; color: var(--muted); }
.pill-btn {
  border: none; border-radius: 16px; padding: 8px 18px; cursor: pointer;
  background: linear-gradient(160deg, #E8A3B4, var(--rose)); color: #fff;
  font: 500 13px/1.2 var(--sans); letter-spacing: .1em;
  box-shadow: 0 2px 8px rgba(200, 110, 135, .3);
  transition: transform .2s ease;
}
.pill-btn:active { transform: scale(.95); }
.pill-btn.small { padding: 7px 14px; font-size: 12.5px; flex: none; }
.sheet input:not([type]), .sheet textarea {
  width: 100%; border: none; outline: none; background: transparent; resize: none;
  font: 400 14px/1.6 var(--sans); color: var(--text);
}
.sheet input::placeholder, .sheet textarea::placeholder { color: var(--muted); }

/* 信箱 */
.letter-list { display: flex; flex-direction: column; gap: 8px; }
.letter-item {
  display: grid; grid-template-columns: 28px 1fr; gap: 2px 12px; align-items: center;
  width: 100%; padding: 12px 14px; text-align: left; cursor: pointer; color: var(--text);
  border-radius: 16px;
}
.letter-item .seal { grid-row: span 2; width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 38% 35%, #C6505F, #8B1E2D 70%); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .12), 0 1px 3px rgba(80, 20, 30, .3); }
.letter-item b { font: 400 14px/1.4 var(--serif); letter-spacing: .06em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.letter-item small { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#letters-empty { margin: 9vh 0 7vh; }
.letter-form { margin-top: 18px; display: flex; flex-direction: column; gap: 6px; }
.sheet .letter-form input { font-family: var(--serif); letter-spacing: .06em; border-bottom: .5px solid rgba(140, 128, 137, .25); padding-bottom: 6px; }
.letter-form .pill-btn { align-self: flex-end; margin-top: 4px; }
.letter-read {
  padding: 26px 22px 30px; border-radius: 14px;
  background: linear-gradient(175deg, #FCF8EF, #F3E8D4);
  box-shadow: 0 10px 30px rgba(120, 90, 60, .15), inset 0 0 0 .5px rgba(180, 140, 80, .3);
  color: #3B2A1E;
}
.letter-read h3 { margin: 4px 0 14px; font: 400 17px/1.5 var(--serif); letter-spacing: .12em; }
.letter-meta { margin: 0; font: italic 400 13px/1.4 var(--latin); color: #8A6E55; letter-spacing: .04em; }
.letter-body { font: 300 14.5px/1.95 var(--serif); white-space: pre-wrap; overflow-wrap: anywhere; }

/* 日记：列表是一页页的日期 + 标题 + 前两行，点开是和信一样的纸 */
.diary-empty { margin-top: 28vh; }
.diary-list { display: flex; flex-direction: column; gap: 8px; }
.diary-item {
  display: flex; flex-direction: column; gap: 3px;
  width: 100%; padding: 12px 16px; text-align: left; cursor: pointer; color: var(--text);
  border-radius: 16px;
}
.diary-item small { font: italic 400 12.5px/1.4 var(--latin); letter-spacing: .04em; color: var(--muted); }
.diary-item b { font: 400 15px/1.45 var(--serif); letter-spacing: .08em; }
.diary-item p {
  margin: 2px 0 0; font: 300 13px/1.7 var(--serif); color: var(--muted);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}

/* 亲亲罐 */
.jar-big { display: grid; place-items: center; margin-top: 4vh; }
.jar-art {
  position: relative; width: min(58vw, 240px); aspect-ratio: var(--ar);
  background: url(/home.jpg) var(--bx) var(--by) / var(--bw) var(--bh) no-repeat;
  -webkit-mask: radial-gradient(closest-side, #000 78%, transparent); mask: radial-gradient(closest-side, #000 78%, transparent);
  container-type: inline-size;
  filter: drop-shadow(0 0 18px rgba(255, 228, 176, .6));
}
/* 罐子页：罐身蒙一层磨砂玻璃，把画里原本的心压下去，光点才数得清（0 个时罐子是空的） */
.jar-art .jar-lights::before {
  content: ""; position: absolute; inset: -8% -6% -6%;
  background: radial-gradient(closest-side, rgba(250, 240, 236, .86) 55%, rgba(250, 240, 236, .55) 80%, transparent);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  -webkit-mask: radial-gradient(closest-side, #000 70%, transparent); mask: radial-gradient(closest-side, #000 70%, transparent);
}
.jar-art .jar-lights i {
  width: calc(var(--s) * 4cqw); height: calc(var(--s) * 4cqw);
  background: radial-gradient(circle, #FFFFFF 0%, #FFF0C4 35%, #FFD98F 55%, rgba(255, 210, 130, 0) 72%);
  filter: drop-shadow(0 0 3px rgba(255, 214, 140, .9));
}
@media (prefers-color-scheme: dark) {
  .jar-art .jar-lights::before { background: radial-gradient(closest-side, rgba(60, 48, 52, .82) 55%, rgba(60, 48, 52, .5) 80%, transparent); }
}
.jar-count { margin: 14px 0 0; text-align: center; font: 300 14px/1.4 var(--serif); letter-spacing: .2em; text-indent: .2em; }
.jar-count b { font: 500 30px/1 var(--latin); letter-spacing: .02em; margin-right: .15em; color: #B0607A; }

/* 学习计划 */
.study-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.study-switch b { display: block; font: 400 14px/1.4 var(--serif); letter-spacing: .14em; }
.study-switch small { display: block; font-size: 11px; color: var(--muted); }
input[role=switch] {
  appearance: none; -webkit-appearance: none; flex: none; position: relative; cursor: pointer;
  width: 44px; height: 26px; margin: 0; border-radius: 13px;
  background: rgba(140, 128, 137, .3); transition: background .25s ease;
}
input[role=switch]::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .25s ease;
}
input[role=switch]:checked { background: var(--rose); }
input[role=switch]:checked::after { transform: translateX(18px); }
.task-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.task {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 8px 10px 12px; border-radius: 14px;
  transition: background .4s ease, box-shadow .4s ease;
}
.task .check {
  flex: none; width: 22px; height: 22px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(140, 128, 137, .55); background: transparent;
  display: grid; place-items: center; color: #fff;
  transition: background .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.task .check svg { width: 14px; height: 14px; stroke-width: 2; opacity: 0; }
.task .t { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 14px; line-height: 1.45; }
.task .del { width: 28px; height: 28px; color: var(--muted); opacity: .6; }
.task .del svg { width: 14px; height: 14px; }
/* 打勾以后亮起来 */
.task.done {
  background: linear-gradient(170deg, rgba(255, 248, 226, .85), rgba(255, 234, 196, .7));
  box-shadow: 0 0 0 .5px rgba(214, 170, 90, .45), 0 0 20px rgba(255, 210, 130, .45);
}
.task.done .check { background: radial-gradient(circle at 40% 35%, #F6D88E, #C9A25A); border-color: transparent; box-shadow: 0 0 10px rgba(240, 196, 110, .8); }
.task.done .check svg { opacity: 1; }
.task.done .t { color: #7A5420; text-shadow: 0 0 8px rgba(255, 236, 190, .9); }
#tasks-empty { margin: 8vh 0 6vh; }
.task-form { margin-top: 14px; display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; }
@media (prefers-color-scheme: dark) {
  .task.done { background: linear-gradient(170deg, rgba(120, 92, 50, .55), rgba(96, 70, 36, .5)); }
  .task.done .t { color: #F6E2B4; text-shadow: 0 0 8px rgba(240, 196, 110, .5); }
}

.viewer { position: fixed; inset: 0; z-index: 40; background: rgba(20, 16, 12, .9); display: grid; place-items: center; padding: 16px; }
.viewer img { max-width: 100%; max-height: 100%; }

@media (min-width: 720px) {
  .list { padding-left: max(12px, calc(50% - 330px)); padding-right: max(12px, calc(50% - 330px)); }
  .top-row, .top .status { max-width: 680px; margin-left: auto; margin-right: auto; }
  .top .status { margin-top: 8px; }
  .composer { padding-left: max(12px, calc(50% - 340px)); padding-right: max(12px, calc(50% - 340px)); }
  .stack { max-width: 68%; }
  .painting { height: 58vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
}
