/* 共享 UI 风格（参考模型图鉴：深色面板 + 金色描边） */
:root { --gold: #e3b955; --gold2: #f5d58a; --panel: rgba(18, 16, 14, 0.82); --panel2: rgba(30, 26, 22, 0.92); --line: rgba(227, 185, 85, 0.35); --txt: #eee; --dim: #9a9384;
  --sat: env(safe-area-inset-top); --sab: env(safe-area-inset-bottom); --sal: env(safe-area-inset-left); --sar: env(safe-area-inset-right); }
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #111; font-family: 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif; color: var(--txt); user-select: none; -webkit-user-select: none; }
#app { position: fixed; inset: 0; } #app canvas { display: block; touch-action: none; }

/* v55 文档类页面（试听 / 世界观 / 平衡 / 测试…）：ui.css 默认锁定 html+body 给 3D 画布用；这些页面需要整页滚动（手机触摸滑动），必须同时解锁 html 与 body */
html.doc { overflow-x: hidden !important; overflow-y: auto !important; height: auto !important; -webkit-overflow-scrolling: touch; }
html.doc body { overflow: visible !important; height: auto !important; min-height: 100%; touch-action: auto; user-select: text; -webkit-user-select: text; } /* 只让文档滚动：body 不能再成为第二个滚动容器（否则手势被吞） */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 8px 30px rgba(0,0,0,.4); }
.btn { background: var(--panel); color: var(--txt); border: 1px solid var(--line); border-radius: 18px; padding: 7px 14px; font-size: 13px; cursor: pointer; white-space: nowrap; font-family: inherit; }
.btn:hover { background: rgba(60,50,35,.9); }
.btn.on, .btn.primary { background: var(--gold); color: #221; border-color: var(--gold); font-weight: 700; }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 14px; }
.title { color: var(--gold); letter-spacing: 2px; font-weight: 700; }
.dim { color: var(--dim); }
#loading { position: fixed; inset: 0; display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; background: radial-gradient(#2a2418, #0c0a08); z-index: 100; transition: opacity .4s; }
#loading.hide { opacity: 0; pointer-events: none; }
#loading .t { color: var(--gold); font-size: 22px; letter-spacing: 6px; font-weight: 700; }
#loading .bar { width: 220px; height: 6px; background: rgba(255,255,255,.08); border-radius: 3px; overflow: hidden; border: 1px solid var(--line); }
#loading .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #a07a2a, var(--gold2)); transition: width .2s; }
#loading .s { color: var(--dim); font-size: 12px; }
.toast { position: fixed; left: 50%; top: calc(70px + var(--sat)); transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--line); color: var(--gold2); padding: 8px 18px; border-radius: 18px; font-size: 13px; z-index: 50; pointer-events: none; opacity: 0; transition: opacity .25s; }
.toast.show { opacity: 1; }
::-webkit-scrollbar { width: 4px; height: 4px; } ::-webkit-scrollbar-thumb { background: var(--line); border-radius: 2px; }

/* 返回素材工坊（统一按键模块 src/hubback.js：v15 固定左上角；--hubw = 按键宽度 + 间距，供左上角面板让位） */
:root { --hubw: 120px; }
.hubback { display: inline-flex; align-items: center; gap: 4px; color: var(--gold2); text-decoration: none; font-size: 13px; padding: 0 13px 0 10px; height: 32px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel2); white-space: nowrap; line-height: 1; box-shadow: 0 4px 16px rgba(0,0,0,.35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.hubback:hover { background: rgba(70, 56, 30, 0.95); border-color: var(--gold); }
.hubback .hb-i { font-size: 17px; margin-top: -2px; }
.hubback .hb-s { display: none; }
.hubfix { position: fixed; z-index: 60; top: calc(12px + var(--sat)); left: calc(12px + var(--sal)); }
@media (max-width: 760px) { .hubback .hb-l { display: none; } .hubback .hb-s { display: inline; } .hubback { padding: 0 11px 0 8px; font-size: 12.5px; } }
