/* ============================================================
   精灵详情页
   沿用 styles.css 的深色魔法学院主题变量，不另起色系
   ============================================================ */

/* ── 顶部：返回 + 立绘 + 身份 ── */
.dex-head { margin-bottom: 6px; }
.dex-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.dex-src { font-size: 12px; }

.dex-hero {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 28px;
  align-items: start;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* 立绘：1024×1024 原图，容器自适应，**不缩放图片本身**（浏览器等比显示） */
.dex-art {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: radial-gradient(ellipse at 50% 60%, rgba(109, 124, 255, 0.16), transparent 70%);
  border: 1px solid var(--border);
  overflow: hidden;
}
.dex-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
}
.dex-art-empty { color: var(--muted); font-size: 13px; }

.dex-id { min-width: 0; }
.dex-no {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--gold);
  font-weight: 700;
}
.dex-name {
  margin: 6px 0 14px;
  font-size: 32px;
  line-height: 1.15;
  color: var(--ink);
  font-weight: 800;
}
.dex-formpill { margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.dex-cat {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--gold-soft);
  color: var(--gold);
  border: 1px solid rgba(245, 196, 81, 0.3);
}
.dex-bars { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.dex-bar { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.dex-bar .k { color: var(--muted); min-width: 64px; }
.dex-bar .v { color: var(--ink-2); font-weight: 600; }
.dex-row {
  margin-top: 14px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
}
.dex-row .k { color: var(--muted); }
.dex-row .v { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* ── 属性胶囊 ── */
.dex-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.dex-pills.big { gap: 10px; }
.pill {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid rgba(109, 124, 255, 0.32);
}
.pill.good { background: var(--ok-soft); color: var(--ok); border-color: rgba(4, 120, 87, 0.3); }
.pill.bad  { background: var(--danger-soft); color: var(--danger); border-color: rgba(248, 113, 113, 0.34); }

/* ── 形态一览 ── */
.dex-shapes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 12px;
}
.dex-shape {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease;
}
.dex-shape:hover { transform: translateY(-3px); border-color: var(--border-2); }
.dex-shape.cur {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 1px var(--brand) inset;
}
.dex-shape img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  display: block;
  margin: 0 auto 8px;
}
.dex-shape span { font-size: 12.5px; color: var(--ink-2); }

/* ── 键值表 ── */
table.kv { width: 100%; border-collapse: collapse; }
table.kv th {
  text-align: left;
  width: 116px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.kv td {
  padding: 9px 12px;
  font-size: 13.5px;
  color: var(--ink);
  border-bottom: 1px solid var(--border);
}
table.kv tr:last-child th,
table.kv tr:last-child td { border-bottom: 0; }

/* ── 特性 ── */
.dex-traits { display: flex; flex-direction: column; gap: 12px; }
.trait {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
}
.trait-name { font-size: 14px; font-weight: 700; color: var(--gold); margin-bottom: 6px; }
.trait-desc { font-size: 13px; color: var(--ink-2); line-height: 1.65; }

/* ── 进化链 ── */
.dex-evo { display: flex; flex-direction: column; gap: 18px; }
.evo-chain {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 15px;
}
.evo-title { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.evo-nodes { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.evo-node {
  min-width: 92px;
  text-align: center;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  border: 1px solid var(--border);
}
.evo-node.self { border-color: var(--brand); background: var(--brand-soft); }
.evo-node.lord { border-color: rgba(245, 196, 81, 0.4); }
.evo-name { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.evo-stage { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.evo-arrow { color: var(--muted); font-size: 15px; }
.evo-cond {
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px dashed var(--border);
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.7;
}

/* ── 技能 ── */
.dex-skills { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.skill {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
}
.skill-head {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  font-size: 12.5px;
}
.skill-name { font-size: 14px; font-weight: 700; color: var(--ink); }
.skill-desc {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.68;
}

/* ── 受击关系 ── */
.dex-counter { display: flex; flex-direction: column; gap: 12px; }
.ct-row { display: flex; align-items: flex-start; gap: 14px; }
.ct-row .k { color: var(--muted); font-size: 13px; min-width: 40px; }
.ct-row .v { display: inline-flex; gap: 7px; flex-wrap: wrap; }

/* ── 图鉴描述 ── */
.dex-handbook {
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--ink-2);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  white-space: pre-wrap;
}

/* ── 图鉴卡片可点 ── */
.dex-card { cursor: pointer; }

/* ── 详情页里的 h2 图标留白 ── */
.dex-head + section h2 { margin-top: 4px; }

@media (max-width: 720px) {
  .dex-hero { grid-template-columns: 1fr; gap: 18px; padding: 16px; }
  .dex-name { font-size: 26px; }
  table.kv th { width: 92px; }
  .dex-skills { grid-template-columns: 1fr; }
}

/* ---------- 列表卡片：形态角标 ----------
   列表按编号聚合，一个编号只显示一条代表形态；
   有多个形态时在头像角上标「N 形态」，提示点进去可切换。 */
.dex-card .pimg { position: relative; }
.dex-card .shape-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 10px;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #6d5bd0, #9b6ad6);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
  white-space: nowrap;
  pointer-events: none;
}
