:root {
  --bg: #08111c;
  --bg-image:
    radial-gradient(circle at top left, rgba(124, 224, 255, 0.14), transparent 32%),
    radial-gradient(circle at top right, rgba(255, 209, 102, 0.12), transparent 26%),
    linear-gradient(180deg, #08111c 0%, #0d1726 50%, #08111c 100%);
  --bg-soft: rgba(9, 22, 37, 0.84);
  --panel: rgba(11, 20, 30, 0.82);
  --panel-strong: rgba(15, 30, 47, 0.94);
  --panel-bg: linear-gradient(180deg, rgba(11, 20, 30, 0.82), rgba(9, 17, 27, 0.9));
  --controls-bg: rgba(9, 22, 37, 0.84);
  --surface: rgba(255, 255, 255, 0.03);
  --surface-strong: rgba(255, 255, 255, 0.05);
  --line: rgba(152, 194, 255, 0.16);
  --text: #eff7ff;
  --muted: #94aeca;
  --accent: #7ce0ff;
  --accent-2: #ffd166;
  --danger: #ff7b7b;
  --shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.4);
  --hero-overlay: linear-gradient(135deg, rgba(8, 17, 28, 0.8), rgba(9, 26, 40, 0.6));
  --hero-frame: rgba(124, 224, 255, 0.08);
  --input-bg: rgba(6, 14, 23, 0.75);
  --table-head-bg: rgba(8, 18, 30, 0.995);
  --row-hover: rgba(124, 224, 255, 0.08);
  --scrollbar-track: rgba(255, 255, 255, 0.03);
  --scrollbar-thumb: linear-gradient(180deg, rgba(124, 224, 255, 0.62), rgba(255, 209, 102, 0.5));
  --scrollbar-thumb-hover: linear-gradient(180deg, rgba(124, 224, 255, 0.86), rgba(255, 209, 102, 0.76));
  --primary-button-text: #08111c;
  --code-bg: rgba(124, 224, 255, 0.12);
  --scrollbar-thumb-ring: rgba(255, 255, 255, 0.08);
  --soft-line: rgba(152, 194, 255, 0.09);
  --card-border-soft: rgba(152, 194, 255, 0.08);
  --card-highlight: rgba(255, 255, 255, 0.04);
  --card-highlight-strong: rgba(255, 255, 255, 0.05);
  --type-pill-bg: rgba(124, 224, 255, 0.12);
  --attr-pill-shell: rgba(255, 255, 255, 0.96);
  --attr-pill-text: #151515;
  --attr-pill-border: rgba(0, 0, 0, 0.08);
  --attr-pill-shadow: rgba(0, 0, 0, 0.2);
  --attr-badge-shadow: rgba(0, 0, 0, 0.18);
  --bar-bg: rgba(124, 224, 255, 0.08);
  --chip-bg: rgba(124, 224, 255, 0.08);
  --chip-border: rgba(124, 224, 255, 0.12);
  --chip-text: var(--text);
  --matchup-bg: linear-gradient(180deg, rgba(7, 17, 28, 0.82), rgba(11, 24, 39, 0.74));
  --matchup-border: rgba(152, 194, 255, 0.12);
  --matchup-shine: rgba(255, 255, 255, 0.04);
  --matchup-rule-strong: rgba(152, 194, 255, 0.12);
  --matchup-rule: rgba(152, 194, 255, 0.08);
  --matchup-shell-bg:
    radial-gradient(circle at top left, rgba(124, 224, 255, 0.09), transparent 34%),
    radial-gradient(circle at bottom right, rgba(255, 209, 102, 0.08), transparent 38%),
    linear-gradient(180deg, rgba(10, 20, 34, 0.92), rgba(8, 16, 29, 0.96));
  --matchup-shell-shadow:
    0 18px 36px -26px rgba(0, 0, 0, 0.75),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --matchup-head-bg:
    linear-gradient(180deg, rgba(18, 24, 34, 0.98), rgba(27, 31, 39, 0.94));
  --matchup-head-text: #fff5de;
  --matchup-head-border: rgba(255, 223, 159, 0.18);
  --matchup-head-ornament: rgba(255, 230, 179, 0.95);
  --matchup-panel-bg:
    radial-gradient(circle at top left, rgba(124, 224, 255, 0.06), transparent 34%),
    radial-gradient(circle at bottom right, rgba(255, 209, 102, 0.05), transparent 36%),
    rgba(10, 18, 30, 0.75);
  --matchup-panel-border: rgba(146, 171, 196, 0.26);
  --matchup-panel-shadow:
    0 14px 28px -22px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --matchup-title-text: #101619;
  --matchup-title-shadow: rgba(255, 255, 255, 0.25);
  --matchup-core-bg:
    linear-gradient(180deg, rgba(57, 74, 96, 0.98), rgba(39, 51, 69, 0.98));
  --matchup-core-text: #f8fff9;
  --matchup-core-border: rgba(145, 178, 214, 0.2);
  --matchup-core-shadow:
    0 10px 20px -16px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
  --matchup-arrow-blue:
    linear-gradient(180deg, #46b7ff, #187fcb);
  --matchup-arrow-blue-edge: #0f6caf;
  --matchup-arrow-blue-shadow: rgba(12, 92, 156, 0.42);
  --matchup-arrow-orange:
    linear-gradient(180deg, #ffba45, #f18408);
  --matchup-arrow-orange-edge: #cf6c00;
  --matchup-arrow-orange-shadow: rgba(177, 101, 18, 0.38);
  --matchup-arrow-text: #fffaf1;
  --matchup-tag-muted: rgba(27, 38, 38, 0.66);
  --tab-hover-bg: rgba(124, 224, 255, 0.06);
  --tab-active-bg: rgba(124, 224, 255, 0.1);
  --section-panel-bg: rgba(255, 255, 255, 0.02);
  --section-panel-border: rgba(124, 224, 255, 0.08);
  --section-divider: rgba(255, 255, 255, 0.05);
  --role-bg: rgba(255, 209, 102, 0.15);
  --role-text: #ffd166;
  --role-border: rgba(255, 209, 102, 0.2);
  --iv-bg: rgba(124, 224, 255, 0.1);
  --iv-border: rgba(124, 224, 255, 0.16);
  --nature-item-bg: rgba(0, 0, 0, 0.2);
  --boost-text: #78c850;
  --reduce-text: #f85888;
  --teammate-bg: rgba(124, 224, 255, 0.08);
  --teammate-border: rgba(124, 224, 255, 0.15);
  --teammate-text: #fff;
  --deck-tag-bg: rgba(255, 255, 255, 0.08);
  --deck-tag-border: rgba(255, 255, 255, 0.08);
  --source-blood: #ff7b7b;
  --source-stone: #bc8f8f;
  --pve-card-bg: linear-gradient(180deg, rgba(255, 209, 102, 0.06), rgba(255, 255, 255, 0.02));
  --pvp-card-bg: linear-gradient(180deg, rgba(248, 88, 136, 0.07), rgba(255, 255, 255, 0.02));
  --skill-card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.02));
  --skill-card-hover-bg: rgba(124, 224, 255, 0.06);
  --skill-card-hover-border: rgba(124, 224, 255, 0.2);
  --skill-icon-bg: radial-gradient(circle at top, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.2));
  --skill-icon-ring: rgba(152, 194, 255, 0.08);
  --skill-icon-shadow: rgba(0, 0, 0, 0.45);
  --power-bg: rgba(255, 209, 102, 0.15);
  --power-text: #ffd166;
  --power-border: rgba(255, 209, 102, 0.2);
  --cost-bg: rgba(124, 224, 255, 0.12);
  --cost-border: rgba(124, 224, 255, 0.16);
  --level-bg: rgba(152, 194, 255, 0.1);
  --level-border: rgba(152, 194, 255, 0.14);
  --type-tag-border: rgba(255, 255, 255, 0.1);
  --type-physical-bg: rgba(240, 128, 48, 0.15);
  --type-physical-text: #f8a060;
  --type-magic-bg: rgba(120, 80, 200, 0.18);
  --type-magic-text: #b898f8;
  --type-status-bg: rgba(120, 200, 80, 0.12);
  --type-status-text: #90d868;
  --type-defend-bg: rgba(100, 160, 230, 0.14);
  --type-defend-text: #88c0f0;
  --ability-card-bg: rgba(255, 255, 255, 0.03);
  --ability-card-border: rgba(152, 194, 255, 0.08);
  --ability-icon-bg: radial-gradient(circle at top, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.22));
  --wheel-info-bg: radial-gradient(circle at top, rgba(124, 224, 255, 0.08), transparent 58%), rgba(5, 12, 20, 0.52);
  --wheel-info-border: rgba(152, 194, 255, 0.12);
  --wheel-info-shine: rgba(255, 255, 255, 0.05);
  --legend-strong: rgba(92, 242, 168, 0.88);
  --legend-vulnerable: rgba(255, 110, 110, 0.78);
  --matchup-scale-good-bg: rgba(255, 140, 40, 0.22);
  --matchup-scale-good-text: #ffb060;
  --matchup-scale-good-border: rgba(255, 160, 60, 0.36);
  --matchup-scale-bad-bg: rgba(60, 140, 240, 0.18);
  --matchup-scale-bad-text: #60b0ff;
  --matchup-scale-bad-border: rgba(70, 150, 255, 0.32);
  --radius: 28px;
  --font-heading: 'mainfeiziti', "Microsoft YaHei UI", "PingFang SC", "Noto Sans SC", sans-serif;
  --font-body: 'fzltyjt', "Microsoft YaHei UI", "PingFang SC", "Noto Sans SC", sans-serif;
}

