/* Ballebatt Wiki 共享样式
   黑白灰 / 直角 / 实线边框；唯一彩色来自球体自身的填色（由页面内联变量给出）。
   主题变量在每页 <head> 内联，这里只写结构与规则。 */

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
    "PingFang SC", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  font-size: var(--fs);
  line-height: 1.7;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 { margin: 0; font-weight: 800; line-height: 1.25; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
b, strong { font-weight: 800; }

.wrap { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 24px; }

.muted { color: var(--muted); }
.small { font-size: 0.85em; }
.hidden { display: none !important; }

/* ---------- 顶栏 ---------- */

.topbar {
  border-bottom: var(--bw) solid var(--line);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 20;
}

.bar {
  display: flex;
  align-items: stretch;
  gap: 20px;
  min-height: 56px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 2px;
  font-size: 15px;
  white-space: nowrap;
}
.brand b { font-weight: 700; }
.brand span { color: var(--muted); font-size: 12px; letter-spacing: 1px; }
.brand:hover { text-decoration: none; }

.nav { display: flex; align-items: stretch; flex-wrap: wrap; }

.nav-item {
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-left: 1px solid #d8d8d8;
  font-size: 13px;
}
.nav-item:first-child { border-left: 0; }
.nav-item:hover { background: var(--gray); text-decoration: none; }
.nav-item.is-on { background: var(--ink); color: var(--paper); }

.bar-ext { margin-left: auto; display: flex; align-items: center; }
.ext-link {
  border: var(--bw) solid var(--line);
  padding: 5px 12px;
  font-size: 12px;
  letter-spacing: 1px;
}
.ext-link:hover { background: var(--ink); color: var(--paper); text-decoration: none; }

/* ---------- 页面与面包屑 ---------- */

.page { padding-top: 28px; padding-bottom: 40px; }

.crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 18px;
}
.crumb i { font-style: normal; color: #b5b5b5; }
.crumb a:hover { color: var(--ink); }
.crumb b { color: var(--ink); font-weight: 700; }

.kicker {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.lede { color: var(--muted); margin-top: 10px; font-size: 13px; max-width: 780px; }

.page-head { border-bottom: 1px solid #d8d8d8; padding-bottom: 18px; margin-bottom: 22px; }
.page-head h1 { font-size: 30px; }

.note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  border-left: 3px solid var(--line);
  padding-left: 10px;
}

/* ---------- 首页 ---------- */

.hero { border-bottom: var(--bw) solid var(--line); padding-bottom: 24px; margin-bottom: 24px; }
.hero h1 { font-size: 40px; letter-spacing: 1px; }
.hero .lede { font-size: 14px; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 22px 0 0;
  border: var(--bw) solid var(--line);
}
.hero-stats > div {
  padding: 10px 14px;
  border-left: 1px solid #d8d8d8;
}
.hero-stats > div:first-child { border-left: 0; }
.hero-stats dt { font-size: 11px; letter-spacing: 1px; color: var(--muted); }
.hero-stats dd { margin: 2px 0 0; font-size: 22px; font-weight: 800; line-height: 1.2; }
.hero-stats dd.small { font-size: 14px; font-weight: 700; }

.portals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.portal {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "en en"
    "title count"
    "desc desc"
    "go go";
  gap: 4px 10px;
  border: var(--bw) solid var(--line);
  padding: 18px;
  min-height: 168px;
  background: var(--paper);
  transition: background 0.12s, color 0.12s;
}
.portal:hover { background: var(--ink); color: var(--paper); text-decoration: none; }
.portal-en { grid-area: en; font-size: 11px; letter-spacing: 2px; color: var(--muted); }
.portal:hover .portal-en { color: #b9b9b9; }
.portal-title { grid-area: title; font-size: 24px; font-weight: 800; }
.portal-count { grid-area: count; align-self: center; font-size: 12px; border: 1px solid currentColor; padding: 2px 8px; }
.portal-desc { grid-area: desc; font-size: 12px; color: var(--muted); margin-top: 6px; }
.portal:hover .portal-desc { color: #d8d8d8; }
.portal-go { grid-area: go; align-self: end; margin-top: 12px; font-size: 12px; letter-spacing: 1px; }

.home-note { margin-top: 30px; border-top: 1px solid #d8d8d8; padding-top: 18px; max-width: 780px; }
.home-note h2 { font-size: 15px; margin-bottom: 8px; }
.home-note p { font-size: 13px; color: var(--muted); margin-bottom: 8px; }

/* ---------- 工具栏 / 筛选 ---------- */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.filters { display: flex; flex-wrap: wrap; gap: 8px; }

.fbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 12px;
  padding: 5px 10px;
  cursor: pointer;
}
.fbtn span { color: var(--muted); font-size: 11px; }
.fbtn:hover { background: var(--gray); }
.fbtn.is-on { background: var(--ink); color: var(--paper); }
.fbtn.is-on span { color: #cfcfcf; }

.search { display: flex; align-items: center; gap: 8px; }
.search span { font-size: 11px; letter-spacing: 1px; color: var(--muted); }
.search input {
  width: 180px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  padding: 6px 8px;
  outline: none;
}
.search input:focus { border-width: var(--bw); }

/* ---------- 索引表格 ---------- */

.idx-group { margin-bottom: 26px; }
.idx-group h2 { font-size: 15px; padding-bottom: 6px; border-bottom: 1px solid #d8d8d8; margin-bottom: 0; }
.idx-group .cnt { font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 4px; }

.table-wrap { border: 1px solid var(--line); overflow-x: auto; }
.idx-group .table-wrap { border-top: 0; }

/* ---------- 球种索引：7 列方格 ---------- */

.species-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 26px;
}

.species-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  aspect-ratio: 1 / 1;
  border: var(--bw) solid var(--line);
  background: var(--paper);
  padding: 10px 6px;
  text-align: center;
}
.species-cell:hover { background: var(--gray); text-decoration: none; }
.species-cell .ball { width: 64px; height: 64px; }
.species-cell .cell-preview { display: flex; align-items: center; justify-content: center; }
.species-cell .cell-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.3;
  word-break: break-all;
}

table.grid, table.ptable, table.kv { border-collapse: collapse; width: 100%; }

table.grid thead th {
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  letter-spacing: 1px;
  font-weight: 700;
  text-align: left;
  padding: 8px 12px;
  white-space: nowrap;
}
table.grid tbody td, table.grid tbody th {
  border-top: 1px solid #d8d8d8;
  padding: 9px 12px;
  font-size: 13px;
  text-align: left;
  vertical-align: middle;
}
table.grid tbody th { font-weight: 700; }
table.grid tbody tr:hover { background: var(--gray); cursor: pointer; }
table.grid tbody tr:hover a { text-decoration: underline; text-underline-offset: 3px; }

.c-no { width: 56px; color: var(--muted); font-variant-numeric: tabular-nums; }
.c-cat { width: 90px; }
.c-skill { width: 130px; }
.c-pool { width: 80px; }
.c-name { font-weight: 700; }

table.terms tbody td { white-space: normal; line-height: 1.7; }
table.terms tbody th { width: 150px; }

/* ---------- 详细页骨架 ---------- */

.entry-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  border-bottom: var(--bw) solid var(--line);
  padding-bottom: 22px;
  margin-bottom: 24px;
}
.entry-head h1 { font-size: 36px; letter-spacing: 1px; }

.entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 288px;
  gap: 32px;
  align-items: start;
}
.entry.single { grid-template-columns: minmax(0, 1fr); max-width: 900px; }

.entry-side { position: sticky; top: 76px; display: grid; gap: 16px; }

.sec { border-top: var(--bw) solid var(--line); padding-top: 14px; margin-bottom: 30px; }
.sec h2 { font-size: 17px; margin-bottom: 12px; }
.sub-h { font-size: 13px; margin: 18px 0 8px; }

.prose { font-size: 14px; line-height: 1.85; max-width: 760px; }
.prose p { margin-bottom: 8px; }
.prose ul, .prose ol { margin: 0 0 10px; padding-left: 22px; }
.prose li { margin-bottom: 4px; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose b { font-weight: 800; }

.empty { font-size: 13px; color: var(--muted); border-left: 3px solid #d8d8d8; padding-left: 10px; }

.back { margin-top: 28px; font-size: 12px; }
.back a { border-bottom: 1px solid currentColor; }

/* 折叠基本信息 */

.fold { border: 1px solid var(--line); }
.fold summary {
  cursor: pointer;
  padding: 10px 14px;
  background: var(--gray);
  font-size: 13px;
  font-weight: 700;
  list-style: none;
}
.fold summary::-webkit-details-marker { display: none; }
.fold summary::before { content: "＋ "; color: var(--muted); }
.fold[open] summary::before { content: "－ "; }
.fold .table-wrap { border: 0; border-top: 1px solid var(--line); }

table.kv th, table.kv td {
  border-top: 1px solid #d8d8d8;
  padding: 8px 14px;
  font-size: 13px;
  text-align: left;
}
table.kv tr:first-child th, table.kv tr:first-child td { border-top: 0; }
table.kv th { width: 160px; color: var(--muted); font-weight: 400; background: var(--paper); }
table.kv td { font-weight: 700; font-variant-numeric: tabular-nums; }

/* 参数表 */

table.ptable thead th {
  background: var(--gray);
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 1px;
  text-align: left;
  padding: 7px 12px;
}
table.ptable tbody th, table.ptable tbody td {
  border-top: 1px solid #d8d8d8;
  padding: 8px 12px;
  font-size: 13px;
  text-align: left;
  vertical-align: top;
  line-height: 1.65;
}
table.ptable tbody th { width: 220px; font-weight: 700; }
table.ptable td.val { width: 120px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.ptable td.c-type { width: 70px; color: var(--muted); }
.pnote { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }

table.matrix { min-width: 640px; }
table.matrix thead th { white-space: nowrap; }
table.matrix .sticky {
  position: sticky;
  left: 0;
  background: var(--paper);
  z-index: 1;
  border-right: 1px solid #d8d8d8;
}
table.matrix thead .sticky { background: var(--gray); }
table.matrix td.val { width: auto; }

/* 技能头 */

.skill-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.skill-head b { font-size: 16px; }
.skill-head .more {
  margin-left: auto;
  font-size: 12px;
  border-bottom: 1px solid currentColor;
}

/* 词条与链接列表 */

.termlist { list-style: none; display: grid; gap: 10px; }
.termlist li { border: 1px solid var(--line); padding: 10px 12px; }
.termlist a { font-weight: 800; }
.termlist p { font-size: 12px; color: var(--muted); margin-top: 4px; }
.term-group {
  margin-left: 8px;
  font-size: 10px;
  letter-spacing: 1px;
  border: 1px solid currentColor;
  padding: 0 5px;
  color: var(--muted);
}

.linklist { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.linklist li { display: flex; align-items: baseline; gap: 8px; border: 1px solid var(--line); padding: 6px 10px; font-size: 13px; }
.linklist li a { font-weight: 700; }
.linklist li span { font-size: 11px; color: var(--muted); }

/* 右侧栏 */

.toc { border: var(--bw) solid var(--line); }
.toc h3 {
  font-size: 12px;
  letter-spacing: 1px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--gray);
}
.toc ol { list-style: none; counter-reset: toc; }
.toc li { border-top: 1px solid #e2e2e2; }
.toc li:first-child { border-top: 0; }
.toc a {
  display: flex;
  gap: 8px;
  padding: 7px 12px;
  font-size: 12px;
}
.toc a::before {
  counter-increment: toc;
  content: counter(toc, decimal-leading-zero);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.toc a:hover { background: var(--gray); text-decoration: none; }

.archive { border: var(--bw) solid var(--line); }
.archive h3 {
  font-size: 12px;
  letter-spacing: 1px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--gray);
}
.archive dl { margin: 0; padding: 4px 0; }
.archive dt {
  font-size: 11px;
  color: var(--muted);
  padding: 6px 12px 0;
}
.archive dd {
  margin: 0;
  padding: 0 12px 6px;
  font-size: 12px;
  font-weight: 700;
  word-break: break-all;
}
.swatch {
  display: inline-block;
  width: 11px;
  height: 11px;
  border: 1px solid var(--line);
  margin-right: 6px;
  vertical-align: -1px;
}

/* ---------- 提示框 / 行内目录 ---------- */

.notice {
  border: var(--bw) solid var(--line);
  padding: 14px 16px;
  margin: 0 0 24px;
  background: var(--gray);
}
.notice h2 { font-size: 13px; letter-spacing: 1px; margin-bottom: 6px; }
.notice p { font-size: 12px; line-height: 1.8; }

.toc-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  border-top: 1px solid #d8d8d8;
  border-bottom: 1px solid #d8d8d8;
  padding: 8px 0;
  margin-bottom: 20px;
  font-size: 12px;
}
.toc-inline span { color: var(--muted); letter-spacing: 1px; margin-right: 4px; }
.toc-inline a { border: 1px solid var(--line); padding: 3px 9px; }
.toc-inline a:hover { background: var(--ink); color: var(--paper); text-decoration: none; }

.rules .sec { max-width: 820px; }

/* ---------- 页脚 ---------- */

.foot {
  border-top: var(--bw) solid var(--line);
  padding: 26px 0 40px;
  background: var(--paper);
}
.foot-in { display: grid; grid-template-columns: minmax(0, 1fr) 2fr; gap: 24px; }
.foot-brand b { font-weight: 700; letter-spacing: 1px; }
.foot-brand span { color: var(--muted); font-size: 12px; }
.foot-brand p { font-size: 11px; color: var(--muted); margin-top: 8px; max-width: 240px; }

.foot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.foot-grid h4 { font-size: 11px; letter-spacing: 1px; color: var(--muted); margin-bottom: 6px; }
.foot-grid p { font-size: 11px; line-height: 1.8; }
.foot-grid p span { color: var(--muted); margin-right: 6px; }
.foot-grid a { border-bottom: 1px solid currentColor; }

/* ---------- 球体 ---------- */

.ball {
  display: inline-block;
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--fill);
  border: var(--sw, 1px) solid var(--stroke);
  flex: 0 0 auto;
}
.ball i {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  transform: rotate(var(--angle, 0deg)) scale(var(--scale, 1));
  transform-origin: 50% 50%;
}
.ball i::before { content: ""; position: absolute; }

.ball.p-solid i { display: none; }
.ball.p-stripes i {
  background: linear-gradient(90deg, transparent 0 26%, var(--accent) 26% 34%,
    transparent 34% 66%, var(--accent) 66% 74%, transparent 74%);
}
.ball.p-rings i {
  background: radial-gradient(circle at 50% 50%, transparent 0 30%, var(--accent) 30% 38%,
    transparent 38% 56%, var(--accent) 56% 64%, transparent 64%);
}
.ball.p-square i::before {
  inset: 16%;
  background: var(--accent);
  transform: rotate(45deg);
}
.ball.p-triangle i::before {
  inset: 12%;
  background: var(--accent);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.ball.p-pie i {
  background: conic-gradient(var(--accent) 0 60deg, transparent 60deg 360deg);
}
.ball.p-quadrant i {
  background: conic-gradient(var(--accent) 0 90deg, transparent 90deg 360deg);
}

.ball-lg { width: 108px; height: 108px; }
.ball-xs { width: 44px; height: 44px; }
.ball-xxl { width: 140px; height: 140px; }

.ball .bssk {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(100% * var(--sk-s, 1));
  height: calc(100% * var(--sk-s, 1));
  max-width: none;
  transform:
    translate(calc(-50% + var(--sk-x, 0) * 100%), calc(-50% + var(--sk-y, 0) * 100%))
    rotate(var(--sk-a, 0deg));
  transform-origin: 50% 50%;
  pointer-events: none;
  user-select: none;
}

/* ---------- 图鉴表（预览列在最左） ---------- */

table.roster { min-width: 860px; }
table.roster tbody td { padding: 7px 12px; }
table.roster tbody tr { height: 62px; }
.c-thumb { width: 80px; }
.c-num { width: 66px; font-variant-numeric: tabular-nums; }
.c-desc { font-size: 12px; color: var(--muted); max-width: 460px; }
.c-sub {
  display: block;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 1px;
  color: var(--muted);
}

.thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: var(--gray);
  border: 1px solid #d8d8d8;
  vertical-align: middle;
}
.thumb-wide { width: 58px; height: 58px; }
.thumb:hover { border-color: var(--line); }

.ent-img { max-width: 56px; max-height: 56px; object-fit: contain; }

/* ---------- 详细页右侧预览卡 ---------- */

.entry-title { min-width: 0; }

.side-card { border: var(--bw) solid var(--line); background: var(--paper); }
.card-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--gray);
}
.pv-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 196px;
  padding: 24px 18px;
  border-bottom: 1px solid var(--line);
  background:
    repeating-linear-gradient(0deg, transparent 0 39px, #ededed 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, #ededed 39px 40px);
}
.card-sec h3 {
  font-size: 11px;
  letter-spacing: 1px;
  font-weight: 700;
  color: var(--muted);
  padding: 7px 14px;
  border-bottom: 1px solid #e2e2e2;
}
.side-dl { margin: 0; padding: 2px 0; }
.side-dl > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 3px 14px;
  font-size: 12px;
  border-top: 1px solid #f0f0f0;
}
.side-dl > div:first-child { border-top: 0; }
.side-dl dt { color: var(--muted); }
.side-dl dd { margin: 0; font-weight: 700; text-align: right; word-break: break-all; }

