/* ============================================================
   站点样式 —— 深色 + 火焰红/琥珀，移动端优先
   ============================================================ */
:root {
  --bg: #0b0f14;
  --bg-soft: #121821;
  --panel: #161d28;
  --panel-2: #1d2532;
  --line: #263040;
  --text: #e7edf5;
  --text-dim: #93a1b5;
  --text-mute: #64748b;
  --accent: #ff6b4a;
  --accent-2: #f2b03d;
  --accent-ink: #2a0b04;          /* 主按钮上的字（深色主题里是接近黑的深棕） */
  --accent-hover: #ff7f61;
  --accent-line: rgba(255, 107, 74, .38);
  --danger: #f4635f;

  /* ---------- 主题零件色 ----------
     下面这些在深色下是「淡淡的白色」，浅色下要换成「淡淡的黑色」。
     集中成变量，浅色主题只覆盖这一组就够了。 */
  --glow-a: rgba(255, 107, 74, .10);        /* 页面背景的两团光晕 */
  --glow-b: rgba(242, 176, 61, .09);
  --header-bg: rgba(11, 15, 20, .82);       /* 吸顶导航（半透明 + 模糊） */
  --hover-bg: #26303f;                      /* 按钮 / 分段控件的悬停底色 */
  --hover-line: #33404f;
  --card-hover-line: #35425a;
  --cover-bg: #0d131b;                      /* 封面底：图片没加载出来之前 */
  --badge-bg: rgba(4, 12, 20, .78);         /* 封面左上角的小标签 */
  --dropzone-bg: rgba(22, 29, 40, .5);
  --modal-veil: rgba(4, 8, 13, .72);        /* 弹窗背后的遮罩 */
  --sheet-veil: rgba(4, 7, 11, .62);        /* 手机端 MENU 面板的遮罩 */
  --hairline: rgba(255, 255, 255, .10);     /* 页脚分隔线、键位表虚线 */
  --kbd-line: #3a4757;
  --ad-stripe-a: #121821;                   /* 广告占位框的斜纹 */
  --ad-stripe-b: #151d27;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --maxw: 1180px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ============================================================
   浅色主题
   ------------------------------------------------------------
   只覆盖颜色，不动任何尺寸 / 布局 —— 所以两套主题长得一样、
   只是明暗反过来。切换逻辑见 assets/common.js 的 initTheme()，
   页面 <head> 里还有一小段内联脚本负责「首次绘制前」就把主题定好。
   ============================================================ */
html[data-theme="light"] {
  --bg: #f7f9fc;
  --bg-soft: #eef2f7;
  --panel: #ffffff;
  --panel-2: #f1f5f9;
  --line: #dbe3ec;
  --text: #16212e;
  --text-dim: #4d5c70;
  --text-mute: #6d7c8f;

  /* 白底上的绿要压深一点，否则对比度不够、字看不清 */
  --accent: #c1401f;
  --accent-2: #9a6a10;
  --accent-ink: #ffffff;
  --accent-hover: #a83618;
  --accent-line: rgba(193, 64, 31, .30);
  --danger: #c5342f;

  --glow-a: rgba(255, 107, 74, .16);
  --glow-b: rgba(242, 176, 61, .14);
  --header-bg: rgba(247, 249, 252, .86);
  --hover-bg: #e6ecf3;
  --hover-line: #c9d4e0;
  --card-hover-line: #b9c7d8;
  --cover-bg: #e7edf4;
  --badge-bg: rgba(255, 255, 255, .88);
  --dropzone-bg: rgba(255, 255, 255, .7);
  --modal-veil: rgba(23, 34, 48, .42);
  --sheet-veil: rgba(23, 34, 48, .40);
  --hairline: rgba(22, 33, 46, .12);
  --kbd-line: #c2ceda;
  --ad-stripe-a: #eef2f7;
  --ad-stripe-b: #e6ecf3;

  --shadow: 0 10px 26px rgba(15, 32, 55, .12);
  color-scheme: light;              /* 滚动条、原生控件跟着变浅 */
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; color-scheme: dark; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(60rem 40rem at 15% -10%, var(--glow-a), transparent 60%),
    radial-gradient(50rem 35rem at 90% 0%, var(--glow-b), transparent 60%);
  z-index: 0;
}

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

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 1.1rem + 2vw, 2.5rem); }
h2 { font-size: clamp(1.25rem, 1rem + 1vw, 1.7rem); }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; color: var(--text-dim); }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; position: relative; z-index: 1; }

/* ---------- 头部 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 14px; height: 60px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; color: var(--text); font-size: 1.05rem; }
.brand:hover { text-decoration: none; }
/* 站点标记：和 <link rel="icon"> 里的 favicon 用同一张图（绿色圆角方块 + 🎮） */
.brand-mark {
  width: 26px; height: 26px; flex: none;
  border-radius: 25%;                       /* 对应 SVG 里 rx=8 / 32 */
  /* 和 <link rel="icon"> 引用同一个文件：根目录的 favicon.svg */
  background-image: url("/favicon.svg");
  background-size: 100% 100%;
  background-repeat: no-repeat;
}

.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a {
  color: var(--text-dim); padding: 7px 12px; border-radius: 999px;
  font-size: .9rem; white-space: nowrap;
}
.nav a:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--panel-2); color: var(--accent); }

.menu-toggle {
  display: none; margin-left: auto; background: var(--panel);
  border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 7px 11px; cursor: pointer; font-size: 1rem;
}

/* 深浅色切换按钮。两个图标都写在 HTML 里，靠当前主题只显示其中一个 ——
   这样即使脚本还没跑起来，看到的也是对的图标，不会两个一起冒出来 */
