/* 4388 小遊戲：基本樣式＋多套風格（正式用 .theme-mag 雜誌精選）；分類一直見到 */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --soft: #f1f3f6;
  --accent: #2563eb;
  --accent-ink: #1d4ed8;
  --accent-weak: #eaf1ff;
  --star: #f59e0b;
  --up: #15803d;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Hiragino Sans", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 var(--font); }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-ink); }
img { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 30; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* 頂部 */
.top { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1320px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; white-space: nowrap; }
.search { flex: 1; display: flex; max-width: 560px; margin-left: auto; }
.search input { flex: 1; min-width: 0; height: 40px; padding: 0 14px; border: 1px solid var(--line); border-right: 0; border-radius: 10px 0 0 10px; background: var(--soft); }
.search input:focus { background: var(--surface); border-color: var(--accent); outline: none; }
.search button { height: 40px; padding: 0 16px; border: 0; border-radius: 0 10px 10px 0; background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; }
.search button:hover { background: var(--accent-ink); }
.lang { font-size: 14px; color: var(--muted); white-space: nowrap; padding: 8px 4px; }
@media (max-width: 639px) {
  .top-in { flex-wrap: wrap; gap: 8px 12px; padding-bottom: 8px; }
  .lang { margin-left: auto; }
  .search { order: 3; flex-basis: 100%; max-width: none; margin-left: 0; }
}

/* 分類：手機用頂部橫掃列，桌面用左欄 */
.cats-bar { display: flex; gap: 8px; overflow-x: auto; padding: 0 16px 10px; scrollbar-width: none; }
.cats-bar::-webkit-scrollbar { display: none; }
.cats-bar .cat { flex: none; display: flex; gap: 6px; align-items: baseline; padding: 6px 12px; border-radius: 999px; background: var(--soft); font-size: 14px; white-space: nowrap; }
.cats-bar .cat .n { font-size: 12px; color: var(--muted); }
.cats-bar .cat.on { background: var(--accent); color: #fff; }
.cats-bar .cat.on .n { color: #dbe6ff; }

.layout { max-width: 1320px; margin: 0 auto; padding: 16px; }
.side { display: none; }

@media (min-width: 1024px) {
  .cats-bar { display: none; }
  .layout { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 24px; padding-top: 20px; }
  .side { display: block; position: sticky; top: 82px; align-self: start; max-height: calc(100vh - 100px); overflow-y: auto; }
  .side-cats { display: flex; flex-direction: column; gap: 2px; }
  .side-cats .cat { display: flex; justify-content: space-between; padding: 8px 12px; border-radius: 8px; font-size: 15px; }
  .side-cats .cat:hover { background: var(--surface); }
  .side-cats .cat.on { background: var(--accent-weak); color: var(--accent-ink); font-weight: 600; }
  .side-cats .cat .n { color: var(--muted); font-size: 13px; }
}
.up { color: var(--up); font-weight: 700; }

/* 區塊 */
.block { background: var(--surface); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.block-head h1, .block-head h2 { margin: 0; font-size: 20px; }
.block-head a { color: var(--muted); font-size: 14px; white-space: nowrap; }
.more { margin: 12px 0 0; text-align: right; font-size: 14px; }
.more a { color: var(--accent-ink); }
.empty { padding: 24px 0; text-align: center; }

/* 首頁頂一行說明：新訪客一眼知道呢度做乜 */
.intro { margin: 0 0 12px; grid-column: 1 / -1; }
.intro h1 { margin: 0; font-size: 22px; line-height: 1.3; }
.intro p { margin: 4px 0 0; font-size: 14px; }
@media (max-width: 639px) { .intro h1 { font-size: 19px; } }

/* 首頁：推薦分頁＋右邊排行榜 */
.home { display: grid; grid-template-columns: minmax(0, 1fr); }
.home > * { grid-column: 1 / -1; }
@media (min-width: 1280px) {
  .home { grid-template-columns: minmax(0, 1fr) 280px; column-gap: 16px; align-items: start; }
  .home > .tabs-block { grid-column: 1; }
  .home > .ranks { grid-column: 2; }
}
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs button { flex: none; background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px 10px; font-size: 16px; color: var(--muted); cursor: pointer; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--text); font-weight: 700; border-bottom-color: var(--accent); }

.ranks h2 { margin: 0 0 8px; font-size: 18px; }
.ranks h3 { margin: 12px 0 6px; font-size: 14px; color: var(--muted); font-weight: 600; }
.rank-cols { display: grid; grid-template-columns: 1fr; gap: 0 24px; }
@media (min-width: 640px) and (max-width: 1279px) { .rank-cols { grid-template-columns: 1fr 1fr; } }
.rank { list-style: none; margin: 0; padding: 0; }
.rank li { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--soft); }
.rank li:last-child { border-bottom: 0; }
.rank a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .no { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-size: 13px; font-weight: 700; background: var(--soft); color: var(--muted); }
.rank .no.top3 { background: var(--accent); color: #fff; }

/* 遊戲卡：成張卡（圖＋名＋簡介）撳落即開遊戲 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 20px 16px; }
@media (max-width: 480px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; } }
.card { display: flex; flex-direction: column; min-width: 0; }
.card-play { display: block; }
.thumb { position: relative; aspect-ratio: 63 / 50; border-radius: 10px; overflow: hidden; background: var(--soft); }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease; }
.noimg { width: 100%; height: 100%; display: grid; place-items: center; font-size: 40px; font-weight: 700; color: hsl(var(--h) 35% 40%); background: hsl(var(--h) 40% 93%); }
.badge { position: absolute; left: 8px; top: 8px; padding: 2px 8px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; }
.play-hint { position: absolute; right: 8px; bottom: 8px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgb(255 255 255 / .92); color: var(--accent); font-size: 14px; opacity: 0; transform: translateY(4px); transition: opacity .15s ease, transform .15s ease; }
.card-play:hover .play-hint, .card-play:focus-visible .play-hint { opacity: 1; transform: none; }
.card-play:hover img { transform: scale(1.03); }
@media (hover: none) { .play-hint { opacity: 1; transform: none; width: 30px; height: 30px; font-size: 12px; } }
.card-title { margin: 8px 0 2px; font-size: 15px; font-weight: 600; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-desc { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.card-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; font-size: 13px; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--soft); font-size: 13px; white-space: nowrap; }
.chip:hover { background: var(--accent-weak); }
.rate-link { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.star { color: var(--star); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* 列表 */
.sorts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.sorts a { padding: 6px 14px; border-radius: 999px; background: var(--soft); font-size: 14px; }
.sorts a.on { background: var(--text); color: #fff; }
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; font-size: 15px; }
.pager a { padding: 8px 14px; border-radius: 8px; background: var(--soft); }

/* 遊戲頁 */
.crumbs { font-size: 14px; color: var(--muted); margin: 0 0 12px; }
.game-top { display: grid; gap: 20px; background: var(--surface); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
@media (min-width: 768px) { .game-top { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); padding: 20px; } }
.game-cover .play-hint { opacity: 1; transform: none; width: 52px; height: 52px; font-size: 20px; right: 12px; bottom: 12px; }
.game-info h1 { margin: 0 0 8px; font-size: 26px; line-height: 1.25; overflow-wrap: anywhere; }
.game-desc { margin: 0 0 12px; overflow-wrap: anywhere; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; }
.btn-play { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 200px; height: 48px; padding: 0 24px; border-radius: 12px; background: var(--accent); color: #fff; font-size: 17px; font-weight: 700; }
.btn-play:hover { background: var(--accent-ink); color: #fff; }
@media (max-width: 767px) { .btn-play { width: 100%; } }
.game-info > .small { margin: 6px 0 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin: 18px 0 0; }
.facts div { background: var(--soft); border-radius: 10px; padding: 8px 12px; min-width: 0; }
.facts dt { font-size: 13px; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.rate-box h2, .game h2 { margin: 0 0 10px; font-size: 18px; }
.stars { display: flex; gap: 4px; }
.stars button, .toast .stars button { width: 44px; height: 44px; border: 0; border-radius: 10px; background: var(--soft); color: #c7ccd4; font-size: 24px; line-height: 1; cursor: pointer; }
.stars button.lit { color: var(--star); background: #fff7e6; }
.comment-form { display: grid; gap: 8px; margin-bottom: 16px; }
.comment-form input, .comment-form textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); resize: vertical; }
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--accent); outline: none; }
.form-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.form-row button { height: 40px; padding: 0 18px; border: 0; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; }
.form-row button:disabled { opacity: .6; cursor: default; }
.comments { list-style: none; margin: 0; padding: 0; }
.comments li { padding: 12px 0; border-top: 1px solid var(--soft); }
.c-head, .c-body { margin: 0; overflow-wrap: anywhere; }
.c-body { white-space: pre-line; }
.report { text-align: center; margin: 8px 0 24px; }
.linkish { background: none; border: 0; color: var(--muted); font-size: 13px; text-decoration: underline; cursor: pointer; }
.prose { max-width: 760px; }
.prose h1 { margin-top: 0; }
.prose h2 { font-size: 18px; margin: 20px 0 6px; }

.foot { max-width: 1320px; margin: 8px auto 0; padding: 16px 16px 40px; color: var(--muted); font-size: 13px; text-align: center; }
.foot p { margin: 4px 0; }
.foot a { text-decoration: underline; }

/* 玩完返嚟：底部一行即評 */
.toast { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 40; width: min(440px, calc(100vw - 32px)); background: var(--surface); border-radius: 14px; box-shadow: 0 12px 32px rgb(17 24 39 / .18); padding: 14px 44px 14px 16px; }
.toast p { margin: 0 0 8px; font-weight: 600; overflow-wrap: anywhere; }
.toast .stars button { width: 40px; height: 40px; }
.toast .close { position: absolute; right: 6px; top: 6px; width: 32px; height: 32px; border: 0; background: none; font-size: 20px; color: var(--muted); cursor: pointer; }

/* ── 今日精選、圖示、風格切換（各風格共用骨架） ── */
.ico { display: none; }
.hero { display: grid; gap: 16px; background: var(--surface); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
@media (min-width: 768px) { .hero { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; padding: 20px; align-items: center; } }
.hero-cover { display: block; aspect-ratio: 1200 / 630; border-radius: 12px; overflow: hidden; background: var(--soft); }
.hero-cover img, .hero-cover .noimg { width: 100%; height: 100%; object-fit: cover; }
.eyebrow { margin: 0 0 6px; font-size: 13px; font-weight: 700; letter-spacing: .08em; color: var(--accent-ink); text-transform: uppercase; }
.hero h2 { margin: 0 0 8px; font-size: 28px; line-height: 1.25; overflow-wrap: anywhere; }
.hero-desc { margin: 0 0 18px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.hero-more { color: var(--muted); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.theme-switch { position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; z-index: 50; display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgb(17 24 39 / .88); box-shadow: 0 8px 24px rgb(0 0 0 / .25); max-width: calc(100vw - 24px); overflow-x: auto; }
.theme-switch a { color: #e5e7eb; font-size: 13px; padding: 8px 14px; border-radius: 999px; white-space: nowrap; }
.theme-switch a[aria-current] { background: #fff; color: #111827; font-weight: 700; }
body:has(.theme-switch) .toast { bottom: 72px; }

/* ── 風格一：暖色遊戲櫃 ── */
.theme-warm {
  --bg: #faf5ec; --surface: #fffdf8; --text: #2a2118; --muted: #85725f; --line: #eee2cf; --soft: #f4ead9;
  --accent: #ec5b2a; --accent-ink: #c2421a; --accent-weak: #ffe8dc; --radius: 20px;
  --font: ui-rounded, "SF Pro Rounded", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}
.theme-warm .ico { display: inline-block; margin-right: 6px; }
.theme-warm .top { background: rgb(255 253 248 / .92); backdrop-filter: blur(8px); border-bottom-color: var(--line); }
.theme-warm .search input { background: var(--soft); border-color: transparent; border-radius: 999px 0 0 999px; }
.theme-warm .search button { border-radius: 0 999px 999px 0; }
.theme-warm .cats-bar .cat { background: hsl(var(--h) 70% 94%); color: hsl(var(--h) 45% 28%); }
.theme-warm .cats-bar .cat .n { color: hsl(var(--h) 25% 45%); }
.theme-warm .cats-bar .cat.on, .theme-warm .side-cats .cat.on { background: hsl(var(--h) 62% 46%); color: #fff; }
.theme-warm .cats-bar .cat.on .n, .theme-warm .side-cats .cat.on .n { color: rgb(255 255 255 / .8); }
.theme-warm .side-cats .cat { border-radius: 12px; }
.theme-warm .side-cats .cat:hover { background: hsl(var(--h) 70% 94%); }
.theme-warm .block, .theme-warm .hero, .theme-warm .game-top { box-shadow: 0 1px 2px rgb(90 60 20 / .06), 0 6px 20px rgb(90 60 20 / .05); }
.theme-warm .hero { background: #fff1e4; }
.theme-warm .thumb, .theme-warm .hero-cover { border-radius: 16px; }
.theme-warm .card { transition: transform .15s ease; }
.theme-warm .card:hover { transform: translateY(-3px); }
.theme-warm .chip { background: var(--soft); border-radius: 999px; padding: 2px 10px; }
.theme-warm .tabs button[aria-selected="true"] { border-bottom-width: 3px; }
.theme-warm .rank .no.top3 { background: var(--accent); border-radius: 50%; }
.theme-warm .btn-play { border-radius: 999px; box-shadow: 0 4px 0 var(--accent-ink); }
.theme-warm .btn-play:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--accent-ink); }
.theme-warm .block-head h2 { display: flex; align-items: center; }

/* ── 風格二：深色遊戲廳 ── */
.theme-dark {
  --bg: #0d1117; --surface: #151b23; --text: #e6edf3; --muted: #8b949e; --line: #262f3a; --soft: #1e2631;
  --accent: #4f8dff; --accent-ink: #8ab4ff; --accent-weak: #1a2740; --star: #fbbf24; --up: #4ade80; --radius: 14px;
  color-scheme: dark;
}
.theme-dark .top { background: rgb(13 17 23 / .9); backdrop-filter: blur(8px); }
.theme-dark .search input { background: #0f141b; border-color: var(--line); }
.theme-dark .search input:focus { background: #0f141b; }
.theme-dark .cats-bar .cat { background: transparent; border: 1px solid var(--line); }
.theme-dark .cats-bar .cat.on { background: var(--accent); border-color: var(--accent); }
.theme-dark .side-cats .cat:hover { background: var(--surface); }
.theme-dark .side-cats .cat.on { background: var(--accent-weak); color: var(--accent-ink); }
.theme-dark .thumb { box-shadow: 0 0 0 1px rgb(255 255 255 / .06); transition: box-shadow .15s ease; }
.theme-dark .card-play:hover .thumb, .theme-dark .card-play:focus-visible .thumb { box-shadow: 0 0 0 2px var(--accent), 0 10px 28px rgb(79 141 255 / .28); }
.theme-dark .noimg { color: hsl(var(--h) 55% 72%); background: hsl(var(--h) 30% 18%); }
.theme-dark .hero { position: relative; overflow: hidden; background: #0a0e14; padding: 0; min-height: 320px; display: block; }
.theme-dark .hero-cover { position: absolute; inset: 0; aspect-ratio: auto; border-radius: 0; }
.theme-dark .hero-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgb(10 14 20 / .95) 0%, rgb(10 14 20 / .75) 45%, rgb(10 14 20 / .15) 100%); }
.theme-dark .hero-info { position: relative; max-width: 520px; padding: 40px 32px; pointer-events: none; }
.theme-dark .hero-info a { pointer-events: auto; }
.theme-dark .hero h2 { font-size: 34px; }
.theme-dark .hero-desc { color: #c9d1d9; }
@media (max-width: 767px) { .theme-dark .hero-info { padding: 28px 20px; } .theme-dark .hero h2 { font-size: 26px; } }
.theme-dark .play-hint { background: var(--accent); color: #fff; }
.theme-dark .sorts a.on { background: var(--accent); }
.theme-dark .rank .no { background: var(--soft); }
.theme-dark .toast { background: var(--surface); }
.theme-dark .stars button { background: var(--soft); color: #4b5563; }
.theme-dark .stars button.lit { background: #3a2f12; }
.theme-dark .comment-form input, .theme-dark .comment-form textarea { background: #0f141b; border-color: var(--line); }

/* ── 風格三：雜誌精選 ── */
.theme-mag {
  --bg: #f7f4ee; --surface: #fffefa; --text: #1c1917; --muted: #78716c; --line: #e2dbcf; --soft: #efe8dc;
  --accent: #b4371f; --accent-ink: #8f2a16; --accent-weak: #f5e2da; --radius: 4px;
  --serif: "Noto Serif TC", "Songti TC", "Source Han Serif TC", "PMingLiU", Georgia, serif;
}
.theme-mag h1, .theme-mag h2, .theme-mag h3, .theme-mag .brand, .theme-mag .card-title, .theme-mag .tabs button, .theme-mag .rank .no { font-family: var(--serif); }
.theme-mag .top { background: var(--bg); border-bottom: 2px solid var(--text); }
.theme-mag .brand { font-size: 22px; letter-spacing: .02em; }
.theme-mag .search input { background: transparent; border-color: var(--text); border-radius: 0; }
.theme-mag .search button { background: var(--text); border-radius: 0; }
.theme-mag .cats-bar .cat { background: transparent; border-radius: 0; border-bottom: 2px solid transparent; padding: 6px 4px; }
.theme-mag .cats-bar .cat.on { background: transparent; color: var(--accent); border-bottom-color: var(--accent); }
.theme-mag .cats-bar .cat.on .n { color: var(--accent); }
.theme-mag .side-cats .cat { border-radius: 0; border-bottom: 1px solid var(--line); padding: 10px 2px; }
.theme-mag .side-cats .cat.on { background: transparent; color: var(--accent); }
.theme-mag .block, .theme-mag .hero { background: transparent; border-radius: 0; border-top: 2px solid var(--text); padding: 18px 0 8px; }
.theme-mag .game-top { background: transparent; border-top: 2px solid var(--text); border-radius: 0; padding-left: 0; padding-right: 0; }
.theme-mag .intro h1 { font-size: 30px; }
.theme-mag .hero { padding-top: 22px; }
.theme-mag .hero h2 { font-size: 40px; line-height: 1.15; }
.theme-mag .eyebrow { color: var(--accent); letter-spacing: .2em; }
.theme-mag .hero-cover, .theme-mag .thumb { border-radius: 2px; }
.theme-mag .block-head h2 { font-size: 24px; }
.theme-mag .tabs { border-bottom-color: var(--line); }
.theme-mag .tabs button[aria-selected="true"] { border-bottom-color: var(--accent); }
.theme-mag .card-title { font-size: 17px; font-weight: 700; }
.theme-mag .chip { background: transparent; padding: 0; color: var(--accent); font-size: 13px; }
.theme-mag .rank .no { background: transparent; color: var(--muted); font-size: 20px; width: 28px; }
.theme-mag .rank .no.top3 { background: transparent; color: var(--accent); }
.theme-mag .btn-play, .theme-mag .sorts a.on { border-radius: 2px; background: var(--text); }
.theme-mag .sorts a { border-radius: 2px; }
/* 專題區塊：第一款放大做主角 */
@media (min-width: 640px) {
  .theme-mag .feature .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .theme-mag .feature .grid > .card:first-child { grid-column: span 2; grid-row: span 2; }
  .theme-mag .feature .grid > .card:first-child .card-title { font-size: 26px; white-space: normal; }
  .theme-mag .feature .grid > .card:first-child .card-desc { -webkit-line-clamp: 4; font-size: 15px; }
}

/* ── 登入及收藏 ── */
.card { position: relative; }
.fav { display: none; position: absolute; top: 6px; right: 6px; z-index: 2; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: rgb(255 255 255 / .92); color: #44403c; cursor: pointer; place-items: center; box-shadow: 0 1px 3px rgb(0 0 0 / .18); }
.has-acct .fav { display: grid; }
.fav:hover { color: var(--accent); }
.fav svg, .fav-btn svg, .acct svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.fav[aria-pressed="true"], .fav-btn[aria-pressed="true"], .acct.in { color: var(--accent); }
.fav[aria-pressed="true"] svg, .fav-btn[aria-pressed="true"] svg, .acct.in svg { fill: currentColor; }
.fav-btn { display: none; align-items: center; justify-content: center; gap: 6px; height: 48px; padding: 0 20px; border: 1px solid var(--text); border-radius: 2px; background: transparent; color: var(--text); font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; }
.has-acct .fav-btn { display: inline-flex; }
.fav-btn[aria-pressed="true"] { border-color: var(--accent); }
.play-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
@media (max-width: 767px) { .play-row .fav-btn { width: 100%; } }
.acct { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; white-space: nowrap; padding: 8px 4px; }
@media (max-width: 639px) { .acct { margin-left: auto; } .acct ~ .lang { margin-left: 0; } }
.login-dlg { border: 0; border-top: 3px solid var(--text); border-radius: 4px; padding: 24px 22px 16px; width: min(380px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: 0 24px 60px rgb(0 0 0 / .25); }
.login-dlg::backdrop { background: rgb(28 25 23 / .45); }
.login-dlg h2 { margin: 0 0 8px; padding-right: 32px; font-size: 22px; line-height: 1.3; }
.login-dlg p { margin: 0 0 8px; }
.dlg-close { position: absolute; right: 6px; top: 6px; margin: 0; }
.dlg-close button { width: 40px; height: 40px; border: 0; background: none; font-size: 24px; color: var(--muted); cursor: pointer; }
.gsi { min-height: 44px; margin: 14px 0 8px; }
.btn-login { height: 44px; padding: 0 20px; border: 0; border-radius: 2px; background: var(--text); color: var(--bg); font: inherit; font-weight: 600; cursor: pointer; }
.fav-page .acct-line { margin: -4px 0 14px; }
.theme-mag .login-dlg h2, .theme-mag .fav-btn { font-family: var(--serif); }