body[data-theme="light"] {
  --bg: #f5efe2;
  --bg-image:
    radial-gradient(circle at top left, rgba(179, 145, 74, 0.12), transparent 30%),
    radial-gradient(circle at top right, rgba(121, 149, 180, 0.12), transparent 26%),
    linear-gradient(180deg, #f9f4e8 0%, #f2ead9 54%, #eee4d1 100%);
  --bg-soft: rgba(253, 249, 240, 0.9);
  --panel: rgba(255, 251, 244, 0.82);
  --panel-strong: rgba(255, 252, 246, 0.94);
  --panel-bg: linear-gradient(180deg, rgba(255, 252, 246, 0.9), rgba(248, 240, 227, 0.86));
  --controls-bg: rgba(253, 249, 240, 0.9);
  --surface: rgba(116, 92, 57, 0.045);
  --surface-strong: rgba(116, 92, 57, 0.075);
  --line: rgba(125, 101, 67, 0.18);
  --text: #35291d;
  --muted: #7a6a59;
  --accent: #8a5a2b;
  --accent-2: #b88a3b;
  --danger: #b45d4b;
  --shadow: 0 18px 36px -24px rgba(101, 75, 41, 0.32);
  --hero-overlay: linear-gradient(135deg, rgba(255, 248, 236, 0.84), rgba(246, 236, 214, 0.76));
  --hero-frame: rgba(138, 90, 43, 0.12);
  --input-bg: rgba(255, 252, 246, 0.96);
  --table-head-bg: rgba(245, 236, 220, 0.995);
  --row-hover: rgba(138, 90, 43, 0.08);
  --scrollbar-track: rgba(138, 90, 43, 0.08);
  --scrollbar-thumb: linear-gradient(180deg, rgba(138, 90, 43, 0.56), rgba(184, 138, 59, 0.46));
  --scrollbar-thumb-hover: linear-gradient(180deg, rgba(138, 90, 43, 0.82), rgba(184, 138, 59, 0.7));
  --primary-button-text: #fffaf1;
  --code-bg: rgba(138, 90, 43, 0.12);
  --scrollbar-thumb-ring: rgba(255, 248, 236, 0.78);
  --soft-line: rgba(125, 101, 67, 0.12);
  --card-border-soft: rgba(125, 101, 67, 0.14);
  --card-highlight: rgba(255, 255, 255, 0.58);
  --card-highlight-strong: rgba(255, 255, 255, 0.66);
  --type-pill-bg: rgba(138, 90, 43, 0.1);
  --attr-pill-shell: rgba(255, 251, 245, 0.98);
  --attr-pill-text: #18130f;
  --attr-pill-border: rgba(96, 73, 42, 0.12);
  --attr-pill-shadow: rgba(88, 63, 32, 0.16);
  --attr-badge-shadow: rgba(88, 63, 32, 0.14);
  --bar-bg: rgba(138, 90, 43, 0.08);
  --chip-bg: rgba(138, 90, 43, 0.07);
  --chip-border: rgba(138, 90, 43, 0.14);
  --chip-text: #3a2d20;
  --matchup-bg: linear-gradient(180deg, rgba(248, 242, 229, 0.92), rgba(243, 234, 217, 0.88));
  --matchup-border: rgba(138, 90, 43, 0.16);
  --matchup-shine: rgba(255, 255, 255, 0.65);
  --matchup-rule-strong: rgba(138, 90, 43, 0.16);
  --matchup-rule: rgba(138, 90, 43, 0.1);
  --matchup-shell-bg:
    radial-gradient(circle at top left, rgba(115, 181, 111, 0.18), transparent 34%),
    radial-gradient(circle at bottom right, rgba(229, 196, 121, 0.16), transparent 40%),
    linear-gradient(180deg, rgba(249, 243, 232, 0.98), rgba(239, 229, 208, 0.96));
  --matchup-shell-shadow:
    0 20px 34px -28px rgba(111, 84, 51, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  --matchup-head-bg:
    linear-gradient(180deg, rgba(45, 40, 34, 0.98), rgba(34, 30, 26, 0.95));
  --matchup-head-text: #fff8ea;
  --matchup-head-border: rgba(164, 126, 69, 0.22);
  --matchup-head-ornament: rgba(255, 234, 196, 0.98);
  --matchup-panel-bg:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.34), transparent 38%),
    radial-gradient(circle at bottom right, rgba(218, 198, 161, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(255, 251, 245, 0.97), rgba(244, 237, 225, 0.96));
  --matchup-panel-border: rgba(176, 150, 112, 0.24);
  --matchup-panel-shadow:
    0 18px 30px -26px rgba(128, 99, 63, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
  --matchup-title-text: #13110d;
  --matchup-title-shadow: rgba(255, 255, 255, 0.7);
  --matchup-core-bg:
    linear-gradient(180deg, rgba(116, 159, 198, 0.96), rgba(86, 123, 159, 0.96));
  --matchup-core-text: #fefef7;
  --matchup-core-border: rgba(86, 118, 147, 0.26);
  --matchup-core-shadow:
    0 12px 22px -18px rgba(93, 109, 127, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
  --matchup-arrow-blue:
    linear-gradient(180deg, #45b6fb, #2a8fe0);
  --matchup-arrow-blue-edge: #1e78c0;
  --matchup-arrow-blue-shadow: rgba(64, 143, 202, 0.32);
  --matchup-arrow-orange:
    linear-gradient(180deg, #ffbf49, #ef8a0a);
  --matchup-arrow-orange-edge: #d77700;
  --matchup-arrow-orange-shadow: rgba(200, 141, 55, 0.34);
  --matchup-arrow-text: #fffaf0;
  --matchup-tag-muted: rgba(58, 45, 32, 0.64);
  --tab-hover-bg: rgba(138, 90, 43, 0.08);
  --tab-active-bg: rgba(138, 90, 43, 0.12);
  --section-panel-bg: rgba(255, 250, 242, 0.72);
  --section-panel-border: rgba(138, 90, 43, 0.12);
  --section-divider: rgba(138, 90, 43, 0.1);
  --role-bg: rgba(184, 138, 59, 0.14);
  --role-text: #8a5a2b;
  --role-border: rgba(184, 138, 59, 0.2);
  --iv-bg: rgba(138, 90, 43, 0.08);
  --iv-border: rgba(138, 90, 43, 0.14);
  --nature-item-bg: rgba(138, 90, 43, 0.06);
  --boost-text: #5e8a37;
  --reduce-text: #bb5d63;
  --teammate-bg: rgba(138, 90, 43, 0.08);
  --teammate-border: rgba(138, 90, 43, 0.14);
  --teammate-text: #3a2d20;
  --deck-tag-bg: rgba(138, 90, 43, 0.08);
  --deck-tag-border: rgba(138, 90, 43, 0.12);
  --source-blood: #b45d4b;
  --source-stone: #8f765f;
  --pve-card-bg: linear-gradient(180deg, rgba(184, 138, 59, 0.08), rgba(255, 251, 245, 0.7));
  --pvp-card-bg: linear-gradient(180deg, rgba(180, 93, 75, 0.07), rgba(255, 251, 245, 0.7));
  --skill-card-bg: linear-gradient(180deg, rgba(255, 251, 244, 0.9), rgba(248, 241, 228, 0.82));
  --skill-card-hover-bg: rgba(138, 90, 43, 0.05);
  --skill-card-hover-border: rgba(138, 90, 43, 0.18);
  --skill-icon-bg: radial-gradient(circle at top, rgba(255, 255, 255, 0.82), rgba(229, 214, 186, 0.82));
  --skill-icon-ring: rgba(138, 90, 43, 0.12);
  --skill-icon-shadow: rgba(126, 96, 56, 0.18);
  --power-bg: rgba(184, 138, 59, 0.12);
  --power-text: #8a5a2b;
  --power-border: rgba(184, 138, 59, 0.18);
  --cost-bg: rgba(138, 90, 43, 0.08);
  --cost-border: rgba(138, 90, 43, 0.12);
  --level-bg: rgba(122, 106, 89, 0.08);
  --level-border: rgba(122, 106, 89, 0.14);
  --type-tag-border: rgba(138, 90, 43, 0.12);
  --type-physical-bg: rgba(196, 112, 63, 0.12);
  --type-physical-text: #b26032;
  --type-magic-bg: rgba(128, 102, 173, 0.12);
  --type-magic-text: #7658aa;
  --type-status-bg: rgba(104, 151, 73, 0.12);
  --type-status-text: #5c8d3a;
  --type-defend-bg: rgba(95, 133, 176, 0.12);
  --type-defend-text: #4f7fb2;
  --ability-card-bg: rgba(255, 250, 242, 0.8);
  --ability-card-border: rgba(138, 90, 43, 0.12);
  --ability-icon-bg: radial-gradient(circle at top, rgba(255, 255, 255, 0.86), rgba(232, 218, 194, 0.9));
  --wheel-info-bg: radial-gradient(circle at top, rgba(184, 138, 59, 0.12), transparent 56%), rgba(248, 241, 228, 0.88);
  --wheel-info-border: rgba(138, 90, 43, 0.14);
  --wheel-info-shine: rgba(255, 255, 255, 0.72);
  --legend-strong: rgba(87, 153, 88, 0.92);
  --legend-vulnerable: rgba(180, 93, 75, 0.84);
  --matchup-scale-good-bg: rgba(184, 138, 59, 0.16);
  --matchup-scale-good-text: #8a5a2b;
  --matchup-scale-good-border: rgba(184, 138, 59, 0.28);
  --matchup-scale-bad-bg: rgba(180, 93, 75, 0.14);
  --matchup-scale-bad-text: #a05040;
  --matchup-scale-bad-border: rgba(180, 93, 75, 0.26);
}

@font-face {
  font-family: 'fzltyjt';
  src: url('https://patchwiki.biligame.com/images/rocom/a/a2/k0bnd4f33k0ps0i9865qot1s01w988y.woff') format('woff');
}

@font-face {
  font-family: 'mainfeiziti';
  src: url('https://patchwiki.biligame.com/images/rocom/d/df/68y2741981o2aivc1a5z1mhw45j5n09.woff') format('woff');
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg-image);
  color: var(--text);
  font-family: var(--font-body);
}

body {
  padding: 24px;
  transition:
    background 220ms ease,
    color 220ms ease;
}

button,
input,
select {
  font: inherit;
}

code {
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--code-bg);
  color: var(--accent);
}

.app-shell {
  max-width: 1600px;
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 24px;
  min-height: 44vh;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 8px);
  background:
    var(--hero-overlay),
    url('./images/bg.png') center/cover no-repeat;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.theme-toggle-button {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel-strong) 74%, transparent);
  backdrop-filter: blur(14px);
  color: var(--text);
  font-size: 0.8rem;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease;
}

.theme-toggle-button:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}