.theme-toggle {
  flex: none; width: 36px; height: 36px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; cursor: pointer; font-size: 1rem; line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
.theme-toggle:hover { background: var(--hover-bg); border-color: var(--hover-line); }
.theme-toggle:active { transform: translateY(1px); }
.theme-toggle .i-sun { display: none; }
html[data-theme="light"] .theme-toggle .i-moon { display: none; }
html[data-theme="light"] .theme-toggle .i-sun { display: inline; }
@media (max-width: 420px) {
  .site-header .wrap { gap: 8px; }
  .theme-toggle { width: 34px; height: 34px; }
}

/* ---------- 广告位 ---------- */
.ad {
  display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(45deg, var(--ad-stripe-a), var(--ad-stripe-a) 10px, var(--ad-stripe-b) 10px, var(--ad-stripe-b) 20px);
  border: 1px dashed var(--line); border-radius: var(--radius-sm);
  color: var(--text-mute); font-size: .78rem; letter-spacing: .06em;
  min-height: 90px; margin: 18px 0; overflow: hidden; text-align: center;
}
.ad[data-filled="1"] { background: none; border: 0; min-height: 0; }
.ad-slot-top { max-height: 120px; }
.ad-slot-rect { min-height: 250px; }
.ad-slot-rail { min-height: 600px; }
.ad-label { font-size: .68rem; color: var(--text-mute); text-transform: uppercase; letter-spacing: .12em; }

.layout-with-rail { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
/* 侧边栏没有真实广告时（占位框也隐藏了），整列宽度收成 0，正文占满 */
.layout-with-rail.no-rail { grid-template-columns: minmax(0, 1fr); }
.layout-with-rail.no-rail .side-rail, .side-rail[hidden] { display: none; }

/* ---------- 首页 hero ---------- */
.hero { padding: 46px 0 10px; text-align: center; }
.hero p.lead { font-size: clamp(.98rem, .9rem + .3vw, 1.1rem); max-width: 62ch; margin: 0 auto 22px; }
.hero-emoji { font-size: 2.4rem; line-height: 1; margin-bottom: 6px; }

.pill-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 0 0 26px; }
.pill {
  font-size: .78rem; color: var(--text-dim); background: var(--panel);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer;
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 16px; transition: .15s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--hover-bg); border-color: var(--hover-line); text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 11px; font-size: .82rem; border-radius: 8px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ---------- 拖拽区 ---------- */
.dropzone {
  border: 1.5px dashed var(--line); border-radius: var(--radius);
  background: var(--dropzone-bg); padding: 22px; text-align: center;
  transition: .15s ease; cursor: pointer;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--accent); background: rgba(61, 220, 132, .06); }
.dropzone strong { color: var(--text); }
.dropzone small { display: block; color: var(--text-mute); margin-top: 6px; font-size: .8rem; }

/* ---------- 游戏卡片 ---------- */
.section-head { display: flex; align-items: baseline; gap: 12px; margin: 34px 0 16px; }
.section-head h2 { margin: 0; }
.section-head .count { color: var(--text-mute); font-size: .85rem; }
.section-head .spacer { margin-left: auto; }

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

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
  transition: .18s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--card-hover-line); box-shadow: var(--shadow); }
.card-cover {
  position: relative; aspect-ratio: 3 / 2; background: var(--cover-bg); overflow: hidden;
}
.card-cover img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  image-rendering: pixelated;
}
.card-cover .placeholder {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 2rem; opacity: .35;
}
.card-badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--badge-bg); color: var(--accent);
  border: 1px solid var(--accent-line);
  font-size: .68rem; padding: 2px 8px; border-radius: 999px; font-weight: 700;
  letter-spacing: .04em;
}
.card-body { padding: 13px 14px 15px; display: flex; flex-direction: column; flex: 1; gap: 8px; }
.card-body h3 { margin: 0; font-size: .98rem; }
.card-body .desc {
  font-size: .82rem; color: var(--text-dim); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { font-size: .68rem; color: var(--text-mute); background: var(--bg-soft); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
.card-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; }
.card-foot .meta { font-size: .72rem; color: var(--text-mute); margin-left: auto; }

/* ---------- 播放页 ---------- */
.player-page { padding: 18px 0 40px; }
.breadcrumb { font-size: .84rem; color: var(--text-mute); margin-bottom: 12px; }
.breadcrumb a { color: var(--text-dim); }

.player-shell {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  --shell-pad: 14px;   /* 四周留白，窄屏再调小，见下面的媒体查询 */
}
/* 画面（以及手机端排在画面下面的手柄）不要贴着面板边框：
   黑画面和面板边糊在一起时，面板看着像被画面切断了。
   留白加在 .player-shell 上；标题栏 / 工具栏 / 模拟器抽屉是三条「整宽横带」，
   用负外边距把留白顶回去，底色和分隔线仍旧顶到面板边缘。
   全屏下不套这套（画面要顶满整个屏幕），所以用 body:not(.fs-mode) 限定。 */
body:not(.fs-mode) .player-shell { padding: 0 var(--shell-pad) var(--shell-pad); }
body:not(.fs-mode) .player-shell > .player-titlebar,
body:not(.fs-mode) .player-shell > .toolbar,
body:not(.fs-mode) .player-shell > #ejs-dock {
  margin-left: calc(var(--shell-pad) * -1);
  margin-right: calc(var(--shell-pad) * -1);
}
/* 模拟器设置抽屉是最后一块，底下也顶到边 */
body:not(.fs-mode) .player-shell > #ejs-dock { margin-bottom: calc(var(--shell-pad) * -1); }
@media (max-width: 700px) {
  /* 手机屏幕窄，留白收到和工具栏左右内边距（10px）一样，文字仍旧对齐、画面少让一点 */
  .player-shell { --shell-pad: 10px; }
}
.player-titlebar {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px;
  border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.player-titlebar h1 { font-size: 1rem; margin: 0; }
.player-titlebar .meta { font-size: .75rem; color: var(--text-mute); margin-left: auto; }

/* screen-box 是尺寸的唯一控制点（EJS 不会碰它）。
   position:relative 让手机端那块 MENU 按钮有个定位基准（全屏时它是 fixed，
   两种模式都用得上，所以放在这里而不是某段媒体查询里）。 */
#screen-box { position: relative; width: 100%; margin: 0 auto; }
#game {
  width: 100%; aspect-ratio: 3 / 2; background: #000;
  outline: none;                  /* 焦点在游戏画面上时不显示外框 */
}
#game:focus, #game:focus-visible { outline: none; }
#game.ejs_fullscreen_container { aspect-ratio: auto; }
/* 整数倍放大时保持像素锐利 */
#screen-box[data-scale="1"] canvas,
#screen-box[data-scale="2"] canvas,
#screen-box[data-scale="3"] canvas,
#screen-box[data-scale="4"] canvas,
#screen-box[data-scale="5"] canvas { image-rendering: pixelated; }

