:root {
  --bg-deep: #050810;
  --bg-panel: rgba(8, 18, 32, 0.82);
  --border: rgba(0, 212, 255, 0.22);
  --accent: #00d4ff;
  --accent-dim: rgba(0, 212, 255, 0.45);
  --accent-warm: #ff6b35;
  --text: #e8f4fc;
  --text-muted: #7a9bb8;
  --glow: 0 0 24px rgba(0, 212, 255, 0.15);
  --font-display: "Orbitron", sans-serif;
  --font-body: "Noto Sans SC", sans-serif;
  --panel-width: 320px;
}

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

html {
  height: 100%;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 70% 20%, rgba(0, 100, 180, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 20% 80%, rgba(0, 212, 255, 0.06), transparent);
  pointer-events: none;
  z-index: 0;
}

.app {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  z-index: 1;
}

/* 左侧控制面板列（折叠钮在列外侧，不占面板内容宽度） */
.panel-column {
  position: relative;
  width: var(--panel-width);
  flex-shrink: 0;
  min-height: 0;
  overflow: visible;
  transition: width 0.22s ease;
}

.app.panel-collapsed .panel-column {
  width: 0;
  min-width: 0;
}

.panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
  padding: 0;
  background: var(--bg-panel);
  backdrop-filter: blur(8px);
  box-shadow: var(--glow);
  border-right: 1px solid var(--border);
  overflow: hidden;
  transition: opacity 0.18s ease, border-color 0.22s ease;
}

.app.panel-collapsed .panel {
  border-right-color: transparent;
  opacity: 0;
  pointer-events: none;
}

.panel-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) transparent;
}

.panel-header {
  flex-shrink: 0;
  padding: 18px 14px 14px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(
    165deg,
    rgba(0, 212, 255, 0.14) 0%,
    rgba(0, 100, 160, 0.06) 45%,
    transparent 100%
  );
  box-shadow: inset 0 -1px 0 rgba(0, 212, 255, 0.1);
}

.panel-title {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.4;
  color: #f2fbff;
  text-shadow:
    0 0 14px rgba(0, 212, 255, 0.65),
    0 0 32px rgba(0, 212, 255, 0.3),
    0 1px 2px rgba(0, 0, 0, 0.45);
}

.panel-title-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.22em;
  letter-spacing: 0.06em;
  color: var(--accent);
  margin: 0 0.1em;
  vertical-align: -0.02em;
  text-shadow:
    0 0 18px rgba(0, 212, 255, 0.95),
    0 0 36px rgba(0, 212, 255, 0.45);
}

.section-label {
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  margin: 0 0 8px;
  opacity: 0.9;
}

.section-label-sub {
  font-family: var(--font-body);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 400;
}

/* 控制面板各功能模块分隔框 */
.panel-body > .control-group {
  margin: 0 10px;
  padding: 10px 10px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 20, 40, 0.5);
}

.panel-body > .control-group[hidden] {
  display: none;
}

.app.panel-collapsed .panel-body {
  display: none;
}

.panel-toggle-btn {
  position: absolute;
  left: 100%;
  top: 50%;
  z-index: 20;
  transform: translateY(-50%);
  box-sizing: border-box;
  width: 28px;
  height: 52px;
  padding: 0;
  margin: 0;
  font-size: 13px;
  line-height: 1;
  border-radius: 0 8px 8px 0;
  border: 1px solid var(--border);
  border-left: none;
  background: rgba(8, 18, 32, 0.95);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.35);
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.panel-toggle-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 212, 255, 0.12);
  box-shadow: 4px 0 20px rgba(0, 212, 255, 0.2);
}

.panel-toggle-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.subtitle {
  margin: 8px 0 16px;
  color: var(--text-muted);
  line-height: 1.5;
}

.slider-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px 10px;
}

.slider-row-playback {
  grid-template-columns: auto 1fr auto;
}

.slider-row-date {
  margin-bottom: 8px;
}

.slider-row-date .slider-val {
  min-width: 6.5em;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
}

.slider-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.slider-val {
  font-family: var(--font-display);
  font-size: 0.7rem;
  color: var(--accent);
  white-space: nowrap;
  text-align: right;
  min-width: 2.8em;
}

.panel-select {
  width: 100%;
  padding: 6px 32px 6px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(0, 40, 70, 0.5);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.82rem;
  line-height: 1.25;
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2300d4ff' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.panel-select:hover,
.panel-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.15);
}