.hero::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid var(--hero-frame);
  border-radius: calc(var(--radius) + 2px);
  pointer-events: none;
}

.hero::before {
  content: "";
  position: absolute;
  left: -8%;
  top: 8%;
  width: 58%;
  height: 78%;
  border-radius: 42% 58% 46% 54% / 46% 42% 58% 54%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.12), transparent 26%),
    radial-gradient(circle at 48% 42%, rgba(124, 224, 255, 0.14), transparent 44%),
    radial-gradient(circle at 70% 62%, rgba(255, 209, 102, 0.09), transparent 34%);
  filter: blur(26px);
  opacity: 0.9;
  pointer-events: none;
}

.hero-panel,
.table-panel,
.detail-panel,
.controls {
  backdrop-filter: blur(18px);
}

.hero-copy,
.hero-panel {
  position: relative;
  z-index: 1;
}

.hero-copy {
  padding: 8px 4px 8px 2px;
}

.eyebrow,
.panel-kicker,
.metric-label {
  margin: 0 0 10px;
  font-family: var(--font-heading);
  font-size: 0.74rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  max-width: 11ch;
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(2.6rem, 5vw, 5.4rem);
  line-height: 0.95;
}

.hero-text {
  max-width: 60ch;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-actions-hidden {
  display: none;
}

.primary-button,
.secondary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease;
}