/* 模拟器自带控制条：从画面里搬出来，收进画面下方的抽屉 */
#ejs-dock { border-top: 1px solid var(--line); background: var(--bg-soft); padding: 4px 10px; }
#ejs-dock[hidden] { display: none; }
#ejs-dock .ejs_menu_bar {
  position: static !important; opacity: 1 !important; transform: none !important;
  pointer-events: auto !important; left: auto !important; bottom: auto !important;
  width: 100% !important; max-width: 100% !important; height: auto !important;
  max-height: none !important; z-index: 1 !important; margin: 0 !important;
  padding: 6px 0 !important; background: transparent !important;
  flex-wrap: wrap !important; align-items: center !important; gap: 4px 2px !important;
}
#ejs-dock .ejs_menu_bar_spacer { display: none !important; }
#ejs-dock .ejs_menu_bar, #ejs-dock .ejs_menu_button { font-family: var(--font) !important; }
#ejs-dock .ejs_menu_button {
  width: auto !important; margin: 0 !important; padding: 6px 10px !important;
  display: inline-flex !important; align-items: center !important;
  border-radius: 8px !important; color: var(--text-dim) !important;
  line-height: 1 !important; font-size: .78rem !important;
}
#ejs-dock .ejs_menu_button:hover { background: var(--panel-2) !important; color: var(--text) !important; }
#ejs-dock .ejs_menu_button svg { float: none !important; height: 15px !important; width: 15px !important; }
#ejs-dock .ejs_menu_text {
  position: static !important; opacity: 1 !important; transform: none !important;
  background: none !important; color: inherit !important; padding: 0 0 0 5px !important;
  font-size: .78rem !important; white-space: nowrap;
}
#ejs-dock .ejs_volume_parent { padding-right: 4px !important; }
#ejs-dock .ejs_volume_parent input[type=range] { max-width: 90px; }
#ejs-dock .ejs_settings_parent, #ejs-dock .ejs_disks_parent { position: relative; }

/* ---------- 虚拟手柄：先做减法，再做排版 ----------
   1) 「加速 / 减速」两个手柄键没有意义：玩家不会一边按住加速一边去按别的键，
      倍速在工具栏（以及手机端的 MENU 面板）里选就够了，删掉还能少占一块地方。
   2) 其余按键按屏幕方向分区重排，见下面的竖屏 / 横屏两段。 */
.ejs_virtualGamepad_button.b_speed_fast,
.ejs_virtualGamepad_button.b_speed_slow { display: none !important; }

/* ---------- 手机竖屏：手柄搬到画面下方，分三行摆开 ----------
   EJS 自己那套坐标是给「浮在画面上」设计的：十字键 / AB 各占一角、
   L / R 悬在画面里距顶 -90px、开始 / 选择挤在底部中央，全在同一个高度带里。
   竖屏时画面只有 230 多像素高，这堆按键必然摞在一起
   （实测 L 压住「选择」、R 压住「开始」，就是用户截图里的样子）。
   所以竖屏下不用它的坐标，改成三行：
       第一行   L              MENU              R
       第二行   十字键（左下）            A / B（右下）
       第三行            选择        开始
   所有坐标都相对 .ejs_virtualGamepad_parent，而它正好铺在画面下方那块留白里。
   行与行之间必须留够空档：L / R 紧贴十字键上沿的话，拇指按「上」时很容易
   蹭到 L（差 3px 就会误触），所以第一行和第二行之间留了 25px。
   第一行整体高度 = 4 + 31，第二行 128，最后一行 31 + 底边距 9，加起来 250。
   body.has-vpad 由 player.js 在模拟器把手柄建出来之后才加。 */
