/* =========================================================
   《霸王的大陆》(Destiny of an Emperor II) 专题档案馆
   全站共享样式 —— 零构建纯静态站，无外部资源
   ========================================================= */

:root {
  --bg: #ffffff;
  --ink: #1f2328;
  --ink-soft: #444c56;
  --muted: #6b7280;
  --accent: #9e2b25;
  --accent-dark: #7f221d;
  --accent-soft: rgba(158, 43, 37, 0.08);
  --line: #e8e4de;
  --line-soft: #f2efe9;
  --panel: #faf9f7;
  --card-shadow: 0 1px 2px rgba(31, 35, 40, 0.05), 0 8px 24px rgba(31, 35, 40, 0.06);
  --radius: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 中英文页字体栈（按 <html lang> 区分） */
html[lang="zh-CN"] body,
html[lang^="zh"] body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}
html[lang="en"] body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

::selection { background: var(--accent); color: #fff; }

img, svg { vertical-align: middle; }

a, button, label, input, select, textarea {
  /* 触屏优化：去掉双击缩放延迟，点击响应更快 */
  touch-action: manipulation;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: 0 0 8px 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ------------------ 页头与导航 ------------------ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }

.brand-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  flex: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 2px 6px rgba(158, 43, 37, 0.35);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 1.02rem; letter-spacing: 0.02em; }
.brand-text small {
  font-size: 0.7rem;
  color: var(--muted);
  letter-spacing: 0.14em;
}

.nav-toggle { display: none; }

.nav-toggle-label {
  display: none;
  width: 42px;
  height: 42px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: none;
}
.nav-toggle-label span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.site-nav a {
  padding: 8px 13px;
  border-radius: 9px;
  color: var(--ink-soft);
  font-size: 0.95rem;
  text-decoration: none;
}
.site-nav a:hover { background: var(--panel); color: var(--ink); text-decoration: none; }
.site-nav a.active { color: var(--accent); font-weight: 600; }

.lang-switch {
  border: 1px solid var(--accent) !important;
  color: var(--accent) !important;
  border-radius: 999px !important;
  padding: 4px 14px !important;
  margin-left: 8px;
  font-weight: 600;
}
.lang-switch:hover { background: var(--accent-soft) !important; }

/* ------------------ Hero ------------------ */

.hero {
  position: relative;
  overflow: hidden;
  padding: 76px 0 60px;
}
.hero::after {
  content: "霸";
  position: absolute;
  right: -30px;
  top: -40px;
  font-size: 260px;
  line-height: 1;
  font-weight: 700;
  color: var(--accent);
  opacity: 0.045;
  pointer-events: none;
  user-select: none;
}

.hero-kicker {
  margin: 0 0 14px;
  font-size: 0.8rem;
  letter-spacing: 0.28em;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.3rem, 5.5vw, 3.4rem);
  line-height: 1.2;
  letter-spacing: 0.02em;
  font-weight: 800;
}

.hero-sub {
  margin: 12px 0 4px;
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.06em;
}

.hero-en {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 26px;
}
.meta-chips span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 0.83rem;
  color: var(--muted);
  background: var(--bg);
}

.hero-intro { max-width: 780px; }
.hero-intro p { margin: 0 0 14px; color: var(--ink-soft); }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

/* ------------------ 按钮 ------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-dark); color: #fff; }

.btn-outline {
  border-color: #d5d0c8;
  color: var(--ink);
  background: #fff;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn[disabled],
.btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-sm { padding: 7px 15px; font-size: 0.88rem; border-radius: 9px; }

/* ------------------ 区块 ------------------ */

.section { padding: 58px 0; }
.section-alt {
  background: var(--panel);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.section-head { margin-bottom: 28px; }
.section-head h2 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
}
.section-head h2::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 1.05em;
  background: var(--accent);
  border-radius: 3px;
  margin-right: 12px;
  vertical-align: -0.14em;
}
.section-head p {
  margin: 8px 0 0;
  color: var(--muted);
  max-width: 720px;
}

.page-title {
  padding: 44px 0 6px;
}
.page-title h1 { margin: 0; font-size: clamp(1.7rem, 4vw, 2.2rem); }
.page-title p { margin: 8px 0 0; color: var(--muted); max-width: 760px; }

/* ------------------ 卡片 ------------------ */