.primary-button {
  background: var(--accent);
  color: var(--primary-button-text);
  font-weight: 700;
}

.secondary-button,
.ghost-button {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--text);
  border-color: var(--line);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.status-text {
  margin-top: 14px;
  color: var(--muted);
}

.status-text-hidden {
  display: none;
}

.hero-panel {
  align-self: end;
  padding: 28px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--panel-strong) 88%, transparent), color-mix(in srgb, var(--panel) 94%, transparent));
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.headline-metric strong,
.hero-grid strong {
  display: block;
  font-family: var(--font-heading);
  font-weight: 700;
}

.headline-metric strong {
  font-size: 4rem;
  line-height: 1;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 16px;
  margin-top: 26px;
}

.hero-grid strong {
  font-size: 1.65rem;
}

.metric-caption {
  color: var(--muted);
}

.workspace {
  margin-top: 22px;
}

.control.skill-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  margin-bottom: 8px;
}

.controls {
  display: grid;
  grid-template-columns: 2.2fr 1fr 1fr 1fr auto;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--controls-bg);
}

.control-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-block label {
  color: var(--muted);
  font-size: 0.92rem;
  padding-left: 6px;
}

.control-block input,
.control-block select {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--input-bg);
  color: var(--text);
  box-shadow: inset 0 1px 0 var(--card-highlight);
}