.panel-select option {
  background: #0a1828;
  color: var(--text);
}

.panel-select-inline {
  grid-column: 2 / -1;
  width: 100%;
  min-width: 0;
}

.panel-select-compact {
  width: auto !important;
  min-width: 3.6em;
  max-width: 5.2em;
  padding: 4px 24px 4px 7px !important;
  font-size: 0.74rem;
  line-height: 1.2;
}

.panel-range-full {
  width: 100%;
}

.control-group-layers .layer-checkboxes > label,
.control-group-layers .layer-check-meridian-cb,
.ref-point-check-label,
.preset-cities-checkboxes > label {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--text-muted);
  font-family: var(--font-body);
}

.control-group input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
  transform: translateY(1px);
}

.control-group-layers .layer-earth-skin {
  margin-bottom: 8px;
}

.control-group-layers .layer-earth-skin select {
  width: 100%;
}

.control-group-layers .layer-checkboxes {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 6px 10px;
  margin-top: 0;
}

.control-group-layers .layer-checkboxes > label {
  min-width: 0;
}

.control-group-layers .layer-checkboxes > label.layer-check-full {
  grid-column: 1 / -1;
}

.control-group-layers .layer-check-meridian-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  min-width: 0;
}

.control-group-layers .layer-check-meridian-cb {
  min-width: 0;
}

.meridian-count-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* [hidden] 默认的 display:none 会被上面的 flex 覆盖，必须显式隐藏 */
#meridianCountWrap[hidden],
.meridian-count-wrap[hidden],
#showEquatorMountainWrap[hidden],
#showDateLineWrap[hidden],
#coriolisMotionDirWrap[hidden],
#targetLatWrap[hidden],
.control-group-layers .layer-checkboxes > label[hidden],
#liveDataPanel[hidden] {
  display: none !important;
}

.date-line-label {
  max-width: 11em;
  font-size: 0.68rem;
  line-height: 1.3;
  text-align: center;
  color: #ffe8c8;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.95), 0 0 10px rgba(255, 180, 100, 0.35);
}

.date-line-arrow-label {
  max-width: 5em;
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff6d8;
  pointer-events: none;
}

.date-line-title-label {
  max-width: none;
  font-size: 0.68rem;
  line-height: 1.5;
  letter-spacing: 0.1em;
  writing-mode: vertical-rl;
  text-orientation: upright;
  white-space: nowrap;
  text-align: center;
  pointer-events: none;
  /* transform 由 JS 按球面经线方向每帧设置 */
  transform: none;
}

.meridian-label.date-line-zone-label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.45;
  white-space: normal;
  text-align: center;
  pointer-events: none;
}

.date-line-zone-new {
  color: #ffe8e8;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.95), 0 0 12px rgba(220, 60, 60, 0.55);
}

.date-line-zone-old {
  color: #fff8d8;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.95), 0 0 12px rgba(220, 180, 40, 0.5);
}

