/* =========================================================
   信仰之路 · 长征互动学习 —— 纯前端静态站点样式
   （由原 Next.js + Tailwind 站点改写，视觉保持一致）
   ========================================================= */

/* 字体已本地化（见 assets/css/fonts.css，由 scripts/offline_fetch.py 生成） */
/* 相对路径（相对本 CSS 文件），保证 file:// 与子目录部署都能加载 */
:root {
  --wood: #2b2118;
  --wood-2: #3a2c1e;
  --wood-3: #241b12;
  --paper: #e8d5b0;
  --paper-deep: #d9c193;
  --seal: #a4262c;
  --seal-deep: #7c1d22;
  --brass: #c8a15a;
  --brass-soft: #e8c877;
  --cream: #f0e6d0;
  --hill: #7a8b5a;
  --water: #4a6b7c;
  --ink: #3a2c1e;
  --border: #5a4832;
  --muted: #b9a582;
  --radius: 6px;
  --font-sans: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', ui-sans-serif, system-ui, sans-serif;
  --font-serif: 'Noto Serif SC', 'Songti SC', 'SimSun', ui-serif, Georgia, serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--wood);
  color: var(--cream);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
}

button {
  font-family: inherit;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

img {
  max-width: 100%;
}

.serif {
  font-family: var(--font-serif);
}

.hidden {
  display: none !important;
}

/* ---------------- 关键帧动画 ---------------- */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

@keyframes stampIn {
  0% { opacity: 0; transform: scale(2.6) rotate(-28deg); }
  60% { opacity: 1; transform: scale(0.92) rotate(-10deg); }
  100% { opacity: 1; transform: scale(1) rotate(-12deg); }
}

@keyframes flameFlicker {
  0%, 100% { opacity: 1; transform: scale(1); }
  45% { opacity: 0.75; transform: scale(0.94); }
  70% { opacity: 0.9; transform: scale(1.04); }
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.75; }
}

@keyframes paperIn {
  0% { opacity: 0; transform: translateY(18px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes kenburns {
  0% { transform: scale(1); }
  100% { transform: scale(1.12) translate(-1.5%, -1%); }
}

@keyframes slideIn {
  0% { opacity: 0; transform: translateY(14px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes typeCaret {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes ping {
  75%, 100% { transform: scale(1.9); opacity: 0; }
}

.anim-shake { animation: shake 0.45s ease; }
.anim-stamp { animation: stampIn 0.55s cubic-bezier(0.2, 1.4, 0.4, 1) forwards; }
.anim-flame { animation: flameFlicker 1.6s ease-in-out infinite; transform-origin: bottom center; }
.anim-glow { animation: glowPulse 2.4s ease-in-out infinite; }
.anim-paper-in { animation: paperIn 0.5s ease both; }
.anim-kenburns { animation: kenburns 14s ease-in-out infinite alternate; }
.anim-slide-in { animation: slideIn 0.32s ease-out both; }
.anim-ping { animation: ping 1.2s cubic-bezier(0, 0, 0.2, 1) infinite; }
.caret { animation: typeCaret 1s steps(1) infinite; }

/* ---------------- 质感 ---------------- */
.paper-texture {
  background-image: url('../../public/images/paper.jpg');
  background-size: cover;
  background-position: center;
}

.deck-paper {
  background-color: #f1e2bd;
  background-image:
    radial-gradient(ellipse at 18% 8%, rgba(255, 248, 226, 0.7), transparent 55%),
    radial-gradient(ellipse at 88% 92%, rgba(122, 90, 46, 0.16), transparent 52%),
    repeating-linear-gradient(0deg, rgba(90, 70, 40, 0.03) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(90, 70, 40, 0.024) 0 1px, transparent 1px 4px);
}

.film-frame {
  position: relative;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.65);
}

.film-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%);
  mix-blend-mode: multiply;
}

.film-grain::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;
  background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.15) 0px, transparent 1px, transparent 3px);
}

.scrollbar-paper::-webkit-scrollbar { width: 8px; }
.scrollbar-paper::-webkit-scrollbar-track { background: var(--paper-deep); }
.scrollbar-paper::-webkit-scrollbar-thumb { background: var(--seal); border-radius: 4px; }

.scrollbar-paper { scrollbar-width: thin; scrollbar-color: var(--seal) var(--paper-deep); }

/* ---------------- 通用控件 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}

.btn:active { transform: translateY(1px); }

.btn-seal {
  background: var(--seal);
  color: var(--cream);
}

.btn-seal:hover { background: var(--seal-deep); }

.btn-seal:disabled {
  background: rgba(138, 115, 85, 0.4);
  color: #7a6a52;
}

.btn-ghost {
  border-color: rgba(200, 161, 90, 0.6);
  background: rgba(164, 38, 44, 0.1);
  color: var(--brass);
}

.btn-ghost:hover { background: var(--seal); color: var(--cream); }

.btn-outline {
  border-color: var(--border);
  background: transparent;
  color: var(--muted);
}

.btn-outline:hover { border-color: var(--seal); color: var(--cream); }

.btn-paper {
  border-color: rgba(138, 111, 77, 0.6);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
}

.btn-paper:hover { border-color: var(--seal); color: var(--seal); }

.btn-paper.is-active {
  border-color: var(--seal);
  background: var(--seal);
  color: #f7ecd4;
}

.btn-paper.is-on {
  border-color: var(--brass);
  background: rgba(200, 161, 90, 0.2);
  color: #e8c877;
}

.chip {
  border-radius: 3px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.6;
}

.chip-seal { background: var(--seal); color: var(--cream); }
.chip-paper { background: rgba(255, 255, 255, 0.8); color: var(--border); }
.chip-brass { background: rgba(164, 38, 44, 0.1); border: 1px solid rgba(164, 38, 44, 0.4); color: var(--seal); }

.panel {
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.75);
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.panel-dashed {
  border: 2px dashed rgba(164, 38, 44, 0.6);
  background: rgba(255, 255, 255, 0.75);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.section-title {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--seal-deep);
  margin: 0 0 8px;
}

/* ---------------- 开场页 ---------------- */
.opening {
  position: relative;
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--wood-3);
}

.opening-bg {
  position: absolute;
  inset: 0;
}

.opening-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35;
}

.opening-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(36, 27, 18, 0.7), rgba(36, 27, 18, 0.55) 55%, #241b12);
}

.opening-inner {
  position: relative;
  z-index: 10;
  max-width: 640px;
  margin: 0 16px;
  text-align: center;
}

.opening-kicker {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: 0.5em;
  color: var(--brass);
}

.opening-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 56px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--cream);
}