.card {
  background: #fff;
  border: 1px solid rgba(31, 35, 40, 0.08);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 26px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.hack-card {
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.hack-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 2px 4px rgba(31, 35, 40, 0.06), 0 14px 32px rgba(31, 35, 40, 0.1);
}

.hack-card h3 { margin: 0 0 6px; font-size: 1.16rem; }

.hack-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.type-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }

.type-pill {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 2px 11px;
  border-radius: 999px;
  letter-spacing: 0.03em;
}

.type-story       { background: rgba(158, 43, 37, 0.1);  color: var(--accent); }
.type-difficulty  { background: #fdf3dd; color: #8a5a00; }
.type-gameplay    { background: #e8f0fb; color: #1d4ed8; }
.type-qol         { background: #e4f3f1; color: #0f766e; }
.type-graphics    { background: #e8ecfd; color: #4f46e5; }
.type-translation { background: #f4ecfd; color: #9333ea; }
.type-cheat       { background: #eef0f3; color: #4b5563; }
.type-engine, .type-original    { background: #fbf3d5; color: #a16207; }
.type-unknown     { background: #eef0f3; color: #6b7280; }

.hack-desc {
  margin: 10px 0 18px;
  color: var(--ink-soft);
  font-size: 0.95rem;
  flex: 1 0 auto;
}

.hack-card-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ------------------ 筛选 ------------------ */

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}
.filter-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  padding: 5px 15px;
  font-size: 0.86rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* ------------------ 空状态 ------------------ */

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 46px 24px;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--bg);
}
.empty-state strong { display: block; color: var(--ink-soft); margin-bottom: 6px; font-size: 1.02rem; }
.empty-state small { font-size: 0.88rem; line-height: 1.7; display: block; }

/* ------------------ 快速入口 ------------------ */

.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
}

.quick-card {
  display: block;
  color: var(--ink);
  text-decoration: none;
  padding: 22px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.quick-card:hover { text-decoration: none; transform: translateY(-3px); }

.quick-card .q-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 14px;
}

.quick-card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.quick-card p { margin: 0 0 10px; font-size: 0.9rem; color: var(--muted); }
.quick-card .q-arrow { font-size: 0.88rem; color: var(--accent); font-weight: 600; }

/* ------------------ 攻略栏目 ------------------ */

.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.guide-card { display: flex; flex-direction: column; gap: 8px; }
.guide-card .g-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 6px;
}
.guide-card h3 { margin: 0; font-size: 1.08rem; }
.guide-card p { margin: 0; color: var(--muted); font-size: 0.92rem; flex: 1; }

.badge-soon {
  align-self: flex-start;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 3px 12px;
  margin-top: 6px;
}

.guide-card.is-live { border-color: rgba(158, 43, 37, 0.25); }
.guide-card.is-live .g-link {
  align-self: flex-start;
  margin-top: 4px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
}
.guide-card.is-live:hover .g-link { text-decoration: underline; }

/* ------------------ 资料数据表 ------------------ */

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  margin: 14px 0 22px;
}

.data-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 0.88rem;
  line-height: 1.6;
}
.data-table th {
  position: sticky;
  top: 0;
  background: var(--panel);
  color: var(--ink-soft);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-align: left;
  padding: 9px 12px;
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}
.data-table td {
  padding: 6px 12px;
  border-bottom: 1px solid var(--line-soft);
  white-space: nowrap;
  color: var(--ink-soft);
}
.data-table td.num, .data-table th.num { text-align: center; font-variant-numeric: tabular-nums; }
.data-table td.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.8rem; color: var(--muted); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr.row-region td {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  padding: 7px 12px;
  letter-spacing: 0.05em;
}
.data-table tr.row-force td {
  background: #f6f3ec;
  color: #7c6a3f;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.data-table td.name { font-weight: 600; color: var(--ink); }

.table-note {
  font-size: 0.84rem;
  color: var(--muted);
  margin: -12px 0 22px;
  line-height: 1.7;
}

.doc-source {
  font-size: 0.84rem;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 0 0 8px;
}

/* ------------------ 详情 / 播放页 ------------------ */

.breadcrumb {
  padding: 20px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }

.detail-card { margin-top: 22px; }
.detail-card h1 { margin: 0 0 10px; font-size: 1.75rem; }

.detail-card h2 {
  margin: 28px 0 12px;
  font-size: 1.12rem;
}
.detail-card h2::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 1em;
  background: var(--accent);
  border-radius: 3px;
  margin-right: 10px;
  vertical-align: -0.12em;
}

.detail-desc { color: var(--ink-soft); margin: 12px 0 0; }

.feature-list { margin: 0; padding: 0; list-style: none; }
.feature-list li { padding: 5px 0 5px 26px; position: relative; color: var(--ink-soft); }
.feature-list li::before {
  content: "✓";
  position: absolute;
  left: 2px;
  color: var(--accent);
  font-weight: 700;
}

.player-card { margin-top: 24px; }

/* 补丁下载卡（详情页内嵌信息块） */
.patch-dl-card {
  margin-top: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
}
.patch-dl-card h3 {
  margin: 0 0 4px;
  font-size: 1.02rem;
  color: var(--ink);
}
.patch-dl-card .patch-dl-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 12px 0 4px; }
.patch-dl-card .patch-dl-note { font-size: 0.86rem; color: var(--muted); margin: 10px 0 0; line-height: 1.7; }
.patch-dl-card dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 18px;
  margin: 14px 0 0;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
}
.patch-dl-card dt { color: var(--muted); font-size: 0.86rem; }
.patch-dl-card dd { margin: 0; font-size: 0.9rem; overflow-wrap: anywhere; }
.patch-dl-card dd.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.82rem; }
@media (max-width: 760px) {
  .patch-dl-card dl { grid-template-columns: 1fr; gap: 2px 0; }
  .patch-dl-card dt { margin-top: 8px; }
  .patch-dl-card dt:first-of-type { margin-top: 0; }
}

