/* ============ ailibababa.cn · 家 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky1) 0%, var(--sky2) 60%, var(--sky3, var(--sky2)) 100%);
  transition: background 1.2s ease;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

/* 时段调色板 */
body[data-period="morning"]  { --sky1:#ffe9d6; --sky2:#fff3e0; --ink:#7c2d12; --card:#fffaf3; --line:#fed7aa; --dim:#b98455; }
body[data-period="day"]      { --sky1:#e0f2fe; --sky2:#fff7ed; --ink:#7c2d12; --card:#fffdf8; --line:#fed7aa; --dim:#b98455; }
body[data-period="dusk"]     { --sky1:#ffd6a5; --sky2:#ffb4a2; --ink:#6b2737; --card:#fff6ee; --line:#f9c0a8; --dim:#a4634f; }
body[data-period="night"]    { --sky1:#1e293b; --sky2:#312e5f; --ink:#f8e8d8; --card:#3b3363; --line:#8a7fb8; --dim:#c4b8e0; }
body[data-period="deepnight"]{ --sky1:#0f172a; --sky2:#1e1b4b; --ink:#f8e8d8; --card:#2c2a55; --line:#6d68a8; --dim:#b0a9d6; }

/* 灯光影响屋内色调:开灯变暖亮,关灯变冷暗(夜里最明显) */
body[data-lamp="on"][data-period="night"],
body[data-lamp="on"][data-period="deepnight"] { --card:#453c74; --line:#9a90cc; }
body[data-lamp="off"][data-period="night"] { --card:#332e55; --line:#6a6398; }
body[data-lamp="off"][data-period="deepnight"] { --card:#262346; --line:#565180; }
body[data-lamp="on"][data-period="dusk"] { --card:#fff4e6; }
body[data-lamp="off"][data-period="dusk"] { --card:#f4e2d2; --line:#eeb69e; }

main { max-width: 34rem; margin: 0 auto; padding: 0 1rem; }
section { margin-bottom: 2.4rem; }

/* 滚动渐显(仅 JS 可用时启用,防止无 JS 时内容不可见) */
html.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .7s ease, transform .7s ease;
}
html.js .reveal.shown { opacity: 1; transform: none; }

/* ============ 场景:天空 + 小房子 ============ */
.scene { position: relative; height: 16rem; overflow: hidden; transition: filter 1.1s ease; }
/* 开灯:院子泛起暖光;关灯:夜色更沉 */
.scene::after {
  content: '';
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(32rem, 96vw); height: 11rem;
  background: radial-gradient(ellipse at 50% 100%, rgba(255,176,84,.26), rgba(255,176,84,0) 68%);
  opacity: 0; transition: opacity 1.1s ease;
  pointer-events: none;
}
body[data-lamp="on"] .scene::after { opacity: 1; }
body[data-lamp="off"][data-period="night"] .scene,
body[data-lamp="off"][data-period="deepnight"] .scene { filter: brightness(.78) saturate(.9); }
body[data-lamp="on"][data-period="night"] .scene,
body[data-lamp="on"][data-period="deepnight"] .scene { filter: brightness(1.07) saturate(1.06); }
body[data-lamp="off"][data-period="dusk"] .scene { filter: brightness(.94) saturate(.96); }
/* 开灯瞬间咔哒一闪(由 JS 加 .lamp-flick 触发) */
body.lamp-flick .scene { animation: flick .4s ease-out; }
@keyframes flick {
  0%   { filter: brightness(1.35); }
  35%  { filter: brightness(.9); }
  65%  { filter: brightness(1.18); }
  100% { filter: brightness(1); }
}
.sky { position: absolute; inset: 0; }

.sun {
  position: absolute; top: 1.6rem; left: 18%;
  width: 3rem; height: 3rem; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff3b0, #fbbf24);
  box-shadow: 0 0 2.6rem rgba(251,191,36,.6);
  animation: floaty 7s ease-in-out infinite;
  display: none;
}
.moon {
  position: absolute; top: 1.4rem; left: 20%;
  width: 2.6rem; height: 2.6rem; border-radius: 50%;
  background: #fef9c3; box-shadow: 0 0 2rem rgba(254,249,195,.5);
  display: none;
}
.moon::after {
  content: ''; position: absolute; top: -0.35rem; right: -0.6rem;
  width: 2.3rem; height: 2.3rem; border-radius: 50%;
  background: var(--sky1); transition: background 1.2s ease;
}
.stars { position: absolute; inset: 0; display: none; }
.stars::before, .stars::after {
  content: '';
  position: absolute; inset: 0;
  background-image:
    radial-gradient(2px 2px at 12% 22%, #fff8 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 32% 12%, #fff6 50%, transparent 51%),
    radial-gradient(2px 2px at 55% 28%, #fff9 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 71% 10%, #fff7 50%, transparent 51%),
    radial-gradient(2.2px 2.2px at 86% 24%, #fff8 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 44% 8%,  #fff6 50%, transparent 51%),
    radial-gradient(2px 2px at 92% 40%,  #fff7 50%, transparent 51%);
  animation: twinkle 3.2s ease-in-out infinite;
}
.stars::after { transform: scale(-1); animation-delay: 1.6s; }

.cloud {
  position: absolute; background: #fff; border-radius: 3rem;
  opacity: .9; filter: drop-shadow(0 .2rem .4rem rgba(0,0,0,.04));
  display: none;
}
.cloud::before, .cloud::after {
  content: ''; position: absolute; background: inherit; border-radius: 50%;
}
.cloud.c1 { top: 3.2rem; right: 12%; width: 5.4rem; height: 1.7rem; animation: drift 26s linear infinite; }
.cloud.c1::before { width: 2rem; height: 2rem; top: -0.9rem; left: 1rem; }
.cloud.c1::after  { width: 1.5rem; height: 1.5rem; top: -0.5rem; left: 2.7rem; }
.cloud.c2 { top: 6.4rem; right: 34%; width: 4rem; height: 1.3rem; opacity: .7; animation: drift 38s linear infinite reverse; }
.cloud.c2::before { width: 1.5rem; height: 1.5rem; top: -0.7rem; left: 0.8rem; }

/* 小鸟:白天偶尔飞过(纯 CSS 循环,一段飞完歇一阵) */
.bird {
  position: absolute; top: 2.6rem; left: 110%;
  font-size: 1.3rem; display: none;
  animation: flyby 34s linear infinite;
}
@keyframes flyby {
  0%   { transform: translate(0, 0); }
  8%   { transform: translate(-14rem, -1.2rem); }
  20%  { transform: translate(-30rem, .6rem); }
  32%  { transform: translate(-46rem, -1.5rem); }
  45%  { transform: translate(-58rem, .8rem); }
  55%  { transform: translate(-64rem, 0); }
  55.01%, 100% { transform: translate(-64rem, 0); opacity: 0; }
}

/* 流星:夜里偶发 */
.meteor {
  position: absolute; top: 1.2rem; right: 18%;
  width: 2px; height: 2px; border-radius: 50%;
  background: #fff; opacity: 0; display: none;
  box-shadow: 0 0 6px 1px rgba(255,255,255,.8);
  animation: shoot 9s ease-in infinite;
}
.meteor::before {
  content: ''; position: absolute; top: 50%; right: 2px;
  width: 5.5rem; height: 1.5px; transform: translateY(-50%);
  background: linear-gradient(270deg, rgba(255,255,255,.85), transparent);
  border-radius: 2px;
}
@keyframes shoot {
  0%, 84%  { opacity: 0; transform: translate(0, 0) rotate(-32deg); }
  86%      { opacity: 1; }
  96%, 100%{ opacity: 0; transform: translate(-11rem, 7rem) rotate(-32deg); }
}

/* 萤火虫:夜里出没 */
.fireflies { position: absolute; inset: 0; display: none; }
.fireflies span {
  position: absolute;
  width: .32rem; height: .32rem; border-radius: 50%;
  background: #fef08a;
  box-shadow: 0 0 .5rem .15rem rgba(254,240,138,.75);
  opacity: 0;
  animation: wander 11s ease-in-out infinite alternate, glowblink 2.8s ease-in-out infinite;
}
.fireflies span:nth-child(1) { left: 12%; top: 62%; animation-delay: 0s, .2s; }
.fireflies span:nth-child(2) { left: 24%; top: 48%; animation-delay: -3s, 1.1s; }
.fireflies span:nth-child(3) { left: 70%; top: 55%; animation-delay: -6s, .6s; }
.fireflies span:nth-child(4) { left: 84%; top: 40%; animation-delay: -8s, 1.8s; }
.fireflies span:nth-child(5) { left: 55%; top: 70%; animation-delay: -4.5s, 2.2s; }
@keyframes wander {
  from { transform: translate(0, 0); }
  to   { transform: translate(2.6rem, -1.8rem); }
}
@keyframes glowblink { 0%, 100% { opacity: .15; } 50% { opacity: .95; } }

body[data-period="day"] .sun, body[data-period="morning"] .sun,
body[data-period="dusk"] .sun { display: block; }
body[data-period="day"] .cloud, body[data-period="morning"] .cloud { display: block; }
body[data-period="night"] .moon, body[data-period="deepnight"] .moon,
body[data-period="dusk"] .moon { display: block; }
body[data-period="night"] .stars, body[data-period="deepnight"] .stars { display: block; }
body[data-period="night"] .meteor, body[data-period="deepnight"] .meteor { display: block; }
body[data-period="night"] .fireflies, body[data-period="deepnight"] .fireflies { display: block; }
body[data-period="morning"] .bird, body[data-period="day"] .bird, body[data-period="dusk"] .bird { display: block; }

/* 后院:小树 + 花 + 信箱 */
.yard {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: min(24rem, 92vw); height: 100%; pointer-events: none;
}
.tree {
  position: absolute; bottom: 0; left: -1.2rem;
  font-size: 2.8rem; line-height: 1;
  transform-origin: bottom center;
  animation: sway 6s ease-in-out infinite;
}
.flower {
  position: absolute; bottom: 0; font-size: 1.15rem; line-height: 1;
  transform-origin: bottom center;
  animation: sway 4.5s ease-in-out infinite;
}
.flower.f1 { left: 4.2rem; }
.flower.f2 { left: 5.6rem; animation-delay: -1.4s; }
.flower.f3 { left: 17.6rem; animation-delay: -2.6s; }
@keyframes sway {
  0%, 100% { transform: rotate(-2.5deg); }
  50%      { transform: rotate(2.5deg); }
}
.mailbox {
  position: absolute; bottom: 0; right: -0.6rem;
  font-size: 2rem; line-height: 1;
  pointer-events: auto; cursor: pointer; user-select: none;
  transition: transform .15s ease;
}
.mailbox:active { transform: scale(.9); }
.mailbox .mailpop {
  position: absolute; top: -1.9rem; left: 50%;
  transform: translateX(-50%) scale(0);
  transform-origin: bottom center;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: .8rem;
  padding: .18rem .6rem; font-size: .78rem; white-space: nowrap;
  transition: transform .2s ease;
  box-shadow: 0 .3rem .8rem rgba(120, 80, 20, .18);
}
.mailbox.popped .mailpop { transform: translateX(-50%) scale(1); }

/* 房子 */
.house { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 13rem; }
.roof {
  height: 3.4rem;
  background: linear-gradient(135deg, #e07a5f, #c05a3f);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  border-radius: .2rem .2rem 0 0;
}
.chimney {
  position: absolute; top: -1.6rem; right: 2rem;
  width: 1.1rem; height: 2.6rem; background: #b0563d; border-radius: .15rem;
  z-index: -1;
}
.smoke {
  position: absolute; width: .9rem; height: .9rem; border-radius: 50%;
  background: rgba(255,255,255,.75); filter: blur(1px);
  animation: rise 4s ease-out infinite; opacity: 0;
}
.smoke.s1 { top: -2.2rem; right: 2.15rem; }
.smoke.s2 { top: -2.2rem; right: 2.15rem; animation-delay: 1.3s; }
.smoke.s3 { top: -2.2rem; right: 2.15rem; animation-delay: 2.6s; }
.windchime {
  position: absolute; top: 2.9rem; left: 0.1rem;
  font-size: 1.05rem; z-index: 2;
  transform-origin: top center;
  animation: chime 5s ease-in-out infinite;
}
@keyframes chime {
  0%, 100% { transform: rotate(-6deg); }
  50%      { transform: rotate(6deg); }
}
.lantern {
  position: absolute; top: 2.75rem; right: 0.35rem;
  font-size: 1.1rem; z-index: 2;
  transform-origin: top center;
  animation: sway 7s ease-in-out infinite;
  transition: filter .8s ease;
}
body[data-lamp="on"] .lantern { filter: drop-shadow(0 0 .5rem rgba(255,120,60,.9)); }

.wall-body {
  height: 5.4rem; background: linear-gradient(#fff3e2, #ffe8cc);
  border: 2px solid #f3c9a5; border-top: none;
  display: flex; align-items: center; justify-content: center; gap: 1.1rem;
  position: relative;
}
.win {
  width: 2.1rem; height: 2.1rem; border-radius: .3rem;
  border: 2px solid #c98d61; background: #fff8e7;
  position: relative; transition: box-shadow .8s ease, background .8s ease;
}
.win .cross { position: absolute; inset: 0; }
.win .cross::before, .win .cross::after {
  content: ''; position: absolute; background: #c98d61;
}
.win .cross::before { left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; }
.win .cross::after  { top: 50%; left: 0; right: 0; height: 2px; margin-top: -1px; }
.win .plant {
  position: absolute; bottom: -0.55rem; left: 50%; transform: translateX(-50%);
  font-size: .8rem; line-height: 1; z-index: 2;
}
/* 关灯:窗户映天色 */
body[data-lamp="off"] .win { background: #e3eef7; box-shadow: none; }
body[data-lamp="off"][data-period="morning"] .win { background: #fdeedd; }
body[data-lamp="off"][data-period="dusk"] .win { background: #e8c8b8; }
body[data-lamp="off"][data-period="night"] .win,
body[data-lamp="off"][data-period="deepnight"] .win { background: #2e3552; border-color: #55486f; }
/* 开灯:暖黄 + 光束洒到墙根 */
body[data-lamp="on"] .win {
  background: #ffd76e;
  box-shadow: 0 0 1.2rem .35rem rgba(255, 200, 80, .6);
}
body[data-lamp="on"] .win::after {
  content: '';
  position: absolute; top: 85%; left: -45%;
  width: 190%; height: 300%;
  background: linear-gradient(rgba(255,205,110,.42), rgba(255,205,110,0));
  clip-path: polygon(18% 0, 82% 0, 100% 100%, 0% 100%);
  filter: blur(3px);
  pointer-events: none; z-index: 1;
  animation: beams .9s ease-out;
}
@keyframes beams { from { opacity: 0; } to { opacity: 1; } }
.door {
  width: 1.9rem; height: 3.3rem; align-self: flex-end;
  background: #c05a3f; border: 2px solid #9c4229; border-bottom: none;
  border-radius: .35rem .35rem 0 0; position: relative;
}
/* 开灯:门缝漏光 */
.door::after {
  content: '';
  position: absolute; bottom: -0.32rem; left: -18%; right: -18%;
  height: .55rem; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255,205,110,.75), rgba(255,205,110,0) 70%);
  opacity: 0; transition: opacity .9s ease;
  pointer-events: none;
}
body[data-lamp="on"] .door::after { opacity: 1; }
.door .knob {
  position: absolute; right: .25rem; top: 50%;
  width: .28rem; height: .28rem; border-radius: 50%; background: #ffe1a8;
}
.cat {
  position: absolute; right: -2.4rem; bottom: 0;
  font-size: 1.9rem; cursor: pointer; user-select: none;
  transition: transform .15s ease;
  animation: catbob 3.4s ease-in-out infinite;
}
@keyframes catbob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-.18rem); }
}
.cat:active { transform: scale(.88); }
.cat .meow {
  position: absolute; top: -1.1rem; left: 50%; transform: translateX(-50%) scale(0);
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: .8rem;
  padding: .1rem .5rem; font-size: .75rem; white-space: nowrap;
  transition: transform .18s ease; z-index: 3;
}
.cat.meowing .meow { transform: translateX(-50%) scale(1); }
.heart {
  position: absolute; font-size: .9rem; pointer-events: none;
  animation: heartup 1.2s ease-out forwards; z-index: 3;
}
@keyframes heartup {
  0%   { opacity: 0; transform: translateY(0) scale(.6); }
  25%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(-2.4rem) translateX(.5rem) scale(1.15); }
}

@keyframes rise {
  0%   { transform: translateY(0) scale(.6); opacity: 0; }
  25%  { opacity: .8; }
  100% { transform: translateY(-3.2rem) translateX(.6rem) scale(1.5); opacity: 0; }
}
@keyframes twinkle { 0%,100% { opacity: .5; } 50% { opacity: 1; } }
@keyframes drift { from { transform: translateX(4rem); } to { transform: translateX(-34rem); } }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-.4rem); } }

/* ============ 门厅 ============ */
.hall { text-align: center; }
.greet { font-size: 1rem; color: var(--dim); letter-spacing: .12em; margin-bottom: .4rem; }
h1 {
  font-size: clamp(2rem, 7vw, 2.9rem);
  background: linear-gradient(90deg, #ea580c, #d97706);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: .8rem;
}
body[data-period="night"] h1, body[data-period="deepnight"] h1,
body[data-period="dusk"] h1 {
  background: linear-gradient(90deg, #ffb26b, #ffd9a0);
  -webkit-background-clip: text; background-clip: text;
}
.sub { font-size: 1.02rem; line-height: 1.9; color: var(--dim); margin-bottom: .4rem; }
.stats { font-size: .88rem; color: var(--dim); margin-bottom: .4rem; }
.stats b { color: #ea580c; }
body[data-period="night"] .stats b, body[data-period="deepnight"] .stats b { color: #ffb26b; }
.daily { font-size: .9rem; color: var(--dim); opacity: .9; min-height: 1.5em; }
.caret {
  display: inline-block; width: 2px; height: 1em;
  background: currentColor; margin-left: 2px;
  vertical-align: -0.15em;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ============ 客厅:挂钟 + 灯开关 ============ */
.living { display: flex; align-items: stretch; justify-content: center; gap: 1.2rem; flex-wrap: wrap; }
.clockbox {
  display: flex; align-items: center; gap: 1.2rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 1.1rem;
  padding: 1rem 1.5rem; box-shadow: 0 .5rem 1.6rem rgba(180, 83, 9, .08);
  transition: background .8s ease, border-color .8s ease;
}
.face {
  position: relative; width: 5.6rem; height: 5.6rem; border-radius: 50%;
  background: var(--card); border: 4px solid #e8a865;
  box-shadow: inset 0 0 .5rem rgba(180,83,9,.15);
  flex: none;
}
.face .t12,.face .t3,.face .t6,.face .t9 {
  position: absolute; background: #c98d61; border-radius: 1px;
}
.face .t12 { left: 50%; top: .3rem; width: 2px; height: .45rem; margin-left: -1px; }
.face .t6  { left: 50%; bottom: .3rem; width: 2px; height: .45rem; margin-left: -1px; }
.face .t3  { top: 50%; right: .3rem; height: 2px; width: .45rem; margin-top: -1px; }
.face .t9  { top: 50%; left: .3rem; height: 2px; width: .45rem; margin-top: -1px; }
.hand {
  position: absolute; left: 50%; bottom: 50%;
  transform-origin: 50% 100%; border-radius: 2px;
}
.hand.hour { width: 4px; height: 1.35rem; margin-left: -2px; background: #9a5b33; }
.hand.min  { width: 3px; height: 1.95rem; margin-left: -1.5px; background: #c05a3f; }
.hand.sec  { width: 1.5px; height: 2.2rem; margin-left: -.75px; background: #ea580c; }
.face .pin {
  position: absolute; left: 50%; top: 50%; width: .5rem; height: .5rem;
  margin: -.25rem 0 0 -.25rem; border-radius: 50%; background: #ea580c;
}
.dtime .date { font-size: .9rem; color: var(--dim); letter-spacing: .08em; margin-bottom: .2rem; }
.dtime .time {
  font-size: 1.7rem; font-weight: 700; color: var(--ink);
  font-variant-numeric: tabular-nums; letter-spacing: .05em;
}
.lampswitch {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem;
  min-width: 5.6rem; min-height: 44px;
  background: var(--card); border: 1px solid var(--line); border-radius: 1.1rem;
  padding: .8rem 1.1rem; cursor: pointer;
  color: var(--ink); font-size: .85rem;
  box-shadow: 0 .5rem 1.6rem rgba(180, 83, 9, .08);
  transition: transform .15s ease, background-color .8s ease, border-color .8s ease;
}
.lampswitch:active { transform: scale(.94); }
.lampswitch .bulb { font-size: 1.6rem; transition: transform .3s ease; }
.lampswitch:hover .bulb { transform: scale(1.15); }
body[data-lamp="off"] .lampswitch .bulb { filter: grayscale(1) opacity(.5); }
body[data-lamp="on"] .lampswitch .bulb {
  animation: bulbpulse 2.6s ease-in-out infinite;
}
@keyframes bulbpulse {
  0%, 100% { filter: drop-shadow(0 0 .3rem rgba(255,200,80,.7)); }
  50%      { filter: drop-shadow(0 0 .6rem rgba(255,200,80,1)); }
}

/* ============ 书房门牌 ============ */
.doorcard {
  background: var(--card); border: 1px solid var(--line); border-radius: 1.1rem;
  padding: 1.3rem 1.5rem; text-align: left; display: flex; align-items: center;
  gap: 1rem; text-decoration: none;
  box-shadow: 0 .5rem 1.6rem rgba(234, 88, 12, .10);
  transition: transform .18s ease, box-shadow .18s ease, background-color .8s ease, border-color .8s ease;
  color: var(--ink);
}
.doorcard:hover { transform: translateY(-2px); box-shadow: 0 .8rem 2rem rgba(234, 88, 12, .18); }
.doorcard .ico {
  flex: none; width: 2.9rem; height: 2.9rem; border-radius: .8rem;
  background: linear-gradient(135deg, #fb923c, #f97316);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: #fff;
  transition: transform .3s ease;
}
.doorcard:hover .ico { transform: rotate(-8deg) scale(1.08); }
.doorcard .txt { flex: 1; min-width: 0; }
.doorcard .t { display: block; font-size: 1.05rem; font-weight: 600; color: var(--ink); }
.doorcard .d { display: block; font-size: .85rem; color: var(--dim); margin-top: .25rem; }
.doorcard .go { flex: none; color: #ea580c; font-size: 1.2rem; transition: transform .18s ease; }
.doorcard:hover .go { transform: translateX(.25rem); }

/* ============ 留言墙 ============ */
.wallsec h2 { text-align: center; font-size: 1.25rem; color: var(--ink); margin-bottom: .3rem; }
.wallsub { text-align: center; font-size: .88rem; color: var(--dim); margin-bottom: 1.1rem; }
.gbform {
  display: flex; flex-direction: column; gap: .6rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 1.1rem;
  padding: 1rem 1.1rem; box-shadow: 0 .5rem 1.6rem rgba(180, 83, 9, .08);
  margin-bottom: 1.4rem;
  transition: background-color .8s ease, border-color .8s ease;
}
.gbform input[name="name"], .gbform textarea {
  font: inherit; font-size: 16px;   /* 防 iOS 聚焦自动放大 */
  color: var(--ink); background: transparent;
  border: 1px solid var(--line); border-radius: .7rem; padding: .6rem .8rem;
  resize: vertical;
  min-height: 44px;
}
.gbform textarea { min-height: 0; }
.gbform input:focus, .gbform textarea:focus { outline: 2px solid #fb923c55; border-color: #fb923c; }
.gbform .hp { position: absolute; left: -9999px; height: 0; width: 0; opacity: 0; }
.gbform button {
  align-self: flex-end; font: inherit; font-size: 16px; font-weight: 600; cursor: pointer;
  color: #fff; background: linear-gradient(135deg, #fb923c, #f97316);
  border: none; border-radius: .7rem; padding: .6rem 1.3rem; min-height: 44px;
  transition: transform .15s ease, opacity .15s ease, box-shadow .15s ease;
}
.gbform button:hover { box-shadow: 0 .35rem 1rem rgba(234, 88, 12, .3); }
.gbform button:active { transform: scale(.95); }
.gbform button:disabled { opacity: .55; cursor: wait; }
.gbmsg { font-size: .82rem; color: #d97706; min-height: 1.1em; text-align: right; }
.gblist { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.note {
  position: relative;
  background: #fff8d6; color: #6b4f1d;
  border-radius: .35rem; padding: 1.5rem .9rem .8rem;
  box-shadow: 0 .35rem .9rem rgba(120, 80, 20, .14);
  word-break: break-word; overflow-wrap: anywhere;
  transition: transform .18s ease, box-shadow .18s ease, background-color .8s ease, color .8s ease;
  animation: notepop .35s ease-out;
}
@keyframes notepop {
  from { opacity: 0; transform: scale(.85) rotate(-2deg); }
  to   { opacity: 1; transform: scale(1) rotate(0); }
}
.note:hover { transform: translateY(-3px) rotate(-.6deg); box-shadow: 0 .6rem 1.3rem rgba(120, 80, 20, .2); }
body[data-period="night"] .note, body[data-period="deepnight"] .note {
  background: #4a4270; color: #ffe9c9;
}
body[data-lamp="off"][data-period="night"] .note,
body[data-lamp="off"][data-period="deepnight"] .note { background: #3b3560; color: #e3d2bd; }
body[data-lamp="on"][data-period="night"] .note,
body[data-lamp="on"][data-period="deepnight"] .note { background: #544a86; color: #ffeed6; }
.note::before {
  content: '📌'; position: absolute; top: -.55rem; left: 50%;
  transform: translateX(-50%); font-size: 1rem;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.2));
}
.note .who { display: block; font-size: .78rem; opacity: .75; margin-bottom: .3rem; }
.note .what { display: block; font-size: .95rem; line-height: 1.55; }
.note .when { display: block; font-size: .72rem; opacity: .55; margin-top: .45rem; }
.gbempty { grid-column: 1 / -1; text-align: center; color: var(--dim); font-size: .9rem; padding: 1.4rem 0; }
.gbmore {
  display: block; margin: 1.2rem auto 0; font: inherit; font-size: 16px;
  color: var(--dim); background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: .55rem 1.4rem; min-height: 44px; cursor: pointer;
}
.gbmore:disabled { opacity: .5; }
.gbmore[hidden] { display: none; }

/* ============ 回到顶部 ============ */
.totop {
  position: fixed; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  width: 44px; height: 44px; border-radius: 50%;
  font-size: 1.25rem; line-height: 1; cursor: pointer;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: 0 .4rem 1.2rem rgba(120, 80, 20, .22);
  opacity: 0; pointer-events: none; transform: translateY(1rem);
  transition: opacity .25s ease, transform .25s ease;
  z-index: 50;
}
.totop.show { opacity: 1; pointer-events: auto; transform: none; }
.totop:active { transform: scale(.9); }

/* ============ 页脚 ============ */
footer {
  text-align: center; font-size: .8rem; color: var(--dim);
  padding: 2.5rem 0 calc(2rem + env(safe-area-inset-bottom, 0px));
}

/* ============ 动画 & 响应式 ============ */
@media (max-width: 480px) {
  .scene { height: 13.5rem; }
  .house { width: 10.5rem; }
  .win { width: 1.8rem; height: 1.8rem; }
  .wall-body { height: 4.8rem; gap: .9rem; }
  .door { width: 1.7rem; height: 3rem; }
  .cat { right: -1.9rem; font-size: 1.65rem; }
  .tree { font-size: 2.2rem; left: -0.6rem; }
  .flower { font-size: 1rem; }
  .flower.f1 { left: 3.6rem; }
  .flower.f2 { left: 4.8rem; }
  .flower.f3 { left: 14.6rem; }
  .mailbox { right: 0; font-size: 1.7rem; }
  .clockbox { width: 100%; justify-content: center; padding: .9rem 1rem; gap: 1rem; }
  .face { width: 4.9rem; height: 4.9rem; }
  .dtime .time { font-size: 1.45rem; }
  .living { gap: .8rem; }
  .doorcard { padding: 1.05rem 1.1rem; gap: .8rem; }
  .gblist { grid-template-columns: 1fr; }
  section { margin-bottom: 2rem; }
}
@media (max-width: 350px) {
  .house { width: 9.2rem; }
  .clockbox { flex-direction: column; gap: .7rem; }
  h1 { font-size: 1.8rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
