:root {
  --ink: #0b0d10;
  --paper: #f1eee6;
  --page: #f3f0e8;
  --text: #15171a;
  --surface: #fffdf8;
  --surface-soft: #e9e5db;
  --muted: #6e716d;
  --line: rgba(17, 20, 24, 0.16);
  --acid: #677500;
  --orange: #ff5c35;
  --panel: #fffdf8;
  color-scheme: light;
  font-family: "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
  background: var(--page);
  color: var(--text);
}

:root[data-theme="dark"] {
  --page: #0b0d10;
  --text: #f1eee6;
  --surface: #15181c;
  --surface-soft: #20242a;
  --muted: #8e928f;
  --line: rgba(255, 255, 255, 0.12);
  --acid: #f1ff3f;
  --panel: #14171b;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--text); background: var(--page); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  z-index: 10;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

.site-header, .player-header {
  height: 84px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(22px, 5vw, 80px);
  position: relative;
  z-index: 4;
}

.brand { display: flex; align-items: center; gap: 13px; }
.brand img { filter: drop-shadow(0 0 18px rgba(241, 255, 63, 0.12)); }
.brand span { display: grid; line-height: 1; }
.brand b { font: 800 24px/1 "Arial Narrow", Impact, sans-serif; letter-spacing: 0.06em; }
.brand small { margin-top: 5px; font: 600 9px/1 sans-serif; letter-spacing: 0.22em; color: var(--muted); }

.header-actions, .player-actions { display: flex; align-items: center; gap: 18px; }
.header-status { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #8dff69; box-shadow: 0 0 12px #8dff69; }

.theme-toggle {
  min-width: 76px;
  height: 36px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text);
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
}
.theme-toggle span { font-size: 17px; line-height: 1; }
.theme-toggle small { font-size: 11px; }
.theme-toggle:hover { border-color: var(--orange); }

main { overflow: hidden; }
.hero {
  min-height: 630px;
  padding: 84px clamp(22px, 7vw, 110px) 72px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  align-items: center;
  gap: 60px;
  position: relative;
  border-bottom: 1px solid var(--line);
}

.hero::before {
  content: "01";
  position: absolute;
  right: 2vw;
  top: -40px;
  font: 900 280px/1 "Arial Narrow", Impact, sans-serif;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, 0.035);
  pointer-events: none;
}