@media (max-width: 700px) and (orientation: portrait) {
  body.has-vpad { --vpad-h: 250px; }
  /* height 必须是 auto：player.js 会给 #screen-box 写死一个高度（内联样式），
     全站又是 border-box，写死的高度会把留白算进去、画面被压扁 */
  body.has-vpad #screen-box {
    position: relative; height: auto !important; padding-bottom: var(--vpad-h);
  }
  /* #game 不再当定位容器（它的 .ejs_parent{position:relative} 被这条更具体的盖掉），
     改由 #screen-box 承担，手柄父节点才有整块留白可以铺 */
  body.has-vpad #screen-box #game:not(:fullscreen) { position: static; }
  /* 手柄父节点铺满留白区，下面每个键的坐标都相对它算 */
  body.has-vpad #screen-box .ejs_virtualGamepad_parent {
    left: 0; right: 0; bottom: 0 !important; width: 100%; height: var(--vpad-h);
  }

  /* 第二行：十字键靠左、A/B 靠右，各 128px，离底边留出第三行的高度 */
  body.has-vpad #screen-box .ejs_virtualGamepad_left {
    left: 10px; right: auto; bottom: 62px; width: 128px; height: 128px;
  }
  body.has-vpad #screen-box .ejs_virtualGamepad_right {
    right: 10px; left: auto; bottom: 62px; width: 128px; height: 128px;
  }

  /* 第一行：L / R 是十字键、A/B 的子元素，EJS 的坐标写在内联样式里，
     盖它必须 !important。-56px 让它们落在留白区顶部那一行，
     和下面的十字键 / A·B 之间空出 25px，按方向键不会蹭到。 */
  body.has-vpad #screen-box .ejs_virtualGamepad_button.b_l {
    left: 10px !important; right: auto !important; top: -56px !important;
  }
  body.has-vpad #screen-box .ejs_virtualGamepad_button.b_r {
    right: 10px !important; left: auto !important; top: -56px !important;
  }

  /* 第三行：开始 / 选择 从挤成一堆改成左右分开，各让出 24px 的间距 */
  body.has-vpad #screen-box .b_select { left: 0 !important; }
  body.has-vpad #screen-box .b_start { left: 74px !important; }

  /* 手机屏幕竖向就那么高，标题栏占的一行留给游戏：名字上面面包屑里已经有了 */
  body.has-vpad .player-titlebar { display: none; }
}

/* ---------- 手机端「快速存 / 快速读」常驻按钮 ----------
   这两个是玩改版最常用的动作（打 Boss 前先存一下），所以不藏在 MENU 面板里，
   直接做成手柄旁的常驻按钮。点它们走的就是工具栏那两个按钮的同一套逻辑
   （data-quicksave / data-quickload），存档行为、提示条完全一致。
   摆位原则跟手柄一样：只占空位，不压十字键、也不压 A·B。
     · 竖屏 —— 留白区最下面一行的两个角上，正好是「选择 / 开始」左右两侧的空位；
     · 横屏（触摸设备）—— 画面底部「选择 / 开始」上面那一排，居中并排。 */
