/* Aniimo Codex — 基础样式
   主题：亮色，品牌色取自官网实测值 #0589DF
   零外部依赖：无 CDN 字体、无框架。目的是首屏直出、CLS 接近 0。 */

:root {
  --brand: #0589DF;
  --brand-2: #33A9D7;
  --brand-dark: #0369A8;
  --brand-tint: #EAF7FF;

  --ink: #10202E;
  --ink-2: #445a6d;
  --ink-3: #7089a0;
  --line: #d9e8f3;
  --line-2: #eaf3f9;

  --bg: #ffffff;
  --bg-soft: #F6FBFE;
  --card: #ffffff;

  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 1px 2px rgba(16, 32, 46, .05), 0 8px 24px -12px rgba(16, 32, 46, .12);
  --shadow-hover: 0 2px 4px rgba(16, 32, 46, .06), 0 16px 36px -14px rgba(5, 137, 223, .28);

  --wrap: 1160px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }
img { max-width: 100%; height: auto; display: block; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line-2);
}

.site-header .inner {
  display: flex; align-items: center; gap: 20px;
  height: 62px;
}

.brand {
  display: flex; align-items: center; gap: 9px;
  font-weight: 800; font-size: 17px; color: var(--ink);
  letter-spacing: -.2px; white-space: nowrap;
}
.brand:hover { color: var(--ink); }
.brand .mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid; place-items: center;
  color: #fff; font-size: 15px; font-weight: 900;
}

.nav { display: flex; gap: 3px; margin-left: auto; flex-wrap: wrap; }
.nav a {
  padding: 7px 12px; border-radius: 8px;
  color: var(--ink-2); font-size: 14.5px; font-weight: 550;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--brand-tint); color: var(--brand-dark); }
.nav a[aria-current="page"] { color: var(--brand); background: var(--brand-tint); }

/* ---------------------------------------------------------------- hero */

.hero {
  background:
    radial-gradient(900px 340px at 12% -10%, rgba(5, 137, 223, .13), transparent 62%),
    radial-gradient(700px 300px at 88% 0%, rgba(51, 169, 215, .11), transparent 60%),
    var(--bg-soft);
  border-bottom: 1px solid var(--line-2);
  padding: 56px 0 48px;
}
.hero h1 { font-size: clamp(30px, 5vw, 44px); line-height: 1.14; margin: 10px 0 14px; letter-spacing: -.9px; }
.hero .lead { font-size: 17.5px; color: var(--ink-2); max-width: 68ch; margin: 0 0 22px; }

.eyebrow {
  display: inline-block; font-size: 12.5px; font-weight: 750;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--brand); background: #fff;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 13px;
}

.stat-row { display: flex; flex-wrap: wrap; gap: 9px; margin: 24px 0 26px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 15px; font-size: 13.5px; font-weight: 620; color: var(--ink-2);
}

.cta-row { display: flex; flex-wrap: wrap; gap: 11px; }
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 11px 20px; border-radius: 10px;
  font-size: 15px; font-weight: 650;
  border: 1px solid transparent; transition: transform .12s, box-shadow .2s, background .2s;
}
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 18px -8px rgba(5, 137, 223, .7); }
.btn-primary:hover { background: var(--brand-dark); color: #fff; transform: translateY(-1px); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-dark); transform: translateY(-1px); }

/* ---------------------------------------------------------------- sections */

section { padding: 52px 0; }
section.tight { padding: 36px 0; }
section.soft { background: var(--bg-soft); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }

h2 { font-size: 27px; letter-spacing: -.5px; margin: 0 0 8px; }
h3 { font-size: 18px; margin: 0 0 6px; }
.section-lead { color: var(--ink-2); margin: 0 0 28px; max-width: 72ch; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 22px;
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); border-color: #c3ddf0; }
.card h3 a { color: var(--ink); }
.card h3 a:hover { color: var(--brand); }
.card p { color: var(--ink-2); font-size: 14.5px; margin: 0; }
.card .num {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--brand-tint); color: var(--brand);
  font-weight: 800; font-size: 14px; margin-bottom: 12px;
}

/* ---------------------------------------------------------------- creature grid */

.creature-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
}

.creature-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
.creature-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); border-color: var(--brand); }

.creature-card .thumb {
  aspect-ratio: 1 / 1; background: var(--brand-tint);
  display: grid; place-items: center; padding: 10px;
}
.creature-card .thumb img { width: 100%; height: 100%; object-fit: contain; }

.creature-card .body { padding: 11px 12px 13px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.creature-card .no { font-size: 11.5px; font-weight: 700; color: var(--ink-3); letter-spacing: .04em; }
.creature-card .nm { font-size: 15px; font-weight: 700; color: var(--ink); line-height: 1.25; }
.creature-card .nm:hover { color: var(--brand); }
.creature-card .tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; }