.date-line-zone-date {
  display: block;
  margin-top: 2px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.date-line-zone-pct {
  display: block;
  margin-top: 3px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0.92;
}

.control-group-layers .layer-coriolis-motion-row {
  margin-bottom: 8px;
  grid-template-columns: auto 1fr;
}

.control-group-layers .layer-checkboxes input[type="checkbox"] {
  flex-shrink: 0;
  margin-top: 2px;
}

.meridian-count-label {
  white-space: nowrap;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.panel-body select:not(.panel-select):not(.panel-select-inline):not(.panel-select-compact),
.panel-body input[type="range"]:not(.target-lat-range),
.panel-body button {
  width: 100%;
}

.panel-body button:not(.ref-point-add-btn):not(.ref-point-settings-btn):not(.ref-point-delete-btn):not(
    .copyright-text-btn
  ):not(.play-pause-btn):not(.collapsible-head-btn):not(.preset-season-btn) {
  padding: 5px 7px;
  font-size: 0.75rem;
  line-height: 1.25;
  font-family: var(--font-body);
  border: 1px solid var(--border);
  border-radius: 5px;
  background: rgba(0, 30, 50, 0.5);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

.panel-body button:not(.ref-point-add-btn):not(.ref-point-settings-btn):not(.ref-point-delete-btn):not(
    .copyright-text-btn
  ):not(.play-pause-btn):not(.collapsible-head-btn):not(.preset-season-btn):hover {
  border-color: var(--accent-warm);
  color: var(--accent-warm);
  background: rgba(255, 107, 53, 0.12);
}

input[type="range"] {
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(0, 212, 255, 0.2);
  border-radius: 2px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  cursor: pointer;
}

.slider-row input[type="range"],
.target-lat-row-wrap input[type="range"],
.panel-range-full {
  width: 100%;
  min-width: 0;
}

/* 左侧参数区：按钮更矮；网格行内不对齐拉伸（避免一行里被拉成同一高度） */
.panel-body .row,
.panel-body .season-presets {
  align-items: start;
}

.panel-body .preset-season-btn {
  padding: 5px 6px;
  font-size: 0.75rem;
  line-height: 1.25;
  font-family: var(--font-body);
  border: 1px solid var(--border);
  border-radius: 5px;
  background: rgba(0, 30, 50, 0.5);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

.panel-body .preset-season-btn:hover {
  border-color: rgba(255, 107, 53, 0.65);
  color: var(--accent-warm);
  background: rgba(255, 107, 53, 0.1);
}

.panel-body .preset-season-btn.preset-season-active {
  border-color: var(--accent-warm);
  color: var(--accent-warm);
  background: rgba(255, 107, 53, 0.18);
  box-shadow: 0 0 12px rgba(255, 107, 53, 0.28);
  font-weight: 600;
}

.panel-body .preset-season-btn.preset-season-active:hover {
  border-color: var(--accent-warm);
  color: var(--accent-warm);
  background: rgba(255, 107, 53, 0.24);
  box-shadow: 0 0 14px rgba(255, 107, 53, 0.32);
}

.panel-body .play-pause-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(0, 40, 70, 0.5);
  color: var(--text);
}

.panel-body .play-pause-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 212, 255, 0.1);
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.control-group-layers .target-lat-row-wrap {
  margin-bottom: 8px;
}

.season-presets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

/* —— 动画区域（视口 HUD、浮层卡片、标签） —— */

.knowledge-box,
.stage-panel-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(5, 15, 28, 0.88);
  backdrop-filter: blur(8px);
  box-shadow: var(--glow);
}

.info-card {
  margin-top: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.stage-live-data.info-card {
  margin-top: 0;
}

.info-card h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.info-card p,
.info-card li {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.65;
  color: var(--text-muted);
  font-family: var(--font-body);
}

.info-card ul {
  margin: 0;
  padding-left: 18px;
}

.stage-live-data .collapsible-content li span {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.ref-point-times-wrap {
  list-style: none;
  margin-top: 6px;
  padding-top: 4px;
}

.ref-point-times-label {
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 6px;
}

.ref-point-times-nested {
  margin: 0;
  padding-left: 16px;
  list-style: disc;
}

.ref-point-times-nested li {
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--text-muted);
}

/* grid 第二列：允许收缩，否则侧栏展开/收起后主区域宽度计算异常，画布与地球视觉不居中 */
main.stage-wrap {
  min-width: 0;
  min-height: 0;
}

.stage-wrap {
  position: relative;
  min-height: 0;
  height: 100%;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  overflow: hidden;
  background: #03070d;
  isolation: isolate;
}

.stage-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 58% 48% at 74% 14%, rgba(0, 180, 220, 0.13), transparent 62%),
    radial-gradient(ellipse 52% 42% at 14% 78%, rgba(0, 212, 255, 0.1), transparent 58%),
    radial-gradient(ellipse 90% 55% at 50% 108%, rgba(16, 48, 88, 0.42), transparent 52%),
    linear-gradient(168deg, #071018 0%, #050c14 42%, #03070d 72%, #020508 100%);
  animation: stage-bg-aurora 20s ease-in-out infinite alternate;
}

.stage-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.75;
  background:
    radial-gradient(1px 1px at 8% 14%, rgba(220, 240, 255, 0.55), transparent),
    radial-gradient(1px 1px at 22% 38%, rgba(200, 230, 255, 0.35), transparent),
    radial-gradient(1.5px 1.5px at 41% 18%, rgba(180, 220, 255, 0.45), transparent),
    radial-gradient(1px 1px at 63% 27%, rgba(200, 230, 255, 0.3), transparent),
    radial-gradient(1px 1px at 84% 12%, rgba(220, 240, 255, 0.5), transparent),
    radial-gradient(1px 1px at 91% 52%, rgba(200, 230, 255, 0.28), transparent),
    radial-gradient(1px 1px at 17% 68%, rgba(200, 230, 255, 0.32), transparent),
    radial-gradient(1px 1px at 52% 58%, rgba(180, 220, 255, 0.22), transparent),
    radial-gradient(1px 1px at 76% 71%, rgba(200, 230, 255, 0.38), transparent),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0, 212, 255, 0.018) 2px,
      rgba(0, 212, 255, 0.018) 3px
    );
}