.vpad-quick-btn {
  display: none; position: absolute; z-index: 60;
  width: 58px; height: 31px; padding: 0; border-radius: 9px;
  border: 1px solid rgba(61, 220, 132, .5); background: rgba(61, 220, 132, .14);
  color: #c7f7db; font: inherit; font-size: .72rem; font-weight: 700;
  line-height: 29px; text-align: center; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.vpad-quick-btn:active { background: rgba(61, 220, 132, .32); }

@media (max-width: 700px) and (orientation: portrait) {
  body.has-vpad .vpad-quick-btn { display: inline-block; bottom: 9px; }
  body.has-vpad .vpad-quick-btn[data-quicksave] { left: 8px; }
  body.has-vpad .vpad-quick-btn[data-quickload] { right: 8px; }
}

/* 横屏：手机竖过来之后画面顶满，底部中间「选择 / 开始」上方那块是空的 */
@media (orientation: landscape) and (any-pointer: coarse) {
  .vpad-quick-btn { display: inline-block; bottom: 102px; }
  .vpad-quick-btn[data-quicksave] { left: calc(50% - 8px); transform: translateX(-100%); }
  .vpad-quick-btn[data-quickload] { left: calc(50% + 8px); }
}

/* ---------- 手机端 MENU：一块能随时展开的功能面板 ----------
   工具栏在竖屏时被压缩、全屏时更是整个被藏起来，玩家想「快速存 / 存档槽 /
   金手指」就得先退出全屏。所以给它一个随时在场的入口：
     · 竖屏非全屏 —— 摆在留白区第一行正中（L 与 R 之间），不用碰画面；
     · 全屏 —— 浮在画面顶部正中（原生全屏里只有 #screen-box 被显示，
       所以按钮必须放在 #screen-box 里面才看得见）。 */
.vpad-menu-btn {
  display: none; position: absolute; z-index: 60;
  height: 32px; padding: 0 14px; border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .38); background: rgba(255, 255, 255, .12);
  color: #e7edf5; font: inherit; font-size: .78rem; font-weight: 700; letter-spacing: .04em;
  line-height: 30px; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.vpad-menu-btn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
body.fs-mode .vpad-menu-btn { display: inline-block; }

@media (max-width: 700px) and (orientation: portrait) {
  body.has-vpad .vpad-menu-btn {
    display: inline-block; left: 50%; transform: translateX(-50%);
    bottom: calc(var(--vpad-h) - 36px);   /* 与 L / R 同一行 */
  }
}

body.fs-mode .vpad-menu-btn {
  position: fixed; left: 50%; right: auto; bottom: auto; transform: translateX(-50%);
  top: calc(8px + env(safe-area-inset-top)); z-index: 10002;
  background: rgba(11, 15, 20, .72);
}

/* 面板本体：固定定位、带半透明遮罩，全屏时也浮在最上层 */
.vpad-menu { position: fixed; inset: 0; z-index: 10050; display: flex; align-items: flex-end; }
.vpad-menu[hidden] { display: none; }
.vpad-menu-backdrop { position: absolute; inset: 0; background: var(--sheet-veil); }
.vpad-menu-card {
  position: relative; width: 100%; max-height: 78vh; overflow: auto;
  background: var(--panel); border-top: 1px solid var(--line);
  border-radius: 16px 16px 0 0; box-shadow: 0 -12px 40px rgba(0, 0, 0, .55);
  padding: 0 0 calc(10px + env(safe-area-inset-bottom));
  animation: vpad-rise .16s ease-out;
}
@keyframes vpad-rise { from { transform: translateY(18px); opacity: .4; } to { transform: none; opacity: 1; } }
.vpad-menu-head {
  display: flex; align-items: center; padding: 12px 16px;
  border-bottom: 1px solid var(--line); font-size: .92rem;
}
.vpad-menu-close {
  margin-left: auto; background: none; border: 0; color: var(--text-dim);
  font-size: 1.3rem; line-height: 1; padding: 0 4px; cursor: pointer;
}
.vpad-menu-body { padding: 6px 12px 2px; }
/* 面板里放的是工具栏的那一份（含文字标签与分隔线），这里让它们竖着排开 */
.vpad-menu-body .toolbar {
  display: block; padding: 0; border-top: 0; background: none;
}
.vpad-menu-body .tool-group { display: flex; align-items: center; gap: 6px; padding: 7px 0; flex-wrap: wrap; }
.vpad-menu-body .divider { display: none; }
.vpad-menu-body .tip { display: block; margin: 4px 0 8px; }

/* 手机上的工具栏再紧一点：默认每一档都占满一行太占地方，
   小屏手机上会把画面和手柄挤到屏幕外面去 */
@media (max-width: 700px) {
  .toolbar { padding: 8px 10px; gap: 6px; }
  .toolbar .tool-group { gap: 5px; }
  .seg button { padding: 5px 9px; font-size: .76rem; }
  .toolbar .btn-sm { padding: 6px 10px; font-size: .78rem; }
}

/* ---------- 全屏 / 沉浸模式 ----------
   原生 Fullscreen API 能进就进（地址栏消失，最沉浸）；
   iPhone Safari 没有这个 API，进不去就退回「网页内全屏」：
   藏起页头页脚和正文，只留画面与手柄，右上角一个退出按钮。
   两种情况的排版都由这里的 CSS 说了算 —— EJS 自己的全屏是把 #game
   直接铺满屏幕，GBA 是 3:2 的，铺满会被拉变形，所以不走它那套。 */
body.fs-mode { overflow: hidden; }
body.fs-mode .site-header,
body.fs-mode .site-footer,
body.fs-mode .breadcrumb,
body.fs-mode .btn-row,
body.fs-mode #player-error,
body.fs-mode .ad,
body.fs-mode .stat-row,
body.fs-mode main.player-page section { display: none !important; }
/* 播放器面板里只留画面和模拟器设置抽屉，工具栏/标题栏都收起来 */
body.fs-mode .player-shell > * { display: none !important; }
body.fs-mode .player-shell > #screen-box,
body.fs-mode .player-shell > .fs-exit,
body.fs-mode .player-shell > #ejs-dock:not([hidden]) { display: block !important; }
/* 面板 / 弹窗 / 提示条都挂在 .player-shell 里面（原生全屏只渲染这一支），
   它们的显示由自己的 hidden / .open 决定，这里要把上面那条「全部收起来」放回来 */
body.fs-mode .player-shell > .vpad-menu:not([hidden]) { display: flex !important; }
body.fs-mode .player-shell > .modal.open { display: flex !important; }
body.fs-mode .player-shell > #toast { display: block !important; }
body.fs-mode .player-shell {
  position: fixed; inset: 0; z-index: 10000; margin: 0; overflow: auto;
  border: 0; border-radius: 0; background: #000; box-shadow: none;
  display: flex; flex-direction: column; justify-content: center;
}
/* 画面按 3:2 顶满高度或宽度，多出来的地方留黑边。
   150vh 让「高」成为限制条件，横屏时画面正好和屏幕一样高。
   手机浏览器地址栏会占掉一截，所以支持 dvh 的（iOS 15.4+）用能随地址栏变化的
   dvh，免得横屏时画面下沿被顶到屏幕外面去。 */
body.fs-mode #screen-box {
  width: min(100vw, 150vh) !important; height: auto !important; margin: 0 auto;
}
@supports (height: 100dvh) {
  body.fs-mode #screen-box { width: min(100vw, 150dvh) !important; }
}
/* 全屏时播放器面板是 z-index 10000 的浮层，模态框（z-index 200）和
   提示条（z-index 300）默认会被它盖住 —— 从 MENU 面板里点开「存档槽」
   就什么也看不到。这里把这两样抬到面板之上。 */
body.fs-mode .modal { z-index: 10055; }
body.fs-mode #toast { z-index: 10060 !important; }

.fs-exit {
  display: none; position: fixed; z-index: 10001;
  top: calc(10px + env(safe-area-inset-top)); right: calc(10px + env(safe-area-inset-right));
  padding: 9px 14px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .22); background: rgba(11, 15, 20, .86);
  color: #fff; font: inherit; font-size: .82rem; cursor: pointer;
}
body.fs-mode .fs-exit { display: block; }

/* 手机竖屏时提示一句：横过来画面能大不少（点「知道了」记在本机，不再打扰） */
.rotate-hint {
  margin: 12px 0 0; padding: 10px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--bg-soft);
  color: var(--text-dim); font-size: .84rem;
}
.rotate-hint button {
  margin-left: 10px; background: none; border: 0; color: var(--text-mute);
  font: inherit; font-size: .8rem; cursor: pointer; text-decoration: underline;
}

