/* 基础变量与全局重置 */
:root {
  --bg-dark: #020d1a;
  --bg-toolbar: #041528;
  --brand-cyan: #38bdf8;
  --brand-glow: rgba(56, 189, 248, 0.4);
  --brand-green: #10b981;
  --text-primary: #e2f0fd;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-subtle: rgba(56, 189, 248, 0.18);
  --border-highlight: rgba(56, 189, 248, 0.55);
  --modal-bg: rgba(3, 18, 36, 0.95);
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 整体应用骨架 */
.app-root {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* 顶部演示控制栏 */
.toolbar {
  flex-shrink: 0;
  height: 46px;
  background: var(--bg-toolbar);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 50;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-green);
  box-shadow: 0 0 8px var(--brand-green);
  animation: pulse-dot 2s infinite ease-in-out;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.9); }
}

.brand-text {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.5px;
}

.demo-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.page-indicator {
  display: flex;
  align-items: center;
  margin-left: 10px;
  padding: 2px 10px;
  border-radius: 14px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-size: 12px;
}

.indicator-label {
  color: var(--text-secondary);
}

.indicator-name {
  color: var(--brand-cyan);
  font-weight: 600;
}

/* 控制栏中间切页 */
.toolbar-center {
  display: flex;
  align-items: center;
}

.quick-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0 !important;
}

.page-select {
  height: 28px;
  background: #061e38;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 0 8px;
  font-size: 12px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.page-select:hover, .page-select:focus {
  border-color: var(--brand-cyan);
}

/* 控制栏右侧操作 */
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-pill-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: linear-gradient(135deg, #0e3b6d 0%, #08284d 100%) !important;
  border: 1px solid #38bdf8 !important;
  color: #fff !important;
  font-weight: 500;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.2);
}