.control-block select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='rgba(148,174,202,0.95)' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.6' d='M1 1.25 6 6.25 11 1.25'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px 8px;
}

body[data-theme="light"] .control-block select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='rgba(122,106,89,0.95)' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.6' d='M1 1.25 6 6.25 11 1.25'/%3E%3C/svg%3E");
}

.control-reset-button {
  align-self: end;
  min-width: 120px;
  gap: 8px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 12%, transparent), color-mix(in srgb, var(--accent) 5%, transparent));
  border-color: color-mix(in srgb, var(--accent) 24%, var(--line));
  box-shadow:
    inset 0 1px 0 var(--card-highlight),
    0 8px 18px -14px color-mix(in srgb, var(--accent) 40%, transparent);
}

.control-reset-button:hover {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 18%, transparent), color-mix(in srgb, var(--accent) 8%, transparent));
}

.control-reset-button:active {
  transform: translateY(0);
}

.control-reset-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  font-size: 0.9rem;
  line-height: 1;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
  gap: 22px;
  margin-top: 22px;
}

.table-panel,
.detail-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-bg);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 18px;
}

.panel-head h2 {
  margin: 0;
  font-size: 1.5rem;
  font-family: var(--font-heading);
}

#detail-name {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-type-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.panel-note {
  color: var(--muted);
  font-size: 0.9rem;
}

.table-wrap {
  overflow: auto;
  max-height: 72vh;
  border-top: 1px solid var(--line);
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--accent) 55%, transparent) transparent;
}

.table-wrap::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.table-wrap::-webkit-scrollbar-track {
  background:
    linear-gradient(180deg, transparent, var(--scrollbar-track), transparent);
  border-radius: 999px;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: padding-box;
  box-shadow: inset 0 0 0 1px var(--scrollbar-thumb-ring);
}

.table-wrap::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
  background-clip: padding-box;
}

.table-wrap::-webkit-scrollbar-corner {
  background: transparent;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1080px;
}

thead th {
  position: sticky;
  top: 0;
  background: var(--table-head-bg);
  z-index: 20;
  isolation: isolate;
  text-align: left;
  padding: 14px 16px;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  white-space: nowrap;
}

thead th::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--table-head-bg);
  z-index: -1;
}

.table-head-metric {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.table-head-metric img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
}

tbody td {
  padding: 14px 16px;
  border-top: 1px solid var(--soft-line);
  vertical-align: middle;
}

tbody tr {
  cursor: pointer;
  transition: background-color 140ms ease;
}

tbody tr:hover,
tbody tr.is-selected {
  background: var(--row-hover);
}

thead th:nth-child(3),
tbody td:nth-child(3) {
  white-space: nowrap;
}

tbody td:nth-child(3) {
  min-width: 132px;
}

tbody td:nth-child(4) {
  min-width: 170px;
}

.empty-cell {
  text-align: center;
  color: var(--muted);
  padding: 44px 18px;
}

.detail-panel {
  padding-bottom: 22px;
}

.detail-panel-kicker {
  padding: 24px 24px 0;
  margin-bottom: -4px;
}

.detail-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.detail-hero > div {
  min-width: 0;
}

#detail-name {
  margin-left: 10px;
}

.detail-image {
  width: 220px;
  height: 220px;
  object-fit: contain;
  border-radius: 12px;
  display: none;
}

.type-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--type-pill-bg);
  color: var(--accent);
}

.meta-label-with-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
}

.meta-inline-icon {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.detail-meta {
  display: grid;
  gap: 12px;
  padding: 0 24px;
}

.detail-meta {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-meta div {
  margin: 0;
  padding: 14px 0;
  border-top: 1px solid var(--soft-line);
}

.detail-meta span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.detail-meta .meta-label-with-icon {
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
  width: fit-content;
}

.detail-section {
  padding: 0 24px;
}

.detail-submeta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 8px 24px 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.detail-submeta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.detail-evo-text {
  color: var(--text);
}

.submeta-icon {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

.detail-section h3 {
  margin: 22px 0 12px;
  font-size: 1rem;
}

.detail-section p {
  color: var(--muted);
  line-height: 1.8;
}

.matchup-meta {
  margin: 8px 16px;
  background: transparent;
}

.matchup-card {
  position: relative;
  border-radius: 18px;
  border: 1px solid var(--matchup-border);
  background: var(--matchup-shell-bg);
  box-shadow:
    var(--matchup-shell-shadow),
    inset 0 1px 0 var(--matchup-shine);
  overflow: hidden;
}

.matchup-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(160deg, rgba(255,255,255,0.06) 0%, transparent 40%, transparent 60%, rgba(255,255,255,0.04) 100%);
  pointer-events: none;
  z-index: 0;
}

.matchup-card-head {
  position: relative;
  padding: 14px 20px;
  background: var(--matchup-head-bg);
  border-bottom: 1px solid var(--matchup-head-border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  z-index: 1;
}

.matchup-head-text {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 800;
  color: var(--matchup-head-text);
  letter-spacing: 0.12em;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.matchup-body {
  position: relative;
  z-index: 1;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Sections */
.matchup-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.matchup-section-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted);
  text-transform: uppercase;
}

.matchup-label-icon {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  opacity: 0.8;
}

/* Lane — the horizontal scrolling strip */
.matchup-lane {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 52px;
  background: var(--matchup-panel-bg);
  border: 1px solid var(--matchup-panel-border);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: var(--matchup-panel-shadow);
  overflow: hidden;
}

/* Empty state */
.matchup-empty-text {
  color: var(--muted);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  opacity: 0.7;
}

/* Group row inside lane: weak types grouped by multiplier */
.matchup-group-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  flex-wrap: wrap;
}

.matchup-group-scale {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 22px;
  padding: 0 5px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.matchup-group-scale.scale-good {
  background: var(--matchup-scale-good-bg);
  color: var(--matchup-scale-good-text);
  border: 1px solid var(--matchup-scale-good-border);
}

.matchup-group-scale.scale-bad {
  background: var(--matchup-scale-bad-bg);
  color: var(--matchup-scale-bad-text);
  border: 1px solid var(--matchup-scale-bad-border);
}

.matchup-group-types {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* Separator between the two lanes */
.matchup-sep {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 10px 0;
  margin: 4px 0;
}

.matchup-sep-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--matchup-rule), transparent);
}

.matchup-sep-diamond {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 2px;
  transform: rotate(45deg);
  margin: 0 10px;
  flex-shrink: 0;
  opacity: 0.6;
  box-shadow: 0 0 6px var(--accent);
}

/* Arrow direction badge between center and sides */
.matchup-arrow-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  position: relative;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.matchup-arrow-badge::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0) 60%);
  pointer-events: none;
}