.opening-sub {
  margin: 8px 0 0;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.35em;
  color: var(--seal);
  text-shadow: 0 0 18px rgba(164, 38, 44, 0.4);
}

.opening-card {
  max-width: 576px;
  margin: 32px auto 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(58, 44, 30, 0.8);
  padding: 24px;
  backdrop-filter: blur(4px);
}

.opening-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.9;
  color: var(--paper);
}

.opening-card b { color: var(--brass); }

.btn-start {
  margin-top: 32px;
  border: 2px solid var(--brass);
  border-radius: var(--radius);
  background: var(--seal);
  padding: 14px 40px;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.2em;
  color: var(--cream);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  transition: transform 0.2s, background-color 0.2s;
}

.btn-start:hover { transform: scale(1.05); background: var(--seal-deep); }

.opening-tip {
  margin: 16px 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* ---------------- 主界面 ---------------- */
.app {
  min-height: 100vh;
  background: var(--wood-3);
  padding-bottom: 48px;
}

.topbar {
  border-bottom: 1px solid var(--border);
  background: rgba(43, 33, 24, 0.95);
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar-inner {
  display: flex;
  max-width: 1152px;
  margin: 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  display: flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  background: var(--seal);
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 900;
  color: var(--cream);
}

.brand-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 900;
  color: var(--cream);
}

.brand-sub {
  margin: 2px 0 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.container {
  max-width: 1152px;
  margin: 0 auto;
  padding: 0 16px;
}

.map-section { margin-top: 24px; }

/* ---------------- 中国省份 SVG 地图 ---------------- */
.map-wrap {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.map-canvas {
  width: 100%;
  height: 72vh;
  min-height: 520px;
  background: var(--wood);
  opacity: 0;
  transition: opacity 0.7s ease;
}

.map-canvas.is-ready { opacity: 1; }

.map-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 8px;
  box-shadow: inset 0 0 60px rgba(20, 12, 6, 0.55);
}

.map-reset {
  position: absolute;
  right: 12px;
  bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(43, 33, 24, 0.85);
  padding: 6px 12px;
  font-size: 12px;
  color: var(--paper);
  backdrop-filter: blur(4px);
  transition: background-color 0.2s, color 0.2s;
}

.map-reset:hover { background: var(--seal); color: var(--cream); }

/* 左侧站点目录（仅全国总览视图显示，放大后隐藏） */
.map-station-list {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 190px;
  pointer-events: none;
  transition: opacity 0.35s, visibility 0.35s;
}

.map-wrap.is-zoomed .map-station-list {
  opacity: 0;
  visibility: hidden;
}

.map-station-list-right {
  left: auto;
  right: 14px;
  display: none;
}

.map-station-list-right.is-visible { display: flex; }

.map-station-item {
  pointer-events: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(43, 33, 24, 0.85);
  padding: 8px 12px;
  text-align: left;
  color: var(--paper);
  backdrop-filter: blur(4px);
  transition: background-color 0.2s, color 0.2s;
}

.map-station-item b {
  display: block;
  overflow: hidden;
  font-family: var(--font-serif);
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--cream);
}

.map-station-item span {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--brass);
}

.map-station-item:hover { background: var(--seal); color: var(--cream); }

/* 站点按钮入场动画（逐个错峰滑入） */
.map-station-item {
  animation: stationIn 0.45s ease backwards;
  animation-delay: calc(var(--i, 0) * 45ms);
}

@keyframes stationIn {
  from { opacity: 0; transform: translateX(-16px); }
  to { opacity: 1; transform: none; }
}

/* 右侧影像轮播（默认视图显示，放大/分列模式隐藏） */
.map-photo-box {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 360px;
  pointer-events: none;
  transition: opacity 0.35s, visibility 0.35s;
}

.map-photo-box.is-hidden,
.map-wrap.is-zoomed .map-photo-box {
  opacity: 0;
  visibility: hidden;
}

.map-photo-frame {
  pointer-events: auto;
  display: block;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(43, 33, 24, 0.85);
  padding: 8px;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background-color 0.2s, transform 0.3s;
}

.map-photo-frame:hover { background: rgba(58, 44, 30, 0.95); transform: scale(1.03); }

.map-photo-frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 360 / 212;
  object-fit: cover;
  border-radius: 4px;
  opacity: 1;
  transition: opacity 0.26s ease;
}

.map-photo-frame img.is-fading { opacity: 0; }

.map-photo-caption {
  display: block;
  overflow: hidden;
  margin-top: 7px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--brass);
}