.side-fold { border-top: 1px solid var(--line); }
.side-fold summary {
  cursor: pointer;
  padding: 8px 14px;
  background: var(--gray);
  font-size: 12px;
  font-weight: 700;
  list-style: none;
}
.side-fold summary::-webkit-details-marker { display: none; }
.side-fold summary::before { content: "＋ "; color: var(--muted); }
.side-fold[open] summary::before { content: "－ "; }
.side-fold .card-sec h3 { border-top: 1px solid #e2e2e2; }
.side-fold .card-sec:first-child h3 { border-top: 0; }
.card-foot {
  border-top: 1px solid var(--line);
  padding: 7px 14px;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--muted);
  background: var(--gray);
}

.toc-box { margin: 0 0 26px; max-width: 760px; }
.entry-intro { margin-bottom: 20px; }

/* ---------- 详情页模板：板块级字号 / 加粗 ----------
   .tpl-fs / .tpl-bold 由渲染器挂在板块容器上，作用范围是该板块内的全部文本，
   包含板块标题、技能名、描述与表格；模板未配置时不挂类，默认外观不变。 */

.tpl-fs,
.tpl-fs * {
  font-size: var(--tpl-fs) !important;
}

.tpl-bold,
.tpl-bold *:not(b):not(strong):not(h1):not(h2):not(h3):not(h4) {
  font-weight: 700 !important;
}

