/* ============ 中山六院 3D 园区模型 · 界面样式 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --accent: #1f8a63;
  --accent-bright: #2fbf8a;
  --panel-bg: rgba(13, 22, 19, 0.78);
  --panel-border: rgba(255, 255, 255, 0.12);
  --text-main: #f2f6f4;
  --text-dim: #9fb3ab;
}

html, body { width: 100%; height: 100%; overflow: hidden; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  background: #0a1410;
  color: var(--text-main);
  user-select: none;
}

#scene { position: fixed; inset: 0; display: block; }

/* ---------------- 加载页（浅色 · 与日景一致） ---------------- */
#loading {
  position: fixed; inset: 0; z-index: 100;
  background:
    radial-gradient(820px 460px at 78% 10%, rgba(47,191,138,.16), rgba(47,191,138,0) 62%),
    radial-gradient(700px 430px at 10% 90%, rgba(125,170,220,.18), rgba(125,170,220,0) 60%),
    linear-gradient(165deg, #f5f9f6 0%, #e9f1ec 48%, #dfeaf2 100%);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .8s ease, transform .8s ease;
}
#loading.done { opacity: 0; pointer-events: none; transform: scale(1.045); }
.loading-box {
  text-align: center;
  background: rgba(255,255,255,.8);
  border: 1px solid rgba(31,138,99,.16);
  border-radius: 26px;
  padding: 46px 64px 42px;
  box-shadow: 0 26px 70px rgba(23,58,45,.15), 0 2px 10px rgba(23,58,45,.05);
  backdrop-filter: blur(10px);
}
.loading-badge {
  width: 76px; height: 76px; margin: 0 auto 18px;
  border-radius: 20px;
  background: linear-gradient(145deg, #2fbf8a, #145c43);
  box-shadow: 0 12px 30px rgba(31,138,99,.3), 0 0 0 3px rgba(255,255,255,.7), inset 0 1px 0 rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 700; color: #fff;
  animation: badgeIn .7s cubic-bezier(.2,.9,.3,1.3) both;
}
@keyframes badgeIn {
  from { transform: scale(.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.loading-box h1 { font-size: 29px; letter-spacing: 4px; margin-bottom: 8px; color: #17352a; }
.loading-en { font-size: 11px; letter-spacing: 1.5px; color: #7d948b; margin-bottom: 6px; }
.loading-addr { font-size: 11.5px; color: #7d948b; margin-bottom: 24px; }
.loading-sub {
  display: inline-block; font-size: 13px; color: #1f8a63;
  background: rgba(31,138,99,.08); border: 1px solid rgba(31,138,99,.25);
  padding: 7px 18px; border-radius: 999px; margin-bottom: 18px;
}
.bar {
  width: 260px; height: 4px; margin: 0 auto;
  background: rgba(31,138,99,.15); border-radius: 4px; overflow: hidden;
}
.bar-fill {
  height: 100%; width: 30%; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  box-shadow: 0 0 10px rgba(47,191,138,.55);
  animation: loadmove 1.2s ease-in-out infinite;
}
@keyframes loadmove {
  0% { width: 8%; margin-left: 0; }
  50% { width: 62%; }
  100% { width: 8%; margin-left: 92%; }
}

/* ---------------- 顶栏 ---------------- */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
  background: linear-gradient(180deg, rgba(6,14,11,.82), rgba(6,14,11,0));
  pointer-events: none;
}
#topbar .brand { display: flex; align-items: center; gap: 12px; pointer-events: auto; }
.logo {
  width: 44px; height: 44px; border-radius: 10px; flex: none;
  background: linear-gradient(145deg, #2fbf8a, #145c43);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; color: #fff;
  box-shadow: 0 4px 18px rgba(47,191,138,.4);
}
.brand-text h1 { font-size: 17px; letter-spacing: 1px; }
.brand-text p { font-size: 11px; color: var(--text-dim); margin-top: 3px; }
.actions { display: flex; gap: 8px; pointer-events: auto; flex-wrap: wrap; justify-content: flex-end; }
.tbtn {
  border: 1px solid var(--panel-border);
  background: rgba(16, 28, 24, .72);
  color: var(--text-main);
  padding: 8px 13px; border-radius: 999px;
  font-size: 12.5px; font-family: inherit; cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all .18s ease;
}
.tbtn:hover { background: rgba(47, 191, 138, .22); border-color: rgba(47,191,138,.5); transform: translateY(-1px); }
.tbtn:active { transform: translateY(0); }
.tbtn.active { background: rgba(47,191,138,.28); border-color: rgba(47,191,138,.65); box-shadow: 0 0 14px rgba(47,191,138,.25); }

/* ---------------- 左侧图例 ---------------- */
#legend {
  position: fixed; left: 16px; top: 86px; z-index: 15;
  width: 218px; max-height: calc(100vh - 220px);
  overflow-y: auto;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  box-shadow: 0 10px 44px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.06);
  border-radius: 14px;
  padding: 14px;
  backdrop-filter: blur(10px);
  transition: transform .35s ease, box-shadow .25s ease;
}
#legend:hover { box-shadow: 0 12px 52px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.09); }
#legend::-webkit-scrollbar { width: 5px; }
#legend::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 3px; }
.panel-title { font-size: 12px; letter-spacing: 2px; color: var(--text-dim); margin-bottom: 8px; }
.panel-sub { font-size: 11px; letter-spacing: 2px; color: var(--text-dim); margin: 12px 0 8px; }
.li {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 8px; border-radius: 9px; cursor: pointer;
  transition: background .15s ease;
}
.li:hover { background: rgba(47,191,138,.16); }
.li.sel { background: rgba(47,191,138,.3); }
.li .no {
  width: 22px; height: 22px; flex: none; border-radius: 6px;
  background: linear-gradient(145deg, var(--accent-bright), var(--accent));
  color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.li b { display: block; font-size: 13px; font-weight: 600; }
.li i { display: block; font-style: normal; font-size: 10.5px; color: var(--text-dim); margin-top: 1px; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.pbtn {
  border: 1px solid var(--panel-border); background: rgba(255,255,255,.06);
  color: var(--text-main); font-size: 11.5px; font-family: inherit;
  padding: 5px 10px; border-radius: 999px; cursor: pointer; transition: all .15s;
}
.pbtn:hover { background: rgba(47,191,138,.25); }

/* ---------------- 右侧信息面板 ---------------- */
#info {
  position: fixed; right: 16px; top: 86px; z-index: 15;
  width: 292px; max-height: calc(100vh - 200px); overflow-y: auto;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  box-shadow: 0 10px 44px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.06);
  border-radius: 14px; padding: 18px;
  backdrop-filter: blur(10px);
  transition: transform .38s cubic-bezier(.2,.9,.3,1.15), opacity .3s ease;
}
#info.hidden { transform: translateX(340px) scale(.96); opacity: 0; pointer-events: none; }
#info::-webkit-scrollbar { width: 5px; }
#info::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 3px; }
#infoClose {
  position: absolute; top: 10px; right: 10px;
  width: 26px; height: 26px; border-radius: 50%;
  border: none; background: rgba(255,255,255,.1); color: #fff;
  cursor: pointer; font-size: 12px;
}
#infoClose:hover { background: rgba(255,255,255,.25); }
.info-no {
  width: 30px; height: 30px; border-radius: 8px; margin-bottom: 10px;
  background: linear-gradient(145deg, var(--accent-bright), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
#infoName { font-size: 20px; letter-spacing: 1px; }
.info-en { font-size: 10.5px; color: var(--text-dim); margin: 4px 0 10px; letter-spacing: .5px; }
.info-meta {
  font-size: 11.5px; color: var(--accent-bright);
  background: rgba(47,191,138,.12);
  border: 1px solid rgba(47,191,138,.3);
  border-radius: 8px; padding: 6px 10px; margin-bottom: 10px;
}
.info-desc { font-size: 12.5px; line-height: 1.75; color: #cfdad5; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 11px; padding: 4px 10px; border-radius: 999px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  color: #dfe9e4;
}

/* ---------------- 悬停提示 ---------------- */
#tip {
  position: fixed; z-index: 30; pointer-events: none;
  background: rgba(10, 20, 16, .92);
  border: 1px solid rgba(47,191,138,.5);
  color: #fff; font-size: 12.5px;
  padding: 5px 11px; border-radius: 999px;
  transform: translate(14px, 10px);
  white-space: nowrap;
}
#tip.hidden, .hidden { display: none; }
#info.hidden { display: block; }

/* ---------------- 底部提示 / 署名 ---------------- */
#hint {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  z-index: 15; font-size: 12px; color: #cfdfd7;
  background: rgba(10,20,16,.7); border: 1px solid var(--panel-border);
  padding: 7px 16px; border-radius: 999px; backdrop-filter: blur(8px);
}
#hint b { color: var(--accent-bright); }
#credit {
  position: fixed; bottom: 14px; left: 16px; z-index: 14;
  font-size: 10.5px; color: rgba(255,255,255,.42); letter-spacing: .5px;
}

/* ---------------- 小地图 ---------------- */
#minimap {
  position: fixed; right: 16px; bottom: 16px; z-index: 15;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: rgba(10,18,14,.85);
  box-shadow: 0 6px 30px rgba(0,0,0,.4);
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 980px) {
  #legend, #hint, #credit { display: none; }
  .brand-text p { display: none; }
  #info { top: auto; bottom: 220px; max-height: 40vh; }
}
@media (max-width: 640px) {
  .actions .tbtn { padding: 6px 9px; font-size: 11px; }
  .brand-text h1 { font-size: 13px; }
}
