:root {
  --bg: #070907;
  --fg: #f2f5ee;
  --dim: rgba(242, 245, 238, 0.45);
  --line: rgba(255, 255, 255, 0.1);
  --accent: #a6ff4d;
  --glass: rgba(28, 31, 28, 0.62);
  --sans: "Space Grotesk", "Noto Sans TC", system-ui, sans-serif;
  --zh: "Noto Sans TC", "Space Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", "Noto Sans TC", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); color: var(--fg); }
body { font-family: var(--zh); overflow: hidden; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: 0.04em; line-height: 1.45; text-transform: uppercase; }
.dim { color: var(--dim); }
.accent { color: var(--accent); }

/* ---------- loader ---------- */
#loader {
  position: fixed; inset: 0; z-index: 100; background: var(--bg);
  display: grid; place-items: center; align-content: center; gap: 18px;
  transition: opacity .6s ease;
}
#loader.done { opacity: 0; pointer-events: none; }
.loader-slime { width: 72px; animation: squish 0.9s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes squish {
  0%, 100% { transform: scale(1.12, 0.88) translateY(0); }
  50% { transform: scale(0.92, 1.08) translateY(-14px); }
}

/* ---------- stage ---------- */
#stage {
  position: fixed; inset: 0; width: 100vw; height: 100vh; display: block;
  touch-action: none; cursor: grab; opacity: 0; transition: opacity 1s ease;
}
#stage.ready { opacity: 1; }
#stage.dragging { cursor: grabbing; }
#stage.pointer { cursor: pointer; }

/* ---------- header ---------- */
.top {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: grid; grid-template-columns: 1fr auto auto 1fr; align-items: start; gap: 48px;
  padding: 20px 24px; pointer-events: none;
}
.top > * { pointer-events: auto; position: relative; }
.top::before {
  content: ""; position: absolute; inset: 0 0 -40px 0; pointer-events: none;
  background: linear-gradient(to bottom, rgba(7,9,7,.85), rgba(7,9,7,.5) 55%, transparent);
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); }
.logo svg { width: 40px; color: var(--accent); }
.wordmark { font-family: var(--sans); font-weight: 700; font-size: 15px; line-height: 0.95; letter-spacing: -0.01em; }
.tagline { text-transform: none; }
.status p { display: flex; align-items: center; gap: 6px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.cta {
  justify-self: end; background: var(--fg); color: var(--bg); font-weight: 500; font-size: 14px;
  padding: 12px 20px; border-radius: 999px; transition: background .2s, transform .2s;
}
.cta:hover { background: var(--accent); transform: translateY(-1px); }

/* ---------- bottom controls ---------- */
.view-toggle, .bottom-nav, .filter-btn {
  background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-radius: 999px;
}
.view-toggle { position: fixed; left: 20px; bottom: 20px; z-index: 30; display: flex; padding: 4px; gap: 2px; }
.view-toggle button { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; transition: background .2s; }
.view-toggle svg { width: 15px; fill: var(--fg); }
.view-toggle button.active { background: var(--fg); }
.view-toggle button.active svg { fill: var(--bg); }

.bottom-nav {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 30;
  display: flex; padding: 4px; gap: 2px;
}
.bottom-nav button { padding: 11px 22px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--dim); transition: color .2s, background .2s; }
.bottom-nav button:hover { color: var(--fg); }
.bottom-nav button.active { background: var(--fg); color: var(--bg); }

.filter-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 30; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.filter-btn { padding: 14px 22px; font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 8px; }
.filter-btn:hover, .filter-btn.open { background: var(--fg); color: var(--bg); }
.badge { background: var(--accent); color: var(--bg); font-family: var(--mono); font-size: 10px; border-radius: 999px; padding: 1px 7px; }
.filter-panel {
  width: min(340px, calc(100vw - 40px)); padding: 18px; border-radius: 20px;
  background: rgba(20, 22, 20, 0.85); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line); animation: pop .25s ease;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chip {
  font-family: var(--mono); font-size: 12px; padding: 7px 12px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18); color: var(--dim); transition: all .15s;
}
.chip:hover { color: var(--fg); border-color: rgba(255,255,255,.4); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--bg); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.hint { position: fixed; left: 50%; bottom: 82px; transform: translateX(-50%); z-index: 10; color: var(--dim); pointer-events: none; transition: opacity .8s; }
.hint.gone { opacity: 0; }