.eyebrow { margin: 0 0 16px; color: var(--acid); font: 700 12px/1 "Arial Narrow", Impact, sans-serif; letter-spacing: 0.24em; }
.hero h1 { margin: 0; max-width: 760px; font: 900 clamp(58px, 8vw, 112px)/0.86 "Arial Narrow", "Microsoft YaHei UI", sans-serif; letter-spacing: -0.025em; text-transform: uppercase; }
.hero h1 em { color: var(--acid); font-style: italic; }
.hero-description { max-width: 570px; margin: 32px 0 0; color: #a9adaa; font-size: 15px; line-height: 1.9; }
.hero-actions { margin-top: 34px; display: flex; align-items: center; gap: 28px; }

.primary-button, .secondary-button, .icon-button {
  border: 0;
  cursor: pointer;
  border-radius: 0;
  font-weight: 800;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 32px; min-height: 52px; padding: 0 22px; background: var(--acid); color: var(--ink); }
.primary-button:hover { transform: translateY(-2px); background: #fff; }
.primary-button:disabled { cursor: not-allowed; opacity: 0.45; transform: none; }
.secondary-button { min-height: 52px; padding: 0 22px; background: #2a2e33; color: var(--paper); }
.secondary-button:hover { background: #373c42; }
.text-link { padding: 12px 0; color: #c6c9c6; font-size: 13px; border-bottom: 1px solid #60635f; }
.text-link span { color: var(--acid); margin-left: 9px; }

.hero-machine {
  width: min(350px, 90%);
  margin: 0 auto;
  padding: 24px 22px 32px;
  background: linear-gradient(145deg, #20242a, #101215 65%);
  border: 1px solid #343940;
  box-shadow: 34px 38px 0 rgba(0, 0, 0, 0.2), 0 0 80px rgba(241, 255, 63, 0.04);
  transform: perspective(800px) rotateY(-5deg) rotateX(2deg);
}
.machine-top { height: 45px; display: grid; place-items: center; border: 1px solid #3a3f45; background: #0a0c0e; }
.machine-top span { color: var(--acid); font: 800 15px "Arial Narrow", Impact, sans-serif; letter-spacing: 0.2em; }
.machine-screen { width: 100%; margin-top: 16px; padding: 0; aspect-ratio: 4/3; position: relative; display: grid; align-content: center; justify-items: center; overflow: hidden; color: inherit; background: radial-gradient(circle at 50% 45%, #333a23 0, #11150e 52%, #030403 100%); border: 12px solid #08090a; box-shadow: inset 0 0 50px #000; cursor: pointer; }
.machine-screen::before { content: ""; position: absolute; inset: 9%; z-index: 3; border: 1px solid rgba(241, 255, 63, 0.25); transform: skew(-7deg); }
.machine-screen::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(3, 5, 3, 0.74)); pointer-events: none; }
.machine-screen-cover { position: absolute; inset: 0; z-index: 0; background-position: center; background-size: cover; opacity: 0; filter: saturate(0.85) contrast(1.12); transition: opacity 180ms ease, transform 500ms ease; }
.machine-screen.has-cover .machine-screen-cover { opacity: 0.72; transform: scale(1.04); }
.scanlines { position: absolute; inset: 0; z-index: 2; opacity: 0.18; background: repeating-linear-gradient(0deg, transparent 0 3px, #000 3px 5px); }
.screen-kicker { z-index: 4; color: #fff; font: 700 13px "Arial Narrow", Impact, sans-serif; letter-spacing: 0.4em; }
.machine-screen strong { z-index: 4; color: var(--acid); font: italic 900 64px/0.9 Impact, sans-serif; text-shadow: 5px 5px 0 var(--orange); }
.machine-screen small { z-index: 4; margin-top: 35px; color: #fff; font: 700 10px sans-serif; animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.machine-controls { height: 90px; padding: 25px 20px 0; display: flex; align-items: center; justify-content: flex-end; gap: 9px; background: linear-gradient(#272c31, #171a1e); border-bottom: 6px solid #090a0b; }
.machine-controls i { width: 17px; height: 45px; margin-right: auto; background: #08090a; border-radius: 5px; position: relative; }
.machine-controls i::before { content: ""; position: absolute; left: -12px; top: -14px; width: 41px; height: 17px; background: var(--orange); border-radius: 50%; }
.machine-controls b { width: 22px; height: 22px; border-radius: 50%; background: var(--acid); box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.22); }
.machine-controls b:nth-of-type(even) { background: var(--orange); }

.library { padding: 86px clamp(22px, 7vw, 110px) 110px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.section-heading h2, .setup-panel h2 { margin: 0; font: 900 clamp(40px, 5vw, 66px)/1 "Arial Narrow", "Microsoft YaHei UI", sans-serif; }
.library-count { display: flex; align-items: baseline; gap: 8px; }
.library-count strong { font: 800 42px/1 Impact, sans-serif; color: var(--acid); }
.library-count span { color: var(--muted); font-size: 12px; }
.library-tools { margin: 42px 0 34px; padding-bottom: 17px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.filter-list { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-button { padding: 8px 13px; color: #858a87; background: transparent; border: 1px solid transparent; cursor: pointer; font-size: 12px; }
.filter-button:hover { color: #fff; }
.filter-button.active { border-color: #646965; color: var(--acid); }
.search-box { width: min(270px, 40vw); display: flex; gap: 10px; align-items: center; color: var(--muted); }
.search-box input { width: 100%; border: 0; outline: 0; color: #fff; background: transparent; font-size: 12px; }
.search-box input::placeholder { color: #666b68; }

.resource-notice { margin-bottom: 28px; padding: 17px 20px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 15px; border: 1px solid rgba(241, 255, 63, 0.25); background: rgba(241, 255, 63, 0.045); }
.resource-notice > span { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); background: var(--acid); font-weight: 900; }
.resource-notice p { margin: 0; color: #9fa39f; font-size: 12px; }
.resource-notice strong { color: var(--paper); }
.resource-notice button { border: 0; background: transparent; color: var(--acid); cursor: pointer; font-size: 12px; }

.game-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.game-card { min-height: 365px; position: relative; display: flex; flex-direction: column; justify-content: end; overflow: hidden; border: 1px solid var(--line); background: #15181c; isolation: isolate; transition: transform 180ms ease, border-color 180ms ease; }
.game-card:hover { transform: translateY(-5px); border-color: rgba(241, 255, 63, 0.45); }
.game-card::before { content: attr(data-index); position: absolute; right: 12px; top: 0; z-index: -1; color: rgba(255, 255, 255, 0.035); font: 900 150px/1 Impact, sans-serif; }
.game-cover { position: absolute; inset: 0; z-index: -2; background-size: cover; background-position: center; opacity: 0.42; filter: saturate(0.7) contrast(1.1); }
.game-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11, 13, 16, 0.05), #111419 77%); }
.game-card-body { padding: 24px; }
.game-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #929692; font: 700 10px "Arial Narrow", sans-serif; letter-spacing: 0.14em; text-transform: uppercase; }
.availability { display: flex; align-items: center; gap: 6px; }
.availability i { width: 6px; height: 6px; border-radius: 50%; background: #666; }
.availability.ready { color: #b5d891; }
.availability.ready i { background: #8dff69; box-shadow: 0 0 9px rgba(141, 255, 105, 0.8); }
.availability.missing { color: #e09582; }
.availability.missing i { background: var(--orange); }
.game-card h3 { margin: 14px 0 9px; font: 900 34px/1 "Arial Narrow", "Microsoft YaHei UI", sans-serif; }
.game-card p { min-height: 43px; margin: 0; color: #909592; font-size: 12px; line-height: 1.75; }
.game-card-footer { margin-top: 22px; display: flex; align-items: center; justify-content: space-between; }
.game-card-footer span { color: #696e6a; font: 700 10px "Arial Narrow", sans-serif; letter-spacing: 0.1em; }
.play-button { width: 42px; height: 42px; display: grid; place-items: center; border: 0; cursor: pointer; color: var(--ink); background: var(--acid); font-size: 17px; }
.play-button:disabled { cursor: not-allowed; color: #777; background: #2a2e32; }
.skeleton-card { min-height: 365px; background: linear-gradient(100deg, #121519 20%, #1d2126 40%, #121519 60%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position-x: -200%; } }
.empty-state { margin: 70px 0; text-align: center; color: var(--muted); }

.setup-panel { max-width: 850px; margin: 0 auto 100px; padding: 45px; position: relative; color: #a4a8a5; border: 1px solid #34393d; background: #14171a; }
.setup-panel h2 { color: var(--paper); }
.setup-panel > p:last-child { margin: 28px 0 0; font-size: 12px; line-height: 1.8; }
.close-button { position: absolute; right: 17px; top: 13px; border: 0; background: transparent; color: #8c918e; cursor: pointer; font-size: 28px; }
.path-list { margin-top: 28px; display: grid; grid-template-columns: minmax(190px, auto) 1fr; gap: 1px; background: #32363a; border: 1px solid #32363a; }
.path-list code, .path-list span { padding: 13px 16px; background: #0d0f12; font-size: 12px; }
.path-list code { color: var(--acid); }

footer { min-height: 90px; padding: 0 clamp(22px, 7vw, 110px); display: flex; align-items: center; justify-content: space-between; gap: 30px; color: #5c615e; border-top: 1px solid var(--line); font: 700 9px sans-serif; letter-spacing: 0.14em; }

/* 首页固定在一个视口内，游戏列表只在自己的区域滚动。 */
.home-page { height: 100vh; overflow: hidden; }
.home-page .site-header {
  height: 76px;
  padding: 0;
  display: grid;
  grid-template-columns: clamp(250px, 22vw, 340px) minmax(0, 1fr);
  gap: 0;
  background: color-mix(in srgb, var(--page) 92%, transparent);
}
.home-page .brand { height: 100%; padding-left: clamp(24px, 4vw, 80px); border-right: 1px solid var(--line); }
.header-library {
  min-width: 0;
  height: 100%;
  padding: 0 clamp(24px, 3vw, 52px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(18px, 2vw, 34px);
}
.header-library .filter-list { flex: none; flex-wrap: nowrap; }
.header-library .filter-button { padding: 7px 10px; white-space: nowrap; }
.header-tools { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: clamp(9px, 1vw, 16px); }
.header-tools .search-box { width: clamp(132px, 12vw, 210px); }
.header-tools .catalog-status, .header-tools .header-status { gap: 7px; }
.header-tools .catalog-status { display: inline-flex; align-items: center; }
.header-tools .catalog-status .status-dot { background: #8dff69; box-shadow: 0 0 9px #8dff69; }
.home-main { height: calc(100vh - 76px); }
.arcade-layout {
  height: 100%;
  display: grid;
  grid-template-columns: clamp(250px, 22vw, 340px) minmax(560px, 1fr);
}
.machine-zone {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 2.4vh, 24px);
  padding: clamp(18px, 3vh, 30px) 8px;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(circle at 48% 44%, color-mix(in srgb, var(--orange) 10%, transparent), transparent 34%),
    linear-gradient(135deg, var(--surface), var(--page));
}
.machine-status { width: min(300px, 92%); }
.machine-status {
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 76%, transparent);
  box-shadow: 0 10px 26px color-mix(in srgb, var(--text) 5%, transparent);
}
.machine-status > span { display: flex; align-items: center; gap: 7px; color: var(--acid); font: 700 9px "Arial Narrow", sans-serif; letter-spacing: 0.2em; }
.machine-status > span i { width: 6px; height: 6px; border-radius: 50%; background: #76df55; box-shadow: 0 0 9px #76df55; }
.machine-status strong { margin-top: 8px; display: block; font-size: 16px; }
.machine-status strong b { color: var(--orange); font: 800 22px/1 Impact, sans-serif; }
.machine-status small { margin-top: 5px; display: block; color: var(--muted); font-size: 10px; }
.machine-zone .hero-machine {
  width: min(310px, calc(100% - 8px));
  margin: 0;
  transform: perspective(900px) rotateY(5deg) rotateX(1deg);
  box-shadow: -18px 22px 0 color-mix(in srgb, var(--text) 11%, transparent), 0 0 64px rgba(104, 87, 255, 0.1);
}
.interactive-machine { transition: transform 180ms ease, box-shadow 180ms ease; }
.interactive-machine:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 6px;
  transform: perspective(900px) rotateY(3deg) translateY(-2px);
}
.machine-zone .machine-screen { transition: background 180ms ease, box-shadow 180ms ease; }
.machine-zone .machine-screen:focus-visible { outline: 2px solid var(--orange); outline-offset: -5px; }
.machine-zone .machine-screen strong { max-width: 92%; text-align: center; transition: font-size 160ms ease, color 160ms ease; }
.machine-zone .machine-screen.is-preview { background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--acid) 28%, #15180d), #080a07 62%); box-shadow: inset 0 0 50px #000, 0 0 20px color-mix(in srgb, var(--acid) 22%, transparent); }
.machine-zone .machine-screen.is-preview strong {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: #fff;
  font: 900 24px/1.08 "Arial Narrow", "Microsoft YaHei UI", sans-serif;
  text-shadow: 3px 3px 0 color-mix(in srgb, var(--orange) 78%, transparent);
}
.machine-zone .machine-screen.is-preview small { margin-top: 18px; color: var(--acid); animation: none; letter-spacing: 0.16em; }
.machine-zone .machine-controls { justify-content: space-between; gap: 12px; }
.joystick-navigation { display: flex; align-items: center; gap: 5px; }
.joystick-navigation button,
.machine-action {
  display: grid;
  place-items: center;
  color: #fff;
  border: 0;
  cursor: pointer;
  box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.22);
  transition: transform 120ms ease, filter 120ms ease;
}
.joystick-navigation button { width: 22px; height: 28px; color: #bec879; background: #0a0c0e; font: 900 20px/1 sans-serif; }
.joystick-navigation button:hover,
.machine-action:hover { filter: brightness(1.16); transform: translateY(-2px); }
.joystick-navigation button:active,
.machine-action:active { transform: translateY(1px); }
.joystick { width: 15px; height: 39px; position: relative; display: block; border-radius: 5px; background: #08090a; }
.joystick::before { content: ""; width: 38px; height: 16px; position: absolute; left: -11px; top: -12px; border-radius: 50%; background: var(--orange); box-shadow: inset -3px -3px 0 rgba(0, 0, 0, 0.2); }
.machine-action { flex: none; width: 27px; height: 27px; border-radius: 50%; background: var(--acid); font: 900 11px/1 sans-serif; }
.machine-start { width: 50px; border-radius: 999px; color: #fff; background: var(--orange); font-size: 9px; }
.machine-action:disabled,
.machine-screen:disabled { cursor: not-allowed; opacity: 0.62; }
.home-page .library {
  min-width: 0;
  min-height: 0;
  padding: clamp(12px, 1.8vh, 18px) clamp(24px, 3vw, 52px);
  display: flex;
  flex-direction: column;
}
.home-page .section-heading h1 {
  margin: 0;
  font: 900 clamp(36px, 4vw, 58px)/0.95 "Arial Narrow", "Microsoft YaHei UI", sans-serif;
}
.home-page .library-tools { margin: 20px 0 16px; padding-bottom: 12px; }
.catalog-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.catalog-status { color: var(--muted); font-size: 10px; white-space: nowrap; }
.refresh-games {
  height: 34px;
  padding: 0 12px;
  color: var(--text);
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  font-size: 11px;
}
.refresh-games:hover { border-color: var(--orange); }
.refresh-games:disabled { cursor: wait; opacity: 0.65; }
.refresh-games.is-loading span { display: inline-block; animation: spin 0.8s linear infinite; }
.home-page .filter-button { color: var(--muted); }
.home-page .filter-button:hover { color: var(--text); }
.home-page .filter-button.active { color: var(--text); border-color: var(--line); background: var(--surface); }
.home-page .search-box input { color: var(--text); }
.home-page .search-box input::placeholder { color: var(--muted); }
.home-page .game-grid {
  flex: 1;
  min-height: 0;
  padding: 4px 10px 12px 4px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  grid-auto-rows: 270px;
  align-content: start;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--orange) 72%, var(--surface)) transparent;
}
.home-page .game-grid::-webkit-scrollbar { width: 9px; }
.home-page .game-grid::-webkit-scrollbar-track { background: transparent; }
.home-page .game-grid::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: color-mix(in srgb, var(--orange) 72%, var(--surface));
  background-clip: padding-box;
}
.home-page .game-grid::-webkit-scrollbar-thumb:hover { background-color: var(--orange); }
.home-page .game-card {
  min-height: 0;
  color: var(--text);
  border-color: var(--line);
  background: var(--surface);
  box-shadow: 0 10px 30px color-mix(in srgb, var(--text) 7%, transparent);
}
.home-page .game-card:hover { transform: translateY(-3px); box-shadow: 0 15px 36px color-mix(in srgb, var(--text) 12%, transparent); }
.home-page .game-card.is-machine-selected { border-color: color-mix(in srgb, var(--orange) 82%, var(--line)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--orange) 24%, transparent), 0 14px 34px color-mix(in srgb, var(--orange) 12%, transparent); }
.home-page .game-card.is-random-pick { border-color: var(--orange); animation: random-pick 0.6s ease 3; }
@keyframes random-pick { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--orange) 24%, transparent), 0 18px 40px color-mix(in srgb, var(--orange) 18%, transparent); } }
.home-page .game-card::before { color: color-mix(in srgb, var(--text) 6%, transparent); }
.home-page .game-cover { opacity: 0.58; filter: saturate(0.86) contrast(1.05); }
.home-page .game-cover::after { background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 3%, transparent), var(--surface) 80%); }
.home-page .game-card-body { padding: 20px; }
.home-page .game-card h3 { margin: 10px 0 7px; font-size: clamp(25px, 2vw, 31px); }
.home-page .game-card p {
  min-height: 39px;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.home-page .game-card-footer { margin-top: 14px; }
.home-page .game-edition { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: color-mix(in srgb, var(--text) 72%, var(--muted)); }
.home-page .game-card p, .home-page .game-meta, .home-page .game-card-footer span { color: var(--muted); }
.home-page .availability.ready { color: #397728; }
:root[data-theme="dark"] .home-page .availability.ready { color: #b5d891; }
.home-page .play-button { color: #fff; background: var(--orange); }
.home-page .play-button:disabled { color: var(--muted); background: var(--surface-soft); }
.home-page .resource-notice { margin-bottom: 18px; }
.home-page .resource-notice p { color: var(--muted); }
.home-page .resource-notice strong { color: var(--text); }
.home-page .resource-notice > span { color: #fff; background: var(--orange); }
.home-page .resource-notice button { color: var(--text); }
.home-page .skeleton-card { min-height: 0; background: linear-gradient(100deg, var(--surface) 20%, var(--surface-soft) 40%, var(--surface) 60%); background-size: 200% 100%; }
.home-page .setup-panel {
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  margin: 0;
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 20;
  transform: translate(-50%, -50%);
  overflow: auto;
  color: var(--muted);
  border-color: var(--line);
  background: var(--surface);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.3);
}
.home-page .setup-panel h2 { color: var(--text); }
.home-page .path-list { border-color: var(--line); background: var(--line); }
.home-page .path-list code, .home-page .path-list span { color: var(--text); background: var(--page); }
.home-page .path-list code { color: var(--orange); }

/* 游戏页固定在动态可视区内，避免手机地址栏变化或操作虚拟摇杆时把顶部工具栏滚出屏幕。 */
.player-root { height: 100%; overflow: hidden; overscroll-behavior: none; }
.player-page {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-rows: 68px minmax(0, 1fr);
  background: var(--page);
  overflow: hidden;
  overscroll-behavior: none;
}
.player-header { height: 68px; padding-inline: clamp(16px, 3vw, 44px); background: var(--surface); }
.back-link { color: var(--muted); font-size: 12px; }
.back-link:hover { color: var(--acid); }
.back-link span { margin-left: 8px; }
.player-title { display: grid; justify-items: center; }
.player-title span { color: var(--acid); font: 700 9px "Arial Narrow", sans-serif; letter-spacing: 0.2em; }
.player-title strong { margin-top: 4px; font: 700 15px "Noto Sans SC"; }
.icon-button { padding: 8px 14px; color: var(--text); border: 1px solid var(--line); background: transparent; font-size: 11px; }
.icon-button:hover { color: var(--ink); background: var(--acid); }
.player-main { height: auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) var(--player-help-width, 280px); }
.emulator-shell { min-width: 0; min-height: 0; position: relative; display: grid; place-items: center; overflow: hidden; overscroll-behavior: none; background: #000; }
#game { width: 100%; height: 100%; min-height: 0; }
/* 只拦截虚拟手柄区域的浏览器平移，模拟器设置等可滚动面板仍保持原有触控行为。 */
#game .ejs_virtualGamepad_parent { touch-action: none; overscroll-behavior: none; }
.boot-panel, .resume-panel, .error-panel { position: absolute; inset: 0; z-index: 5; display: grid; place-content: center; justify-items: center; padding: 28px; color: #f1eee6; text-align: center; background: radial-gradient(circle, #171b15, #050607 55%); }
.boot-panel h1, .resume-panel h2, .error-panel h2 { margin: 0; font: 900 clamp(32px, 4vw, 58px)/1 "Arial Narrow", "Microsoft YaHei UI", sans-serif; }
.boot-panel > p:last-child, .resume-panel > p, .error-panel > p { max-width: 560px; margin: 18px auto 0; color: #898e8a; font-size: 13px; line-height: 1.8; }
.loader-ring { width: 56px; height: 56px; margin-bottom: 34px; border-radius: 50%; border: 2px solid #2c302b; border-top-color: var(--acid); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.resume-panel > div { margin-top: 28px; display: flex; gap: 10px; }
.error-panel > span { width: 50px; height: 50px; margin-bottom: 25px; display: grid; place-items: center; border: 2px solid var(--orange); border-radius: 50%; color: var(--orange); font-size: 26px; font-weight: 900; }
.error-panel .primary-button { margin-top: 28px; }
.player-help { min-height: 0; position: relative; display: flex; flex-direction: column; overflow: hidden; color: var(--text); border-left: 1px solid var(--line); background: var(--surface); container-name: player-tools; container-type: inline-size; }
.player-help > .help-card { flex: none; margin-inline: 20px; }
.player-help-resizer { width: 11px; position: absolute; inset: 0 auto 0 -6px; z-index: 6; cursor: col-resize; touch-action: none; outline: 0; }
.player-help-resizer::after { content: ""; width: 2px; height: 52px; position: absolute; left: 5px; top: 50%; border-radius: 2px; background: var(--line); transform: translateY(-50%); transition: height 160ms ease, background 160ms ease; }
.player-help-resizer:hover::after, .player-help-resizer:focus-visible::after, .is-resizing-help .player-help-resizer::after { height: 92px; background: var(--acid); }
.is-resizing-help, .is-resizing-help * { cursor: col-resize !important; user-select: none !important; }
.help-card { padding: 15px 3px 12px; border-bottom: 1px solid var(--line); }
.help-card h2 { margin: 0; font: 900 20px "Arial Narrow", "Microsoft YaHei UI", sans-serif; }
.quick-guide-heading { display: flex; align-items: end; justify-content: space-between; gap: 10px; }
.quick-guide-heading .eyebrow { margin-bottom: 4px; font-size: 8px; }
.help-card dl { margin: 11px 0 8px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.help-card dl div { min-width: 0; padding: 5px 0; display: flex; justify-content: space-between; gap: 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.055); }
.help-card dt { color: #7a7f7b; font-size: 11px; }
.help-card dd { margin: 0; color: var(--text); font: 700 11px monospace; letter-spacing: 0.08em; }
.quick-guide-note { margin: 0; color: #777c78; font-size: 9px; line-height: 1.55; }
.save-indicator { margin: 0; display: flex; align-items: center; gap: 7px; color: #858a86; font-size: 9px; white-space: nowrap; }
.save-indicator i { width: 6px; height: 6px; border-radius: 50%; background: #666; }
.save-indicator.active { color: #aad28f; }
.save-indicator.active i { background: #8dff69; box-shadow: 0 0 8px #8dff69; }

.move-list-trigger { display: none; border: 1px solid var(--line); }
.move-list-dialog {
  width: min(900px, calc(100vw - 40px));
  height: min(88vh, 920px);
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  color: var(--text);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.42);
}
.move-list-dialog::backdrop { background: rgba(3, 5, 6, 0.72); backdrop-filter: blur(5px); }
.move-list-sheet { height: 100%; padding: clamp(22px, 4vw, 42px); overflow-y: auto; overscroll-behavior: contain; scrollbar-color: var(--acid) transparent; scrollbar-width: thin; }
.move-list-sheet::-webkit-scrollbar { width: 7px; }
.move-list-sheet::-webkit-scrollbar-track { background: transparent; }
.move-list-sheet::-webkit-scrollbar-thumb { background: var(--acid); }
.move-list-sheet > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; }
.move-list-sheet h2 { margin: 0; font: 900 clamp(30px, 4vw, 48px)/1 "Arial Narrow", "Microsoft YaHei UI", sans-serif; }
.move-list-sheet header div > p:last-child { max-width: 620px; margin: 12px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.move-list-close { flex: none; width: 38px; height: 38px; color: var(--text); border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 25px; line-height: 1; }
.move-list-close:hover { color: var(--ink); border-color: var(--acid); background: var(--acid); }
.move-list-legend { margin-top: 24px; padding: 16px 18px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; border-left: 3px solid var(--acid); background: var(--surface-soft); font-size: 11px; }
.move-list-legend strong { color: var(--acid); letter-spacing: 0.08em; }
.move-list-legend span { font-family: monospace; font-weight: 700; }
.move-list-legend small { width: 100%; color: var(--muted); line-height: 1.65; }
.move-list-search { min-height: 46px; margin-top: 20px; padding: 0 15px; display: flex; align-items: center; gap: 11px; border: 1px solid var(--line); background: var(--page); }
.move-list-search:focus-within { border-color: var(--acid); box-shadow: 0 0 0 2px color-mix(in srgb, var(--acid) 18%, transparent); }
.move-list-search span { color: var(--acid); font-size: 21px; }
.move-list-search input { width: 100%; padding: 10px 0; color: var(--text); border: 0; outline: 0; background: transparent; font-size: 13px; }
.move-list-search input::placeholder { color: var(--muted); }
.move-list-shortcuts {
  margin-top: 12px;
  padding-bottom: 7px;
  display: flex;
  flex-wrap: nowrap;
  gap: 7px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline proximity;
  scrollbar-color: var(--acid) transparent;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.move-list-shortcuts::-webkit-scrollbar { height: 5px; }
.move-list-shortcuts::-webkit-scrollbar-track { background: transparent; }
.move-list-shortcuts::-webkit-scrollbar-thumb { border-radius: 999px; background: var(--acid); }
.move-list-shortcuts button { flex: none; scroll-snap-align: start; padding: 6px 10px; color: var(--muted); border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 10px; }
.move-list-shortcuts button:hover, .move-list-shortcuts button.is-active { color: var(--ink); border-color: var(--acid); background: var(--acid); }
.move-list-result-count { margin: 20px 0 10px; color: var(--muted); font-size: 10px; letter-spacing: 0.08em; }
.move-list-results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.move-list-results.is-empty::after { content: "换个人物名称或招式名称试试"; grid-column: 1 / -1; padding: 45px 20px; color: var(--muted); border: 1px dashed var(--line); text-align: center; font-size: 12px; }
.move-character { border: 1px solid var(--line); background: var(--page); }
.move-character h3 { margin: 0; padding: 14px 16px; color: var(--ink); background: var(--acid); font: 900 20px "Arial Narrow", "Microsoft YaHei UI", sans-serif; }
.move-character-note { margin: 0; padding: 9px 16px; color: var(--muted); background: var(--surface-soft); border-bottom: 1px solid var(--line); font-size: 10px; line-height: 1.6; }
.move-row { padding: 12px 15px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; border-top: 1px solid var(--line); }
.move-row:first-of-type { border-top: 0; }
.move-row > div { min-width: 0; display: flex; align-items: baseline; gap: 8px; }
.move-row strong { font-size: 12px; }
.move-row div span { color: var(--muted); font-size: 9px; white-space: nowrap; }
.move-row code { align-self: center; color: var(--orange); font-size: 12px; font-weight: 800; white-space: nowrap; }
.move-row small { grid-column: 1 / -1; color: var(--muted); font-size: 9px; }

.move-list-desktop { min-height: 0; flex: 1; overflow: hidden; border-top: 1px solid var(--line); background: var(--surface); }
.move-list-desktop .move-list-sheet { padding: 12px 20px 18px; }
.move-list-desktop .move-list-sheet > header { gap: 12px; }
.move-list-desktop .move-list-sheet .eyebrow { margin-bottom: 4px; font-size: 8px; }
.move-list-desktop .move-list-sheet h2 { font-size: 21px; }
.move-list-desktop .move-list-sheet header div > p:last-child { display: none; }
.move-list-desktop .move-list-close { display: none; }
.move-list-desktop .move-list-legend { margin-top: 8px; padding: 7px 9px; gap: 3px 8px; font-size: 9px; }
.move-list-desktop .move-list-legend strong { width: 100%; }
.move-list-desktop .move-list-legend small { font-size: 8px; line-height: 1.4; }
.move-list-desktop .move-list-search { min-height: 34px; margin-top: 8px; padding-inline: 10px; }
.move-list-desktop .move-list-search span { font-size: 16px; }
.move-list-desktop .move-list-search input { padding-block: 7px; font-size: 11px; }
.move-list-desktop .move-list-shortcuts { margin-top: 6px; gap: 4px; }
.move-list-desktop .move-list-shortcuts button { flex: none; padding: 4px 7px; }
.move-list-desktop .move-list-result-count { margin: 8px 0 5px; }
.move-list-desktop .move-list-results { grid-template-columns: 1fr; }
.move-list-desktop .move-character h3 { padding: 8px 11px; font-size: 16px; }
.move-list-desktop .move-character-note { padding: 5px 11px; font-size: 9px; line-height: 1.45; }
.move-list-desktop .move-row { padding: 6px 10px; gap: 2px 8px; }
.move-list-desktop .move-row strong { font-size: 11px; }
.move-list-desktop .move-row code { font-size: 10px; }
.move-list-desktop .move-row small { font-size: 8px; line-height: 1.3; }

@container player-tools (min-width: 520px) {
  .quick-guide-heading { align-items: center; }
  .help-card dl { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 16px; }
  .help-card dl div { display: grid; gap: 2px; }
  .move-list-desktop .move-list-results { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 70px; }
  .hero .hero-machine { display: none; }
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .player-main { grid-template-columns: 1fr; }
  .player-help { display: none; }
  .move-list-trigger:not([hidden]) { display: inline-flex; }
  .move-list-dialog { width: min(900px, calc(100vw - 28px)); height: min(90vh, 920px); }
}

@media (max-width: 1040px) {
  .home-page .site-header { grid-template-columns: 240px minmax(0, 1fr); }
  .home-page .brand { padding-left: 20px; }
  .home-page .brand small, .header-library .catalog-status { display: none; }
  .header-library { gap: 10px; }
  .header-library .filter-button { padding-inline: 7px; }
  .header-library .search-box { width: 120px; }
  .home-page .header-status { display: none; }
  .arcade-layout { grid-template-columns: 240px minmax(460px, 1fr); }
  .machine-zone { padding: 18px 8px; }
  .machine-zone .hero-machine { width: min(224px, calc(100% - 8px)); padding: 17px 15px 21px; }
  .machine-status { width: min(220px, 92%); }
  .machine-status small { display: none; }
  .machine-controls { height: 68px; padding-top: 18px; }
  .home-page .game-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); grid-auto-rows: 250px; }
  .home-page .game-card p { min-height: 0; }
}

@media (max-width: 760px) {
  .home-page { height: auto; min-height: 100vh; overflow: auto; }
  .home-main { height: auto; min-height: calc(100vh - 148px); }
  .arcade-layout { display: block; }
  .machine-zone { display: none; }
  .home-page .site-header {
    height: 148px;
    padding: 8px 16px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 44px 44px 40px;
    gap: 4px;
  }
  .home-page .brand { grid-column: 1 / -1; grid-row: 1; padding: 0; border-right: 0; }
  .header-library { display: contents; }
  .header-library .filter-list { width: 100%; min-width: 0; grid-row: 3; flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: none; }
  .header-library .filter-list::-webkit-scrollbar { display: none; }
  .header-tools { width: 100%; min-width: 0; grid-row: 2; justify-content: stretch; gap: 8px; border-top: 1px solid var(--line); }
  .home-page .header-tools .search-box { width: auto; min-width: 0; flex: 1; padding: 7px 10px; border: 1px solid var(--line); background: var(--surface); }
  .header-library .refresh-games { width: 34px; padding: 0; overflow: hidden; font-size: 0; }
  .header-library .refresh-games span { font-size: 13px; }
  .home-page .library { min-height: calc(100vh - 148px); padding: 12px 12px 28px; }
  .home-page .game-grid { gap: 10px; overflow: visible; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 220px; padding: 0; }
  .home-page .game-card-body { padding: 12px; }
  .home-page .game-card h3 { min-height: 38px; margin: 8px 0 6px; display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: clamp(17px, 5.3vw, 21px); line-height: 1.05; }
  .home-page .game-card p { display: none; }
  .home-page .game-card-footer { margin-top: 8px; }
  .home-page .game-meta, .home-page .game-card-footer span { font-size: 8px; }
  .home-page .play-button { width: 34px; height: 34px; }
  .catalog-actions { flex-wrap: wrap; }
  .catalog-status { display: none; }
  .header-status { display: none; }
}

@media (max-height: 700px) and (min-width: 761px) {
  .machine-zone .hero-machine { width: min(310px, 82%); padding: 18px 17px 22px; }
  .machine-controls { height: 66px; padding-top: 18px; }
  .home-page .library { padding-block: 10px; }
  .home-page .section-heading h1 { font-size: 40px; }
  .home-page .library-tools { margin-block: 16px 13px; }
  .home-page .game-grid { grid-auto-rows: minmax(210px, 1fr); }
  .home-page .game-card-body { padding: 18px; }
  .home-page .game-card h3 { margin-block: 9px 6px; font-size: 28px; }
  .home-page .game-card-footer { margin-top: 13px; }
}

@media (max-width: 620px) {
  .site-header { height: 70px; }
  .header-status span:last-child { display: none; }
  .hero { min-height: 520px; padding-top: 55px; }
  .hero h1 { font-size: clamp(52px, 17vw, 78px); }
  .hero-actions { align-items: stretch; flex-direction: column; gap: 12px; }
  .text-link { text-align: center; }
  .library { padding-top: 65px; }
  .library-tools { align-items: stretch; flex-direction: column; }
  .catalog-actions { justify-content: stretch; }
  .catalog-actions .search-box { flex: 1; width: auto; }
  .search-box { width: 100%; padding: 10px 2px; border-top: 1px solid var(--line); }
  .game-grid { grid-template-columns: 1fr; }
  .game-card { min-height: 330px; }
  .library-count { display: none; }
  .resource-notice { grid-template-columns: auto 1fr; }
  .resource-notice button { grid-column: 2; justify-self: start; padding: 0; }
  .setup-panel { margin-inline: 16px; padding: 32px 20px; }
  .path-list { grid-template-columns: 1fr; }
  .path-list span { padding-top: 4px; color: #777; }
  footer { align-items: flex-start; flex-direction: column; justify-content: center; gap: 8px; }
  .player-title { max-width: 47vw; }
  .player-title strong { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .back-link span { display: none; }
  .player-actions { gap: 6px; }
  .player-header .theme-toggle { min-width: 38px; padding-inline: 9px; }
  .player-header .theme-toggle small { display: none; }
  .player-header { padding-inline: 12px; }
  .player-title { max-width: 35vw; }
  .player-actions .icon-button { padding-inline: 9px; }
  .move-list-dialog { width: 100vw; max-height: none; height: 100dvh; border: 0; }
  .move-list-sheet { height: 100%; padding: 24px 16px; }
  .move-list-results { grid-template-columns: 1fr; }
  .move-row { grid-template-columns: minmax(0, 1fr); }
  .move-row code { justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