.stage-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 88% 78% at 50% 44%, transparent 36%, rgba(2, 5, 10, 0.68) 100%),
    linear-gradient(180deg, rgba(0, 212, 255, 0.04) 0%, transparent 18%, transparent 82%, rgba(0, 0, 0, 0.35) 100%);
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.45);
}

.stage-bg-grid {
  position: absolute;
  left: -40%;
  right: -40%;
  bottom: -8%;
  height: 62%;
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.11) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.11) 1px, transparent 1px);
  background-size: 44px 44px;
  transform: perspective(480px) rotateX(72deg);
  transform-origin: center top;
  mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 82%);
  -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 82%);
}

@keyframes stage-bg-aurora {
  from {
    filter: hue-rotate(0deg) brightness(1);
    transform: scale(1);
  }
  to {
    filter: hue-rotate(8deg) brightness(1.06);
    transform: scale(1.03);
  }
}

@media (prefers-reduced-motion: reduce) {
  .stage-bg {
    animation: none;
  }
}

#stage {
  flex: 1 1 auto;
  min-height: 200px;
  width: 100%;
  position: relative;
  z-index: 1;
}

#stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.stage-demo-btn[hidden] {
  display: none !important;
}

.stage-demo-btn {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 15;
  padding: 10px 22px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #e8f4ff;
  background: linear-gradient(180deg, rgba(0, 140, 190, 0.92), rgba(0, 90, 140, 0.95));
  border: 1px solid rgba(0, 212, 255, 0.55);
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45), 0 0 16px rgba(0, 212, 255, 0.2);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, opacity 0.2s;
  white-space: nowrap;
}

.stage-demo-btn:hover:not(:disabled) {
  border-color: var(--accent);
  box-shadow: 0 4px 22px rgba(0, 0, 0, 0.5), 0 0 22px rgba(0, 212, 255, 0.35);
}

.stage-demo-btn:disabled {
  opacity: 0.72;
  cursor: default;
  pointer-events: none;
}

.stage-demo-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.stage-tool-btn {
  position: fixed;
  top: 14px;
  z-index: 20;
  font-family: var(--font-body);
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: rgba(5, 15, 28, 0.88);
  border: 1px solid var(--border);
  border-radius: 6px;
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.stage-tool-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 212, 255, 0.12);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.15);
}

.stage-tool-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.stage-reset-btn {
  right: 126px;
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 36px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

/* 语音「全屏显示」：系统全屏不可用时的页面铺满视口方案 */
html.app-page-fullscreen,
html.app-page-fullscreen body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #03070d;
}

html.app-page-fullscreen .app {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  max-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr !important;
  grid-template-rows: minmax(0, 1fr) !important;
}

html.app-page-fullscreen .panel-column {
  display: none !important;
}

html.app-page-fullscreen .panel-toggle-btn {
  display: none;
}

html.app-page-fullscreen .stage-wrap {
  width: 100%;
  height: 100%;
  min-height: 0;
  min-width: 0;
}

html.app-page-fullscreen #stage {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: 100%;
}

.stage-fullscreen-btn {
  right: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  padding: 6px 12px;
  font-size: 0.72rem;
}

.meridian-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
}

.meridian-label {
  position: absolute;
  transform: translate(-50%, -50%);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.02em;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.95), 0 1px 3px rgba(0, 0, 0, 0.85);
  white-space: nowrap;
  pointer-events: none;
}

.meridian-label.demo-flow-label {
  font-size: 0.8rem;
  font-weight: 600;
  z-index: 3;
}

.meridian-label.pressure-ocean-hint-label {
  transform: translate(-50%, -100%);
  margin-top: -8px;
}

.meridian-label.pressure-ocean-hint-above-left {
  transform: translate(-100%, -100%);
  margin-top: -8px;
  text-align: right;
}

.meridian-label.pressure-land-center-label {
  transform: translate(-50%, 0);
  margin-top: 8px;
}

.meridian-label.lat-guide-label {
  font-size: 0.78rem;
  font-weight: 600;
  z-index: 2;
}