/* ---------- 实体 / 效体 ---------- */

.unitlist { list-style: none; display: grid; gap: 10px; }
.unitlist li {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 14px;
  border: 1px solid var(--line);
  padding: 10px 12px;
}
.unit-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  background: var(--gray);
  border: 1px solid #e2e2e2;
}
.unit-name { font-size: 14px; font-weight: 800; }
.unit-meta { font-size: 11px; color: var(--muted); margin-left: 8px; }
.unit-body p { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.65; }

.ent-img-lg { max-width: 96px; max-height: 96px; }
.ent-img-xl { max-width: 124px; max-height: 124px; }
.fx-ph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border: 1px solid var(--line);
  font-size: 12px;
}

.fx { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; }
.fx-line i { display: block; width: 100%; height: 6px; background: var(--ink); }
.fx-field i {
  display: block;
  width: 46px;
  height: 46px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #ffffff 0 36%, #dcdcdc 36% 44%, #ffffff 44%);
}
.fx-lg { width: 96px; height: 96px; }
.fx-lg.fx-line i { height: 8px; }
.fx-lg.fx-field i { width: 84px; height: 84px; }
.fx-xl { width: 130px; height: 130px; }
.fx-xl.fx-line i { height: 10px; }
.fx-xl.fx-field i { width: 112px; height: 112px; }

