
:root{
  --wall:rgb(255,250,240); --floor:rgb(182,213,232); --fg:rgb(43,43,43);
  --muted:rgb(139,129,114); --accent:#d9694a; --night:0; --px:0; --py:0;
  --sun-x:88; --sun-y:9; --sun:rgb(245,207,91);
  --desk-top:rgb(226,195,154); --desk-front:rgb(201,164,121);
  --desk-leg:rgb(185,145,106); --desk-drawer:rgb(232,207,171);
  --serif:"Songti SC",SimSun,Georgia,serif; --hand:"PingFang SC","Microsoft YaHei",sans-serif;
  /* 房间画布的缩放/位移，由 room.js 的 fitRoom() 按视口实时写入 */
  --room-s:1; --room-inv:1; --room-x:0px; --room-y:0px; --room-floor-y:442px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;background:var(--wall);color:var(--fg);font-family:var(--hand);-webkit-font-smoothing:antialiased;overflow-x:hidden}
a{color:inherit;text-decoration:none}
.note-bar{position:relative;z-index:60;background:#2b2b2b;color:#f3ead9;font-size:11.5px;line-height:1.7}
.note-bar .in{max-width:1400px;margin-inline:auto;padding:8px 24px;display:flex;justify-content:space-between;gap:14px;flex-wrap:wrap}
.note-bar b{color:#f5cf5b;font-weight:600;letter-spacing:.08em}.note-bar a{color:#f5cf5b}

/* ---------- 滚动轨道：整屏场景固定，滚动只驱动时间 ---------- */
.track{height:320vh;position:relative}
.stage{position:sticky;top:0;height:calc(100vh - 34px);min-height:0;overflow:hidden;color:var(--fg);
  /* 画布上下留白与画布内的墙/地板同色，看起来仍是连续的一整间屋子 */
  background:linear-gradient(to bottom,
    var(--wall) 0 var(--room-floor-y,442px),
    var(--floor) var(--room-floor-y,442px) 100%)}
.shell{position:absolute;inset:0}
/* ---------- 固定设计画布：桌面 / 缩略窗口 / 手机共用同一张「订好的布局」 ----------
   设计稿 1440×630。墙、地板、桌子、所有物件、标题都画在这张画布里；
   room.js 的 fitRoom() 只做一件事：按视口把整张画布等比缩放并居中。
   因此窗口变窄、变扁、变成手机、旋转屏幕时，物件不会重排、不会被裁掉、不会留下空白。 */
.room-canvas{position:absolute;left:0;top:0;width:1440px;height:630px;pointer-events:none;
  transform:translate(var(--room-x,0px),var(--room-y,0px)) scale(var(--room-s,1));
  transform-origin:top left}
body.shake .shell{animation:shake .28s cubic-bezier(.36,.07,.19,.97) both}
@keyframes shake{0%{transform:translate(0) rotate(0)}25%{transform:translate(-7px,-4px) rotate(-.6deg)}50%{transform:translate(7px,4px) rotate(.6deg)}75%{transform:translate(-3px,-2px) rotate(-.3deg)}100%{transform:translate(0)}}

/* ---------- 房间层次：远 → 近 ----------
   l-bg   天空 / 地板 / 光晕        （最远，几乎不动）
   l-wall 靠墙家具：书架、相框、便签、挂钟（动得少；书架整座落地，不被桌子遮断）
   l-desk 书桌 + 桌面物件 + 地面盆栽（最近，动得多；左沿让开书架，只在右端形成前景遮挡）
   桌子与桌上物件同在 l-desk，且物件放在 .desk 容器内，缩放时不脱离桌面      */
.layer{position:absolute;inset:0;pointer-events:none}
.l-bg{transform:translate3d(calc(var(--px)*6px),calc(var(--py)*4px),0)}
.l-wall{transform:translate3d(calc(var(--px)*-10px),calc(var(--py)*-6px),0)}
.l-desk{transform:translate3d(calc(var(--px)*-24px),calc(var(--py)*-14px),0)}

/* ---------- 天空 / 太阳 / 云 / 星 / 地面 ---------- */
.sky{position:absolute;inset:0;background:var(--wall)}
.floor{position:absolute;left:0;right:0;bottom:0;height:33%;background:var(--floor);opacity:calc(1 - var(--night)*.28)}
.floor::after{content:"";position:absolute;inset:0;background-image:radial-gradient(rgba(43,43,43,.09) 1.4px,transparent 1.4px);background-size:24px 24px;opacity:.6}
.wall-line{position:absolute;left:0;right:0;top:67%;height:3px;background:var(--fg);opacity:.5}
.floor-shadow{position:absolute;left:26%;right:6%;bottom:2%;height:24px;background:rgba(43,43,43,.16);border-radius:50%;filter:blur(10px)}
.sun{position:absolute;left:calc(var(--sun-x)*1%);top:calc(var(--sun-y)*1%);width:92px;height:92px;border-radius:50%;
  background:var(--sun);box-shadow:0 0 0 3px var(--fg),0 0 60px 20px color-mix(in srgb,var(--sun) 45%,transparent)}
.sun::after{content:"";position:absolute;inset:0;border-radius:50%;background:var(--wall);opacity:var(--night);transform:translate(-26%,-16%)}
.cloud{position:absolute;width:130px;opacity:calc(.72 - var(--night)*.55);animation:drift 34s linear infinite}
.cloud.c1{top:4%;left:23%}.cloud.c2{top:6%;right:28%;width:100px;animation-duration:46s;animation-direction:reverse}
@keyframes drift{0%{transform:translateX(-40px)}50%{transform:translateX(40px)}100%{transform:translateX(-40px)}}
.stars{position:absolute;inset:0;opacity:var(--night)}
.stars i{position:absolute;width:3px;height:3px;border-radius:50%;background:#f5efe2;box-shadow:0 0 6px #fff;animation:twinkle 3.4s ease-in-out infinite}
@keyframes twinkle{0%,100%{opacity:.25}50%{opacity:1}}

/* ---------- 四层呼吸光晕（整场氛围） ---------- */
.glows{position:absolute;inset:0;opacity:var(--night);pointer-events:none}
.glow{position:absolute;border-radius:50%;filter:blur(34px);mix-blend-mode:screen;background:radial-gradient(circle,rgba(245,207,91,.42),rgba(245,207,91,0) 70%)}
.g1{width:420px;height:420px;right:6%;top:18%;animation:breathe1 7s ease-in-out infinite}
.g2{width:300px;height:300px;right:22%;top:34%;animation:breathe2 9s ease-in-out infinite}
.g3{width:260px;height:260px;right:2%;bottom:16%;animation:breathe3 8s ease-in-out infinite}
.g4{width:200px;height:200px;right:38%;bottom:8%;animation:breathe1 11s ease-in-out infinite reverse}
@keyframes breathe1{0%,100%{opacity:.18;transform:translate(0) scale(1)}50%{opacity:.5;transform:translate(-12px,6px) scale(1.08)}}
@keyframes breathe2{0%,100%{opacity:.4;transform:translate(0) scale(1.04)}50%{opacity:.15;transform:translate(10px,-8px) scale(.96)}}
@keyframes breathe3{0%,100%{opacity:.25;transform:translate(0)}50%{opacity:.55;transform:translate(8px,10px) scale(1.1)}}
.cone{position:absolute;right:3%;top:26%;width:620px;height:700px;pointer-events:none;opacity:calc(var(--night)*.9);
  /* 显式椭圆半径 + 模糊，让渐变在元素矩形边界前归零，深夜墙上不留一块硬边贴片 */
  background:radial-gradient(ellipse 44% 52% at 50% 30%,rgba(245,207,91,.5) 0%,rgba(245,207,91,.16) 42%,rgba(245,207,91,0) 78%);
  filter:blur(22px)}

/* ---------- 标题 / HUD ---------- */
.headline{position:absolute;top:7%;left:0;right:0;text-align:center;z-index:12;padding:0 20px;pointer-events:none}
.headline .k{font-size:11px;letter-spacing:.34em;color:var(--accent);margin:0 0 16px}
.headline h1{font-family:var(--serif);font-weight:400;font-size:78px;line-height:1.25;letter-spacing:.06em;margin:0}
.headline p{font-size:13px;color:var(--muted);letter-spacing:.1em;margin:14px 0 0}
.top{position:absolute;left:0;right:0;top:30px;z-index:30;max-width:1400px;margin-inline:auto;padding:0 40px;display:flex;justify-content:space-between;align-items:center;gap:20px;pointer-events:none}
.logo{font-family:var(--serif);font-size:25px;letter-spacing:.2em;position:relative;display:inline-block;pointer-events:auto}
.logo::after{content:"";position:absolute;left:0;right:0;bottom:-8px;height:7px;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='8' viewBox='0 0 120 8'%3E%3Cpath d='M1 5 Q 15 1 30 5 T 60 5 T 90 5 T 119 4' fill='none' stroke='%23d9694a' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x;background-size:120px 8px}
.hud{display:flex;align-items:center;gap:16px;font-size:12px;letter-spacing:.1em}
.hud .bar{width:110px;height:3px;background:var(--fg);opacity:.22;position:relative}
.hud .bar i{position:absolute;left:0;top:0;bottom:0;width:0;background:var(--accent)}
.hint{position:absolute;left:0;right:0;bottom:8px;z-index:35;font-size:11.5px;line-height:1.8;color:var(--fg);opacity:.72;letter-spacing:.04em;text-align:center;padding:0 20px;pointer-events:none}

/* ---------- 自己摆：常驻小入口 / 说明条 / 导出弹层 ----------
   正常访客只看到右下角一枚低调的小铅笔；点开才出现编辑工具栏，不打扰画面。 */
.edit-launcher{position:fixed;right:14px;bottom:14px;z-index:75;display:flex;align-items:center;gap:6px;
  border:1px solid rgba(43,43,43,.18);background:rgba(255,250,240,.9);color:#2b2b2b;
  font:inherit;font-size:12px;padding:8px 12px;border-radius:999px;cursor:pointer;letter-spacing:.04em;
  box-shadow:0 4px 14px rgba(0,0,0,.14);opacity:.58;transition:opacity .2s,transform .2s}
.edit-launcher:hover,.edit-launcher:focus-visible,.edit-launcher.on{opacity:1;transform:translateY(-1px)}
.edit-launcher .el-ico{font-size:15px;line-height:1}
body.editing .edit-launcher{display:none}
.edit-toast{position:fixed;left:16px;bottom:76px;z-index:80;
  max-width:min(420px,88vw);background:rgba(43,43,43,.94);color:#f3ead9;
  padding:9px 14px;border-radius:12px;font-size:12px;line-height:1.7;text-align:left;
  box-shadow:0 8px 26px rgba(0,0,0,.26);pointer-events:none;opacity:0;transition:opacity .25s}
.edit-toast.on{opacity:1}
.layout-export{position:fixed;inset:0;z-index:90;display:none;align-items:center;justify-content:center;
  background:rgba(30,26,22,.58);padding:16px}
.layout-export.on{display:flex}
.le-box{width:min(640px,100%);max-height:88vh;overflow:auto;background:#fffaf0;color:#2b2b2b;
  border-radius:16px;padding:19px 21px 17px;box-shadow:0 18px 50px rgba(0,0,0,.32);
  font-family:"PingFang SC","Microsoft YaHei",sans-serif}
.le-box h3{margin:0 0 8px;font-family:var(--serif);font-size:19px;letter-spacing:.06em}
.le-box p{margin:0 0 11px;font-size:12.5px;line-height:1.85;color:#5b5145}
.le-box textarea{width:100%;height:212px;box-sizing:border-box;resize:vertical;
  border:1px solid rgba(43,43,43,.2);border-radius:10px;background:#fffdf7;color:#2b2b2b;
  padding:11px 12px;font-family:Consolas,Menlo,ui-monospace,monospace;font-size:12px;line-height:1.65}
.le-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:11px}
.le-actions button{border:0;background:#f5cf5b;color:#2b2b2b;font:inherit;font-size:12px;
  padding:8px 15px;border-radius:9px;cursor:pointer}
.le-actions button.ghost{background:transparent;border:1px solid rgba(43,43,43,.28);color:#2b2b2b}
.le-actions button:hover{filter:brightness(1.06)}
.le-box .le-hint{margin:9px 0 0;font-size:12px;color:#7b6f60}
@media(max-width:820px){
  .edit-launcher{right:10px;bottom:10px;padding:9px 11px}
  .edit-launcher .el-txt{display:none}
  .edit-toast{left:10px;bottom:74px;font-size:11.5px;padding:8px 11px}
  .edit-help{font-size:11px}
  .le-box{padding:16px 15px 14px}
}
/* ---------- 编辑布局：开启后物件可自由拖动，位置自动存本地 ---------- */
.editbar{position:fixed;left:16px;bottom:14px;z-index:70;display:none;gap:8px;align-items:center;
  flex-wrap:wrap;max-width:min(760px,calc(100vw - 32px));
  background:rgba(43,43,43,.92);color:#f3ead9;padding:9px 13px;border-radius:13px;font-size:12px;
  letter-spacing:.04em;box-shadow:0 8px 24px rgba(0,0,0,.28)}
.editbar.show{display:flex}
/* 编辑模式第一行：操作说明常驻在工具栏里，不再弹到画面中间遮住标题 */
.edit-help{flex:1 1 100%;order:-1;font-size:12px;line-height:1.7;opacity:.92;
  border-bottom:1px solid rgba(243,234,217,.22);padding-bottom:7px;margin-bottom:2px}
.editbar button{border:0;background:#f5cf5b;color:#2b2b2b;font:inherit;font-size:12px;
  padding:7px 13px;border-radius:9px;cursor:pointer;transition:filter .15s}
.editbar button:hover{filter:brightness(1.06)}
.editbar button.ghost{background:transparent;color:#f3ead9;border:1px solid rgba(243,234,217,.45)}
.editbar .edit-tip{opacity:.72;margin-left:2px;white-space:nowrap}
/* 编辑模式缩放控件：选中物件后可放大/缩小，滑块与 ± 按钮同步，支持鼠标滚轮 */
.editbar .edit-scale{display:flex;align-items:center;gap:7px;margin-left:4px;padding-left:10px;border-left:1px solid rgba(243,234,217,.3)}
.editbar .edit-scale .es-label{opacity:.72;white-space:nowrap}
.editbar .edit-scale button{border:0;background:transparent;color:#f3ead9;border:1px solid rgba(243,234,217,.45);
  font:inherit;font-size:15px;line-height:1;padding:3px 9px;border-radius:8px;cursor:pointer;transition:filter .15s}
.editbar .edit-scale button:hover:not(:disabled){filter:brightness(1.5)}
.editbar .edit-scale button:disabled{opacity:.32;cursor:default}
.editbar .edit-scale input[type=range]{width:112px;accent-color:#f5cf5b;cursor:pointer}
.editbar .edit-scale input[type=range]:disabled{cursor:default;opacity:.4}
.editbar .edit-scale .es-val{font-variant-numeric:tabular-nums;min-width:40px;text-align:right;opacity:.85;white-space:nowrap}
body.editing .obj{outline:2px dashed var(--accent);outline-offset:5px;border-radius:10px;cursor:grab;z-index:22;touch-action:none}
body.editing .obj.dragging{cursor:grabbing;outline-color:#2b2b2b}
body.editing .obj svg{transform:none;animation:none;filter:drop-shadow(0 5px 0 rgba(43,43,43,.10))}
body.editing .obj .bubble{opacity:0 !important}
body.editing .obj:focus-visible{outline:3px dashed #2b2b2b}
/* 选中物件：更实的描边，提示当前在缩放 / 操作的是哪一个 */
body.editing .obj.selected{outline:3px solid #2b2b2b;outline-offset:6px}
body.editing .obj.selected svg{filter:drop-shadow(0 0 0 #2b2b2b) drop-shadow(0 6px 0 rgba(43,43,43,.18))}
/* 拉绳：挂在灯罩右下、灯体轮廓之外，是台灯上单独的可点开关（只管这盏灯亮/灭） */
.lamp-cord{position:absolute;left:72%;top:33%;width:22%;height:26%;z-index:6;
  border:0;background:none;padding:0;cursor:pointer;pointer-events:auto;transform-origin:top center}
.lamp-cord::before{content:"";position:absolute;left:50%;top:0;width:2.5px;height:100%;border-radius:2px;
  background:var(--fg);opacity:.72;transform:translateX(-50%)}
.lamp-cord::after{content:"";position:absolute;left:50%;bottom:-9px;width:13px;height:13px;border-radius:50%;
  background:var(--accent);border:2.5px solid var(--fg);transform:translateX(-50%);box-shadow:2px 2px 0 rgba(43,43,43,.12)}
.lamp-cord:focus-visible{outline:3px dashed var(--accent);outline-offset:4px;border-radius:6px}
.o-lamp.pull .lamp-cord{animation:pull .42s ease-in-out}
@keyframes pull{0%{transform:translateY(0) scaleY(1)}45%{transform:translateY(9px) scaleY(1.2)}100%{transform:translateY(0) scaleY(1)}}
.o-lamp:hover .lamp-cord{transform:translateY(-7px) rotate(-1.5deg)}
/* ---------- 台灯：实体感的灯光散射（拉绳开关，只管这盏灯） ----------
   三层结构：灯罩内侧发光 + 灯泡光点 → 桌面光斑(z5，物件站在光里)
   → 空气光锥与光尘(z10，半透明叠加，把桌面物件一起照亮)            */
.o-lamp{isolation:isolate}
/* hover 时不把整盏灯抬到前景物件之上 */
.obj.o-lamp:hover,.obj.o-lamp:focus-visible{z-index:6}
.o-lamp svg{position:relative;z-index:1}
.shade-glow{position:absolute;left:26%;top:15%;width:48%;height:30%;z-index:2;pointer-events:none;
  border-radius:46% 46% 14% 14%;
  background:radial-gradient(ellipse at 50% 78%,rgba(255,250,222,.98) 0%,rgba(255,228,152,.58) 42%,rgba(255,210,120,0) 80%);
  opacity:0;transition:opacity .4s}
/* 灯罩下沿被灯泡照亮的一条亮边，光像是从罩子里出来的 */
.shade-glow::after{content:"";position:absolute;left:9%;right:9%;bottom:-3px;height:11px;
  border-radius:50%;background:rgba(255,251,226,.95);filter:blur(5px)}
.lamp-bulb{position:absolute;left:50%;top:41%;width:12px;height:12px;z-index:3;pointer-events:none;
  transform:translateX(-50%);border-radius:50%;background:#fffbe8;
  box-shadow:0 0 12px 5px rgba(255,226,150,.95),0 0 34px 14px rgba(255,205,105,.5);opacity:0}
body.lamp-on .shade-glow{opacity:1}
body.lamp-on .lamp-bulb{animation:bulbOn .6s ease-out both}
@keyframes bulbOn{0%{opacity:0}18%{opacity:1}32%{opacity:.35}48%{opacity:1}68%{opacity:.6}100%{opacity:1}}

/* 桌面光斑：被透视压扁的椭圆，落在桌面梯形内、桌面物件的下面 */
.lamp-pool{position:absolute;left:57%;width:44%;top:29%;height:27%;z-index:5;pointer-events:none;
  border-radius:50%;filter:blur(5px);
  background:radial-gradient(ellipse at 50% 50%,rgba(255,238,180,.92) 0%,rgba(255,219,132,.55) 42%,rgba(255,203,105,.16) 68%,rgba(255,198,96,0) 82%);
  opacity:0;transform:scale(.72);transform-origin:center;
  transition:opacity .5s ease,transform .6s cubic-bezier(.16,.84,.28,1)}
/* 光斑中心更实的亮核，外围柔化，落在桌面上像一摊真的光 */
.lamp-pool::after{content:"";position:absolute;left:19%;top:22%;width:62%;height:56%;border-radius:50%;
  filter:blur(2px);
  background:radial-gradient(ellipse at 50% 50%,rgba(255,249,216,.95) 0%,rgba(255,233,164,.42) 54%,rgba(255,220,130,0) 80%)}
body.lamp-on .lamp-pool{opacity:1;transform:scale(1)}

/* 空气光锥：SVG 梯形光束，横向中心亮/边缘透明 + 高斯柔化 + 纵向衰减，从灯罩向下展开 */
.lamp-beam{position:absolute;left:56%;width:46%;top:-22%;height:72%;z-index:10;pointer-events:none;
  opacity:0;transform:scaleY(.26);transform-origin:top center;
  transition:opacity .5s ease,transform .62s cubic-bezier(.16,.84,.28,1)}
.lamp-beam svg{width:100%;height:100%;display:block;overflow:visible}
body.lamp-on .lamp-beam{opacity:1;transform:scaleY(1)}
.lamp-beam .mote{fill:#fff6d5;opacity:0;animation:mote 7s ease-in-out infinite}
.lamp-beam .mote:nth-of-type(2){animation-delay:-1.2s;animation-duration:8.4s}
.lamp-beam .mote:nth-of-type(3){animation-delay:-2.7s;animation-duration:6.2s}
.lamp-beam .mote:nth-of-type(4){animation-delay:-3.9s;animation-duration:9.1s}
.lamp-beam .mote:nth-of-type(5){animation-delay:-.6s;animation-duration:7.6s}
.lamp-beam .mote:nth-of-type(6){animation-delay:-4.8s;animation-duration:6.8s}
.lamp-beam .mote:nth-of-type(7){animation-delay:-2.1s;animation-duration:8.9s}
.lamp-beam .mote:nth-of-type(8){animation-delay:-5.4s;animation-duration:7.2s}
@keyframes mote{0%{transform:translateY(12px);opacity:0}22%{opacity:.9}72%{opacity:.5}100%{transform:translateY(-30px);opacity:0}}
/* 台灯气泡挪到灯左侧避开挂钟；悬停在绳子上时不弹台灯气泡，免得两种交互混在一起 */
.obj.o-lamp .bubble{left:auto;right:calc(100% + 12px);bottom:auto;top:26%;
  transform:translate(0,8px) rotate(-2deg) scale(.94);transform-origin:right center}
.obj.o-lamp .bubble::after{left:auto;right:-8px;bottom:auto;top:42%;transform:rotate(-45deg)}
.obj.o-lamp:hover .bubble,.obj.o-lamp:focus-visible .bubble{transform:translate(0,0) rotate(-2deg) scale(1)}
.o-lamp:has(.lamp-cord:hover) .bubble,.o-lamp:has(.lamp-cord:focus-visible) .bubble{opacity:0}

/* ---------- 桌子：上窄下宽的透视桌面，物件底边分档落在梯形内 ---------- */
/* 桌子靠房间右前方，左边让给靠墙落地的书架，两者只在边缘形成前后透视 */
.desk,.desk-stage{position:absolute;left:26%;right:6%;bottom:4%;aspect-ratio:1000/360}
/* 桌子本体与桌面物件分成两层，几何坐标完全相同：
     .desk（id=o-desk）只装桌面板、桌腿、抽屉板与两个抽屉热区，可单独拖 / 缩放；
     .desk-stage 装光斑、光束和书 / 笔 / 杯 / 台灯，它们各自独立，不跟着桌子走。
   两层同为 z-index:5，后者在 DOM 里靠后，视觉叠放顺序与拆分前完全一致。 */
.desk-stage{z-index:5;pointer-events:none}   /* 点击穿透到桌面；里面的 .obj 自己显式 auto */
/* 桌子本体是一张「大」.obj：通用 hover 会把它抬到 z-index:20 盖住桌面物件，这里压回去 */
#o-desk,#o-desk:hover,#o-desk:focus-visible{z-index:5}
#o-desk:hover .desk-svg{transform:none}
#o-desk{cursor:default}
body.editing #o-desk{cursor:grab;outline:2px dashed rgba(217,105,74,.5);outline-offset:3px}
body.editing #o-desk.dragging{cursor:grabbing;outline-color:#2b2b2b}
body.editing #o-desk.selected{outline:3px solid #2b2b2b;outline-offset:5px}
.desk-svg{width:100%;height:100%;display:block;pointer-events:none;overflow:visible}
.desk-svg path,.desk-svg circle{stroke:var(--fg);stroke-width:3.4;stroke-linecap:round;stroke-linejoin:round}
.d-top{fill:var(--desk-top)}
.d-front{fill:var(--desk-front)}
.d-leg{fill:var(--desk-leg)}
.d-drawer{fill:var(--desk-drawer)}
.d-grain{fill:none;stroke-width:2.2;opacity:.42}
.d-detail{fill:none;stroke-width:2.4;opacity:.6}
.d-knob{fill:var(--fg);stroke-width:1.4}

/* ---------- 书桌的两个抽屉：点一下，抽屉拉出一张纸 ----------
   左「纸条匣」随机便签，右「索引卡」列最近文章；热区按 SVG 坐标百分比压在抽屉板上，
   不进 .obj 列表，所以编辑摆位时不会被拖走，也不会写进布局数据。            */
.drawer-hit{position:absolute;top:55.5%;height:12%;border:0;background:transparent;padding:0;
  pointer-events:auto;cursor:pointer;z-index:11;border-radius:8px}
.drawer-hit.dh-left{left:24%;width:19%}
.drawer-hit.dh-right{left:57%;width:19%}
.drawer-hit:focus-visible{outline:3px dashed var(--accent);outline-offset:3px}
.drawer-hit::after{content:attr(data-tip);position:absolute;left:50%;bottom:calc(100% + 8px);
  width:max-content;background:#fffdf6;color:#2b2b2b;border:2px solid #2b2b2b;border-radius:11px;
  padding:5px 10px;font-size:11px;line-height:1.5;white-space:nowrap;pointer-events:none;
  opacity:0;transform:translate(-50%,6px) rotate(-2deg);transition:opacity .2s,transform .24s;
  box-shadow:2px 3px 0 rgba(43,43,43,.13)}
.drawer-hit:hover::after,.drawer-hit:focus-visible::after{opacity:1;transform:translate(-50%,0) rotate(-2deg)}
/* 抽屉板往外拉：SVG 里 1px = 1 用户单位，13 单位约为桌面高度的 3.6% */
.desk .dl-left,.desk .dl-right{transition:transform .34s cubic-bezier(.2,.8,.3,1),filter .34s}
.desk.d-open-left  .dl-left,
.desk.d-open-right .dl-right{transform:translateY(18px);filter:drop-shadow(0 7px 3px rgba(43,43,43,.28))}
/* 纸已抽出，就别再叠一个热区气泡在旁边 */
.desk.d-open-left  .drawer-hit::after,
.desk.d-open-right .drawer-hit::after{opacity:0}
body.editing .drawer-hit{pointer-events:none}

/* ---------- 抽屉里抽出来的纸：纸色固定，整屋换装时只有这张纸不变 ---------- */
.drawer-card{position:absolute;bottom:12%;left:var(--card-x,50%);width:min(360px,86vw);
  z-index:45;background:#fffdf6;color:#2b2b2b;border:2.5px solid #2b2b2b;
  border-radius:12px 15px 12px 14px;padding:22px 26px 18px;font-family:var(--hand);
  transform:translate(-50%,0) rotate(-1.2deg);
  box-shadow:5px 7px 0 rgba(43,43,43,.16),0 18px 36px rgba(43,43,43,.16);
  animation:cardIn .34s cubic-bezier(.2,.85,.3,1) both}
.drawer-card[hidden]{display:none}
.dc-left{--card-x:40%}
.dc-right{--card-x:68%}
@keyframes cardIn{
  from{opacity:0;transform:translate(-50%,22px) rotate(-2.6deg) scale(.95)}
  to  {opacity:1;transform:translate(-50%,0) rotate(-1.2deg) scale(1)}
}
.dc-tape{position:absolute;top:-12px;left:50%;width:78px;height:22px;
  transform:translateX(-50%) rotate(-3deg);background:rgba(245,207,91,.74);
  border:1px solid rgba(43,43,43,.16);box-shadow:0 2px 5px rgba(43,43,43,.12)}
.dc-close{position:absolute;right:8px;top:6px;border:0;background:transparent;color:#8b8172;
  font-size:20px;line-height:1;padding:3px 8px;border-radius:7px;cursor:pointer}
.dc-close:hover,.dc-close:focus-visible{color:#d9694a;background:rgba(43,43,43,.06)}
.dc-k{font-size:10.5px;letter-spacing:.24em;color:#d9694a;margin:0 0 12px}
.dc-note{font-family:var(--serif);font-size:clamp(17px,2.1vw,21px);line-height:2;
  margin:0 0 18px;min-height:2.5em;text-wrap:balance}
.dc-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;
  border-top:1px dashed rgba(43,43,43,.24);padding-top:12px}
.dc-mark{font-family:Georgia,serif;font-size:11px;color:#a89e90;letter-spacing:.1em}
.dc-again{border:2px solid #2b2b2b;background:#f5cf5b;color:#2b2b2b;font:inherit;
  font-size:11.5px;padding:6px 12px;border-radius:8px;cursor:pointer;transition:filter .15s}
.dc-again:hover{filter:brightness(1.06)}
.dc-title{font-family:var(--serif);font-weight:400;font-size:18px;margin:0 0 10px}
.dc-sum{font-size:11px;color:#a89e90;margin:0 0 6px}
.dc-list{margin:0 0 12px}
.dc-row{display:grid;grid-template-columns:22px 1fr auto;gap:9px;align-items:baseline;
  padding:8px 2px;border-bottom:1px dashed rgba(43,43,43,.18);font-size:12.5px}
.dc-row:hover{color:#d9694a}
.dc-row .n{font-family:Georgia,serif;font-size:10.5px;color:#a89e90}
.dc-row .t{font-family:var(--serif);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dc-row .d{font-size:10.5px;color:#a89e90;white-space:nowrap}
.dc-more{font-size:12px;color:#d9694a;text-decoration:underline;text-underline-offset:4px}
@media(prefers-reduced-motion:reduce){
  .drawer-card{animation:none}
  .desk .dl-left,.desk .dl-right{transition:none}
}

/* ---------- 物件：场景 + 内容入口；所有物件同步微动，不各自乱跳 ---------- */
.obj{position:absolute;display:block;color:var(--fg);pointer-events:auto;cursor:pointer;z-index:5}
button.obj{border:0;background:none;padding:0;font:inherit;color:var(--fg)}
.obj svg{display:block;width:100%;height:auto;overflow:visible;
  filter:drop-shadow(0 5px 0 rgba(43,43,43,.10));animation:float 7s ease-in-out infinite}
@keyframes float{0%,100%{transform:translateY(0)}50%{transform:translateY(-2.5px)}}
.o-lamp svg{animation:none}
.obj:hover{z-index:20}
.obj:hover svg,.obj:focus-visible svg{animation:none;transform:translateY(-7px) rotate(-1.5deg);filter:drop-shadow(0 9px 0 rgba(43,43,43,.16))}
.obj:focus-visible{outline:3px dashed var(--accent);outline-offset:6px;border-radius:8px}
.obj .bubble{position:absolute;left:50%;bottom:calc(100% + 10px);width:max-content;max-width:190px;
  background:#fffdf6;color:#2b2b2b;border:2.5px solid var(--fg);border-radius:14px 16px 13px 15px;
  padding:8px 13px;font-size:11.5px;line-height:1.7;text-align:center;pointer-events:none;
  opacity:0;transform:translate(-50%,8px) rotate(-2deg) scale(.94);transform-origin:center bottom;
  transition:opacity .2s,transform .28s cubic-bezier(.34,1.56,.64,1);
  box-shadow:3px 4px 0 rgba(43,43,43,.13);z-index:40}
.obj .bubble::after{content:"";position:absolute;left:50%;bottom:-8px;width:12px;height:12px;
  background:#fffdf6;border-right:2.5px solid var(--fg);border-bottom:2.5px solid var(--fg);transform:translateX(-50%) rotate(45deg)}
.obj .bubble b{display:block;font-size:13px;font-weight:600;color:#d9694a;margin-bottom:2px}
.obj:hover .bubble,.obj:focus-visible .bubble{opacity:1;transform:translate(-50%,0) rotate(-2deg) scale(1)}

/* ---------- 墙面层：书架靠左墙、整座落地；相框 / 便签 / 挂钟各占一块墙 ----------
   书架底边落在地板线下方一点（踩进地板），且桌子左沿不与它重叠，所以底脚与投影完整可见 */
.o-shelf{width:331px;left:1.5%;bottom:30%;z-index:2}
.o-shelf::after{content:"";position:absolute;left:-5%;right:-5%;bottom:-10px;height:20px;pointer-events:none;
  background:rgba(43,43,43,.2);border-radius:50%;filter:blur(8px)}
.o-frame{width:128px;left:28%;top:29%;transform:rotate(-3deg);z-index:3}
.o-clock{width:96px;right:16%;top:12%;z-index:3}
.notes span{position:absolute;font-family:var(--serif);font-size:12.5px;padding:6px 11px;border:2px solid var(--fg);
  background:#fffdf6;color:#2b2b2b;box-shadow:2px 3px 0 rgba(43,43,43,.13);animation:sway 7s ease-in-out infinite}
/* 便签贴在相框右侧一列，不压标题、不压相框、不压桌面 */
.notes .n1{left:39%;top:35%;background:#f5cf5b;transform:rotate(-4deg)}
.notes .n2{left:39%;top:40%;background:#b6d5e8;transform:rotate(3deg)}
@keyframes sway{0%,100%{translate:0 0}50%{translate:0 -3px}}

/* ---------- 桌面：按「后 → 前」斜向错落，分成三组，不再一条直线 ----------
   桌面上窄下宽，越靠后可用横向越窄；所以后排两件都往里收，底边一定落在桌面梯形内。
   七个物件底边分七档，从后向前依次靠近人：
     84% 书堆(中左后)  82% 台灯(右后·放大)  66% 笔记本(中央主件)  64% 钢笔(搭在本子右侧)
     57% 马克杯         56% 信封(左前)       51% 相机(右前)
   中间留出空桌面，各组之间横向留 3%~10% 空隙；只有钢笔与本子有一处合理搭靠       */
.o-stack {left:12%; bottom:84%;width:14%;  z-index:4}
.o-lamp  {right:11%;bottom:82%;width:19%;  z-index:3}
.o-book  {left:27%; bottom:66%;width:25%;  z-index:7}
.o-pen   {left:52%; bottom:64%;width:3.5%;transform:rotate(28deg);z-index:9}
.o-mug   {left:60%; bottom:57%;width:8.5%;z-index:7}
.o-mail  {left:6%;  bottom:56%;width:12%; z-index:6}
.o-camera{left:74%; bottom:51%;width:13%; z-index:7}
/* 地面盆栽：落在桌子右前方的地板上，避开底部提示文字 */
.o-plant{width:150px;right:2%;bottom:9%;z-index:12}

/* ---------- 滚动结束后的内容入口 ---------- */
.outro{min-height:52vh;background:#fffaf0;color:#2b2b2b;border-top:3px solid #2b2b2b;padding:88px 24px 90px;text-align:center}
.outro .k{font-size:11px;letter-spacing:.3em;color:#d9694a;margin:0 0 18px}
.outro h2{font-family:var(--serif);font-weight:400;font-size:clamp(30px,4.4vw,52px);margin:0 0 18px}
.outro p{font-size:14px;color:#8b8172;line-height:2;margin:0 0 30px}
.outro a{display:inline-block;border:2px solid #2b2b2b;padding:12px 30px;font-size:14px;transition:all .2s}
.outro a:hover{background:#2b2b2b;color:#fffaf0}
.outro .foot{font-size:11.5px;color:#a89e90;margin-top:46px}

@media(max-width:820px){
  /* 窄屏不重排房间：整屋仍是同一张画布，fitRoom() 按屏宽等比缩小，
     舞台高度也跟着画布收缩，所以没有中间大空白，书架 / 时钟 / 盆栽 / 便签一个都不少。 */
  .track{height:calc(43.75vw + 12vh)}
  .stage{height:calc(43.75vw + 8px)}
  /* 缩略图里看不清的纯装饰小字收起；站点导航与下方正文仍是正常字号 */
  .hint,.obj .bubble{display:none}
  .editbar{left:10px;right:10px;bottom:10px;max-width:none;flex-wrap:wrap;padding:8px 10px;gap:6px}
  .editbar button{padding:6px 10px;font-size:11px}
  .editbar .edit-tip{display:none}
  /* 缩放控件独占第二行，滑块自适应拉伸，避免工具栏溢出右边界 */
  .editbar .edit-scale{flex:1 1 100%;order:5;margin-left:0;padding-left:0;border-left:0;
    border-top:1px solid rgba(243,234,217,.3);padding-top:7px;margin-top:2px;justify-content:flex-start}
  .editbar .edit-scale input[type=range]{flex:1 1 80px;width:auto;min-width:70px}
  /* 抽屉里抽出的纸不跟画布一起缩小：手机上是居中弹层，文字始终可读 */
  .drawer-card{position:fixed;left:50%;right:auto;top:50%;bottom:auto;
    width:min(320px,88vw);padding:14px 16px 12px;animation:none;
    transform:translate(-50%,-50%) rotate(-1.2deg)}
  .dc-note{font-size:17px;min-height:2.2em;line-height:1.9;margin-bottom:12px}
  .dc-k{margin-bottom:8px}
  .dc-title{font-size:16px;margin-bottom:6px}
  .dc-row{grid-template-columns:20px 1fr;font-size:12px;padding:6px 2px}
  .dc-row .d{display:none}
  .dc-list{margin-bottom:8px}
  .dc-foot{padding-top:9px}
  .dc-tape{width:62px;height:18px;top:-10px}
}
@media(max-width:480px){
  .editbar{left:8px;right:8px;bottom:8px}
  .drawer-card{width:min(300px,90vw);padding:12px 14px 10px}
  .dc-note{font-size:16px;min-height:2.1em}
}
/* 画布尺寸固定，不需要再按超大屏给物件封顶；封顶反而会让摆位随视口变化 */
/* ==== 订好的默认布局 · 由 deploy/sync-layout.py 生成，请勿手改 BEGIN ==== */
/* 数值来源：assets/layout-defaults.js；单位是固定设计画布(1440×630)里的像素。
   画布整体等比缩放，所以桌面 / 缩略窗口 / 手机看到的是同一套摆位，不再分桌面与窄屏两套。 */
#o-desk{translate:-52px 20px}
#o-shelf{translate:-25px 67px;scale:0.840}
#o-frame{translate:-70px -96px}
#o-clock{translate:-134px -18px}
#o-stack{translate:453px 23px;scale:0.920}
#lampBtn{translate:-17px 37px}
#o-mail{translate:586px 36px;scale:0.920}
#o-book{translate:63px 108px;scale:0.760}
#o-pen{translate:1px 70px;scale:0.720}
#o-mug{translate:-369px 47px;scale:0.760}
#o-camera{translate:-518px -68px;scale:0.680}
#o-plant{translate:-836px -216px;scale:0.840}
/* ==== 订好的默认布局 · END ==== */

/* ---- 无障碍：系统开启「减少动态效果」时关掉装饰动画，内容仍完整可用 ---- */
@media (prefers-reduced-motion: reduce){
  .stage *, .stage *::before, .stage *::after,
  .drawer-card, .drawer-card *, body.shake{
    animation-duration:.001ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.001ms !important;
  }
}