/* SVG 底图 */
.china-map {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

.china-map.is-panning { cursor: grabbing; }

.map-sea { fill: #d9cfb2; }

.map-provinces .pv {
  fill: #f3ead4;
  stroke: #9c8a68;
  stroke-width: 0.7;
  stroke-linejoin: round;
  transition: fill 0.2s;
}

.map-provinces .pv:hover { fill: #efe3c2; }

/* 南海诸岛附图 */
.map-inset-frame {
  fill: rgba(243, 234, 212, 0.55);
  stroke: #9c8a68;
  stroke-width: 1;
  stroke-dasharray: 4 3;
}

.map-inset-isle { fill: #a4906c; }

.map-nine-dash {
  fill: none;
  stroke: #7c5a2e;
  stroke-width: 1;
  opacity: 0.75;
  vector-effect: non-scaling-stroke;
}

.map-inset-label {
  font-family: var(--font-serif);
  font-size: 13px;
  fill: #7c5a2e;
}

/* 行军路线：红色实线，比省份分界线（0.7）粗 1px */
.route-line-full {
  fill: none;
  stroke: #d92d33;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 流动高亮：沿路线循环移动的亮色虚线 */
.route-line-flow {
  fill: none;
  stroke: #ff9d7a;
  stroke-width: 1.2;
  stroke-dasharray: 8 16;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: routeFlow 3s linear infinite;
  pointer-events: none;
}

@keyframes routeFlow {
  to { stroke-dashoffset: -240; }
}

.route-arrow { fill: #c0282e; opacity: 0.85; }

/* 地图站点节点（SVG） */
.lm-node {
  cursor: pointer;
  user-select: none;
}

.lm-node.lm-clickable { cursor: pointer; }

.lm-node-icon { filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.55)); }

.lm-node-icon svg { display: block; overflow: visible; }

/* 未完成站点的中性小圆点（替代原锁定图标） */
.lm-node-dot { fill: #9c8a68; stroke: #f6ecd4; stroke-width: 0.8; }

.lm-done .lm-node-dot,
.lm-current .lm-node-dot { display: none; }

.lm-current .lm-node-icon { animation: lmPulse 1.6s ease-in-out infinite; }

.lm-node-tag {
  font-family: var(--font-serif);
  font-size: 9.5px;
  font-weight: 700;
  fill: #f6ecd4;
  paint-order: stroke;
  stroke: rgba(43, 33, 24, 0.92);
  stroke-width: 2.2px;
  stroke-linejoin: round;
  cursor: pointer;
}

.lm-current .lm-node-tag { fill: #ffe9bd; }

@keyframes lmPulse {
  0%, 100% { filter: drop-shadow(0 0 1px rgba(200, 161, 90, 0.9)); }
  50% { filter: drop-shadow(0 0 7px rgba(200, 161, 90, 0.95)); }
}

/* ---------------- 弹窗通用 ---------------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  padding: 12px;
}

.modal {
  position: relative;
  display: flex;
  width: 100%;
  max-width: 768px;
  max-height: 92vh;
  flex-direction: column;
  overflow: hidden;
  border: 4px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.modal-wide { max-width: 896px; }

.modal-inner-line {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 2px;
  border: 1px solid rgba(58, 44, 30, 0.3);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 2px solid rgba(164, 38, 44, 0.5);
  background: rgba(255, 255, 255, 0.7);
  padding: 18px 20px 16px 28px;
  backdrop-filter: blur(4px);
}

.modal-head-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.modal-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 900;
  color: var(--ink);
}

.modal-head p {
  margin: 4px 0 0;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: #8a7355;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* 弹窗内容区是滚动容器：子项必须保持自然高度。
   否则带 overflow:hidden 的媒体框（如视频框）会被 flex-shrink 压扁到 0，
   视频虽然加载成功却因被裁剪而"看不见"。 */
.modal-body > * {
  flex-shrink: 0;
}

/* 纸纹之上的浅色衬底，保证正文可读性 */
.modal-body.sheet {
  background: rgba(255, 252, 243, 0.62);
}

.modal-body.sheet-solid {
  background: rgba(248, 240, 222, 0.94);
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 2px solid rgba(164, 38, 44, 0.5);
  background: rgba(255, 255, 255, 0.7);
  padding: 16px 28px;
  backdrop-filter: blur(4px);
}

.modal-foot span {
  font-size: 12px;
  font-weight: 500;
  color: var(--border);
}

.btn-close {
  border: 1px solid #8a7355;
  border-radius: 4px;
  background: transparent;
  padding: 4px 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--border);
  transition: background-color 0.2s, color 0.2s;
}

.btn-close:hover { background: var(--seal); color: var(--cream); }

/* 关卡内容块 */
.video-frame {
  position: relative;
  flex: none;
  overflow: hidden;
  border: 4px solid var(--wood-2);
  border-radius: 4px;
  background: #000;
}

.video-frame video,
.video-frame img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.video-tag {
  position: absolute;
  left: 8px;
  top: 8px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.6);
  padding: 2px 8px;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--brass);
}

.briefing p {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.9;
  text-align: justify;
  color: var(--ink);
}

.briefing p::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 4px;
  background: var(--seal);
  transform: rotate(45deg);
}

.briefing .source {
  margin: 8px 0 0;
  border-top: 1px dashed rgba(138, 115, 85, 0.3);
  padding-top: 8px;
  font-size: 11px;
  font-style: italic;
  text-align: right;
  color: #8a7355;
}

.knowledge-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.knowledge-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
}

.knowledge-list li::before {
  content: '';
  flex: none;
  width: 6px;
  height: 6px;
  margin-top: 8px;
  border-radius: 999px;
  background: var(--seal);
}

/* 精神坐标 */
.spirit-badge {
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(164, 38, 44, 0.5);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(164, 38, 44, 0.1), rgba(255, 255, 255, 0.7) 45%, rgba(200, 161, 90, 0.1));
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.spirit-badge::after {
  content: '';
  position: absolute;
  right: -12px;
  top: -12px;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: rgba(164, 38, 44, 0.1);
}

.spirit-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.spirit-icon {
  display: flex;
  flex: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  background: var(--seal);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.spirit-icon svg { width: 24px; height: 24px; fill: #f7ecd4; }

.spirit-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.spirit-title h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--seal-deep);
}

.spirit-essence {
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink);
}

/* 信物 */
.relic {
  border: 1px solid rgba(138, 111, 77, 0.5);
  border-radius: var(--radius);
  background: rgba(243, 231, 205, 0.8);
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.relic-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  border-bottom: 1px dashed rgba(138, 111, 77, 0.4);
  padding-bottom: 8px;
}

.relic-icon {
  display: flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  background: #8a6f4d;
  color: #f7ecd4;
}

.relic-head h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--border);
}

.relic-head h3 span { color: var(--seal); }

.relic-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.relic-img {
  position: relative;
  flex: none;
  overflow: hidden;
  border: 2px solid rgba(138, 111, 77, 0.6);
  border-radius: 3px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.relic-img img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.relic-img::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 28px rgba(43, 33, 24, 0.55);
  background: linear-gradient(180deg, rgba(43, 33, 24, 0.1), transparent 60%, rgba(43, 33, 24, 0.2));
}

.relic-story {
  flex: 1;
  margin: 0;
  font-size: 14px;
  line-height: 1.9;
  text-align: justify;
  color: var(--ink);
}

/* 抉择 */
.dilemma {
  overflow: hidden;
  border: 2px solid rgba(122, 139, 90, 0.6);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.dilemma-head {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 2px solid rgba(122, 139, 90, 0.4);
  background: rgba(122, 139, 90, 0.15);
  padding: 10px 16px;
}

.dilemma-head h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: #4a5a32;
}

.dilemma-head .chip {
  margin-left: auto;
  border-radius: 3px;
  background: rgba(122, 139, 90, 0.2);
  padding: 2px 8px;
  font-size: 11px;
  color: #4a5a32;
}

.dilemma-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }

.dilemma-scenario {
  margin: 0;
  border-radius: 4px;
  background: rgba(58, 44, 30, 0.05);
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink);
}