.meridian-label.cell-name-label {
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  z-index: 4;
  text-align: center;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.95), 0 0 6px rgba(0, 0, 0, 0.85);
}

.meridian-label.flat-map-graticule-label {
  font-size: 0.68rem;
  font-weight: 600;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  color: #9ecae8;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.95);
  z-index: 1;
}

.meridian-label.flat-map-graticule-lat {
  transform: translate(-100%, -50%);
}

.meridian-label.flat-map-graticule-lon {
  transform: translate(-50%, -100%);
}

.local-time-hour-label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #ffd966;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.95), 0 0 10px rgba(255, 200, 60, 0.35);
}

.cardinal-label {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #fff6c8;
  text-shadow: 0 0 8px rgba(0, 0, 0, 1), 0 0 12px rgba(255, 220, 120, 0.4);
}

.polaris-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #ffe98a;
  white-space: nowrap;
  text-shadow: 0 0 8px rgba(0, 0, 0, 1), 0 0 12px rgba(255, 200, 80, 0.55);
}

.equator-mountain-label {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-warm);
  white-space: nowrap;
  text-shadow: 0 0 8px rgba(0, 0, 0, 1), 0 0 10px rgba(255, 107, 53, 0.45);
  pointer-events: none;
}

.stage-corner-stack {
  position: absolute;
  right: 16px;
  bottom: 12px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  max-width: min(92vw, 400px);
  pointer-events: auto;
}

/* 锚定在右侧动画区域 main.stage-wrap 内，而非整页视口 */
.stage-gesture-dock.stage-bottom-left {
  position: absolute;
  left: 16px;
  bottom: 12px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  pointer-events: auto;
}

.stage-live-data .collapsible-content ul {
  margin: 0;
  padding-left: 18px;
}

.hint-bar {
  align-self: flex-end;
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(5, 15, 28, 0.88);
  backdrop-filter: blur(8px);
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.stage-gesture-check {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(5, 15, 28, 0.88);
  backdrop-filter: blur(8px);
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  user-select: none;
}

.stage-gesture-check:hover {
  border-color: var(--accent);
  color: var(--text);
}

.stage-gesture-check:has(input:checked) {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 212, 255, 0.1);
}

.stage-gesture-check input {
  flex-shrink: 0;
  margin: 0;
  accent-color: var(--accent);
}

.gesture-status {
  align-self: flex-start;
  max-width: min(92vw, 280px);
  margin: 0;
  padding: 0 4px;
  font-size: 0.68rem;
  line-height: 1.4;
  text-align: left;
  color: var(--accent-dim);
}

.voice-help {
  align-self: flex-start;
  max-width: min(92vw, 260px);
  margin: 0;
  padding: 6px 10px;
  font-size: 0.65rem;
  line-height: 1.45;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: rgba(5, 15, 28, 0.65);
}

.stage-gesture-check:has(input:disabled) {
  opacity: 0.45;
  cursor: not-allowed;
}

.gesture-preview-wrap {
  position: relative;
  width: 168px;
  height: 126px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(5, 15, 28, 0.92);
  box-shadow: var(--glow);
  pointer-events: none;
}

.gesture-preview-video,
.gesture-preview-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.gesture-preview-overlay {
  pointer-events: none;
}

.panel-explain-entry {
  flex-shrink: 0;
  margin: 0 10px 8px;
  min-width: 0;
  max-height: min(38vh, 300px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-explain-entry:not(.collapsed) .collapsible-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-dim) transparent;
}

.panel-explain-entry .collapsible-head {
  flex-shrink: 0;
}

.app.panel-collapsed .panel-explain-entry {
  display: none;
}

.collapsible-box {
  max-width: 100%;
  min-width: 0;
  padding: 10px 12px;
  box-sizing: border-box;
}

.collapsible-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.collapsible-box:not(.collapsed) .collapsible-head {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.collapsible-head-title {
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.collapsible-head-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 11px;
  line-height: 1;
  font-family: inherit;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(0, 40, 70, 0.5);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.collapsible-head-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 212, 255, 0.1);
}

.collapsible-head-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.collapsible-box.collapsed .collapsible-content {
  display: none;
}

.collapsible-box.collapsed .collapsible-head {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.knowledge-explain-body {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.65;
  color: var(--text);
  font-family: var(--font-body);
  white-space: pre-line;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 100%;
}

.layer-check-ref-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.ref-point-block {
  grid-column: 1 / -1;
}

.preset-cities-block {
  margin-top: 8px;
}

.preset-cities-title {
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 6px;
  opacity: 0.9;
}

.preset-cities-checkboxes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
}