.unit-hero {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  border-bottom: 1px solid #d8d8d8;
  padding-bottom: 18px;
  margin-bottom: 22px;
}
.unit-hero-img {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 124px;
  border: 1px solid var(--line);
  background: var(--gray);
}

/* ---------- 球类卡片 ---------- */

.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cat-card {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "en en"
    "title count"
    "desc desc"
    "go go";
  gap: 4px 10px;
  border: var(--bw) solid var(--line);
  padding: 18px;
  min-height: 158px;
  background: var(--paper);
  transition: background 0.12s, color 0.12s;
}
.cat-card:hover { background: var(--ink); color: var(--paper); text-decoration: none; }
.cat-card:hover .portal-en, .cat-card:hover .cat-desc { color: #cfcfcf; }
.cat-title { grid-area: title; font-size: 24px; font-weight: 800; }
.cat-desc { grid-area: desc; font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ---------- 密度 ---------- */

body.density-comfortable { font-size: calc(var(--fs) + 1px); }
body.density-comfortable table.grid tbody td { padding-top: 12px; padding-bottom: 12px; }
body.density-comfortable .sec { margin-bottom: 36px; }
body.density-comfortable .prose { line-height: 1.95; }

/* ---------- 窄屏 ---------- */

@media (max-width: 900px) {
  .entry { grid-template-columns: minmax(0, 1fr); }
  .entry-side { position: static; grid-row: 1; }
  .species-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .cat-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-stats > div:nth-child(odd) { border-left: 0; }
  .hero-stats > div:nth-child(n + 3) { border-top: 1px solid #d8d8d8; }
  .foot-in { grid-template-columns: minmax(0, 1fr); }
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .bar { flex-wrap: wrap; gap: 10px; padding: 8px 0; }
  .nav { order: 3; width: 100%; }
  .nav-item { padding: 6px 10px; border-left: 0; border-top: 1px solid #d8d8d8; }
  .bar-ext { margin-left: auto; }
  .hero h1 { font-size: 30px; }
  .entry-head h1 { font-size: 28px; }
  .entry-head .ball-lg { width: 76px; height: 76px; }
  .portals { grid-template-columns: minmax(0, 1fr); }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-grid { grid-template-columns: minmax(0, 1fr); }
  .toolbar { align-items: flex-start; }
  .search input { width: 100%; }
  .search { width: 100%; }
  .species-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .species-cell .ball { width: 56px; height: 56px; }
  table.ptable tbody th { width: 150px; }
  .unit-hero { grid-template-columns: minmax(0, 1fr); }
  .unitlist li { grid-template-columns: 64px minmax(0, 1fr); }
  .unit-thumb { width: 64px; height: 64px; }
  .pv-stage { min-height: 168px; }
  .ball-xxl { width: 112px; height: 112px; }
}
