:root {
  --panel-bg: rgba(255, 255, 255, 0.78);
  --panel-border: rgba(56, 189, 248, 0.22);
  --panel-edge: rgba(148, 163, 184, 0.38);
  --accent: #0ea5e9;
  --accent-deep: #0284c7;
  --accent-soft: rgba(14, 165, 233, 0.14);
  --accent-glow: rgba(14, 165, 233, 0.38);
  --text: #0f172a;
  --muted: #64748b;
  --ok: #059669;
  --bad: #e11d48;
  --map-bg: #e8f2fa;
  --radius-sm: 8px;
  --radius-md: 12px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 30px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.16);
  --sidebar-width: min(300px, 20vw);
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background: linear-gradient(155deg, #cfe8f8 0%, #dce7f0 38%, #e8edf4 72%, #eef2f7 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
.app {
  display: flex;
  height: 100%;
  min-height: 560px;
}
/* 左侧控制面板列（含贴右侧外侧的折叠钮，参考经纬网/等高线地形图） */
.panel-column {
  position: relative;
  width: var(--sidebar-width);
  min-width: 212px;
  flex-shrink: 0;
  min-height: 0;
  overflow: visible;
  z-index: 10;
}

.app.panel-collapsed .panel-column {
  width: 0;
  min-width: 0;
}

.panel {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  background: linear-gradient(188deg, #f0f9ff 0%, #e2f3fc 46%, #d4ebf8 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-right: 1px solid rgba(14, 165, 233, 0.28);
  box-shadow:
    6px 0 32px rgba(14, 165, 233, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: auto;
}

.app.panel-collapsed .panel {
  border-right-color: transparent;
  opacity: 0;
  pointer-events: none;
}

.panel-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, transparent, var(--accent) 25%, #38bdf8 50%, var(--accent) 75%, transparent);
  box-shadow: 0 0 12px var(--accent-glow);
  z-index: 2;
  pointer-events: none;
}

.app.panel-collapsed .panel-accent {
  opacity: 0.35;
}

.panel-body {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 12px 12px 14px;
  gap: 8px;
  overflow: auto;
}

.app.panel-collapsed .panel-body {
  display: none;
}

.panel-toggle-btn {
  position: absolute;
  left: 100%;
  top: 50%;
  z-index: 20;
  transform: translateY(-50%);
  box-sizing: border-box;
  width: 28px;
  height: 52px;
  padding: 0;
  margin: 0;
  font-size: 13px;
  line-height: 1;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  border: 1px solid rgba(14, 165, 233, 0.45);
  border-left: none;
  background: rgba(255, 255, 255, 0.95);
  color: var(--accent-deep);
  cursor: pointer;
  font-family: inherit;
  box-shadow: 4px 0 16px rgba(14, 165, 233, 0.12);
  transition: background 0.2s, box-shadow 0.2s, border-color 0.2s, color 0.2s;
}

.panel-toggle-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: 4px 0 20px rgba(14, 165, 233, 0.2);
}

.panel-toggle-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.panel h1 {
  font-size: 1.22rem;
  margin: 0 0 6px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-align: center;
  color: #0369a1;
  text-shadow: 0 0 20px rgba(56, 189, 248, 0.45);
}
.panel .sub {
  font-size: 0.74rem;
  color: #4a6d85;
  margin-bottom: 2px;
  line-height: 1.5;
  letter-spacing: 0.02em;
}
section.block {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.32);
  border-radius: var(--radius-md);
  padding: 10px 11px 11px;
  box-shadow:
    0 1px 2px rgba(14, 165, 233, 0.06),
    0 4px 16px rgba(14, 165, 233, 0.08);
}
section.block h2 {
  margin: 0 0 7px;
  font-size: 0.74rem;
  color: #0c4a6e;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.row { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
label.lbl { font-size: 0.76rem; color: var(--muted); }
input[type="text"], select {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input[type="text"]:focus-visible,
select:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
button.btn {
  cursor: pointer;
  border: 1px solid rgba(14, 165, 233, 0.42);
  background: rgba(255, 255, 255, 0.95);
  color: var(--accent-deep);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease,
    box-shadow 0.15s ease, transform 0.12s ease;
  box-shadow: var(--shadow-sm);
}
button.btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.18);
}
button.btn:active {
  transform: translateY(1px);
}
button.btn.primary {
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 16px var(--accent-glow);
}
button.btn.primary:hover {
  filter: brightness(1.06);
  box-shadow: 0 6px 22px var(--accent-glow);
}
button.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.panel .mode-btns {
  gap: 5px;
}
.panel button.btn {
  padding: 5px 8px;
  font-size: 0.76rem;
}
/* 模式按钮：仅用 .active 表示当前模式，避免与 .primary 叠加出现多个「实心」按钮 */
.mode-btns .btn {
  flex: 1 1 auto;
  min-width: 0;
}
.mode-btns .btn.active {
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 18px var(--accent-glow);
}
/* 省份档案弹窗（学习模式 · 地图点击） */
.archive-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.archive-modal.open {
  display: flex;
}
.archive-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 15, 30, 0.58);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  cursor: pointer;
}
.archive-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(920px, 96vw);
  max-height: min(90vh, 880px);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.archive-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.28);
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.12) 0%, rgba(56, 189, 248, 0.05) 55%, transparent 100%);
}
.archive-modal-header h2 {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #0c4a6e;
}
button.archive-close {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  padding: 4px 10px;
  cursor: pointer;
  color: var(--muted);
  border-radius: 6px;
}
button.archive-close:hover {
  background: rgba(14, 165, 233, 0.12);
  color: var(--accent-deep);
}
.archive-modal-body {
  overflow: auto;
  padding: 18px 20px 22px;
  font-size: 0.88rem;
  line-height: 1.6;
}
.archive-section {
  margin-bottom: 22px;
}
.archive-section h3 {
  margin: 0 0 12px;
  font-size: 0.9rem;
  font-weight: 800;
  color: #0f172a;
  border-left: 3px solid var(--accent);
  padding-left: 11px;
  letter-spacing: 0.04em;
}
.archive-video-shell {
  position: relative;
  width: 100%;
  max-width: min(820px, 100%);
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  background: #020617;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.2), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}
.archive-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.archive-map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.archive-map-grid figure {
  margin: 0;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
  box-shadow: var(--shadow-sm);
}
.archive-map-grid figcaption {
  padding: 6px 8px;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}
.archive-map-grid img {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: middle;
  cursor: zoom-in;
}
/* 省份档案内：地图大图预览（触摸捏合 / 滚轮 / 拖动） */
.map-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: none;
  align-items: stretch;
  justify-content: center;
  padding: 0;
  background: rgba(15, 23, 42, 0.75);
}
.map-preview-overlay.open {
  display: flex;
  flex-direction: column;
}
.map-preview-backdrop {
  position: absolute;
  inset: 0;
  cursor: pointer;
}
.map-preview-panel {
  position: relative;
  z-index: 1;
  margin: auto;
  width: min(96vw, 1200px);
  height: min(92vh, 900px);
  background: #0f172a;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}
.map-preview-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: #1e293b;
  color: #e2e8f0;
  flex-shrink: 0;
}
.map-preview-caption {
  font-size: 0.9rem;
  font-weight: 600;
}
.map-preview-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}
.map-preview-tool {
  min-width: 36px;
  padding: 4px 10px;
  font-size: 1rem;
  border-color: #64748b;
  color: #e2e8f0;
  background: #334155;
}
.map-preview-tool:hover {
  background: #475569;
}
.map-preview-stage {
  flex: 1;
  position: relative;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}