.preset-cities-checkboxes > label {
  margin: 0;
}

.preset-cities-checkboxes input[type="checkbox"] {
  width: auto;
  margin: 0 6px 0 0;
  transform: translateY(1px);
}

.preset-cities-checkboxes > label input[type="checkbox"] {
  margin-right: 0;
}

.ref-point-check-label {
  flex: 1;
  min-width: 0;
}

.ref-point-add-btn {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(0, 40, 70, 0.5);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.ref-point-add-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 212, 255, 0.1);
}

.ref-point-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ref-point-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(0, 20, 40, 0.5);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  min-width: 0;
}

.ref-point-list-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.ref-point-list-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.ref-point-list-actions button {
  width: auto;
}

.ref-point-settings-btn {
  flex: 0 0 auto;
  padding: 3px 8px;
  font-size: 0.72rem;
  cursor: pointer;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(0, 40, 70, 0.5);
  color: var(--text);
  white-space: nowrap;
}

.ref-point-settings-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 212, 255, 0.1);
}

.ref-point-delete-btn {
  flex: 0 0 auto;
  box-sizing: border-box;
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  border: 1px solid #6a3030;
  background: #2a1212;
  color: #ffaaaa;
}

.ref-point-delete-btn:hover {
  background: #3d1a1a;
  border-color: #8a4040;
}

.ref-point-label {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  color: #7affc8;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.95), 0 0 10px rgba(0, 229, 160, 0.35);
}

.movement-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.movement-row {
  display: flex;
  gap: 6px;
}

.movement-controls button {
  width: 40px;
  height: 40px;
  padding: 0;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.copyright-entry {
  flex-shrink: 0;
  margin-top: auto;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(0, 212, 255, 0.35);
  background: linear-gradient(
    180deg,
    rgba(0, 212, 255, 0.06) 0%,
    rgba(0, 50, 90, 0.28) 100%
  );
  box-shadow: inset 0 1px 0 rgba(0, 212, 255, 0.12);
}

.app.panel-collapsed .copyright-entry {
  display: none;
}

.copyright-text-btn {
  display: block;
  width: 100%;
  padding: 10px 14px;
  font-size: 0.82rem;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #e8fcff;
  background: linear-gradient(
    135deg,
    rgba(0, 212, 255, 0.22) 0%,
    rgba(0, 100, 170, 0.32) 55%,
    rgba(0, 60, 110, 0.38) 100%
  );
  border: 1px solid rgba(0, 212, 255, 0.5);
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  text-shadow: 0 0 14px rgba(0, 212, 255, 0.45);
  box-shadow:
    0 0 18px rgba(0, 212, 255, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition:
    background 0.2s,
    border-color 0.2s,
    color 0.2s,
    box-shadow 0.2s,
    transform 0.15s;
}

.copyright-text-btn:hover {
  color: #fff;
  border-color: var(--accent);
  background: linear-gradient(
    135deg,
    rgba(0, 212, 255, 0.35) 0%,
    rgba(0, 120, 190, 0.42) 100%
  );
  box-shadow:
    0 0 28px rgba(0, 212, 255, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.copyright-text-btn:active {
  transform: scale(0.98);
}

.copyright-text-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.copyright-modal {
  max-width: 440px;
}

.copyright-modal .modal-title {
  text-align: center;
}

.copyright-modal .modal-actions {
  justify-content: center;
}

.copyright-qr-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 14px 16px;
  margin-bottom: 14px;
}

.copyright-qr-item {
  margin: 0;
  flex: 1 1 150px;
  max-width: 200px;
  min-width: 0;
  text-align: center;
}

.copyright-qr-caption {
  margin: 8px 0 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--text-muted);
}

.copyright-qr-image {
  display: block;
  width: 100%;
  max-width: 200px;
  height: auto;
  margin: 0 auto;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.copyright-note {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--text);
  text-align: center;
  font-family: var(--font-body);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.55);
  box-sizing: border-box;
  font-family: var(--font-body);
}

.modal-overlay[hidden] {
  display: none !important;
}

.modal-dialog {
  width: 100%;
  max-width: 380px;
  padding: 18px 16px;
  border-radius: 8px;
  background: rgba(8, 18, 32, 0.98);
  border: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  color: var(--text);
}

.modal-title {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-display);
  letter-spacing: 0.06em;
  color: var(--accent);
}

