/* =========================================================
   天使之戀2 WIKI — 共用樣式（沿用 MisakiYu 主站配色）
   換風格時只需改這一段 :root 變數
   ========================================================= */
:root {
  color-scheme: dark;
  --bg: #06111f;
  --bg-deep: #030b15;
  --surface: #0a1929;
  --surface-2: #0d2033;
  --surface-3: #112840;
  --text: #f4f8fb;
  --muted: #a6b5c4;
  --faint: #718397;
  --accent: #35d2c2;
  --accent-strong: #20b9ad;
  --accent-soft: rgba(53, 210, 194, 0.1);
  --amber: #ffb11b;
  --line: rgba(112, 160, 183, 0.22);
  --line-strong: rgba(112, 160, 183, 0.4);
  --glow: rgba(23, 98, 116, 0.12);
  --header-bg: rgba(3, 11, 21, 0.82);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
  --r-一般: #9aa8b8; --r-精英: #5ad48a; --r-英雄: #5aa8ff;
  --r-傳說: #c08bff; --r-史詩: #ff9a4d; --r-太古: #ff5f6d;
  --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  --radius: 14px;
  --shell: 1400px;
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f9ff;
  --bg-deep: #e8f3fc;
  --surface: #ffffff;
  --surface-2: #eef6fc;
  --surface-3: #e2eef8;
  --text: #102a43;
  --muted: #4c6478;
  --faint: #6a8194;
  --accent: #087f78;
  --accent-strong: #066c66;
  --accent-soft: rgba(8, 127, 120, 0.09);
  --amber: #9a5d00;
  --line: rgba(42, 91, 122, 0.16);
  --line-strong: rgba(42, 91, 122, 0.32);
  --glow: rgba(66, 153, 184, 0.12);
  --header-bg: rgba(244, 249, 255, 0.88);
  --shadow: 0 18px 50px rgba(31, 75, 108, 0.12);
  --r-一般: #5f6f80; --r-精英: #18864a; --r-英雄: #1f63c6;
  --r-傳說: #8a3fd6; --r-史詩: #c25a10; --r-太古: #c8283a;
}

