/* RO 倖存者小百科：配色比照遊戲的淺藍介面 */
:root {
  --blue-1: #6f8fd8; --blue-2: #3a5bb4; --blue-3: #24418e;
  --panel: #f6f8fd; --panel-2: #eaeff9; --line: #d3dbef; --border: #6b7ba8;
  --text: #24304f; --muted: #6c7896; --green: #3f9a55; --gold: #b8860b; --red: #b4413a;
  --q-common: #6c7896; --q-mini: #8a5a00; --q-mvp: #b4413a;
  --bg: linear-gradient(180deg, #b9cdf2 0%, #8fa8de 55%, #6b86c6 100%) fixed;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text); background: #8fa8de; background: var(--bg);
  font: 600 15px/1.6 Nunito, "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", sans-serif;
  padding: 18px 12px 40px;
}
a { color: var(--blue-2); text-decoration: none; }
a:hover { text-decoration: underline; }
img.px { image-rendering: pixelated; }

.shell { max-width: 1180px; margin: 0 auto; background: linear-gradient(180deg, #fdfdff, var(--panel) 60%, #eef2fa);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 18px 50px rgba(36, 65, 142, .3); overflow: hidden; }

/* 頁首 */
.top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 18px; color: #fff;
  background: linear-gradient(180deg, #97b1e6 0%, #7d9ad6 45%, #5f7fc0 55%, #3a559a 100%); }
.top h1 { margin: 0; font-size: 21px; font-weight: 900; text-shadow: 0 1px 0 #2f4a8a; white-space: nowrap; }
.top h1 a { color: #fff; }
.top h1 small { font-size: 12px; font-weight: 800; opacity: .85; margin-left: 6px; }
.top .search { flex: 1; min-width: 180px; display: flex; }
.top .search input { width: 100%; border: 0; border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 14px; color: var(--text); outline: none; box-shadow: inset 0 1px 3px #0003; }
.top .play { color: #fff; font-weight: 900; font-size: 14px; padding: 5px 14px; border-radius: 999px; background: rgba(255, 255, 255, .22); white-space: nowrap; }

nav.tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 8px 12px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
nav.tabs a { padding: 5px 12px; border-radius: 999px; font-weight: 800; font-size: 14px; color: var(--text); }
nav.tabs a:hover { background: #fff; text-decoration: none; }
nav.tabs a.on { background: var(--blue-2); color: #fff; }

main#app { padding: 16px 20px 26px; min-height: 60vh; }
footer.foot { padding: 12px 20px 18px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }

/* 共用元件 */
h2.pt { margin: 2px 0 6px; font-size: 22px; font-weight: 900; color: var(--blue-3); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
h3 { margin: 18px 0 8px; font-size: 17px; font-weight: 900; color: var(--blue-3); }
.lead { margin: 0 0 12px; color: var(--muted); }
.box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 10px 0; }
.note { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 10px 0; font-size: 14px; }
.warn { background: #fff4dd; border-color: #e8c98a; color: #6b4600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tag { display: inline-block; font-size: 12px; font-weight: 900; padding: 0 8px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.tag.mvp { background: #fde8e6; border-color: #e6a9a3; color: var(--q-mvp); }
.tag.mini { background: #fff4dd; border-color: #e8c98a; color: var(--q-mini); }
.tag.dev { background: #fff4dd; border-color: #e8c98a; color: #8a5a00; }
.tag.ok { background: #e9f6ec; border-color: #9ccfa8; color: var(--green); }
.tag.star { background: #fff8e1; border-color: #e6cf7a; color: #8a6d00; }
.grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.tile { display: flex; gap: 10px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; color: var(--text); }
a.tile:hover { border-color: var(--blue-1); box-shadow: 0 0 0 3px rgba(58, 91, 180, .15); text-decoration: none; }
.tile img { width: 36px; height: 36px; object-fit: contain; flex: none; image-rendering: pixelated; }
.tile b { display: block; color: var(--blue-3); }
.tile small { display: block; color: var(--muted); font-size: 13px; line-height: 1.45; }
.ico { width: 24px; height: 24px; object-fit: contain; vertical-align: middle; image-rendering: pixelated; }
.ico.lg { width: 40px; height: 40px; }
.cardimg { width: 110px; border-radius: 6px; box-shadow: 0 2px 8px #0003; }

table.t { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: 14px; }
table.t th, table.t td { padding: 6px 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.t th { background: var(--panel-2); color: var(--blue-3); font-weight: 900; white-space: nowrap; }
table.t tr:last-child td { border-bottom: 0; }
table.t td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tw { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 8px 0; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 12px; }
.filters select, .filters input { font: inherit; font-size: 14px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--text); }
.filters .count { color: var(--muted); font-size: 13px; }
.pill { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 3px 11px; font: inherit; font-size: 13px; font-weight: 800; color: var(--text); cursor: pointer; }
.pill.on { background: var(--blue-2); border-color: var(--blue-3); color: #fff; }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 8px 0; }
.steps > li { position: relative; padding: 8px 12px 8px 46px; margin: 6px 0; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.steps > li::before { counter-increment: s; content: counter(s); position: absolute; left: 10px; top: 8px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--blue-2); color: #fff; font-weight: 900; display: flex; align-items: center; justify-content: center; font-size: 14px; }

details.fold { background: #fff; border: 1px solid var(--line); border-radius: 12px; margin: 8px 0; }
details.fold > summary { cursor: pointer; padding: 9px 12px; font-weight: 900; color: var(--blue-3); list-style: none; display: flex; align-items: center; gap: 8px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: "▸"; color: var(--muted); }
details.fold[open] > summary::before { content: "▾"; }
details.fold > .in { padding: 0 12px 12px; }

.talent { display: grid; grid-template-columns: 34px 1fr; gap: 8px; padding: 7px 0; border-top: 1px dashed var(--line); }
.talent:first-child { border-top: 0; }
.talent img { width: 32px; height: 32px; image-rendering: pixelated; }
.talent .tn { font-weight: 900; }
.talent .td { font-size: 13.5px; line-height: 1.5; }
.row-h { font-size: 12px; font-weight: 900; color: var(--muted); margin: 10px 0 2px; }

.stat { display: inline-flex; gap: 4px; align-items: baseline; margin-right: 12px; font-size: 14px; }
.stat b { color: var(--blue-3); }
.empty { padding: 30px; text-align: center; color: var(--muted); }

/* LINE 群組按鈕（遊戲風格：立體綠色按鈕） */
.line-ico { display: inline-flex; align-items: center; justify-content: center; font: 900 9px/1 Nunito, sans-serif; letter-spacing: .2px;
  color: #06c755; background: #fff; border-radius: 6px; padding: 3px 4px; margin-right: 6px; box-shadow: 0 1px 0 #0002; }
.line-ico.big { font-size: 13px; padding: 9px 7px; border-radius: 10px; margin: 0; }
.top .line-btn { display: inline-flex; align-items: center; color: #fff; font-weight: 900; font-size: 14px; padding: 4px 14px 4px 6px; border-radius: 999px; white-space: nowrap;
  background: linear-gradient(180deg, #5fe08f 0%, #22c35e 48%, #06a84a 52%, #04863a 100%);
  border: 1px solid #036b2e; box-shadow: inset 0 1px 0 #ffffff80, 0 2px 0 #024f22; text-shadow: 0 1px 0 #036b2e; transition: transform .08s, filter .15s; }
.top .line-btn:hover { text-decoration: none; filter: brightness(1.08); }
.top .line-btn:active { transform: translateY(2px); box-shadow: inset 0 1px 0 #ffffff80, 0 0 0 #024f22; }
.author-card { margin: 4px 0 14px; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--gold);
  background: linear-gradient(180deg, #fffbea 0%, #fff3c9 100%); box-shadow: 0 3px 0 #c9a23a, 0 8px 18px rgba(184, 134, 11, .18); }
.author-card .ac-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.author-card .ac-badge { font-weight: 900; font-size: 13px; color: #fff; background: var(--gold); padding: 3px 10px; border-radius: 999px; }
.author-card .ac-name { font: 900 22px/1.2 Nunito, sans-serif; color: #5a3d00; }
.author-card .ac-desc { margin: 6px 0 10px; font-size: 14px; color: #5a4a20; }
.author-card .ac-links { display: flex; flex-wrap: wrap; gap: 8px; }
.author-card .ac-btn { display: inline-flex; align-items: center; font-weight: 800; font-size: 14px; padding: 6px 14px; border-radius: 999px;
  color: #fff; white-space: nowrap; box-shadow: 0 2px 0 #0003; transition: transform .08s, filter .15s; }
.author-card .ac-btn:hover { text-decoration: none; filter: brightness(1.08); }
.author-card .ac-btn:active { transform: translateY(2px); box-shadow: none; }
.author-card .ac-btn.site { background: #3a63c4; }
.author-card .ac-btn.x { background: #111; }
.author-card .ac-btn.dc { background: #5865f2; }.line-banner { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; padding: 10px 14px; border-radius: 12px; color: #fff;
  background: linear-gradient(180deg, #5fe08f 0%, #22c35e 48%, #06a84a 52%, #04863a 100%);
  border: 1px solid #036b2e; box-shadow: inset 0 1px 0 #ffffff80, 0 3px 0 #024f22, 0 8px 18px rgba(4, 134, 58, .25); transition: transform .08s, filter .15s; }
.line-banner:hover { text-decoration: none; filter: brightness(1.06); }
.line-banner:active { transform: translateY(3px); box-shadow: inset 0 1px 0 #ffffff80, 0 0 0 #024f22; }
.line-banner .lb-text { flex: 1; min-width: 0; text-shadow: 0 1px 0 #036b2e; }
.line-banner .lb-text b { display: block; font-size: 17px; font-weight: 900; }
.line-banner .lb-text small { display: block; font-size: 13px; opacity: .95; }
.line-banner .lb-go { flex: none; font-weight: 900; font-size: 15px; color: #24418e; padding: 6px 16px; border-radius: 999px;
  background: linear-gradient(180deg, #fff 0%, #eaf0fb 50%, #d3dcf2 100%); border: 1px solid #6b7ba8; box-shadow: 0 2px 0 #3a559a; }

@media (max-width: 640px) {
  .line-banner { padding: 9px 10px; gap: 10px; }
  .line-banner .lb-go { padding: 5px 12px; font-size: 14px; }
  body { padding: 8px 6px 24px; }
  main#app { padding: 12px; }
  .top { padding: 10px 12px; }
  .top h1 { font-size: 18px; }
  nav.tabs { padding: 6px 8px; overflow-x: auto; flex-wrap: nowrap; }
  nav.tabs a { white-space: nowrap; font-size: 13px; padding: 4px 10px; }
  .grid { grid-template-columns: 1fr; }
  table.t { font-size: 13px; }
}

.image-sources { margin-top: 18px; line-height: 1.8; overflow-wrap: anywhere; }
.image-sources h2 { font-size: 16px; color: var(--text); }
.image-sources li { margin: 10px 0; }
.image-sources a { text-decoration: underline; }

.event-intro { border-left: 4px solid var(--accent, #7289bc); }
.event-details { margin: 12px 0; padding: 12px 16px; border: 1px solid var(--line, #d6deeb); border-radius: 10px; }
.event-details summary { cursor: pointer; font-weight: 800; }
.event-details[open] summary { margin-bottom: 12px; }