/* 点击即玩：大按钮 + 说明小字 */
.btn-play {
  padding: 16px 44px;
  font-size: 1.12rem;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(158, 43, 37, 0.28);
}
.btn-play[disabled] { box-shadow: none; }

.play-notes {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 7px;
}
.play-notes li {
  color: var(--muted);
  font-size: 0.87rem;
  line-height: 1.65;
  padding-left: 18px;
  position: relative;
}
.play-notes li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 0.68em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.55;
}

.status-list {
  display: grid;
  gap: 10px;
  margin: 20px 0 0;
}
.status-item {
  padding: 10px 15px;
  border-radius: 10px;
  font-size: 0.92rem;
  border-left: 4px solid transparent;
  overflow-wrap: anywhere;
}
.status-ok   { background: #eef7ee; border-color: #1a7f37; color: #14532d; }
.status-warn { background: #fdf6e3; border-color: #b45309; color: #7c4a03; }
.status-err  { background: #fdeef0; border-color: #cf222e; color: #8a1f28; }
.status-info { background: #f3f4f6; border-color: #9ca3af; color: #4b5563; }

.player-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

.emulator-wrap { margin-top: 22px; }
.emulator-wrap .ejs-hint { font-size: 0.84rem; color: var(--muted); margin: 0 0 10px; }

/* 改版截图（真机标题画面） */
.card-shot, .hack-shot {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #101418;
  border-radius: 10px;
  image-rendering: pixelated;
  margin: 0 0 14px;
}
.hack-shot { max-width: 460px; }

/* 横屏提示：仅在「竖屏 + 触屏」设备显示（纯 CSS），桌面/横屏/非触屏隐藏 */
.rotate-tip {
  display: none;
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: #9a6700;
  background: #fdf6e3;
  border: 1px solid #f3e3b3;
  border-radius: 9px;
  padding: 7px 12px;
  text-align: center;
}
@media (orientation: portrait) and (pointer: coarse) {
  .emulator-wrap .rotate-tip { display: block; }
}

/* 模拟器容器：
   桌面——高度跟随视口、上限 640px（宽高比交由 EmulatorJS 内部 letterbox）；
   移动端（≤760px 见响应式段）——aspect-ratio 4:3 自适应，max-height 防横屏撑爆。 */
#emulator {
  width: 100%;
  height: min(72vh, 640px);      /* 旧浏览器回退 */
  height: min(72dvh, 640px);      /* 动态视口：iOS/安卓工具栏收放不跳变 */
  min-height: 280px;              /* 桌面安全下限（矮窗口） */
  background: #1f2328;
  border-radius: 12px;
  /* 圆角 + overflow:hidden 只裁切 iframe 直角外沿，
     不影响 iframe 内部 EmulatorJS 的 letterbox 缩放与虚拟手柄布局 */
  overflow: hidden;
}

/* ------------------ 关于页 ------------------ */

.prose { max-width: 800px; }
.prose h2 {
  font-size: 1.3rem;
  margin: 36px 0 12px;
}
.prose h2:first-child { margin-top: 0; }
.prose h2::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 1.05em;
  background: var(--accent);
  border-radius: 3px;
  margin-right: 12px;
  vertical-align: -0.14em;
}
.prose p, .prose li { color: var(--ink-soft); }
.prose ul, .prose ol { padding-left: 22px; }

.howto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 18px;
}
.howto-card h3 { margin: 0 0 4px; font-size: 1.08rem; }
.howto-card .howto-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 2px 11px;
  margin-bottom: 12px;
}
.howto-card ol { margin: 0; padding-left: 20px; color: var(--ink-soft); font-size: 0.94rem; }
.howto-card li { margin: 6px 0; }

