/* IKGames — 糖果贴纸风：奶油底、深墨蓝厚描边、粉 / 青 / 金点缀。色值取自咕咚的 look.luau。 */
:root {
  color-scheme: light dark;
  --bg: #fff7e6;
  --bg-2: #fff1d6;
  --surface: #ffffff;
  --ink: #1d1330;
  --sub: #6b5a7a;
  --line: #1d1330;
  --rule: #e3d3b0;
  --pink: #e8478a;
  --pink-soft: #ffd3e3;
  --cyan: #7df9e9;
  --cyan-soft: #d3fbf6;
  --gold: #ffb62e;
  --gold-soft: #fff0b8;
  --violet: #5540e0;
  --link: #4a35d0;
  --on-accent: #1d1330;
  --shadow: #1d1330;
  --r: 22px;
  --bw: 3px;
  --wrap: 1080px;
  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171026;
    --bg-2: #1d1330;
    --surface: #2a1c44;
    --ink: #fff7e6;
    --sub: #c9bcdb;
    --line: #0a0612;
    --rule: #43325f;
    --pink: #ff8fbc;
    --pink-soft: #5a2445;
    --cyan: #7df9e9;
    --cyan-soft: #1d4a52;
    --gold: #ffb62e;
    --gold-soft: #54401a;
    --violet: #b9a8ff;
    --link: #c3b5ff;
    --shadow: #0a0612;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.7 var(--font);
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { line-height: 1.2; font-weight: 900; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.1rem, 7vw, 3.6rem); }
h2 { font-size: clamp(1.5rem, 4.5vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); color: var(--ink); padding: 8px 14px; border: var(--bw) solid var(--line); border-radius: 12px; z-index: 20; }
.skip:focus { left: 12px; }

/* 页头 */
.top { padding: 16px 0; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 900; font-size: 1.02rem; line-height: 1.15; min-width: 0; }
.brand img { flex: none; width: 36px; height: 36px; border-radius: 10px; box-shadow: 0 0 0 2px var(--line), 0 3px 0 2px var(--shadow); }
.nav { display: flex; align-items: center; gap: 6px; flex: none; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 700; padding: 7px 12px; border-radius: 999px; font-size: 0.95rem; }
.nav a:hover { background: var(--bg-2); }
.nav a.lang { border: var(--bw) solid var(--line); background: var(--surface); box-shadow: 0 3px 0 var(--shadow); padding: 5px 14px; }
.nav a.lang:hover { background: var(--gold-soft); }
@media (max-width: 480px) { .nav .hide-s { display: none; } .brand { font-size: 0.95rem; } }

