/* =========================================================
   玻璃展厅 Glass Gallery —— 界面样式
   ========================================================= */

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #0b0e13;
  color: #eef2f6;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  -webkit-user-select: none; user-select: none;
}

#app { position: fixed; inset: 0; }
#app canvas { display: block; cursor: grab; touch-action: none; }
#app canvas.dragging { cursor: grabbing; }

/* ---------- 加载遮罩 ---------- */
#loading {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1100px 700px at 50% 32%, #1a2431 0%, #0b0e13 72%);
  transition: opacity .65s ease;
}
#loading.done { opacity: 0; pointer-events: none; }
.l-box { text-align: center; width: min(420px, 84vw); }
.l-box h1 { font-size: 40px; font-weight: 600; letter-spacing: 14px; text-indent: 14px; }
.l-sub { margin-top: 8px; font-size: 12px; letter-spacing: 8px; color: #8fa0b2; }
.l-bar {
  margin: 30px auto 14px; height: 4px; border-radius: 2px;
  background: rgba(255,255,255,.12); overflow: hidden;
}
#loadBar { width: 0%; height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, #6fb7e8, #cfe9ff); transition: width .2s ease; }
#loadText { font-size: 13px; color: #9fb0c2; }

/* ---------- 顶部标题 ---------- */
#hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(8,11,16,.55), transparent);
}
.hud-title { display: flex; align-items: baseline; gap: 12px; }
.hud-cn { font-size: 18px; font-weight: 600; letter-spacing: 6px; }
.hud-en { font-size: 10px; letter-spacing: 4px; color: #93a4b6; }
#helpBtn {
  pointer-events: auto;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(20,26,34,.55);
  color: #dfe8f1; font-size: 16px; font-weight: 700;
  cursor: pointer; backdrop-filter: blur(8px);
  transition: background .2s, transform .2s;
}
#helpBtn:hover { background: rgba(70,100,130,.6); transform: scale(1.06); }

/* ---------- 底部提示 ---------- */
#hint {
  position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%);
  z-index: 20; pointer-events: none;
  padding: 8px 18px; border-radius: 20px;
  background: rgba(14,19,26,.55);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(10px);
  font-size: 12px; letter-spacing: 1px; color: #c3cfdb;
  white-space: nowrap;
}

/* ---------- 操作说明 ---------- */
#help {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6,9,13,.55); backdrop-filter: blur(4px);
}
#help.hidden { display: none; }
.help-card {
  position: relative; width: min(460px, 90vw);
  padding: 28px 30px 22px; border-radius: 16px;
  background: rgba(18,24,32,.92);
  border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.help-card h2 { font-size: 20px; letter-spacing: 4px; margin-bottom: 16px; }
.help-card ul { list-style: none; }
.help-card li {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 9px 0; border-bottom: 1px dashed rgba(255,255,255,.09);
  font-size: 13px;
}
.help-card li b { color: #9fd0f5; font-weight: 600; white-space: nowrap; }
.help-card li span { color: #b9c5d1; text-align: right; }
.help-tip { margin-top: 16px; font-size: 12px; line-height: 1.8; color: #8fa0b2; }
#helpClose, #detailClose {
  position: absolute; top: 12px; right: 14px;
  width: 30px; height: 30px; border: none; border-radius: 50%;
  background: rgba(255,255,255,.08); color: #dfe8f1;
  font-size: 17px; line-height: 1; cursor: pointer;
  transition: background .2s;
}
#helpClose:hover, #detailClose:hover { background: rgba(255,90,90,.35); }

/* ---------- 展品详情面板 ---------- */
#detail {
  position: fixed; top: 76px; right: 20px; bottom: 60px; z-index: 30;
  width: min(340px, calc(100vw - 40px));
  padding: 24px 22px;
  border-radius: 16px;
  background: rgba(16,22,30,.82);
  border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
  overflow-y: auto;
  transform: translateX(calc(100% + 40px));
  transition: transform .45s cubic-bezier(.22,.9,.3,1);
}
#detail.open { transform: translateX(0); }
.d-badge {
  display: inline-block; margin-bottom: 12px;
  padding: 4px 12px; border-radius: 12px;
  background: rgba(110,180,240,.16);
  border: 1px solid rgba(110,180,240,.4);
  color: #9fd0f5; font-size: 12px; letter-spacing: 1px;
}
#detailImg {
  width: 100%; border-radius: 10px; margin-bottom: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: #0d1117;
}
#detailTitle { font-size: 22px; letter-spacing: 2px; margin-bottom: 6px; }
.d-meta { font-size: 13px; color: #93a4b6; margin-bottom: 12px; letter-spacing: 1px; }
.d-desc { font-size: 14px; line-height: 1.9; color: #d5dde5; }
.d-hint {
  margin-top: 18px; padding-top: 12px;
  border-top: 1px dashed rgba(255,255,255,.12);
  font-size: 12px; color: #7f8f9f; letter-spacing: 1px;
}

/* ---------- 悬停提示 ---------- */
#tooltip {
  position: fixed; z-index: 25; pointer-events: none;
  padding: 6px 14px; border-radius: 14px;
  background: rgba(14,19,26,.85);
  border: 1px solid rgba(255,255,255,.16);
  font-size: 12px; letter-spacing: 1px; color: #dbe6f0;
  transform: translate(-50%, calc(-100% - 16px));
  opacity: 0; transition: opacity .15s ease;
  white-space: nowrap;
}
#tooltip.show { opacity: 1; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; bottom: 60px; left: 50%; transform: translateX(-50%) translateY(16px);
  z-index: 55; padding: 10px 22px; border-radius: 20px;
  background: rgba(30,38,48,.92);
  border: 1px solid rgba(255,255,255,.16);
  font-size: 13px; color: #e8eef4;
  opacity: 0; pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 窄屏适配 ---------- */
@media (max-width: 720px) {
  #hint { font-size: 10px; padding: 6px 12px; bottom: 10px; }
  #detail { top: auto; left: 12px; right: 12px; bottom: 12px; width: auto;
            max-height: 46vh; transform: translateY(130%); }
  #detail.open { transform: translateY(0); }
  .l-box h1 { font-size: 30px; letter-spacing: 8px; text-indent: 8px; }
}