.lang-pill-btn:hover {
  background: linear-gradient(135deg, #15559d 0%, #0e3b6d 100%) !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

.lang-icon {
  font-size: 12px;
}

.shortcut-tip {
  font-size: 11px;
  color: var(--text-muted);
}

.tool-btn {
  padding: 4px 12px;
  font-size: 12px;
  font-family: inherit;
  color: var(--text-primary);
  background: #092648;
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tool-btn:hover {
  background: #0f3764;
  border-color: var(--brand-cyan);
  color: #fff;
}

.tool-btn.highlight {
  background: #0284c7;
  border-color: #38bdf8;
  color: #fff;
  font-weight: 500;
}

.tool-btn.highlight:hover {
  background: #0369a1;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

/* 主舞台自适应居中容器 */
.stage-container {
  flex: 1;
  width: 100%;
  height: calc(100vh - 46px - 26px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 40%, #061d36 0%, #020c18 85%);
}

.stage-viewport {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 核心展示舞台 */
.stage {
  position: relative;
  width: auto;
  height: 100%;
  max-width: 100%;
  aspect-ratio: 1672 / 941;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  background: #000;
}

.stage.page-overview {
  aspect-ratio: 1672 / 941;
}

.stage.page-secondary {
  aspect-ratio: 1920 / 1080;
}

/* 舞台内底图层 */
.stage-layers {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.stage-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  opacity: 0;
  transition: opacity 0.18s ease-in-out;
  pointer-events: none;
}

.stage-layer.active {
  opacity: 1;
}

/* 通用交互热区基类 */
.hotspot {
  position: absolute;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  padding: 0;
  outline: none;
  z-index: 10;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

/* 顶部 Logo 返回首页 */
.hotspot-logo {
  cursor: pointer;
  border-radius: 4px;
}

.hotspot-logo:hover {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.4);
}

/* 顶部语言切换按钮热区 */
.hotspot-lang-zh, .hotspot-lang-en {
  cursor: pointer;
  border-radius: 3px;
}

.hotspot-lang-zh:hover, .hotspot-lang-en:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}

/* 在英文模式下，二级页面的中英文按钮状态微调 */
.stage.page-secondary.lang-en .hotspot-lang-zh {
  background: rgba(3, 19, 39, 0.7);
}

.stage.page-secondary.lang-en .hotspot-lang-en {
  background: linear-gradient(180deg, #1d6fc6 0%, #0e4c8c 100%);
  border: 1px solid #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
}

/* ========================================================
   顶部实时时钟动态覆盖层（100% 完全遮盖原背景文字）
   ======================================================== */
.live-clock {
  position: absolute;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d8ecff;
  font-family: Consolas, "Roboto Mono", "Segoe UI", monospace;
  font-size: clamp(9px, 0.95vw, 15px);
  font-weight: 500;
  letter-spacing: 0.6px;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  opacity: 1;
}

/* 一级页面 (1672 x 941) 时钟绝对覆盖 */
.stage.page-overview .live-clock {
  left: 80.0%;
  top: 3.8%;
  width: 11.6%;
  height: 3.2%;
  background: linear-gradient(180deg, #1b5695 0%, #1e5c9f 100%);
  border-radius: 2px;
  box-shadow: 0 0 4px #1b5695;
}

/* 二级页面 (1920 x 1080) 时钟绝对覆盖 */
.stage.page-secondary .live-clock {
  left: 82.2%;
  top: 3.0%;
  width: 12.3%;
  height: 3.8%;
  background: linear-gradient(180deg, #2b77c5 0%, #05488c 100%);
  border-radius: 2px;
  box-shadow: 0 0 4px #05488c;
}

/* 菜单项热区通用效果 */
.menu-btn {
  border-radius: 4px;
  cursor: pointer;
}

.menu-btn:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: inset 0 0 10px rgba(56, 189, 248, 0.25), 0 0 10px rgba(56, 189, 248, 0.35);
}

.menu-btn.current {
  cursor: default;
  pointer-events: none;
}

/* ========================================================
   一级页面（首页总览, 1672 x 941）精确热区坐标
   ======================================================== */
.stage.page-overview .hotspot-logo {
  left: 1.5%;
  top: 1.5%;
  width: 28.5%;
  height: 6.8%;
}

.stage.page-overview .hotspot-lang-zh {
  left: 74.16%;
  top: 3.72%;
  width: 3.47%;
  height: 3.08%;
}

.stage.page-overview .hotspot-lang-en {
  left: 77.63%;
  top: 3.72%;
  width: 3.65%;
  height: 3.08%;
}

.stage.page-overview .menu-btn {
  left: 1.38%;
  width: 10.53%;
  height: 5.10%;
}

.stage.page-overview .menu-btn[data-target="0"] { top: 13.60%; }
.stage.page-overview .menu-btn[data-target="1"] { top: 19.34%; }
.stage.page-overview .menu-btn[data-target="2"] { top: 25.08%; }
.stage.page-overview .menu-btn[data-target="3"] { top: 30.82%; }
.stage.page-overview .menu-btn[data-target="4"] { top: 36.56%; }
.stage.page-overview .menu-btn[data-target="5"] { top: 42.30%; }
.stage.page-overview .menu-btn[data-target="6"] { top: 48.03%; }
.stage.page-overview .menu-btn[data-target="7"] { top: 53.77%; }
.stage.page-overview .menu-btn[data-target="8"] { top: 59.51%; }

/* ========================================================
   二级页面（8个模块, 1920 x 1080）精确热区坐标
   ======================================================== */
.stage.page-secondary .hotspot-logo {
  left: 1.5%;
  top: 1.5%;
  width: 29.5%;
  height: 6.5%;
}

.stage.page-secondary .hotspot-lang-zh {
  left: 75.52%;
  top: 3.24%;
  width: 3.33%;
  height: 3.24%;
}

.stage.page-secondary .hotspot-lang-en {
  left: 78.91%;
  top: 3.24%;
  width: 3.39%;
  height: 3.24%;
}

.stage.page-secondary .menu-btn {
  left: 1.30%;
  width: 11.15%;
  height: 5.09%;
}

.stage.page-secondary .menu-btn[data-target="0"] { top: 16.30%; }
.stage.page-secondary .menu-btn[data-target="1"] { top: 22.69%; }
.stage.page-secondary .menu-btn[data-target="2"] { top: 28.98%; }
.stage.page-secondary .menu-btn[data-target="3"] { top: 34.63%; }
.stage.page-secondary .menu-btn[data-target="4"] { top: 40.28%; }
.stage.page-secondary .menu-btn[data-target="5"] { top: 46.02%; }
.stage.page-secondary .menu-btn[data-target="6"] { top: 51.67%; }
.stage.page-secondary .menu-btn[data-target="7"] { top: 57.31%; }
.stage.page-secondary .menu-btn[data-target="8"] { top: 63.06%; }

/* 底部状态说明栏 */
.footer-bar {
  flex-shrink: 0;
  height: 26px;
  background: #020c18;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  font-size: 11px;
  color: var(--text-muted);
}

/* 全屏状态增强 */
:fullscreen .toolbar {
  opacity: 0.2;
  transition: opacity 0.3s ease;
}

:fullscreen .toolbar:hover {
  opacity: 1;
}

:fullscreen .footer-bar {
  display: none;
}

:fullscreen .stage-container {
  height: 100vh;
  padding: 0;
}

/* Toast 提示浮窗 */
.toast {
  position: fixed;
  top: 58px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: rgba(8, 30, 56, 0.96);
  border: 1px solid var(--brand-cyan);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6), 0 0 15px rgba(56, 189, 248, 0.3);
  padding: 10px 20px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #fff;
  z-index: 100;
  pointer-events: auto;
  animation: slide-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(10px);
}

.toast[hidden] {
  display: none;
}

.toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brand-cyan);
  color: #031527;
  font-size: 11px;
  font-weight: bold;
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* 说明弹窗 Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 8, 20, 0.75);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  z-index: 120;
  padding: 20px;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-dialog {
  width: min(600px, 94vw);
  max-height: 88vh;
  background: var(--modal-bg);
  border: 1px solid var(--border-highlight);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(56, 189, 248, 0.2);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modal-pop 0.22s ease-out;
}

@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.modal-close-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.guide-section h3 {
  font-size: 14px;
  color: var(--brand-cyan);
  margin-bottom: 8px;
}

.guide-section ul {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.guide-section strong {
  color: #fff;
}

.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.shortcut-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.shortcut-item kbd {
  background: #0f2c4f;
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: var(--brand-cyan);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-family: monospace;
}

.modal-p {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.6;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
}

.confirm-btn {
  background: #0284c7;
  color: #fff;
  border: 1px solid #38bdf8;
  padding: 7px 18px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.confirm-btn:hover {
  background: #0369a1;
}

/* 响应式适配 */
@media (max-width: 900px) {
  .shortcut-tip { display: none; }
  .shortcut-grid { grid-template-columns: 1fr; }
  .footer-bar span:last-child { display: none; }
}


/* 遮盖底图时间，保留页面本身的备注并增强可见度。 */
.time-mask { position:absolute; z-index:20; pointer-events:none; border-radius:2px; }
.page-overview .time-mask { left:82%; top:4%; width:9.5%; height:3%; background:#195797; }
.page-secondary .time-mask { left:83.2%; top:4%; width:10.3%; height:3%; background:#0a4c91; }
.original-note-highlight { position:absolute; z-index:21; pointer-events:none; left:.8%; bottom:2.6%; width:46%; height:3.4%; border:1px solid rgba(255,213,90,.95); border-radius:3px; background:rgba(255,204,72,.09); backdrop-filter:brightness(2.1); }
.page-secondary .original-note-highlight { bottom:.8%; height:3.2%; width:53%; }

/* 隐藏标题栏上方的演示操作行。 */
.toolbar, :fullscreen .toolbar { display: none; }
