:root{color-scheme:dark;--glass:rgba(20,20,22,.72);--line:rgba(255,255,255,.13);--accent:#c42e2c;--text:#f7f7f7;--muted:#a8a9ad;font-family:"Microsoft YaHei UI","PingFang SC",system-ui,sans-serif}
*{box-sizing:border-box}html,body,#viewer{width:100%;height:100%;height:var(--app-height,100%);margin:0;overflow:hidden;background:#090a0d;color:var(--text);overscroll-behavior:none}button,input{font:inherit}button{color:inherit}.glass{background:var(--glass);border:1px solid var(--line);box-shadow:0 10px 34px rgba(0,0,0,.22);backdrop-filter:blur(18px);-webkit-backdrop-filter:blur(18px)}
#canvas-host,canvas{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none;-webkit-user-select:none;user-select:none}.brand{position:absolute;z-index:7;top:18px;left:18px;width:116px;height:auto;filter:drop-shadow(0 3px 8px rgba(0,0,0,.38));pointer-events:none}.top-actions{position:absolute;z-index:11;right:18px;bottom:18px;height:48px;padding:4px;border-radius:12px;display:flex;gap:3px}.icon-btn,.bottom-toolbar button,.mini,.close,.panel-handle,.text-btn{border:0;background:transparent;cursor:pointer}.icon-btn{width:38px;border-radius:8px;font-size:18px}.icon-btn:hover,.bottom-toolbar button:hover,.bottom-toolbar button.active{background:rgba(255,255,255,.14)}
#loading{position:absolute;z-index:100;inset:0;background:#08090b;display:grid;place-items:center;transition:opacity .45s}.load-track{width:min(320px,54vw);height:3px;background:#292a2e;border-radius:9px;overflow:hidden}.load-track div{height:100%;width:0;background:linear-gradient(90deg,#852321,#e84742);box-shadow:0 0 14px #d53330;transition:width .2s}.loaded#loading{opacity:0;pointer-events:none}
.side-panel{position:absolute;z-index:7;top:90px;right:0;width:248px;min-height:170px;padding:18px 16px 20px;border-radius:16px 0 0 16px;transition:transform .25s}.side-panel:not(.open){transform:translateX(100%)}.panel-handle{position:absolute;left:-22px;top:43px;width:22px;height:82px;background:var(--glass);border-radius:12px 0 0 12px;font-size:26px}.side-panel:not(.open) .panel-handle{transform:rotate(180deg)}.panel-title{font-weight:650;margin-bottom:13px}.search{height:34px;border:1px solid var(--line);border-radius:8px;display:flex;align-items:center;gap:7px;padding:0 9px;margin-bottom:10px}.search input{width:100%;border:0;outline:0;background:transparent;color:#fff}.tree-row{height:36px;display:flex;align-items:center;gap:9px;border-radius:8px;padding:0 7px;font-size:13px}.tree-row:hover{background:rgba(255,255,255,.07)}.tree-row.muted{color:var(--muted)}.tree-dot{width:7px;height:7px;border:1px solid #666;border-radius:50%}.tree-dot.red{background:var(--accent);border:0}.grow{flex:1}.mini{font-size:15px}
.info-panel{position:absolute;z-index:7;top:90px;left:0;width:308px;min-height:220px;padding:25px 24px 22px;border-radius:0 18px 18px 0;transition:transform .25s;background:linear-gradient(145deg,rgba(17,18,21,.88),rgba(35,31,31,.72));overflow:visible}.info-panel:before{content:"";position:absolute;inset:0;border-radius:inherit;background:radial-gradient(circle at 10% 0,rgba(196,46,44,.17),transparent 45%);pointer-events:none}.info-panel:not(.open){transform:translateX(-100%)}.info-handle{position:absolute;right:-22px;top:43px;width:22px;height:82px;border:0;background:var(--glass);color:#fff;border-radius:0 12px 12px 0;font-size:26px;cursor:pointer}.info-panel:not(.open) .info-handle{transform:rotate(180deg)}.info-rule{position:relative;width:34px;height:3px;background:var(--accent);border-radius:3px;margin-bottom:15px}.info-panel h1{position:relative;font-size:25px;line-height:1.25;letter-spacing:.02em;margin:0 0 14px}.info-panel p{position:relative;margin:0;color:#c1c2c5;font-size:13px;line-height:1.85;white-space:pre-wrap}.info-signature{position:relative;margin-top:22px;padding-top:13px;border-top:1px solid rgba(255,255,255,.09);font:600 9px/1 Arial;letter-spacing:.18em;color:#77797e}
.drawer{position:absolute;z-index:20;top:72px;left:150px;width:320px;max-height:calc(100% - 100px);overflow:auto;padding:18px;border-radius:16px;transform:translateY(-12px);opacity:0;pointer-events:none;transition:.2s}.drawer.show,.popover.show,.modal.show{transform:none;opacity:1;pointer-events:auto}.drawer header{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}.drawer h2,.modal h2{font-size:17px;margin:0}.close{font-size:25px;color:#bbb}.setting{min-height:48px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid rgba(255,255,255,.08);font-size:13px}.setting.block{display:block;padding:13px 0}.setting.block>span{display:flex;justify-content:space-between;margin-bottom:10px}.switch input{display:none}.switch i{display:block;width:38px;height:22px;border-radius:12px;background:#4b4c50;position:relative;cursor:pointer}.switch i:after{content:"";position:absolute;width:18px;height:18px;top:2px;left:2px;border-radius:50%;background:#fff;transition:.2s}.switch input:checked+i{background:var(--accent)}.switch input:checked+i:after{left:18px}.segments{display:grid;grid-template-columns:repeat(3,1fr);padding:3px;background:rgba(0,0,0,.25);border-radius:9px}.segments button,.height-presets button,.popover button{border:0;background:transparent;padding:7px;border-radius:7px;cursor:pointer}.segments button.active,.height-presets button.active{background:rgba(255,255,255,.15)}input[type=range]{width:100%;accent-color:var(--accent)}.swatches{display:flex;gap:10px}.swatches button{width:34px;height:25px;border:2px solid transparent;border-radius:7px;background:#090a0d;cursor:pointer}.swatches button:nth-child(2){background:linear-gradient(#3d6887,#bdd5e2)}.swatches button:nth-child(3){background:#dfe3e6}.swatches button:nth-child(4){background:conic-gradient(#333 25%,#ddd 0 50%,#333 0 75%,#ddd 0)}.swatches button.active{border-color:var(--accent)}.text-btn{color:#ff746f}.version{font-size:11px;color:#777;text-align:center;margin:16px 0 0}
.popover{position:absolute;z-index:15;bottom:78px;left:50%;display:flex;gap:3px;padding:7px;border-radius:11px;transform:translate(-50%,10px);opacity:0;pointer-events:none;transition:.18s}.popover.show{transform:translate(-50%,0)}.popover button{min-width:61px;font-size:12px}.popover button:hover,.popover button.active{background:rgba(255,255,255,.13)}.popover b{display:block;font-size:18px;margin-bottom:3px}.popover-title{font-size:12px;margin:4px 6px 8px}.height-presets{display:flex;gap:4px}.height-presets button{font-size:12px}#height-panel{display:block;width:230px}
.modal{position:absolute;z-index:30;width:min(500px,calc(100% - 30px));left:50%;top:50%;padding:24px;border-radius:18px;transform:translate(-50%,-46%);opacity:0;pointer-events:none;transition:.2s}.modal.show{transform:translate(-50%,-50%)}.modal .close{position:absolute;right:16px;top:10px}.help-tabs{display:flex;gap:12px;margin:20px 0 16px}.help-tabs button{border:0;background:transparent;color:#aaa;padding:6px 0;cursor:pointer}.help-tabs button.active{color:#fff;border-bottom:2px solid var(--accent)}.help-grid{display:grid;grid-template-columns:1fr auto 1fr auto;gap:14px 12px;align-items:center;font-size:13px;color:#ccc}.help-grid kbd{background:#303137;border:1px solid #525359;padding:5px 8px;border-radius:6px;color:#fff}
.bottom-toolbar{position:absolute;z-index:10;bottom:18px;left:50%;height:48px;display:flex;align-items:center;padding:4px;border-radius:13px;transform:translateX(-50%)}.bottom-toolbar button{min-width:43px;height:40px;border-radius:9px;font-size:20px}.bottom-toolbar button:nth-last-child(2){font-size:12px;font-weight:700;min-width:47px}#axis{position:absolute;z-index:5;right:22px;top:18px;width:72px;height:72px;border-radius:50%;background:rgba(25,27,31,.32);font:bold 11px Arial}#axis i{position:absolute;width:20px;height:20px;border-radius:50%;display:grid;place-items:center;font-style:normal}.z{left:26px;top:2px;background:#315ee8}.x{left:2px;top:28px;background:#e52f32}.y{left:26px;top:28px;background:#43bc48}#axis span{position:absolute;width:10px;height:10px;right:6px;top:31px;border-radius:50%;background:#78909c}
#toast,#measure-hint{position:absolute;z-index:40;left:50%;transform:translateX(-50%);padding:9px 14px;background:rgba(12,12,14,.78);border-radius:8px;font-size:12px;opacity:0;pointer-events:none;transition:.2s}#toast{top:22px}#measure-hint{bottom:82px}#toast.show,#measure-hint.show{opacity:1}.measure-label{position:absolute;z-index:6;padding:4px 7px;background:rgba(12,12,14,.78);border:1px solid rgba(255,255,255,.2);border-radius:6px;font-size:11px;pointer-events:none;white-space:nowrap}
#mobile-controls,#measure-actions{display:none}#measure-actions{position:absolute;z-index:45;left:50%;bottom:calc(88px + env(safe-area-inset-bottom));transform:translateX(-50%);gap:8px}#measure-actions button{border:0;border-radius:20px;padding:9px 18px;color:#fff;background:rgba(25,25,28,.86);box-shadow:0 5px 18px rgba(0,0,0,.28)}#measure-actions button:first-child{background:var(--accent)}
#axis{position:absolute;z-index:5;inset:14px 18px auto auto;width:80px;height:80px;border-radius:50%;background:radial-gradient(circle at 38% 32%,rgba(75,78,83,.72),rgba(25,27,31,.48));box-shadow:inset 0 0 0 1px rgba(255,255,255,.06),0 4px 16px rgba(0,0,0,.13);pointer-events:none}
@media(max-width:700px),(pointer:coarse){
  .brand{width:84px;top:calc(12px + env(safe-area-inset-top));left:calc(12px + env(safe-area-inset-left))}.top-actions{left:auto;right:calc(8px + env(safe-area-inset-right));top:auto;bottom:calc(72px + env(safe-area-inset-bottom));height:46px}.icon-btn{width:36px}
  #axis{display:none}.side-panel{top:auto;right:10px;bottom:calc(80px + env(safe-area-inset-bottom));width:min(260px,calc(100% - 20px));min-height:0;max-height:42vh;border-radius:14px;transform:translateY(calc(100% + 100px));padding:14px}.side-panel.open{transform:none}.side-panel:not(.open){transform:translateY(calc(100% + 100px))}.panel-handle{left:auto;right:8px;top:-36px;width:74px;height:36px;border-radius:12px 12px 0 0;font-size:22px}.side-panel:not(.open) .panel-handle{transform:none}.search{height:38px}.tree-row{height:42px}
  .info-panel{top:calc(72px + env(safe-area-inset-top));left:8px;width:min(300px,calc(100% - 38px));max-height:calc(100% - 158px - env(safe-area-inset-bottom));overflow:auto;border-radius:16px;padding:18px}.info-panel:not(.open){transform:translateX(calc(-100% - 8px))}.info-handle{right:-30px;top:18px;width:30px;height:70px;border-radius:0 12px 12px 0}.info-panel:not(.open) .info-handle{transform:rotate(180deg)}
  .drawer{position:absolute;left:8px;top:auto;bottom:calc(8px + env(safe-area-inset-bottom));width:calc(100% - 16px);max-height:min(76vh,650px);border-radius:20px;padding:18px;transform:translateY(calc(100% + 30px));opacity:1}.drawer.show{transform:none}.setting{min-height:52px}.segments button{min-height:38px}.switch i{width:44px;height:26px}.switch i:after{width:22px;height:22px}.switch input:checked+i:after{left:20px}
  .modal{width:calc(100% - 16px);padding:22px;max-height:80vh;overflow:auto}.help-grid{grid-template-columns:1fr auto}.popover{bottom:calc(80px + env(safe-area-inset-bottom));max-width:calc(100% - 16px);overflow-x:auto}.popover button{min-width:68px;min-height:52px}#height-panel{width:min(270px,calc(100% - 20px))}
  .bottom-toolbar{left:8px;right:8px;bottom:calc(8px + env(safe-area-inset-bottom));height:54px;transform:none;justify-content:space-around;padding:4px}.bottom-toolbar button{flex:1;min-width:0;height:46px;font-size:19px}.bottom-toolbar button:nth-last-child(2){min-width:0}
  #toast{top:calc(62px + env(safe-area-inset-top));max-width:80%;text-align:center}#measure-hint{bottom:calc(146px + env(safe-area-inset-bottom));white-space:nowrap}#measure-actions.show{display:flex}
  #mobile-controls.walk{display:block;position:absolute;z-index:12;inset:0;pointer-events:none}.joystick-zone{position:absolute;left:calc(18px + env(safe-area-inset-left));bottom:calc(82px + env(safe-area-inset-bottom));width:126px;height:140px;pointer-events:auto;touch-action:none}.joystick-zone>span,.look-zone>span{position:absolute;bottom:0;width:100%;text-align:center;font-size:10px;color:rgba(255,255,255,.55)}.joystick-base{position:absolute;left:8px;top:4px;width:110px;height:110px;border:1px solid rgba(255,255,255,.28);border-radius:50%;background:rgba(15,15,17,.24);backdrop-filter:blur(4px)}.joystick-knob{position:absolute;left:31px;top:31px;width:46px;height:46px;border-radius:50%;background:rgba(255,255,255,.48);box-shadow:0 2px 14px rgba(0,0,0,.25);transform:translate(0,0)}.look-zone{position:absolute;right:calc(16px + env(safe-area-inset-right));bottom:calc(84px + env(safe-area-inset-bottom));width:38vw;height:33vh;border:1px dashed rgba(255,255,255,.18);border-radius:22px;pointer-events:auto;touch-action:none}.mobile-rise{position:absolute;right:calc(42vw + env(safe-area-inset-right));bottom:calc(98px + env(safe-area-inset-bottom));display:grid;gap:8px;pointer-events:auto}.mobile-rise button{width:42px;height:42px;border:1px solid rgba(255,255,255,.2);border-radius:50%;background:rgba(20,20,22,.55);color:#fff;font-size:22px;touch-action:none}
  .measure-label{font-size:12px;padding:6px 8px;max-width:75vw;overflow:hidden;text-overflow:ellipsis}
}
@media(max-height:520px) and (orientation:landscape){.brand{width:70px}.side-panel{max-height:58vh}.drawer{max-height:92vh;width:min(340px,45vw);left:auto;right:8px}.modal{max-height:92vh;width:min(480px,62vw)}.joystick-zone{bottom:calc(64px + env(safe-area-inset-bottom));transform:scale(.82);transform-origin:left bottom}.look-zone{height:48vh;bottom:calc(64px + env(safe-area-inset-bottom))}.mobile-rise{bottom:calc(72px + env(safe-area-inset-bottom))}.bottom-toolbar{height:48px}.bottom-toolbar button{height:40px}#measure-hint{bottom:calc(116px + env(safe-area-inset-bottom))}}
.setting-section{margin:14px 0 2px;color:#d25b57;font:600 9px/1.2 Arial,"Microsoft YaHei UI";letter-spacing:.14em;text-transform:uppercase}.drawer header{position:sticky;top:-18px;z-index:2;padding:4px 0 12px;background:linear-gradient(var(--glass),rgba(20,20,22,.92) 80%,transparent)}.drawer .setting{padding-left:2px;padding-right:2px}.drawer .setting.block{padding-top:12px;padding-bottom:14px}.drawer .version{margin-top:18px;padding-top:13px;border-top:1px solid rgba(255,255,255,.08);color:#aaa;font-weight:600;letter-spacing:.12em}.walk-mode canvas{cursor:grab}.walk-mode canvas:active{cursor:grabbing}
@media(min-width:701px) and (pointer:fine){.drawer{top:auto;left:auto;right:18px;bottom:78px;width:320px;max-height:calc(100vh - 108px);transform:translateY(12px);transform-origin:bottom right}.drawer.show{transform:none}}
@media(max-width:700px),(pointer:coarse){.look-zone{width:46vw;height:44vh;right:calc(10px + env(safe-area-inset-right));bottom:calc(78px + env(safe-area-inset-bottom));background:rgba(12,12,14,.08)}.drawer .setting-section{margin-top:16px}.drawer header{top:-18px}}

/* 设置面板：恢复 SDK 原版的紧凑、整块式视觉 */
.drawer{
  width:230px;
  padding:14px;
  border-radius:10px;
  background:rgba(31,32,35,.94);
  border-color:rgba(255,255,255,.08);
  box-shadow:0 8px 28px rgba(0,0,0,.3);
}
.drawer header{
  position:static;
  padding:0 0 7px;
  margin:0;
  background:none;
  border-bottom:0;
}
.drawer h2{font-size:14px;font-weight:700}
.drawer .close{font-size:20px;line-height:1;color:#bfc0c3}
.drawer .setting-section{display:none}
.drawer .setting{
  min-height:35px;
  padding:0 1px;
  font-size:11px;
  border-bottom-color:rgba(255,255,255,.08);
}
.drawer .setting.block{padding:7px 1px 8px}
.drawer .setting.block>span{margin-bottom:6px}
.drawer .switch i{width:29px;height:17px}
.drawer .switch i:after{width:13px;height:13px}
.drawer .switch input:checked+i:after{left:14px}
.drawer .segments{padding:2px;border-radius:6px}
.drawer .segments button{padding:5px 3px;border-radius:5px;font-size:10px}
.drawer .swatches{gap:8px}
.drawer .swatches button{width:25px;height:20px;border-radius:5px}
.drawer input[type=range]{height:14px}
.drawer .version{
  margin:8px 0 0;
  padding-top:9px;
  font-size:8px;
  color:#87888c;
  letter-spacing:.04em;
}
@media(min-width:701px) and (pointer:fine){
  .drawer{right:18px;bottom:78px;width:230px;max-height:calc(100vh - 96px)}
}
@media(max-width:700px),(pointer:coarse){
  .drawer{width:calc(100% - 16px);padding:16px;border-radius:16px}
  .drawer header{position:static;padding-bottom:9px;background:none}
  .drawer .setting{min-height:44px;font-size:13px}
  .drawer .setting.block{padding:10px 1px 11px}
  .drawer .segments button{min-height:34px;font-size:12px}
  .drawer .switch i{width:40px;height:24px}
  .drawer .switch i:after{width:20px;height:20px}
  .drawer .switch input:checked+i:after{left:18px}
}

/* 设置面板尺寸 ×1.2，文字 ×1.1 */
@media(min-width:701px) and (pointer:fine){
  .drawer{
    width:276px;
    padding:17px;
    border-radius:12px;
  }
  .drawer header{padding-bottom:8px}
  .drawer h2{font-size:15.4px}
  .drawer .close{font-size:22px}
  .drawer .setting{min-height:42px;font-size:12.1px}
  .drawer .setting.block{padding:8px 1px 10px}
  .drawer .setting.block>span{margin-bottom:7px}
  .drawer .switch i{width:35px;height:20px;border-radius:12px}
  .drawer .switch i:after{width:16px;height:16px}
  .drawer .switch input:checked+i:after{left:17px}
  .drawer .segments{padding:3px;border-radius:7px}
  .drawer .segments button{padding:6px 4px;border-radius:6px;font-size:11px}
  .drawer .swatches{gap:10px}
  .drawer .swatches button{width:30px;height:24px;border-radius:6px}
  .drawer input[type=range]{height:17px}
  .drawer .version{margin-top:10px;padding-top:11px;font-size:8.8px}
}
@media(max-width:700px),(pointer:coarse){
  .drawer h2{font-size:15.4px}
  .drawer .setting{font-size:14.3px}
  .drawer .segments button{font-size:13.2px}
  .drawer .version{font-size:8.8px}
}

/* 底部主工具栏：统一图标与文字信息层级 */
.bottom-toolbar{
  height:60px;
  padding:5px 7px;
  gap:3px;
  border-radius:16px;
}
.bottom-toolbar button,
.bottom-toolbar button:nth-last-child(2){
  width:62px;
  min-width:62px;
  height:50px;
  padding:4px 3px 3px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  border-radius:10px;
  font-size:10px;
  font-weight:500;
  color:#d6d7da;
}
.bottom-toolbar button svg{
  width:22px;
  height:22px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.7;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.bottom-toolbar button span{line-height:1;white-space:nowrap}
.bottom-toolbar button:hover,
.bottom-toolbar button.active{color:#fff;background:rgba(255,255,255,.13)}
.bottom-toolbar button.active svg{color:#ef4a46}
@media(max-width:700px),(pointer:coarse){
  .bottom-toolbar{height:62px;gap:2px;padding:4px 5px}
  .bottom-toolbar button,
  .bottom-toolbar button:nth-last-child(2){width:auto;min-width:0;height:52px;font-size:10px;gap:2px}
  .bottom-toolbar button svg{width:21px;height:21px}
}

/* 简介侧栏的常驻竖排开关 */
.info-handle{
  right:-34px;
  width:34px;
  height:96px;
  padding:7px 0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:5px;
  font-size:14px;
  transform:none;
}
.info-panel:not(.open) .info-handle{transform:none}
.info-handle-arrow{display:block;font-size:20px;line-height:1;transition:transform .2s}
.info-panel:not(.open) .info-handle-arrow{transform:rotate(180deg)}
.info-handle-text{font-size:12.65px;line-height:1;letter-spacing:2px;writing-mode:vertical-rl}
@media(max-width:700px),(pointer:coarse){
  .info-handle{right:-36px;width:36px;height:104px;top:18px;border-radius:0 12px 12px 0}
  .info-handle-text{font-size:13.8px}
}

/* 手游式移动端控制：浮动摇杆、全画面观察、右侧横排升降 */
@media(max-width:700px),(pointer:coarse){
  #mobile-controls.walk .joystick-zone{left:0;bottom:calc(70px + env(safe-area-inset-bottom));width:48vw;height:48vh;transform:none;background:transparent}
  .joystick-base{left:19px;top:auto;bottom:13px;transition:left .12s ease,top .12s ease,opacity .15s;background:rgba(18,19,22,.38);box-shadow:0 6px 22px rgba(0,0,0,.2)}
  .joystick-zone.active .joystick-base{transition:none;background:rgba(18,19,22,.52)}
  .joystick-knob{background:rgba(255,255,255,.58)}
  .look-zone{display:none!important}
  .mobile-rise{right:calc(12px + env(safe-area-inset-right));bottom:calc(140px + env(safe-area-inset-bottom));display:flex;grid-template:none;gap:9px}
  .mobile-rise button{width:44px;height:44px;background:rgba(20,20,22,.68);box-shadow:0 4px 14px rgba(0,0,0,.2)}
}
@media(max-height:520px) and (orientation:landscape){
  #mobile-controls.walk .joystick-zone{left:0;bottom:calc(58px + env(safe-area-inset-bottom));width:42vw;height:65vh;transform:none}
  .mobile-rise{right:calc(12px + env(safe-area-inset-right));bottom:calc(120px + env(safe-area-inset-bottom))}
}

/* 供移动端测试器在宽屏 iframe 中强制保持手游操作布局 */
.mobile-ui #axis{display:none}
.mobile-ui #mobile-controls.walk{display:block;position:absolute;z-index:12;inset:0;pointer-events:none}
.mobile-ui #mobile-controls.walk .joystick-zone{position:absolute;left:0;bottom:70px;width:42vw;height:65vh;pointer-events:auto;touch-action:none;transform:none;background:transparent}
.mobile-ui .joystick-base{position:absolute;width:110px;height:110px;border:1px solid rgba(255,255,255,.28);border-radius:50%;background:rgba(18,19,22,.38);box-shadow:0 6px 22px rgba(0,0,0,.2);backdrop-filter:blur(4px)}
.mobile-ui .joystick-knob{position:absolute;left:31px;top:31px;width:46px;height:46px;border-radius:50%;background:rgba(255,255,255,.58);box-shadow:0 2px 14px rgba(0,0,0,.25)}
.mobile-ui .mobile-rise{position:absolute;right:12px;bottom:120px;display:flex;gap:9px;pointer-events:auto}
.mobile-ui .mobile-rise button{width:44px;height:44px;border:1px solid rgba(255,255,255,.2);border-radius:50%;background:rgba(20,20,22,.68);color:#fff;font-size:22px;box-shadow:0 4px 14px rgba(0,0,0,.2);touch-action:none}
.mobile-ui .bottom-toolbar{left:8px;right:8px;bottom:8px;height:62px;transform:none;justify-content:space-around;padding:4px 5px;gap:2px}
.mobile-ui .bottom-toolbar button,.mobile-ui .bottom-toolbar button:nth-last-child(2){width:auto;min-width:0;height:52px;flex:1;font-size:10px;gap:2px}
.mobile-ui .top-actions{left:auto;right:8px;top:auto;bottom:72px;height:46px}
@media(orientation:portrait){.mobile-ui #mobile-controls.walk .joystick-zone{width:48vw;height:48vh;bottom:70px}.mobile-ui .mobile-rise{bottom:140px}}

/* 浮动摇杆的限定活动区 */
@media(orientation:portrait){
  .mobile-ui #mobile-controls.walk .joystick-zone{
    left:0;
    bottom:calc(70px + env(safe-area-inset-bottom));
    width:min(42vw,164px);
    height:min(22vh,170px);
    overflow:hidden;
  }
}
@media(orientation:landscape){
  .mobile-ui #mobile-controls.walk .joystick-zone{
    left:calc(56px + env(safe-area-inset-left));
    bottom:calc(70px + env(safe-area-inset-bottom));
    width:min(28vw,260px);
    height:40vh;
  }
}

/* 移动端专用简介：PC 端侧栏保持原样 */
.mobile-info-toggle,.mobile-info-modal{display:none}
.mobile-ui #model-info-panel{display:none}
.mobile-ui .mobile-info-toggle{
  display:flex;
  position:absolute;
  z-index:32;
  top:calc(16px + env(safe-area-inset-top));
  right:calc(18px + env(safe-area-inset-right));
  height:38px;
  padding:0 14px;
  align-items:center;
  gap:6px;
  border-radius:19px;
  color:#fff;
  border:1px solid rgba(255,255,255,.2);
  background:rgba(20,20,22,.68);
  font-size:13px;
  cursor:pointer;
  backdrop-filter:blur(12px);
}
.mobile-ui .mobile-info-toggle[aria-expanded="true"]{background:rgba(190,47,44,.88)}
.mobile-ui .mobile-info-modal{
  display:block;
  position:absolute;
  z-index:70;
  left:50%;
  top:50%;
  width:min(86vw,420px);
  max-height:min(72vh,560px);
  overflow:auto;
  padding:25px 23px 21px;
  border-radius:18px;
  background:linear-gradient(145deg,rgba(17,18,21,.96),rgba(35,31,31,.94));
  transform:translate(-50%,-46%) scale(.96);
  opacity:0;
  pointer-events:none;
  transition:opacity .2s,transform .2s;
}
.mobile-ui .mobile-info-modal.show{opacity:1;pointer-events:auto;transform:translate(-50%,-50%) scale(1)}
.mobile-info-close{position:absolute;right:13px;top:10px;width:34px;height:34px;border:0;background:transparent;color:#c7c8cb;font-size:25px;cursor:pointer}
.mobile-info-rule{width:35px;height:3px;margin-bottom:14px;border-radius:3px;background:var(--accent)}
.mobile-info-modal h2{margin:0 32px 13px 0;font-size:23px;line-height:1.3}
.mobile-info-modal p{margin:0;color:#c6c7ca;font-size:13px;line-height:1.85;white-space:pre-wrap}
.mobile-info-signature{margin-top:19px;padding-top:12px;border-top:1px solid rgba(255,255,255,.1);color:#85868b;font:600 8px/1 Arial;letter-spacing:.17em}
@media(orientation:landscape){
  .mobile-ui .mobile-info-toggle{top:calc(14px + env(safe-area-inset-top));right:calc(46px + env(safe-area-inset-right))}
  .mobile-ui .mobile-info-modal{width:min(62vw,500px);max-height:76vh;padding:21px 23px 18px}
}
.camera-editor .brand,.camera-editor .info-panel,.camera-editor .top-actions,.camera-editor #axis{display:none}
.camera-editor .bottom-toolbar{bottom:12px}

/* 在当前尺寸基础上再次放大：面板 ×1.1，文字 ×1.1 */
@media(min-width:701px) and (pointer:fine){
  .drawer{width:304px;padding:19px;border-radius:13px}
  .drawer header{padding-bottom:9px}
  .drawer h2{font-size:17px}
  .drawer .close{font-size:24px}
  .drawer .setting{min-height:46px;font-size:13.3px}
  .drawer .setting.block{padding:9px 1px 11px}
  .drawer .setting.block>span{margin-bottom:8px}
  .drawer .switch i{width:39px;height:22px}
  .drawer .switch i:after{width:18px;height:18px}
  .drawer .switch input:checked+i:after{left:19px}
  .drawer .segments{border-radius:8px}
  .drawer .segments button{padding:7px 4px;border-radius:7px;font-size:12.1px}
  .drawer .swatches{gap:11px}
  .drawer .swatches button{width:33px;height:26px;border-radius:7px}
  .drawer input[type=range]{height:19px}
  .drawer .version{margin-top:11px;padding-top:12px;font-size:9.7px}
}

/* 移动端 WebGL 合成稳定：避免地址栏变化和毛玻璃层导致控件闪烁 */
html.mobile-ui,html.mobile-ui body,html.mobile-ui #viewer{
  height:var(--app-height,100%);
  min-height:var(--app-height,100%);
  max-height:var(--app-height,100%);
}
.mobile-ui body{-webkit-text-size-adjust:100%;touch-action:none}
.mobile-ui button{-webkit-tap-highlight-color:transparent;touch-action:manipulation}
.mobile-ui #canvas-host,.mobile-ui #canvas-host canvas{
  backface-visibility:hidden;
  -webkit-backface-visibility:hidden;
  transform:translateZ(0);
}
.mobile-ui .glass,
.mobile-ui .joystick-base,
.mobile-ui .mobile-info-toggle{
  -webkit-backdrop-filter:none!important;
  backdrop-filter:none!important;
}
.mobile-ui .bottom-toolbar,
.mobile-ui .top-actions,
.mobile-ui .mobile-rise,
.mobile-ui .brand,
.mobile-ui .mobile-info-toggle{
  backface-visibility:hidden;
  -webkit-backface-visibility:hidden;
}
@media(hover:none){
  .icon-btn:hover,.bottom-toolbar button:hover,.popover button:hover,.tree-row:hover{background:transparent}
  .bottom-toolbar button.active,.popover button.active{background:rgba(255,255,255,.13)}
}

/* 微信兼容横屏：不依赖系统自动旋转，网页自身交换画幅并旋转 */
html.mobile-ui.forced-landscape #viewer{
  position:fixed!important;
  top:0!important;
  left:var(--forced-landscape-left)!important;
  width:var(--forced-landscape-width)!important;
  height:var(--forced-landscape-height)!important;
  min-width:var(--forced-landscape-width)!important;
  max-width:var(--forced-landscape-width)!important;
  min-height:var(--forced-landscape-height)!important;
  max-height:var(--forced-landscape-height)!important;
  transform:rotate(90deg);
  transform-origin:top left;
}
html.mobile-ui.forced-landscape #mobile-controls.walk .joystick-zone{
  left:calc(56px + env(safe-area-inset-left));
  bottom:calc(58px + env(safe-area-inset-bottom));
  width:min(28vh,260px);
  height:40vw;
  overflow:hidden;
}
html.mobile-ui.forced-landscape .mobile-rise{bottom:calc(126px + env(safe-area-inset-bottom))}
html.mobile-ui.forced-landscape .bottom-toolbar{height:48px}
html.mobile-ui.forced-landscape .bottom-toolbar button{height:40px}
html.mobile-ui.forced-landscape .mobile-info-toggle{top:calc(14px + env(safe-area-inset-top));right:calc(46px + env(safe-area-inset-right))}
html.mobile-ui.forced-landscape .mobile-info-modal{width:min(62vh,500px);max-height:76vw;padding:21px 23px 18px}
html.mobile-ui.forced-landscape .brand{width:70px}
html.mobile-ui.forced-landscape .drawer{max-height:92vw;width:min(340px,45vh);left:auto;right:8px}

/* 移动端右下角分层：升降在上，工具栏在下，避免横竖屏切换后重叠 */
.mobile-ui .top-actions{
  right:calc(8px + env(safe-area-inset-right));
  bottom:calc(72px + env(safe-area-inset-bottom));
  z-index:15;
}
.mobile-ui .mobile-rise{
  right:calc(12px + env(safe-area-inset-right));
  bottom:calc(126px + env(safe-area-inset-bottom));
  z-index:14;
  display:flex;
  flex-flow:row nowrap;
  gap:9px;
}
.mobile-ui .mobile-rise button{flex:0 0 44px}
@media(orientation:portrait){
  .mobile-ui .mobile-rise{bottom:calc(140px + env(safe-area-inset-bottom))}
}
@media(orientation:landscape){
  .mobile-ui .mobile-rise{bottom:calc(126px + env(safe-area-inset-bottom))}
}
html.mobile-ui.forced-landscape .mobile-rise{
  bottom:calc(126px + env(safe-area-inset-bottom));
}