/* 自建工具栏 */
.toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 10px 14px; border-top: 1px solid var(--line); background: var(--bg-soft);
}
.tool-group { display: flex; align-items: center; gap: 6px; }
.tool-group > .label { font-size: .74rem; color: var(--text-mute); margin-right: 2px; }
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button {
  font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer;
  background: transparent; color: var(--text-dim); border: 0;
  padding: 6px 11px; border-right: 1px solid var(--line);
}
.seg button:last-child { border-right: 0; }
.seg button:hover { background: var(--hover-bg); color: var(--text); }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.toolbar .divider { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.toolbar .tip { font-size: .74rem; color: var(--text-mute); margin-left: auto; }

/* 数字兜底 */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 16px 0; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 13px; }
.stat b { display: block; font-size: 1.02rem; color: var(--accent); }
.stat span { font-size: .76rem; color: var(--text-mute); }

/* ---------- 弹层 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 200; display: none;
  align-items: center; justify-content: center; padding: 18px;
  background: var(--modal-veil); backdrop-filter: blur(4px);
}
.modal.open { display: flex; }
.modal-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  width: min(560px, 100%); max-height: 84vh; display: flex; flex-direction: column;
  box-shadow: var(--shadow);
}
.modal-head { display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 1rem; }
.modal-head .close { margin-left: auto; background: none; border: 0; color: var(--text-dim); font-size: 1.3rem; cursor: pointer; line-height: 1; padding: 0 4px; }
.modal-body { padding: 14px 16px; overflow: auto; }
.modal-foot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }

.cheat-row { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.cheat-row:last-child { border-bottom: 0; }
.cheat-row input[type=checkbox] { margin-top: 4px; width: 16px; height: 16px; accent-color: var(--accent); flex: none; }
.cheat-row .cname { font-size: .88rem; }
.cheat-row code {
  display: block; font-family: var(--mono); font-size: .72rem; color: var(--text-mute);
  white-space: pre-wrap; word-break: break-all; margin-top: 2px;
}
/* 站上不放预设代码，金手指面板只讲「怎么自己加」，所以这里是一段说明性的步骤 */
.cheat-steps { margin: 10px 0 0; padding-left: 20px; font-size: .87rem; line-height: 1.8; }
.cheat-steps li { margin: 6px 0; }
.cheat-steps code {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px;
  padding: 1px 5px; font-size: .84em; font-family: var(--mono);
}
.slot-row { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.slot-row:last-child { border-bottom: 0; }
.slot-row .slot-name { font-size: .88rem; min-width: 68px; }
.slot-row .slot-time { font-size: .74rem; color: var(--text-mute); margin-left: auto; }
.slot-thumb { width: 64px; height: 43px; object-fit: cover; border-radius: 5px; image-rendering: pixelated; background: #000; flex: none; }

.notice {
  border-left: 3px solid var(--accent); background: var(--panel);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 12px 15px; margin: 16px 0;
}
.notice p { margin: 0; font-size: .87rem; }
.notice.warn { border-left-color: #e3b341; }

/* ---------- 正文页 ---------- */
.prose { max-width: 76ch; }
.prose h2 { margin-top: 1.6em; }
.prose ul { color: var(--text-dim); padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }
.prose ol { color: var(--text-dim); padding-left: 1.35em; }
.prose h3 { margin: 1.3em 0 .35em; font-size: 1.02rem; }
.prose code { font-family: var(--mono); font-size: .86em; background: var(--panel-2); padding: 1px 5px; border-radius: 4px; }

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--line); margin-top: 50px; padding: 26px 0 34px;
  color: var(--text-mute); font-size: .84rem; position: relative; z-index: 1;
}
.site-footer .cols { display: flex; flex-wrap: wrap; gap: 22px 40px; }
.site-footer a { color: var(--text-dim); }
.site-footer .legal { margin-top: 16px; font-size: .78rem; line-height: 1.7; }

.empty { text-align: center; padding: 34px 18px; color: var(--text-mute); border: 1px dashed var(--line); border-radius: var(--radius); }

.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px; color: var(--text-dim); }
.spinner {
  width: 16px; height: 16px; border: 2px solid var(--line);
  border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 响应式 ---------- */
@media (max-width: 1000px) {
  .layout-with-rail { grid-template-columns: 1fr; }
  .layout-with-rail .side-rail { display: none; }
}
@media (max-width: 720px) {
  /* 手机上点 ☰ 弹出的菜单：底色用 --panel、再加一道投影，
     浅色主题下才看得出是「浮在上面的一层」，不会和页面糊在一起 */
  .nav { display: none; position: absolute; top: 60px; left: 0; right: 0;
         flex-direction: column; align-items: stretch; gap: 0;
         background: var(--panel); border-bottom: 1px solid var(--line);
         box-shadow: var(--shadow); padding: 6px; }
  .nav.open { display: flex; }
  .menu-toggle { display: block; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .card-body .desc { display: none; }
  .toolbar .tip { display: none; }
.tool-group { flex-wrap: wrap; }          /* 窄屏时按钮组要能换行，别被挤出容器 */
  .toolbar .divider { display: none; }
  .hero { padding: 28px 0 6px; }
  .ad-slot-rail { min-height: 250px; }
}

/* 模拟器启动前 #game 是空的，这里放「下载 / 解压游戏文件」的提示 */
.rom-loading {
  display: flex; align-items: center; justify-content: center;
  height: 100%; min-height: 220px; padding: 24px;
  color: var(--text-dim); font-size: .95rem; text-align: center;
}

/* ---------- 游戏介绍页（games/*.html） ---------- */
main.wrap > section { margin-bottom: 30px; }
main.wrap > p.lead { font-size: 1.02rem; max-width: 70ch; }
.game-hero { display: flex; gap: 22px; flex-wrap: wrap; align-items: flex-start; margin: 6px 0 26px; }
.game-hero-cover { flex: 0 0 360px; max-width: 100%; }
.game-hero-cover img { width: 100%; height: auto; border-radius: var(--radius);
  border: 1px solid var(--line); background: #000; display: block; }
.game-hero-info { flex: 1 1 320px; min-width: 0; }
.game-hero-info h1 { margin-bottom: .35em; }
.meta-line { font-size: .82rem; color: var(--text-mute); margin: 14px 0 0; }
/* 首段结论 + 速览参数表：给「只想扫一眼」的人，也是 AI 搜索最爱摘的一段 */
.one-liner { font-size: 1.05rem; color: var(--text); margin: 0 0 10px; padding-left: 12px;
  border-left: 3px solid var(--accent); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px 18px;
  margin: 16px 0 4px; padding: 14px 16px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius-sm); }
.facts > div { min-width: 0; }
.facts dt { font-size: .74rem; color: var(--text-mute); letter-spacing: .04em; }
.facts dd { margin: 1px 0 0; font-size: .9rem; color: var(--text-dim); }
.feat-list { margin: 0; padding-left: 1.15em; color: var(--text-dim); }
.feat-list li { margin-bottom: .45em; }
.shot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.shot-grid img { width: 100%; height: auto; border-radius: var(--radius-sm);
  border: 1px solid var(--line); display: block; }
/* 首页「继续上次的游戏」入口（由 assets/app.js 渲染） */
.resume { display: flex; align-items: center; gap: 16px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.resume-cover { flex: none; width: 132px; display: block; border-radius: var(--radius-sm); overflow: hidden; }
.resume-cover img { width: 100%; height: auto; display: block; }
.resume-cover .placeholder { aspect-ratio: 3 / 2; display: grid; place-items: center; font-size: 1.6rem;
  background: var(--panel-2); }
.resume-body { min-width: 0; }
.resume-kicker { display: inline-block; font-size: .74rem; color: var(--accent); letter-spacing: .04em; }
.resume-body h2 { margin: 4px 0 6px; font-size: 1.12rem; }
.resume-body p { margin: 0 0 10px; color: var(--text-dim); font-size: .86rem; }
@media (max-width: 560px) {
  .resume { flex-direction: column; align-items: flex-start; gap: 12px; }
  .resume-cover { width: 100%; max-width: 240px; }
}

/* 改版推荐页的对照表 */
.table-wrap { overflow-x: auto; margin: 18px 0 6px; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--text-dim); font-weight: 600; font-size: .82rem; white-space: nowrap; }
.table td:first-child { color: var(--text-dim); }
.table tr:last-child td { border-bottom: 0; }
@media (max-width: 640px) { .table { font-size: .84rem; } .table th, .table td { padding: 8px 9px; } }

/* 三列都塞不下的对比表（「系列版本对比」用的就是它）：手机上一行折成一张卡片，
   每格上面标出它原本属于哪一列 —— 三列硬挤在手机宽度里，每格只剩四五个字，读不动。 */
@media (max-width: 640px) {
  .table-stack { display: block; }        /* 整张表变成普通块，colgroup 的列宽随之失效 */
  .table-stack thead { display: none; }
  .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
  .table-stack tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .table-stack tr:last-child { border-bottom: 0; }
  .table-stack td { padding: 3px 0; border-bottom: 0; }
  .table-stack td:first-child { color: var(--text); font-weight: 600; font-size: 1rem; }
  .table-stack td:not(:first-child)::before {
    content: attr(data-label);
    display: block; margin: 8px 0 1px; font-size: .74rem; color: var(--text-mute);
  }
}

.faq-item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px;
  margin-bottom: 10px; background: var(--panel); }
.faq-item summary { cursor: pointer; font-weight: 600; color: var(--text); }
.faq-item p { margin: 10px 0 0; }
@media (max-width: 720px) { .game-hero-cover { flex: 1 1 100%; } }

/* ============================================================
   最近更新面板 / 操作说明键位表 / 交流群 / 分享按钮
   —— 首页与播放页共用，所以集中放在文件末尾，别在中间另起一套
   ============================================================ */

/* ---------- 「最近更新」时间线 ---------- */
.updates { list-style: none; margin: 0; padding: 0; }
.update-item {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 14px 16px; margin-bottom: 10px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel);
}
.update-date {
  flex: none; width: 84px; padding-top: 2px;
  font-size: .84rem; font-weight: 700; color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.update-body { flex: 1; min-width: 0; }
.update-body h3 { margin: 0 0 6px; font-size: .98rem; }
.update-list { margin: 0; padding-left: 1.15em; font-size: .88rem; color: var(--text-dim); }
.update-list li { margin-bottom: 3px; }
.updates-note { margin: 12px 0 0; font-size: .85rem; color: var(--text-mute); }
@media (max-width: 560px) {
  .update-item { flex-direction: column; gap: 5px; padding: 12px 13px; }
  .update-date { width: auto; }
}

/* ---------- 操作说明：键位表 ----------
   两列自适应排布，手机上一列。键帽用 <kbd>：下边框粗一点，看起来像真按键。 */
.keymap {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(266px, 1fr));
  gap: 0 28px; padding: 14px 18px; margin: 4px 0 0;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
}
.keymap-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 0; border-bottom: 1px dashed var(--hairline);
}
.keymap-label { font-size: .88rem; color: var(--text-dim); }
.keymap-keys { display: inline-flex; align-items: center; gap: 6px; flex: none; }
kbd {
  display: inline-block; min-width: 30px; padding: 3px 8px; text-align: center;
  font-family: var(--mono); font-size: .8rem; font-weight: 700; line-height: 1.45;
  color: var(--text); background: var(--panel-2);
  border: 1px solid var(--kbd-line); border-bottom-width: 3px; border-radius: 7px;
}
.keymap-note { margin: 10px 0 0; font-size: .84rem; color: var(--text-mute); }