.dilemma-question {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.opt-list { display: grid; gap: 8px; }

.opt {
  display: block;
  width: 100%;
  border: 1px solid rgba(138, 115, 85, 0.6);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.85);
  padding: 10px 12px;
  text-align: left;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.opt:hover:not(:disabled) { border-color: var(--seal); background: #fff; }

.opt b {
  margin-right: 6px;
  font-family: var(--font-serif);
}

.opt.is-correct {
  border-color: var(--hill);
  background: rgba(122, 139, 90, 0.2);
  font-weight: 700;
  color: #3a4a2a;
}

.opt.is-wrong {
  border-color: var(--seal);
  background: rgba(164, 38, 44, 0.15);
  color: var(--seal-deep);
}

.opt.is-muted {
  border-color: rgba(138, 115, 85, 0.4);
  background: rgba(255, 255, 255, 0.5);
  color: #7a6a52;
}

.dilemma-answer {
  border-left: 4px solid var(--seal);
  border-radius: 4px;
  background: rgba(164, 38, 44, 0.08);
  padding: 10px 12px;
}

.dilemma-answer.brass { border-left-color: var(--brass); background: rgba(200, 161, 90, 0.1); }

.dilemma-answer b {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--seal);
}

.dilemma-answer.brass b { color: #8a6a2a; }

.dilemma-answer p {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink);
}

/* 随堂检验 */
.quiz {
  display: flex;
  flex-direction: column;
  gap: 24px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.quiz-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px dashed rgba(164, 38, 44, 0.4);
  padding-bottom: 8px;
}

.quiz-head h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--seal-deep);
}

.quiz-head span { font-size: 14px; font-weight: 500; color: #7a6a52; }

.quiz-item {
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.75);
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.quiz-q {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.7;
  color: var(--ink);
}

.quiz-q em {
  margin-right: 8px;
  font-style: normal;
  color: var(--seal);
}

.quiz-opts {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.quiz-opt {
  border: 1px solid rgba(138, 115, 85, 0.6);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.85);
  padding: 10px 12px;
  text-align: left;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.quiz-opt:hover:not(:disabled) { border-color: var(--seal); background: #fff; }

.quiz-opt b { margin-right: 6px; font-family: var(--font-serif); }

.quiz-opt.is-correct {
  border-color: var(--hill);
  background: rgba(122, 139, 90, 0.2);
  font-weight: 700;
  color: #3a4a2a;
}

.quiz-opt.is-muted {
  border-color: rgba(138, 115, 85, 0.4);
  background: rgba(255, 255, 255, 0.5);
  color: #7a6a52;
}

.quiz-opt.is-wrong {
  border-color: var(--seal);
  background: rgba(164, 38, 44, 0.15);
  color: var(--seal-deep);
}

.quiz-explain {
  margin: 12px 0 0;
  border-radius: 4px;
  background: rgba(122, 139, 90, 0.15);
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.7;
  color: #3a4a2a;
}

.quiz-explain.wrong { background: rgba(164, 38, 44, 0.1); color: var(--seal-deep); }

/* 会议模拟 / 兵棋 */
.sim {
  border: 1px solid rgba(138, 115, 85, 0.5);
  border-radius: 4px;
  background: var(--wood-3);
  padding: 4px;
}

.sim-head {
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
}

.sim-head h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--brass);
}

.sim-head p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }

.sim-scroll {
  max-height: 380px;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.narration {
  border-left: 4px solid var(--brass);
  border-radius: 4px;
  background: rgba(58, 44, 30, 0.7);
  padding: 12px 16px;
}

.narration p {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 14px;
  font-style: italic;
  line-height: 1.8;
  color: var(--brass);
}

.say { display: flex; gap: 12px; }

.avatar {
  display: flex;
  flex: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--brass);
  border-radius: 999px;
  background: var(--seal);
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--cream);
}

.say-meta {
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--muted);
}

.say-meta b {
  margin-right: 8px;
  font-family: var(--font-serif);
  font-size: 14px;
  color: var(--cream);
}

.bubble {
  border: 1px solid var(--border);
  border-radius: 4px 0 4px 4px;
  background: var(--paper);
  padding: 10px 16px;
}

.bubble p { margin: 0; font-size: 14px; line-height: 1.8; color: var(--ink); }

.choice-box {
  border: 1px solid rgba(164, 38, 44, 0.6);
  border-radius: 4px;
  background: var(--wood-2);
  padding: 16px;
}

.choice-prompt {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.7;
  color: var(--cream);
}

.choice-prompt .chip { margin-right: 8px; }

.choice-feedback {
  margin: 12px 0 0;
  border-radius: 4px;
  background: rgba(200, 161, 90, 0.15);
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--paper);
}

.sim-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding: 12px 16px;
}

.sim-foot span { font-size: 12px; color: var(--muted); }

.strategy {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.strategy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px dashed rgba(164, 38, 44, 0.4);
  padding-bottom: 8px;
}

.strategy-head h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--seal-deep);
}

.strategy-head span { font-size: 14px; color: #7a6a52; }

.strategy-situation {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.8;
  color: var(--ink);
}

.strategy-feedback {
  border-radius: 4px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.8;
}

.strategy-feedback.ok { background: rgba(122, 139, 90, 0.15); color: #3a4a2a; }
.strategy-feedback.bad { background: rgba(164, 38, 44, 0.1); color: var(--seal-deep); }

.locked-note {
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.7);
  padding: 12px 16px;
  text-align: center;
  font-size: 14px;
  color: var(--border);
}

/* 探究延伸 */
.inquiry {
  border: 1px dashed rgba(74, 107, 124, 0.5);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.75);
  padding: 16px;
}

.inquiry h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  color: #3a5a6c;
}

.inquiry p { margin: 0; font-size: 14px; line-height: 1.8; color: var(--ink); }

.inquiry .hint { margin-top: 6px; font-size: 11px; color: #8a7355; }

/* 通关印章 */
.stamp-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.stamp {
  border: 8px solid var(--seal);
  border-radius: 6px;
  padding: 16px 32px;
  opacity: 0;
}

.stamp span {
  font-family: var(--font-serif);
  font-size: 48px;
  font-weight: 900;
  letter-spacing: 0.3em;
  color: var(--seal);
}

/* ---------------- 智能答疑面板 ---------------- */
.chat {
  position: absolute;
  inset: 0 0 0 auto;
  z-index: 30;
  display: flex;
  width: 100%;
  max-width: 380px;
  flex-direction: column;
  border-left: 4px solid var(--seal-deep);
  background: #f7ecd4;
  box-shadow: -12px 0 32px rgba(30, 20, 10, 0.35);
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--wood);
  padding: 12px 16px;
}

.chat-head h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #e8c87a;
}

.chat-head p {
  margin: 2px 0 0;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: rgba(240, 230, 208, 0.6);
}

.chat-head-actions { display: flex; align-items: center; gap: 8px; }

.chat-icon-btn {
  display: flex;
  height: 28px;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(240, 230, 208, 0.4);
  border-radius: 4px;
  background: transparent;
  padding: 0 8px;
  font-size: 11px;
  color: rgba(240, 230, 208, 0.5);
  transition: color 0.2s, background-color 0.2s, border-color 0.2s;
}

.chat-icon-btn:hover { color: var(--cream); }

.chat-icon-btn.is-on {
  border-color: rgba(232, 200, 122, 0.7);
  background: rgba(232, 200, 122, 0.15);
  color: #e8c87a;
}

.chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg { display: flex; align-items: flex-start; gap: 8px; }

.msg-bot {
  display: flex;
  flex: none;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  background: var(--seal);
  font-size: 11px;
  font-weight: 700;
  color: #f7ecd4;
}

.msg-bubble {
  max-width: 85%;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.75);
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.75;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.msg-user { display: flex; justify-content: flex-end; }

.msg-user .msg-bubble {
  max-width: 85%;
  border: 0;
  background: var(--hill);
  color: #f7ecd4;
}

.chat-caret {
  display: inline-block;
  width: 6px;
  height: 14px;
  margin-left: 2px;
  vertical-align: middle;
  background: var(--seal);
  animation: typeCaret 1s steps(1) infinite;
}

.chat-wait { margin-left: 4px; font-size: 11px; color: #7a6a55; }

.msg-play {
  display: inline-flex;
  width: 20px;
  height: 20px;
  margin-left: 6px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: rgba(164, 38, 44, 0.7);
  vertical-align: middle;
}

.msg-play:hover { background: rgba(164, 38, 44, 0.1); color: var(--seal); }
.msg-play.is-playing { background: var(--seal); color: #f7ecd4; }

.chat-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 12px 8px;
}

.chat-quick button {
  border: 1px solid rgba(164, 38, 44, 0.5);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.6);
  padding: 4px 8px;
  font-size: 11px;
  color: var(--seal-deep);
  transition: background-color 0.2s, color 0.2s;
}

.chat-quick button:hover:not(:disabled) { background: var(--seal); color: #f7ecd4; }
.chat-quick button:disabled { opacity: 0.5; }

.chat-form {
  display: flex;
  align-items: center;
  gap: 8px;
  border-top: 2px dashed rgba(164, 38, 44, 0.3);
  background: #efe2c2;
  padding: 12px;
}

.chat-mic {
  position: relative;
  display: flex;
  flex: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(138, 111, 77, 0.5);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--seal);
  transition: background-color 0.2s, color 0.2s;
}

.chat-mic:hover:not(:disabled) { border-color: var(--seal); }
.chat-mic.is-recording { border-color: var(--seal-deep); background: var(--seal); color: #f7ecd4; }
.chat-mic:disabled { opacity: 0.5; }

.chat-input {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(138, 111, 77, 0.5);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.85);
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
}

.chat-input:focus { border-color: var(--seal); }
.chat-input[readonly] { background: #f3e9ce; color: var(--seal-deep); }

.chat-send {
  flex: none;
  border: 0;
  border-radius: 3px;
  background: var(--seal);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  color: #f7ecd4;
  transition: background-color 0.2s;
}

.chat-send:hover:not(:disabled) { background: var(--seal-deep); }
.chat-send:disabled { opacity: 0.5; }

.chat-notice {
  margin: 0 12px 8px;
  border: 1px solid rgba(200, 161, 90, 0.6);
  border-radius: 4px;
  background: rgba(200, 161, 90, 0.12);
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.7;
  color: #7c5a2e;
}

.chat-notice button {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 11px;
  font-weight: 700;
  color: var(--seal);
  text-decoration: underline;
}

/* ---------------- API 设置面板 ---------------- */
.settings-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 高级设置折叠区 */
.adv-fold {
  border: 1px dashed rgba(138, 111, 77, 0.45);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.35);
  padding: 8px 14px 12px;
}

.adv-fold > summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: var(--seal-deep);
  outline: none;
}

.adv-fold > summary::marker { content: ''; }
.adv-fold > summary::before { content: '＋ '; }
.adv-fold[open] > summary::before { content: '－ '; }

.adv-fold .settings-grid {
  margin-top: 14px;
  gap: 12px;
}

/* 设置面板里的次级操作 */
.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 11px;
}

/* ---------------- 独立"长征电台"窗口 ---------------- */
.modal-narrow { max-width: 420px; }

.chat-host {
  position: relative;
  display: flex;
  height: min(68vh, 520px);
  min-height: 320px;
}

.chat-host > .chat {
  position: relative;
  inset: auto;
  width: 100%;
  max-width: none;
  border-left: none;
  box-shadow: none;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.field .hint {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.7;
  color: #8a7355;
}

.field input,
.field select {
  width: 100%;
  border: 1px solid rgba(138, 111, 77, 0.6);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.9);
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
}

.field input:focus,
.field select:focus { border-color: var(--seal); }

.field input.is-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.6;
}

.status-line.ok { background: rgba(122, 139, 90, 0.15); color: #3a4a2a; }
.status-line.bad { background: rgba(164, 38, 44, 0.1); color: var(--seal-deep); }
.status-line.info { background: rgba(74, 107, 124, 0.1); color: #3a5a6c; }

/* ---------------- 宏观总览 ---------------- */
.overview-chart {
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.75);
  padding: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.overview-chart svg { display: block; width: 100%; height: auto; }

.spirit-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.spirit-card {
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.spirit-card h4 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 900;
}

.spirit-card p {
  margin: 4px 0 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--border);
}

.timeline {
  position: relative;
  margin-left: 8px;
  border-left: 2px dashed rgba(164, 38, 44, 0.4);
  padding-left: 20px;
}

.timeline-item { position: relative; padding-bottom: 20px; }
.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -27px;
  top: 4px;
  width: 12px;
  height: 12px;
  border: 2px solid #f7ecd4;
  border-radius: 999px;
}

.timeline-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.timeline-title b {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 900;
  color: var(--ink);
}

.timeline-item p { margin: 2px 0 0; font-size: 12px; color: #8a7355; }

/* ---------------- 结业证书 ---------------- */
.certificate {
  border: 4px solid var(--border);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 32px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  max-height: 90vh;
  overflow-y: auto;
  width: 100%;
  max-width: 640px;
}

.certificate-kicker {
  margin: 0;
  text-align: center;
  font-family: var(--font-serif);
  font-size: 14px;
  letter-spacing: 0.4em;
  color: var(--seal-deep);
}

.certificate h2 {
  margin: 12px 0 0;
  text-align: center;
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 900;
  color: var(--wood-2);
}

.cert-section { margin-top: 24px; }

.cert-section h3 {
  margin: 0 0 4px;
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--seal-deep);
}

