* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; background: #000; overflow: hidden;
  font-family: system-ui, -apple-system, "PingFang SC", sans-serif; }

/* 主舞台：全屏、禁掉浏览器默认触摸滚动（否则翻层手势会被页面滚动吃掉） */
#stage { position: fixed; inset: 0; touch-action: none; cursor: grab; }

/* 视口：居中放置图像，缩放围绕中心 */
#viewport { position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(1); transform-origin: center; }

#viewport img { display: block; width: min(100vw, 100vh); height: auto;
  image-rendering: auto; user-select: none; -webkit-user-drag: none; }

/* 轮廓叠加层：与图片同尺寸 */
#overlay { position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none; }

/* 底部控制条 */
#hud { position: fixed; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(0,0,0,.75) 40%);
  color: #ddd; font-size: 14px; }
#hud button { width: 44px; height: 44px; border: none; border-radius: 8px;
  background: rgba(255,255,255,.12); color: #fff; font-size: 18px; }
#hud input[type=range] { flex: 1; accent-color: #4ea1ff; }
#label { min-width: 84px; text-align: right; font-variant-numeric: tabular-nums; }

/* 点选结构的名称标签（顶部，避开手指遮挡） */
#tag { position: fixed; left: 50%; top: 64px; transform: translateX(-50%);
  background: rgba(18,28,48,.92); color: #fff; padding: 10px 20px;
  border-radius: 10px; font-size: 17px; letter-spacing: .5px;
  border: 1px solid rgba(120,180,255,.35); display: none; z-index: 10;
  white-space: nowrap; }

/* 病例信息按钮（右上角，避开安全区） */
#btn-info { position: fixed; right: 14px;
  top: calc(14px + env(safe-area-inset-top)); width: 40px; height: 40px;
  border-radius: 50%; border: 1px solid rgba(140,180,230,.35);
  background: rgba(18,28,48,.86); color: #cfe2ff; font-size: 18px;
  font-style: italic; font-family: Georgia, serif; z-index: 15;
  cursor: pointer; }

/* 信息面板：底部抽屉（手机）/ 居中弹窗（桌面） */
#info-backdrop { position: fixed; inset: 0; z-index: 30;
  background: rgba(0,0,0,.55); display: flex; align-items: flex-end;
  justify-content: center; }
#info-backdrop.hidden { display: none; }
#info-sheet { width: 100%; max-width: 640px; max-height: 82vh;
  display: flex; flex-direction: column; background: #0f1622;
  color: #e8e8e8; border: 1px solid #22304a;
  border-radius: 18px 18px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.5); }
#info-head { display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid #1c2738;
  font-size: 16px; font-weight: 600; color: #dfe8f5; }
#btn-info-close { width: 34px; height: 34px; border: none; border-radius: 50%;
  background: rgba(255,255,255,.08); color: #aab8cc; font-size: 16px; }
#info-body { overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 16px 18px calc(24px + env(safe-area-inset-bottom));
  font-size: 14px; line-height: 1.7; }
.info-sec h3 { font-size: 15px; color: #cdd6e4; margin: 18px 0 8px; }
.info-sec h3:first-child { margin-top: 0; }
.info-src { font-size: 11px; color: #7a8699; font-weight: 400; margin-left: 6px; }
.info-note { font-size: 12px; color: #8a98ad; background: #0b1220;
  border: 1px solid #1b2434; border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.info-group h4 { font-size: 13px; color: #9aa7bb; margin: 14px 0 6px; }
.info-dl { display: grid; grid-template-columns: 108px 1fr; gap: 6px 10px;
  font-size: 13.5px; }
.info-dl dt { color: #7f8da3; white-space: nowrap; }
.info-dl dd { color: #dbe3ef; }
.know-title { font-size: 16px; font-weight: 600; color: #dfe8f5; margin: 4px 0 10px; }
.know-sec { margin: 10px 0; }
.know-sec strong { color: #9fc0ea; font-weight: 600; }
.disclaimer { margin-top: 16px; padding-top: 10px; font-size: 12px;
  color: #7a8699; border-top: 1px dashed #22304a; }
@media (min-width: 700px) {
  #info-backdrop { align-items: center; }
  #info-sheet { border-radius: 16px; max-height: 80vh; }
}
