/* ==========================================================================
   Pokédex · 全国图鉴  —  stylesheet
   ========================================================================== */

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, dl, dd, dt, figure { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
::selection { background: rgba(227, 53, 43, .35); }

/* ---------- tokens ---------- */
:root {
  --bg: #080a0f;
  --bg-2: #0b0e15;
  --panel: rgba(255, 255, 255, .042);
  --panel-2: rgba(255, 255, 255, .065);
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .14);
  --text: #eaeef7;
  --muted: #8b94a7;
  --muted-2: #626c80;
  --red: #e3352b;
  --red-2: #ff6a5e;
  --blue: #3aa0ff;
  --gold: #ffca3a;
  --shadow-lg: 0 40px 80px -30px rgba(0, 0, 0, .9), 0 12px 30px -18px rgba(0, 0, 0, .9);
  --shadow-card: 0 18px 32px -22px rgba(0, 0, 0, .9);
  --radius: 20px;
  --header-h: 76px;
  --max-w: 1440px;
  --ease: cubic-bezier(.22, .8, .26, 1);
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #eef1f7;
  --bg-2: #ffffff;
  --panel: rgba(255, 255, 255, .78);
  --panel-2: rgba(255, 255, 255, .95);
  --line: rgba(18, 24, 40, .1);
  --line-strong: rgba(18, 24, 40, .18);
  --text: #111623;
  --muted: #5c6679;
  --muted-2: #7d879a;
  --shadow-lg: 0 40px 80px -34px rgba(30, 40, 70, .45), 0 12px 30px -18px rgba(30, 40, 70, .25);
  --shadow-card: 0 18px 30px -24px rgba(30, 40, 70, .35);
  color-scheme: light;
}

/* ---------- base ---------- */
html, body { min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei",
    "Noto Sans SC", "Source Han Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
body.modal-open { overflow: hidden; }

.bg-deco {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1200px 640px at 8% -12%, rgba(227, 53, 43, .22), transparent 62%),
    radial-gradient(1000px 520px at 96% -6%, rgba(58, 160, 255, .16), transparent 60%),
    radial-gradient(900px 700px at 50% 110%, rgba(120, 80, 255, .1), transparent 65%);
}
html[data-theme="light"] .bg-deco {
  background:
    radial-gradient(1100px 600px at 8% -10%, rgba(227, 53, 43, .16), transparent 62%),
    radial-gradient(900px 520px at 96% -8%, rgba(58, 160, 255, .14), transparent 62%),
    radial-gradient(800px 600px at 50% 112%, rgba(140, 100, 255, .1), transparent 65%);
}
.bg-deco::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .028) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 65% at 50% 0%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 90% 65% at 50% 0%, #000 20%, transparent 75%);
}
html[data-theme="light"] .bg-deco::after {
  background-image:
    linear-gradient(rgba(20, 30, 60, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 30, 60, .05) 1px, transparent 1px);
}