/* ---------- pages (list / about) ---------- */
.page { position: fixed; inset: 0; z-index: 15; overflow-y: auto; background: var(--bg); animation: fadein .4s ease; }
@keyframes fadein { from { opacity: 0; } }
.page-inner { padding: 22vh 24px 140px; max-width: 1600px; margin: 0 auto; }
.list-head { display: grid; grid-template-columns: 1fr 2fr; margin-bottom: 7vh; }
.list-head h1, .big { font-family: var(--sans); font-weight: 700; font-size: clamp(32px, 4.2vw, 64px); letter-spacing: -0.03em; line-height: 1.05; }
.year-group { display: grid; grid-template-columns: 1fr 2fr; border-top: 1px solid var(--line); padding: 22px 0 56px; }
.year-group h3 { font-family: var(--sans); font-size: 20px; font-weight: 700; }
.row {
  display: grid; grid-template-columns: 1.3fr 1.2fr 0.9fr; align-items: center; gap: 16px;
  padding: 11px 0; border-bottom: 1px solid var(--line); text-decoration: none; cursor: pointer;
  transition: padding .25s ease, color .2s;
}
.row:hover { padding-left: 12px; color: var(--accent); }
.row .t { font-weight: 500; font-size: 16px; }
.row .t small { color: var(--dim); font-weight: 400; margin-left: 8px; font-size: 13px; }
.row .d { text-align: right; color: var(--dim); font-size: 14px; }
.row:hover .d { color: var(--fg); }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { font-family: var(--mono); font-size: 10.5px; padding: 4px 9px; border-radius: 999px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.05); color: rgba(242,245,238,.75); }
#hoverPreview {
  position: fixed; left: 0; top: 0; width: 200px; height: 200px; pointer-events: none; z-index: 16;
  border-radius: 8px; opacity: 0; transition: opacity .2s; box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
#hoverPreview.show { opacity: 1; }

.about .big { margin: 18px 0 56px; max-width: 18em; }
.about-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; max-width: 980px; font-size: 17px; line-height: 1.8; color: rgba(242,245,238,.8); }
.submit { margin-top: 14vh; border-top: 1px solid var(--line); padding-top: 28px; max-width: 980px; }
.submit h2 { font-family: var(--sans); font-size: clamp(26px, 3vw, 42px); letter-spacing: -0.02em; line-height: 1.15; margin: 16px 0 20px; }
.submit > p:not(.mono) { font-size: 17px; line-height: 1.8; color: rgba(242,245,238,.8); max-width: 36em; }
.rules { list-style: none; margin-top: 28px; display: grid; gap: 10px; font-size: 13px; }
.rules li { border-bottom: 1px solid var(--line); padding-bottom: 10px; }