.cert-section > p { margin: 0; font-size: 12px; color: #6b5842; }

.cert-grid {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.cert-chip {
  border: 1px solid rgba(164, 38, 44, 0.25);
  border-radius: 4px;
  background: rgba(164, 38, 44, 0.05);
  padding: 8px 10px;
}

.cert-chip p { margin: 0; font-size: 11px; color: #6b5842; }
.cert-chip b { display: block; margin-top: 2px; font-family: var(--font-serif); font-size: 12px; color: var(--seal-deep); }

.cert-quote {
  margin-top: 8px;
  border-left: 4px solid var(--seal);
  border-radius: 4px;
  background: rgba(164, 38, 44, 0.05);
  padding: 16px;
}

.cert-quote p { margin: 0; font-size: 14px; line-height: 1.9; color: var(--ink); }

.cert-quote textarea {
  width: 100%;
  margin-top: 12px;
  border: 1px solid rgba(164, 38, 44, 0.3);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.6);
  padding: 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  resize: vertical;
}

.cert-quote textarea:focus { border-color: var(--seal); outline: none; }

.cert-manifest {
  margin-top: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(58, 44, 30, 0.7);
  padding: 16px;
}

.cert-manifest h3 {
  margin: 0 0 12px;
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--brass);
}

.cert-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  text-align: center;
}

.cert-stats b {
  display: block;
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 900;
  color: var(--cream);
}

.cert-stats span { font-size: 11px; color: var(--muted); }

.cert-final {
  margin-top: 24px;
  border: 2px dashed rgba(164, 38, 44, 0.6);
  border-radius: var(--radius);
  background: rgba(164, 38, 44, 0.05);
  padding: 20px;
}

.cert-final p { margin: 0; font-size: 14px; line-height: 2; color: var(--ink); }

.cert-seal {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.cert-seal span {
  border: 4px solid var(--seal);
  border-radius: var(--radius);
  padding: 8px 20px;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.25em;
  color: var(--seal);
}

/* ---------------- 教师课件（SlideDeck） ---------------- */
.deck {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  background: #171008;
}

.deck-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(200, 161, 90, 0.2);
  background: #241a10;
  padding: 10px 16px;
}

.deck-top-left { display: flex; align-items: center; gap: 12px; }

.deck-top-right { display: flex; align-items: center; gap: 8px; }

.deck-title {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  color: var(--paper);
}

.deck-stage {
  position: relative;
  flex: 1;
  overflow: hidden;
  padding: 12px;
}

.deck-stage::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, 0.55) 100%);
}

.deck-paper-frame {
  position: relative;
  display: flex;
  height: 100%;
  max-width: 1152px;
  margin: 0 auto;
  flex-direction: column;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.65);
}

.deck-frame-outer {
  position: absolute;
  inset: 12px;
  border: 2px solid rgba(164, 38, 44, 0.4);
  pointer-events: none;
}

.deck-frame-inner {
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(138, 111, 77, 0.4);
  pointer-events: none;
}

.deck-corner {
  position: absolute;
  width: 40px;
  height: 40px;
  color: rgba(164, 38, 44, 0.6);
  pointer-events: none;
}

.deck-corner.tl { left: 16px; top: 16px; }
.deck-corner.tr { right: 16px; top: 16px; transform: scaleX(-1); }
.deck-corner.bl { left: 16px; bottom: 16px; transform: scaleY(-1); }
.deck-corner.br { right: 16px; bottom: 16px; transform: scale(-1); }

.deck-ribbon {
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  background: linear-gradient(90deg, var(--seal-deep), var(--seal), var(--seal-deep));
}

.deck-watermark {
  position: absolute;
  right: -24px;
  bottom: -64px;
  pointer-events: none;
  user-select: none;
  font-family: var(--font-serif);
  font-size: 22rem;
  font-weight: 900;
  line-height: 1;
  color: rgba(58, 44, 30, 0.05);
}

.deck-cover {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
}

.deck-cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.deck-cover-shade {
  position: absolute;
  inset: 0;
  background: rgba(36, 26, 16, 0.55);
}

.deck-cover-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(20, 14, 8, 0.1) 25%, rgba(20, 14, 8, 0.88) 100%);
}

.deck-cover-line-a {
  position: absolute;
  inset: 24px;
  z-index: 10;
  border: 1px solid rgba(240, 230, 208, 0.25);
  pointer-events: none;
}

.deck-cover-line-b {
  position: absolute;
  inset: 26px;
  z-index: 10;
  border: 1px solid rgba(200, 161, 90, 0.4);
  pointer-events: none;
}

.deck-cover-inner {
  position: relative;
  z-index: 20;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
}

.deck-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 448px;
  margin-bottom: 32px;
}

.deck-badge i { flex: 1; height: 1px; background: rgba(200, 161, 90, 0.6); }
.deck-badge span { font-size: 12px; font-weight: 700; letter-spacing: 0.5em; color: #e8c877; }

.deck-stamp {
  margin-bottom: 32px;
  border: 4px solid var(--seal);
  background: var(--cream);
  padding: 6px;
  transform: rotate(3deg);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
}

.deck-stamp div {
  display: flex;
  width: 72px;
  height: 72px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(164, 38, 44, 0.8);
}

.deck-stamp small { font-family: var(--font-serif); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; color: var(--seal); }
.deck-stamp b { font-family: var(--font-serif); font-size: 24px; font-weight: 900; line-height: 1; color: var(--seal); }

.deck-cover h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 56px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #f7ecd4;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.8);
}

.deck-cover h2 {
  margin: 24px 0 0;
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #f0b8a8;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.deck-cover-rule {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 384px;
  margin-top: 40px;
}

.deck-cover-rule i { flex: 1; height: 1px; background: rgba(232, 213, 176, 0.5); }
.deck-cover-rule em { width: 8px; height: 8px; background: #d9534f; transform: rotate(45deg); }
.deck-cover-rule p { margin: 20px 0 0; font-size: 14px; font-weight: 700; letter-spacing: 0.35em; color: rgba(232, 213, 176, 0.85); }

.deck-content {
  position: relative;
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  padding: 32px 48px;
}

.deck-content.dense { padding: 20px 48px; }

.deck-head {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.deck-content.dense .deck-head { margin-bottom: 14px; }

.deck-head-left { display: flex; align-items: center; gap: 16px; }

.deck-index {
  display: flex;
  flex: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  background: var(--seal);
  font-family: var(--font-serif);
  font-weight: 900;
  color: var(--cream);
  box-shadow: 2px 2px 0 rgba(60, 35, 20, 0.35);
}

.deck-content.dense .deck-index { width: 36px; height: 36px; font-size: 16px; }

.deck-head h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 40px;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--seal-deep);
}

.deck-content.dense .deck-head h2 { font-size: 30px; }

.deck-tag {
  flex: none;
  border: 1px solid rgba(138, 111, 77, 0.6);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #7c5a2e;
}

.deck-rules { margin-bottom: 28px; display: flex; flex-direction: column; gap: 3px; }
.deck-content.dense .deck-rules { margin-bottom: 16px; }
.deck-rules i { display: block; height: 3px; background: var(--seal); }
.deck-rules i:last-child { height: 1px; background: rgba(138, 111, 77, 0.6); }

