/* =========================================================
   玩樂島 PlayIsle — 前台基礎樣式（預設主題「貼紙島」）
   其他主題在 /static/css/themes/<主題>.css 覆寫這裡的設計變數
   米白紙張底 × 深墨描邊 × 實色位移陰影 × 明亮色塊
   ========================================================= */

:root {
  --ink: #1f1a2e;
  --ink-2: #4a4360;
  --muted: #6d6680;
  --paper: #fff8ec;
  --paper-2: #fff0d9;
  --card: #fff;
  --c-primary: #ff6b4a;
  --c-secondary: #12b5a5;
  --c-accent: #ffc533;
  --coral: #ff6b4a;
  --sun: #ffc533;
  --teal: #12b5a5;
  --grape: #6f4dff;
  --sky: #3fa2ff;
  --pink: #ff7eb6;
  --mint: #2fc58d;
  --bw: 2.5px;
  --border: var(--bw) solid var(--line);
  --pop-sm: 3px 3px 0 var(--shadow-c);
  --pop: 4px 4px 0 var(--shadow-c);
  --pop-lg: 6px 6px 0 var(--shadow-c);
  --r-sm: 13px;
  --r: 18px;
  --r-lg: 26px;
  --container: 1360px;
  --gutter: 24px;
  --font: "Noto Sans TC", system-ui, -apple-system, "PingFang TC", "Microsoft JhengHei", sans-serif;
  --font-display: "Fredoka", "Noto Sans TC", system-ui, -apple-system, "PingFang TC", "Microsoft JhengHei", sans-serif;
  --tabbar-h: 64px;
  /* ---- 主題可覆寫的設計變數 ---- */
  --bg: var(--paper);
  --bg-pattern: radial-gradient(rgba(31, 26, 46, .07) 1.2px, transparent 1.4px);
  --bg-size: 22px 22px;
  --bg-attach: scroll;
  --surface: #fff;
  --surface-2: var(--paper-2);
  --text: var(--ink);
  --text-2: var(--ink-2);
  --line: var(--ink);
  --shadow-c: var(--ink);
  --inv: var(--ink);
  --hl: var(--sun);
  --on-primary: var(--c-primary-ink, #fff);
  --scrim: rgba(31, 26, 46, .45);
  --header-bg: var(--paper);
  --footer-bg: var(--ink);
  --footer-fg: #cfc8e2;
  --footer-title: var(--sun);
  --footer-logo: #fff;
  --bw-sm: 2px;
  --border-sm: var(--bw-sm) solid var(--line);
  --pop-press: 1px 1px 0 var(--shadow-c);
  --pop-xs: 2px 2px 0 var(--shadow-c);
  --pop-xl: 8px 8px 0 var(--shadow-c);
  --tpop-xs: 2px 2px 0 var(--shadow-c);
  --tpop-sm: 3px 3px 0 var(--shadow-c);
  --tpop: 4px 4px 0 var(--shadow-c);
  --tpop-lg: 6px 6px 0 var(--shadow-c);
  --tstroke: var(--ink);
  --r-xs: 9px;
  --r-pill: 999px;
  --r-round: 50%;
  --tilt: 1;
  --body-weight: 500;
  --heading-weight: 700;
  --heading-spacing: normal;
  --heading-case: none;
}

.tone-coral { --tone: var(--coral); --tone-soft: #ffe3da; --tone-fg: var(--ink); }
.tone-sun { --tone: var(--sun); --tone-soft: #fff1c7; --tone-fg: var(--ink); }
.tone-teal { --tone: var(--teal); --tone-soft: #d2f3ee; --tone-fg: var(--ink); }
.tone-grape { --tone: var(--grape); --tone-soft: #e7e0ff; --tone-fg: #fff; }
.tone-sky { --tone: var(--sky); --tone-soft: #dcefff; --tone-fg: var(--ink); }
.tone-pink { --tone: var(--pink); --tone-soft: #ffe1ee; --tone-fg: var(--ink); }
.tone-mint { --tone: var(--mint); --tone-soft: #d5f5e7; --tone-fg: var(--ink); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font: var(--body-weight) 15.5px/1.65 var(--font);
  color: var(--text);
  background-color: var(--bg);
  background-image: var(--bg-pattern);
  background-size: var(--bg-size);
  background-attachment: var(--bg-attach);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { color: var(--text); line-height: 1.3; margin: 0; font-family: var(--font-display); font-weight: var(--heading-weight); letter-spacing: var(--heading-spacing); text-transform: var(--heading-case); }
p { margin: 0; }
[hidden] { display: none !important; }

.ic { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; vertical-align: -0.2em; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 1000; background: var(--inv); color: #fff; padding: 10px 16px; border-radius: var(--r-xs); }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }

@media (max-width: 899.98px) { .d-only { display: none !important; } }
@media (min-width: 900px) { .m-only { display: none !important; } }

/* 背景塗鴉（白色或指定色） */
.slide::after, .cat-art::before, .page-hero > .container::before, .showcase::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: var(--doodle, rgba(255, 255, 255, .22));
  -webkit-mask: url("/static/img/doodles.svg") 0 0 / 480px 320px repeat;
  mask: url("/static/img/doodles.svg") 0 0 / 480px 320px repeat;
}

/* ---------- 共用元件 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; border-radius: var(--r-pill);
  background: var(--c-primary); color: var(--on-primary); border: var(--border); box-shadow: var(--pop);
  font: 700 16px var(--font-display); letter-spacing: .02em;
  transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: var(--pop-lg); }
.btn:active { transform: translate(2px, 2px); box-shadow: var(--pop-press); }
.btn-lg { height: 54px; padding: 0 30px; font-size: 18px; }
.btn-ghost { background: var(--surface); color: var(--text); }

.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border: var(--border-sm); border-radius: var(--r-xs); font: 700 12px/1 var(--font-display); letter-spacing: .05em; box-shadow: var(--pop-xs); }
.badge-hot { background: var(--coral); color: var(--ink); transform: rotate(calc(-6deg * var(--tilt))); }
.badge-new { background: var(--mint); color: var(--ink); transform: rotate(calc(4deg * var(--tilt))); }

.chips { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 4px 4px 8px; }
.chips::-webkit-scrollbar { display: none; }
.chips-wrap { flex-wrap: wrap; overflow: visible; margin: 22px 0 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  height: 40px; padding: 0 16px; border-radius: var(--r-pill); border: var(--border-sm);
  background: var(--surface); color: var(--text); font: 700 14.5px var(--font-display); box-shadow: var(--pop-xs);
  transition: transform .15s, background .15s;
}
.chip small { font-size: 12px; color: var(--muted); }
.chip:hover { transform: translateY(-2px); }
.chip.active { background: var(--hl); }
.chip-sm { height: 32px; padding: 0 12px; font-size: 13px; }

.tag { display: inline-block; padding: 3px 12px; border-radius: var(--r-pill); border: var(--border-sm); background: var(--surface); font: 700 13px var(--font-display); }
.tag:hover { background: var(--hl); }
.tag-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 22px 0; color: var(--muted); }

.tape {
  position: absolute; z-index: 3; width: 104px; height: 26px;
  background: rgba(255, 197, 51, .88); border-left: 2px dashed rgba(31, 26, 46, .25); border-right: 2px dashed rgba(31, 26, 46, .25);
  transform: rotate(calc(-4deg * var(--tilt))); box-shadow: 0 2px 0 rgba(31, 26, 46, .12);
}

/* =========================================================
   頂部
   ========================================================= */
.appbar { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--hl); border-bottom: var(--border); }
.appbar-icon { width: 40px; height: 40px; border-radius: var(--r-xs); border: var(--border-sm); }
.appbar-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.appbar-text strong { font: 700 15px var(--font-display); }
.appbar-text span { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar-btn { flex-shrink: 0; padding: 8px 14px; border-radius: var(--r-pill); background: var(--inv); color: #fff; font: 700 13.5px var(--font-display); }
.appbar-close { display: grid; place-items: center; width: 28px; height: 28px; font-size: 18px; }

.hdr { position: sticky; top: 0; z-index: 60; background: var(--header-bg); border-bottom: var(--border); }
.hdr-in { display: flex; align-items: center; gap: 20px; height: 78px; }
.hdr-nav { flex: 1; display: flex; justify-content: center; align-items: center; gap: 2px; min-width: 0; }
.hdr-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.logo { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; line-height: 1; margin-right: 6px; }
.logo-img { height: 48px; width: auto; }
.logo-en { font: 700 30px/1 var(--font-display); letter-spacing: .01em; color: var(--text); }
.logo-zh { font: 900 17px/1 var(--font); color: var(--on-primary); background: var(--c-primary); border: var(--border); border-radius: var(--r-xs); padding: 6px 9px 7px; transform: rotate(calc(-4deg * var(--tilt))); box-shadow: var(--pop-sm); }
.logo-badge { font: 700 11px/1 var(--font); background: var(--hl); border: var(--border-sm); border-radius: var(--r-pill); padding: 4px 7px; transform: rotate(calc(8deg * var(--tilt))) translate(-2px, -11px); }

.nav-item { position: relative; }
.nav-link {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border-radius: var(--r-pill); border: 2px solid transparent;
  font: 700 16px var(--font-display); color: var(--text); white-space: nowrap; transition: background .15s, border-color .15s;
}
.nav-link:hover { background: var(--surface); border-color: var(--text); }
.nav-link.active { background: var(--hl); border-color: var(--text); box-shadow: var(--pop-xs); }
.nav-dot { display: grid; place-items: center; width: 26px; height: 26px; border-radius: var(--r-round); background: var(--tone); color: var(--tone-fg); border: var(--border-sm); font-size: 13px; }
.nav-dot .ic { stroke-width: 2.6; }

.drop { position: absolute; left: 50%; top: calc(100% + 12px); width: 400px; transform: translate(-50%, 8px); opacity: 0; visibility: hidden; transition: opacity .18s, transform .18s, visibility .18s; z-index: 70; }
.drop::before { content: ""; position: absolute; left: 0; right: 0; top: -16px; height: 16px; }
.has-drop:hover .drop, .has-drop:focus-within .drop { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.drop-card { background: var(--surface); border: var(--border); border-radius: var(--r); box-shadow: var(--pop-lg); overflow: hidden; }
.drop-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--tone); color: var(--tone-fg); border-bottom: var(--border); }
.drop-head strong { font: 700 17px var(--font-display); }
.drop-head a { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 13.5px; }
.drop-games { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px; }
.drop-game { border-radius: var(--r-sm); border: var(--border-sm); overflow: hidden; background: var(--bg); transition: transform .15s; }
.drop-game:hover { transform: translateY(-2px) rotate(calc(-1deg * var(--tilt))); }
.drop-game img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; border-bottom: var(--border-sm); }
.drop-game span { display: block; padding: 6px 10px; font: 700 14px var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.hdr-search { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: var(--r-pill); border: var(--border); background: var(--surface); font: 700 15px var(--font-display); color: var(--text-2); box-shadow: var(--pop-sm); transition: transform .15s; }
.hdr-search:hover { transform: translate(-1px, -1px); }
.hdr-btn {
  display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 16px; border-radius: var(--r-pill);
  background: var(--btn, var(--c-primary)); color: var(--btn-fg, #fff); border: var(--border); box-shadow: var(--pop-sm);
  font: 700 15px var(--font-display); white-space: nowrap; transition: transform .15s, box-shadow .15s;
}
.hdr-btn:hover { transform: translate(-2px, -2px); box-shadow: var(--pop); }
.hdr-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-round); background: var(--btn, var(--sun)); color: var(--btn-fg, var(--ink)); border: var(--border); font-size: 18px; box-shadow: var(--pop-xs); }

/* 搜尋浮層 */
.search-layer { position: fixed; inset: 0; z-index: 300; }
.search-backdrop { position: absolute; inset: 0; background: var(--scrim); animation: fade .15s; }
.search-box-big {
  position: absolute; left: 50%; top: 12vh; width: min(720px, calc(100vw - 24px)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 20px; border-radius: var(--r-pill);
  background: var(--surface); border: var(--border); box-shadow: var(--pop-lg); font-size: 22px; animation: drop .2s ease-out;
}
.search-box-big input { flex: 1; min-width: 0; border: 0; outline: none; height: 48px; font-size: 18px; font-weight: 600; background: none; }
.search-go { height: 46px; padding: 0 20px; border-radius: var(--r-pill); background: var(--c-primary); color: var(--on-primary); border: var(--border-sm); font: 700 16px var(--font-display); }
.search-close { display: grid; place-items: center; width: 42px; height: 42px; border-radius: var(--r-round); font-size: 20px; }
@keyframes drop { from { transform: translate(-50%, -10px); opacity: 0; } }

/* =========================================================
   首頁主視覺（輪播 + 側邊卡）
   ========================================================= */
.home-hero { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; padding-top: 28px; }
.home-hero.no-banner { grid-template-columns: 1fr; }
.hero { position: relative; border: var(--border); border-radius: var(--r-lg); box-shadow: var(--pop-lg); overflow: hidden; background: var(--grape); isolation: isolate; }
.hero-track { position: relative; height: 410px; }
.slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .6s ease, visibility .6s; background: var(--tone, var(--grape)); overflow: hidden; }
.slide.active { opacity: 1; visibility: visible; z-index: 1; }
.slide::after { z-index: 0; }
.slide-link { position: absolute; inset: 0; z-index: 5; }
.theme-neon { --tone: var(--grape); }
.theme-ocean { --tone: var(--sky); }
.theme-sunset { --tone: var(--coral); }
.theme-forest { --tone: var(--mint); }
.theme-candy { --tone: var(--pink); }
.slide.has-bg { background: var(--slide-bg) center / cover no-repeat; }
.slide.has-bg::after { background: linear-gradient(90deg, rgba(31, 26, 46, .55), transparent 65%); -webkit-mask: none; mask: none; }
.slide.textless::after { display: none; }

.slide-in { position: relative; z-index: 2; height: 100%; display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 10px; padding: 34px 40px 70px 46px; }
.slide-copy { color: #fff; }
.slide-eyebrow { display: inline-block; padding: 5px 13px; border-radius: var(--r-xs); background: var(--hl); color: var(--text); border: var(--border); box-shadow: var(--pop-sm); font: 700 17px/1.2 var(--font-display); letter-spacing: .08em; transform: rotate(calc(-3deg * var(--tilt))); }
.slide-title {
  margin: 18px 0 10px; font: 700 clamp(34px, 3.6vw, 56px)/1.15 var(--font-display); color: #fff;
  -webkit-text-stroke: 2px var(--tstroke); paint-order: stroke fill; text-shadow: var(--tpop);
}
.slide-sub { max-width: 28em; font-size: 18px; font-weight: 700; color: #fff; text-shadow: 0 2px 0 rgba(31, 26, 46, .35); }
.slide-btn { display: inline-flex; align-items: center; gap: 8px; margin-top: 22px; height: 50px; padding: 0 24px; border-radius: var(--r-pill); background: var(--hl); color: var(--text); border: var(--border); box-shadow: var(--pop); font: 700 18px var(--font-display); transition: transform .15s, box-shadow .15s; }
.slide:hover .slide-btn { transform: translate(-2px, -2px); box-shadow: var(--pop-lg); }
.slide-art { position: relative; height: 100%; min-height: 0; }
.slide-art img { position: absolute; inset: 0; margin: auto; max-height: 92%; max-width: 100%; width: auto; height: auto; }
.art-free img { filter: drop-shadow(6px 6px 0 rgba(31, 26, 46, .3)); animation: float 6s ease-in-out infinite; }
.art-card img { max-height: 70%; max-width: 92%; padding: 8px; background: var(--surface); border: var(--border); border-radius: var(--r-sm); box-shadow: var(--pop-lg); transform: rotate(calc(4deg * var(--tilt))); }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.hero-nav { position: absolute; left: 46px; bottom: 22px; z-index: 6; display: flex; align-items: center; gap: 10px; }
.hero-arrow { display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r-round); background: var(--surface); border: var(--border-sm); box-shadow: var(--pop-xs); font-size: 18px; transition: transform .15s; }
.hero-arrow:hover { transform: translateY(-2px); }
.hero-arrow .ic { stroke-width: 3; }
.hero-bars { display: flex; align-items: center; gap: 6px; }
.hero-bars button { position: relative; width: 14px; height: 14px; border-radius: var(--r-pill); background: var(--surface); border: var(--border-sm); overflow: hidden; transition: width .25s; }
.hero-bars button.active { width: 40px; }
.hero-bars i { position: absolute; inset: 0; }
.hero-bars .active i::after { content: ""; position: absolute; inset: 0; background: var(--hl); transform-origin: left; animation: barfill var(--dur, 6s) linear forwards; }
.hero.paused .hero-bars .active i::after { animation-play-state: paused; }
@keyframes barfill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.hero-side { display: grid; grid-template-rows: auto 1fr; gap: 24px; min-width: 0; }
.no-banner .hero-side { grid-template-rows: none; grid-template-columns: 1fr 2fr; }
.tile { position: relative; background: var(--surface); border: var(--border); border-radius: var(--r-lg); box-shadow: var(--pop-lg); }
.tile-random { display: flex; align-items: center; gap: 16px; padding: 20px; background: var(--hl); transition: transform .15s, box-shadow .15s; }
.tile-random:hover { transform: translate(-2px, -2px); box-shadow: var(--pop-xl); }
.tile-random:hover .dice { animation: wiggle .5s; }
.dice { position: relative; flex-shrink: 0; width: 62px; height: 62px; border-radius: var(--r-sm); background: var(--surface); border: var(--border); box-shadow: var(--pop-sm); transform: rotate(calc(-10deg * var(--tilt))); }
.dice i { position: absolute; width: 11px; height: 11px; border-radius: var(--r-round); background: var(--inv); }
.dice i:nth-child(1) { left: 9px; top: 9px; } .dice i:nth-child(2) { right: 9px; top: 9px; } .dice i:nth-child(3) { left: 50%; top: 50%; margin: -5.5px 0 0 -5.5px; background: var(--coral); }
.dice i:nth-child(4) { left: 9px; bottom: 9px; } .dice i:nth-child(5) { right: 9px; bottom: 9px; }
@keyframes wiggle { 25% { transform: rotate(calc(10deg * var(--tilt))); } 50% { transform: rotate(calc(-20deg * var(--tilt))); } 75% { transform: rotate(calc(6deg * var(--tilt))); } }
.tile-text { display: flex; flex-direction: column; min-width: 0; }
.tile-text strong { font: 700 24px/1.2 var(--font-display); }
.tile-text small { color: var(--text-2); font-size: 13.5px; font-weight: 600; }
.tile-go { margin-left: auto; display: grid; place-items: center; width: 40px; height: 40px; flex-shrink: 0; border-radius: var(--r-round); background: var(--inv); color: #fff; }
.tile-top { padding: 18px 18px 12px; display: flex; flex-direction: column; }
.tile-title { display: flex; align-items: center; gap: 8px; font: 700 18px var(--font-display); margin-bottom: 8px; }
.tile-title .ic { color: var(--coral); }
.top3 { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.top3 a { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--r-sm); transition: background .15s; }
.top3 a:hover { background: var(--surface-2); }
.rank { display: grid; place-items: center; width: 30px; height: 30px; flex-shrink: 0; border-radius: var(--r-round); border: var(--border-sm); font: 700 15px var(--font-display); }
.rank-1 { background: var(--hl); } .rank-2 { background: var(--teal); color: var(--ink); } .rank-3 { background: var(--coral); color: var(--ink); }
.top3 img { width: 72px; height: 45px; object-fit: cover; border-radius: var(--r-xs); border: var(--border-sm); flex-shrink: 0; }
.top3-t { display: flex; flex-direction: column; min-width: 0; }
.top3-t strong { font: 700 15.5px var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top3-t small { color: var(--muted); font-size: 12.5px; font-weight: 600; }

/* 公告膠帶 */
.ticker-clip { overflow: hidden; padding: 26px 0 8px; }
.ticker { position: relative; margin: 0 -10px; transform: rotate(calc(-1deg * var(--tilt))); background: var(--hl); border-top: var(--border); border-bottom: var(--border); }
.ticker-in { display: flex; align-items: center; height: 48px; }
.ticker-label { display: inline-flex; align-items: center; gap: 6px; height: 100%; padding: 0 18px 0 28px; background: var(--inv); color: var(--hl); font: 700 16px var(--font-display); flex-shrink: 0; }
.marquee { flex: 1; overflow: hidden; }
.marquee-track { display: inline-flex; gap: 46px; white-space: nowrap; padding-left: 30%; animation: marquee var(--mq, 30s) linear infinite; font-weight: 800; font-size: 15.5px; }
.marquee-track span::before { content: "★"; margin-right: 14px; color: var(--coral); }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-100%); } }

/* =========================================================
   區塊標題、分類卡、遊戲卡
   ========================================================= */
.section { padding-top: 48px; padding-bottom: 6px; }
.section-sm { padding-top: 26px; padding-bottom: 6px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.sec-head h2 { display: flex; align-items: center; gap: 12px; font-size: 28px; }
.sec-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-sm); background: var(--tone); color: var(--tone-fg); border: var(--border); box-shadow: var(--pop-sm); transform: rotate(calc(-6deg * var(--tilt))); font-size: 19px; }
.sec-more { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: var(--border-sm); border-radius: var(--r-pill); background: var(--surface); font: 700 14px var(--font-display); white-space: nowrap; box-shadow: var(--pop-xs); transition: transform .15s; }
.sec-more:hover { transform: translate(-1px, -1px); background: var(--hl); }
.h-sm { font-size: 20px; margin-bottom: 14px; }

.cat-tiles { display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); gap: 24px; }
.cat-tile { display: flex; flex-direction: column; border: var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--pop); overflow: hidden; transition: transform .2s, box-shadow .2s; }
.cat-tile:nth-child(odd) { transform: rotate(calc(-1.2deg * var(--tilt))); }
.cat-tile:nth-child(even) { transform: rotate(calc(1.2deg * var(--tilt))); }
.cat-tile:hover { transform: rotate(0) translateY(-5px); box-shadow: var(--pop-lg); }
.cat-art { position: relative; height: 210px; display: grid; place-items: center; background: var(--tone); overflow: hidden; }
.cat-art img { position: relative; height: 92%; width: auto; object-fit: contain; filter: drop-shadow(4px 4px 0 rgba(31, 26, 46, .25)); transition: transform .3s; }
.cat-tile:hover .cat-art img { transform: scale(1.06) rotate(calc(-3deg * var(--tilt))); }
.cat-big { position: relative; font-size: 88px; color: var(--tone-fg); }
.cat-meta { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: var(--border); }
.cat-ico { display: grid; place-items: center; width: 36px; height: 36px; flex-shrink: 0; border-radius: var(--r-round); background: var(--tone); color: var(--tone-fg); border: var(--border-sm); }
.cat-txt { display: flex; flex-direction: column; min-width: 0; }
.cat-txt strong { font: 700 17px var(--font-display); }
.cat-txt small { color: var(--muted); font: 600 11px var(--font-display); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-count { margin-left: auto; display: grid; place-items: center; min-width: 32px; height: 28px; padding: 0 8px; border-radius: var(--r-pill); background: var(--inv); color: #fff; font: 700 13px var(--font-display); }

.ggrid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 22px 20px; }
.ggrid-page { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); margin-top: 22px; }
.gcard { position: relative; background: var(--surface); border: var(--border); border-radius: var(--r); box-shadow: var(--pop); transition: transform .18s, box-shadow .18s; }
.gcard:hover { transform: translate(-2px, -3px) rotate(calc(-.6deg * var(--tilt))); box-shadow: var(--pop-lg); }
.gcard-link { display: block; height: 100%; padding: 8px 8px 12px; }
.gcard-media { position: relative; aspect-ratio: 16 / 10; border-radius: var(--r-sm); overflow: hidden; border: var(--border-sm); background: var(--surface-2); }
.gcard-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.gcard:hover .gcard-media img { transform: scale(1.06); }
.gcard-play { position: absolute; left: 50%; top: 50%; width: 50px; height: 50px; margin: -25px 0 0 -25px; display: grid; place-items: center; border-radius: var(--r-round); background: var(--c-primary); color: var(--on-primary); border: var(--border-sm); box-shadow: var(--pop-xs); font-size: 20px; opacity: 0; transform: scale(.6); transition: opacity .2s, transform .2s; }
.gcard-play .ic { margin-left: 3px; }
.gcard:hover .gcard-play { opacity: 1; transform: none; }
.badges { position: absolute; left: -7px; top: -9px; z-index: 2; display: flex; gap: 4px; }
.gcard-body { padding: 10px 4px 0; }
.gcard-title { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcard-desc { margin-top: 3px; font-size: 13px; line-height: 1.5; color: var(--muted); font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 3em; }
.gcard-cat { display: inline-flex; align-items: center; gap: 5px; margin-top: 9px; padding: 2px 10px; border-radius: var(--r-pill); border: var(--border-sm); background: var(--surface-2); font: 700 12px var(--font-display); }
.fav-btn { position: absolute; right: 14px; top: 14px; z-index: 3; display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-round); background: var(--surface); color: var(--text-2); border: var(--border-sm); box-shadow: var(--pop-xs); transition: transform .15s, background .15s; }
.fav-btn:hover { transform: scale(1.1); }
.fav-btn[aria-pressed="true"] { background: var(--pink); color: #fff; }
.fav-btn[aria-pressed="true"] .ic { fill: currentColor; }
.fav-btn.pop { animation: pop .35s; }
@keyframes pop { 50% { transform: scale(1.35) rotate(calc(-10deg * var(--tilt))); } }

/* 文章卡 */
.pgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
.pgrid-page { margin-top: 16px; }
.pcard { background: var(--surface); border: var(--border); border-radius: var(--r); box-shadow: var(--pop); overflow: hidden; transition: transform .18s, box-shadow .18s; }
.pcard:hover { transform: translate(-2px, -3px); box-shadow: var(--pop-lg); }
.pcard-link { display: flex; flex-direction: column; height: 100%; }
.pcard-media { aspect-ratio: 16 / 9; overflow: hidden; background: var(--tone, var(--surface-2)); border-bottom: var(--border); }
.pcard-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.pcard:hover .pcard-media img { transform: scale(1.05); }
.pcard-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pcard-tag { align-self: flex-start; display: inline-block; padding: 2px 10px; border-radius: var(--r-xs); border: var(--border-sm); background: var(--tone, var(--sun)); color: var(--tone-fg, var(--ink)); font: 700 12px var(--font-display); transform: rotate(calc(-2deg * var(--tilt))); }
.pcard-title { font-size: 19px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard-excerpt { font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard-meta { margin-top: auto; padding-top: 6px; font-size: 13px; color: var(--muted); display: flex; gap: 6px; font-weight: 600; }

/* 首頁底部 */
.home-bottom { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; padding-bottom: 70px; align-items: start; }
.intro-card { position: relative; background: var(--grape); color: #fff; border: var(--border); border-radius: var(--r-lg); box-shadow: var(--pop-lg); padding: 36px 36px 30px; }
.intro-card .tape { top: -14px; left: 40px; }
.intro-card h2 { color: #fff; font-size: 26px; margin-bottom: 14px; text-shadow: var(--tpop-sm); }
.intro-card .prose { color: rgba(255, 255, 255, .94); }
.intro-card .prose strong { color: #fff; background: linear-gradient(transparent 62%, rgba(255, 197, 51, .55) 62%); }
.intro-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 24px; }
.intro-stats div { text-align: center; padding: 14px 8px; border-radius: var(--r); background: var(--tone); color: var(--tone-fg); border: var(--border); box-shadow: var(--pop-sm); }
.intro-stats div:nth-child(2) { transform: rotate(calc(2deg * var(--tilt))); }
.intro-stats strong { display: block; font: 700 32px/1.1 var(--font-display); }
.intro-stats span { font-size: 13px; font-weight: 700; }
.faq-card { background: var(--surface); border: var(--border); border-radius: var(--r-lg); box-shadow: var(--pop-lg); padding: 30px 30px 26px; }
.faq-card h2 { font-size: 26px; margin-bottom: 16px; }
.faq-card .sec-more { margin-top: 18px; }
.faq-list { display: flex; flex-direction: column; gap: 10px; }
.faq-item { border: var(--border-sm); border-radius: var(--r-sm); background: var(--bg); overflow: hidden; transition: box-shadow .15s; }
.faq-item summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; font: 700 16px var(--font-display); }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .ic { flex-shrink: 0; width: 28px; height: 28px; padding: 4px; border-radius: var(--r-round); background: var(--hl); border: var(--border-sm); transition: transform .2s; }
.faq-item[open] { background: var(--surface); box-shadow: var(--pop-sm); }
.faq-item[open] summary .ic { transform: rotate(180deg); }
.faq-item .prose { padding: 0 16px 16px; color: var(--text-2); }

/* =========================================================
   內頁
   ========================================================= */
.page-hero { padding-top: 28px; }
.page-hero > .container {
  position: relative; overflow: hidden; width: calc(100% - 2 * var(--gutter)); max-width: calc(var(--container) - 2 * var(--gutter));
  padding: 26px 34px 30px; background: var(--c-primary); color: #fff; border: var(--border); border-radius: var(--r-lg); box-shadow: var(--pop-lg);
}
.page-hero-cat > .container { background: var(--c-secondary); }
.page-hero > .container > * { position: relative; }
.page-hero h1 { color: #fff; font-size: 38px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; text-shadow: var(--tpop-sm); }
.page-hero h1 small { font-size: 17px; text-shadow: none; opacity: .9; }
.page-hero-sub { margin-top: 6px; font-weight: 700; opacity: .95; }
.page-hero-sub a { text-decoration: underline; text-underline-offset: 3px; }
.page-hero-row { display: flex; align-items: center; gap: 16px; }
.page-hero-icon { display: grid; place-items: center; width: 62px; height: 62px; border-radius: var(--r); background: var(--surface); color: var(--text); border: var(--border); box-shadow: var(--pop-sm); font-size: 30px; transform: rotate(calc(-6deg * var(--tilt))); flex-shrink: 0; }
.page-hero .crumbs { margin: 0 0 12px; color: rgba(255, 255, 255, .9); }
.page-hero .crumbs a:hover { color: #fff; text-decoration: underline; }
.page-hero .big-search { color: var(--text-2); }
.crumbs { margin: 18px 0 14px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.crumbs li + li::before { content: "/"; margin-right: 4px; opacity: .6; }
.crumbs a:hover { color: var(--text); }

.filterbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 26px; }
.sorts { display: flex; flex-shrink: 0; padding: 4px; border-radius: var(--r-pill); background: var(--surface); border: var(--border-sm); box-shadow: var(--pop-xs); }
.sorts a { padding: 6px 14px; border-radius: var(--r-pill); font: 700 14px var(--font-display); color: var(--text-2); }
.sorts a.active { background: var(--inv); color: #fff; }
.cat-intro { margin: 40px 0 12px; padding: 26px 30px; background: var(--surface); border: var(--border); border-radius: var(--r-lg); box-shadow: var(--pop); }

.pagination { display: flex; justify-content: center; gap: 8px; margin: 36px 0 10px; flex-wrap: wrap; }
.pg-btn { display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 10px; border-radius: var(--r-sm); background: var(--surface); border: var(--border-sm); box-shadow: var(--pop-xs); font: 700 16px var(--font-display); }
.pg-btn:hover { background: var(--hl); }
.pg-btn.active { background: var(--c-primary); color: var(--on-primary); }
.pg-gap { display: grid; place-items: center; width: 24px; color: var(--muted); }

.empty { text-align: center; padding: 60px 20px; color: var(--text-2); }
.empty > .ic { width: 84px; height: 84px; padding: 18px; border-radius: var(--r-round); background: var(--hl); border: var(--border); box-shadow: var(--pop); margin-bottom: 18px; }
.empty p { margin-bottom: 18px; font-weight: 700; }

/* =========================================================
   遊戲介紹頁：展示區
   ========================================================= */
.showcase { position: relative; overflow: hidden; isolation: isolate; background: var(--sc-bg); border-bottom: var(--border); --doodle: rgba(31, 26, 46, .07); }
.showcase::before { z-index: -1; }
.sc-sakura { --sc-bg: #ffe5ef; --sc-main: var(--pink); --sc-fg: #fff; }
.sc-sky { --sc-bg: #def0ff; --sc-main: var(--sky); --sc-fg: #fff; }
.sc-mint { --sc-bg: #d9f6e9; --sc-main: var(--mint); --sc-fg: #fff; }
.sc-lavender { --sc-bg: #ebe5ff; --sc-main: var(--grape); --sc-fg: #fff; }
.sc-sunset { --sc-bg: #ffe8d6; --sc-main: var(--coral); --sc-fg: #fff; }
.sc-night { --sc-bg: #2a2342; --sc-main: var(--sun); --sc-fg: var(--ink); --doodle: rgba(255, 255, 255, .08); }

.sc-pills { padding: 26px 0 0; }
.sc-pills-in { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.sc-pill { display: inline-flex; align-items: center; height: 44px; padding: 0 20px; border-radius: var(--r-pill); background: var(--surface); border: var(--border-sm); box-shadow: var(--pop-xs); font: 700 16px var(--font-display); white-space: nowrap; transition: transform .15s; }
.sc-pill:hover { transform: translateY(-2px); }
.sc-pill.active { background: var(--sc-main); color: var(--sc-fg); }

.sc-stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 620px) minmax(0, 1fr); align-items: end; gap: 10px; min-height: 600px; }
.sc-side { position: relative; align-self: stretch; min-height: 540px; }
.sc-side img { position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; width: auto; height: auto; max-width: 110%; max-height: 88%; filter: drop-shadow(6px 6px 0 rgba(31, 26, 46, .2)); }
.sc-left img { animation: float 6s ease-in-out infinite; }
.sc-card img { bottom: 24%; max-width: 88%; max-height: 58%; padding: 10px 10px 34px; background: var(--surface); border: var(--border); border-radius: var(--r-sm); box-shadow: var(--pop-lg); filter: none; transform: rotate(calc(5deg * var(--tilt))); }

.sc-center { align-self: center; position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 28px 0 54px; }
.sc-title {
  font: 700 clamp(48px, 5.4vw, 92px)/1.12 var(--font-display); letter-spacing: .04em; color: var(--sc-main);
  -webkit-text-stroke: 3px var(--tstroke); paint-order: stroke fill; text-shadow: var(--tpop);
}
.sc-title-img img { max-height: 180px; width: auto; margin: 0 auto; filter: drop-shadow(5px 5px 0 rgba(31, 26, 46, .3)); }
.sc-tagline { margin-top: 16px; padding: 7px 20px; border-radius: var(--r-pill); background: var(--surface); border: var(--border-sm); box-shadow: var(--pop-sm); font: 700 clamp(16px, 1.4vw, 21px) var(--font-display); letter-spacing: .1em; transform: rotate(calc(-2deg * var(--tilt))); }

.sc-panel { position: relative; width: min(620px, 100%); margin-top: 44px; padding: 38px 40px 62px; border-radius: var(--r-lg); background: var(--surface); border: var(--border); box-shadow: var(--pop-lg); }
.sc-panel .tape-l { top: -14px; left: -22px; transform: rotate(calc(-32deg * var(--tilt))); }
.sc-panel .tape-r { top: -14px; right: -22px; transform: rotate(calc(32deg * var(--tilt))); }
.sc-panel-text { font-size: clamp(16px, 1.2vw, 19px); font-weight: 700; line-height: 1.85; color: var(--text); }
.sc-panel-meta { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; margin-top: 18px; }
.sc-panel-meta a, .sc-panel-meta > span:not(.badge) { display: inline-flex; align-items: center; gap: 5px; padding: 3px 12px; border-radius: var(--r-pill); border: var(--border-sm); background: var(--surface-2); font: 700 13.5px var(--font-display); }
.sc-panel-meta a:hover { background: var(--hl); }
.sc-start {
  position: relative; z-index: 3; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  margin-top: -32px; min-width: 240px; height: 64px; padding: 0 38px; border-radius: var(--r-pill);
  background: var(--c-primary); color: var(--on-primary); border: var(--border); box-shadow: var(--pop-lg);
  font: 700 24px var(--font-display); letter-spacing: .08em; transition: transform .15s, box-shadow .15s;
}
.sc-night .sc-start { background: var(--hl); color: var(--text); }
.sc-start:hover { transform: translate(-2px, -2px); box-shadow: var(--pop-xl); }
.sc-start:active { transform: translate(3px, 3px); box-shadow: var(--pop-xs); }
.sc-start-sm { margin-top: 20px; min-width: 0; height: 50px; padding: 0 26px; font-size: 18px; box-shadow: var(--pop); }
.sc-actions { display: flex; gap: 10px; margin-top: 20px; }
.sc-act { position: static; width: auto; height: 38px; display: inline-flex; align-items: center; gap: 6px; padding: 0 16px; border-radius: var(--r-pill); background: var(--surface); border: var(--border-sm); box-shadow: var(--pop-xs); color: var(--text); font: 700 14px var(--font-display); }
.sc-act:hover { transform: translateY(-2px); background: var(--hl); }
.sc-act.fav-btn[aria-pressed="true"] { background: var(--pink); color: #fff; }

.game-body { padding-bottom: 30px; }
.game-lead { margin: -2px 0 12px; font-size: 16px; font-weight: 700; }
.game-info { display: grid; grid-template-columns: 1.5fr 1fr; gap: 24px; align-items: start; }
.info-card { background: var(--surface); border: var(--border); border-radius: var(--r-lg); padding: 24px 26px; box-shadow: var(--pop); }
.info-card h2 { display: flex; align-items: center; gap: 10px; font-size: 21px; margin-bottom: 14px; }
.info-card h2 .ic { width: 34px; height: 34px; padding: 6px; border-radius: var(--r-xs); background: var(--hl); border: var(--border-sm); }
.info-how { background: var(--surface-2); }

.side-list { display: flex; flex-direction: column; gap: 8px; }
.side-game { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--r-sm); transition: background .15s; }
.side-game:hover { background: var(--surface-2); }
.side-game img { width: 92px; height: 58px; object-fit: cover; border-radius: var(--r-xs); border: var(--border-sm); flex-shrink: 0; }
.side-game span { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.side-game strong { font: 700 15.5px var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-game small { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.side-play { color: var(--c-primary); font-size: 18px; }

.post-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.post-list a { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--surface); border: var(--border-sm); border-radius: var(--r-sm); box-shadow: var(--pop-xs); font: 700 15px var(--font-display); transition: transform .15s; }
.post-list a:hover { transform: translate(-1px, -1px); background: var(--hl); }

/* ---- 全螢幕播放頁 ---- */
.page-play { background: var(--inv); overflow: hidden; padding-bottom: 0 !important; }
.pw { display: flex; flex-direction: column; height: 100dvh; }
.pw-bar { flex: 0 0 56px; display: flex; align-items: center; gap: 12px; padding: 0 14px; background: var(--bg); border-bottom: var(--border); }
.pw-home img { display: block; }
.pw-title { flex: 1; min-width: 0; font: 700 17px var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pw-actions { display: flex; gap: 8px; }
.pw-actions button, .pw-actions a { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: var(--r-pill); background: var(--surface); border: var(--border-sm); box-shadow: var(--pop-xs); font: 700 14px var(--font-display); }
.pw-actions button:hover, .pw-actions a:hover { background: var(--hl); }
.pw-stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; isolation: isolate; background: var(--inv); }
.pw-stage::before { content: ""; position: absolute; inset: -40px; z-index: -1; background: var(--poster) center / cover; filter: blur(34px) brightness(.45) saturate(1.2); }
.pw-frame { display: block; border: 0; background: #000; aspect-ratio: var(--ar); width: min(100vw, calc((100dvh - 56px) * var(--arn))); max-height: calc(100dvh - 56px); }
.pw-exit { display: none; position: absolute; top: 12px; right: 12px; z-index: 5; width: 44px; height: 44px; border-radius: var(--r-round); background: var(--surface); border: var(--border); place-items: center; font-size: 20px; }
.pw.max .pw-bar { display: none; }
.pw.max .pw-frame, .pw-stage:fullscreen .pw-frame { width: min(100vw, calc(100dvh * var(--arn))); max-height: 100dvh; }
.pw.max .pw-exit, .pw-stage:fullscreen .pw-exit { display: grid; }

/* =========================================================
   文章與頁面
   ========================================================= */
.prose { color: var(--text-2); line-height: 1.85; overflow-wrap: anywhere; font-weight: 500; }
.prose > * + * { margin-top: 1em; }
.prose h2 { font-size: 1.45em; color: var(--text); margin-top: 1.8em; scroll-margin-top: 110px; }
.prose h2::after { content: ""; display: block; width: 56px; height: 6px; margin-top: 6px; border-radius: var(--r-xs); background: var(--hl); border: var(--border-sm); }
.prose h3 { font-size: 1.2em; color: var(--text); margin-top: 1.5em; scroll-margin-top: 110px; }
.prose a { color: var(--text); font-weight: 700; text-decoration: underline; text-decoration-color: var(--c-primary); text-decoration-thickness: 3px; text-underline-offset: 3px; }
.prose a:hover { background: var(--hl); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .35em; }
.prose li::marker { color: var(--c-primary); font-weight: 700; }
.prose strong { color: var(--text); }
.prose blockquote { margin-left: 0; padding: 14px 18px; border-radius: var(--r-sm); background: var(--surface-2); border: var(--border-sm); }
.prose code { background: var(--surface-2); padding: 2px 6px; border-radius: var(--r-xs); font-size: .9em; }
.prose pre { background: var(--inv); color: #f1ecff; padding: 16px; border-radius: var(--r-sm); overflow: auto; }
.prose pre code { background: none; padding: 0; }
.prose img { border-radius: var(--r-sm); border: var(--border-sm); margin: 1.2em auto; }
.prose hr { border: 0; border-top: 2px dashed var(--line); opacity: .3; margin: 2em 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: .95em; }
.prose th, .prose td { border: var(--border-sm); padding: 8px 12px; text-align: left; }
.prose th { background: var(--surface-2); }
.prose iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: var(--border); border-radius: var(--r-sm); }
.prose > :first-child { margin-top: 0; }
.prose-lg { font-size: 16.5px; }
.intro-card .prose h2::after, .faq-item .prose h2::after { display: none; }

.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
.article { background: var(--surface); border: var(--border); border-radius: var(--r-lg); box-shadow: var(--pop-lg); padding: 38px 46px 30px; }
.article-head h1 { font-size: 34px; line-height: 1.35; margin-top: 12px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 14px; color: var(--muted); font-size: 14px; font-weight: 700; }
.article-meta span { display: inline-flex; align-items: center; gap: 6px; }
.article-cover { margin: 26px 0 0; }
.article-cover img { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: var(--r); border: var(--border); }
.article-lead { margin-top: 22px; font-size: 17px; font-weight: 700; padding: 16px 20px; background: var(--surface-2); border: var(--border-sm); border-radius: var(--r-sm); }
.article-lead + .prose, .toc + .prose { margin-top: 26px; }
.toc { margin-top: 24px; padding: 18px 22px; border-radius: var(--r); border: 2px dashed var(--line); background: var(--bg); }
.toc-title { font: 700 16px var(--font-display); margin-bottom: 8px; }
.toc ol { margin: 0; padding-left: 1.3em; display: grid; gap: 4px; }
.toc a { font-weight: 700; color: var(--text-2); }
.toc a:hover { color: var(--text); background: var(--hl); }
.article-foot { margin-top: 30px; padding-top: 20px; border-top: 2px dashed rgba(31, 26, 46, .3); }
.share-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; color: var(--muted); font-weight: 700; }
.share-btn { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: var(--r-pill); background: var(--surface); border: var(--border-sm); box-shadow: var(--pop-xs); color: var(--text); font: 700 14px var(--font-display); }
.share-btn:hover { background: var(--hl); }
.article-aside { position: sticky; top: 104px; display: flex; flex-direction: column; gap: 22px; }
.aside-card { background: var(--surface); border: var(--border); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--pop); }
.aside-title { font: 700 18px var(--font-display); margin-bottom: 12px; }
.aside-card .post-list a { box-shadow: none; }

.doc-layout { display: grid; grid-template-columns: minmax(0, 1fr); max-width: 940px; margin-top: 30px; margin-bottom: 40px; }
.doc-layout.has-toc { grid-template-columns: 250px minmax(0, 1fr); max-width: 1200px; gap: 28px; align-items: start; }
.doc { background: var(--surface); border: var(--border); border-radius: var(--r-lg); padding: 38px 46px; box-shadow: var(--pop-lg); }
.toc-side { position: sticky; top: 104px; margin-top: 0; background: var(--surface); border-style: solid; box-shadow: var(--pop-sm); }

.faq-page { max-width: 900px; padding-bottom: 40px; }
.faq-group { margin-top: 34px; scroll-margin-top: 110px; }
.faq-group h2 { font-size: 22px; margin-bottom: 14px; }
.faq-page .faq-item { background: var(--surface); }
.cta-card { margin-top: 40px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 24px 28px; border-radius: var(--r-lg); background: var(--hl); border: var(--border); box-shadow: var(--pop-lg); }
.cta-card strong { font: 700 20px var(--font-display); }
.cta-card p { color: var(--text-2); font-weight: 600; }

.contact-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; margin-top: 30px; margin-bottom: 40px; align-items: start; }
.form-card { background: var(--surface); border: var(--border); border-radius: var(--r-lg); padding: 32px; box-shadow: var(--pop-lg); }
.form { display: flex; flex-direction: column; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form label { display: flex; flex-direction: column; gap: 8px; font: 700 15px var(--font-display); }
.form label b { color: var(--coral); }
.form input, .form select, .form textarea { width: 100%; padding: 12px 14px; border-radius: var(--r-sm); border: var(--border-sm); background: var(--bg); font: 500 15px var(--font); outline: none; transition: box-shadow .15s, background .15s; }
.form input:focus, .form select:focus, .form textarea:focus { background: var(--surface); box-shadow: var(--pop-sm); }
.form textarea { resize: vertical; }
.form .btn { align-self: flex-start; }
.form-note { font-size: 13px; color: var(--muted); font-weight: 600; }
.form-note a { text-decoration: underline; }
.hp { position: absolute !important; left: -9999px !important; }
.alert { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-radius: var(--r-sm); border: var(--border-sm); font-weight: 700; margin-bottom: 18px; }
.alert-ok { background: #d5f5e7; }
.alert-err { background: #ffe3da; }
.contact-aside { display: flex; flex-direction: column; gap: 22px; }
.contact-line { display: flex; align-items: center; gap: 8px; font-weight: 800; margin-bottom: 10px; }
.contact-line a { text-decoration: underline; text-decoration-color: var(--c-primary); text-decoration-thickness: 3px; }
.muted { color: var(--muted); font-size: 14px; font-weight: 600; }

.big-search { display: flex; align-items: center; gap: 10px; margin-top: 18px; max-width: 640px; padding: 6px 6px 6px 18px; border-radius: var(--r-pill); background: var(--surface); border: var(--border); box-shadow: var(--pop); color: var(--text-2); font-size: 20px; }
.big-search input { flex: 1; min-width: 0; border: 0; outline: none; height: 44px; font-size: 16px; font-weight: 600; background: none; color: var(--text); }
.big-search .btn { height: 44px; box-shadow: none; }

.error-page { padding-bottom: 40px; }
.error-hero { text-align: center; padding: 60px 0 20px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.error-code { font: 700 140px/1 var(--font-display); color: var(--hl); -webkit-text-stroke: 4px var(--tstroke); paint-order: stroke fill; text-shadow: var(--tpop-lg); transform: rotate(calc(-4deg * var(--tilt))); }
.error-hero h1 { font-size: 30px; }
.error-hero p { color: var(--text-2); font-weight: 600; }
.error-hero .big-search { width: 100%; }
.error-actions { display: flex; gap: 12px; margin-top: 10px; }

/* =========================================================
   頁尾
   ========================================================= */
.footer { position: relative; margin-top: 80px; background: var(--footer-bg); color: var(--footer-fg); }
.footer-wave { position: absolute; left: 0; top: -46px; width: 100%; height: 48px; fill: var(--footer-bg); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; padding-top: 44px; padding-bottom: 36px; }
.logo-footer .logo-en { color: var(--footer-logo); font-size: 28px; }
.logo-footer .logo-badge { color: var(--ink); }
.f-brand p { margin-top: 16px; font-size: 14px; line-height: 1.8; max-width: 380px; font-weight: 500; }
.f-title { color: var(--footer-title); font: 700 17px var(--font-display); margin-bottom: 14px; }
.f-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; font-size: 14.5px; font-weight: 600; }
.f-links a:hover { color: #fff; text-decoration: underline; text-decoration-color: var(--c-primary); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.socials { display: flex; gap: 10px; margin-top: 18px; }
.socials a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-round); background: rgba(255, 255, 255, .08); border: 2px solid rgba(255, 255, 255, .2); color: #fff; font-size: 18px; transition: background .15s, transform .15s; }
.socials a:hover { background: var(--c-primary); transform: rotate(calc(-8deg * var(--tilt))); }
.socials-dark a { background: var(--surface); border-color: var(--text); color: var(--text); box-shadow: var(--pop-xs); }
.socials-dark a:hover { color: #fff; }
.footer-bottom { border-top: 2px dashed rgba(255, 255, 255, .14); font-size: 13px; font-weight: 600; }
.footer-bottom .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding-top: 18px; padding-bottom: 20px; }

.to-top { position: fixed; right: 22px; bottom: 26px; z-index: 50; width: 48px; height: 48px; border-radius: var(--r-round); display: grid; place-items: center; background: var(--hl); border: var(--border); box-shadow: var(--pop); font-size: 20px; }
.to-top .ic { stroke-width: 3; }
.toast { position: fixed; left: 50%; bottom: 40px; z-index: 2000; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 12px 20px; border-radius: var(--r-pill); background: var(--inv); color: #fff; border: 2px solid var(--hl); font: 700 14.5px var(--font-display); transition: opacity .25s, transform .25s; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* =========================================================
   平板
   ========================================================= */

/* =========================================================
   新功能：今日推薦、最近玩過、排行榜、專題、評分、搜尋建議、廣告
   ========================================================= */
.tile-title .tile-more { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; font: 700 13px var(--font-display); color: var(--text-2); }
.tile-title .tile-more:hover { color: var(--text); text-decoration: underline; }
.tile-title .tile-more .ic { color: inherit; }

.daily-wrap { padding-top: 26px; }
.daily { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 28px; align-items: center; background: var(--surface); border: var(--border); border-radius: var(--r-lg); box-shadow: var(--pop-lg); padding: 18px 28px 18px 18px; }
.daily-art { display: block; border-radius: var(--r); overflow: hidden; border: var(--border-sm); box-shadow: var(--pop-sm); transform: rotate(calc(-1.5deg * var(--tilt))); }
.daily-art img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; transition: transform .3s; }
.daily-art:hover img { transform: scale(1.04); }
.daily-eyebrow { display: flex; align-items: center; gap: 8px; font: 700 15px var(--font-display); color: var(--text-2); }
.daily-eyebrow .ic { color: var(--c-primary); font-size: 18px; }
.daily-eyebrow small { margin-left: 4px; padding: 2px 10px; border-radius: var(--r-pill); background: var(--surface-2); border: var(--border-sm); font-size: 12px; }
.daily-title { font-size: 34px; margin: 6px 0 6px; }
.daily-title a:hover { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 5px; }
.daily-desc { color: var(--text-2); font-weight: 600; max-width: 60ch; }
.daily-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 12px 0 16px; font-weight: 700; color: var(--text-2); font-size: 14px; }
.daily-meta span { display: inline-flex; align-items: center; gap: 5px; }
.stars-mini .ic { color: #f5a400; fill: currentColor; }

.recent-wrap .sec-more { cursor: pointer; background: none; }

/* 排行榜 */
.rank-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; margin-top: 30px; margin-bottom: 30px; }
.rank-board { background: var(--surface); border: var(--border); border-radius: var(--r-lg); box-shadow: var(--pop-lg); padding: 22px 22px 14px; min-width: 0; }
.rank-head { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.rank-head h2 { font-size: 22px; }
.rank-head p { color: var(--text-2); font-size: 13.5px; font-weight: 600; }
.rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rank-list li + li { border-top: 1px dashed var(--line); }
.rank-list a { display: flex; align-items: center; gap: 12px; padding: 9px 6px; border-radius: var(--r-sm); transition: background .15s; }
.rank-list a:hover { background: var(--surface-2); }
.rank-list img { width: 80px; height: 50px; object-fit: cover; border-radius: var(--r-xs); border: var(--border-sm); flex-shrink: 0; }
.rank-n { background: var(--surface-2); }
.rank-t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.rank-t strong { font: 700 16px var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-t small { color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.rank-m { flex-shrink: 0; font: 700 14px var(--font-display); color: var(--text-2); white-space: nowrap; }
.rank-empty { padding: 18px 6px 22px; color: var(--text-2); font-weight: 600; }

/* 專題卡片 */
.cgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.ccard { display: flex; flex-direction: column; background: var(--surface); border: var(--border); border-radius: var(--r-lg); box-shadow: var(--pop); overflow: hidden; transition: transform .2s, box-shadow .2s; }
.ccard:hover { transform: translateY(-4px) rotate(calc(-.6deg * var(--tilt))); box-shadow: var(--pop-lg); }
.ccard-art { display: block; aspect-ratio: 16 / 9; overflow: hidden; border-bottom: var(--border-sm); background: var(--surface-2); }
.ccard-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ccard-mosaic { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; }
.ccard-mosaic img:only-child { grid-column: 1 / -1; grid-row: 1 / -1; }
.ccard-mosaic.m2 { grid-template-rows: 1fr; }
.ccard-mosaic.m3 img:first-child { grid-row: 1 / -1; }
.ccard-body { display: flex; align-items: center; gap: 12px; padding: 14px 16px 16px; }
.ccard-ico { display: grid; place-items: center; width: 38px; height: 38px; flex-shrink: 0; border-radius: var(--r-sm); background: var(--c-primary); color: var(--on-primary); border: var(--border-sm); font-size: 18px; }
.ccard-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.ccard-title { font: 700 17px/1.3 var(--font-display); }
.ccard-txt small { color: var(--text-2); font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccard-count { flex-shrink: 0; padding: 3px 10px; border-radius: var(--r-pill); background: var(--surface-2); border: var(--border-sm); font: 700 12px var(--font-display); white-space: nowrap; }
.col-intro { margin: 26px 0 0; }

/* 評分 */
.sc-rating { display: inline-flex; align-items: center; gap: 4px; }
.sc-rating .ic { color: #f5a400; fill: currentColor; }
.sc-rating small { font-size: 12px; opacity: .8; }
.rate-card { display: flex; align-items: center; justify-content: space-between; gap: 18px 28px; flex-wrap: wrap; margin-top: 26px; padding: 22px 26px; background: var(--surface); border: var(--border); border-radius: var(--r-lg); box-shadow: var(--pop); }
.rate-copy h2 { display: flex; align-items: center; gap: 8px; font-size: 21px; }
.rate-copy h2 .ic { color: #f5a400; fill: currentColor; }
.rate-copy p { color: var(--text-2); font-weight: 600; margin-top: 4px; font-size: 14.5px; }
.rate-ui { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.rate-stars { display: flex; gap: 4px; }
.rate-stars button { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-sm); background: transparent; color: transparent; font-size: 32px; cursor: pointer; transition: transform .12s, color .12s; }
.rate-stars button .ic { fill: currentColor; stroke: var(--text-2); stroke-width: 1.4; }
.rate-stars button.lit .ic { stroke: var(--text); }
.rate-stars button.lit { color: #ffb400; }
.rate-stars button:hover { transform: scale(1.12); }
.rate-stars button:focus-visible { outline: 3px solid var(--c-primary); outline-offset: 2px; }
.rate-card.busy .rate-stars { opacity: .6; pointer-events: none; }
.rate-sum { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.rate-sum strong { font: 700 30px var(--font-display); }
.rate-sum span { font-size: 12.5px; color: var(--text-2); font-weight: 700; }

/* 搜尋建議 */
.suggest-host { position: relative; }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 60; list-style: none; margin: 0; padding: 6px; background: var(--surface); color: var(--text); border: var(--border); border-radius: var(--r); box-shadow: var(--pop-lg); max-height: 70vh; overflow: auto; text-align: left; }
.suggest[hidden] { display: none; }
.suggest a { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--text); }
.suggest a.on, .suggest a:hover { background: var(--surface-2); }
.suggest img { width: 64px; height: 40px; object-fit: cover; border-radius: var(--r-xs); border: var(--border-sm); flex-shrink: 0; }
.suggest strong { display: block; font: 700 15px var(--font-display); }
.suggest small { color: var(--text-2); font-size: 12px; font-weight: 600; }
.suggest .sg-all { justify-content: center; font-weight: 700; color: var(--text-2); }

/* 廣告版位 */
.ad-slot { display: block; margin-top: 26px; margin-bottom: 6px; text-align: center; }
.ad-slot .ad-label { display: block; font-size: 11px; letter-spacing: .1em; color: var(--muted); margin-bottom: 4px; }
.ad-body { min-height: 50px; }


/* 語言切換、表單勾選 */
.lang-switch { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; padding: 6px 14px; border-radius: var(--r-pill); border: 1.5px solid currentColor; font-weight: 700; font-size: 14px; opacity: .9; }
.lang-switch:hover { opacity: 1; }
.form label.check-line { flex-direction: row; align-items: flex-start; gap: 10px; font: 600 14.5px/1.5 var(--font); }
.form .check-line input { width: 20px; height: 20px; flex: none; padding: 0; margin-top: 2px; accent-color: var(--c-primary); }
.home-bottom-solo { grid-template-columns: 1fr; }

@media (max-width: 1360px) {
  .nav-extra { display: none; }
  .nav-link { padding: 0 10px; font-size: 15px; }
}
@media (max-width: 1200px) {
  :root { --gutter: 20px; }
  .ggrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ggrid > :nth-child(n + 9) { display: none; }
  .ggrid-page > :nth-child(n + 9) { display: block; }
  .hdr-btn span { display: none; }
  .hdr-btn { width: 42px; padding: 0; justify-content: center; }
  .home-hero { grid-template-columns: minmax(0, 1fr) 290px; }
  .cat-art { height: 170px; }
  .article-layout { grid-template-columns: minmax(0, 1fr) 280px; }
  .sc-pill { height: 40px; font-size: 15px; }
}
@media (max-width: 1280px) {
  .nav-dot { display: none; }
}
@media (max-width: 1060px) {
  .logo-en { font-size: 26px; }
}

/* =========================================================
   手機版（< 900px）
   ========================================================= */
@media (max-width: 1200px) {
  .cgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1060px) {
  .rank-grid { grid-template-columns: 1fr; }
}
@media (max-width: 899.98px) {
  .daily-wrap { padding-top: 16px; }
  .daily { grid-template-columns: 1fr; gap: 14px; padding: 14px 14px 18px; box-shadow: var(--pop); }
  .daily-title { font-size: 24px; }
  .daily-meta { margin: 8px 0 12px; }
  .cgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .ccard-body { padding: 10px 12px 12px; gap: 8px; flex-wrap: wrap; }
  .ccard-ico { display: none; }
  .ccard-title { font-size: 15px; }
  .rank-grid { gap: 16px; margin-top: 18px; }
  .rank-board { padding: 16px 12px 8px; box-shadow: var(--pop); }
  .rank-list img { width: 64px; height: 40px; }
  .rank-t strong { font-size: 15px; }
  .rank-m { font-size: 12.5px; }
  .rate-card { padding: 18px 16px; }
  .rate-stars button { width: 40px; height: 40px; font-size: 28px; }
}
@media (max-width: 420px) {
  .cgrid { grid-template-columns: 1fr; }
}
/* 英文版：分類名稱較長，桌機主選單省略分類小圖示，避免和右側按鈕重疊 */
html[lang="en"] .hdr-nav .nav-dot { display: none; }
@media (min-width: 1100px) and (max-width: 1319.98px) {
  html[lang="en"] .hdr-btn > .ic { display: none; }
}
@media (max-width: 979.98px) {
  html[lang="en"] .hdr-nav .nav-item:last-child { display: none; }
}
@media (max-width: 1099.98px) {
  html[lang="en"] .hdr-btn > span, html[lang="en"] .hdr-search > span { display: none !important; }
  html[lang="en"] .hdr-btn { padding-left: 12px; padding-right: 12px; }
}
/* 手機：標題與「查看更多」太長時換行，避免超出畫面（英文版較常見） */
@media (max-width: 599.98px) {
  .sec-head { flex-wrap: wrap; row-gap: 8px; }
  .sec-head h2 { min-width: 0; }
  .sorts { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .sorts::-webkit-scrollbar { display: none; }
  .sorts a { flex-shrink: 0; }
}
.mcard, .mcard-label { min-width: 0; }
.mcard-label strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 899.98px) {
  :root { --gutter: 14px; }
  body { font-size: 15px; padding-bottom: calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom)); }

  .hdr-in { height: 60px; gap: 10px; justify-content: space-between; }
  .logo-en { font-size: 23px; }
  .logo-zh { font-size: 13px; padding: 4px 7px 5px; border-width: 2px; box-shadow: var(--pop-xs); }
  .logo-badge { display: none; }
  .logo-img { height: 36px; }
  .hdr-search { width: 40px; height: 40px; padding: 0; justify-content: center; font-size: 18px; box-shadow: var(--pop-xs); }

  .search-box-big { top: 10px; padding-left: 14px; font-size: 18px; }
  .search-go { display: none; }

  .home-hero { grid-template-columns: 1fr; gap: 16px; padding-top: 14px; }
  .hero { box-shadow: var(--pop); border-radius: var(--r); }
  .hero-track { height: 230px; }
  .slide-in { grid-template-columns: 1.2fr 1fr; padding: 18px 12px 48px 18px; gap: 0; }
  .slide-eyebrow { font-size: 12px; padding: 3px 9px; border-width: 2px; box-shadow: var(--pop-xs); }
  .slide-title { margin: 10px 0 6px; font-size: 25px; -webkit-text-stroke-width: 1.5px; text-shadow: var(--tpop-sm); }
  .slide-sub { display: none; }
  .slide-btn { margin-top: 8px; height: 36px; padding: 0 14px; font-size: 14px; box-shadow: var(--pop-sm); }
  .art-card img { padding: 5px; border-width: 2px; box-shadow: var(--pop-sm); }
  .hero-nav { left: 18px; bottom: 12px; gap: 6px; }
  .hero-arrow { display: none; }
  .hero-bars button { width: 12px; height: 12px; }
  .hero-bars button.active { width: 30px; }
  .hero-side { grid-template-rows: none; }
  .tile-random { padding: 14px 16px; border-radius: var(--r); box-shadow: var(--pop); }
  .dice { width: 48px; height: 48px; border-radius: var(--r-sm); }
  .dice i { width: 9px; height: 9px; }
  .dice i:nth-child(1), .dice i:nth-child(4) { left: 7px; }
  .dice i:nth-child(2), .dice i:nth-child(5) { right: 7px; }
  .dice i:nth-child(1), .dice i:nth-child(2) { top: 7px; }
  .dice i:nth-child(4), .dice i:nth-child(5) { bottom: 7px; }
  .dice i:nth-child(3) { margin: -4.5px 0 0 -4.5px; }
  .tile-text strong { font-size: 19px; }
  .tile-text small { font-size: 12.5px; }
  .tile-top { display: none; }

  .ticker-clip { padding: 16px 0 4px; }
  .ticker-in { height: 42px; }
  .ticker-label { padding: 0 12px 0 20px; font-size: 14px; }
  .marquee-track { font-size: 14px; }

  /* 分類標籤 + 雙欄 */
  .rail-wrap { padding: 18px 0 0; }
  .rail { position: sticky; top: 60px; z-index: 20; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 10px var(--gutter) 12px; background: var(--bg); }
  .rail::-webkit-scrollbar { display: none; }
  .rail-tab { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; height: 40px; padding: 0 14px; border-radius: var(--r-pill); background: var(--surface); border: var(--border-sm); box-shadow: var(--pop-xs); font: 700 14.5px var(--font-display); }
  .rail-tab .ic { font-size: 17px; }
  .rail-tab.active { background: var(--hl); }
  .rail-panels { padding: 4px var(--gutter) 0; }
  .mgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .mcard { position: relative; display: block; background: var(--surface); border: var(--border-sm); border-radius: var(--r); box-shadow: var(--pop-sm); overflow: hidden; }
  .mcard:active { transform: translate(2px, 2px); box-shadow: var(--pop-press); }
  .mcard-img { position: relative; display: block; aspect-ratio: 16 / 10; border-bottom: var(--border-sm); }
  .mcard-img img { width: 100%; height: 100%; object-fit: cover; }
  .mcard .badge { position: absolute; left: 6px; top: 6px; height: 19px; font-size: 10.5px; padding: 0 6px; }
  .mcard-label { display: flex; flex-direction: column; padding: 7px 10px 9px; }
  .mcard-label strong { font: 700 15px var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mcard-label small { font-size: 11.5px; color: var(--muted); font-weight: 700; }
  .rail-more { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 16px; height: 46px; border-radius: var(--r-pill); background: var(--surface); border: var(--border-sm); box-shadow: var(--pop-sm); font: 700 15px var(--font-display); }

  .section { padding-top: 34px; }
  .sec-head { margin-bottom: 16px; }
  .sec-head h2 { font-size: 22px; gap: 10px; }
  .sec-mark { width: 34px; height: 34px; font-size: 16px; border-width: 2px; }
  .sec-more { padding: 6px 12px; font-size: 13px; }
  .ggrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 14px; }
  .ggrid > :nth-child(n + 9) { display: block; }
  .ggrid-scroll { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); gap: 14px; margin: 0 calc(-1 * var(--gutter)); padding: 10px var(--gutter) 14px; scrollbar-width: none; }
  .ggrid-scroll::-webkit-scrollbar { display: none; }
  .ggrid-scroll .gcard { flex: 0 0 64%; scroll-snap-align: start; }
  .ggrid-page { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 14px; margin-top: 16px; }
  .gcard { border-width: 2px; box-shadow: var(--pop-sm); }
  .gcard:hover { transform: none; box-shadow: var(--pop-sm); }
  .gcard-link { padding: 6px 6px 10px; }
  .gcard-title { font-size: 15.5px; }
  .gcard-desc, .gcard-play { display: none; }
  .gcard-cat { margin-top: 6px; font-size: 11.5px; }
  .fav-btn { width: 30px; height: 30px; right: 11px; top: 11px; }
  .sc-act.fav-btn { width: auto; height: 38px; }

  .pgrid { grid-template-columns: 1fr; gap: 16px; }
  .pcard { box-shadow: var(--pop-sm); }
  .pcard-link { flex-direction: row; }
  .pcard-media { width: 38%; flex-shrink: 0; aspect-ratio: auto; border-bottom: 0; border-right: var(--border); }
  .pcard-body { padding: 12px 14px; gap: 4px; }
  .pcard-title { font-size: 15.5px; }
  .pcard-excerpt { display: none; }
  .pcard-tag { font-size: 11px; }
  .pcard-meta { font-size: 12px; }

  .home-bottom { grid-template-columns: 1fr; gap: 24px; padding-bottom: 20px; }
  .intro-card, .faq-card { padding: 26px 20px 22px; box-shadow: var(--pop); }
  .intro-stats strong { font-size: 24px; }
  .intro-stats { gap: 10px; }

  .page-hero { padding-top: 16px; }
  .page-hero > .container { padding: 18px 20px 22px; box-shadow: var(--pop); border-radius: var(--r); }
  .page-hero h1 { font-size: 26px; }
  .page-hero-icon { width: 48px; height: 48px; font-size: 24px; border-radius: var(--r-sm); }
  .filterbar { flex-direction: column; align-items: stretch; gap: 12px; margin-top: 18px; }
  .chips { margin: 0 calc(-1 * var(--gutter)); padding: 4px var(--gutter) 8px; }
  .chips-wrap { margin: 16px 0 4px; padding: 4px 0; }
  .chip { height: 36px; padding: 0 13px; font-size: 13.5px; }
  .sorts { align-self: flex-start; }
  .cat-intro { padding: 18px; }

  .sc-pills { padding: 12px 0 0; }
  .sc-pills-in { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; gap: 8px; padding-top: 4px; padding-bottom: 8px; scrollbar-width: none; }
  .sc-pills-in::-webkit-scrollbar { display: none; }
  .sc-pill { height: 38px; padding: 0 14px; font-size: 14px; flex-shrink: 0; }
  .sc-stage { grid-template-columns: 1fr; min-height: 0; gap: 0; }
  .sc-left { display: none; }
  .sc-side.sc-right { order: -1; min-height: 0; height: 200px; margin-top: 10px; }
  .sc-right img { max-height: 96%; }
  .sc-card img { bottom: 6%; max-height: 82%; max-width: 72%; padding: 6px 6px 20px; border-width: 2px; box-shadow: var(--pop); transform: rotate(calc(-3deg * var(--tilt))); }
  .sc-center { padding: 4px 0 30px; }
  .sc-title { font-size: 42px; -webkit-text-stroke-width: 2px; text-shadow: var(--tpop); }
  .sc-title-img img { max-height: 110px; }
  .sc-tagline { font-size: 14.5px; letter-spacing: .06em; padding: 5px 14px; }
  .sc-panel { margin-top: 30px; padding: 28px 20px 52px; box-shadow: var(--pop); }
  .sc-panel .tape-l { left: -14px; width: 80px; }
  .sc-panel .tape-r { right: -14px; width: 80px; }
  .sc-panel-text { font-size: 15.5px; }
  .sc-start { min-width: 210px; height: 56px; padding: 0 30px; font-size: 20px; margin-top: -28px; box-shadow: var(--pop); }
  .sc-start-sm { height: 48px; font-size: 17px; margin-top: 16px; }
  .game-body .crumbs { margin: 16px 0 12px; }
  .game-lead { font-size: 15px; }
  .game-info { grid-template-columns: 1fr; gap: 18px; }
  .info-card { padding: 20px 18px; box-shadow: var(--pop-sm); }

  .pw-bar { flex-basis: 50px; padding: 0 10px; }
  .pw-actions span { display: none; }
  .pw-actions button, .pw-actions a { width: 40px; padding: 0; }
  .pw-frame { width: min(100vw, calc((100dvh - 50px) * var(--arn))); max-height: calc(100dvh - 50px); }

  .article-layout, .contact-layout, .doc-layout.has-toc { grid-template-columns: 1fr; gap: 20px; }
  .article { padding: 24px 18px; border-radius: var(--r); box-shadow: var(--pop); }
  .article-head h1 { font-size: 24px; }
  .article-meta { gap: 12px; font-size: 13px; }
  .doc { padding: 24px 18px; border-radius: var(--r); box-shadow: var(--pop); }
  .doc-layout { margin-top: 18px; }
  .prose-lg { font-size: 15.5px; }
  .article-aside, .toc-side { position: static; }
  .form-card { padding: 20px; box-shadow: var(--pop); }
  .form-row { grid-template-columns: 1fr; }
  .form .btn { align-self: stretch; }
  .cta-card { flex-direction: column; align-items: flex-start; box-shadow: var(--pop); }
  .error-code { font-size: 96px; }

  .footer { margin-top: 64px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 26px 18px; padding-top: 30px; padding-bottom: 20px; }
  .f-brand { grid-column: 1 / -1; }
  .footer-bottom .container { flex-direction: column; }
  .to-top { display: none; }
  .toast { bottom: calc(var(--tabbar-h) + 34px); }

  /* 底部浮動導覽 */
  .tabbar {
    position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 90;
    display: grid; grid-template-columns: repeat(5, 1fr); height: var(--tabbar-h); padding: 0 6px;
    background: var(--surface); border: var(--border); border-radius: var(--r); box-shadow: var(--pop);
  }
  .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font: 700 11.5px var(--font-display); color: var(--text-2); }
  .tab .ic { width: 42px; height: 30px; padding: 4px 9px; border-radius: var(--r-sm); border: 2px solid transparent; stroke-width: 2.2; }
  .tab.active { color: var(--text); }
  .tab.active .ic { background: var(--hl); border-color: var(--text); }

  .sheet { position: fixed; inset: 0; z-index: 300; }
  .sheet-backdrop { position: absolute; inset: 0; background: var(--scrim); animation: fade .2s; }
  .sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 82dvh; overflow-y: auto; background: var(--bg); border-top: var(--border); border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 10px 18px calc(18px + env(safe-area-inset-bottom)); animation: up .25s ease-out; }
  .sheet-grip { width: 46px; height: 6px; border-radius: var(--r-xs); background: var(--inv); opacity: .25; margin: 0 auto 12px; }
  .sheet-title { font: 700 16px var(--font-display); margin: 10px 0 12px; }
  .sheet-cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .sheet-cat { display: flex; flex-direction: column; align-items: center; gap: 6px; font: 700 13px var(--font-display); }
  .sheet-cat span { display: grid; place-items: center; width: 54px; height: 54px; border-radius: var(--r); font-size: 24px; color: #fff; background: var(--coral); border: var(--border); box-shadow: var(--pop-sm); }
  .sheet-cat:nth-child(5n + 2) span { background: var(--hl); color: var(--text); }
  .sheet-cat:nth-child(5n + 3) span { background: var(--teal); }
  .sheet-cat:nth-child(5n + 4) span { background: var(--grape); }
  .sheet-cat:nth-child(5n + 5) span { background: var(--sky); }
  .sheet-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .sheet-links a { display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: var(--r-sm); background: var(--surface); border: var(--border-sm); font: 700 14px var(--font-display); }
  .sheet-close { width: 100%; height: 48px; margin-top: 18px; border-radius: var(--r-pill); background: var(--inv); color: #fff; font: 700 15px var(--font-display); }
}

@media (min-width: 600px) and (max-width: 899.98px) {
  .mgrid { grid-template-columns: repeat(3, 1fr); }
  .ggrid, .ggrid-page { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ggrid-scroll .gcard { flex-basis: 38%; }
  .hero-track { height: 280px; }
  .slide-sub { display: block; font-size: 14px; }
  .footer-grid { grid-template-columns: repeat(3, 1fr); }
  .pgrid { grid-template-columns: 1fr 1fr; }
  .pcard-link { flex-direction: column; }
  .pcard-media { width: 100%; aspect-ratio: 16 / 9; border-right: 0; border-bottom: var(--border); }
}

@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(100%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .ticker-in { height: auto; min-height: 48px; }
  .marquee-track { animation: none; padding: 8px 0; white-space: normal; flex-direction: column; gap: 4px; }
}