.map-preview-stage.panning {
  cursor: grabbing;
}
.map-preview-inner {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
  transform-origin: 0 0;
}
.map-preview-inner img {
  display: block;
  max-width: none;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}
.map-preview-hint {
  margin: 0;
  padding: 6px 12px 10px;
  font-size: 0.75rem;
  color: #94a3b8;
  text-align: center;
  background: #1e293b;
  flex-shrink: 0;
}
/* 文字简介与数据：每项「标题：内容」同行（可自动换行）+ 横线分隔 */
.archive-text-list {
  margin: 0;
}
.archive-text-row {
  padding: 11px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  font-size: 0.88rem;
  line-height: 1.55;
  word-break: break-word;
}
.archive-text-row:last-child {
  border-bottom: none;
}
.archive-text-k {
  margin: 0;
  display: inline;
  font-weight: 600;
  color: var(--muted);
}
.archive-text-v {
  margin: 0;
  display: inline;
  color: var(--text);
}
.archive-empty {
  color: var(--muted);
  margin: 0;
}
.info-card {
  font-size: 0.88rem;
  line-height: 1.55;
}
.info-card strong { color: var(--accent); }
.detail-card-hint {
  margin: 0;
  color: #475569;
  font-size: 0.88rem;
  line-height: 1.6;
}
.detail-card-hint--idle {
  color: #64748b;
  font-size: 0.85rem;
}
.stats {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.55;
  letter-spacing: 0.02em;
}
.stats span.val { color: var(--text); font-weight: 600; }
.error-msg {
  color: var(--bad);
  font-size: 0.78rem;
  display: none;
}
.error-msg.show { display: block; }
::selection {
  background: rgba(14, 165, 233, 0.28);
  color: var(--text);
}
/* 右侧约 75% */
.map-wrap {
  flex: 1;
  position: relative;
  z-index: 1;
  background: linear-gradient(165deg, var(--map-bg) 0%, #e8f2f8 45%, #dceaf5 100%);
  display: flex;
  flex-direction: column;
  min-width: 0;
  box-shadow: inset 0 0 80px rgba(14, 165, 233, 0.06);
}
/* 学习模式：地图版图外围背景更浅，衬托中国区域 */
.map-wrap.map-wrap--learn {
  background: linear-gradient(165deg, #fdfefe 0%, #f8fbfc 42%, #f3f8fa 100%);
  box-shadow: inset 0 0 120px rgba(14, 165, 233, 0.022);
}
.map-toolbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.28);
  font-size: 0.8rem;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
}
/* 测试模式整块答题区盖住地图时隐藏顶栏（含全屏） */
#map-toolbar[hidden] {
  display: none !important;
}
.map-toolbar label { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.map-toolbar-start {
  grid-column: 1;
  justify-self: start;
  display: flex;
  align-items: center;
}
.map-toolbar .puzzle-session-timer {
  grid-column: 2;
  justify-self: center;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 800;
  color: #0c4a6e;
  letter-spacing: 0.04em;
  min-width: 10.5em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.map-toolbar .puzzle-session-timer[hidden] {
  display: none !important;
}
.map-toolbar .puzzle-high-tools {
  grid-column: 3;
  justify-self: end;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding-left: 10px;
  border-left: 1px solid rgba(148, 163, 184, 0.38);
}
.map-toolbar .puzzle-high-tools[hidden] {
  display: none !important;
}
.map-toolbar .puzzle-high-tools .puzzle-high-tools-cap {
  font-size: 0.76rem;
  color: var(--muted);
  margin-right: 2px;
}
.map-toolbar .puzzle-high-tools .btn {
  padding: 4px 8px;
  font-size: 0.72rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: rgba(255, 255, 255, 0.95);
  color: #0f172a;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.map-toolbar .puzzle-high-tools .btn:hover {
  background: #f8fafc;
  border-color: rgba(59, 130, 246, 0.55);
}
.map-toolbar .puzzle-high-tools .btn:active {
  transform: translateY(1px);
}
.map-wrap.map-wrap--puzzle {
  background: linear-gradient(165deg, #f6fbfe 0%, #f0f8fc 48%, #eaf4fa 100%);
  box-shadow: inset 0 0 100px rgba(14, 165, 233, 0.035);
}
#diff-row.diff-row-puzzle {
  flex-direction: column;
  align-items: flex-start;
}
#diff-row.diff-row-puzzle label {
  font-size: 0.72rem;
  line-height: 1.32;
}
#layer-pool { pointer-events: none; }
#layer-pool #pool-bg {
  fill: #f9fcfe;
  stroke: rgba(186, 201, 218, 0.42);
  stroke-width: 0.5;
}
#layer-pool text { pointer-events: none; }
.piece-selected path {
  stroke: #0284c7 !important;
  stroke-width: 0.65 !important;
  filter: drop-shadow(0 0 6px rgba(14, 165, 233, 0.55));
}
.svg-host {
  flex: 1;
  position: relative;
  overflow: hidden;
}
.map-fs-wrap {
  flex-shrink: 0;
}
.map-fs-wrap--overlay {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 25;
}
.map-fs-btn {
  border-radius: var(--radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.4);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #0c4a6e;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
}
.map-fs-btn--icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
}
.map-fs-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.map-fs-btn .map-fs-icon--exit {
  display: none;
}
.map-fs-btn.is-fullscreen .map-fs-icon--enter {
  display: none;
}
.map-fs-btn.is-fullscreen .map-fs-icon--exit {
  display: block;
}
.map-fs-btn:hover {
  background: #f0f9ff;
  border-color: rgba(14, 165, 233, 0.55);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.15);
}
.map-fs-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.map-wrap:fullscreen,
.map-wrap:-webkit-full-screen {
  background: linear-gradient(165deg, var(--map-bg) 0%, #e8f2f8 45%, #dceaf5 100%);
}
.map-wrap:fullscreen.map-wrap--learn,
.map-wrap:-webkit-full-screen.map-wrap--learn {
  background: linear-gradient(165deg, #fdfefe 0%, #f8fbfc 42%, #f3f8fa 100%);
}
.map-wrap:fullscreen.map-wrap--puzzle,
.map-wrap:-webkit-full-screen.map-wrap--puzzle {
  background: linear-gradient(165deg, #f6fbfe 0%, #f0f8fc 48%, #eaf4fa 100%);
}
svg#main-svg {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
/* 学习模式：#layer-map-stack 内的中国版图（省区 + 经纬网 + 省名等）整体略抬升 + 多层投影，形成立体悬浮 */
.map-wrap--learn #layer-map-stack {
  transform: translate(0, -3px);
  filter:
    drop-shadow(0 -1.5px 1px rgba(255, 255, 255, 0.55))
    drop-shadow(0 2px 4px rgba(15, 23, 42, 0.1))
    drop-shadow(0 8px 18px rgba(15, 23, 42, 0.14))
    drop-shadow(0 18px 36px rgba(15, 23, 42, 0.1))
    drop-shadow(0 0 22px rgba(14, 165, 233, 0.14));
}
@media (prefers-reduced-motion: reduce) {
  .map-wrap--learn #layer-map-stack {
    transform: none;
  }
}
/* 标注层在省界之上绘制，须整体不拦截点击，否则点不到下面的省区 path */
#layer-labels,
#layer-capitals,
#layer-graticule-labels {
  pointer-events: none;
}
.province-path {
  stroke: #94a3b8;
  stroke-width: 0.35;
  vector-effect: non-scaling-stroke;
  transition: fill 0.18s ease, stroke 0.18s ease, opacity 0.2s, filter 0.2s ease;
  cursor: pointer;
}
.province-path.dim { opacity: 0.35; }
.province-path.quiz-on {
  stroke: #c2410c;
  stroke-width: 0.9;
  filter: drop-shadow(0 0 4px rgba(234, 88, 12, 0.45));
}
/* 左侧下拉选中：取消位移，加粗高亮描边 + 多层外发光形成醒目「框」 */
.province-path.panel-picked {
  stroke: #0284c7;
  stroke-width: 2.25px;
  vector-effect: non-scaling-stroke;
  filter:
    drop-shadow(0 0 0 3px #ffffff)
    drop-shadow(0 0 0 5px rgba(56, 189, 248, 0.85))
    drop-shadow(0 0 0 9px rgba(14, 165, 233, 0.5))
    drop-shadow(0 0 22px rgba(14, 165, 233, 0.55));
}
/* 拼图底图与虚线提示仅作衬底，不参与命中；低档显示分省描边底图，中档仅全国外衣（见 .board--silhouette） */
#layer-board,
#layer-hint,
#layer-graticule-lines {
  pointer-events: none;
}
.hint-path {
  fill: none;
  stroke: #94a3b8;
  stroke-dasharray: 3 3;
  stroke-width: 0.4;
  opacity: 0.55;
  pointer-events: none;
}
.map-wrap--puzzle #layer-hint .hint-path {
  stroke: #c5d3e2;
  stroke-width: 0.38;
  opacity: 0.5;
}
.graticule-line {
  stroke: rgba(71, 85, 105, 0.5);
  stroke-width: 0.45;
  vector-effect: non-scaling-stroke;
}
.graticule-tropic {
  stroke: rgba(220, 38, 38, 0.72);
  stroke-width: 0.55;
  stroke-dasharray: 5 4;
  vector-effect: non-scaling-stroke;
}
.graticule-label {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 9.5px;
  font-weight: 700;
  fill: #1e293b;
  paint-order: stroke fill;
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 2.2px;
  stroke-linejoin: round;
  pointer-events: none;
}
.graticule-label.graticule-label--tropic {
  fill: #b91c1c;
  font-size: 9px;
}
.board-path {
  fill: #f9fcfe;
  stroke: rgba(186, 201, 218, 0.42);
  stroke-width: 0.22;
  pointer-events: none;
}
/* 中档拼图：合并 path 与低档同色填色；禁止 stroke（多子路径时 stroke 会沿各省子轮廓画线，省界会露出来） */
.board-china-outline {
  pointer-events: none;
  display: none;
}
#board-china-outline {
  stroke: none;
  stroke-width: 0;
  vector-effect: unset;
}
#layer-board.board--silhouette .board-path:not(#board-china-outline) {
  display: none;
}
#layer-board.board--silhouette #board-china-outline {
  display: block;
  /* 无外描边，用阴影强调国界整体外形（不画省界） */
  filter:
    drop-shadow(0 0 1px rgba(15, 23, 42, 0.48))
    drop-shadow(0 0 3.5px rgba(15, 23, 42, 0.18))
    drop-shadow(0 2px 8px rgba(15, 23, 42, 0.09))
    drop-shadow(0 -1px 0 rgba(255, 255, 255, 0.72));
}
/* 低档拼图：整块底图组加与中档轮廓 path 一致的外缘阴影，凸显国界整体外形（省界描边仍在各 .board-path 上） */
#layer-board.layer-board--low-puzzle {
  filter:
    drop-shadow(0 0 1px rgba(15, 23, 42, 0.48))
    drop-shadow(0 0 3.5px rgba(15, 23, 42, 0.18))
    drop-shadow(0 2px 8px rgba(15, 23, 42, 0.09))
    drop-shadow(0 -1px 0 rgba(255, 255, 255, 0.72));
}
.piece {
  touch-action: none;
}
.piece path {
  stroke: #475569;
  stroke-width: 0.35;
  vector-effect: non-scaling-stroke;
  cursor: grab;
}
.piece.piece--micro path {
  stroke: #1e293b;
  stroke-width: 1.05;
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.85));
}
.piece.piece--micro.correct path {
  stroke-width: 0.9;
}
.piece.dragging path { cursor: grabbing; }
.piece.correct {
  pointer-events: none;
}
.piece.correct path {
  stroke: var(--ok);
  stroke-width: 0.55;
  cursor: default;
}
.piece.flash-bad path {
  stroke: var(--bad);
  stroke-width: 0.8;
}
@keyframes piece-snap-shine {
  0% {
    filter: drop-shadow(0 0 0 rgba(22, 163, 74, 0));
  }
  30% {
    filter:
      drop-shadow(0 0 10px rgba(34, 197, 94, 0.9))
      drop-shadow(0 0 20px rgba(250, 204, 21, 0.65));
  }
  100% {
    filter: none;
  }
}
.piece.snap-shine path {
  animation: piece-snap-shine 0.72s ease-out forwards;
}
.cap-dot {
  fill: #b45309;
  stroke: #fff;
  stroke-width: 0.2;
  pointer-events: none;
}
.prov-label {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  pointer-events: none;
  text-anchor: middle;
  font-weight: 700;
  fill: #0f172a;
  paint-order: stroke fill;
  stroke: rgba(255, 255, 255, 0.95);
  stroke-width: 0.45px;
  stroke-linejoin: round;
}
/* 按省区在图上的投影外包面积分级：大省字大，直辖市等字略小以免溢出 */
.prov-label.size-lg {
  font-size: 14px;
}
.prov-label.size-md {
  font-size: 10.5px;
}
.prov-label.size-sm {
  font-size: 7px;
}
.panel-hint {
  min-height: 1.25em;
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-deep);
  line-height: 1.45;
  letter-spacing: 0.02em;
}
#tooltip {
  position: absolute;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.94));
  color: #f1f5f9;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  z-index: 20;
  display: none;
  max-width: 220px;
  line-height: 1.45;
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}
.complete-banner {
  position: absolute;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(5, 150, 105, 0.45);
  color: var(--ok);
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  display: none;
  z-index: 15;
  box-shadow: 0 8px 32px rgba(5, 150, 105, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
}
.complete-banner.show { display: block; }
/* —— 测试模式：右侧填空题区（不显示地图） —— */
.test-quiz-root {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #f0f7fc 0%, #e8f0f8 100%);
  overflow: hidden;
}
.test-quiz-root[hidden] {
  display: none !important;
}
.test-quiz-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
}
.test-quiz-timer {
  font-weight: 800;
  font-size: 0.95rem;
  color: #0c4a6e;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}
.test-quiz-timer.warn {
  color: #c2410c;
}
.test-quiz-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 16px 14px 24px;
}
.test-quiz-single {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.test-quiz-progress {
  font-size: 0.82rem;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 10px;
}
.test-q-stem-single {
  font-size: 1.02rem;
  line-height: 1.5;
  color: #0f172a;
  margin-bottom: 14px;
  text-align: center;
}
.test-outline-wrap-single {
  margin: 0 auto 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, rgba(14, 165, 233, 0.1), rgba(226, 232, 240, 0.95));
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 12px;
  display: inline-block;
  box-shadow: var(--shadow-sm);
}
svg.test-outline-svg {
  display: block;
  width: min(100%, 320px);
  height: auto;
  max-height: 220px;
  margin: 0 auto;
}
.test-outline-path {
  fill: #475569;
  stroke: #1e293b;
  stroke-width: 0.35;
  vector-effect: non-scaling-stroke;
}
.test-q-input-single {
  width: 100%;
  max-width: 400px;
  padding: 11px 14px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  margin-bottom: 16px;
  box-sizing: border-box;
  text-align: center;
  background: rgba(255, 255, 255, 0.95);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.test-q-input-single:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.test-mc-options {
  width: 100%;
  max-width: 440px;
  margin: 0 auto 18px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  text-align: left;
}
.test-mc-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, 0.38);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1.35;
  color: #0f172a;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  box-shadow: var(--shadow-sm);
}
.test-mc-option:hover {
  border-color: var(--accent);
  background: rgba(240, 249, 255, 0.95);
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.12);
}
.test-mc-option:has(input:checked) {
  border-color: var(--accent-deep);
  background: linear-gradient(90deg, rgba(224, 242, 254, 0.95), rgba(255, 255, 255, 0.98));
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.test-mc-option input {
  flex: 0 0 auto;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--accent-deep);
}
.test-quiz-restart-area {
  width: 100%;
  max-width: 520px;
  text-align: center;
  padding: 32px 12px 28px;
}
.test-quiz-restart-area .btn.btn-test-restart {
  font-size: 1.18rem;
  font-weight: 800;
  padding: 16px 40px;
  min-width: 260px;
  border-radius: var(--radius-md);
  letter-spacing: 0.04em;
  box-shadow:
    0 6px 24px var(--accent-glow),
    0 0 0 1px rgba(255, 255, 255, 0.35) inset;
}
.test-quiz-restart-area .btn.btn-test-restart:hover {
  filter: brightness(1.06);
  box-shadow:
    0 8px 28px var(--accent-glow),
    0 0 0 1px rgba(255, 255, 255, 0.45) inset;
}
.test-quiz-restart-area[hidden] {
  display: none !important;
}
.test-format-picker {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 16px 20px;
  text-align: center;
  box-sizing: border-box;
}
.test-format-picker[hidden] {
  display: none !important;
}
.test-format-title {
  font-size: 1.12rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 8px;
}
.test-format-desc {
  font-size: 0.9rem;
  color: #64748b;
  line-height: 1.5;
  margin: 0 0 20px;
}
.test-format-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}
.test-format-card {
  flex: 1 1 200px;
  max-width: 248px;
  padding: 16px 14px 14px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
}
.test-format-card .btn-test-pick {
  width: 100%;
}
.test-format-card .test-format-time {
  margin: 10px 0 0;
  font-size: 0.84rem;
  color: #64748b;
}
.test-result-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.test-result-modal.show {
  display: flex;
}
.test-result-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 15, 30, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.test-result-dialog {
  position: relative;
  z-index: 1;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 14px;
  padding: 22px 24px;
  max-width: 520px;
  width: 100%;
  max-height: min(86vh, 640px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: var(--shadow-lg);
}
.test-result-dialog h3 {
  margin: 0 0 12px;
  font-size: 1.12rem;
  color: #0c4a6e;
  flex: 0 0 auto;
  font-weight: 800;
  letter-spacing: 0.03em;
}
#test-result-body {
  margin: 0 0 16px;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #334155;
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.test-result-row {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  text-align: left;
}
.test-result-row:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.test-result-intro {
  margin: 0 0 12px;
  font-weight: 600;
  color: #0f172a;
}

/* 左侧栏底部版权入口 */
.panel-copyright-entry {
  margin-top: auto;
  flex-shrink: 0;
  padding-top: 8px;
  border-top: 1px solid rgba(14, 165, 233, 0.28);
}
.copyright-text-btn {
  display: block;
  width: 100%;
  padding: 7px 10px;
  font-size: 0.72rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(255, 255, 255, 0.75);
  color: var(--muted);
  font-family: inherit;
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.copyright-text-btn:hover {
  background: var(--accent-soft);
  border-color: rgba(14, 165, 233, 0.55);
  color: #0c4a6e;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.12);
}
.copyright-text-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}


@media (max-width: 720px) {
  .panel-column {
    width: min(100%, 100vw);
    min-width: 0;
  }
  .app.panel-collapsed .panel-column {
    width: 0;
    min-width: 0;
  }
  .panel-toggle-btn {
    left: auto;
    right: 12px;
    top: auto;
    bottom: 12px;
    transform: none;
    border-radius: var(--radius-sm);
    border-left: 1px solid rgba(14, 165, 233, 0.45);
    width: 36px;
    height: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .panel-column,
  .panel {
    transition: none;
  }
}

/* 版权弹窗 */
.copyright-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(8, 15, 30, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.copyright-modal-overlay[hidden] {
  display: none !important;
}
.copyright-modal-dialog {
  width: min(96vw, 520px);
  max-height: min(92vh, 720px);
  overflow-y: auto;
  border-radius: 14px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: linear-gradient(180deg, #ffffff 0%, #f0f9ff 55%, #e8f4fc 100%);
  padding: 20px;
  box-shadow: var(--shadow-lg), 0 0 40px rgba(56, 189, 248, 0.1);
}
.copyright-modal-title {
  margin: 0 0 14px;
  font-size: 1.1rem;
  font-weight: 800;
  color: #0c4a6e;
  text-align: center;
  letter-spacing: 0.06em;
}
.copyright-modal-qr-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px 30px;
  align-items: flex-start;
}
.copyright-modal-qr-col {
  text-align: center;
  flex-shrink: 0;
}
.copyright-qrcode {
  display: block;
  margin: 0 auto;
  max-width: 150px;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 4px 20px rgba(14, 165, 233, 0.12);
}
.copyright-modal-qr-caption {
  margin: 8px 0 0;
  font-size: 0.88rem;
  color: #334155;
  line-height: 1.4;
}
.copyright-note {
  margin: 14px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.65;
  text-align: center;
}
.copyright-modal-actions {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}
.copyright-modal-actions button {
  min-width: 120px;
  padding: 9px 18px;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(14, 165, 233, 0.45);
  background: var(--accent-soft);
  color: #0c4a6e;
  font-family: inherit;
  font-weight: 600;
  transition: background 0.2s, box-shadow 0.2s;
}
.copyright-modal-actions button:hover {
  background: rgba(14, 165, 233, 0.22);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.18);
}