.matchup-arrow-badge.badge-strong {
  background: var(--matchup-arrow-orange);
  color: #fff8f0;
  box-shadow:
    0 3px 10px var(--matchup-arrow-orange-shadow),
    inset 0 1px 0 rgba(255,255,255,0.3),
    inset 0 -1px 0 rgba(0,0,0,0.2);
}

.matchup-arrow-badge.badge-weak {
  background: var(--matchup-arrow-blue);
  color: #f0f8ff;
  box-shadow:
    0 3px 10px var(--matchup-arrow-blue-shadow),
    inset 0 1px 0 rgba(255,255,255,0.3),
    inset 0 -1px 0 rgba(0,0,0,0.2);
}

/* Type badges inside matchup lane — use same design as spirit index table */
.matchup-lane .attr-pill {
  margin: 0;
  padding: 0 0 0 9px;
  min-height: 20px;
  overflow: visible;
}

.matchup-lane .attr-pill-icon-wrap {
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0;
  z-index: 1;
}

.matchup-lane .attr-pill-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
}

.matchup-lane .attr-pill-text {
  min-height: 20px;
  padding: 0 10px 0 25px;
  font-size: 0.68rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--attr-pill-shell);
  border: 1px solid var(--attr-pill-border);
  box-shadow: 0 6px 14px -10px var(--attr-pill-shadow), 0 2px 6px -4px var(--attr-pill-shadow);
  color: var(--attr-pill-text);
  letter-spacing: 0;
  line-height: 1;
  font-family: var(--font-heading);
  gap: 0;
}

.matchup-lanes {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.matchup-lane-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stats-list {
  display: grid;
  gap: 10px;
  padding: 22px 24px 0;
}

.stat-row {
  display: grid;
  grid-template-columns: 74px 1fr 48px;
  gap: 10px;
  align-items: center;
}

.stat-row span {
  color: var(--muted);
}

.stat-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.stat-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.bar {
  height: 10px;
  border-radius: 999px;
  background: var(--bar-bg);
  overflow: hidden;
}

.bar>i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-chip {
  padding: 9px 12px;
  border-radius: 14px;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  color: var(--chip-text);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* ===== Attribute Colors ===== */
:root {
  --attr-普通: #a8a878;
  --attr-火: #f08030;
  --attr-水: #6890f0;
  --attr-草: #78c850;
  --attr-电: #f8d030;
  --attr-冰: #98d8d8;
  --attr-武: #c03028;
  --attr-毒: #a040a0;
  --attr-地: #e0c068;
  --attr-翼: #a890f0;
  --attr-幻: #f85888;
  --attr-虫: #a8b820;
  --attr-光: #ffe66f;
  --attr-恶: #705848;
  --attr-龙: #7038f8;
  --attr-幽: #705898;
  --attr-机械: #b8b8d0;
  --attr-萌: #ee99ac;
  --attr-default: #7ce0ff;
}

/* ===== Skill Tabs ===== */
.skill-section {
  margin-top: 18px;
  padding-bottom: 0 !important;
}

.skill-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 2px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0;
}

.skill-tab {
  position: relative;
  padding: 10px 16px;
  border: none;
  border-radius: 12px 12px 0 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 180ms, background 180ms;
}

.skill-tab:hover {
  color: var(--text);
  background: var(--tab-hover-bg);
}

.skill-tab.is-active {
  color: var(--accent);
  background: var(--tab-active-bg);
}

.skill-tab.is-active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}

.skill-tab-panels {
  max-height: 520px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--accent) 40%, transparent) transparent;
}

.skill-tab-panel {
  display: none;
  padding: 14px 0 8px;
}

.skill-tab-panel.is-active {
  display: block;
}

.skill-empty {
  color: var(--muted);
  text-align: center;
  padding: 28px 0;
  font-size: 0.9rem;
}

/* ===== Recommendations ===== */
.rec-section {
  padding-bottom: 0 !important;
}