/* ---------- detail modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: fadein .3s; }
.detail-card {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; width: min(980px, 100%); max-height: calc(100vh - 40px);
  background: #0d100d; border: 1px solid var(--line); border-radius: 24px; overflow: hidden; animation: pop .35s cubic-bezier(.2,.9,.3,1.2);
}
.detail-cover { background: #000; aspect-ratio: 1; }
.detail-cover canvas { width: 100%; height: 100%; display: block; }
.detail-info { padding: 36px 34px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.meta { display: flex; justify-content: space-between; color: var(--dim); }
.detail-info h2 { font-family: var(--sans); font-size: clamp(28px, 3.2vw, 44px); letter-spacing: -0.03em; line-height: 1; margin-top: 8px; }
.facts { border-top: 1px solid var(--line); }
.facts > div { display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.facts dt { color: var(--dim); align-self: center; }
.facts dd { word-break: break-word; }
.zh { font-size: 18px; color: var(--dim); font-weight: 500; }
.blurb { font-size: 16px; line-height: 1.8; color: rgba(242,245,238,.85); }
.play {
  margin-top: auto; flex-shrink: 0; display: inline-flex; justify-content: space-between; align-items: center;
  background: var(--accent); color: var(--bg); text-decoration: none; font-weight: 700; font-size: 17px;
  padding: 16px 22px; border-radius: 999px; transition: transform .2s, box-shadow .2s;
}
.play span { font-size: 12px; font-weight: 500; opacity: .7; }
.play:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(166,255,77,.3); }
.small { font-size: 10px; text-transform: none; word-break: break-all; }
.detail-nav { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 14px; }
.detail-nav button { color: var(--dim); }
.detail-nav button:hover { color: var(--fg); }
.icon-btn.close {
  position: absolute; right: 14px; top: 14px; z-index: 2; width: 38px; height: 38px; border-radius: 50%;
  background: var(--glass); backdrop-filter: blur(8px); font-size: 14px;
}
.icon-btn.close:hover { background: var(--fg); color: var(--bg); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .top { grid-template-columns: 1fr auto; gap: 16px; padding: 16px; }
  .tagline, .status { display: none; }
  .list-head, .year-group { grid-template-columns: 1fr; gap: 12px; }
  .row { grid-template-columns: 1fr; gap: 6px; }
  .row .d { text-align: left; }
  .about-cols { grid-template-columns: 1fr; gap: 16px; }
  .detail-card { grid-template-columns: 1fr; overflow-y: auto; }
  .detail-cover { aspect-ratio: 16 / 9; max-height: 34vh; width: 100%; }
  .detail-info { padding: 20px 20px 22px; overflow: visible; gap: 12px; }
  .detail-info .play { position: sticky; bottom: 0; box-shadow: 0 -12px 24px #0d100d; }
  .bottom-nav button { padding: 10px 14px; }
  .filter-btn { padding: 13px 16px; }
  .hint { bottom: 76px; }
  #hoverPreview { display: none; }
}
@media (max-width: 520px) {
  .view-toggle { left: 12px; bottom: 14px; }
  .bottom-nav { bottom: 14px; }
  .filter-wrap { right: 12px; bottom: 14px; }
  .view-toggle button { width: 36px; height: 36px; }
  .bottom-nav button { padding: 10px 11px; font-size: 13px; }
  .filter-btn { padding: 12px 13px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- list toolbar：搜尋 + 篩選 ---------- */
.list-head { margin-bottom: 4vh; }
.list-tools {
  position: sticky; top: var(--header-h, 78px); z-index: 5; margin: 0 -24px 36px; padding: 12px 24px 14px;
  background: var(--bg); border-bottom: 1px solid var(--line);
  display: grid; gap: 12px;
}
.search {
  display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 18px;
  border: 1px solid rgba(255,255,255,.16); border-radius: 999px; background: rgba(255,255,255,.04);
  transition: border-color .2s, background .2s;
}
.search:focus-within { border-color: var(--accent); background: rgba(166,255,77,.05); }
.search svg { width: 18px; flex-shrink: 0; color: var(--dim); }
.search input {
  flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0; color: var(--fg);
  font: 500 17px var(--zh);
}
.search input::placeholder { color: rgba(242,245,238,.35); }
.search input::-webkit-search-cancel-button { display: none; }
.search kbd { border: 1px solid rgba(255,255,255,.2); border-radius: 6px; padding: 2px 8px; color: var(--dim); }
.search:focus-within kbd { display: none; }
#searchClear { width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,.1); font-size: 12px; }
#searchClear:hover { background: var(--fg); color: var(--bg); }

.list-filters { display: flex; flex-wrap: wrap; gap: 14px 32px; align-items: flex-start; }
.fgroup { display: grid; gap: 8px; }
.list-filters .fgroup { display: flex; align-items: center; gap: 10px; }
.list-filters .fgroup > p { flex-shrink: 0; }
.fgroup > p span { opacity: .6; text-transform: none; }
.filter-panel .fgroup + .fgroup { margin-top: 14px; }
.filter-panel .chips { margin-top: 0; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); }
.seg button { padding: 7px 14px; border-radius: 999px; font-size: 13px; color: var(--dim); transition: all .15s; }
.seg button span { font-family: var(--mono); font-size: 10px; opacity: .7; margin-left: 2px; }
.seg button:hover { color: var(--fg); }
.seg button.on { background: var(--fg); color: var(--bg); }
.chip:disabled { opacity: .3; cursor: default; }
.chip:disabled:hover { color: var(--dim); border-color: rgba(255,255,255,.18); }