/* 贴纸件 */
.sticker { background: var(--surface); border: var(--bw) solid var(--line); border-radius: var(--r); box-shadow: 0 6px 0 var(--shadow); }
.shot { border: var(--bw) solid var(--line); border-radius: 18px; overflow: hidden; background: var(--line); box-shadow: 0 6px 0 var(--shadow); }
.shot img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.pill { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 0.85rem; padding: 4px 12px; border-radius: 999px; border: 2px solid var(--line); background: var(--cyan-soft); color: var(--ink); }
.pill.pink { background: var(--pink-soft); }
.pill.gold { background: var(--gold-soft); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 22px; font-weight: 900; font-size: 1rem; color: #1d1330; background: #ffd95a; border: var(--bw) solid var(--line); border-radius: 16px; box-shadow: 0 5px 0 var(--shadow); text-decoration: none; transition: transform 0.08s, box-shadow 0.08s; }
.btn:hover { transform: translateY(2px); box-shadow: 0 3px 0 var(--shadow); }
.btn.plain { background: var(--surface); color: var(--ink); }
.soon { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 18px; font-weight: 900; color: var(--ink); background: var(--surface); border: var(--bw) dashed var(--line); border-radius: 16px; }
.soon svg { width: 22px; height: 22px; flex: none; }
.row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* 主页 */
.hero { padding: 40px 0 28px; }
.hero p.lead { font-size: clamp(1.05rem, 2.6vw, 1.3rem); color: var(--sub); max-width: 34em; }
.hero h1 em { font-style: normal; background: linear-gradient(transparent 62%, var(--gold) 62%, var(--gold) 92%, transparent 92%); }
@media (prefers-color-scheme: dark) { .hero h1 em { background: linear-gradient(transparent 62%, #8a5a00 62%, #8a5a00 92%, transparent 92%); } }
section { padding: 36px 0; }
.eyebrow { font-weight: 900; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pink); margin-bottom: 8px; }
@media (prefers-color-scheme: light) { .eyebrow { color: #b8275f; } }

.project { display: grid; grid-template-columns: 1fr; overflow: hidden; color: var(--ink); }
.project .pic { border-bottom: var(--bw) solid var(--line); background: var(--line); }
.project .pic img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.project .body { padding: 22px 22px 26px; }
.project h3 { font-size: clamp(1.6rem, 5vw, 2.2rem); margin-bottom: 6px; }
.project h3 a { color: inherit; text-decoration: none; }
.project h3 a:hover { text-decoration: underline; }
.project .tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; padding: 0; list-style: none; }
@media (min-width: 820px) {
  .project { grid-template-columns: 1.25fr 1fr; }
  .project .pic { border-bottom: 0; border-right: var(--bw) solid var(--line); }
  .project .pic img { height: 100%; aspect-ratio: auto; min-height: 340px; }
  .project .body { padding: 32px; align-self: center; }
}
.projects { display: grid; gap: 28px; }
.contact { padding: 28px 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; background: var(--cyan-soft); }
.contact h2 { margin: 0 0 4px; }
.contact p { margin: 0; color: var(--sub); }

/* 游戏页 */
.game-hero { padding: 28px 0 12px; }
.game-hero .grid { display: grid; gap: 28px; align-items: center; }
.game-hero h1 { margin-bottom: 0.25em; }
.game-hero h1 small { display: block; font-size: 0.42em; color: var(--sub); font-weight: 800; letter-spacing: 0; margin-top: 6px; }
.game-hero .lead { font-size: 1.12rem; color: var(--sub); }
@media (min-width: 900px) { .game-hero .grid { grid-template-columns: 0.9fr 1.1fr; } .game-hero .shot { transform: rotate(1.2deg); } }
.features { display: grid; gap: 34px; margin: 0; padding: 0; list-style: none; }
.feature { display: grid; gap: 16px; align-items: center; }
.feature p { color: var(--sub); margin: 0; }
.feature .n { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: var(--bw) solid var(--line); background: var(--gold); color: #1d1330; font-weight: 900; margin-bottom: 10px; }
@media (min-width: 760px) {
  .feature { grid-template-columns: 1fr 1fr; gap: 36px; }
  .feature:nth-child(even) .shot { order: 2; }
}
.fair { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin: 0; padding: 0; list-style: none; }
.fair li { padding: 18px 20px; }
.fair strong { display: block; font-weight: 900; margin-bottom: 2px; }
.fair span { color: var(--sub); font-size: 0.95rem; }
.gallery { display: grid; gap: 16px; grid-template-columns: 1fr; margin: 0; padding: 0; list-style: none; }
@media (min-width: 560px) { .gallery { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .gallery { grid-template-columns: repeat(4, 1fr); } }
.gallery + .note { margin-top: 22px; }
.gallery a { display: block; position: relative; cursor: zoom-in; transition: transform 0.08s, box-shadow 0.08s; }
.gallery a:hover { transform: translateY(2px); box-shadow: 0 4px 0 var(--shadow); }
.gallery a:focus-visible { border-radius: 18px; }
.gallery figure { margin: 0; }
.gallery figcaption { font-size: 0.9rem; color: var(--sub); padding: 10px 4px 0; }
.note { font-size: 0.92rem; color: var(--sub); }
.cta { padding: 30px 24px; text-align: center; background: var(--pink-soft); }
.cta .row { justify-content: center; }

/* 大图浮层：原生 dialog，Esc 与焦点归还由浏览器管 */
.lightbox { width: min(96vw, 1280px); max-width: none; max-height: none; margin: auto; padding: 0; border: 0; background: transparent; color: #fff7e6; overflow: visible; }
.lightbox::backdrop { background: rgba(10, 6, 18, 0.88); }
.lightbox figure { margin: 0; }
.lightbox img { width: 100%; max-height: calc(100dvh - 150px); aspect-ratio: 16 / 9; object-fit: contain; background: #0a0612; border: var(--bw) solid #0a0612; border-radius: 18px; }
.lightbox figcaption { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 4px 0; font-weight: 700; }
.lightbox .count { flex: none; font-variant-numeric: tabular-nums; opacity: 0.75; font-weight: 400; }
.lightbox button { position: absolute; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border-radius: 50%; border: var(--bw) solid #0a0612; background: #fff7e6; color: #1d1330; box-shadow: 0 4px 0 #0a0612; cursor: pointer; }
.lightbox button:hover { background: #ffd95a; }
.lightbox button:focus-visible { outline-color: #7df9e9; border-radius: 50%; }
.lightbox button svg { width: 24px; height: 24px; }
.lightbox .x { top: -20px; right: -6px; }
.lightbox .prev, .lightbox .next { top: calc(50% - 46px); }
.lightbox .prev { left: -10px; }
.lightbox .next { right: -10px; }
@media (max-width: 700px) {
  .lightbox .x { top: -60px; right: 0; }
  .lightbox .prev, .lightbox .next { top: auto; bottom: -64px; }
  .lightbox .prev { left: calc(50% - 60px); }
  .lightbox .next { right: calc(50% - 60px); }
}

/* 条文页 */
.doc { max-width: 760px; padding-top: 20px; padding-bottom: 40px; }
.doc h1 { font-size: clamp(1.9rem, 6vw, 2.8rem); }
.doc h2 { font-size: 1.35rem; margin-top: 2em; padding-top: 0.2em; }
.doc h3 { font-size: 1.05rem; margin-top: 1.4em; }
.doc ul, .doc ol { padding-left: 1.3em; margin: 0 0 1em; }
.doc li { margin-bottom: 0.4em; }
.doc .meta { color: var(--sub); font-size: 0.95rem; }
.doc .summary { padding: 18px 22px; margin: 22px 0 8px; background: var(--gold-soft); }
.doc .summary ul { margin: 0; }
.doc .altlang { margin: 0 0 18px; }
.doc table { width: 100%; border-collapse: collapse; margin: 0 0 1em; font-size: 0.95rem; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 2px solid var(--rule); }
.doc th { font-weight: 900; }
.tablewrap { overflow-x: auto; }

/* 页脚 */
footer.foot { margin-top: 40px; padding: 28px 0 40px; border-top: var(--bw) solid var(--rule); color: var(--sub); font-size: 0.93rem; }
footer.foot .wrap { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; }
footer.foot ul { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 0; padding: 0; list-style: none; }
footer.foot a { color: var(--ink); }

/* 语言提示：不挡内容的一小条 */
.langhint { position: fixed; left: 12px; right: 12px; bottom: 12px; margin: 0 auto; max-width: 460px; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; font-size: 0.95rem; }
.langhint[hidden] { display: none; }
.langhint p { margin: 0; flex: 1; }
.langhint a { font-weight: 900; white-space: nowrap; }
.langhint button { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--line); background: var(--bg-2); color: var(--ink); font: 900 1rem/1 var(--font); cursor: pointer; }

.center { text-align: center; }
.e404 { padding: 60px 0; text-align: center; }
.e404 svg { width: 120px; height: 120px; margin: 0 auto 18px; display: block; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .btn, .gallery a { transition: none; } }

/* 预告片：先只放封面，点了才换成 YouTube 的播放器 */
.trailer { position: relative; max-width: 860px; aspect-ratio: 16 / 9; }
.trailer a { display: block; position: relative; height: 100%; }
.trailer img, .trailer iframe { display: block; width: 100%; height: 100%; object-fit: cover; border: 0; }
.trailer .play { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(29, 19, 48, 0.18); transition: background 0.12s; }
.trailer .play svg { width: 84px; height: 84px; padding: 16px 12px 16px 20px; background: #fff7e6; border: var(--bw) solid #1d1330; border-radius: 50%; box-shadow: 0 5px 0 #1d1330; }
.trailer a:hover .play, .trailer a:focus-visible .play { background: rgba(29, 19, 48, 0.04); }
.trailer + .note { color: var(--sub); font-size: 0.92rem; margin-top: 12px; max-width: 860px; }