/* ---------- 交流群二维码 ---------- */
.group-join {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  padding: 18px; border: 1px solid var(--line); border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(61, 220, 132, .08), rgba(34, 184, 207, .06)),
    var(--panel);
}
.group-qr {
  flex: none; width: 178px; height: 178px; padding: 8px;
  border-radius: 12px; background: #fff;
}
.group-text { flex: 1 1 250px; min-width: 0; }
.group-text h3 { margin: 0 0 8px; }
.group-text p { margin: 0 0 8px; font-size: .88rem; }
.group-text .group-note { font-size: .8rem; color: var(--text-mute); margin: 0; }
@media (max-width: 520px) {
  .group-join { flex-direction: column; text-align: center; gap: 16px; }
}

/* ---------- 分享游戏 ---------- */
.share-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.share-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border: 0; border-radius: 9px;
  font: inherit; font-size: .9rem; font-weight: 700; line-height: 1.2; color: #fff;
  cursor: pointer; text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.share-btn:hover { filter: brightness(1.1); text-decoration: none; }
.share-btn:active { transform: translateY(1px); }
.share-btn svg { width: 18px; height: 18px; flex: none; fill: currentColor; }
.share-wx { background: #07c160; }
.share-wb { background: #e6162d; }
.share-qq { background: #12b7f5; }
.share-copy { background: #5c6b7a; }

/* 微信分享用的二维码：白底、留够安静区，手机扫得出来 */
#share-qr {
  display: block; width: min(260px, 68vw); aspect-ratio: 1 / 1; height: auto;
  margin: 0 auto 14px; border-radius: 10px; background: #fff; image-rendering: pixelated;
}
#share-modal .modal-body { text-align: center; }
#share-modal p { font-size: .86rem; margin: 0 0 8px; }
#share-link { font-family: var(--mono); font-size: .78rem; word-break: break-all; color: var(--text-mute); }

/* ---------- 云端存档 ---------- */
.cloud-code {
  margin-top: 14px; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(61, 220, 132, .08), rgba(34, 184, 207, .06)), var(--panel);
}
.cloud-code-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.cloud-code-label { font-size: .82rem; color: var(--text-dim); }
#cloud-code-text {
  font-family: var(--mono); font-size: 1.4rem; letter-spacing: .16em; color: var(--accent);
  user-select: all; -webkit-user-select: all;
}
#cloud-code-text.cloud-code-empty { color: var(--text-mute); letter-spacing: .08em; }
.cloud-note { font-size: .8rem; line-height: 1.7; color: var(--text-mute); margin: 10px 0 0; }
.cloud-note b { color: var(--text-dim); }
.cloud-row { display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.cloud-row input {
  flex: 1 1 auto; min-width: 0; padding: 9px 12px;
  font: inherit; font-size: 1rem; font-family: var(--mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--text); background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.cloud-row input:focus { outline: none; border-color: var(--accent); }
.cloud-status { font-size: .82rem; margin: 12px 0 0; color: var(--text-dim); min-height: 1.2em; }
.cloud-status.cloud-ok { color: var(--accent); }
.cloud-status.cloud-bad { color: var(--danger); }
.cloud-list { margin-top: 12px; }
.cloud-list-title { font-size: .82rem; color: var(--text-dim); margin: 0 0 8px; }
.cloud-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; margin-bottom: 6px; font-size: .84rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-soft);
}
.cloud-item.mine { border-color: rgba(61, 220, 132, .5); }
.cloud-item-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cloud-item-meta { flex: none; font-size: .76rem; color: var(--text-mute); font-family: var(--mono); }
@media (max-width: 520px) {
  #cloud-code-text { font-size: 1.2rem; letter-spacing: .1em; }
  .cloud-item { flex-direction: column; align-items: flex-start; gap: 2px; }
}

/* 云存档面板里用 hidden 开关的按钮/区块：.btn、.btn-row 的 display 会盖掉 hidden 属性，
   这里补一条，免得「还没生成存档码」时那排按钮也露出来 */
#cloud-modal [hidden] { display: none; }


/* ---------- 摸鱼模式：老板键的封面 ----------
   故意不跟主题走。它要装成一张和游戏无关的中性页面（浅底灰字，像内部系统
   「会话超时」那种），跟着站点的深色主题反而显眼。 */
.stealth-cover {
  position: fixed; inset: 0; z-index: 2147483000;
  background: #f6f7f9; color: #495057;
  display: flex; align-items: center; justify-content: center;
  font: 14px/1.7 system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.stealth-cover[hidden] { display: none; }   /* 上面的 display:flex 会盖掉浏览器的默认 [hidden] */
.stealth-card { text-align: center; padding: 24px; }
.stealth-title { margin: 0 0 8px; font-size: 1.06rem; font-weight: 600; color: #343a40; }
.stealth-note { margin: 0; font-size: .84rem; color: #868e96; }
.stealth-note kbd {
  padding: 0 5px; border: 1px solid #ced4da; border-bottom-width: 2px; border-radius: 4px;
  background: #fff; font: inherit; font-size: .78rem; color: #495057;
}