/* 天使星空（14-celestial）：深紫到靛藍星空、光環金、薰衣草紫 */
html[data-theme="celestial"] {
  color-scheme: dark;
  --bg: #170f45;
  --bg-deep: #0b0b33;
  --surface: rgba(30, 24, 92, 0.78);
  --surface-2: rgba(42, 33, 118, 0.72);
  --surface-3: rgba(56, 44, 140, 0.7);
  --text: #ece7ff;
  --muted: #b9b2e6;
  --faint: #9087c4;
  --accent: #ffe3a3;
  --accent-strong: #ffd27a;
  --accent-soft: rgba(255, 238, 189, 0.12);
  --amber: #ffd27a;
  --line: rgba(205, 184, 255, 0.2);
  --line-strong: rgba(205, 184, 255, 0.38);
  --glow: rgba(183, 156, 255, 0.22);
  --header-bg: rgba(26, 14, 70, 0.78);
  --shadow: 0 20px 60px rgba(5, 3, 30, 0.5);
  --r-一般: #b9b2e6; --r-精英: #7fe0a6; --r-英雄: #8cc0ff;
  --r-傳說: #d7b0ff; --r-史詩: #ffb27a; --r-太古: #ff8a95;
  --font: "Noto Serif TC", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", serif;
}
html[data-theme="celestial"] body {
  background:
    radial-gradient(1px 1px at 12% 18%, #fff 60%, transparent), radial-gradient(1px 1px at 72% 9%, #fff 60%, transparent),
    radial-gradient(1.5px 1.5px at 33% 42%, #fff8 60%, transparent), radial-gradient(1px 1px at 88% 36%, #fff 60%, transparent),
    radial-gradient(1px 1px at 52% 71%, #fffa 60%, transparent), radial-gradient(1.5px 1.5px at 8% 82%, #fff 60%, transparent),
    radial-gradient(1px 1px at 64% 54%, #fff9 60%, transparent), radial-gradient(1px 1px at 93% 88%, #fff 60%, transparent),
    radial-gradient(1px 1px at 22% 63%, #fff7 60%, transparent), radial-gradient(1.5px 1.5px at 45% 12%, #ffeebd 60%, transparent),
    radial-gradient(circle at 50% -10%, rgba(255, 238, 189, 0.16), transparent 32rem),
    linear-gradient(180deg, #2a0f55 0, #231a6e 35%, #101a58 70%, #070b2e 100%);
  background-size: 420px 420px, 520px 520px, 360px 360px, 610px 610px, 470px 470px, 390px 390px, 550px 550px, 640px 640px, 330px 330px, 700px 700px, auto, auto;
  background-attachment: fixed;
}
html[data-theme="celestial"] h1, html[data-theme="celestial"] .al2-brand { letter-spacing: .08em; text-shadow: 0 0 18px rgba(255, 238, 189, 0.35); }
html[data-theme="celestial"] .panel, html[data-theme="celestial"] .al2-subnav { backdrop-filter: blur(6px); }

/* 電子紙：像電子書閱讀器，米白紙面、黑墨字、幾乎不用顏色、沒有陰影漸層 */
html[data-theme="paper"] {
  color-scheme: light;
  --bg: #efede6;
  --bg-deep: #e6e3da;
  --surface: #f6f4ee;
  --surface-2: #ebe8df;
  --surface-3: #e1ded4;
  --text: #1d1d1b;
  --muted: #45443f;
  --faint: #6b6a63;
  --accent: #1d1d1b;
  --accent-strong: #000;
  --accent-soft: rgba(29, 29, 27, 0.07);
  --amber: #3a3934;
  --line: rgba(29, 29, 27, 0.18);
  --line-strong: rgba(29, 29, 27, 0.42);
  --glow: transparent;
  --header-bg: #efede6;
  --shadow: none;
  --r-一般: #6b6a63; --r-精英: #3d5a45; --r-英雄: #34465e;
  --r-傳說: #523f63; --r-史詩: #6a4a2c; --r-太古: #6e2f2f;
  --font: "Noto Serif TC", "Songti TC", "PMingLiU", "MingLiU", Georgia, serif;
  --radius: 4px;
}
html[data-theme="paper"] body { background: var(--bg); letter-spacing: .01em; }
html[data-theme="paper"] *, html[data-theme="paper"] *::before, html[data-theme="paper"] *::after { box-shadow: none !important; text-shadow: none !important; transition: none !important; animation: none !important; }
html[data-theme="paper"] .al2-header { backdrop-filter: none; border-bottom: 2px solid var(--text); }
html[data-theme="paper"] .panel { background: var(--surface); }
html[data-theme="paper"] a { text-decoration-thickness: 1px; }

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0; min-width: 320px;
  background: radial-gradient(circle at 78% 0, var(--glow), transparent 36rem), var(--bg);
  color: var(--text); font: 15px/1.7 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.shell { width: min(calc(100% - 40px), var(--shell)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 200; padding: 8px 14px; background: var(--accent); color: var(--bg); border-radius: 8px; }
.skip-link:focus { top: 10px; }

/* ---------- 頂欄 ---------- */
.al2-header { position: sticky; top: 0; z-index: 60; background: var(--header-bg); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.al2-header__inner { display: flex; align-items: center; gap: 28px; min-height: 64px; }
.al2-brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
.al2-brand:hover { text-decoration: none; }
.al2-brand img { width: 34px; height: 34px; border-radius: 50%; }
.al2-brand small { padding-left: 10px; border-left: 1px solid var(--line-strong); color: var(--muted); font-size: 13px; font-weight: 500; letter-spacing: 0; }
.al2-nav { display: flex; gap: 4px; margin-left: auto; }
.al2-nav a { position: relative; padding: 8px 12px; color: var(--muted); font-weight: 700; font-size: 14.5px; border-radius: 8px; }
.al2-nav a:hover { color: var(--text); text-decoration: none; background: var(--accent-soft); }
.al2-nav a[aria-current="page"] { color: var(--accent); }
.al2-nav a[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; background: var(--accent); border-radius: 2px; }
.al2-theme { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 8px 0 10px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 700; cursor: pointer; }
.al2-theme:hover, .al2-theme:focus-within { color: var(--text); border-color: var(--accent); }
.al2-theme__ic { display: inline-grid; }
.al2-theme svg { width: 17px; height: 17px; }
.al2-theme select { appearance: none; -webkit-appearance: none; border: 0; background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238aa' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 2px center / 12px; color: inherit; font: inherit; padding: 0 18px 0 0; cursor: pointer; outline: none; }
.al2-theme select option { background: var(--surface); color: var(--text); }
.al2-menu { display: none; }

.al2-subnav { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 50%, transparent); }
.al2-subnav .shell { display: flex; gap: 6px; padding: 8px 0; overflow-x: auto; scrollbar-width: none; }
.al2-subnav a { flex: none; padding: 5px 14px; border-radius: 999px; color: var(--muted); font-size: 14px; font-weight: 600; }
.al2-subnav a:hover { text-decoration: none; color: var(--text); background: var(--accent-soft); }
.al2-subnav a[aria-current="page"] { background: var(--accent); color: var(--bg); }

/* ---------- 頁尾 ---------- */
.al2-footer { margin-top: 60px; padding: 28px 0 36px; border-top: 1px solid var(--line); color: var(--faint); font-size: 13.5px; }
.al2-footer .shell { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 28px; }
.al2-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.al2-footer a { color: var(--muted); }

/* ---------- 共用元件 ---------- */
.page-head { padding: 28px 0 18px; }
.page-head h1 { margin: 0; font-size: clamp(26px, 3vw, 34px); letter-spacing: -.01em; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.source-note { color: var(--faint); font-size: 12.5px; }

.field { position: relative; }
.field svg { position: absolute; left: 13px; top: 50%; width: 18px; height: 18px; translate: 0 -50%; stroke: var(--faint); fill: none; stroke-width: 2; pointer-events: none; }
.input { width: 100%; height: 44px; padding: 0 14px 0 40px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; }
.input::placeholder { color: var(--faint); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--surface-3); color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.badge--new { background: var(--amber); color: #1a1200; }
html[data-theme="paper"] .badge--new { background: var(--text); color: var(--bg); }
.rar { color: var(--rc); }
.rar-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--rc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rc) 22%, transparent); }
[data-r="一般"] { --rc: var(--r-一般); } [data-r="精英"] { --rc: var(--r-精英); } [data-r="英雄"] { --rc: var(--r-英雄); }
[data-r="傳說"] { --rc: var(--r-傳說); } [data-r="史詩"] { --rc: var(--r-史詩); } [data-r="太古"] { --rc: var(--r-太古); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.empty { padding: 40px 20px; text-align: center; color: var(--faint); }

/* ---------- 響應式頂欄 ---------- */
@media (max-width: 900px) {
  .al2-brand small { display: none; }
  .al2-menu { display: inline-grid; place-items: center; width: 40px; height: 38px; margin-left: auto; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); cursor: pointer; }
  .al2-menu svg { width: 20px; height: 20px; stroke: var(--text); }
  .al2-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; padding: 8px 20px 14px; background: var(--bg); border-bottom: 1px solid var(--line-strong); }
  .al2-nav[data-open="true"] { display: flex; }
  .al2-nav a { padding: 12px 6px; border-bottom: 1px solid var(--line); }
  .al2-nav a[aria-current="page"]::after { display: none; }
  .al2-header__inner { gap: 10px; }
}
@media (max-width: 520px) {
  .shell { width: min(calc(100% - 24px), var(--shell)); }
  .al2-theme select { width: 18px; color: transparent; }
}
html[data-theme="paper"] .tile--big { background: var(--surface); border-width: 2px; }