.modal-field {
  margin-bottom: 12px;
}

.modal-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.modal-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(0, 40, 70, 0.5);
  color: var(--text);
  font-size: 0.84rem;
  font-family: var(--font-body);
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.15);
}

.modal-field input[type="range"] {
  width: 100%;
}

.modal-range-val {
  font-family: var(--font-display);
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 600;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  justify-content: flex-end;
}

.modal-btn {
  padding: 8px 18px;
  font-size: 0.84rem;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: rgba(0, 40, 70, 0.6);
  color: var(--text);
  font-family: inherit;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.modal-btn:hover {
  border-color: var(--accent);
  background: rgba(0, 212, 255, 0.12);
}

.modal-btn-primary {
  border-color: var(--accent);
  color: var(--accent);
}

.stage-movement-controls {
  position: fixed;
  right: 16px;
  top: 58px;
  z-index: 20;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(5, 15, 28, 0.88);
  backdrop-filter: blur(8px);
  box-shadow: var(--glow);
}

.stage-movement-controls .movement-controls {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

.stage-movement-controls .movement-controls .movement-row {
  display: flex;
  gap: 4px;
}

.stage-movement-controls .movement-controls button {
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--text-muted);
  background: rgba(0, 40, 70, 0.5);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.stage-movement-controls .movement-controls button:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 212, 255, 0.1);
}

@media (max-width: 1000px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .panel-column {
    width: 100%;
    max-width: none;
  }

  .app.panel-collapsed .panel-column {
    width: 100%;
    max-height: 0;
    overflow: visible;
  }

  .panel {
    max-height: 48vh;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .app.panel-collapsed .panel {
    max-height: 0;
    opacity: 0;
  }

  .panel-toggle-btn {
    left: auto;
    right: 12px;
    top: auto;
    bottom: 12px;
    transform: none;
    border-radius: 8px;
    border-left: 1px solid var(--border);
    width: 36px;
    height: 36px;
  }
}

/* —— 河流袭夺：加载、视频、条件示意、模型标签 —— */

.panel-tip {
  margin: 8px 0 0;
  font-size: 0.74rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.condition-list {
  margin: 0;
  padding-left: 18px;
  font-size: 0.78rem;
  line-height: 1.65;
  color: var(--text-muted);
}

.condition-list li + li {
  margin-top: 4px;
}

.stage-flat {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  padding: 24px;
  overflow: auto;
  background: transparent;
}

.stage-flat[hidden],
.stage-loading[hidden],
.stage-error[hidden],
.model-labels[hidden] {
  display: none !important;
}

.stage-flat-inner {
  width: 100%;
  max-width: 960px;
}

.stage-loading,
.stage-error {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(8, 18, 28, 0.72);
  backdrop-filter: blur(6px);
}

.stage-loading-spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(0, 212, 255, 0.2);
  border-top-color: var(--accent);
  animation: river-spin 0.9s linear infinite;
}

@keyframes river-spin {
  to { transform: rotate(360deg); }
}

.stage-loading-progress {
  width: min(280px, 72vw);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.stage-loading-progress-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 212, 255, 0.15);
  overflow: hidden;
}

.stage-loading-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(0, 180, 220, 0.85), var(--accent));
  transition: width 0.18s ease-out;
}

.stage-loading-percent {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-align: center;
}

.stage-loading p,
.stage-error p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  max-width: 420px;
  line-height: 1.6;
}

.stage-error p {
  color: #e8a090;
}

.stage-flat--video {
  padding: 12px;
  overflow: hidden;
}

.stage-flat--image {
  padding: 12px;
  overflow: hidden;
}

.stage-flat--video .stage-flat-inner,
.stage-flat--image .stage-flat-inner {
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
}

.stage-image-viewer {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.stage-image-viewport {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(3, 8, 14, 0.35);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.35), var(--glow);
  touch-action: none;
  cursor: default;
  outline: none;
}

.stage-image-viewport.is-dragging {
  cursor: grabbing;
}

.stage-image-stage {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: center center;
  will-change: transform;
}

.stage-image {
  display: block;
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.stage-image-toolbar {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(5, 15, 28, 0.88);
  backdrop-filter: blur(8px);
  box-shadow: var(--glow);
}

.stage-image-tool-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  font-family: var(--font-body);
  color: var(--text-muted);
  background: rgba(0, 40, 70, 0.5);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.stage-image-tool-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(0, 212, 255, 0.12);
}