.deck-body { display: flex; min-height: 0; flex: 1; gap: 24px; }

.deck-text {
  min-width: 0;
  flex: 1;
  overflow-y: auto;
  padding-right: 8px;
}

.deck-points { display: flex; height: 100%; flex-direction: column; gap: 20px; justify-content: center; }
.deck-content.dense .deck-points { gap: 10px; justify-content: flex-start; }

.deck-point {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  border-left: 4px solid var(--seal);
  background: #faf1da;
  padding: 16px 24px 16px 20px;
  box-shadow: 3px 3px 0 rgba(90, 70, 40, 0.15);
}

.deck-content.dense .deck-point { padding: 10px 24px 10px 20px; gap: 12px; }

.deck-point > span {
  display: flex;
  flex: none;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(124, 90, 46, 0.7);
  background: rgba(200, 161, 90, 0.25);
  font-family: var(--font-serif);
  font-weight: 900;
  color: #7c5a2e;
}

.deck-content.dense .deck-point > span { width: 26px; height: 26px; font-size: 12px; }

.deck-point p {
  margin: 0;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.85;
  text-align: justify;
  color: #33261a;
}

.deck-content.dense .deck-point p { font-size: 15px; line-height: 1.65; }

.deck-numbers {
  display: grid;
  height: 100%;
  align-content: center;
  gap: 20px;
  grid-template-columns: repeat(3, 1fr);
}

.deck-num-card {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  border: 2px solid rgba(164, 38, 44, 0.45);
  background: #faf1da;
  padding: 28px 12px;
  text-align: center;
  box-shadow: 4px 4px 0 rgba(90, 70, 40, 0.18);
}

.deck-num-card::before {
  content: '';
  position: absolute;
  top: -7px;
  width: 14px;
  height: 14px;
  border: 2px solid #7c5a2e;
  border-radius: 999px;
  background: var(--brass);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.deck-num-card b {
  font-family: var(--font-serif);
  font-size: 48px;
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--seal);
}

.deck-num-card b.long { font-size: 32px; }
.deck-num-card b.mid { font-size: 40px; }

.deck-num-card i { display: block; width: 64px; margin: 12px 0; height: 1px; background: rgba(138, 111, 77, 0.6); }
.deck-num-card span { font-size: 16px; font-weight: 700; line-height: 1.5; color: #33261a; }

.deck-discuss { display: flex; height: 100%; flex-direction: column; gap: 20px; justify-content: center; }
.deck-content.dense .deck-discuss { gap: 16px; }

.deck-discuss-item {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  border: 1px solid rgba(138, 111, 77, 0.5);
  background: #faf1da;
  padding: 20px;
  box-shadow: 4px 4px 0 rgba(90, 70, 40, 0.15);
}

.deck-content.dense .deck-discuss-item { padding: 16px; gap: 16px; }

.deck-discuss-item > span {
  display: flex;
  flex: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--seal);
  border-radius: 999px;
  background: rgba(164, 38, 44, 0.1);
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 900;
  color: var(--seal);
}

.deck-discuss-item small {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: #7c5a2e;
}

.deck-discuss-item p {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.7;
  color: #33261a;
}

.deck-content.dense .deck-discuss-item p { font-size: 16px; }

.deck-summary { display: flex; height: 100%; flex-direction: column; gap: 20px; justify-content: center; }
.deck-content.dense .deck-summary { gap: 16px; }

.deck-summary-item {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  border-left: 4px solid #5f7040;
  background: #f3eed3;
  padding: 20px 24px 20px 20px;
  box-shadow: 4px 4px 0 rgba(90, 70, 40, 0.15);
}

.deck-content.dense .deck-summary-item { padding: 12px 24px 12px 20px; gap: 16px; }

.deck-summary-item > span {
  display: flex;
  flex: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 3px solid #5f7040;
  border-radius: 999px;
  background: rgba(95, 112, 64, 0.12);
  font-weight: 900;
  color: #4a5c28;
}

.deck-summary-item small {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: #5f7040;
}

.deck-summary-item p {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.8;
  color: #33261a;
}

.deck-content.dense .deck-summary-item p { font-size: 15px; line-height: 1.7; }

.deck-figure {
  display: none;
  width: 36%;
  flex: none;
  flex-direction: column;
  justify-content: center;
}

@media (min-width: 640px) {
  .deck-figure { display: flex; }
}

.deck-figure.is-left { order: -1; }

.deck-figure-frame {
  flex: none;
  border: 6px solid var(--wood-2);
  background: #efe0bd;
  padding: 8px;
  box-shadow: 6px 8px 24px rgba(30, 20, 10, 0.4);
}

.deck-figure-frame.is-left { transform: rotate(-1deg); }
.deck-figure-frame.is-right { transform: rotate(1deg); }

.deck-figure-frame img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.deck-figure figcaption {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 0 2px;
}

.deck-figure figcaption i { width: 24px; height: 1px; background: rgba(138, 111, 77, 0.5); }
.deck-figure figcaption span { font-size: 10px; font-weight: 700; letter-spacing: 0.25em; color: #7c5a2e; }

.deck-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  border-top: 1px solid rgba(138, 111, 77, 0.4);
  padding-top: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.25em;
  color: #8a6f4d;
}

.deck-nav {
  position: absolute;
  top: 50%;
  z-index: 10;
  display: flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(200, 161, 90, 0.4);
  border-radius: 999px;
  background: rgba(36, 26, 16, 0.9);
  font-size: 20px;
  font-weight: 900;
  color: #e8c877;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  transform: translateY(-50%);
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.deck-nav:hover { border-color: var(--brass); background: var(--seal); color: var(--cream); }
.deck-nav:disabled { opacity: 0.25; }
.deck-nav.prev { left: 16px; }
.deck-nav.next { right: 16px; }

.deck-note {
  border-top: 2px dashed rgba(200, 161, 90, 0.4);
  background: #241a10;
  padding: 12px 16px;
}

.deck-note p {
  display: flex;
  max-width: 1024px;
  margin: 0 auto;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--paper);
}

.deck-note b {
  flex: none;
  border-radius: 3px;
  background: rgba(200, 161, 90, 0.25);
  padding: 2px 6px;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: #e8c877;
}

.deck-pages {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #171008;
  padding: 10px;
}

.deck-pages button {
  height: 6px;
  width: 6px;
  border: 0;
  border-radius: 999px;
  background: rgba(138, 111, 77, 0.5);
  transition: width 0.2s, background-color 0.2s;
}