.list-meta { display: flex; gap: 16px; align-items: center; color: var(--dim); }
.list-meta button { color: var(--accent); text-transform: none; }
.list-meta button:hover { text-decoration: underline; }

.row mark { background: rgba(166,255,77,.25); color: var(--fg); border-radius: 3px; padding: 0 1px; }
.year-group h3 .dim { font-family: var(--mono); font-size: 13px; margin-left: 6px; }
.empty { padding: 8vh 0; display: grid; gap: 12px; justify-items: start; }
.big-empty { font-family: var(--sans); font-size: 28px; font-weight: 700; }

@media (max-width: 900px) {
  .list-tools { margin: 0 -16px 28px; padding: 10px 16px 14px; }
  .search { height: 50px; }
  .search kbd { display: none; }
  .list-filters { gap: 10px; flex-direction: column; flex-wrap: nowrap; }
  .list-filters .fgroup { width: 100%; }
  .list-filters .fgroup > p { display: none; }
  .list-filters .seg { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }
  .list-filters .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
  .list-filters .chips::-webkit-scrollbar { display: none; }
  .list-filters .chip { flex-shrink: 0; }
}

/* 列表／關於頁：上方 header 改成實心底，捲動時內容不會從 header 和工具列之間露出來 */
body.solid-header .top::before { background: var(--bg); inset: 0; }
#listBody .year-group:first-child { border-top: 0; padding-top: 0; }

/* ======================================================
   List view 細修
   ====================================================== */
#list .page-inner { padding-top: 17vh; }
.list-head { grid-template-columns: 1fr 3fr; align-items: end; margin-bottom: 3.5vh; }
.year-group { grid-template-columns: 1fr 3fr; padding: 28px 0 48px; }
.year-group h3 { position: sticky; top: calc(var(--header-h, 78px) + var(--tools-h, 150px) + 16px); align-self: start; }

/* 工具列：搜尋一列，篩選 + 結果數同一列 */
.list-tools { grid-template-columns: 1fr auto; column-gap: 24px; }
.list-tools .search { grid-column: 1 / -1; }
.list-meta { justify-self: end; align-self: center; white-space: nowrap; }
.list-filters .fgroup > p { min-width: 2.5em; }