.stage-image-tool-reset {
  width: auto;
  padding: 0 10px;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.stage-image-zoom-val {
  min-width: 3.2em;
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-align: center;
}

.stage-video-viewer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.stage-video-frame {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage-video-step-label {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: auto;
  max-width: calc(100% - 40px);
  margin: 0;
  padding: 8px 16px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.45;
  color: #e8f4f8;
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid rgba(0, 212, 255, 0.4);
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.stage-video-step-label[hidden] {
  display: none !important;
}

.stage-video {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: var(--glow);
  background: #000;
}

.stage-video-demo-btn {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 2;
  flex-shrink: 0;
}

.model-labels {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
  overflow: hidden;
}

.model-label-tag {
  position: absolute;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(5, 15, 28, 0.88);
  backdrop-filter: blur(8px);
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  white-space: nowrap;
}

/* 标签固定在动画区域背景上，不随模型旋转 */
.model-labels--both #labelBefore {
  left: 25%;
  bottom: 14%;
  transform: translateX(-50%);
}

.model-labels--both #labelAfter {
  left: 75%;
  bottom: 14%;
  transform: translateX(-50%);
}

.model-labels--before #labelBefore {
  left: 50%;
  bottom: 14%;
  transform: translateX(-50%);
}

.model-labels--after #labelAfter {
  left: 50%;
  bottom: 14%;
  transform: translateX(-50%);
}

.model-label-tag[hidden] {
  display: none;
}

.conditions-diagram {
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(5, 15, 28, 0.88);
  box-shadow: var(--glow);
}

.conditions-diagram-title {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  text-align: center;
}

.conditions-visual {
  position: relative;
  height: 320px;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(180deg, #1a3040 0%, #102028 42%, #3a3028 43%, #2a2420 100%);
  border: 1px solid rgba(0, 212, 255, 0.15);
}

.conditions-ridge {
  position: absolute;
  left: 18%;
  right: 18%;
  top: 38%;
  height: 18%;
  background: linear-gradient(180deg, #7a7468, #5a5448);
  border-radius: 40% 40% 8px 8px;
  box-shadow: inset 0 -4px 12px rgba(0, 0, 0, 0.25);
}

.conditions-ridge-label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.68rem;
  color: #ffe8c8;
  white-space: nowrap;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.95);
}

.conditions-river {
  position: absolute;
  bottom: 8%;
  width: 34%;
  height: 28%;
  border-radius: 50% 50% 0 0 / 30% 30% 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 10px;
  gap: 2px;
}

.conditions-river--capture {
  left: 8%;
  background: linear-gradient(180deg, rgba(0, 180, 220, 0.15), rgba(0, 140, 200, 0.55));
  border: 1px solid rgba(0, 212, 255, 0.35);
}

.conditions-river--captured {
  right: 8%;
  background: linear-gradient(180deg, rgba(100, 140, 180, 0.12), rgba(80, 110, 150, 0.45));
  border: 1px solid rgba(120, 160, 200, 0.3);
}

.conditions-river-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #e8f4fc;
}

.conditions-river-note {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-align: center;
  max-width: 90%;
}

.conditions-arrow {
  position: absolute;
  font-size: 1.6rem;
  color: var(--accent);
  opacity: 0.85;
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.4);
}

.conditions-arrow--left {
  left: 28%;
  top: 52%;
}

.conditions-arrow--right {
  right: 28%;
  top: 52%;
}

.conditions-factor {
  position: absolute;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.62rem;
  color: var(--text-muted);
  background: rgba(5, 15, 28, 0.75);
  border: 1px dashed var(--border);
  white-space: nowrap;
}

.conditions-factor--1 { left: 4%; top: 8%; }
.conditions-factor--2 { right: 4%; top: 8%; }
.conditions-factor--3 { left: 50%; top: 12%; transform: translateX(-50%); }
.conditions-factor--4 { left: 50%; bottom: 6%; transform: translateX(-50%); }

.conditions-caption {
  margin: 14px 0 0;
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text-muted);
  text-align: center;
}

.stage-reset-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.model-view-presets {
  grid-template-columns: 1fr 1fr 1fr;
}

.elements-layer-checkboxes {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px 20px;
  margin-top: 8px;
}

.elements-layer-checkboxes label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--text-muted);
}

.elements-layer-checkboxes input[type="checkbox"] {
  width: auto;
  margin: 0;
  transform: translateY(1px);
}
