/* ============================================================
   games.css — themed pages for four visual novels (v13)
   ============================================================ */

/* ---------- shared ---------- */
body[data-game] {
  background: var(--g-bg);
  color: var(--g-ink);
}
body[data-game] .head {
  background: color-mix(in srgb, var(--g-bg) 88%, transparent);
  border-bottom-color: var(--g-line);
}
body[data-game] .brand-name { color: var(--g-ink); }
body[data-game] .nav a { color: var(--g-muted); }
body[data-game] .nav a:hover { color: var(--g-ink); }
body[data-game] .nav .nav-mail { background: var(--g-ink); color: var(--g-bg); }
body[data-game] .theme { color: var(--g-ink); border-color: var(--g-line); }
body[data-game] .foot { border-top-color: var(--g-line); color: var(--g-muted); }
body[data-game] .foot-mark { color: var(--g-ink); }
body[data-game] .foot a { color: var(--g-muted); }
body[data-game] .progress { background: var(--g-accent); }

.gwrap { width: min(1180px, calc(100% - 64px)); margin: 0 auto; }

body[data-game] .theme { display: none; }

/* ---------- hero ---------- */
.ghero {
  position: relative;
  min-height: 94vh;
  display: flex;
  align-items: flex-end;
  padding: 160px 0 72px;
  overflow: hidden;
  isolation: isolate;
}
.ghero-bg { position: absolute; inset: 0; z-index: -2; }
.ghero-bg img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); }
.ghero::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(0,0,0,.18) 0%, rgba(0,0,0,.05) 34%, rgba(0,0,0,.62) 100%);
}
.ghero-in { width: min(1180px, calc(100% - 64px)); margin: 0 auto; color: #fff; }
.gkicker {
  font-family: var(--mono, "Space Grotesk", monospace);
  font-size: 11px; letter-spacing: .3em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 12px; border: 1px solid rgba(255,255,255,.42);
  backdrop-filter: blur(6px);
}
.gkicker i { width: 5px; height: 5px; background: currentColor; border-radius: 50%; }
.gtitle { margin: 28px 0 0; font-weight: 700; line-height: .92; }
.gtitle .gen {
  display: block;
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(48px, 9.2vw, 142px);
  letter-spacing: -.045em;
  text-transform: uppercase;
}
.gtitle .gcn {
  display: block; margin-top: 14px;
  font-family: var(--g-serif);
  font-size: clamp(20px, 2.6vw, 34px);
  letter-spacing: .14em; font-weight: 500;
}
.gquote {
  margin: 30px 0 0; max-width: 30em;
  font-family: var(--g-serif);
  font-size: clamp(18px, 2.1vw, 26px);
  line-height: 1.7; text-wrap: pretty;
}
.gmeta {
  margin: 34px 0 0; padding: 22px 0 0;
  border-top: 1px solid rgba(255,255,255,.28);
  display: flex; flex-wrap: wrap; gap: 12px 34px;
  list-style: none;
  font-family: var(--mono, monospace); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase;
}
.gmeta span { opacity: .58; margin-right: 8px; }
.gscroll {
  margin: 46px 0 0; display: flex; gap: 10px; align-items: center;
  font-family: var(--mono, monospace); font-size: 10px; letter-spacing: .26em; text-transform: uppercase;
  opacity: .72;
}
.gscroll::after { content: ""; width: 56px; height: 1px; background: currentColor; }

/* PM hero is dark, light text already */
body[data-game="pm"] .ghero::after {
  background: linear-gradient(180deg, rgba(10,8,18,.55) 0%, rgba(10,8,18,.42) 36%, rgba(10,8,18,.9) 100%);
}

/* ---------- section shell ---------- */
.gsec { padding: 118px 0; border-top: 1px solid var(--g-line); }
.gsec:first-of-type { border-top: 0; }
.ghead-row {
  display: grid; grid-template-columns: 96px 1fr auto; gap: 20px; align-items: baseline;
  padding-bottom: 20px; border-bottom: 1px solid var(--g-line);
}
.gnum { font-family: var(--mono, monospace); font-size: 12px; letter-spacing: .2em; color: var(--g-accent); }
.ghead-row h2 {
  margin: 0; font-family: var(--g-serif);
  font-size: clamp(28px, 3.4vw, 44px); font-weight: 600; letter-spacing: .06em;
}
.ghead-row .gside { font-family: var(--mono, monospace); font-size: 11px; letter-spacing: .16em; color: var(--g-muted); text-transform: uppercase; }

/* story */
.gstory { display: grid; grid-template-columns: 240px 1fr; gap: 72px; padding-top: 52px; }
.gstory-lead { position: sticky; top: 96px; align-self: start; }
.gstory-lead .gbig {
  font-family: var(--g-serif); font-size: 52px; line-height: 1;
  color: var(--g-accent); opacity: .5;
}
.gstory-lead p { margin: 18px 0 0; font-size: 12.5px; line-height: 1.9; color: var(--g-muted); }
.gstory-body p { margin: 0 0 26px; font-size: 16.5px; line-height: 2.15; max-width: 44em; text-wrap: pretty; }
.gstory-body p:first-child { font-size: 20px; line-height: 2; }
.gstory-body p:first-child::first-letter {
  float: left; font-family: var(--g-serif); font-size: 3.2em; line-height: .86;
  padding: 4px 12px 0 0; color: var(--g-accent);
}
.gpull {
  margin: 46px 0; padding: 34px 0 34px 34px; border-left: 2px solid var(--g-accent);
  font-family: var(--g-serif); font-size: clamp(20px, 2.2vw, 27px); line-height: 1.8;
  color: var(--g-ink);
}
.gpull small { display: block; margin-top: 14px; font-family: var(--mono, monospace); font-size: 10px; letter-spacing: .2em; color: var(--g-muted); text-transform: uppercase; }

/* world strip */
.gstrip { display: flex; gap: 18px; overflow-x: auto; padding: 48px 0 6px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.gstrip figure { flex: 0 0 min(560px, 78vw); margin: 0; scroll-snap-align: start; }
.gstrip img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; filter: saturate(.96); }
.gstrip figcaption {
  display: flex; justify-content: space-between; gap: 16px;
  padding-top: 12px; font-size: 12px; color: var(--g-muted);
  font-family: var(--mono, monospace); letter-spacing: .08em;
}
.gstrip b { color: var(--g-ink); font-weight: 500; }

/* cast */
.gcast { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; padding-top: 52px; }
.gcast-card {
  position: relative; overflow: hidden; min-height: 520px;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 28px;
  background: linear-gradient(180deg, var(--g-bg2) 0%, color-mix(in srgb, var(--g-accent) 16%, var(--g-bg2)) 100%);
  border: 1px solid var(--g-line);
}
.gcast-card .gsp {
  position: absolute; right: -12px; bottom: 0; height: 84%; width: auto;
  filter: drop-shadow(0 24px 34px rgba(0,0,0,.18));
  transition: transform .5s cubic-bezier(.2,.8,.2,1);
}
.gcast-card:hover .gsp { transform: translateY(-8px) scale(1.02); }
.gcast-card .ginfo { position: relative; z-index: 1; max-width: 70%; }
.gcast-card .grole { font-family: var(--mono, monospace); font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: var(--g-accent); }
.gcast-card h3 { margin: 8px 0 4px; font-family: var(--g-serif); font-size: 25px; letter-spacing: .05em; }
.gcast-card .gen-name { display: block; font-family: var(--mono, monospace); font-size: 10.5px; letter-spacing: .16em; color: var(--g-muted); }
.gcast-card blockquote { margin: 16px 0 0; font-family: var(--g-serif); font-size: 15px; line-height: 1.85; }
.gcast-card p { margin: 12px 0 0; font-size: 12.5px; line-height: 1.9; color: var(--g-muted); }
.gcast-card a.gmore { display: inline-flex; margin-top: 16px; font-family: var(--mono, monospace); font-size: 11px; letter-spacing: .12em; border-bottom: 1px solid currentColor; color: var(--g-accent); }
.gcast-note { margin-top: 26px; font-size: 12px; color: var(--g-muted); }

/* music */
.gmusic { padding-top: 52px; }
.gtrack {
  display: grid; grid-template-columns: 82px 1fr auto; gap: 30px; align-items: center;
  padding: 34px; border: 1px solid var(--g-line);
  background: var(--g-bg2);
}
.gtrack .gn { font-family: var(--mono, monospace); font-size: 30px; color: var(--g-accent); }
.gtrack h3 { margin: 0; font-family: var(--g-serif); font-size: 24px; letter-spacing: .04em; }
.gtrack .gartist { margin: 6px 0 0; font-size: 12px; color: var(--g-muted); letter-spacing: .08em; }
.gtrack .gplay {
  display: inline-flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 22px; border: 1px solid var(--g-ink); background: transparent;
  color: var(--g-ink); font-size: 12px; letter-spacing: .18em; text-transform: uppercase;
  cursor: pointer; transition: background .2s, color .2s;
}
.gtrack .gplay:hover { background: var(--g-ink); color: var(--g-bg); }
.gtrack .gplay svg { width: 13px; height: 13px; }
.gtrack .gplay.is-on { background: var(--g-accent); border-color: var(--g-accent); color: #fff; }

/* gallery */
.ggal { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; padding-top: 48px; }
.ggal figure { margin: 0; position: relative; overflow: hidden; cursor: zoom-in; grid-column: span 4; }
.ggal figure.wide { grid-column: span 6; }
.ggal figure.tall { grid-column: span 4; }
.ggal img { width: 100%; height: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; transition: transform .7s cubic-bezier(.2,.8,.2,1); }
.ggal figure.wide img { aspect-ratio: 16/9; }
.ggal figure:hover img { transform: scale(1.04); }
.ggal figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 16px 14px;
  background: linear-gradient(transparent, rgba(0,0,0,.62)); color: #fff;
  font-size: 11px; letter-spacing: .1em; opacity: 0; transition: opacity .3s;
}
.ggal figure:hover figcaption { opacity: 1; }

/* next */
.gnext-sec { padding: 92px 0 110px; border-top: 1px solid var(--g-line); }
.gnext { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.gnext .glabel { font-family: var(--mono, monospace); font-size: 10px; letter-spacing: .24em; text-transform: uppercase; color: var(--g-muted); }
.gnext a { font-family: var(--g-serif); font-size: clamp(24px, 3.2vw, 40px); line-height: 1.25; border-bottom: 1px solid var(--g-line); padding-bottom: 8px; }
.gnext a:hover { color: var(--g-accent); }
.gnext .gback { font-family: var(--mono, monospace); font-size: 12px; letter-spacing: .12em; }

/* lightbox */
.glb { position: fixed; inset: 0; z-index: 120; display: none; place-items: center; padding: 40px; background: rgba(8,8,10,.9); backdrop-filter: blur(8px); }
.glb.open { display: grid; }
.glb img { max-width: 92vw; max-height: 86vh; object-fit: contain; }
.glb button { position: absolute; top: 24px; right: 28px; width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.4); background: transparent; color: #fff; font-size: 20px; cursor: pointer; }

/* ---------- WA2 ---------- */
body[data-game="wa2"] {
  --g-bg: #eef2f7; --g-bg2: #f8fafc; --g-ink: #16202b; --g-muted: #5d6d7d;
  --g-accent: #6f8fb5; --g-accent2: #b7c9dc; --g-line: rgba(22,32,43,.14);
  --g-serif: "Noto Serif SC", "Songti SC", "SimSun", serif;
}
body[data-game="wa2"] .ghero-in { text-shadow: 0 2px 30px rgba(0,0,0,.35); }
body[data-game="wa2"] .gsec:nth-of-type(even) { background: #e7edf4; }
body[data-game="wa2"] .gcast-card { background: linear-gradient(180deg, #fff 0%, #dee8f2 100%); }

/* ---------- Summer Pockets ---------- */
body[data-game="sp"] {
  --g-bg: #f2fbfd; --g-bg2: #ffffff; --g-ink: #10333d; --g-muted: #557a83;
  --g-accent: #14a3c4; --g-accent2: #ff8a65; --g-line: rgba(16,51,61,.14);
  --g-serif: "Noto Serif SC", "Songti SC", serif;
}
body[data-game="sp"] .ghero::after { background: linear-gradient(180deg, rgba(255,255,255,.12) 0%, rgba(3,70,86,.12) 34%, rgba(3,45,56,.68) 100%); }
body[data-game="sp"] .gsec { background-image: radial-gradient(circle at 88% 8%, rgba(255,138,101,.1), transparent 32%), radial-gradient(circle at 6% 70%, rgba(20,163,196,.09), transparent 30%); }
body[data-game="sp"] .gcast-card { border-radius: 28px; background: linear-gradient(180deg, #ffffff 0%, #dff6fb 100%); }
body[data-game="sp"] .gstrip img { border-radius: 18px; }
body[data-game="sp"] .gtrack { border-radius: 22px; background: linear-gradient(120deg, #fff, #e8f9fc); }
body[data-game="sp"] .ggal img { border-radius: 16px; }
body[data-game="sp"] .gkicker { border-radius: 100px; }

/* ---------- Noble Works ---------- */
body[data-game="nw"] {
  --g-bg: #f4ecdc; --g-bg2: #fbf6ec; --g-ink: #2b1c16; --g-muted: #7a6350;
  --g-accent: #8a2432; --g-accent2: #b98a4b; --g-line: rgba(43,28,22,.18);
  --g-serif: "Noto Serif SC", "Songti SC", "SimSun", serif;
}
body[data-game="nw"] .ghero::after { background: linear-gradient(180deg, rgba(20,10,6,.24) 0%, rgba(20,10,6,.16) 34%, rgba(20,10,6,.78) 100%); }
body[data-game="nw"] .gsec { background-image: none; }
body[data-game="nw"] .ghead-row { border-bottom: 3px double var(--g-line); }
body[data-game="nw"] .gkicker { border-color: rgba(255,255,255,.5); letter-spacing: .34em; }
body[data-game="nw"] .gcast-card { background: linear-gradient(180deg, #fffaf0 0%, #ecdcc4 100%); border: 1px solid rgba(43,28,22,.24); }
body[data-game="nw"] .gcast-card::before { content: ""; position: absolute; inset: 8px; border: 1px solid rgba(138,36,50,.24); pointer-events: none; }
body[data-game="nw"] .gtrack { background: #fffaf0; border: 1px solid rgba(43,28,22,.3); box-shadow: inset 0 0 0 7px #f4ecdc, inset 0 0 0 8px rgba(43,28,22,.25); }
body[data-game="nw"] .gnum, body[data-game="nw"] .gcast-card .grole { color: var(--g-accent); }

/* ---------- 纸上魔法使 ---------- */
body[data-game="pm"] {
  --g-bg: #14111f; --g-bg2: #1c182b; --g-ink: #ece4d2; --g-muted: #a59ab8;
  --g-accent: #a98ad4; --g-accent2: #c9a86a; --g-line: rgba(236,228,210,.16);
  --g-serif: "Noto Serif SC", "Songti SC", serif;
}
body[data-game="pm"] .head { background: rgba(20,17,31,.9); }
body[data-game="pm"] .gsec { background-image: radial-gradient(circle at 80% 4%, rgba(169,138,212,.09), transparent 30%); }
body[data-game="pm"] .gstory-body p:first-child::first-letter { color: var(--g-accent2); }
body[data-game="pm"] .gcast-card { background: linear-gradient(180deg, #241f35 0%, #191528 100%); border-color: rgba(201,168,106,.25); }
body[data-game="pm"] .gtrack { background: #1b1728; border-color: rgba(201,168,106,.3); }
body[data-game="pm"] .ggal figcaption { background: linear-gradient(transparent, rgba(8,6,14,.85)); }
body[data-game="pm"] .gnext a:hover { color: var(--g-accent2); }

/* ---------- games index ---------- */
body[data-game="index"] {
  --g-bg: #fafafa; --g-bg2: #fff; --g-ink: #111; --g-muted: #666;
  --g-accent: #2f6bff; --g-line: rgba(17,17,17,.14);
  --g-serif: "Noto Serif SC", "Songti SC", serif;
}
.gindex-hero { padding: 150px 0 70px; }
.gindex-hero h1 { margin: 18px 0 0; font-size: clamp(42px, 8vw, 110px); line-height: .95; letter-spacing: -.04em; }
.gindex-hero h1 em { font-style: normal; color: var(--g-accent); }
.gindex-hero p { margin: 24px 0 0; max-width: 34em; color: var(--g-muted); line-height: 1.9; }
.gindex { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; padding: 0 0 120px; }
.gitem { position: relative; display: block; overflow: hidden; background: #111; color: #fff; min-height: 360px; }
.gitem img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.8,.2,1); }
.gitem::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,.72)); }
.gitem:hover img { transform: scale(1.04); }
.gitem-txt { position: absolute; z-index: 1; left: 28px; right: 28px; bottom: 26px; }
.gitem-txt .gnum2 { font-family: var(--mono, monospace); font-size: 11px; letter-spacing: .2em; opacity: .7; }
.gitem-txt h2 { margin: 8px 0 6px; font-family: var(--g-serif); font-size: 28px; }
.gitem-txt p { margin: 0; font-size: 12.5px; opacity: .78; }


/* transparent header over game heroes */
body[data-game]:not([data-game="index"]) .head { position: fixed; top: 0; left: 0; right: 0; z-index: 60; background: transparent; border-bottom-color: rgba(255,255,255,.16); backdrop-filter: none; }
body[data-game]:not([data-game="index"]) .head .brand-name,
body[data-game]:not([data-game="index"]) .head .nav a { color: #fff; }
body[data-game]:not([data-game="index"]) .head .nav a::after { background: #fff; }
body[data-game]:not([data-game="index"]) .head .nav .nav-mail { background: #fff; color: #111; border-color: #fff; }
body[data-game]:not([data-game="index"]) .head .brand-mark { box-shadow: 0 0 0 1px rgba(255,255,255,.3); }
body[data-game]:not([data-game="index"]) .head.is-stuck { background: color-mix(in srgb, var(--g-bg) 92%, transparent); border-bottom-color: var(--g-line); backdrop-filter: blur(14px); }
body[data-game]:not([data-game="index"]) .head.is-stuck .brand-name,
body[data-game]:not([data-game="index"]) .head.is-stuck .nav a { color: var(--g-ink); }
body[data-game]:not([data-game="index"]) .head.is-stuck .nav a { color: var(--g-muted); }
body[data-game]:not([data-game="index"]) .head.is-stuck .nav a.is-active { color: var(--g-ink); }
body[data-game]:not([data-game="index"]) .head.is-stuck .nav a::after { background: currentColor; }
body[data-game]:not([data-game="index"]) .head.is-stuck .nav .nav-mail { background: var(--g-ink); color: var(--g-bg); border-color: var(--g-ink); }
body[data-game]:not([data-game="index"]) .head.is-stuck .progress { background: var(--g-accent); }

.gindex-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .gindex-grid { grid-template-columns: 1fr; } }

/* ---------- home game cards (site.css extension) ---------- */
.gcards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 40px; }
.gcard { position: relative; display: block; overflow: hidden; background: #111; color: #fff; aspect-ratio: 3/4; }
.gcard-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.8,.2,1); }
.gcard::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,.74)); }
.gcard:hover .gcard-img img { transform: scale(1.05); }
.gcard-txt { position: absolute; z-index: 1; left: 18px; right: 18px; bottom: 16px; }
.gcard-txt b { display: block; font-family: var(--g-serif, serif); font-size: 18px; letter-spacing: .02em; }
.gcard-txt i { display: block; margin-top: 5px; font-style: normal; font-size: 11px; opacity: .75; letter-spacing: .06em; }


/* ---------- character page ---------- */
.ghero-char { min-height: 92vh; }
.ghero-char .ghero-in { position: relative; z-index: 2; max-width: 720px; margin-left: max(32px, calc((100vw - 1180px) / 2)); }
.ghero-char .gkicker { color: #fff; border-color: rgba(255,255,255,.5); }
.ghero-char .gmeta { border-top-color: rgba(255,255,255,.3); }
.gchar {
  position: absolute; right: max(2vw, calc((100vw - 1320px) / 2)); bottom: 0;
  height: 88%; width: auto; max-width: 48vw; object-fit: contain; object-position: bottom right;
  z-index: 1; filter: drop-shadow(0 24px 50px rgba(0,0,0,.45));
  pointer-events: none;
}
body[data-game="nw"] .ghero-char::after {
  background: linear-gradient(180deg, rgba(20,10,6,.34) 0%, rgba(20,10,6,.18) 30%, rgba(20,10,6,.82) 100%);
}

.gprofile { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.gprofile-img { position: sticky; top: 110px; background: linear-gradient(180deg, #fffaf0, #ecdcc4); border: 1px solid rgba(43,28,22,.22); padding: 18px; }
.gprofile-img img { display: block; width: 100%; height: auto; filter: drop-shadow(0 12px 22px rgba(43,28,22,.22)); }
.gprofile-txt p { margin: 0 0 18px; font-size: 16.5px; line-height: 1.95; }
.gprofile-txt .glead { font-family: var(--g-serif); font-size: clamp(20px, 2.2vw, 26px); line-height: 1.75; }
.gkv { margin: 30px 0 0; border-top: 1px solid var(--g-line); }
.gkv > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--g-line); }
.gkv dt { margin: 0; font-family: var(--mono, monospace); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--g-muted); padding-top: 4px; }
.gkv dt::before { content: "— "; }
.gkv dd { margin: 0; font-size: 14.5px; line-height: 1.75; }
.ggal-char figure img { height: 380px; }
.ggal-char figure.wide img { height: 420px; }

@media (max-width: 960px) {
  .gprofile { grid-template-columns: 1fr; }
  .gprofile-img { position: static; max-width: 300px; }
  .gchar { height: 72%; right: -8vw; max-width: 62vw; opacity: .92; }
  .ghero-char .ghero-in { margin-left: 5vw; }
}
@media (max-width: 640px) {
  .ghero-char { min-height: 640px; }
  .ghero-char .ghero-in { margin-left: 20px; width: calc(100% - 40px); }
  .gchar { height: 58%; right: -18vw; max-width: 84vw; opacity: .8; }
  .ggal-char figure img, .ggal-char figure.wide img { height: 300px; }
}


/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .gwrap, .ghero-in { width: calc(100% - 40px); }
  .gstory { grid-template-columns: 1fr; gap: 26px; }
  .gstory-lead { position: static; display: flex; gap: 18px; align-items: baseline; }
  .gstory-lead .gbig { font-size: 34px; }
  .gstory-lead p { display: none; }
  .gcast { grid-template-columns: 1fr 1fr; }
  .gcards { grid-template-columns: 1fr 1fr; }
  .gindex { grid-template-columns: 1fr; }
  .ggal figure, .ggal figure.wide, .ggal figure.tall { grid-column: span 6; }
}
@media (max-width: 640px) {
  .ghero { min-height: 86vh; padding: 132px 0 48px; }
  .gtitle .gen { font-size: 15vw; }
  .gmeta { gap: 8px 18px; font-size: 10px; }
  .gsec { padding: 74px 0; }
  .ghead-row { grid-template-columns: 46px 1fr; }
  .ghead-row .gside { display: none; }
  .gcast { grid-template-columns: 1fr; }
  .gcast-card { min-height: 440px; }
  .gcast-card .gsp { height: 78%; }
  .gtrack { grid-template-columns: 1fr; gap: 18px; padding: 24px; }
  .gtrack .gplay { justify-self: start; }
  .gcards { gap: 10px; }
  .gcard { aspect-ratio: 4/5; }
  .gcard-txt b { font-size: 15px; }
  .ggal figure, .ggal figure.wide, .ggal figure.tall { grid-column: span 12; }
  .gnext { flex-direction: column; align-items: flex-start; }
}

/* ---------- cast cards (image top, text below) ---------- */
.gcast-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; min-height: 0; }
.gcast-card .gsp {
  position: static; width: 100%; height: 330px; padding: 16px 16px 0;
  object-fit: contain; object-position: bottom center;
}
.gcast-card.photo .gsp { height: 230px; padding: 0; object-fit: cover; object-position: center 30%; }
.gcast-card .ginfo { max-width: none; padding: 22px 24px 26px; }
.gcast-card.photo .ginfo { padding: 20px 24px 26px; }
@media (max-width: 960px) {
  .gcast-card .gsp { height: 300px; }
  .gcast-card.photo .gsp { height: 200px; }
}
@media (max-width: 640px) {
  .gcast-card { min-height: 0; }
  .gcast-card .gsp { height: 300px; }
  .gcast-card.photo .gsp { height: 210px; }
}


/* ============================================================
   v14 — game-specific UI layer
   参考各家 AVG 的实际界面语言：WA2 的雪夜冷白、Summer Pockets 的
   夏日原色圆角卡片、Noble Works 的金色纹章请柬、纸上魔法使的旧书页。
   ============================================================ */

body[data-game] { --g-serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", serif; }

/* ---------- 章节菜单条 ---------- */
.gmenu {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -78px 0 0;
  padding: 0 clamp(18px, 5vw, 64px) 0;
}
.gmenu a {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  padding: 12px 18px;
  color: var(--g-ink);
  text-decoration: none;
  border: 1px solid var(--g-line);
  background: color-mix(in srgb, var(--g-bg) 84%, transparent);
  backdrop-filter: blur(10px);
  transition: transform .3s ease, background .3s ease, color .3s ease, border-color .3s ease;
}
.gmenu a i { font-style: normal; font-family: var(--mono, monospace); font-size: 10px; letter-spacing: .18em; color: var(--g-accent); }
.gmenu a b { font-weight: 500; font-size: 13.5px; letter-spacing: .12em; }
.gmenu a em { font-style: normal; font-family: var(--mono, monospace); font-size: 9.5px; letter-spacing: .22em; color: var(--g-muted); }
.gmenu a:hover { transform: translateY(-3px); border-color: var(--g-accent); }

/* ---------- 对话框 ---------- */
.gdialog {
  position: relative;
  margin-top: 54px;
  padding: 46px clamp(26px, 4vw, 54px) 40px;
  border: 1px solid var(--g-line);
  background: color-mix(in srgb, var(--g-bg2) 88%, var(--g-accent) 12%);
  box-shadow: 0 26px 60px -40px rgba(0, 0, 0, .55);
}
.gdialog-name {
  position: absolute;
  top: -15px;
  left: clamp(26px, 4vw, 54px);
  padding: 7px 20px;
  font-size: 13px;
  letter-spacing: .16em;
  background: var(--g-accent);
  color: #fff;
}
.gdialog-line {
  margin: 0;
  font-family: var(--g-serif);
  font-size: clamp(19px, 2.1vw, 27px);
  line-height: 1.85;
  letter-spacing: .02em;
}
.gdialog-sub { margin: 16px 0 0; font-size: 12.5px; letter-spacing: .04em; color: var(--g-muted); }
.gdialog-next {
  position: absolute; right: 22px; bottom: 14px;
  font-size: 12px; color: var(--g-accent);
  animation: gnextblink 1.2s steps(2, jump-none) infinite;
}
@keyframes gnextblink { 50% { opacity: 0; } }

/* ---------- 章节 / 路线列表（存档格） ---------- */
.gsec-slot { padding-top: 96px; }
.gslots { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 10px; }
.gslot {
  display: grid;
  grid-template-columns: 92px 1fr 26px;
  gap: 22px;
  align-items: center;
  padding: 26px 28px;
  border: 1px solid var(--g-line);
  background: var(--g-bg2);
  transition: transform .35s cubic-bezier(.2, .7, .2, 1), border-color .35s ease, box-shadow .35s ease;
}
.gslot:hover { transform: translateX(6px); border-color: var(--g-accent); box-shadow: 0 24px 50px -42px rgba(0, 0, 0, .6); }
.gslot-no { font-family: var(--mono, monospace); font-size: 26px; letter-spacing: .08em; color: var(--g-accent); }
.gslot-txt h3 { margin: 0; font-family: var(--g-serif); font-size: 21px; letter-spacing: .05em; }
.gslot-sub { margin: 6px 0 8px; font-size: 11px; letter-spacing: .14em; color: var(--g-muted); }
.gslot-txt p:last-child { margin: 0; font-size: 12.5px; line-height: 1.9; color: var(--g-muted); }
.gslot-go { font-size: 20px; color: var(--g-accent); opacity: .4; text-align: right; transition: opacity .3s ease, transform .3s ease; }
.gslot:hover .gslot-go { opacity: 1; transform: translateX(4px); }

/* ---------- 人物卡：角色选择界面 ---------- */
body[data-game] .gcast-card { position: relative; border-color: var(--g-line); background: var(--g-bg2); }
body[data-game] .gcast-card::after {
  content: "";
  position: absolute; inset: 0;
  border: 1px solid transparent;
  pointer-events: none;
  transition: border-color .35s ease;
}
body[data-game] .gcast-card:hover::after { border-color: var(--g-accent); }
body[data-game] .gcast-card .gsp { filter: saturate(.96); }

/* ---------- 图集：CG 画框 ---------- */
.ggal { counter-reset: cg; }
body[data-game] .ggal figure { position: relative; border: 1px solid var(--g-line); background: var(--g-bg2); padding: 10px 10px 0; }
body[data-game] .ggal figure::before {
  counter-increment: cg;
  content: "CG " counter(cg, decimal-leading-zero);
  position: absolute; top: -1px; left: -1px;
  padding: 6px 12px;
  font-family: var(--mono, monospace); font-size: 9.5px; letter-spacing: .2em;
  background: var(--g-accent); color: #fff;
}
body[data-game] .ggal figcaption { padding: 12px 2px 14px; font-family: var(--mono, monospace); font-size: 10.5px; letter-spacing: .14em; color: var(--g-muted); }

/* ---------- 音乐：SOUND 面板 ---------- */
body[data-game] .gmusic { background: var(--g-bg2); border: 1px solid var(--g-line); }

/* ============================================================
   白色相簿 2 —— 冬夜 / 冷白 / 细线
   ============================================================ */
body[data-game="wa2"] {
  --g-bg: #e9eef5; --g-bg2: #f7fafd; --g-ink: #101a26; --g-muted: #56667a;
  --g-accent: #5c81ad; --g-line: rgba(16, 26, 38, .13);
}
body[data-game="wa2"] .ghero::before {
  content: "";
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-image:
    radial-gradient(1.6px 1.6px at 18% 30%, rgba(255,255,255,.85), transparent 60%),
    radial-gradient(2.2px 2.2px at 72% 18%, rgba(255,255,255,.7), transparent 60%),
    radial-gradient(1.4px 1.4px at 44% 72%, rgba(255,255,255,.6), transparent 60%),
    radial-gradient(2px 2px at 88% 62%, rgba(255,255,255,.75), transparent 60%),
    radial-gradient(1.5px 1.5px at 32% 84%, rgba(255,255,255,.5), transparent 60%);
  animation: wa2snow 9s linear infinite alternate;
}
@keyframes wa2snow { from { transform: translate3d(0, -12px, 0); opacity: .8; } to { transform: translate3d(-18px, 22px, 0); opacity: 1; } }
body[data-game="wa2"] .gtitle .gen { letter-spacing: .06em; }
body[data-game="wa2"] .gmenu a { border-radius: 0; border-color: rgba(255,255,255,.34); background: rgba(12,22,34,.42); color: #eef3f9; }
body[data-game="wa2"] .gmenu a i, body[data-game="wa2"] .gmenu a em { color: #cfe0f2; }
body[data-game="wa2"] .gmenu a:hover { background: rgba(92,129,173,.85); border-color: rgba(255,255,255,.7); }
body[data-game="wa2"] .gdialog { background: rgba(247,250,253,.92); }
body[data-game="wa2"] .gdialog-name { background: #1b2b40; }
body[data-game="wa2"] .gslot { background: #fff; }
body[data-game="wa2"] .gslot-no { font-family: var(--g-serif); font-size: 30px; }

/* ============================================================
   Summer Pockets —— 夏日原色 / 圆角 / 阳光与浪
   ============================================================ */
body[data-game="sp"] {
  --g-bg: #eef8fb; --g-bg2: #ffffff; --g-ink: #12303a; --g-muted: #55707a;
  --g-accent: #18a5c4; --g-line: rgba(18, 48, 58, .12);
}
body[data-game="sp"] .ghero::before {
  content: "";
  position: absolute; right: 8%; top: 12%; width: 340px; height: 340px; z-index: 1;
  border-radius: 999px; pointer-events: none;
  background: radial-gradient(circle, rgba(255,240,200,.55), rgba(255,240,200,0) 62%);
  animation: spsun 7s ease-in-out infinite alternate;
}
@keyframes spsun { from { transform: scale(.94); opacity: .75; } to { transform: scale(1.06); opacity: 1; } }
body[data-game="sp"] .gtitle .gen { letter-spacing: -.01em; }
body[data-game="sp"] .gmenu a { border-radius: 999px; border-color: transparent; background: rgba(255,255,255,.82); box-shadow: 0 12px 26px -20px rgba(18,48,58,.8); }
body[data-game="sp"] .gmenu a:hover { background: #fff; border-color: var(--g-accent); transform: translateY(-4px); }
body[data-game="sp"] .gdialog { border-radius: 22px; border-color: rgba(18,165,196,.35); background: #fff; }
body[data-game="sp"] .gdialog-name { border-radius: 999px; top: -16px; background: #f2a33c; }
body[data-game="sp"] .gslot { border-radius: 18px; border-color: transparent; box-shadow: 0 20px 40px -34px rgba(18,48,58,.7); }
body[data-game="sp"] .gslot:hover { transform: translateY(-4px); }
body[data-game="sp"] .gslot-no { color: #f2a33c; }
body[data-game="sp"] .gsec-slot { background: linear-gradient(180deg, transparent, rgba(24,165,196,.06)); }

/* ============================================================
   Noble Works —— 奶油纸 / 酒红 / 金线纹章
   ============================================================ */
body[data-game="nw"] {
  --g-bg: #f7f1e4; --g-bg2: #fffdf8; --g-ink: #2b1d16; --g-muted: #6d5a4a;
  --g-accent: #8a2f3d; --g-line: rgba(43, 29, 22, .16);
}
body[data-game="nw"] .ghero::before {
  content: "";
  position: absolute; inset: 16px; z-index: 1; pointer-events: none;
  border: 1px solid rgba(255,255,255,.5);
  box-shadow: inset 0 0 0 4px rgba(255,255,255,.14);
}
body[data-game="nw"] .gmenu a { border-radius: 0; border-color: rgba(138,47,61,.4); background: rgba(255,253,248,.86); }
body[data-game="nw"] .gmenu a b { letter-spacing: .2em; }
body[data-game="nw"] .gmenu a:hover { background: #8a2f3d; color: #f7f1e4; }
body[data-game="nw"] .gmenu a:hover i, body[data-game="nw"] .gmenu a:hover em { color: #f0d9a8; }
body[data-game="nw"] .gdialog { background: #fffdf8; border-color: rgba(184,145,63,.6); box-shadow: inset 0 0 0 6px #fff, inset 0 0 0 7px rgba(184,145,63,.35); }
body[data-game="nw"] .gdialog-name { background: #8a2f3d; letter-spacing: .24em; }
body[data-game="nw"] .gslot { border-color: rgba(184,145,63,.5); background: linear-gradient(180deg, #fffdf8, #fbf4e4); }
body[data-game="nw"] .gslot-no { color: #8a2f3d; font-family: var(--g-serif); }
body[data-game="nw"] .gslot:hover { box-shadow: inset 0 0 0 1px #b8913f; }
body[data-game="nw"] .ghead-row { border-bottom-color: rgba(184,145,63,.55); }

/* ============================================================
   紙の上の魔法使い —— 旧书页 / 墨 / 烫金
   ============================================================ */
body[data-game="pm"] {
  --g-bg: #14110e; --g-bg2: #1d1815; --g-ink: #ece2cc; --g-muted: #a3947c;
  --g-accent: #c08a5a; --g-line: rgba(236, 226, 204, .14);
}
body[data-game="pm"] .ghero::before {
  content: "";
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-image: repeating-linear-gradient(90deg, rgba(192,138,90,.05) 0 1px, transparent 1px 96px);
  mix-blend-mode: screen;
}
body[data-game="pm"] .gmenu a { border-color: rgba(192,138,90,.4); background: rgba(20,17,14,.62); color: #ece2cc; }
body[data-game="pm"] .gmenu a i { color: #c08a5a; }
body[data-game="pm"] .gmenu a:hover { background: #c08a5a; color: #14110e; }
body[data-game="pm"] .gmenu a:hover i, body[data-game="pm"] .gmenu a:hover em { color: #14110e; }
body[data-game="pm"] .gtitle .gen { letter-spacing: .04em; }
body[data-game="pm"] .gdialog { background: #1d1815; border-color: rgba(192,138,90,.45); }
body[data-game="pm"] .gdialog::before {
  content: ""; position: absolute; inset: 8px; border: 1px solid rgba(192,138,90,.16); pointer-events: none;
}
body[data-game="pm"] .gdialog-name { background: #c08a5a; color: #14110e; }
body[data-game="pm"] .gslot { background: #1d1815; border-color: rgba(192,138,90,.28); }
body[data-game="pm"] .gslot:hover { border-color: #c08a5a; }
body[data-game="pm"] .gslot-no { color: #c08a5a; font-family: var(--g-serif); }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .gmenu { margin-top: -56px; padding: 0 18px; gap: 6px; }
  .gmenu a { padding: 9px 12px; }
  .gmenu a em { display: none; }
  .gslot { grid-template-columns: 62px 1fr; padding: 20px; gap: 14px; }
  .gslot-go { display: none; }
  .gdialog { padding: 40px 22px 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .gmenu a, .gslot, .gdialog-next, .ghero::before { animation: none !important; transition: none !important; }
}



/* ---------- v14.1 菜单条修正：放在 Hero 下方，实心条，分区点击 ---------- */
.gmenu {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 0;
  padding: 0 clamp(0px, 0vw, 0px);
  border-top: 1px solid var(--g-line);
  border-bottom: 1px solid var(--g-line);
  background: var(--g-bg2);
  position: relative;
  z-index: 3;
  backdrop-filter: none;
}
.gmenu-label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding: 16px clamp(18px, 3vw, 34px) 16px clamp(18px, 5vw, 64px);
  font-family: var(--mono, monospace);
  font-size: 10px;
  letter-spacing: .26em;
  color: var(--g-accent);
  white-space: nowrap;
}
.gmenu-label em { font-style: normal; font-size: 8.5px; letter-spacing: .2em; color: var(--g-muted); }
.gmenu a {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 15px clamp(10px, 1.6vw, 22px);
  border: 0;
  border-left: 1px solid var(--g-line);
  border-radius: 0;
  background: transparent;
  color: var(--g-ink);
  text-decoration: none;
  transform: none;
  transition: background .3s ease, color .3s ease;
}
.gmenu a i { font-size: 9px; letter-spacing: .2em; color: var(--g-accent); }
.gmenu a b { font-size: clamp(12px, 1.15vw, 14.5px); letter-spacing: .1em; font-weight: 500; }
.gmenu a em { font-size: 8.5px; letter-spacing: .22em; color: var(--g-muted); }
.gmenu a:hover { background: var(--g-accent); color: #fff; transform: none; border-color: transparent; }
.gmenu a:hover i, .gmenu a:hover em { color: rgba(255,255,255,.8); }
body[data-game="wa2"] .gmenu a,
body[data-game="sp"] .gmenu a,
body[data-game="nw"] .gmenu a,
body[data-game="pm"] .gmenu a { background: transparent; color: var(--g-ink); }
body[data-game="wa2"] .gmenu a:hover,
body[data-game="sp"] .gmenu a:hover,
body[data-game="nw"] .gmenu a:hover { background: var(--g-accent); color: #fff; }
body[data-game="pm"] .gmenu a { color: var(--g-ink); }
body[data-game="pm"] .gmenu a:hover { background: var(--g-accent); color: #14110e; }
body[data-game="pm"] .gmenu a:hover i, body[data-game="pm"] .gmenu a:hover em { color: #14110e; }
body[data-game="nw"] .gmenu { box-shadow: inset 0 -3px 0 rgba(184,145,63,.28); }
body[data-game="sp"] .gmenu { border-bottom-color: rgba(24,165,196,.3); }

/* 每款作品的页面底纹 */
body[data-game="wa2"] {
  background-image:
    radial-gradient(1.2px 1.2px at 12% 18%, rgba(92,129,173,.20), transparent 60%),
    radial-gradient(1.6px 1.6px at 78% 32%, rgba(92,129,173,.14), transparent 60%),
    radial-gradient(1.2px 1.2px at 38% 74%, rgba(92,129,173,.16), transparent 60%);
  background-size: 520px 520px, 680px 680px, 760px 760px;
  background-attachment: fixed;
}
body[data-game="sp"] {
  background-image: linear-gradient(180deg, rgba(24,165,196,.10), rgba(242,163,60,.06) 55%, rgba(24,165,196,.04));
  background-attachment: fixed;
}
body[data-game="nw"] {
  background-image:
    repeating-linear-gradient(135deg, rgba(184,145,63,.05) 0 1px, transparent 1px 26px),
    radial-gradient(circle at 50% 0, rgba(184,145,63,.10), transparent 58%);
  background-attachment: fixed;
}
body[data-game="pm"] {
  background-image:
    repeating-linear-gradient(90deg, rgba(192,138,90,.05) 0 1px, transparent 1px 120px),
    radial-gradient(circle at 50% 0, rgba(192,138,90,.10), transparent 62%);
  background-attachment: fixed;
}

/* 分段标题更像游戏菜单标题 */
body[data-game] .ghead-row { align-items: flex-end; }
body[data-game] .ghead-row h2 { letter-spacing: .06em; }
body[data-game="sp"] .ghead-row h2 { letter-spacing: .02em; }
body[data-game="nw"] .ghead-row h2 { letter-spacing: .12em; }
body[data-game="pm"] .ghead-row h2 { letter-spacing: .1em; }



/* ---------- v14.2 游戏化细节：章节槽、画面墙、音乐、移动端菜单 ---------- */
body[data-game] .gsec { padding: clamp(48px, 6vw, 84px) 0; }
body[data-game] .gsec-slot { padding-top: clamp(36px, 4vw, 56px); }

/* 章节 = 存档槽 */
.gslots { display: flex; flex-direction: column; gap: 10px; counter-reset: none; }
.gslot {
  position: relative;
  display: grid;
  grid-template-columns: 78px 1fr 28px;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  border: 1px solid var(--g-line);
  background: var(--g-bg2);
  border-radius: var(--g-radius, 0px);
  overflow: hidden;
  transition: border-color .3s ease, transform .3s ease, background .3s ease;
}
.gslot::before {
  content: "";
  position: absolute; inset: 0 auto 0 0;
  width: 3px;
  background: var(--g-accent);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform .35s ease;
}
.gslot:hover { transform: translateX(4px); border-color: var(--g-accent); }
.gslot:hover::before { transform: scaleY(1); }
.gslot-no {
  font-family: var(--mono, monospace);
  font-size: 22px;
  letter-spacing: .06em;
  color: var(--g-accent);
  display: flex;
  align-items: center;
  gap: 8px;
}
.gslot-no::after {
  content: "▸";
  font-size: 11px;
  opacity: .55;
}
.gslot-txt h3 { margin: 0 0 3px; font-size: 17px; letter-spacing: .04em; }
.gslot-sub { margin: 0 0 6px; font-size: 11.5px; letter-spacing: .16em; color: var(--g-accent); text-transform: uppercase; }
.gslot-txt p:last-child { margin: 0; font-size: 13.5px; line-height: 1.7; color: var(--g-muted); }
.gslot-go { font-size: 20px; color: var(--g-accent); justify-self: end; transition: transform .3s ease; }
.gslot:hover .gslot-go { transform: translateX(4px); }

body[data-game="wa2"] .gslot-no::after { content: "❄"; }
body[data-game="sp"] .gslot-no::after { content: "☀"; }
body[data-game="nw"] .gslot-no::after { content: "❖"; color: #b8913f; }
body[data-game="pm"] .gslot-no::after { content: "❧"; }
body[data-game="wa2"] .gslot { background: rgba(255,255,255,.55); backdrop-filter: blur(6px); }
body[data-game="sp"] .gslot { border-radius: 16px; box-shadow: 0 10px 26px rgba(24,165,196,.08); }
body[data-game="nw"] .gslot { border-color: rgba(184,145,63,.45); box-shadow: inset 0 0 0 4px rgba(247,241,228,.9); }
body[data-game="pm"] .gslot { background: rgba(30,25,20,.55); border-color: rgba(192,138,90,.35); }

/* 画面墙 = 收藏册 */
.ggal { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.ggal figure {
  position: relative;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--g-line);
  background: var(--g-bg2);
  transition: transform .45s cubic-bezier(.2,.7,.2,1), box-shadow .45s ease;
}
.ggal figure img { display: block; width: 100%; height: 190px; object-fit: cover; transition: transform .7s cubic-bezier(.2,.7,.2,1), filter .5s ease; }
.ggal figure:hover { transform: translateY(-5px); box-shadow: 0 18px 38px rgba(0,0,0,.18); }
.ggal figure:hover img { transform: scale(1.05); }
.ggal figcaption {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 13px;
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--g-ink);
  border-top: 1px solid var(--g-line);
}
.ggal .gcn {
  font-family: var(--mono, monospace);
  font-size: 10px;
  letter-spacing: .18em;
  color: #fff;
  background: var(--g-accent);
  padding: 3px 6px;
  order: -1;
}
body[data-game="sp"] .ggal figure { border-radius: 18px; }
body[data-game="sp"] .ggal figure img { height: 200px; }
body[data-game="nw"] .ggal figure { border: 1px solid rgba(184,145,63,.5); padding: 6px; background: #fffdf7; }
body[data-game="nw"] .ggal figure img { height: 178px; }
body[data-game="nw"] .ggal figcaption { border-top: 1px solid rgba(184,145,63,.28); }
body[data-game="pm"] .ggal figure { background: rgba(26,21,17,.7); }
body[data-game="pm"] .ggal figcaption { border-top-color: rgba(192,138,90,.3); color: #e8dcc9; }

/* 音乐 = 唱片条 */
.gmusic { margin-top: 26px; }
.gtrack {
  display: grid;
  grid-template-columns: 62px 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 22px 26px;
  border: 1px solid var(--g-line);
  background: var(--g-bg2);
  position: relative;
  overflow: hidden;
}
.gtrack .gn { font-size: 26px; color: var(--g-accent); justify-self: center; display: inline-flex; align-items: flex-end; gap: 3px; }
.gtrack .gn::after {
  content: "";
  width: 20px; height: 16px;
  background:
    linear-gradient(var(--g-accent), var(--g-accent)) 0 100%/3px 60% no-repeat,
    linear-gradient(var(--g-accent), var(--g-accent)) 6px 100%/3px 100% no-repeat,
    linear-gradient(var(--g-accent), var(--g-accent)) 12px 100%/3px 42% no-repeat,
    linear-gradient(var(--g-accent), var(--g-accent)) 18px 100%/3px 78% no-repeat;
  opacity: .55;
}
.gtrack h3 { margin: 0 0 4px; font-size: 17px; letter-spacing: .04em; }
.gtrack .gartist { margin: 0; font-size: 11.5px; letter-spacing: .14em; color: var(--g-muted); }
body[data-game="sp"] .gtrack { border-radius: 18px; }
body[data-game="nw"] .gtrack { border-color: rgba(184,145,63,.45); }
body[data-game="pm"] .gtrack { background: rgba(30,25,20,.55); }

/* 章节序号 / 分段序号的颜色统一到各作主色 */
body[data-game="nw"] .gnum, body[data-game="nw"] .gslot-sub { color: #8a2f3d; }

/* 移动端菜单：横滑 + 单行 */
@media (max-width: 760px) {
  .gmenu { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .gmenu::-webkit-scrollbar { display: none; }
  .gmenu-label { display: none; }
  .gmenu a { flex: 0 0 auto; min-width: 84px; padding: 12px 14px; border-left: 1px solid var(--g-line); gap: 3px; }
  .gmenu a b { white-space: nowrap; font-size: 12.5px; }
  .gmenu a em { display: none; }
  .gmenu a i { font-size: 8.5px; }
  .gslots { gap: 8px; }
  .gslot { grid-template-columns: 46px 1fr; padding: 14px 16px; gap: 12px; }
  .gslot-no { font-size: 16px; }
  .gslot-go { display: none; }
  .ggal { grid-template-columns: 1fr 1fr; gap: 10px; }
  .ggal figure img { height: 120px; }
  .ggal figcaption { font-size: 11px; padding: 8px 10px; }
  .gtrack { grid-template-columns: 40px 1fr; gap: 12px; padding: 16px 18px; }
  .gtrack .gplay { grid-column: 1 / -1; justify-self: stretch; text-align: center; }
}



/* ==========================================================================
   v15 四款作品各自独立的视觉语言（不再沿用主站的白底编辑风）
   ========================================================================== */

/* ---------- 通用：页面骨架让位给各作主题 ---------- */
body[data-game] { background: var(--g-bg); color: var(--g-ink); }
body[data-game] .gsec { border-top: 0; background: transparent; }
body[data-game] .gwrap { max-width: 1180px; padding: 0 clamp(18px, 4vw, 48px); }
body[data-game] .ghead-row { margin-bottom: clamp(22px, 3vw, 38px); }
body[data-game] .ghead-row h2 { margin: 0; line-height: 1; }
body[data-game] .gnum { font-family: var(--g-mono); font-size: 11px; letter-spacing: .3em; }
body[data-game] .gside { font-family: var(--g-mono); font-size: 10px; letter-spacing: .3em; }
body[data-game] .gstory-body p { font-size: 15.5px; line-height: 2; }
body[data-game] .gpull, body[data-game] .gquote { font-family: var(--g-serif); }
body[data-game] footer, body[data-game] .foot { border-top: 1px solid var(--g-line); }

/* ---------- 01 WHITE ALBUM 2：冬夜 · 黑白写真 ---------- */
body[data-game="wa2"] {
  --g-bg: #0c141f;
  --g-bg2: rgba(255,255,255,.045);
  --g-ink: #e9f0f8;
  --g-muted: #93a7bd;
  --g-line: rgba(168,196,226,.20);
  --g-accent: #a8cbea;
  --g-serif: "Songti SC", "Noto Serif SC", "Yu Mincho", serif;
  --g-mono: "SFMono-Regular", ui-monospace, monospace;
  background:
    radial-gradient(1200px 620px at 76% -6%, rgba(120,164,208,.20), transparent 70%),
    radial-gradient(900px 520px at 4% 24%, rgba(88,120,160,.14), transparent 72%),
    #0c141f;
  color: var(--g-ink);
}
body[data-game="wa2"] .ghead-row h2 { font-family: var(--g-serif); font-size: clamp(30px, 4.2vw, 54px); letter-spacing: .14em; font-weight: 400; }
body[data-game="wa2"] .gnum, body[data-game="wa2"] .gside { color: rgba(168,203,234,.75); }
body[data-game="wa2"] .gstory { position: relative; }
body[data-game="wa2"] .gstory-lead, body[data-game="wa2"] .gstory-body {
  background: rgba(255,255,255,.045);
  border: 1px solid var(--g-line);
  padding: clamp(22px, 3vw, 38px);
  backdrop-filter: blur(10px);
}
body[data-game="wa2"] .gstory-body { border-top: 0; }
body[data-game="wa2"] .gstory-body p { color: #d5e2f0; }
body[data-game="wa2"] .gquote, body[data-game="wa2"] .gpull {
  border-left: 1px solid rgba(168,203,234,.6);
  color: #fff;
  letter-spacing: .1em;
}
body[data-game="wa2"] .gslot { background: rgba(255,255,255,.05); }
body[data-game="wa2"] .ggal figure { background: #fbfbfb; padding: 8px 8px 0; border: 1px solid rgba(255,255,255,.14); }
body[data-game="wa2"] .ggal figcaption { color: #2a3646; background: #fbfbfb; border-top: 0; padding: 10px 8px 14px; }
body[data-game="wa2"] .gcast-card { background: rgba(255,255,255,.05); border: 1px solid var(--g-line); }
body[data-game="wa2"] .ginfo h3 { font-family: var(--g-serif); letter-spacing: .1em; }
body[data-game="wa2"] .gtrack { background: rgba(255,255,255,.05); }
/* 落雪 */
body[data-game="wa2"] .ghero::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.4px 1.4px at 20% 30%, rgba(255,255,255,.8), transparent 60%),
    radial-gradient(1.1px 1.1px at 62% 16%, rgba(255,255,255,.7), transparent 60%),
    radial-gradient(1.7px 1.7px at 84% 54%, rgba(255,255,255,.55), transparent 60%),
    radial-gradient(1.2px 1.2px at 38% 78%, rgba(255,255,255,.65), transparent 60%);
  background-size: 240px 240px, 320px 320px, 420px 420px, 520px 520px;
  animation: wa2snow 22s linear infinite;
  opacity: .85;
}
@keyframes wa2snow { to { background-position: 40px 240px, -30px 320px, 20px 420px, -50px 520px; } }

/* ---------- 02 SUMMER POCKETS：盛夏 · 天空与海 ---------- */
body[data-game="sp"] {
  --g-bg: #eff9fd;
  --g-bg2: #ffffff;
  --g-ink: #14323d;
  --g-muted: #5a7e8c;
  --g-line: rgba(26,165,196,.18);
  --g-accent: #ff7a45;
  --g-serif: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --g-mono: "SFMono-Regular", ui-monospace, monospace;
  background:
    linear-gradient(180deg, #d6f0fb 0%, #eefaff 26%, #fff8ee 62%, #fff3e6 100%);
  color: var(--g-ink);
}
body[data-game="sp"] .ghead-row h2 { font-family: var(--g-serif); font-weight: 800; font-size: clamp(30px, 4.6vw, 56px); letter-spacing: .02em; color: #0f3542; }
body[data-game="sp"] .gnum, body[data-game="sp"] .gside { color: #1aa5c4; }
body[data-game="sp"] .gsec { padding: clamp(46px, 5.4vw, 78px) 0; }
body[data-game="sp"] .gstory-lead, body[data-game="sp"] .gstory-body {
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 18px 44px rgba(26,165,196,.12);
  padding: clamp(22px, 3vw, 36px);
}
body[data-game="sp"] .gstory-body { border-top-left-radius: 0; border-top-right-radius: 0; }
body[data-game="sp"] .gquote, body[data-game="sp"] .gpull { color: #d9541f; }
body[data-game="sp"] .gquote::before, body[data-game="sp"] .gpull::before { content: "☀ "; }
body[data-game="sp"] .gslot { background: #fff; border-radius: 18px; border-color: rgba(26,165,196,.16); }
body[data-game="sp"] .ggal figure { border-radius: 20px; background: #fff; padding: 8px; }
body[data-game="sp"] .ggal figcaption { border-top: 0; border-radius: 0 0 14px 14px; }
body[data-game="sp"] .gcast-card { background: #fff; border-radius: 20px; box-shadow: 0 14px 34px rgba(26,165,196,.12); border: 0; }
body[data-game="sp"] .gtrack { background: #fff; border-radius: 20px; box-shadow: 0 14px 34px rgba(26,165,196,.12); border: 0; }
body[data-game="sp"] .ghero::after {
  content: "";
  position: absolute; right: -70px; top: -70px; width: 320px; height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,214,150,.55), rgba(255,190,120,0) 68%);
  pointer-events: none;
}

/* ---------- 03 Noble Works：学院 · 金与酒红 ---------- */
body[data-game="nw"] {
  --g-bg: #f8f2e6;
  --g-bg2: #fffdf8;
  --g-ink: #2e2419;
  --g-muted: #7d6a52;
  --g-line: rgba(184,145,63,.34);
  --g-accent: #8a2f3d;
  --g-serif: "Songti SC", "Noto Serif SC", "Times New Roman", serif;
  --g-mono: "SFMono-Regular", ui-monospace, monospace;
  background:
    repeating-linear-gradient(135deg, rgba(184,145,63,.05) 0 1px, transparent 1px 28px),
    radial-gradient(circle at 50% -8%, #fff9ec, #f8f2e6 62%);
  color: var(--g-ink);
}
body[data-game="nw"] .ghead-row h2 { font-family: var(--g-serif); font-weight: 700; font-size: clamp(28px, 4vw, 50px); letter-spacing: .2em; color: #2e2419; }
body[data-game="nw"] .ghead-row { border-bottom: 3px double rgba(184,145,63,.55); padding-bottom: 16px; }
body[data-game="nw"] .gnum, body[data-game="nw"] .gside { color: #8a2f3d; }
body[data-game="nw"] .gside::before { content: "❖  "; color: #b8913f; }
body[data-game="nw"] .gstory-lead, body[data-game="nw"] .gstory-body {
  background: #fffdf8;
  border: 1px solid rgba(184,145,63,.45);
  box-shadow: inset 0 0 0 5px #fffdf8, inset 0 0 0 6px rgba(184,145,63,.35);
  padding: clamp(24px, 3.2vw, 40px);
}
body[data-game="nw"] .gstory-body { border-top: 0; }
body[data-game="nw"] .gquote, body[data-game="nw"] .gpull { color: #8a2f3d; letter-spacing: .08em; }
body[data-game="nw"] .gslot { background: #fffdf8; box-shadow: inset 0 0 0 4px #fffdf8, inset 0 0 0 5px rgba(184,145,63,.32); }
body[data-game="nw"] .gslot-sub { color: #8a2f3d; }
body[data-game="nw"] .ggal figure { background: #fffdf8; padding: 8px; box-shadow: 0 0 0 1px rgba(184,145,63,.45) inset; }
body[data-game="nw"] .ggal figcaption { color: #8a2f3d; border-top: 1px solid rgba(184,145,63,.3); }
body[data-game="nw"] .gcast-card { background: #fffdf8; border: 1px solid rgba(184,145,63,.45); box-shadow: inset 0 0 0 4px #fffdf8, inset 0 0 0 5px rgba(184,145,63,.3); }
body[data-game="nw"] .gtrack { background: #fffdf8; border-color: rgba(184,145,63,.45); }
body[data-game="nw"] .gcast-card .gname-en, body[data-game="nw"] .gen-name { color: #b8913f; letter-spacing: .3em; }

/* ---------- 04 紙の上の魔法使い：图书馆 · 墨与羊皮纸 ---------- */
body[data-game="pm"] {
  --g-bg: #14110e;
  --g-bg2: rgba(243,232,212,.06);
  --g-ink: #ede0cb;
  --g-muted: #b09a7d;
  --g-line: rgba(192,138,90,.30);
  --g-accent: #c08a5a;
  --g-serif: "Songti SC", "Noto Serif SC", "Yu Mincho", serif;
  --g-mono: "SFMono-Regular", ui-monospace, monospace;
  background:
    radial-gradient(1000px 520px at 20% 0%, rgba(150,96,54,.18), transparent 70%),
    repeating-linear-gradient(90deg, rgba(192,138,90,.05) 0 1px, transparent 1px 140px),
    #14110e;
  color: var(--g-ink);
}
body[data-game="pm"] .ghead-row h2 { font-family: var(--g-serif); font-weight: 400; font-size: clamp(30px, 4.2vw, 54px); letter-spacing: .16em; color: #f1e4cf; }
body[data-game="pm"] .gnum, body[data-game="pm"] .gside { color: #c08a5a; }
body[data-game="pm"] .gstory-lead, body[data-game="pm"] .gstory-body {
  background: #f3e8d4;
  color: #2a2119;
  border: 1px solid rgba(192,138,90,.5);
  box-shadow: 0 24px 50px rgba(0,0,0,.45);
  padding: clamp(24px, 3vw, 40px);
}
body[data-game="pm"] .gstory-body { border-top: 0; }
body[data-game="pm"] .gstory-body p { color: #362a1f; }
body[data-game="pm"] .gstory-body p:first-of-type::first-letter {
  float: left; font-family: var(--g-serif); font-size: 3.2em; line-height: .92;
  padding: 6px 10px 0 0; color: #8c5a2f;
}
body[data-game="pm"] .gquote, body[data-game="pm"] .gpull { color: #8c5a2f; }
body[data-game="pm"] .gslot { background: rgba(243,232,212,.07); }
body[data-game="pm"] .ggal figure { background: rgba(243,232,212,.07); padding: 8px; border-color: rgba(192,138,90,.45); }
body[data-game="pm"] .ggal figcaption { border-top: 0; }
body[data-game="pm"] .gcast-card { background: rgba(243,232,212,.07); border-color: rgba(192,138,90,.4); }
body[data-game="pm"] .gtrack { background: rgba(243,232,212,.07); }
body[data-game="pm"] .ghero::after {
  content: "";
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 40%, transparent 40%, rgba(10,8,6,.78) 100%);
}

/* ---------- 四作通用：Hero 与页脚也各自成篇 ---------- */
body[data-game] .ghero-in { padding-bottom: clamp(40px, 5vw, 70px); }
body[data-game] .gtitle .gen { letter-spacing: .02em; }
body[data-game="wa2"] .gtitle .gen { letter-spacing: .12em; font-family: var(--g-serif); font-weight: 400; }
body[data-game="nw"] .gtitle .gen { font-family: var(--g-serif); letter-spacing: .08em; }
body[data-game="pm"] .gtitle .gen { font-family: var(--g-serif); letter-spacing: .1em; font-weight: 400; }
body[data-game] .gnum, body[data-game] .gside { font-weight: 500; }
body[data-game] .gsec:last-of-type { padding-bottom: clamp(50px, 6vw, 90px); }

@media (max-width: 760px) {
  body[data-game] .gstory-lead, body[data-game] .gstory-body { padding: 20px; }
  body[data-game] .ghead-row h2 { font-size: clamp(26px, 8vw, 36px); }
}



/* v15.1：清掉旧版遗留的整段底色，让四作的主题底色透上来 */
body[data-game] .gsec,
body[data-game] .gsec:nth-of-type(n),
body[data-game] .gsec:nth-of-type(even),
body[data-game] .gsec:nth-of-type(odd),
body[data-game="wa2"] .gsec,
body[data-game="wa2"] .gsec:nth-of-type(even),
body[data-game="sp"] .gsec,
body[data-game="nw"] .gsec,
body[data-game="pm"] .gsec { background: transparent; }
body[data-game="wa2"] .gsec:nth-of-type(even) { background: rgba(255,255,255,.02); }
body[data-game] .gstory-lead { border-bottom: 0; }



/* v15.2 对话框配色跟随各作皮肤 */
body[data-game="wa2"] .gdialog {
  background: rgba(10,18,28,.88);
  border: 1px solid rgba(168,203,234,.32);
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
  backdrop-filter: blur(8px);
}
body[data-game="wa2"] .gdialog-name { background: #a8cbea; color: #0c141f; }
body[data-game="wa2"] .gdialog-line { color: #eaf2fb; }
body[data-game="wa2"] .gdialog-sub { color: #93a7bd; }
body[data-game="wa2"] .gdialog-next { color: #a8cbea; border-color: rgba(168,203,234,.4); }
body[data-game="pm"] .gdialog-line { color: #f0e3ce; }
body[data-game="nw"] .gdialog-line { color: #2e2419; }
body[data-game="sp"] .gdialog-line { color: #14323d; }


/* v15.3 小修：立绘卡片底色、移动端底部留白 */
body[data-game="nw"] .gcast-card .gsp { background: #fffdf8; }
body[data-game="pm"] .gcast-card .gsp { background: rgba(243,232,212,.05); }
body[data-game="wa2"] .gcast-card .gsp { background: rgba(255,255,255,.04); }
@media (max-width: 760px) {
  body.game main, body.game .gsec:last-of-type { padding-bottom: 96px; }
}



/* ==========================================================================
   v16 交互层：粒子、光斑、逐字、菜单高亮、视差
   ========================================================================== */
#fx-canvas {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
  opacity: .9;
}
body[data-game] #main,
body[data-game] .foot { position: relative; z-index: 1; }
body[data-game] .gmenu { position: relative; z-index: 2; }

.fx-aura {
  position: fixed; left: 0; top: 0;
  width: 460px; height: 460px; border-radius: 50%;
  pointer-events: none; z-index: 0; opacity: 0;
  background: radial-gradient(circle, rgba(var(--fx-rgb, 168, 203, 234), .20), rgba(var(--fx-rgb, 168, 203, 234), 0) 64%);
  filter: blur(4px);
  transition: opacity .6s ease;
  will-change: transform;
}
.fx-aura.on { opacity: 1; }

.fx-spot { position: relative; }
.fx-spot::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  opacity: 0; transition: opacity .4s ease;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .16), transparent 64%);
}
.fx-spot:hover::after { opacity: 1; }
body[data-game="sp"] .fx-spot::after { background: radial-gradient(280px circle at var(--mx,50%) var(--my,50%), rgba(26,165,196,.14), transparent 66%); }
body[data-game="nw"] .fx-spot::after { background: radial-gradient(280px circle at var(--mx,50%) var(--my,50%), rgba(184,145,63,.20), transparent 66%); }
body[data-game="pm"] .fx-spot::after { background: radial-gradient(280px circle at var(--mx,50%) var(--my,50%), rgba(192,138,90,.18), transparent 66%); }

.fx-split span {
  display: inline-block; opacity: 0;
  transform: translateY(12px) rotate(.001deg);
  transition: opacity .55s ease, transform .7s cubic-bezier(.2,.7,.2,1);
  transition-delay: calc(var(--i, 0) * 16ms);
}
.fx-split.is-in span { opacity: 1; transform: none; }
.fx-split { min-height: 1em; }

.fx-parallax { will-change: transform; }

.gmenu a { position: relative; }
.gmenu a.is-current { background: var(--g-accent); color: #fff; }
.gmenu a.is-current i, .gmenu a.is-current em { color: rgba(255,255,255,.82); }
body[data-game="pm"] .gmenu a.is-current { color: #14110f; }
body[data-game="pm"] .gmenu a.is-current i, body[data-game="pm"] .gmenu a.is-current em { color: rgba(20,17,15,.7); }

.glb img { transition: transform .18s ease; cursor: zoom-in; }

@media (max-width: 760px) {
  .fx-aura { display: none; }
}



/* v16.1 点击与悬停手感 */
.gmenu a { transition: background .25s ease, color .25s ease, transform .18s ease; }
.gmenu a:active { transform: scale(.985); }
.gslot { cursor: default; }
.gslot:active { transform: translateX(2px) scale(.998); }
.gplay, .gplay:active { transform: scale(.98); }
.ggal figure { cursor: zoom-in; }
.ggal figure:active { transform: scale(.99); }
.gcast-card { transition: transform .4s cubic-bezier(.2,.7,.2,1), box-shadow .4s ease; }
.gcast-card:hover { transform: translateY(-4px); }

/* 章节槽：扫光 */
.gslot::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.14) 48%, transparent 62%);
  transform: translateX(-120%);
  transition: transform .9s cubic-bezier(.2,.7,.2,1);
}
.gslot:hover::after { transform: translateX(120%); }
body[data-game="sp"] .gslot::after { background: linear-gradient(105deg, transparent 36%, rgba(26,165,196,.12) 50%, transparent 64%); }
body[data-game="nw"] .gslot::after { background: linear-gradient(105deg, transparent 36%, rgba(184,145,63,.22) 50%, transparent 64%); }
body[data-game="pm"] .gslot::after { background: linear-gradient(105deg, transparent 36%, rgba(192,138,90,.16) 50%, transparent 64%); }

/* 图集：编号标签滑入 */
.ggal figure .gcn { transition: transform .35s cubic-bezier(.2,.7,.2,1), opacity .35s ease; }
.ggal figure:hover .gcn { transform: translateX(3px); }

/* 视图过渡时序 */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .34s; animation-timing-function: cubic-bezier(.2,.7,.2,1); }

@media (prefers-reduced-motion: reduce) {
  .gslot::after, .ggal figure .gcn { transition: none !important; }
}



/* v16.2 逐字入场改为动画触发：未触发时保持可见，避免无 IO 时文字消失 */
.fx-split span {
  display: inline-block; opacity: 1; transform: none;
  transition: none;
}
.fx-split.is-in span {
  animation: fxCharIn .6s cubic-bezier(.2,.7,.2,1) both;
  animation-delay: calc(var(--i, 0) * 16ms);
}
@keyframes fxCharIn {
  from { opacity: 0; transform: translateY(12px) rotate(.001deg); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .fx-split.is-in span { animation: none !important; }
}
/* ================= v17 · per-game interaction skins ================= */
/* WA2 — vignette breathing + film grain */
body[data-page="wa2"]::after{content:"";position:fixed;inset:0;pointer-events:none;z-index:1;background:radial-gradient(115% 85% at 50% 32%,transparent 52%,rgba(3,9,16,.62));animation:wa2breathe 10s ease-in-out infinite}
@keyframes wa2breathe{0%,100%{opacity:.5}50%{opacity:.85}}
body[data-page="wa2"] .gwrap{position:relative;z-index:2}

/* SP — click ripples (sea water) + warm grain */
.fx-ripple{position:fixed;width:14px;height:14px;margin:-7px 0 0 -7px;border:1px solid rgba(255,122,69,.7);border-radius:50%;pointer-events:none;z-index:90;animation:fxRipple 1.05s ease-out forwards}
@keyframes fxRipple{0%{opacity:.9;transform:scale(.4)}70%{opacity:.35}100%{opacity:0;transform:scale(7)}}
body[data-page="sp"] .gwrap{position:relative;z-index:2}

/* NW — gold corner ornaments fade in on each section */
body[data-page="nw"] .gsec .gwrap{position:relative}
body[data-page="nw"] .gsec .gwrap::before,body[data-page="nw"] .gsec .gwrap::after{content:"";position:absolute;width:26px;height:26px;border:1px solid rgba(184,145,63,.55);pointer-events:none;opacity:0;animation:nwOrn .9s ease forwards}
body[data-page="nw"] .gsec .gwrap::before{left:-4px;top:-4px;border-right:0;border-bottom:0}
body[data-page="nw"] .gsec .gwrap::after{right:-4px;bottom:-4px;border-left:0;border-top:0}
@keyframes nwOrn{to{opacity:1;transform:none}}

/* NW / shizuru — click sparkle */
.fx-sparkle{position:fixed;width:26px;height:26px;margin:-13px 0 0 -13px;pointer-events:none;z-index:92;background:
 linear-gradient(0deg,transparent 46%,rgba(217,180,95,.9) 50%,transparent 54%),
 linear-gradient(90deg,transparent 46%,rgba(217,180,95,.9) 50%,transparent 54%);
 animation:fxSparkle .65s ease-out forwards}
@keyframes fxSparkle{0%{opacity:1;transform:scale(.3) rotate(0)}100%{opacity:0;transform:scale(1.5) rotate(45deg)}}

/* PM — ink blot click + page edge shadow */
.fx-ink{position:fixed;width:20px;height:20px;margin:-10px 0 0 -10px;border-radius:50%;pointer-events:none;z-index:91;background:radial-gradient(circle,rgba(20,17,14,.55),rgba(20,17,14,0) 70%);animation:fxInk 1.3s ease-out forwards}
@keyframes fxInk{0%{opacity:.85;transform:scale(.4)}100%{opacity:0;transform:scale(6.5)}}
body[data-page="pm"] .gwrap{position:relative;z-index:2;box-shadow:inset 22px 0 34px -30px rgba(0,0,0,.9)}

/* shizuru — portrait frame draw */
body[data-page="shizuru"] .gprofile-img{position:relative}
body[data-page="shizuru"] .gprofile-img::after{content:"";position:absolute;inset:10px;border:1px solid rgba(184,145,63,.6);pointer-events:none;animation:nwOrn 1.1s .2s ease forwards;opacity:0}

/* PM ornament + shizuru frame rely on simple fade */
@media (prefers-reduced-motion: reduce){
  body[data-page="wa2"]::after{animation:none;opacity:.6}
  .fx-ripple,.fx-sparkle,.fx-ink{display:none}
}


/* ---------- v18 chapter pages ---------- */
.gslots-note{margin:-6px 0 20px;font-size:12.5px;line-height:1.7;color:var(--g-muted);opacity:.85}
.gslot-wrap{list-style:none}
a.gslot{display:grid;grid-template-columns:96px minmax(0,1fr) auto;align-items:center;gap:20px;color:inherit;text-decoration:none;background:var(--g-bg2);border:1px solid var(--g-line);padding:22px 24px;transition:border-color .25s ease,transform .25s ease,box-shadow .3s ease}
a.gslot:hover{border-color:var(--g-accent);transform:translateY(-2px);box-shadow:0 12px 28px rgba(0,0,0,.14)}
a.gslot:focus-visible{outline:2px solid var(--g-accent);outline-offset:3px}
a.gslot .gslot-go{font-size:12px;letter-spacing:.06em;color:var(--g-accent);white-space:nowrap}
a.gslot .gslot-no{font-size:clamp(26px,3vw,36px);font-family:var(--g-serif);letter-spacing:.04em;color:var(--g-accent)}
a.gslot .gslot-txt h3{margin:0 0 6px;font-size:clamp(18px,2vw,23px);font-family:var(--g-serif)}
a.gslot .gslot-txt p{margin:0;font-size:13.5px;line-height:1.8;color:var(--g-ink);opacity:.82}

.gch-hero{position:relative;min-height:66vh;display:flex;align-items:flex-end;overflow:hidden;background:var(--g-bg);isolation:isolate}
.gch-hero-bg{position:absolute;inset:0;z-index:-2}
.gch-hero-bg img{width:100%;height:100%;object-fit:cover;filter:brightness(.62) saturate(.95)}
.gch-hero::after{content:"";position:absolute;inset:0;z-index:-1;background:linear-gradient(to top,rgba(4,8,14,.92) 6%,rgba(4,8,14,.45) 46%,rgba(4,8,14,.18) 100%)}
.gch-hero-in{position:relative;padding:130px 0 54px;color:#fff}
.gch-crumb{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0 0 26px;font-size:11px;letter-spacing:.08em;color:rgba(255,255,255,.7)}
.gch-crumb a{color:inherit;text-decoration:none;border-bottom:1px solid transparent}
.gch-crumb a:hover{border-bottom-color:rgba(255,255,255,.6)}
.gch-crumb i{font-style:normal;opacity:.4}
.gch-crumb span{color:#fff}
.gch-no{display:inline-block;margin:0 0 14px;padding:4px 12px;border:1px solid rgba(255,255,255,.36);font-size:11px;letter-spacing:.22em;text-transform:uppercase}
.gch-title{margin:0 0 10px;font-family:var(--g-serif);font-size:clamp(30px,5vw,58px);line-height:1.08;letter-spacing:.01em}
.gch-sub{margin:0 0 16px;font-size:15px;letter-spacing:.04em;color:rgba(255,255,255,.78)}
.gch-lead{margin:0;max-width:44em;font-size:16px;line-height:1.9;color:rgba(255,255,255,.92)}
.gch-hero-cap{margin:18px 0 0;font-size:11px;letter-spacing:.06em;color:rgba(255,255,255,.5)}

.gch-body-sec{padding:0}
.gch-body{display:grid;grid-template-columns:minmax(0,1fr) 286px;gap:56px;padding:72px 0 24px}
.gch-main{min-width:0}
.gch-sec{padding:26px 0 6px;border-top:1px solid var(--g-line)}
.gch-sec:first-child{border-top:0;padding-top:0}
.gch-sec h2{display:flex;align-items:baseline;gap:14px;margin:0 0 18px;font-family:var(--g-serif);font-size:clamp(20px,2.2vw,26px);line-height:1.4}
.gch-sec h2 i{font-style:normal;font-family:var(--g-mono,monospace);font-size:11px;letter-spacing:.14em;color:var(--g-accent)}
.gch-sec-body p{margin:0 0 15px;font-size:15px;line-height:2;color:var(--g-ink)}
.gch-sec-body p:last-child{margin-bottom:24px}
.gch-aside{display:flex;flex-direction:column;gap:14px;align-self:start;position:sticky;top:96px}
.gch-card{background:var(--g-bg2);border:1px solid var(--g-line);padding:18px 20px 20px}
.gch-card h3{margin:0 0 12px;font-size:11px;letter-spacing:.16em;text-transform:uppercase;color:var(--g-muted)}
.gch-info{margin:0}
.gch-info div{display:flex;justify-content:space-between;gap:14px;padding:8px 0;border-bottom:1px dashed var(--g-line);font-size:12.5px;line-height:1.7}
.gch-info div:last-child{border-bottom:0}
.gch-info dt{margin:0;color:var(--g-muted);white-space:nowrap}
.gch-info dd{margin:0;text-align:right;color:var(--g-ink)}
.gch-chars{display:flex;flex-wrap:wrap;gap:6px;margin:0;padding:0;list-style:none}
.gch-chars li{padding:4px 11px;border:1px solid var(--g-line);font-size:12px;line-height:1.7;color:var(--g-ink)}
.gch-src{margin:0;font-size:11px;line-height:1.7;color:var(--g-muted);opacity:.8}

.gch-gal-sec{padding:24px 0 0}
.gch-figs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-top:22px}
.gch-fig{margin:0;background:var(--g-bg2);border:1px solid var(--g-line);overflow:hidden}
.gch-fig img{display:block;width:100%;aspect-ratio:4/3;object-fit:cover;transition:transform .5s ease}
.gch-fig:hover img{transform:scale(1.04)}
.gch-fig figcaption{padding:9px 11px;font-size:11.5px;line-height:1.6;letter-spacing:.04em;color:var(--g-muted)}

.gch-pager-sec{padding:56px 0 84px}
.gch-pager{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.gch-pager a{display:block;padding:18px 20px;border:1px solid var(--g-line);background:var(--g-bg2);color:inherit;text-decoration:none;transition:border-color .25s ease,transform .25s ease}
.gch-pager a:hover{border-color:var(--g-accent);transform:translateY(-2px)}
.gch-pager a i{display:block;margin-bottom:6px;font-style:normal;font-size:11px;letter-spacing:.12em;color:var(--g-muted)}
.gch-pager a b{font-family:var(--g-serif);font-size:16px;font-weight:600;line-height:1.5}
.gch-pager .gch-next{text-align:right}
.gch-pager .gch-next:only-child,.gch-pager .gch-prev:only-child{grid-column:1 / -1}
.gch-back{display:inline-block;margin-top:18px;font-size:13px;color:var(--g-accent);text-decoration:none}
.gch-back:hover{text-decoration:underline}

@media (max-width:1100px){
  .gch-body{grid-template-columns:minmax(0,1fr) 250px;gap:36px}
}
@media (max-width:900px){
  .gch-body{grid-template-columns:1fr;gap:28px;padding:52px 0 12px}
  .gch-aside{position:static;flex-direction:row;flex-wrap:wrap}
  .gch-card{flex:1 1 240px}
  .gch-figs{grid-template-columns:1fr 1fr}
}
@media (max-width:680px){
  .gch-hero{min-height:58vh}
  .gch-hero-in{padding:104px 0 40px}
  a.gslot{grid-template-columns:64px minmax(0,1fr);gap:14px;padding:18px}
  a.gslot .gslot-go{display:none}
  .gch-pager{grid-template-columns:1fr}
  .gch-pager .gch-next{text-align:left}
  .gch-figs{grid-template-columns:1fr}
  .gch-aside{flex-direction:column}
}


/* ---------- v18 footer on game pages (follow game palette) ---------- */
body.game .foot{background:var(--g-bg2, var(--g-bg));border-top:1px solid var(--g-line);color:var(--g-ink)}
body.game .foot-mark{color:var(--g-ink)}
body.game .foot-links,body.game .foot-meta{color:var(--g-muted)}
body.game .foot-links a:hover{color:var(--g-accent);border-color:var(--g-accent)}
body.game .foot-meta a{color:var(--g-ink);border-bottom:1px solid var(--g-line)}
body.game .foot-meta a:hover{color:var(--g-accent);border-color:var(--g-accent)}


/* ==========================================================================
   v19 交互与排版修整：菜单吸顶、锚点落点、去口号后的节奏、卡片细节
   ========================================================================== */

/* 1. 分区菜单吸顶：滚过 hero 后仍可点击跳转（头部固定高 72px / 窄屏 62px） */
body[data-game]:not([data-game="index"]) .gmenu {
  position: sticky;
  top: 72px;
  z-index: 40;
  background: var(--g-bg);
  box-shadow: 0 1px 0 var(--g-line);
}
@media (max-width: 900px) {
  body[data-game]:not([data-game="index"]) .gmenu { top: 62px; }
}

/* 2. 锚点落点避开固定头部 + 吸顶菜单 */
body[data-game] .gsec { scroll-margin-top: 152px; }
body[data-game="index"] .gindex { scroll-margin-top: 96px; }

/* 3. 去掉 hero 口号之后：标题到元信息的间距、hero 底部留白 */
body[data-game] .ghero-in .gmeta { margin-top: clamp(26px, 3.4vw, 40px); }
body[data-game] .ghero { padding-bottom: clamp(56px, 7vw, 96px); }
body[data-game] .gtitle { margin-bottom: 0; }

/* 4. 卡片与列表的细节统一 */
body[data-game] .gcast-card { transition: transform .35s cubic-bezier(.2,.7,.3,1), border-color .35s ease, box-shadow .35s ease; }
body[data-game] .gcast-card:hover { transform: translateY(-4px); }
body[data-game] .gcast-card.photo .gsp { height: 250px; }
body[data-game] .gcast-card .grole { letter-spacing: .18em; }

/* 章节卡片：左侧竖条在 hover 时展开，右侧箭头位移 */
body[data-game] .gslot::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: var(--g-accent);
  transform: scaleY(.18);
  transform-origin: 50% 50%;
  transition: transform .36s cubic-bezier(.2,.7,.3,1);
}
body[data-game] .gslot:hover::before { transform: scaleY(1); }
body[data-game] .gslot:hover .gslot-no { color: var(--g-accent); }

/* 5. 图集：hover 只做轻微提亮，不再位移，避免整块抖动 */
body[data-game] .ggal figure img { transition: transform .6s cubic-bezier(.2,.7,.3,1), filter .4s ease; }
body[data-game] .ggal figure:hover img { transform: scale(1.035); }

/* 6. 音乐块：播放按钮更明确 */
body[data-game] .gtrack .gplay { border: 1px solid var(--g-line); border-radius: 999px; padding: 9px 16px; }
body[data-game] .gtrack .gplay:hover { background: var(--g-accent); color: #fff; border-color: transparent; }

/* 7. 上一部 / 下一部：点击区域更大 */
body[data-game] .gnext a { display: block; padding: 14px 0; }
body[data-game] .gnext > div:hover a { color: var(--g-accent); }

/* 8. 头部长标题在窄屏不再顶满 */
@media (max-width: 640px) {
  body[data-game] .gtitle .gen { font-size: clamp(38px, 12.4vw, 64px); }
  body[data-game] .gmenu a { min-width: 92px; }
}

/* 9. 游戏总览：去掉说明段之后的标题留白 */
.gindex-hero { padding-bottom: clamp(28px, 4vw, 44px); }
.gindex-hero h1 { margin-bottom: 0; }


/* ---------- v19.2 移动端菜单单行横滑 + hero 高度避让播放器 ---------- */
@media (max-width: 760px) {
  body[data-game] .gmenu {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    gap: 0;
  }
  body[data-game] .gmenu::-webkit-scrollbar { display: none; }
  body[data-game] .gmenu a {
    flex: 0 0 auto;
    min-width: 0;
    padding: 13px 16px;
    scroll-snap-align: start;
  }
  body[data-game] .gmenu a b { font-size: 12.5px; }
}
@media (max-width: 640px) {
  body[data-game] .ghero { min-height: 76vh; }
}