/* 每一列 */
.row {
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, .9fr) 20px;
  gap: 20px; padding: 14px 8px; margin: 0 -8px; border-radius: 10px; border-bottom: 0;
  position: relative; outline: none;
  transition: background .2s ease, color .2s ease;
}
.row::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: 0; height: 1px; background: var(--line); }
.row:hover, .row:focus-visible { padding-left: 8px; background: rgba(255,255,255,.04); color: var(--fg); }
.row:focus-visible { box-shadow: 0 0 0 2px var(--accent) inset; }
.row .thumb { display: none; }
.row .t { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.row .t b { font-weight: 500; font-size: 17px; letter-spacing: -0.01em; transition: color .2s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .t small { margin: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row:hover .t b, .row:focus-visible .t b { color: var(--accent); }
.row .tags { flex-wrap: nowrap; overflow: hidden; }
.row .d { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .go { color: var(--accent); opacity: 0; transform: translateX(-6px); transition: opacity .2s, transform .2s; font-family: var(--mono); }
.row:hover .go, .row:focus-visible .go { opacity: 1; transform: none; }

/* 預覽圖 */
#hoverPreview { width: 300px; height: 188px; border-radius: 10px; border: 1px solid rgba(255,255,255,.12); background: #000; transition: opacity .18s; }

@media (max-width: 900px) {
  #list .page-inner { padding-top: 13vh; }
  .list-head { grid-template-columns: 1fr; gap: 2px; margin-bottom: 18px; }
  .list-head h1 { font-size: 34px; }
  .list-tools { grid-template-columns: 1fr; row-gap: 10px; }
  .list-meta { justify-self: start; }
  .year-group { grid-template-columns: 1fr; gap: 6px; padding: 18px 0 32px; }
  .year-group h3 { position: static; font-size: 17px; }

  /* 手機：縮圖 + 兩行文字 */
  .row {
    grid-template-columns: 76px minmax(0, 1fr) auto;
    grid-template-areas: "th t t" "th tags d";
    gap: 4px 14px; padding: 10px 8px; align-items: center;
  }
  .row .thumb {
    grid-area: th; display: grid; place-items: center; width: 76px; aspect-ratio: 16 / 10; overflow: hidden;
    border-radius: 8px; background: hsl(var(--h) 50% 22%); border: 1px solid rgba(255,255,255,.08);
  }
  .row .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .row .thumb i { font-style: normal; font-size: 22px; }
  .row .t { grid-area: t; flex-direction: column; gap: 1px; align-items: flex-start; }
  .row .t b { font-size: 15px; max-width: 100%; }
  .row .t small { font-size: 12px; max-width: 100%; }
  .row .tags { grid-area: tags; }
  .row .tag { font-size: 10px; padding: 2px 7px; }
  .row .d { grid-area: d; text-align: right; font-size: 12px; max-width: 40vw; }
  .row .go { display: none; }
  .row:hover, .row:focus-visible { padding-left: 8px; }
}
/* 防止類型列（橫向捲動）把工具列撐寬 */
.list-tools > *, .list-filters, .list-filters .fgroup, .list-filters .chips, .list-filters .seg { min-width: 0; }
.list-filters .fgroup { max-width: 100%; }

/* ---------- 類型分組 + 地區小標籤 ---------- */
.year-group h3 small { display: block; margin-top: 6px; font-family: var(--sans); font-size: 12.5px; font-weight: 400; color: var(--dim); line-height: 1.5; }
.tag-region { cursor: pointer; border-style: dashed; color: var(--dim); background: transparent; transition: color .15s, border-color .15s, background .15s; }
.tag-region::before { content: "◎ "; opacity: .6; }
.tag-region:hover, .tag-region:focus-visible { color: var(--accent); border-color: var(--accent); border-style: solid; background: rgba(166,255,77,.08); outline: none; }
.tag-cat { border-color: rgba(166,255,77,.5); color: var(--accent); background: rgba(166,255,77,.08); }
.chip-region { border-style: dashed; }
.fhint { margin-top: 12px; font-size: 10.5px; line-height: 1.6; text-transform: none; }
@media (max-width: 720px) { .year-group h3 small { display: inline; margin: 0 0 0 8px; } }
.list-filters .chip, .filter-panel .chip { white-space: nowrap; }

/* ---------- logo 史萊姆小動畫 ---------- */
.logo-slime { overflow: visible; }
.logo-slime .ls-body { transform-box: view-box; transform-origin: 50% 72%; animation: ls-breathe 3.2s ease-in-out infinite; }
.logo-slime .ls-eyes { transition: transform .12s linear; }
.logo-slime .ls-blink { transform-box: view-box; transform-origin: 50% 44px; transition: transform .07s ease-in; }
.logo-slime.blink .ls-blink { transform: scaleY(.1); }
.logo:hover .ls-body, .logo:focus-visible .ls-body { animation: ls-jiggle .7s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes ls-breathe {
  0%, 100% { transform: scale(1, 1); }
  50% { transform: scale(1.04, .95); }
}
@keyframes ls-jiggle {
  0% { transform: scale(1, 1); }
  25% { transform: scale(1.14, .82); }
  50% { transform: scale(.9, 1.12) translateY(-4px); }
  75% { transform: scale(1.05, .96); }
  100% { transform: scale(1, 1); }
}
@media (prefers-reduced-motion: reduce) {
  .logo-slime .ls-body, .logo:hover .ls-body { animation: none; }
}

/* ---------- 復古版：2000 年代個人網站 ---------- */
body.retro-mode .top, body.retro-mode .bottom-nav, body.retro-mode .filter-wrap, body.retro-mode .hint { display: none; }
#retro { background: #cfeeee; color: #000; animation: none; }
.rt {
  --rt-link: #0000cc; --rt-visited: #551a8b; --rt-line: #8fc4c4;
  max-width: 980px; margin: 0 auto; padding: 18px 16px 120px;
  font-family: "PMingLiU", "新細明體", "MingLiU", "Songti TC", "LiSong Pro", serif;
  font-size: 15px; line-height: 1.7;
}
.rt a { color: var(--rt-link); text-decoration: underline; text-underline-offset: 2px; }
.rt a:hover { color: #cc0000; }
.rt a:focus-visible, .rt button:focus-visible, .rt input:focus-visible { outline: 2px dotted #cc0000; outline-offset: 2px; }
.rt mark { background: #ffff00; color: inherit; padding: 0 1px; }

.rt-head { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; padding-bottom: 10px; border-bottom: 3px double #e0a800; }
.rt-logo { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; text-decoration: none !important;
  background: linear-gradient(#fffbe0, #f6e7a8); border: 2px solid #c9a227; box-shadow: 3px 3px 0 #9a7b12; }
.rt-logo svg { width: 46px; flex-shrink: 0; }
.rt-name { display: flex; flex-direction: column; line-height: 1.2; }
.rt-name b { font-size: 24px; font-weight: 900; color: #6b3d00; letter-spacing: .04em;
  text-shadow: 1px 1px 0 #fff, 2px 2px 0 #e8b400; font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif; }
.rt-name i { font-size: 12px; font-style: italic; color: #3a7d00; font-family: "Comic Sans MS", "Chalkboard SE", cursive; }
.rt-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 16px; font-weight: 700; }
.rt-nav a { display: inline-flex; align-items: center; gap: 4px; padding: 4px 0; }
.rt-nav a span { text-decoration: none; display: inline-block; }
.rt-nav a[aria-current] { color: #000; text-decoration: none; background: #ffff99; padding: 4px 6px; border: 1px dashed #c9a227; }

.rt-search { display: flex; gap: 6px; margin: 16px 0 6px; max-width: 460px; }
.rt-search input { flex: 1; min-width: 0; font: inherit; font-size: 15px; padding: 5px 8px; background: #fff; color: #000;
  border: 2px inset #a9a9a9; border-radius: 0; }
.rt-search button { font: inherit; font-size: 14px; padding: 4px 16px; color: #000; cursor: pointer;
  background: linear-gradient(#fdfdfd, #d8d8d8); border: 2px outset #d8d8d8; }
.rt-search button:active { border-style: inset; }
.rt-welcome { font-size: 13px; color: #006400; margin-bottom: 14px; }
.rt-welcome b { color: #cc0000; font-family: "Courier New", monospace; background: #000; color: #39ff14; padding: 0 5px; letter-spacing: .1em; }

.rt-crumb { font-size: 15px; scroll-margin-top: 12px; }
.rt-crumb b { font-size: 17px; }
.rt-count { color: #555; font-size: 13px; }
.rt-pages { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; margin: 6px 0 10px; font-size: 15px; }
.rt-pages:empty { display: none; }
.rt-pages a { padding: 6px 2px; }
.rt-pages b { color: #e00000; font-size: 22px; font-weight: 900; padding: 0 2px; }
.rt-pages a.off { color: #999; text-decoration: none; pointer-events: none; }

.rt-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--rt-line); }
.rt-table th { background: #ccffcc; font-weight: 400; padding: 5px 8px; border: 1px solid var(--rt-line); }
.rt-table td { padding: 10px 12px; border: 1px solid var(--rt-line); vertical-align: top; }
.rt-table tbody tr:hover td { background: #f3fbff; }
.rt-table tbody tr:hover td.rt-t { background: #fff6b0; }
.rt-t { width: 26%; background: #ffffcc; }
.rt-t > a:first-child { font-size: 16px; font-weight: 700; }
.rt-t small { display: block; color: #555; font-size: 13px; }
.rt-meta { display: block; font-size: 12px; color: #666; margin-top: 2px; }
.rt-meta a { color: #666; }
.rt-play { display: inline-block; margin-top: 6px; font-size: 13px; padding: 1px 8px; color: #000 !important; text-decoration: none !important;
  background: linear-gradient(#fdfdfd, #d8d8d8); border: 2px outset #d8d8d8; }
.rt-play:active { border-style: inset; }
.rt-b { font-size: 14.5px; color: #222; }
.rt-d { width: 15%; font-size: 14px; word-break: break-word; }
.rt-empty { text-align: center; padding: 40px 12px !important; }

.rt-foot { text-align: center; margin-top: 28px; padding-top: 12px; border-top: 3px double #e0a800; }
.rt-small { font-size: 12px; color: #555; }

/* 復古版的遊戲介紹：老式視窗 */
body.retro-mode .modal-backdrop { background: rgba(0, 60, 60, .35); backdrop-filter: none; -webkit-backdrop-filter: none; }
body.retro-mode .detail-card { background: #ece9d8; color: #000; border: 2px outset #fff; border-radius: 0; box-shadow: 4px 4px 0 rgba(0,0,0,.35); padding-top: 28px; animation: none;
  font-family: "PMingLiU", "新細明體", "Songti TC", serif; }
body.retro-mode .detail-card::before { content: "遊戲介紹.htm"; position: absolute; top: 0; left: 0; right: 0; height: 26px; padding: 0 10px;
  display: flex; align-items: center; color: #fff; font: 700 13px/1 "Noto Sans TC", sans-serif;
  background: linear-gradient(90deg, #0a246a, #a6caf0); }
body.retro-mode .detail-card .close { top: 3px; right: 4px; width: 22px; height: 20px; border-radius: 0; color: #000; font-size: 12px;
  background: #ece9d8; border: 2px outset #fff; z-index: 2; }
body.retro-mode .detail-info { color: #000; }
body.retro-mode .detail-info h2 { font-family: inherit; letter-spacing: 0; color: #000; }
body.retro-mode .zh, body.retro-mode .facts dt, body.retro-mode .detail-nav { color: #444; }
body.retro-mode .blurb { color: #111; }
body.retro-mode .facts, body.retro-mode .facts > div { border-color: #b5b19c; }
body.retro-mode .tag { color: #333; border-color: #999; background: #fff; border-radius: 0; }
body.retro-mode .tag-cat { color: #0a246a; border-color: #0a246a; }
body.retro-mode .play { background: linear-gradient(#fdfdfd, #d8d8d8); color: #000; border: 2px outset #d8d8d8; border-radius: 0; }
body.retro-mode .play span { color: #444; }
body.retro-mode .detail-nav button { color: var(--rt-link, #0000cc); text-decoration: underline; }

@media (max-width: 640px) {
  .rt { padding: 12px 12px 110px; }
  .rt-name b { font-size: 20px; }
  .rt-nav { gap: 2px 14px; font-size: 15px; }
  .rt-table, .rt-table tbody, .rt-table tr, .rt-table td { display: block; width: auto; }
  .rt-table thead { display: none; }
  .rt-table { border: 0; background: transparent; }
  .rt-table tr { background: #fff; border: 1px solid var(--rt-line); margin-bottom: 10px; }
  .rt-table td { border: 0; padding: 8px 12px; }
  .rt-t { border-bottom: 1px solid var(--rt-line) !important; }
  .rt-d { font-size: 13px; color: #555; padding-top: 0 !important; }
  .rt-d::before { content: "提供者："; }
}

/* 復古版縮圖：老網站「圖片連結有藍框」的感覺 */
.rt-thumb { display: block; width: 100%; max-width: 200px; aspect-ratio: 16 / 10; margin-bottom: 8px; border: 2px solid var(--rt-link); background: hsl(var(--h, 120) 45% 80%); overflow: hidden; }
.rt-thumb:hover { border-color: #cc0000; }
.rt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rt-thumb i { display: grid; place-items: center; height: 100%; font-size: 34px; font-style: normal; }
.rt-t > a:nth-child(2) { font-size: 16px; font-weight: 700; }
@media (max-width: 640px) {
  .rt-t { display: grid !important; grid-template-columns: 112px 1fr; column-gap: 12px; align-items: start; }
  .rt-thumb { grid-row: 1 / span 4; margin: 0; }
  .rt-t > :not(.rt-thumb) { grid-column: 2; justify-self: start; }
}
