: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-body::-webkit-scrollbar {
  width: 5px;
}
.panel-body::-webkit-scrollbar-track {
  background: transparent;
}
.panel-body::-webkit-scrollbar-thumb {
  background: var(--accent-dim);
  border-radius: 999px;
}

.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;
}

.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;
  pointer-events: auto;
  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-tip {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 6px 0;
}

.panel-list {
  margin: 4px 0 8px;
  padding-left: 18px;
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.panel-list li + li {
  margin-top: 3px;
}

.panel-list strong {
  color: #c8e8f4;
  font-weight: 600;
}

.danxia-type-checkboxes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  margin: 8px 0 4px;
}

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

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

.control-group input[type="checkbox"] {
  accent-color: var(--accent);
}

/* ===== 面板折叠按钮 ===== */
.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;
  pointer-events: auto;
  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;
}

/* ===== 知识点解读面板 ===== */
.knowledge-box {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(5, 15, 28, 0.88);
  backdrop-filter: blur(8px);
  box-shadow: var(--glow);
}

.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%;
}

/* ===== 底部版权 ===== */
.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;
  pointer-events: auto;
  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;
}

/* ===== 右侧动画区域 ===== */
.stage-wrap {
  position: relative;
  min-height: 0;
  min-width: 0;
  height: 100%;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  overflow: hidden;
  background: #03070d;
}

.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-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-loading {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(8, 18, 28, 0.72);
  pointer-events: none;
}

/* 默认隐藏，仅当 :not([hidden]) 时显示（可见时仍穿透点击） */
.stage-loading:not([hidden]) {
  display: flex;
}

.stage-loading[hidden],
.stage-loading[hidden] * {
  display: none !important;
}

/* 无加载内容时也不阻挡点击 */
.stage-loading.no-pe,
.stage-loading.no-pe * {
  pointer-events: none !important;
}

.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: danxia-spin 0.9s linear infinite;
}

@keyframes danxia-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 {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  max-width: 420px;
  line-height: 1.6;
}

/* ===== 错误提示遮罩 ===== */
.stage-error {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(8, 18, 28, 0.72);
  pointer-events: none;
}

.stage-error:not([hidden]) {
  display: flex;
}

.stage-error[hidden],
.stage-error[hidden] * {
  display: none !important;
}

.stage-error.no-pe,
.stage-error.no-pe * {
  pointer-events: none !important;
}

.stage-error p {
  margin: 0;
  font-size: 0.85rem;
  color: #e8a090;
  text-align: center;
  max-width: 420px;
  line-height: 1.6;
}

/* ===== 视频/图片平板区 ===== */
.stage-flat {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: none;
  align-items: stretch;
  justify-content: stretch;
  padding: 24px;
  overflow: auto;
  background: transparent;
}

.stage-flat:not([hidden]) {
  display: flex;
}

.stage-flat[hidden],
.stage-flat[hidden] * {
  display: none !important;
}

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

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

.stage-flat--image {
  padding: 6px;
  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-demo-btn {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 2;
  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-video-demo-btn {
  flex-shrink: 0;
}

/* ===== 工具按钮 ===== */
.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;
  pointer-events: auto;
  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: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 36px;
  padding: 0;
  font-size: 20px;
  line-height: 1;
}

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

/* ===== 操作提示 ===== */
.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;
}

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

/* ===== 全屏模式适配 ===== */
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%;
}

/* ===== 折叠面板时右侧隐藏面板内容 ===== */
.app.panel-collapsed .panel-body {
  display: none;
}

/* ===== 版权弹窗 / 通用弹窗 ===== */
.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);
}

.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-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);
}