/* ---------- 水印 ---------- */
.watermark {
  position: fixed;
  inset: -8% -4%;
  z-index: -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-content: space-around;
  gap: 60px 20px;
  transform: rotate(-18deg);
  pointer-events: none;
  user-select: none;
  overflow: hidden;
  color: #fff;
  opacity: .022;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .12em;
  white-space: nowrap;
}
.watermark span { text-align: center; }
html[data-theme="light"] .watermark { color: #111623; opacity: .03; }
.wm-credit { letter-spacing: .08em; color: var(--muted-2); opacity: .85; }
.card-wm {
  position: absolute;
  right: 9px;
  bottom: 7px;
  color: var(--muted-2);
  opacity: .55;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  pointer-events: none;
  user-select: none;
}
.sheet-wm {
  position: absolute;
  left: 12px;
  bottom: 10px;
  z-index: 1;
  color: var(--text);
  opacity: .14;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .16em;
  transform: rotate(-90deg);
  transform-origin: left bottom;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}
.sheet-wm2 {
  position: absolute;
  right: 14px;
  bottom: 12px;
  z-index: 1;
  color: var(--text);
  opacity: .12;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .2em;
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}
.block-title.keep-case { text-transform: none; }

/* ---------- header ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  backdrop-filter: blur(22px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.app-header::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--red) 18%, #ff8a5c 50%, var(--red) 82%, transparent);
  opacity: .85;
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  min-height: var(--header-h);
  padding: 12px clamp(16px, 3vw, 34px);
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 34px);
}

.brand { display: flex; align-items: center; gap: 13px; min-width: 0; }
.lens {
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 33% 27%, #e6f7ff 0%, #7cc8ff 26%, #2b86e6 58%, #0b3f8f 84%, #052045 100%);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, .07),
    0 0 0 5px rgba(0, 0, 0, .35),
    0 0 26px rgba(58, 160, 255, .55),
    inset 0 -8px 16px rgba(0, 0, 0, .55);
  animation: lensPulse 4.5s ease-in-out infinite;
}
.lens::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 8px;
  width: 16px;
  height: 11px;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0));
  filter: blur(.4px);
  transform: rotate(-18deg);
}
@keyframes lensPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255, 255, 255, .07), 0 0 0 5px rgba(0, 0, 0, .35), 0 0 22px rgba(58, 160, 255, .45), inset 0 -8px 16px rgba(0, 0, 0, .55); }
  50% { box-shadow: 0 0 0 3px rgba(255, 255, 255, .07), 0 0 0 5px rgba(0, 0, 0, .35), 0 0 34px rgba(58, 160, 255, .75), inset 0 -8px 16px rgba(0, 0, 0, .55); }
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand-text strong {
  font-size: clamp(18px, 2.1vw, 21px);
  font-weight: 800;
  letter-spacing: .02em;
  background: linear-gradient(100deg, var(--text) 20%, #ffb0a6 55%, var(--text) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}
.brand-text small {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .18em;
  color: var(--muted);
  text-transform: uppercase;
  white-space: nowrap;
}
.brand-text small i { font-style: normal; color: var(--red-2); margin: 0 2px; }
.leds { display: flex; gap: 4px; margin-left: 2px; }
.led { width: 6px; height: 6px; border-radius: 50%; opacity: .9; }
.led-r { background: #ff4b3e; box-shadow: 0 0 8px rgba(255, 75, 62, .9); }
.led-y { background: #ffd23e; box-shadow: 0 0 8px rgba(255, 210, 62, .85); }
.led-g { background: #3ee08a; box-shadow: 0 0 8px rgba(62, 224, 138, .85); }

.header-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; flex: 1 1 auto; justify-content: flex-end; }
.search {
  position: relative;
  display: flex;
  align-items: center;
  width: min(430px, 100%);
  height: 44px;
  padding: 0 10px 0 42px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.search:focus-within {
  border-color: color-mix(in srgb, var(--red) 60%, var(--line));
  box-shadow: 0 0 0 4px rgba(227, 53, 43, .14);
  background: var(--panel-2);
}
.search-icon { position: absolute; left: 14px; width: 18px; height: 18px; color: var(--muted); }
.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: none;
  font-size: 14px;
}
.search input::placeholder { color: var(--muted-2); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search input::-ms-clear { display: none; }
.search kbd {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .04);
  color: var(--muted);
  font: 600 11px/1 ui-monospace, "Cascadia Mono", Consolas, monospace;
}
.icon-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  transition: transform .18s var(--ease), border-color .2s, background .2s, color .2s;
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { border-color: var(--line-strong); background: var(--panel-2); transform: translateY(-1px); }
.icon-btn:active { transform: translateY(0) scale(.97); }
.icon-btn .ico-moon { display: none; }
html[data-theme="light"] .icon-btn .ico-sun { display: none; }
html[data-theme="light"] .icon-btn .ico-moon { display: block; }

/* ---------- filters ---------- */
.filters {
  position: sticky;
  top: var(--header-h);
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  backdrop-filter: blur(18px) saturate(130%);
  border-bottom: 1px solid var(--line);
}
.filter-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 12px clamp(16px, 3vw, 34px) 13px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.gens { display: flex; gap: 6px; flex-wrap: wrap; }
.gen-tab {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: color .18s, background .18s, border-color .18s;
}
.gen-tab b {
  font: 700 10px/1 ui-monospace, "Cascadia Mono", Consolas, monospace;
  opacity: .55;
  letter-spacing: .04em;
}
.gen-tab:hover { color: var(--text); background: var(--panel); }
.gen-tab.active {
  color: #fff;
  background: linear-gradient(180deg, #f0453a, #c92a20);
  border-color: rgba(255, 255, 255, .16);
  box-shadow: 0 8px 20px -10px rgba(227, 53, 43, .9), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.gen-tab.active b { opacity: .8; }

.type-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.types { display: flex; flex-wrap: wrap; gap: 6px; }
.type-chip {
  --c: #8b94a7;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: all .18s var(--ease);
}
.type-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px color-mix(in srgb, var(--c) 70%, transparent); }
.type-chip:hover { color: var(--text); border-color: var(--line-strong); transform: translateY(-1px); }
.type-chip.active {
  color: #fff;
  background: var(--c);
  border-color: var(--c);
  box-shadow: 0 6px 16px -8px var(--c), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.type-chip.active .dot { background: #fff; box-shadow: none; }
.type-chip.active[data-type="electric"],
.type-chip.active[data-type="ice"],
.type-chip.active[data-type="ground"] { color: #2a2305; }

.tool-row { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  transition: all .18s var(--ease);
}
.pill-btn svg { width: 15px; height: 15px; }
.pill-btn:hover { color: var(--text); border-color: var(--line-strong); background: var(--panel-2); }
.pill-btn[aria-pressed="true"] {
  color: #2a1c00;
  background: linear-gradient(180deg, #ffd45e, #ffb703);
  border-color: rgba(255, 200, 60, .8);
  box-shadow: 0 8px 20px -12px rgba(255, 183, 3, .9);
}
.pill-btn .count {
  display: none;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .16);
  font: 700 10.5px/16px ui-monospace, monospace;
  text-align: center;
}
.pill-btn.has-fav .count { display: inline-block; }

.shiny-switch { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--muted); user-select: none; }
.shiny-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.shiny-switch .track { position: relative; width: 30px; height: 18px; border-radius: 999px; background: rgba(255, 255, 255, .13); transition: background .2s; flex: none; }
.shiny-switch .thumb { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #cfd6e4; transition: transform .22s var(--ease), background .2s; }
.shiny-switch input:checked + .track { background: linear-gradient(90deg, #ff9a3c, #ffcf4a, #7ce7ff); }
.shiny-switch input:checked + .track .thumb { transform: translateX(12px); background: #fff; }
.shiny-switch:has(input:checked) { color: var(--text); }
.shiny-switch input:focus-visible + .track { outline: 2px solid var(--blue); outline-offset: 2px; }
html[data-theme="light"] .shiny-switch input:not(:checked) + .track { background: rgba(15, 22, 40, .16); }
html[data-theme="light"] .shiny-switch .thumb { background: #fff; box-shadow: 0 1px 3px rgba(15, 22, 40, .25); }
html[data-theme="light"] .tool { background: rgba(15, 22, 40, .05); }
html[data-theme="light"] .tool:hover { background: rgba(15, 22, 40, .1); }

.select-wrap { position: relative; display: inline-flex; align-items: center; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); }
.select-wrap svg { position: absolute; right: 9px; width: 14px; height: 14px; color: var(--muted); pointer-events: none; }
.select-wrap select {
  appearance: none;
  -webkit-appearance: none;
  height: 100%;
  padding: 0 30px 0 12px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  outline: 0;
}
.select-wrap:hover { border-color: var(--line-strong); }

/* ---------- page ---------- */
.page {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 22px clamp(16px, 3vw, 34px) 60px;
}
.result-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; min-height: 24px; }
.result-bar p { color: var(--muted); font-size: 13px; font-weight: 500; letter-spacing: .01em; }
.result-bar p b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.link-btn { color: var(--red-2); font-size: 13px; font-weight: 600; padding: 4px 0; }
.link-btn:hover { text-decoration: underline; }

/* ---------- grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(164px, 1fr));
  gap: 14px;
}
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 13px 14px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 90% at 50% -12%, var(--t-soft, rgba(255, 255, 255, .06)), transparent 62%),
    linear-gradient(170deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .012)),
    #0f131b;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  overflow: hidden;
  content-visibility: auto;
  contain-intrinsic-size: 238px;
  transition: transform .24s var(--ease), border-color .24s, box-shadow .24s;
  animation: cardIn .42s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 18ms);
}
html[data-theme="light"] .card {
  background:
    radial-gradient(120% 90% at 50% -12%, var(--t-soft, rgba(0, 0, 0, .04)), transparent 62%),
    linear-gradient(170deg, #ffffff, #f7f9fd),
    #ffffff;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: none; }
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid transparent;
  transition: border-color .24s;
  pointer-events: none;
}
.card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--t, #fff) 42%, var(--line));
  box-shadow: 0 26px 46px -26px rgba(0, 0, 0, .95), 0 0 0 1px color-mix(in srgb, var(--t, #fff) 18%, transparent), 0 0 34px -12px color-mix(in srgb, var(--t, #fff) 45%, transparent);
}
.card:focus-visible { outline: 2px solid var(--t, var(--blue)); outline-offset: 3px; }

.card-top { display: flex; align-items: center; justify-content: space-between; }
.dex-no {
  font: 700 11px/1 ui-monospace, "Cascadia Mono", Consolas, monospace;
  letter-spacing: .07em;
  color: var(--muted-2);
}
.fav-star {
  width: 26px;
  height: 26px;
  margin: -4px -5px 0 0;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--muted-2);
  opacity: .55;
  transition: all .18s var(--ease);
}
.fav-star svg { width: 15px; height: 15px; }
.card:hover .fav-star { opacity: 1; }
.fav-star:hover { color: var(--gold); background: rgba(255, 202, 58, .12); transform: scale(1.12); }
.fav-star[aria-pressed="true"] { color: var(--gold); opacity: 1; }
.fav-star[aria-pressed="true"] svg { fill: currentColor; }

.thumb {
  position: relative;
  height: 112px;
  display: grid;
  place-items: center;
  margin: 2px 0 6px;
}
.thumb::before {
  content: "";
  position: absolute;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--t, #fff) 30%, transparent), transparent 68%);
  filter: blur(6px);
  opacity: .9;
}
.thumb img {
  position: relative;
  width: 104px;
  height: 104px;
  object-fit: contain;
  filter: drop-shadow(0 14px 14px rgba(0, 0, 0, .38));
  transition: transform .3s var(--ease);
  image-rendering: auto;
}
.card:hover .thumb img { transform: translateY(-3px) scale(1.07); }
.card h3 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card .en {
  margin-top: 1px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 9px; }
.type-badge {
  --c: #8b94a7;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
}
.type-badge .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--c); }

/* ---------- empty / sentinel / footer ---------- */
.sentinel { height: 1px; }
.empty {
  flex: 1 1 auto;
  justify-content: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 70px 20px 90px;
  text-align: center;
  color: var(--muted);
}
.empty svg { width: 64px; height: 64px; color: var(--red-2); opacity: .8; margin-bottom: 6px; }
.empty h3 { color: var(--text); font-size: 17px; }
.empty p { font-size: 13.5px; margin-bottom: 8px; }
.site-footer {
  margin-top: auto;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  justify-content: space-between;
  color: var(--muted-2);
  font-size: 11.5px;
}
.site-footer a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.site-footer a:hover { color: var(--red-2); }

/* ---------- modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: clamp(10px, 2.4vw, 30px);
  background: rgba(3, 5, 9, .68);
  -webkit-backdrop-filter: blur(12px) saturate(120%);
  backdrop-filter: blur(12px) saturate(120%);
  animation: fadeIn .22s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  position: relative;
  width: min(1080px, 100%);
  max-height: min(94vh, 940px);
  display: flex;
  flex-direction: column;
  border-radius: 26px;
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: sheetIn .34s var(--ease) both;
  outline: none;
}
html[data-theme="light"] .sheet { background: #fff; }
@keyframes sheetIn {
  from { opacity: 0; transform: translateY(18px) scale(.975); }
  to { opacity: 1; transform: none; }
}
.sheet-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(10, 13, 20, .55);
  border: 1px solid var(--line-strong);
  color: #e7ecf6;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: transform .2s var(--ease), background .2s;
}
.sheet-close:hover { transform: rotate(90deg); background: var(--red); border-color: var(--red); }
.sheet-close svg { width: 17px; height: 17px; }
.sheet::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 57px;
  height: 34px;
  background: linear-gradient(to top, var(--bg-2) 18%, transparent);
  pointer-events: none;
  z-index: 2;
}

.detail {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 372px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

/* art panel */
.art-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 54px 26px 26px;
  background:
    radial-gradient(85% 62% at 50% 34%, var(--t-soft, rgba(255, 255, 255, .07)), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, .035), transparent 60%);
  border-right: 1px solid var(--line);
  overflow: hidden;
}
.art-panel::before {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  border: 1px dashed color-mix(in srgb, var(--t, #fff) 26%, transparent);
  opacity: .5;
  pointer-events: none;
}
.ghost-no {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  font: 900 clamp(80px, 9vw, 132px)/1 ui-monospace, "Cascadia Mono", Consolas, monospace;
  letter-spacing: -.04em;
  color: color-mix(in srgb, var(--t, #fff) 9%, transparent);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}
.hero {
  position: relative;
  width: min(340px, 84%);
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 34px 32px rgba(0, 0, 0, .5));
  animation: heroFloat 5s ease-in-out infinite;
}
html[data-theme="light"] .hero { filter: drop-shadow(0 26px 26px rgba(40, 50, 80, .28)); }
@keyframes heroFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
.art-tools { display: flex; gap: 8px; position: relative; }
.tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .06);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: all .18s var(--ease);
}
.tool svg { width: 15px; height: 15px; }
.tool:hover { background: rgba(255, 255, 255, .13); transform: translateY(-1px); }
.tool[aria-pressed="true"] { background: linear-gradient(120deg, #ffb347, #ffd76e, #7ce7ff); color: #221a00; border-color: transparent; }
.art-caption { position: relative; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.region-chip {
  padding: 2px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--t, #fff) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--t, #fff) 32%, transparent);
  color: color-mix(in srgb, var(--t, #fff) 78%, var(--text));
  font-weight: 700;
  font-size: 11px;
}
.tag-mark {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  background: linear-gradient(120deg, #ffcf4a, #ffa62b);
  color: #2a1c00;
}

/* info */
.info { padding: clamp(22px, 3vw, 34px); display: flex; flex-direction: column; gap: 22px; min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.info > * { flex: 0 0 auto; }
.info-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding-right: 46px; }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 700 11px/1 ui-monospace, "Cascadia Mono", Consolas, monospace;
  letter-spacing: .14em;
  color: var(--muted-2);
  text-transform: uppercase;
}
.eyebrow b { color: var(--red-2); font-weight: 700; }
.info-head h2 { margin-top: 7px; font-size: clamp(26px, 3.4vw, 36px); font-weight: 800; letter-spacing: .01em; line-height: 1.1; }
.alt-names { margin-top: 5px; font-size: 11.5px; font-weight: 600; letter-spacing: .1em; color: var(--muted-2); text-transform: uppercase; }
.info-head .badges { margin-top: 4px; }
.flavor {
  position: relative;
  padding: 14px 16px 14px 18px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: color-mix(in srgb, var(--text) 86%, var(--muted));
  font-size: 14px;
  line-height: 1.75;
}
.flavor::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--t, var(--red)), transparent);
}
.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--line);
}
.facts > div { padding: 12px 13px; background: var(--bg-2); }
html[data-theme="light"] .facts > div { background: #f8fafd; }
.facts dt { font-size: 10.5px; font-weight: 600; letter-spacing: .1em; color: var(--muted-2); text-transform: uppercase; }
.facts dd { margin-top: 4px; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.facts dd small { font-size: 11px; font-weight: 600; color: var(--muted); margin-left: 1px; }

.block { display: flex; flex-direction: column; gap: 11px; }
.block-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: .12em;
  color: var(--muted);
  text-transform: uppercase;
}
.block-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-strong), transparent); }
.block-title .sub { font: 700 11px/1 ui-monospace, monospace; letter-spacing: .04em; color: var(--muted-2); text-transform: none; }

.abilities { display: flex; flex-wrap: wrap; gap: 8px; }
.ability {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 13px;
  font-weight: 600;
}
.ability em {
  font-style: normal;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .05em;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(58, 160, 255, .16);
  color: var(--blue);
}
.ability.egg { border-color: rgba(255, 202, 58, .26); background: rgba(255, 202, 58, .08); }
.egg-dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(255, 202, 58, .55);
}
html[data-theme="light"] .ability.egg { background: rgba(255, 183, 3, .13); border-color: rgba(255, 183, 3, .38); }

.stats { display: flex; flex-direction: column; gap: 9px; }
.stat-row { display: grid; grid-template-columns: 40px 40px minmax(0, 1fr); align-items: center; gap: 12px; }
.stat-name { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.stat-val { font: 700 13px/1 ui-monospace, "Cascadia Mono", Consolas, monospace; text-align: right; font-variant-numeric: tabular-nums; }
.bar { position: relative; height: 7px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
html[data-theme="light"] .bar { background: rgba(15, 22, 40, .08); }
.bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--sc) 70%, #fff 0%), var(--sc));
  box-shadow: 0 0 12px color-mix(in srgb, var(--sc) 55%, transparent);
  transition: width .8s var(--ease);
}
.stat-total { display: grid; grid-template-columns: 40px 40px minmax(0, 1fr); gap: 12px; align-items: center; margin-top: 3px; padding-top: 9px; border-top: 1px dashed var(--line); }
.stat-total .stat-name, .stat-total .stat-val { color: var(--text); }
.stat-total .bar { background: none; height: auto; font-size: 0; }

/* evolution */
.evo { display: flex; align-items: center; gap: 14px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.evo-tree { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.evo-branches { display: flex; flex-direction: column; gap: 7px; }
.evo-branches.many { display: grid; grid-template-columns: repeat(2, max-content); align-content: start; gap: 8px 18px; }
.evo-path { display: flex; align-items: center; gap: 8px; }
.evo-node {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  width: 88px;
  padding: 8px 6px 7px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  transition: all .18s var(--ease);
}
.evo-node img { width: 52px; height: 52px; object-fit: contain; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .35)); }
.evo-node span { font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.evo-node small { font: 600 9.5px/1 ui-monospace, monospace; color: var(--muted-2); }
.evo-node:hover { transform: translateY(-2px); border-color: var(--line-strong); background: var(--panel-2); }
.evo-node.current {
  border-color: color-mix(in srgb, var(--t, var(--red)) 62%, transparent);
  background: color-mix(in srgb, var(--t, var(--red)) 12%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--t, var(--red)) 35%, transparent);
}
.evo-arrow { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted-2); min-width: 42px; }
.evo-arrow em {
  font-style: normal;
  font-size: 9.5px;
  font-weight: 600;
  white-space: nowrap;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
  background: var(--panel);
  padding: 1px 5px;
  border-radius: 5px;
}
.evo-arrow i { position: relative; display: block; width: 28px; height: 1px; background: var(--line-strong); }
.evo-arrow i::after {
  content: "";
  position: absolute;
  right: 0;
  top: -2.5px;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid var(--muted-2);
  border-top: 1.5px solid var(--muted-2);
  transform: rotate(45deg);
}
.evo-single { font-size: 13px; color: var(--muted); }
.evo-single b { color: var(--text); }

/* matchups */
.matchups { display: flex; flex-direction: column; gap: 8px; }

/* 分布 */
.dist-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.dist-tab {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  transition: all .18s var(--ease);
}
.dist-tab b { font: 700 10px/1 ui-monospace, monospace; opacity: .6; }
.dist-tab:hover { color: var(--text); border-color: var(--line-strong); }
.dist-tab.on {
  color: #fff;
  background: linear-gradient(180deg, #f0453a, #c92a20);
  border-color: rgba(255, 255, 255, .16);
}
.dist-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}
.dist-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
}
.dist-loc {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dist-meta { display: flex; flex: none; align-items: center; gap: 5px; font-size: 10.5px; color: var(--muted); }
.dist-method, .dist-lv { padding: 1px 6px; border-radius: 5px; background: rgba(255, 255, 255, .06); }
.dist-rarity { padding: 1px 6px; border-radius: 5px; font-weight: 800; }
.r-VeryCommon, .r-Common { color: #9fd8ac; background: rgba(90, 200, 120, .12); }
.r-Uncommon { color: #9cc8ff; background: rgba(90, 160, 255, .12); }
.r-Rare { color: #cbb0ff; background: rgba(160, 120, 255, .14); }
.r-VeryRare { color: #ffb27a; background: rgba(255, 150, 80, .14); }
.r-Horde { color: #ff9ecb; background: rgba(255, 100, 180, .14); }
.r-Lure { color: #ffd76a; background: rgba(255, 200, 58, .14); }
.r-Special { color: #ff9b9b; background: rgba(255, 90, 90, .14); }
.dist-note { margin-top: 8px; font-size: 10px; color: var(--muted-2); }
.dist-loading, .dist-none { padding: 4px 0; font-size: 12.5px; line-height: 1.6; color: var(--muted); }
html[data-theme="light"] .dist-method,
html[data-theme="light"] .dist-lv { background: rgba(15, 22, 40, .06); }
html[data-theme="light"] .r-VeryCommon,
html[data-theme="light"] .r-Common { color: #2f7d43; }
html[data-theme="light"] .r-Uncommon { color: #2b6fb3; }
html[data-theme="light"] .r-Rare { color: #7048b8; }
html[data-theme="light"] .r-VeryRare { color: #b35a1f; }
html[data-theme="light"] .r-Horde { color: #b83f7a; }
html[data-theme="light"] .r-Lure { color: #8f6c00; }
html[data-theme="light"] .r-Special { color: #b33c3c; }.match-group { display: flex; align-items: flex-start; gap: 10px; }
.match-label {
  flex: none;
  width: 42px;
  padding-top: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted-2);
  text-align: right;
}
.match-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.match-chip {
  --c: #8b94a7;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 26%, transparent);
}
.match-chip b { font: 800 10px/1 ui-monospace, monospace; opacity: .75; }
.match-none { font-size: 12.5px; color: var(--muted); padding-top: 2px; }

/* modal nav */
.sheet-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-2) 88%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 13px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  max-width: 46%;
  transition: all .18s var(--ease);
}
.nav-btn:hover:not(:disabled) { color: var(--text); border-color: var(--line-strong); background: var(--panel-2); }
.nav-btn:disabled { opacity: .35; cursor: not-allowed; }
.nav-btn img { width: 26px; height: 26px; object-fit: contain; }
.nav-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-btn svg { width: 15px; height: 15px; flex: none; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 90;
  transform: translate(-50%, 18px);
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(18, 22, 32, .92);
  border: 1px solid var(--line-strong);
  color: #eef2fa;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .8);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .25s var(--ease);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- scrollbar ---------- */
* { scrollbar-width: thin; scrollbar-color: rgba(140, 150, 170, .35) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(140, 150, 170, .3); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(140, 150, 170, .5); background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .detail { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  :root { --header-h: 68px; }
  .header-inner { flex-wrap: wrap; gap: 10px 14px; padding-top: 10px; padding-bottom: 10px; }
  .search { width: 100%; order: 3; }
  .header-tools { flex: 1 1 auto; }
  .search { flex: 1 1 100%; }
  .filters { position: static; }
  .detail { grid-template-columns: 1fr; grid-template-rows: none; overflow-y: auto; }
  .info { overflow: visible; }
  .art-panel { border-right: 0; border-bottom: 1px solid var(--line); padding: 30px 16px 16px; gap: 12px; }
  .art-panel::before { width: 200px; height: 200px; }
  .hero { width: min(198px, 52%); }
  .ghost-no { font-size: 68px; top: 0; }
  .art-tools { gap: 6px; }
  .tool { height: 32px; font-size: 11.5px; padding: 0 11px; }
  .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tool-row { margin-left: 0; }
  .evo-branches.many { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 11px; }
  .brand-text small { letter-spacing: .1em; }
  .leds { display: none; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sheet { border-radius: 20px; max-height: 96vh; }
  .modal { padding: 8px; }
  .info { padding: 20px 18px 26px; gap: 18px; }
  .stat-row, .stat-total { grid-template-columns: 34px 38px minmax(0, 1fr); gap: 9px; }
  .site-footer { flex-direction: column; }
  .tool-row { width: 100%; }
  .select-wrap { margin-left: auto; }
  .gens, .types { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; width: 100%; }
  .gens::-webkit-scrollbar, .types::-webkit-scrollbar { display: none; }
  .type-row { gap: 9px; }
  .search kbd { display: none; }
}
@media (max-width: 420px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .card { padding: 10px 11px 12px; }
  .thumb { height: 96px; }
  .thumb img { width: 88px; height: 88px; }
  .card h3 { font-size: 14.5px; }
  .type-badge { font-size: 9.5px; height: 18px; padding: 0 6px; }
  .gen-tab { padding: 6px 10px; font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ============================================================
   主功能切换 / 技能图鉴 / 特性表 / 启动弹窗
   ============================================================ */
.main-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.mtab {
  padding: 7px 16px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  transition: all .18s var(--ease);
}
.mtab:hover { color: var(--text); border-color: var(--line-strong); }
.mtab.on {
  color: #fff;
  background: linear-gradient(180deg, #f0453a, #c92a20);
  border-color: rgba(255, 255, 255, .16);
  box-shadow: 0 8px 20px -10px rgba(227, 53, 43, .9);
}
body.view-moves .dex-only,
body.view-abilities .dex-only { display: none; }
body.view-moves .header-tools .search,
body.view-abilities .header-tools .search { display: none; }

.egg-wrap select { max-width: 160px; }

/* 技能 / 特性页 */
.view-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 4px 0 14px; }
.view-head h2 { font-size: 22px; font-weight: 800; letter-spacing: .01em; }
.view-head p { color: var(--muted); font-size: 12.5px; }
.view-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.vinput {
  flex: 1 1 220px;
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  outline: none;
}
.vinput:focus { border-color: rgba(227, 53, 43, .55); box-shadow: 0 0 0 3px rgba(227, 53, 43, .12); }
.vselect {
  height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  outline: none;
}

.move-list, .ability-list { display: flex; flex-direction: column; gap: 7px; }
.move-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
  transition: border-color .18s, transform .18s;
}
.move-row:hover { border-color: var(--line-strong); transform: translateX(2px); }
.move-no { font: 700 10.5px/1 ui-monospace, monospace; color: var(--muted-2); }
.move-name { font-size: 13.5px; font-weight: 700; }
.move-badges { display: inline-flex; flex-wrap: wrap; gap: 5px; margin-left: 8px; vertical-align: middle; }
.move-cat {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
}
.cat-physical { color: #ff9b8f; background: rgba(255, 120, 100, .14); }
.cat-special { color: #8fc4ff; background: rgba(90, 160, 255, .14); }
.cat-status { color: #b9c0cf; background: rgba(170, 180, 200, .14); }
.move-stats { display: flex; gap: 10px; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.move-stats b { color: var(--text); font-weight: 700; margin-right: 2px; }
.move-empty { padding: 40px 10px; text-align: center; color: var(--muted); font-size: 13px; }

.ability-row {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
  transition: border-color .18s, transform .18s;
}
.ability-row:hover { border-color: var(--line-strong); transform: translateX(2px); }
.ability-row h3 { display: flex; align-items: baseline; gap: 8px; font-size: 13.5px; font-weight: 700; }
.ability-row h3 small { font-size: 10px; font-weight: 600; letter-spacing: .06em; color: var(--muted-2); text-transform: uppercase; }
.ability-row p { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.65; }

/* 通用信息弹窗 */
.info-modal { z-index: 70; }
.info-sheet {
  position: relative;
  width: min(720px, 100%);
  max-height: min(86vh, 760px);
  overflow-y: auto;
  padding: clamp(20px, 3vw, 30px);
  border-radius: 22px;
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
  box-shadow: var(--shadow-lg);
  animation: sheetIn .28s var(--ease) both;
}
.info-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 18px;
}
.info-close:hover { color: var(--text); border-color: var(--line-strong); }
.info-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding-right: 36px; }
.info-head h2 { font-size: 24px; font-weight: 800; }
.info-head .alt { margin-top: 4px; color: var(--muted-2); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.info-desc { margin-top: 14px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); font-size: 13px; line-height: 1.8; color: color-mix(in srgb, var(--text) 88%, var(--muted)); }
.info-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.info-stat { padding: 6px 10px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }
.info-stat b { color: var(--text); margin-left: 4px; }
.info-section { margin-top: 18px; }
.info-section h3 { font-size: 12px; font-weight: 800; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; margin-bottom: 8px; }
.learner-chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 170px; overflow-y: auto; }
.learner-groups { display: flex; flex-direction: column; gap: 14px; }
.learner-group h4 {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 0 0 6px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--muted);
}
.learner-group h4 b { font: 700 10px/1 ui-monospace, monospace; color: var(--muted-2); }
.learner-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 600;
}
.learner-chip small { color: var(--muted-2); font-size: 9.5px; font-weight: 600; }
.learner-chip:hover { border-color: var(--line-strong); background: var(--panel-2); }

/* 详情页技能表 */
.learn-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }
.learn-tab {
  padding: 5px 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
}
.learn-tab b { font: 700 9.5px/1 ui-monospace, monospace; opacity: .6; margin-left: 4px; }
.learn-tab.on { color: #fff; background: linear-gradient(180deg, #f0453a, #c92a20); border-color: rgba(255, 255, 255, .16); }
.learn-list { max-height: 330px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding-right: 4px; }
.learn-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
}
.learn-row:hover { border-color: var(--line-strong); }
.learn-level { font: 700 10.5px/1 ui-monospace, monospace; color: var(--muted-2); white-space: nowrap; }
.learn-name { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.learn-meta { display: flex; align-items: center; gap: 5px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.learn-empty { padding: 10px 4px; color: var(--muted); font-size: 12px; }

/* 启动弹窗 */
.startup {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 6, 10, .84);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  animation: fadeIn .25s ease both;
}
.startup-card {
  width: min(420px, 100%);
  padding: 34px 28px 28px;
  border-radius: 24px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #12151d, #0c0f15);
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.startup-lens {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  margin: 0 auto 18px;
  background: radial-gradient(circle at 33% 27%, #e6f7ff 0%, #7cc8ff 28%, #2b86e6 60%, #0b3f8f 88%, #052045 100%);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, .06), 0 0 28px rgba(58, 160, 255, .55);
}
.startup-card h2 { font-size: 24px; font-weight: 800; margin: 0 0 12px; }
.startup-card p { margin: 0 0 22px; color: var(--muted); font-size: 13.5px; line-height: 1.9; }
.pill-btn.primary {
  height: 42px;
  padding: 0 26px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: linear-gradient(180deg, #f0453a, #c92a20);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 10px 24px -12px rgba(227, 53, 43, .9);
}

@media (max-width: 760px) {
  .move-row { grid-template-columns: 46px minmax(0, 1fr); }
  .move-stats { grid-column: 2; justify-content: flex-start; }
  .move-badges { margin-left: 6px; }
  .vselect { flex: 1 1 30%; }
  .view-head h2 { font-size: 19px; }
}

/* ============================================================
   形态 / 努力值 / 分布图鉴
   ============================================================ */
body.view-spawns .dex-only { display: none; }
body.view-spawns .header-tools .search { display: none; }
body.view-other .dex-only { display: none; }
body.view-other .header-tools .search { display: none; }

.card-form-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(227, 53, 43, .16);
  color: #ff9b8f;
  font-size: 8.5px;
  font-weight: 700;
  vertical-align: middle;
}
.form-mark {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(227, 53, 43, .16);
  color: #ff9b8f;
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
}

.ev-list { display: flex; flex-wrap: wrap; gap: 6px; }
.ev-item {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 11.5px;
  color: var(--muted);
}
.ev-item b { color: #ffd166; font-size: 12.5px; }
.ev-none { color: var(--muted); font-size: 12px; }

.spawn-regions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.spawn-region-tab {
  padding: 6px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.spawn-region-tab b { margin-left: 5px; font: 700 9.5px/1 ui-monospace, monospace; opacity: .6; }
.spawn-region-tab.on {
  color: #fff;
  background: linear-gradient(180deg, #f0453a, #c92a20);
  border-color: rgba(255, 255, 255, .16);
}
.spawn-list { display: flex; flex-direction: column; gap: 7px; }
.spawn-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
  transition: border-color .18s, transform .18s;
}
.spawn-row:hover { border-color: var(--line-strong); transform: translateX(2px); }
.spawn-thumb { width: 46px; height: 46px; object-fit: contain; }
.spawn-title { display: flex; align-items: baseline; gap: 6px; font-size: 13.5px; font-weight: 700; }
.spawn-title small { font: 700 10px/1 ui-monospace, monospace; color: var(--muted-2); }
.spawn-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.spawn-region-tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; max-width: 420px; }
.spawn-region-tags span {
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .055);
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}
.spawn-total { font-size: 11px; color: var(--muted); white-space: nowrap; }
.spawn-total b { color: var(--text); font-size: 12.5px; }
.spawn-empty { padding: 40px 10px; text-align: center; color: var(--muted); font-size: 13px; }

@media (max-width: 760px) {
  .spawn-row { grid-template-columns: 40px minmax(0, 1fr); }
  .spawn-thumb { width: 40px; height: 40px; }
  .spawn-region-tags { grid-column: 2; justify-content: flex-start; max-width: none; }
  .spawn-total { grid-column: 2; }
}

/* ============================================================
   分布（按地点）/ 能力值计算器
   ============================================================ */
.main-tabs { flex-wrap: wrap; }
.spawn-modes { display: flex; gap: 6px; margin-bottom: 12px; }
.spawn-mode {
  padding: 6px 14px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
}
.spawn-mode.on {
  color: #fff;
  background: linear-gradient(180deg, #f0453a, #c92a20);
  border-color: rgba(255, 255, 255, .16);
}
.spawn-loc-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.spawn-loc-bar select { flex: 1 1 320px; max-width: 520px; }
.spawn-loc-bar span { color: var(--muted); font-size: 12px; }
.loc-entries { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; max-width: 560px; }
.loc-entries span {
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .055);
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}
.loc-entries b { color: var(--text); font-weight: 700; }

.calc-card {
  padding: clamp(16px, 2.4vw, 26px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}
.calc-top { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.calc-top .vinput { flex: 1 1 220px; }
.calc-top .vselect { flex: 0 1 auto; max-width: 260px; }
.calc-level {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}
.calc-level input {
  width: 56px;
  height: 30px;
  padding: 0 6px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font: 700 13px/1 ui-monospace, monospace;
  text-align: center;
  outline: none;
}
.calc-table { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.calc-row {
  display: grid;
  grid-template-columns: 90px 80px 96px 96px minmax(80px, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
}
.calc-row:first-child { border-top: 0; }
.calc-head {
  background: rgba(255, 255, 255, .035);
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
}
.calc-name { font-size: 12.5px; font-weight: 700; }
.calc-name em { font-style: normal; font-size: 10px; margin-left: 3px; }
.calc-name em.up { color: #ff9b8f; }
.calc-name em.down { color: #8fc4ff; }
.calc-base { font: 600 12px/1 ui-monospace, monospace; color: var(--muted); }
.calc-input {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font: 600 12px/1 ui-monospace, monospace;
  text-align: center;
  outline: none;
}
.calc-input:focus { border-color: rgba(227, 53, 43, .55); }
.calc-val {
  text-align: right;
  font: 800 16px/1 ui-monospace, monospace;
  color: #ffd166;
}
.calc-val small { color: var(--muted-2); font-size: 9px; font-weight: 600; margin-left: 2px; }
.calc-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.calc-foot #calcTotal { margin-left: auto; color: var(--muted); font-size: 12px; }
.calc-foot #calcTotal b { color: var(--text); font-size: 14px; }

@media (max-width: 760px) {
  .mtab { padding: 7px 10px; font-size: 12px; }
  .calc-row { grid-template-columns: 56px 44px 1fr 1fr 1fr; gap: 5px; padding: 7px 8px; }
  .calc-head { font-size: 9px; }
  .calc-name { font-size: 11.5px; }
  .calc-input { height: 30px; font-size: 11px; padding: 0 2px; }
  .calc-val { font-size: 14px; }
  .loc-entries { grid-column: 2; justify-content: flex-start; max-width: none; }
}

/* ============================================================
   其他功能 / 伤害计算 / 队伍配置
   ============================================================ */
.other-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.other-tab {
  padding: 7px 16px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
}
.other-tab.on {
  color: #fff;
  background: linear-gradient(180deg, #f0453a, #c92a20);
  border-color: rgba(255, 255, 255, .16);
}

.damage-card, .team-card {
  padding: clamp(16px, 2.4vw, 26px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}
.damage-grid { display: grid; grid-template-columns: 1fr .95fr 1fr; gap: 16px; }
.damage-side h3, .damage-move h3 {
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  color: var(--muted);
  text-transform: uppercase;
}
.damage-side > .vselect, .damage-move > .vselect { width: 100%; max-width: none; }
.damage-controls { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.damage-controls .calc-level { width: 100%; justify-content: space-between; }
.damage-controls .vselect { width: 100%; max-width: none; }
.check-line { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--muted); font-size: 12px; }
.dmg-item-label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 11px; }
.dmg-item-label .vselect { width: 100%; max-width: none; }
.dmg-move-info { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--muted); font-size: 11px; }
.damage-actions { margin-top: 12px; }
.dmg-result {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}
.dmg-big b { margin-right: 8px; font: 800 28px/1 ui-monospace, monospace; color: #ffd166; }
.dmg-big span { color: var(--muted); font-size: 12px; }
.dmg-bar { height: 8px; margin: 12px 0; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.dmg-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #f0453a, #ffd166); }
.dmg-line { margin-top: 4px; color: var(--muted); font-size: 12.5px; }
.dmg-line b { color: var(--text); }
.dmg-note { margin-top: 8px; color: var(--muted-2); font-size: 10.5px; line-height: 1.7; }
.dmg-none { padding: 10px 0; color: var(--muted); font-size: 12.5px; }

.team-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.team-head h3 { font-size: 17px; font-weight: 800; }
.team-head .sub { margin-left: 6px; color: var(--muted); font-size: 11px; font-weight: 400; }
.team-slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.team-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 70px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  cursor: pointer;
}
.team-slot:hover { border-color: var(--line-strong); }
.team-slot.empty { justify-content: center; border-style: dashed; color: var(--muted-2); cursor: default; font-size: 12px; }
.team-slot img { width: 44px; height: 44px; object-fit: contain; }
.team-slot-info b { display: block; font-size: 12.5px; }
.team-slot-info small { color: var(--muted-2); font-size: 9.5px; }
.team-slot-types { display: flex; gap: 3px; margin-top: 3px; }
.team-remove {
  width: 24px;
  height: 24px;
  margin-left: auto;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
}
.team-remove:hover { color: #ff9b8f; border-color: rgba(255, 120, 100, .4); }
.team-add { display: flex; gap: 8px; margin-top: 14px; }
.team-add .vinput { flex: 1 1 220px; }
.team-add .vselect { flex: 0 1 320px; max-width: 320px; }
.team-summary { margin-top: 14px; }
.team-summary-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; color: var(--muted); font-size: 11px; }
.team-summary-line b { margin-right: 4px; color: var(--text); font-size: 11.5px; }
.team-type, .team-weak { padding: 2px 7px; border-radius: 5px; background: rgba(255, 255, 255, .055); font-size: 10.5px; }
.team-weak { color: #ff9b8f; }

@media (max-width: 760px) {
  .other-tab { padding: 6px 10px; font-size: 12px; }
  .damage-grid { grid-template-columns: 1fr; }
  .team-slots { grid-template-columns: 1fr 1fr; }
  .team-add { flex-wrap: wrap; }
  .team-add .vselect { flex: 1 1 100%; max-width: none; }
  .team-head h3 { font-size: 15px; }
}

/* 道具 / 性格 / 属性克制 / 队伍配置 */
body.view-items .dex-only,
body.view-items .header-tools .search { display: none; }

.nature-card, .typechart-card {
  padding: clamp(14px, 2vw, 22px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  overflow: hidden;
}
.nature-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.nature-table th, .nature-table td { padding: 7px 10px; text-align: left; border-top: 1px solid var(--line); }
.nature-table thead th { color: var(--muted-2); font-size: 10.5px; letter-spacing: .06em; }
.nature-table tbody tr:hover { background: rgba(255, 255, 255, .03); }
.nature-name { font-weight: 700; }
.tc-up { color: #ff9b8f; }
.tc-down { color: #8fc4ff; }

.typechart-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; color: var(--muted); font-size: 11px; }
.typechart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.typechart-legend i { width: 14px; height: 14px; border-radius: 3px; }
.typechart-scroll { max-height: 68vh; overflow: auto; }
.typechart { border-collapse: separate; border-spacing: 2px; }
.typechart th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 4px 3px;
  background: var(--bg-2);
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  white-space: nowrap;
}
.typechart tbody th { position: sticky; left: 0; top: auto; z-index: 2; text-align: left; padding-left: 6px; }
.typechart td { width: 30px; height: 27px; text-align: center; border-radius: 3px; font: 700 10.5px/1 ui-monospace, monospace; }
.tc-corner { background: var(--bg-2); }
.tc-0 { background: #3a1f27; color: #ff9b8f; }
.tc-quarter { background: #4a2330; color: #ffb0a5; }
.tc-half { background: #553021; color: #ffc08a; }
.tc-1 { background: rgba(255, 255, 255, .045); color: var(--muted-2); }
.tc-2 { background: #1e4a2e; color: #9fe0b0; }
.tc-4 { background: #2f7a45; color: #d6ffe4; }
.typechart-legend .tc-0, .typechart-legend .tc-quarter, .typechart-legend .tc-half,
.typechart-legend .tc-1, .typechart-legend .tc-2, .typechart-legend .tc-4 { display: inline-block; }

.item-list { display: flex; flex-direction: column; gap: 6px; }
.item-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); }
.item-icon { flex: 0 0 auto; width: 32px; height: 32px; object-fit: contain; margin-top: 2px; image-rendering: pixelated; }
.item-body { flex: 1 1 auto; min-width: 0; }
.item-head { display: flex; align-items: baseline; gap: 8px; }
.item-head b { font-size: 13px; }
.item-head small { color: var(--muted-2); font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase; }
.item-cat { margin-left: auto; padding: 2px 7px; border-radius: 5px; background: rgba(255, 255, 255, .055); color: var(--muted); font-size: 10px; white-space: nowrap; }
.item-row p { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.65; }

.team-config { margin-top: 14px; padding: 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--bg); }
.team-config-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.team-config-head h3 { font-size: 14px; font-weight: 800; }
.team-config-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.team-config-grid label, .tc-moves label, .tc-ev { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 10.5px; }
.team-config-grid label:last-child { grid-column: 1 / -1; }
.team-config-grid select { width: 100%; max-width: none; }
.tc-moves { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.tc-moves select { width: 100%; max-width: none; }
.tc-evs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.tc-ev input {
  width: 100%;
  height: 30px;
  padding: 0 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--text);
  font: 600 11.5px/1 ui-monospace, monospace;
  text-align: center;
  outline: none;
}
.team-config-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 12px; }
#tcEvTotal { color: var(--muted); font-size: 11.5px; }
#tcEvTotal.over { color: #ff9b8f; }
.team-config-btn {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
}
.team-config-btn:hover { color: var(--text); border-color: var(--line-strong); }
.team-slot-tags { margin-top: 3px; color: var(--muted-2); font-size: 9.5px; }

@media (max-width: 760px) {
  .item-cat { margin-left: 0; }
  .team-config-grid, .tc-moves { grid-template-columns: 1fr; }
  .tc-evs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .typechart td { width: 24px; height: 24px; font-size: 9px; }
  .typechart th { font-size: 8.5px; }
}

/* 速度线 / 对战资料 */
.ref-card {
  padding: clamp(14px, 2vw, 22px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}
.ref-card h3 {
  margin: 4px 0 10px;
  font-size: 14px;
  font-weight: 800;
}
.ref-card h3:not(:first-child) { margin-top: 18px; }
.ref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.ref-item { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.ref-head { display: flex; align-items: baseline; gap: 8px; }
.ref-head b { font-size: 12.5px; }
.ref-tag { margin-left: auto; padding: 1px 6px; border-radius: 4px; background: rgba(255, 255, 255, .06); color: var(--muted-2); font-size: 9.5px; white-space: nowrap; }
.ref-item p { margin-top: 5px; color: var(--muted); font-size: 11.5px; line-height: 1.7; }

.speed-list { display: flex; flex-direction: column; }
.speed-row { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); }
.speed-num { font: 800 18px/1.3 ui-monospace, monospace; color: #ffd166; }
.speed-names { display: flex; flex-wrap: wrap; gap: 4px; }
.speed-chip {
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel);
  color: var(--text);
  font-size: 10.5px;
  white-space: nowrap;
}
.speed-chip:hover { border-color: var(--line-strong); color: #ffd166; }

@media (max-width: 760px) {
  .other-tab { padding: 5px 8px; font-size: 11px; }
  .ref-grid { grid-template-columns: 1fr; }
  .speed-row { grid-template-columns: 48px minmax(0, 1fr); }
  .speed-num { font-size: 15px; }
}