.notice {
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 12px 12px 0;
  padding: 16px 20px;
  margin: 18px 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

/* ------------------ 语言选择门页 ------------------ */

.gate-page {
  min-height: 100vh;   /* 旧浏览器回退 */
  min-height: 100dvh;  /* 移动端动态视口，避免地址栏导致的溢出 */
  display: grid;
  place-items: center;
  background: var(--panel);
  padding: 24px;
}
.gate-card {
  text-align: center;
  padding: 52px 44px;
  max-width: 540px;
  width: 100%;
}
.gate-card .brand-seal {
  width: 60px;
  height: 60px;
  font-size: 30px;
  border-radius: 14px;
  margin: 0 auto 20px;
}
.gate-card h1 { margin: 0; font-size: 1.7rem; }
.gate-card .gate-en {
  display: block;
  font-size: 1rem;
  color: var(--muted);
  font-weight: 500;
  margin-top: 4px;
}
.gate-card p { color: var(--muted); margin: 16px 0 0; }
.gate-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 26px;
  flex-wrap: wrap;
}

/* ------------------ 页脚 ------------------ */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 34px 0 40px;
  margin-top: 40px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer p { margin: 0 0 6px; }
.footer-sub { font-size: 0.82rem; opacity: 0.85; }

/* ------------------ 响应式 ------------------ */

@media (max-width: 760px) {
  .nav-toggle-label { display: flex; }
  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgba(31, 35, 40, 0.08);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 20px 18px;
    gap: 2px;
    margin-left: 0;
  }
  .site-nav a { padding: 12px 10px; border-radius: 9px; }
  .lang-switch { margin-left: 0; text-align: center; }
  .nav-toggle:checked ~ .site-nav { display: flex; }
  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(2) { opacity: 0; }
  .nav-toggle:checked ~ .nav-toggle-label span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .hero { padding: 52px 0 44px; }
  .hero::after { font-size: 170px; right: -20px; }
  .section { padding: 44px 0; }

  /* 在线玩页：玩家区移到改版信息区上方（flex order，不改 HTML 语义） */
  main#main.container {
    display: flex;
    flex-direction: column;
  }
  main#main > .breadcrumb { order: 0; }
  main#main > .player-card { order: 1; }
  main#main > .detail-card { order: 2; }

  /* 模拟器：4:3 自适应高度；不设固定 min-height（横屏 vh 很小时会撑出滚动条） */
  #emulator {
    height: min(75vw, 70vh);      /* 不支持 aspect-ratio 的浏览器回退（约 4:3） */
    min-height: 0;
    max-height: 78vh;             /* vh 回退 */
    max-height: 78dvh;            /* 动态视口高度 */
  }
  @supports (aspect-ratio: 4 / 3) {
    #emulator {
      height: auto;
      aspect-ratio: 4 / 3;
    }
  }

  /* 开始按钮：移动端全宽 + 至少 48px 触控高度 */
  .btn-play {
    width: 100%;
    min-height: 48px;
    padding: 14px 24px;
  }

  .detail-card, .player-card { padding: 20px; }
  .card { padding: 20px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero-actions .btn { width: 100%; }
  .hero::after { display: none; }
  .gate-card { padding: 40px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
