* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #0b1220; font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

/* 加载页 */
#loading { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 40%, #1b2a44, #0b1220); transition: opacity .6s ease; }
#loading.hide { opacity: 0; pointer-events: none; }
.loader-box { text-align: center; color: #dce6f5; }
.spinner { width: 54px; height: 54px; margin: 0 auto 18px; border: 4px solid rgba(255,255,255,.15);
  border-top-color: #6fb1ff; border-radius: 50%; animation: spin 1s linear infinite; }
.loader-text { font-size: 18px; font-weight: 600; letter-spacing: 1px; }
.loader-sub { font-size: 12px; opacity: .65; margin-top: 6px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 顶栏 */
#topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: 12px 18px; background: linear-gradient(180deg, rgba(8,14,26,.78), rgba(8,14,26,0)); color: #eaf1fb; }
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand .logo { font-size: 22px; }
.brand .title { font-size: 18px; font-weight: 700; }
.brand .sub { font-size: 12px; opacity: .6; }
#floors { display: flex; gap: 6px; margin-left: 8px; }
#floors button, .mode-switch button { background: rgba(255,255,255,.08); color: #dbe6f5; border: 1px solid rgba(255,255,255,.12);
  padding: 7px 12px; border-radius: 9px; font-size: 13px; cursor: pointer; transition: .15s; }
#floors button:hover, .mode-switch button:hover { background: rgba(255,255,255,.18); }
#floors button.active { background: #3b82f6; border-color: #60a5fa; color: #fff; }
.mode-switch { margin-left: auto; display: flex; gap: 6px; }
.mode-switch button.active { background: #10b981; border-color: #34d399; color: #fff; }

/* 配色面板 */
#panel { position: fixed; top: 70px; right: 16px; z-index: 20; width: 248px; padding: 16px;
  background: rgba(13,20,34,.86); backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,.1);
  border-radius: 14px; color: #e7eefb; box-shadow: 0 12px 40px rgba(0,0,0,.4); }
.panel-head { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 12px; opacity: .7; margin-bottom: 6px; }
#roomSelect { width: 100%; padding: 9px 10px; border-radius: 9px; background: #0f1726; color: #e7eefb;
  border: 1px solid rgba(255,255,255,.14); font-size: 13px; }
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; margin-bottom: 12px; }
.swatches .sw { width: 100%; aspect-ratio: 1; border-radius: 7px; cursor: pointer; border: 2px solid rgba(255,255,255,.15); transition: .12s; }
.swatches .sw:hover { transform: scale(1.12); border-color: #fff; }
.field.custom input[type=color] { width: 100%; height: 38px; border: 1px solid rgba(255,255,255,.14); border-radius: 9px; background: #0f1726; cursor: pointer; }
.panel-actions { display: flex; gap: 8px; }
.panel-actions button { flex: 1; padding: 9px; border-radius: 9px; border: none; font-size: 13px; cursor: pointer; font-weight: 600; }
#applyColor { background: #3b82f6; color: #fff; }
#applyColor:hover { background: #2f6fe0; }
#resetColor { background: rgba(255,255,255,.1); color: #dbe6f5; }
.hint { font-size: 11px; opacity: .6; margin-top: 12px; line-height: 1.5; }

/* 底部帮助 */
#help { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; padding: 12px 18px; text-align: center;
  background: linear-gradient(0deg, rgba(8,14,26,.78), rgba(8,14,26,0)); color: #cdd9ec; font-size: 13px; }
#help kbd { background: rgba(255,255,255,.12); border-radius: 4px; padding: 1px 6px; margin: 0 2px; font-size: 12px; }
#help b { color: #fff; }

#crosshair { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); z-index: 15; color: rgba(255,255,255,.7); font-size: 22px; pointer-events: none; }

.hidden { display: none !important; }