/* ---------------------------------------------------------------- badges */

.badge {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 6px;
  letter-spacing: .03em; text-transform: capitalize;
  background: var(--line-2); color: var(--ink-2);
}
.badge-el { color: #fff; }
.badge-role { background: var(--brand-tint); color: var(--brand-dark); }

/* 元素色由内联 style 提供，见 config.elementColors */

/* ---------------------------------------------------------------- filters */

.filters {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 16px 0 22px;
}
.filters .group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.filters .label { font-size: 12.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; margin-right: 3px; }

.chip {
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 13px; font-size: 13px; font-weight: 600; color: var(--ink-2);
  cursor: pointer; transition: all .15s; font-family: inherit;
}
.chip:hover { border-color: var(--brand); color: var(--brand-dark); }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------------------------------------------------------------- tables */

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 11px 15px; border-bottom: 1px solid var(--line-2); }
th { background: var(--bg-soft); font-size: 12.5px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-soft); }

/* ---------------------------------------------------------------- notice */

.notice {
  border: 1px solid var(--line); border-left: 4px solid var(--brand);
  background: var(--bg-soft); border-radius: 10px;
  padding: 15px 18px; font-size: 14.5px; color: var(--ink-2);
}
.notice strong { color: var(--ink); }
.notice.warn { border-left-color: #F5A623; background: #FFFBF2; }
.notice.fact { border-left-color: #30A46C; background: #F4FCF7; }

/* ---------------------------------------------------------------- creature detail */

.detail-head { display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 34px; align-items: start; }
.detail-art {
  background: linear-gradient(160deg, var(--brand-tint), #fff);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 26px; aspect-ratio: 1/1; display: grid; place-items: center;
}
.detail-art img { max-height: 100%; object-fit: contain; }

.spec { display: grid; grid-template-columns: auto 1fr; gap: 10px 20px; margin: 18px 0 0; font-size: 15px; }
.spec dt { color: var(--ink-3); font-weight: 650; }
.spec dd { margin: 0; color: var(--ink); font-weight: 600; }

.breadcrumb { font-size: 13.5px; color: var(--ink-3); margin: 0 0 22px; }
.breadcrumb a { color: var(--ink-2); }
.breadcrumb a:hover { color: var(--brand); }

/* ---------------------------------------------------------------- footer */

.site-footer {
  background: #0B1B28; color: #9fb4c6;
  padding: 46px 0 30px; margin-top: 40px;
}
.site-footer a { color: #cfe1ee; }
.site-footer a:hover { color: #fff; }
.site-footer .cols { display: grid; gap: 30px; grid-template-columns: 1.5fr repeat(3, 1fr); }
.site-footer h4 { color: #fff; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 13px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.site-footer .about { font-size: 14px; line-height: 1.6; }
.site-footer .legal { margin-top: 34px; padding-top: 22px; border-top: 1px solid #1d3446; font-size: 13px; display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; }

/* ---------------------------------------------------------------- util */

.muted { color: var(--ink-3); }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

@media (max-width: 860px) {
  .detail-head { grid-template-columns: 1fr; gap: 22px; }
  .site-footer .cols { grid-template-columns: 1fr 1fr; }
  .nav { width: 100%; margin-left: 0; order: 3; }
  .lang-switch { margin-left: auto; padding-left: 0; border-left: none; }
  .site-header .inner { height: auto; padding: 10px 0; flex-wrap: wrap; }
}
@media (max-width: 520px) {
  .creature-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
  .site-footer .cols { grid-template-columns: 1fr; }
  .hero { padding: 36px 0 32px; }
  .lang-switch .ls-icon { display: none; }
}

/* ------------------------------------------------------------------- CJK */
/* 拉丁字母的负字距与全大写处理不适用于中文：会挤字、也会破坏标签可读性 */

html[lang^="zh"] body { line-height: 1.8; }
html[lang^="zh"] .hero h1,
html[lang^="zh"] h2,
html[lang^="zh"] .brand { letter-spacing: 0; }
html[lang^="zh"] .hero h1 { line-height: 1.28; }
html[lang^="zh"] .hero .lead { line-height: 1.78; }
html[lang^="zh"] .eyebrow,
html[lang^="zh"] th,
html[lang^="zh"] .filters .label { letter-spacing: .02em; text-transform: none; }
html[lang^="zh"] .badge { text-transform: none; }
html[lang^="zh"] .spec dd,
html[lang^="zh"] .creature-card .nm { font-weight: 650; }
