* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #04060f; }
body { font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; color: #dfe4f2; user-select: none; }
#app, #app canvas { position: absolute; inset: 0; }

#labels { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.body-label {
  position: absolute; top: 0; left: 0; display: flex; align-items: center; gap: 5px;
  font-size: 13px; letter-spacing: 0.5px; cursor: pointer; pointer-events: auto;
  text-shadow: 0 0 6px rgba(0,0,0,0.9), 0 1px 3px rgba(0,0,0,0.9); white-space: nowrap;
  transition: opacity 0.2s;
}
.body-label:hover { text-shadow: 0 0 10px currentColor; }
.body-label .dot { width: 7px; height: 7px; border-radius: 50%; box-shadow: 0 0 6px currentColor; flex: none; }
.moon-label { font-size: 11.5px; opacity: 0.88; }

.glass {
  background: rgba(10, 16, 34, 0.72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(120, 150, 220, 0.16);
  border-radius: 14px;
}

/* ===== 顶栏 ===== */
#topbar {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; padding: 9px 16px; z-index: 20;
  max-width: calc(100vw - 32px); flex-wrap: wrap; justify-content: center;
}
#topbar .title { font-size: 15px; font-weight: 600; letter-spacing: 2px; color: #aecbff; margin-right: 6px; white-space: nowrap; }
#topbar .title b { color: #ffd27d; font-weight: 600; }
.tbtn {
  background: rgba(90, 130, 230, 0.14); color: #c9d6f5; border: 1px solid rgba(120, 150, 220, 0.22);
  border-radius: 8px; min-width: 34px; height: 32px; padding: 0 10px; font-size: 14px; cursor: pointer;
  transition: all 0.15s; display: inline-flex; align-items: center; justify-content: center; white-space: nowrap;
}
.tbtn:hover { background: rgba(110, 155, 255, 0.28); border-color: rgba(140, 175, 255, 0.5); }
.tbtn.on { background: rgba(255, 150, 60, 0.25); border-color: rgba(255, 170, 90, 0.55); color: #ffd0a0; }
#speedLabel { font-size: 13px; color: #8fd8ff; min-width: 74px; text-align: center; }
#simDate { font-size: 13px; color: #ffe2ae; min-width: 168px; text-align: center; font-variant-numeric: tabular-nums; }
#dateInput {
  background: rgba(90, 130, 230, 0.12); border: 1px solid rgba(120, 150, 220, 0.22); color: #c9d6f5;
  border-radius: 8px; height: 32px; padding: 0 8px; font-size: 13px; color-scheme: dark;
}

/* ===== 侧栏 ===== */
#sidebar {
  position: absolute; top: 80px; left: 14px; bottom: 130px; width: 218px; z-index: 15;
  display: flex; flex-direction: column; transition: transform 0.3s ease, opacity 0.3s;
}
#sidebar.collapsed { transform: translateX(-240px); opacity: 0; pointer-events: none; }
#sidebar .head { padding: 12px 14px 8px; font-size: 13px; color: #8fa8d8; letter-spacing: 1px; }
#bodyList { overflow-y: auto; padding: 0 8px 10px; flex: 1; }
#bodyList::-webkit-scrollbar { width: 4px; }
#bodyList::-webkit-scrollbar-thumb { background: rgba(120,150,220,0.3); border-radius: 2px; }
#bodyList details summary {
  cursor: pointer; font-size: 12.5px; color: #7f92c0; padding: 7px 6px 5px; list-style: none;
  display: flex; align-items: center; letter-spacing: 1px;
}
#bodyList details summary::before { content: "▸"; margin-right: 5px; font-size: 10px; transition: transform 0.2s; }
#bodyList details[open] summary::before { transform: rotate(90deg); }
#bodyList .count { margin-left: auto; font-size: 11px; opacity: 0.6; }
.body-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; font-size: 13.5px; border-radius: 8px;
  cursor: pointer; color: #cdd7ef; transition: background 0.12s;
}
.body-item:hover { background: rgba(110, 150, 255, 0.14); }
.body-item.active { background: rgba(110, 150, 255, 0.22); color: #fff; }
.body-item .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.body-item .en { margin-left: auto; font-size: 10.5px; color: #6a7ba3; }

#btnSidebar {
  position: absolute; top: 80px; left: 14px; z-index: 25; width: 36px; height: 36px;
  font-size: 16px; border-radius: 10px;
}
#sidebar:not(.collapsed) ~ #btnSidebar { left: 244px; }

/* ===== 信息面板 ===== */
#infoPanel {
  position: absolute; top: 80px; right: 14px; bottom: 130px; width: 330px; z-index: 15;
  transform: translateX(370px); opacity: 0; transition: transform 0.35s cubic-bezier(.2,.9,.3,1), opacity 0.3s;
  display: flex; flex-direction: column; overflow: hidden;
}
#infoPanel.open { transform: none; opacity: 1; }
#infoHead { padding: 16px 18px 10px; border-bottom: 1px solid rgba(120,150,220,0.14); position: relative; }
#infoName { font-size: 24px; font-weight: 700; letter-spacing: 2px; }
#infoEn { font-size: 13px; color: #7f92c0; margin-left: 8px; }
#infoType {
  display: inline-block; margin-top: 8px; font-size: 11.5px; padding: 3px 10px;
  border: 1px solid; border-radius: 20px; letter-spacing: 0.5px;
}
#btnCloseInfo {
  position: absolute; top: 12px; right: 12px; width: 28px; height: 28px; border-radius: 8px;
  background: rgba(255,255,255,0.06); border: none; color: #9fb0d8; font-size: 14px; cursor: pointer;
}
#btnCloseInfo:hover { background: rgba(255,255,255,0.14); color: #fff; }
#infoBody { padding: 12px 18px 18px; overflow-y: auto; flex: 1; }
#infoBody::-webkit-scrollbar { width: 4px; }
#infoBody::-webkit-scrollbar-thumb { background: rgba(120,150,220,0.3); border-radius: 2px; }
#infoDesc { font-size: 13.5px; line-height: 1.85; color: #c3cde8; }
#infoBody table { width: 100%; border-collapse: collapse; margin-top: 12px; }
#infoBody td { font-size: 12.5px; padding: 5.5px 2px; border-bottom: 1px dashed rgba(120,150,220,0.13); vertical-align: top; }
#infoBody td:first-child { color: #7f92c0; white-space: nowrap; padding-right: 14px; }
#infoBody td:last-child { color: #dfe4f2; text-align: right; }
#infoBody td.live { color: #8fd8ff; font-variant-numeric: tabular-nums; }
#infoBody h4 { font-size: 12.5px; color: #ffd27d; margin: 16px 0 8px; letter-spacing: 1px; }
#infoFacts { list-style: none; }
#infoFacts li {
  font-size: 12.5px; line-height: 1.75; color: #b9c4e2; padding: 6px 0 6px 20px; position: relative;
}
#infoFacts li::before { content: "✦"; position: absolute; left: 2px; color: #ffd27d; font-size: 11px; }