.deck-pages button.is-active { width: 28px; background: var(--brass); }
.deck-pages button:hover { background: rgba(200, 161, 90, 0.6); }
.deck-pages span { margin-left: 12px; font-family: var(--font-serif); font-size: 12px; font-weight: 700; color: #a08a68; }

/* ---------------- 四渡赤水动态沙盘 ---------------- */
.sandbox {
  position: fixed;
  inset: 0;
  z-index: 75;
  display: flex;
  flex-direction: column;
  background: #171008;
}

.sandbox-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 2px solid rgba(164, 38, 44, 0.6);
  background: var(--wood-3);
  padding: 12px 16px;
}

.sandbox-top h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: var(--cream);
}

.sandbox-top p {
  margin: 2px 0 0;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--brass);
}

.sandbox-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding: 12px;
}

@media (min-width: 1024px) {
  .sandbox-main { flex-direction: row; overflow: hidden; }
}

.sandbox-map {
  position: relative;
  flex: 1;
  min-height: 320px;
  overflow: hidden;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding-bottom: 122px;
}

@media (max-width: 1023px) {
  .sandbox-map {
    min-height: 360px;
    padding-bottom: 104px;
  }

  .sandbox-subtitle-text {
    min-height: 48px;
  }
}

.sandbox-map svg { display: block; width: 100%; height: 100%; }

.sandbox-subtitle {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  padding: 12px 16px 16px;
  pointer-events: none;
}

.sandbox-subtitle-box {
  max-width: 820px;
  margin: 0 auto;
  border: 1px solid rgba(200, 161, 90, 0.5);
  border-radius: 3px;
  background: rgba(43, 33, 24, 0.9);
  padding: 8px 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
}

.sandbox-subtitle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.sandbox-subtitle-label i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--seal);
}

.sandbox-subtitle-label span {
  font-family: var(--font-serif);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--brass);
}

.sandbox-subtitle-text { min-height: 64px; }

.sandbox-subtitle-text p {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--cream);
}

.sandbox-side {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 1024px) {
  .sandbox-side { width: 340px; flex: none; }
}

.sandbox-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.sandbox-card h3 {
  margin: 0 0 8px;
  padding-bottom: 8px;
  border-bottom: 2px dashed rgba(164, 38, 44, 0.4);
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 900;
  color: var(--seal-deep);
}

.sandbox-dl { margin: 0; display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 1.7; }

.sandbox-dl > div { display: flex; gap: 8px; }

.sandbox-dl dt {
  flex: none;
  width: 76px;
  font-family: var(--font-serif);
  font-weight: 700;
  color: #8a6f4d;
}

.sandbox-dl dd { margin: 0; flex: 1; color: var(--ink); }
.sandbox-dl dd.enemy { color: #3a5a6c; }
.sandbox-dl dd.seal { color: var(--seal-deep); }

.sandbox-phases {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.sandbox-phases button {
  border: 1px solid rgba(138, 111, 77, 0.6);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.7);
  padding: 8px 4px;
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--border);
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.sandbox-phases button:hover { border-color: var(--seal); color: var(--seal); }
.sandbox-phases button.is-active { border-color: var(--seal); background: var(--seal); color: #f7ecd4; }

.sandbox-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.sandbox-progress {
  margin-top: 12px;
  height: 6px;
  width: 100%;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(138, 111, 77, 0.3);
}

.sandbox-progress > i {
  display: block;
  height: 100%;
  background: var(--seal);
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 640px) {
  .opening-title { font-size: 40px; }
  .opening-sub { font-size: 16px; letter-spacing: 0.22em; }
  .modal-head, .modal-body, .modal-foot { padding-left: 16px; padding-right: 16px; }
  .modal-head h2 { font-size: 22px; }
  .certificate { padding: 20px; }
  .deck-content { padding: 20px 24px; }
  .deck-cover h1 { font-size: 36px; }
  .deck-head h2 { font-size: 26px; }
  .deck-numbers { grid-template-columns: 1fr; }
  .deck-figure { display: none; }
  .topbar-right { width: 100%; justify-content: space-between; }
}

/* =========================================================
   16:9 横向大屏适配（1920×1080 / 3840×2160 自动全屏放映）
   ------------------------------------------------------------
   · 首屏：顶栏 + 三维地图占满整个视口高度
   · 站点清单等后续内容自然向下滚动
   · 大屏下整体放大栅格与字号，兼顾 4K 直出
   ========================================================= */
@media screen and (min-aspect-ratio: 16 / 10) {
  /* 1080/2160 横屏：整页锁定在视口内，不出上下滚动条 */
  html,
  body {
    overflow: hidden;
    height: 100%;
  }

  .app {
    height: 100vh;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
  }

  /* .container 带 margin:auto，作为 flex 子项会收缩到内容宽，必须显式拉满 */
  .app > .container {
    width: 100%;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .app .map-section {
    margin-top: 16px;
    flex: 1;
    min-height: 0;
    display: flex;
  }

  .app .map-section > .map-wrap {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex; /* canvas 的 flex:1 依赖此处，block 容器会让高度塌缩为 0 */
    flex-direction: column;
  }

  .map-wrap .map-canvas {
    flex: 1;
    height: auto;
    min-height: 0;
  }
}

@media screen and (min-width: 1600px) {
  /* 宽屏拉大容器，让地图吃满横向空间 */
  .container {
    max-width: min(94vw, 1800px);
  }
}

@media screen and (min-width: 2400px) {
  /* 4K 直出（3840×2160 无系统缩放）：地图矢量自动放大，覆盖层 UI 按 2 倍缩放 */
  html {
    font-size: 21px;
  }
  .container {
    max-width: min(94vw, 3560px);
  }
  .topbar-inner {
    max-width: min(94vw, 3560px);
    padding: 22px 32px;
    gap: 24px;
  }
  .brand-logo {
    width: 72px;
    height: 72px;
  }
  .topbar .btn {
    font-size: 22px;
    padding: 12px 26px;
  }
  .map-station-list {
    left: 28px;
    width: 380px;
    gap: 10px;
  }
  .map-station-list-right { right: 28px; }
  .map-station-item {
    padding: 16px 22px;
    border-radius: 10px;
  }
  .map-station-item b { font-size: 25px; }
  .map-station-item span {
    margin-top: 4px;
    font-size: 21px;
  }
  .map-photo-box {
    right: 28px;
    width: 720px;
  }
  .map-photo-frame {
    padding: 16px;
    border-radius: 10px;
  }
  .map-photo-frame img {
    border-radius: 8px;
  }
  .map-photo-caption {
    margin-top: 12px;
    font-size: 26px;
  }
  .map-reset {
    font-size: 22px;
    padding: 12px 22px;
  }
}


