/* ============ 基礎 ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #94a3b8;
  --bg: #f6f7fb;
  --card-bg: #ffffff;
  --line: #e2e8f0;
  --accent: #4f46e5;
  --accent-2: #6366f1;
  --hero-1: #0b1e3f;
  --hero-2: #14306b;
  --gold: #b45309;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(15,23,42,.05), 0 8px 24px rgba(15,23,42,.07);
  --shadow-lg: 0 4px 12px rgba(15,23,42,.1), 0 24px 48px rgba(15,23,42,.14);
}
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
.muted { color: var(--ink-3); }

/* ============ Header ============ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11,30,63,.88);
  backdrop-filter: blur(12px);
  color: #fff;
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg,#f59e0b,#ef4444);
  display: grid; place-items: center;
  font-weight: 800; font-size: 17px;
}
.logo-text { font-size: 17px; letter-spacing: .02em; }
.logo-text b { color: #fbbf24; }
.header-nav { display: flex; gap: 20px; margin-left: 8px; }
.header-nav a { color: #cbd5e1; text-decoration: none; font-size: 14px; }
.header-nav a:first-child { color: #fff; font-weight: 600; }
.proto-badge {
  margin-left: auto; font-size: 12px; color: #93c5fd;
  border: 1px solid rgba(147,197,253,.35); border-radius: 999px;
  padding: 3px 10px; white-space: nowrap;
}

/* ============ Hero ============ */
.hero {
  background:
    radial-gradient(1200px 500px at 80% -10%, rgba(99,102,241,.35), transparent 60%),
    radial-gradient(900px 400px at 10% 110%, rgba(245,158,11,.18), transparent 55%),
    linear-gradient(160deg, var(--hero-1), var(--hero-2));
  color: #fff;
  padding: 56px 0 96px;
}
.hero-head { text-align: center; max-width: 720px; margin: 0 auto 36px; }
.hero-eyebrow {
  font-size: 13px; letter-spacing: .14em; color: #93c5fd;
  text-transform: uppercase; margin-bottom: 14px;
}
.hero h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.25; font-weight: 800; }
.hero h1 em { font-style: normal; color: #fbbf24; }
.hero-sub { margin-top: 14px; font-size: 16px; color: #c7d2fe; }
.mobile-br { display: none; }

/* Matcher 面板 */
.matcher {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 24px;
  padding: 28px;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-lg);
  max-width: 860px; margin: 0 auto;
}
.q + .q { margin-top: 24px; }
.q-label { font-size: 15px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.q-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: #fbbf24; color: #1e293b;
  display: inline-grid; place-items: center;
  font-size: 12px; font-weight: 800;
}
.choice-row { display: flex; flex-wrap: wrap; gap: 10px; }
.choice {
  flex: 1 1 120px;
  background: rgba(255,255,255,.08);
  border: 1.5px solid rgba(255,255,255,.16);
  border-radius: 14px;
  padding: 12px 10px;
  text-align: center;
  color: #e2e8f0;
  transition: all .15s ease;
  display: flex; flex-direction: column; gap: 2px; align-items: center;
}
.choice:hover { border-color: rgba(255,255,255,.45); background: rgba(255,255,255,.13); }
.choice.active {
  background: #fbbf24; border-color: #fbbf24; color: #1e293b;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(251,191,36,.35);
}
.choice-big { font-size: 18px; font-weight: 800; }
.choice-title { font-size: 13px; font-weight: 600; }
.choice-sub { font-size: 11px; opacity: .7; }
.choice.slim { flex: 1 1 100px; padding: 12px 8px; font-size: 14px; font-weight: 600; }
.choice.pill { flex: 0 1 auto; padding: 9px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; }

.matcher-footer {
  margin-top: 28px; display: flex; align-items: center; gap: 20px;
  flex-wrap: wrap; justify-content: space-between;
}
.match-count { font-size: 15px; color: #c7d2fe; }
.match-count b { color: #fbbf24; font-size: 22px; margin: 0 4px; }
.cta {
  background: linear-gradient(135deg,#f59e0b,#ef4444);
  color: #fff; font-weight: 700; font-size: 16px;
  padding: 14px 30px; border-radius: 999px;
  box-shadow: 0 8px 24px rgba(239,68,68,.35);
  transition: transform .15s ease, box-shadow .15s ease;
}
.cta:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(239,68,68,.45); }
.cta.small { padding: 10px 22px; font-size: 14px; }
.ghost { color: var(--ink-3); font-size: 14px; padding: 10px 12px; }
.ghost:hover { color: var(--ink); }

/* ============ 圖鑑區 ============ */
.dex { padding: 48px 0 80px; }
.dex-toolbar { margin-bottom: 24px; }
.dex-toolbar h2 { font-size: 24px; margin-bottom: 16px; }
.toolbar-controls {
  display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 7px 14px; border-radius: 999px;
  background: #fff; border: 1.5px solid var(--line);
  font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  transition: all .12s ease;
}
.chip:hover { border-color: var(--accent-2); color: var(--accent); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.selects { display: flex; gap: 8px; }
.selects select {
  font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink-2);
  padding: 7px 12px; border-radius: 10px;
  border: 1.5px solid var(--line); background: #fff;
}

/* 卡片格 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}
.dex-card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
  display: flex; flex-direction: column;
}
.dex-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.card-art {
  position: relative; padding: 18px 18px 14px; color: #fff;
  min-height: 118px; display: flex; flex-direction: column; justify-content: space-between;
}
.card-art::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(400px 160px at 85% -20%, rgba(255,255,255,.28), transparent 60%);
  pointer-events: none;
}
.card-art.light-art { color: #1e293b; }
.art-top { display: flex; justify-content: space-between; align-items: flex-start; }
.dex-no { font-size: 12px; font-weight: 700; opacity: .8; letter-spacing: .08em; }
.rarity {
  font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 999px;
  letter-spacing: .05em;
}
.rarity.r5 { background: linear-gradient(135deg,#fbbf24,#f59e0b); color: #451a03; }
.rarity.r4 { background: #ede9fe; color: #6d28d9; }
.rarity.r3 { background: #dbeafe; color: #1d4ed8; }
.rarity.r2 { background: #d1fae5; color: #047857; }
.rarity.r1 { background: #f1f5f9; color: #475569; }
.art-name { font-size: 18px; font-weight: 800; line-height: 1.3; position: relative; }
.art-issuer { font-size: 12px; opacity: .85; position: relative; }

.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.offer-line {
  background: #fffbeb; border: 1px dashed #f59e0b; border-radius: 10px;
  padding: 8px 12px; font-size: 13.5px; font-weight: 600; color: #92400e;
}
.offer-line.none { background: #f8fafc; border-color: var(--line); color: var(--ink-3); font-weight: 500; }
.fact-row { display: flex; gap: 14px; font-size: 13px; color: var(--ink-2); }
.fact-row b { color: var(--ink); }
.reward-list { list-style: none; font-size: 13.5px; color: var(--ink-2); display: flex; flex-direction: column; gap: 4px; }
.reward-list li::before { content: "▸ "; color: var(--accent); font-weight: 700; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.tag {
  font-size: 11.5px; font-weight: 600; color: var(--ink-2);
  background: #f1f5f9; border-radius: 6px; padding: 3px 8px;
}
.tag.hot { background: #fef3c7; color: #92400e; }
.card-actions { display: flex; gap: 8px; margin-top: 4px; }
.btn-detail {
  flex: 1; text-align: center; font-size: 13.5px; font-weight: 700;
  padding: 9px 0; border-radius: 10px;
  background: var(--ink); color: #fff;
  transition: background .12s ease;
}
.btn-detail:hover { background: #1e293b; }
.btn-compare {
  flex: 1; text-align: center; font-size: 13.5px; font-weight: 700;
  padding: 9px 0; border-radius: 10px;
  border: 1.5px solid var(--line); color: var(--ink-2);
  transition: all .12s ease;
}
.btn-compare:hover { border-color: var(--accent); color: var(--accent); }
.btn-compare.added { background: #eef2ff; border-color: var(--accent); color: var(--accent); }

.empty { text-align: center; padding: 60px 0; font-size: 17px; }

/* ============ 比較列 ============ */
.compare-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  background: rgba(15,23,42,.96); color: #fff;
  padding: 12px 0;
  box-shadow: 0 -8px 30px rgba(15,23,42,.3);
}
.compare-inner { display: flex; align-items: center; gap: 12px; }
.compare-slots { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; }
.compare-slot {
  background: rgba(255,255,255,.1); border-radius: 8px;
  padding: 6px 12px; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.compare-slot button { color: #94a3b8; font-size: 15px; line-height: 1; }
.compare-slot button:hover { color: #fff; }
.compare-bar .ghost { color: #94a3b8; }
.compare-bar .ghost:hover { color: #fff; }

/* ============ Modal ============ */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15,23,42,.55);
  backdrop-filter: blur(4px);
  display: none; place-items: center;
  padding: 20px;
}
.modal-backdrop:not([hidden]) { display: grid; }
.modal {
  background: #fff; border-radius: 20px;
  max-width: 860px; width: 100%; max-height: 86vh; overflow: auto;
  box-shadow: var(--shadow-lg);
}
.modal-art { padding: 26px 28px; color: #fff; position: relative; }
.modal-art.light-art { color: #1e293b; }
.modal-close {
  position: absolute; top: 14px; right: 16px;
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(0,0,0,.25); color: #fff; font-size: 16px;
}
.modal-art h3 { font-size: 24px; font-weight: 800; }
.modal-art .sub { font-size: 13px; opacity: .85; }
.modal-body { padding: 24px 28px 28px; }
.modal-blurb { font-size: 15px; color: var(--ink-2); margin-bottom: 18px; }
.modal-facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin-bottom: 18px;
}
.fact-box { background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.fact-box .k { font-size: 12px; color: var(--ink-3); }
.fact-box .v { font-size: 16px; font-weight: 800; }
.modal-body h4 { font-size: 14px; margin: 16px 0 8px; color: var(--ink-2); }
.modal-note {
  margin-top: 20px; font-size: 12px; color: var(--ink-3);
  border-top: 1px solid var(--line); padding-top: 12px;
}

/* 比較表 */
.cmp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cmp-table th, .cmp-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.cmp-table th { font-size: 12.5px; color: var(--ink-3); font-weight: 600; white-space: nowrap; }
.cmp-table td b { font-size: 15px; }
.cmp-head-art {
  border-radius: 10px; color: #fff; padding: 10px 12px;
  font-weight: 800; font-size: 14px; line-height: 1.3;
}
.cmp-head-art.light-art { color: #1e293b; }

/* ============ Footer ============ */
.site-footer {
  background: #0f172a; color: #94a3b8;
  padding: 28px 0 40px; font-size: 13px; line-height: 1.8;
}
.site-footer b { color: #e2e8f0; }
.site-footer .muted { margin-top: 8px; color: #64748b; }

/* ============ RWD ============ */
@media (max-width: 720px) {
  .header-nav { display: none; }
  .mobile-br { display: block; }
  .hero { padding: 40px 0 64px; }
  .matcher { padding: 20px 16px; }
  .choice { flex: 1 1 44%; }
  .choice.slim { flex: 1 1 30%; }
  .matcher-footer { justify-content: center; text-align: center; }
  .toolbar-controls { flex-direction: column; align-items: stretch; }
  .selects select { flex: 1; }
}