.rec-content {
  background: var(--section-panel-bg);
  border: 1px solid var(--section-panel-border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rec-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rec-label {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.rec-values {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.rec-section-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--section-divider);
}

.rec-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rec-role {
  display: inline-block;
  padding: 2px 10px;
  background: var(--role-bg);
  color: var(--role-text);
  border: 1px solid var(--role-border);
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
}

.rec-iv {
  display: inline-block;
  padding: 2px 10px;
  background: var(--iv-bg);
  color: var(--accent);
  border: 1px solid var(--iv-border);
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}

.rec-nature-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.rec-nature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  background: var(--nature-item-bg);
  padding: 6px 12px;
  border-radius: 6px;
}

.rec-nature-name {
  font-weight: 700;
  color: var(--text);
  width: 40px;
}

.rec-nature-boost {
  color: var(--boost-text);
  /* Green for buff */
}

.rec-nature-reduce {
  color: var(--reduce-text);
  /* Red for nerf */
}

.rec-teammate-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.rec-teammate-card {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 14px;
  align-items: start;
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--section-panel-border);
  background: var(--section-panel-bg);
  box-shadow: inset 0 1px 0 var(--card-highlight);
}

.rec-teammate-media {
  width: 82px;
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.rec-teammate-image {
  width: 82px;
  height: 82px;
  object-fit: contain;
}

.rec-teammate-image-fallback {
  width: 82px;
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--accent);
}

.rec-teammate-body {
  min-width: 0;
}

.rec-teammate-name {
  margin-bottom: 8px;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  color: var(--accent);
}

.rec-teammate-reason {
  color: var(--text);
  opacity: 0.82;
  font-size: 0.94rem;
  line-height: 1.7;
}

.rec-nature-item {
  align-items: flex-start;
  flex-wrap: wrap;
}

.rec-deck {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.rec-deck-source {
  font-size: 0.75rem;
  font-weight: 700;
}

.rec-deck-source.source-blood {
  color: var(--source-blood);
}

.rec-deck-source.source-stone {
  color: var(--source-stone);
}

.rec-deck-tag {
  font-size: 0.72rem;
  padding: 2px 7px;
  background: var(--deck-tag-bg);
  border-radius: 999px;
  color: var(--muted);
  border: 1px solid var(--deck-tag-border);
}

.rec-skill-card {
  margin-bottom: 0;
}

.rec-skill-card .skill-card-main {
  position: relative;
}

.rec-skill-card-pve {
  background: var(--pve-card-bg);
}

.rec-skill-card-pvp {
  background: var(--pvp-card-bg);
}

.rec-skill-card .skill-card-desc {
  -webkit-line-clamp: unset;
  line-clamp: unset;
  display: block;
  overflow: visible;
}

.rec-skill-card .skill-card-tags {
  align-items: center;
}

.rec-skill-desc {
  position: relative;
  display: block;
  width: 100%;
  min-height: 22px;
  padding-right: 78px;
}

.rec-skill-desc-text {
  min-width: 0;
}

.rec-deck-source-corner {
  display: inline-flex;
  white-space: nowrap;
  position: absolute;
  right: 0;
  bottom: 0;
}

/* ===== Skill Cards ===== */
.skill-card {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 8px 12px;
  padding: 10px 12px;
  margin-bottom: 6px;
  border-radius: 14px;
  border-left: 3px solid var(--attr-default);
  border: 1px solid var(--card-border-soft);
  background: var(--skill-card-bg);
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.skill-card:hover {
  background: var(--skill-card-hover-bg);
  border-color: var(--skill-card-hover-border);
  transform: translateY(-1px);
}

.skill-card-icon-wrap {
  position: relative;
  width: 58px;
  min-width: 58px;
  height: 58px;
  align-self: start;
}

.skill-card-icon {
  width: 58px;
  height: 58px;
  object-fit: contain;
  border-radius: 12px;
  background: var(--skill-icon-bg);
  box-shadow: inset 0 0 0 1px var(--skill-icon-ring);
}

.skill-card-attr-icon {
  position: absolute;
  top: -5px;
  left: -5px;
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px var(--skill-icon-shadow));
  cursor: default;
}

.skill-card-main {
  min-width: 0;
}

.skill-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.skill-card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.skill-card-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.2;
}

.skill-card-tags {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}

.skill-card-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.skill-card-category-icon {
  width: 13px;
  height: 13px;
  object-fit: contain;
}

.skill-card-category-text {
  display: inline-block;
}

.skill-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.45;
  white-space: nowrap;
}

.attr-pill-shell {
  display: inline-flex;
  align-items: center;
  margin: 2px;
  vertical-align: middle;
  overflow: visible;
}

.attr-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin: 0;
  padding: 0 0 0 9px;
  border-radius: 999px;
  background: transparent;
  color: var(--attr-pill-text);
  border: 0;
  box-shadow: none;
  vertical-align: middle;
  overflow: visible;
}

.attr-pill-icon-wrap {
  position: absolute;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0;
  z-index: 1;
}

.attr-pill-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
}

.attr-pill-text {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-heading);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  min-height: 20px;
  padding: 0 10px 0 25px;
  border-radius: 999px;
  background: var(--attr-pill-shell);
  border: 1px solid var(--attr-pill-border);
  box-shadow: 0 6px 14px -10px var(--attr-pill-shadow), 0 2px 6px -4px var(--attr-pill-shadow);
  color: var(--attr-pill-text);
}

.skill-tag-power {
  background: var(--power-bg);
  color: var(--power-text);
  border: 1px solid var(--power-border);
}

.skill-tag-cost {
  background: var(--cost-bg);
  color: var(--accent);
  border: 1px solid var(--cost-border);
}

.skill-tag-cost-icon {
  width: 13px;
  height: 13px;
  object-fit: contain;
}

.skill-tag-level {
  background: var(--level-bg);
  color: var(--muted);
  border: 1px solid var(--level-border);
}

