:root { color-scheme: dark; }

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0b0e14;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
}

#scene { display: block; width: 100%; height: 100%; }

#labels { position: fixed; inset: 0; pointer-events: none; z-index: 2; }

#hud { position: fixed; inset: 0; pointer-events: none; z-index: 3; }

#overviewTitle {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  text-align: center;
  display: none;
  pointer-events: none;
}
.ot-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.ot-mark { color: #c9a86a; font-size: 15px; }
.ot-deco {
  width: 70px;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(201, 168, 106, 0.8));
}
.ot-deco:last-child {
  background: linear-gradient(to left, transparent, rgba(201, 168, 106, 0.8));
}
#overviewTitle h1 {
  font-size: 38px;
  font-weight: 600;
  letter-spacing: 10px;
  color: #eceff4;
  margin: 0;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}
.ot-sub {
  margin-top: 2px;
  font-size: 12px;
  letter-spacing: 3px;
  color: #9aa3b2;
}

#muteBtn {
  position: absolute;
  top: 18px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(17, 22, 32, 0.7);
  color: #eceff4;
  font-size: 18px;
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
#muteBtn:hover { background: rgba(255, 255, 255, 0.16); }

/* 字幕按钮（静音下方） */
#subtitleBtn {
  position: absolute;
  top: 66px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(17, 22, 32, 0.7);
  color: #eceff4;
  font-size: 15px;
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
#subtitleBtn:hover { background: rgba(255, 255, 255, 0.16); }

/* 字幕显示区（底部操作按钮上方，居中单行） */
#subtitle {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  z-index: 4;
  color: #ffffff;
  font-size: 22px;
  white-space: nowrap;
  text-align: center;
  pointer-events: none;
  text-shadow:
    -1px -1px 0 #000, 0 -1px 0 #000, 1px -1px 0 #000,
    -1px 0 0 #000, 1px 0 0 #000,
    -1px 1px 0 #000, 0 1px 0 #000, 1px 1px 0 #000,
    0 2px 6px rgba(0, 0, 0, 0.7);
}

/* 字幕展开面板 */
#subtitlePanel {
  position: fixed;
  top: 114px;
  right: 24px;
  z-index: 3;
  width: 320px;
  max-height: 60vh;
  overflow-y: auto;
  display: none;
  background: rgba(13, 17, 25, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 16px;
  backdrop-filter: blur(10px);
  color: #d5dbe4;
  pointer-events: auto;
}
#subtitleToggle {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #e6e9ee;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
}
#subtitleToggle:hover { background: rgba(255, 255, 255, 0.16); }
#subtitleText { margin-top: 12px; font-size: 13px; line-height: 1.9; color: #c3cad4; }
#subtitleText p { margin-bottom: 10px; }

/* 进入层 */
#entryOverlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b0e14;
  color: #e6e9ee;
  cursor: pointer;
  transition: opacity 0.4s ease;
}
#entryOverlay.hidden { opacity: 0; pointer-events: none; }
.entry-inner { text-align: center; padding: 24px; }
.entry-inner h1 { font-size: 28px; margin-bottom: 16px; letter-spacing: 1px; }
.entry-inner p { color: #9aa3b2; font-size: 15px; }
.entry-sub { font-size: 13px; margin-top: 10px; color: #6b7484; }

#stats {
  position: absolute;
  top: 18px;
  left: 24px;
  color: #9aa3b2;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

#overviewHint {
  position: absolute;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  color: #cbd2dd;
  font-size: 14px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
#f11Hint {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  color: #8b93a1;
  font-size: 12px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

#vignette {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  display: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
}

#segmentNav {
  position: absolute;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  display: none;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
  background: rgba(17, 22, 32, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 16px;
  backdrop-filter: blur(8px);
}

#segmentNav button {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #e6e9ee;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}
#segmentNav button:hover { background: rgba(255, 255, 255, 0.16); }

#exitBtn { margin-left: 6px; }

#segmentLabel {
  color: #e6e9ee;
  font-size: 13px;
  min-width: 96px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.seg-label {
  position: absolute;
  left: 0;
  top: 0;
  color: #eef1f6;
  font-size: 12px;
  background: rgba(17, 22, 32, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  padding: 3px 8px;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* 俯视时侧边信息面板 */
#infoPanel {
  position: fixed;
  top: 72px;
  left: 24px;
  z-index: 3;
  width: 320px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  display: none;
  background: rgba(13, 17, 25, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 18px 18px 6px;
  backdrop-filter: blur(10px);
  color: #d5dbe4;
  pointer-events: auto;
}
#infoPanel .info-section {
  margin-bottom: 18px;
}
#infoPanel h2 {
  font-size: 14px;
  color: #f0f3f8;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}
#infoPanel p {
  font-size: 13px;
  line-height: 1.8;
  color: #c3cad4;
  margin-bottom: 8px;
}
.download-btn {
  display: inline-block;
  margin-top: 4px;
  padding: 9px 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(90, 167, 255, 0.18);
  color: #cfe4ff;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease;
}
.download-btn:hover { background: rgba(90, 167, 255, 0.3); }
.quark-code {
  font-size: 11px;
  color: #8b93a1;
  margin-bottom: 8px;
  word-break: break-all;
}

/* 右侧下载面板 */
#downloadPanel {
  position: fixed;
  top: 120px;
  right: 24px;
  z-index: 3;
  width: 260px;
  display: none;
  background: rgba(13, 17, 25, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 18px;
  backdrop-filter: blur(10px);
  color: #d5dbe4;
  pointer-events: auto;
}
#downloadPanel h2 {
  font-size: 14px;
  color: #f0f3f8;
  font-weight: 600;
  margin-bottom: 8px;
}
#downloadPanel p {
  font-size: 13px;
  line-height: 1.8;
  color: #c3cad4;
  margin-bottom: 10px;
}

#spinner {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #5aa7ff;
  border-radius: 50%;
  display: none;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#error {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: #f0f0f0;
  background: #0b0e14;
  font-size: 15px;
  line-height: 1.7;
  text-align: center;
}