/* ===== 底部控制 ===== */
#bottombar {
  position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 20;
  display: flex; align-items: center; gap: 14px; padding: 10px 18px; flex-wrap: wrap; justify-content: center;
  max-width: calc(100vw - 32px);
}
.mode-switch { display: flex; border: 1px solid rgba(120,150,220,0.25); border-radius: 9px; overflow: hidden; }
.mode-switch button {
  background: transparent; border: none; color: #9fb0d8; font-size: 12.5px; padding: 7px 14px; cursor: pointer;
  transition: all 0.15s;
}
.mode-switch button.on { background: rgba(110, 155, 255, 0.3); color: #fff; }
.chk { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: #9fb0d8; cursor: pointer; white-space: nowrap; }
.chk input { accent-color: #6b9bff; cursor: pointer; }

/* ===== 导览条 ===== */
#tourBar {
  position: absolute; left: 50%; bottom: 78px; transform: translateX(-50%) translateY(140px);
  z-index: 21; display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  transition: transform 0.35s; opacity: 0;
}
#tourBar.open { transform: translateX(-50%); opacity: 1; }
#tourName { font-size: 14px; color: #ffe2ae; min-width: 120px; text-align: center; }
#tourTrack { width: 160px; height: 3px; background: rgba(255,255,255,0.12); border-radius: 2px; overflow: hidden; }
#tourProgress { height: 100%; width: 0; background: linear-gradient(90deg, #6b9bff, #8fd8ff); }

/* ===== 对比图 ===== */
#compareOverlay {
  position: absolute; inset: 0; z-index: 40; background: rgba(3, 5, 12, 0.9);
  backdrop-filter: blur(8px); display: none; flex-direction: column; align-items: center; justify-content: center;
}
#compareOverlay.open { display: flex; }
#compareOverlay h3 { font-size: 18px; letter-spacing: 3px; color: #aecbff; margin-bottom: 6px; }
#compareOverlay p { font-size: 12.5px; color: #7f92c0; margin-bottom: 14px; }
#compareWrap { width: min(1200px, 94vw); overflow-x: auto; }
#compareSvg { width: 100%; min-width: 900px; height: auto; }
.cmp-circle { cursor: pointer; transition: opacity 0.15s; }
.cmp-circle:hover { opacity: 0.75; stroke: #fff; stroke-width: 2; }
#btnCloseCompare { position: absolute; top: 24px; right: 28px; font-size: 15px; }

/* ===== 启动页 ===== */
#splash {
  position: absolute; inset: 0; z-index: 50; background: radial-gradient(ellipse at 50% 42%, #0b1230 0%, #04060f 70%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  transition: opacity 0.8s;
}
#splash.hide { opacity: 0; pointer-events: none; }
#splash h1 { font-size: 42px; font-weight: 700; letter-spacing: 10px; color: #e8f0ff; text-shadow: 0 0 40px rgba(110,155,255,0.7); }
#splash .sub { font-size: 14px; color: #8fa8d8; letter-spacing: 4px; }
#splash .tips { font-size: 12.5px; color: #63739c; line-height: 2.1; text-align: center; margin-top: 8px; }
#btnStart {
  margin-top: 14px; font-size: 15px; letter-spacing: 4px; padding: 12px 42px; border-radius: 30px;
  background: linear-gradient(135deg, rgba(90,140,255,0.35), rgba(140,90,255,0.3));
  border: 1px solid rgba(140, 175, 255, 0.5); color: #e8f0ff; cursor: pointer; transition: all 0.2s;
}
#btnStart:hover { box-shadow: 0 0 30px rgba(110,155,255,0.5); transform: scale(1.04); }

@media (max-width: 900px) {
  #sidebar { width: 190px; }
  #infoPanel { width: 290px; }
  #topbar .title { display: none; }
}