.skill-tag-type {
  font-size: 0.72rem;
  padding: 2px 7px;
  border: 1px solid var(--type-tag-border);
}

.skill-tag-type.type-物攻 {
  background: var(--type-physical-bg);
  color: var(--type-physical-text);
}

.skill-tag-type.type-魔攻 {
  background: var(--type-magic-bg);
  color: var(--type-magic-text);
}

.skill-tag-type.type-状态 {
  background: var(--type-status-bg);
  color: var(--type-status-text);
}

.skill-tag-type.type-防御 {
  background: var(--type-defend-bg);
  color: var(--type-defend-text);
}

.skill-card-desc {
  margin-top: 6px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ability-card {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--ability-card-border);
  background: var(--ability-card-bg);
}

.ability-icon-frame {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  background: transparent;
}

.ability-icon {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.ability-copy strong {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-heading);
  font-size: 1rem;
}

.ability-copy p {
  margin: 0;
}

/* ===== Detail Footer ===== */
.detail-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 24px;
  margin-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--muted);
}

.footer-info {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

.footer-link:hover {
  text-decoration: underline;
}

a {
  color: var(--accent);
}

@media (max-width: 1180px) {

  .hero,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  body {
    padding: 14px;
  }

  .hero,
  .controls,
  .panel-head {
    padding: 18px;
  }

  .theme-toggle-button {
    top: 12px;
    right: 12px;
    min-height: 32px;
    padding: 0 10px;
    font-size: 0.76rem;
  }

  .hero h1 {
    max-width: none;
    font-size: 2.6rem;
  }

  .hero-grid,
  .detail-meta,
  .controls {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    max-height: 54vh;
  }

  .detail-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .matchup-current-types {
    max-width: none;
  }

  .detail-image {
    width: 180px;
    height: 180px;
  }

  .skill-card {
    grid-template-columns: 52px 1fr;
  }

  .skill-card-icon-wrap,
  .skill-card-icon {
    width: 52px;
    height: 52px;
  }

  .skill-card-header {
    flex-direction: column;
  }

  .skill-card-tags {
    justify-content: flex-start;
  }

  .ability-card {
    grid-template-columns: 1fr;
  }

  .type-wheel {
    width: 340px;
    height: 340px;
  }

  .wheel-node {
    width: 46px;
    height: 46px;
  }
}

/* =========================================
   Type Wheel / Matchup Widget
========================================= */
.type-wheel-container {
  position: relative;
}

.type-wheel {
  position: relative;
  width: 430px;
  height: 430px;
  margin: 14px auto 10px;
}

.wheel-node {
  position: absolute;
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
  border-radius: 50%;
  opacity: 1;
}

.wheel-node.is-dimmed {
  opacity: 0.22 !important;
  transform: translate(-50%, -50%) scale(0.9) !important;
}

.wheel-node::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  border: 2px solid transparent;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 180ms ease, transform 180ms ease, border-color 180ms ease;
}

.wheel-node.is-source {
  opacity: 1 !important;
  transform: translate(-50%, -50%) scale(1.2) !important;
}

.wheel-node.is-source::before {
  opacity: 1;
  transform: scale(1.12);
  border-color: rgba(255, 255, 255, 0.72);
}

.wheel-node.is-strong {
  opacity: 1 !important;
  transform: translate(-50%, -50%) scale(1.06) !important;
}

.wheel-node.is-strong::before {
  opacity: 1;
  transform: scale(1.08);
  border-color: rgba(92, 242, 168, 0.9);
  box-shadow: 0 0 14px rgba(92, 242, 168, 0.28);
}

.wheel-node.is-resisted {
  opacity: 1 !important;
  transform: translate(-50%, -50%) scale(1.06) !important;
}

.wheel-node.is-resisted::before {
  opacity: 1;
  transform: scale(1.08);
  border-color: rgba(255, 110, 110, 0.84);
  border-style: dashed;
  box-shadow: 0 0 12px rgba(255, 110, 110, 0.18);
}

.wheel-node.is-mixed {
  opacity: 1 !important;
  transform: translate(-50%, -50%) scale(1.08) !important;
}

.wheel-node.is-mixed::before {
  opacity: 1;
  transform: scale(1.1);
  border-color: rgba(255, 209, 102, 0.92);
  box-shadow: 0 0 14px rgba(255, 209, 102, 0.24);
}

.wheel-node-badge {
  position: absolute;
  right: -8px;
  bottom: -4px;
  min-width: 26px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(10, 18, 28, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

.wheel-node.is-strong .wheel-node-badge,
.wheel-node.is-resisted .wheel-node-badge,
.wheel-node.is-mixed .wheel-node-badge {
  opacity: 1;
  transform: translateY(0);
}

.wheel-node.is-strong .wheel-node-badge {
  color: #5cf2a8;
}

.wheel-node.is-resisted .wheel-node-badge {
  color: #ff8f8f;
}

.wheel-node.is-mixed .wheel-node-badge {
  color: #ffd166;
}

.type-wheel-info {
  background: var(--wheel-info-bg);
  border-radius: 14px;
  padding: 14px 16px;
  text-align: center;
  min-height: 86px;
  border: 1px solid var(--wheel-info-border);
  box-shadow: inset 0 1px 0 var(--wheel-info-shine);
}

.wheel-info-tip {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.wheel-info-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.wheel-info-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  border: 2px solid transparent;
}

.legend-dot-source {
  border-color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.16);
}

.legend-dot-strong {
  border-color: rgba(92, 242, 168, 0.9);
  background: rgba(92, 242, 168, 0.18);
}

.legend-dot-resisted {
  border-color: rgba(255, 110, 110, 0.82);
  border-style: dashed;
  background: rgba(255, 110, 110, 0.14);
}
