:root {
  color-scheme: light;
  --ink: #17244a;
  --paper: #f5eedb;
  --muted: #55584e;
  --line: #adb0a1;
  --orange: #b94226;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 4px 7px, #8b735521 0 .55px, transparent .9px) 0 0/23px 19px, var(--paper); }
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 3px solid #2764c7; outline-offset: 3px; }
[hidden] { display: none !important; }
.poster { overflow: hidden; background: linear-gradient(126deg,#182c56,#223d74 72%,#192e5b); position: relative; border-bottom: 5px solid #f1bd58; }
.poster::after { content:""; position:absolute; bottom:0; left:0; height:4px; width:24%; background:#ef6433; transform:skewX(-30deg); }
.poster-inner { position:relative; width:min(100%,1536px); margin:auto; height:clamp(356px,32.5vw,492px); isolation:isolate; }
.poster-inner::before { content:""; position:absolute; inset:13% 62% 0 0; background:radial-gradient(#a3badb39 .7px,transparent 1px) 0 0/5px 5px; clip-path:polygon(0 0,100% 0,28% 100%,0 100%); }
.room { position:absolute; z-index:-1; right:-1%; top:50%; width:auto; height:115.4%; transform:translateY(-50%); mask-image:linear-gradient(to right,transparent,#000 15%); }
.imprint { display:flex; align-items:center; gap:11px; position:absolute; top:7%; left:4.5%; color:#fff1cf; font:900 clamp(10px,1.15vw,17px)/1 "Avenir Next",Arial,sans-serif; letter-spacing:.1em; text-transform:uppercase; }
.imprint i { display:inline-block; height:1em; width:2.15em; transform:skewX(-28deg); background:repeating-linear-gradient(to right,#f4bc55 0 23%,transparent 23% 36%); }
h1,h2,h3,p { margin:0; }
.wordmark { position:absolute; width:auto; height:63%; top:18.5%; left:4.2%; object-fit:contain; }
.jump, .back-link { display:inline-flex; align-items:center; justify-content:center; gap:9px; min-height:44px; padding:5px 15px; border:1px solid #bec6bd; background:#16294bea; color:#fff2d9; font-size:14px; font-weight:650; border-radius:24px; }
.jump { position:absolute; left:4.6%; bottom:5.2%; }
.jump span { color:#f9c56e; font-size:19px; }
.trim { position:absolute; bottom:0; left:0; width:30%; height:15px; pointer-events:none; background:linear-gradient(125deg,#14274c 0 88%,transparent 88% 90%,#f5bd61 90% 92%,transparent 92% 94%,#f5bd61 94% 95%,transparent 95%); }
.shelf { max-width:1536px; margin:auto; padding:38px 5.2% 52px 4.6%; display:grid; grid-template-columns:minmax(145px,16.8%) minmax(0,1fr); gap:14px; }
.shelf-heading h2 { font-size:clamp(34px,3.35vw,50px); line-height:1.2; letter-spacing:-.065em; }
.shelf-heading span { display:block; font-size:16px; font-weight:550; color:var(--muted); margin:16px 0 23px 2px; }
.shelf-heading span::before { content:"共 "; }
.shelf-heading::after { content:""; display:block; width:110px; height:8px; background:repeating-linear-gradient(115deg,transparent 0 3px,#17244a30 3px 4px,transparent 4px 5px); }
.rows { border-top:2px solid var(--ink); }
.game-row { display:grid; grid-template-columns:minmax(106px,18%) minmax(210px,31%) minmax(125px,1fr) auto; grid-template-rows:auto auto; grid-template-areas:"art name copy key" "art name direction key"; align-content:center; align-items:center; column-gap:10px; row-gap:8px; min-height:121px; padding:10px 0; border-bottom:1px solid var(--line); transition:background .15s; }
.cartridge { grid-area:art; width:min(100%,141px); height:auto; justify-self:center; transition: transform .17s ease; }
.identity { grid-area:name; display:flex; flex-direction:column; gap:9px; min-width:0; }
.game-title,.game-name { font:800 clamp(26px,2.55vw,40px)/1.16 "Songti SC","STSong","SimSun",serif; }
[data-game="town"] .game-title,[data-game="town"] .game-name { font-family:Georgia,"Times New Roman",serif; font-style:italic; }
.subtitle, .description { font-size:15px; }
.subtitle,.orientation { color:var(--muted); }
.description { grid-area:copy; align-self:end; }
.orientation { grid-area:direction; align-self:start; display:flex; align-items:center; gap:7px; font-size:14px; }
.direction::after { content:"游玩"; }
.mobile-genre { display:none; }
.device { width:17px; height:11px; border:1.5px solid currentColor; border-radius:2px; display:inline-grid; align-items:center; justify-items:end; padding:1px; }
.device::after { content:""; width:1px; height:5px; background:currentColor; }
[data-game="town"] .device { width:10px; height:15px; align-items:end; justify-items:center; }
[data-game="town"] .device::after { width:4px; height:1px; }
.play-key, .action { border:1px solid #893520; background:var(--orange); color:#fff3d7; box-shadow:inset 0 1px #e7a171,0 3px #81351f; border-radius:5px; font-weight:680; }
.play-key { grid-area:key; display:flex; align-items:center; justify-content:center; gap:8px; padding:0 15px; min-height:44px; font-size:17px; }
.play-key i { width:0; height:0; border-top:6px solid transparent; border-bottom:6px solid transparent; border-left:9px solid currentColor; }
@media (hover:hover) { .game-row:hover { background:#e9ddbd60; } .game-row:hover .cartridge { transform:translateY(-3px) rotate(-1deg); } .jump:hover,.back-link:hover { background:#283f65; } }
.game-row:active .play-key,.action:active { transform:translateY(2px); box-shadow:inset 0 1px #e7a171,0 1px #81351f; }
@media (min-width:651px) and (max-width:959px) {
  .shelf { display:block; padding:24px 5% 40px; }
  .shelf-heading { display:flex; align-items:baseline; justify-content:space-between; margin-bottom:12px; }
  .shelf-heading span { margin:0; } .shelf-heading::after { display:none; }
  .game-row { grid-template-columns:15% 29% 1fr auto; }
  .wordmark { height:53%; } .room { right:-14%; }
}
@media (max-width:650px) {
  .poster-inner { height:clamp(278px,96vw,470px); }
  .poster-inner::before { display:none; }
  .room { right:-3.6%; top:15.5%; width:113.6%; height:auto; transform:none; mask-image:linear-gradient(to bottom,transparent,#000 20%); }
  .wordmark { width:45.6%; height:auto; left:3.4%; top:12.3%; max-width:220px; }
  .imprint { top:max(18px,var(--safe-top)); left:5%; font-size:clamp(8px,2.25vw,12px); gap:7px; }
  .jump { right:3.7%; left:auto; top:max(2px,var(--safe-top)); bottom:auto; min-height:44px; font-size:12px; padding:3px 11px; }
  .trim { width:100%; height:7.4%; background:radial-gradient(#a3badb38 .7px,transparent 1px) 0 0/5px 5px,#273a67; }
  .trim::after { content:""; position:absolute; bottom:0; width:36%; height:12px; background:linear-gradient(125deg,#14274c 0 78%,transparent 78% 81%,#f5bd61 81% 85%,transparent 85% 89%,#f5bd61 89% 92%,transparent 92%); }
  .shelf { display:block; padding:24px 4.9% max(40px,var(--safe-bottom)); }
  .shelf-heading { display:flex; align-items:baseline; justify-content:space-between; margin-bottom:10px; }
  .shelf-heading h2 { font-size:34px; }
  .shelf-heading span { margin:0; font-size:14px; }
  .shelf-heading span::before,.shelf-heading::after,.direction::after { content:none; }
  .game-row { min-height:153px; grid-template-columns:28% minmax(0,1fr) 50px; grid-template-rows:auto auto auto; grid-template-areas:"art name key" "art direction key" "art copy copy"; column-gap:9px; row-gap:6px; padding:16px 0; }
  .cartridge { align-self:center; justify-self:start; width:106%; max-width:132px; margin-left:-4%; }
  .identity { gap:4px; }
  .game-title { font-size:clamp(21px,6.1vw,29px); }
  .subtitle,.description { font-size:13px; }
  .description { color:var(--muted); }
  .orientation { font-size:12.5px; color:var(--ink); min-height:20px; }
  .device { color:var(--muted); }
  .desktop-genre { display:none; } .mobile-genre { display:inline; }
  .play-key { flex-direction:column; gap:2px; width:50px; min-height:49px; font-size:13px; padding:4px; }
}
@media (max-width:350px) { .game-row { grid-template-columns:24% 1fr 44px; column-gap:6px; } .play-key { width:44px; } }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { transition:none !important; animation:none !important; scroll-behavior:auto !important; } }
.offline-tools { grid-column:2; display:flex; align-items:center; flex-wrap:wrap; gap:6px 12px; padding-top:10px; font-size:13px; color:var(--muted); }
.offline-tools button { font:inherit; min-height:44px; padding:4px 7px; border:0; background:transparent; color:var(--ink); text-decoration:underline; text-underline-offset:4px; }
.offline-tools button:disabled { opacity:.6; }
.install-panel { background:#f4dfac; border-bottom:1px solid #c3aa77; }
.install-inner { max-width:1536px; margin:auto; padding:12px 5.2% 12px 4.6%; display:grid; grid-template-columns:auto 1fr auto; gap:5px 14px; align-items:center; }
.install-inner img { border-radius:9px; }
.install-copy { display:grid; gap:3px; }
.install-copy strong { font-size:17px; }
.install-copy span,#install-help { font-size:13px; line-height:1.5; color:#514831; }
#install-app { border:1px solid #17244a; border-radius:5px; min-height:44px; padding:6px 16px; background:#253d69; box-shadow:0 3px #142444; color:#fff3d7; font-weight:700; }
#install-app span { color:#f7c968; }
#install-app:active { transform:translateY(2px); box-shadow:0 1px #142444; }
#install-help { grid-column:2 / -1; }
#already-installed { border:0; min-height:44px; background:transparent; padding:4px 0; color:var(--ink); text-decoration:underline; text-underline-offset:3px; }
@media(max-width:650px) {
  .install-inner { gap:5px 9px; padding:10px 4.9%; }
  .install-inner img { width:32px; height:32px; border-radius:6px; }
  .install-copy strong { font-size:15px; } .install-copy span { font-size:12px; }
  #install-app { padding:5px 10px; font-size:14px; }
  #install-help { grid-column:1 / -1; padding-top:5px; }
}
@media(max-width:959px) { .offline-tools { margin-top:8px; } }

.game-version,#club-version { font-size:12px; color:var(--muted); font-variant-numeric:tabular-nums; }
.game-version:empty,.cache-meter:has(progress[hidden]) { display:none; }
.cache-meter { display:flex; align-items:center; flex-wrap:wrap; width:100%; gap:6px 12px; font-variant-numeric:tabular-nums; }
#cache-progress { max-width:280px; flex:1 1 120px; }
