:root {
  /* ===== 原有基础色 ===== */
  --bg: #0b0f14;
  --panel: #141b24;
  --panel2: #1b2531;
  --line: #2a3746;
  --text: #d7dee8;
  --muted: #8a97a8;
  --accent: #e6453c;
  --accent2: #f5b93c;
  --ok: #4db6ac;

  /* ===== P1-1 补全：色彩系统（MD3 Tonal Palette 风格） ===== */
  /* 表面 / 描边层级 */
  --surface: var(--panel);
  --surface-variant: #1d2734;
  --surface-dim: #101823;
  --surface-bright: #22303f;
  --outline: #3a4b60;
  --outline-variant: #2d3d51;
  --scrim: rgba(0, 0, 0, 0.6);
  --inverse-surface: #e6e9ee;
  --inverse-text: #0b0f14;

  /* 语义状态色（P1 新增） */
  --error: #ff6b6b;
  --error-container: #4a1f22;
  --on-error: #ffffff;
  --warning: #ffa940;
  --warning-container: #4a3520;
  --info: #4dabf7;
  --info-container: #1f3347;
  --success: var(--ok);
  --success-container: #1f3a36;

  /* MD3 三级阴影层级 */
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .08), 0 2px 6px rgba(0, 0, 0, .08);
  --shadow-2: 0 4px 8px rgba(0, 0, 0, .10), 0 8px 24px rgba(0, 0, 0, .12);
  --shadow-3: 0 8px 16px rgba(0, 0, 0, .12), 0 16px 40px rgba(0, 0, 0, .18);

  /* 稀有度 / 角色色变量化（替换硬编码） */
  --rarity-5: var(--accent);        /* UR 红 */
  --rarity-4: var(--accent2);       /* SSR 金 */
  --rarity-3: #6bb6ff;              /* SR 蓝 */
  --rarity-2: #b2a6ff;              /* R 紫 */
  --rarity-1: #a7c0cd;              /* N 灰蓝 */
  /* 类型色系统（攻击型 / 耐久型 / 支援型）—— 组队卡片、选择器、徽标统一使用 */
  --type-atk: #ff7a6e;                 /* 攻击型：进攻红 */
  --type-tank: #5aa9ff;                /* 耐久型：稳重蓝 */
  --type-sup: #43d29a;                 /* 支援型：辅助绿 */
  --type-unknown: #8593a6;             /* 未知 / 敌方单位 */
  --type-atk-soft: rgba(255, 122, 110, .14);
  --type-tank-soft: rgba(90, 169, 255, .14);
  --type-sup-soft: rgba(67, 210, 154, .14);
  --type-unknown-soft: rgba(133, 147, 166, .12);
  /* 旧别名（原为未启用变量，此处对齐到同一色系，保持向后兼容） */
  --role-1: var(--type-atk-soft);
  --role-2: var(--type-tank-soft);
  --role-3: var(--type-sup-soft);

  /* ===== P1-2 补全：Type Scale 排版系统（Material 3 风格） ===== */
  --type-display-large:  clamp(36px, 4.2vw, 52px) / 1.12;
  --type-display-medium: clamp(28px, 3.2vw, 40px) / 1.16;
  --type-headline-large: clamp(22px, 2.6vw, 28px) / 1.25;
  --type-headline-medium: clamp(18px, 2.2vw, 22px) / 1.29;
  --type-title-large:     17px / 1.4;
  --type-title-medium:    15px / 1.5;
  --type-body-large:      15px / 1.55;
  --type-body-medium:     13px / 1.5;
  --type-label-large:     13px / 1.3;
  --type-label-medium:    12px / 1.4;
  --type-label-small:     11px / 1.45;

  /* 字体族：中文友好层级 */
  --font-display: "Segoe UI", "Microsoft YaHei", system-ui, -apple-system, "PingFang SC", "HarmonyOS Sans SC", sans-serif;
  --font-body:    "Segoe UI", "Microsoft YaHei", system-ui, -apple-system, "PingFang SC", "HarmonyOS Sans SC", sans-serif;
  --font-mono:    ui-monospace, "Consolas", "SF Mono", "Courier New", monospace;

  /* ===== P1-3 补全：8pt 网格间距系统（Apple HIG） ===== */
  --space-1:   4px;
  --space-2:   8px;
  --space-3:  12px;
  --space-4:  16px;   /* 标准内边距 */
  --space-5:  20px;
  --space-6:  24px;   /* 组件内间距 */
  --space-8:  32px;   /* 区块间距 */
  --space-10: 40px;
  --space-12: 48px;   /* 大区块间距 */
  --space-16: 64px;   /* 页面级间距 */

  /* 半径系统 */
  --radius-xs:  4px;
  --radius-sm:  6px;
  --radius-md:  8px;
  --radius-lg:  10px;
  --radius-xl:  12px;
  --radius-2xl: 16px;
  --radius-full: 999px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
html { overflow-y: scroll; }
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  background: linear-gradient(180deg, #101722, #0b0f14);
  border-bottom: 2px solid var(--accent);
  flex-wrap: nowrap;
}
.brand { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.logo {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #8e1d18);
  border-radius: 10px;
  font-weight: 800; font-size: 20px; letter-spacing: 1px;
  color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,.4);
}
.title { font-size: 20px; font-weight: 700; letter-spacing: 4px; }
.sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
nav { display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
nav button {
  background: transparent; color: var(--muted);
  border: 1px solid transparent; border-radius: 8px;
  padding: 8px 10px; font-size: 14px; cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
nav button:hover { color: var(--text); background: var(--panel2); }
nav button.active {
  color: #fff; background: var(--accent);
  box-shadow: 0 2px 10px rgba(230,69,60,.35);
}
main { flex: 1; padding: 22px 28px; max-width: 1280px; width: 100%; margin: 0 auto; }
.tab { display: none; }
.tab.active { display: block; }
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
input, select, button {
  background: var(--panel2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 12px; font-size: 14px;
}
input:focus, select:focus { border-color: var(--accent); }
button { cursor: pointer; }
button:hover { border-color: var(--accent); }
:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 2px;
}
button.primary, .toolbar button {
  background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600;
}
button.primary:hover, .toolbar button:hover { background: #f05047; }
.list-head, .list-row {
  display: grid; grid-template-columns: 3fr 1fr 2fr 1fr 1fr 1fr 1fr 1fr 1fr;
  gap: 0; align-items: center; padding: 8px 12px;
}
.list-head > *, .list-row > * {
  text-align: center;
  border-left: 1px solid var(--line);
  padding-left: 10px; padding-right: 10px;
  width: 100%; min-width: 0;
}
.list-row > * {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.list-head > *:first-child, .list-row > *:first-child { border-left: none; }
.list-head > * { position: relative; }
.col-resize {
  position: absolute; top: 0; right: -4px; width: 8px; height: 100%;
  cursor: col-resize; z-index: 5;
}
.list-head.units, .list-row.units { grid-template-columns: minmax(180px, 1fr) 80px 90px 90px 90px 90px 100px 90px 90px; }
.list-head.chars, .list-row.chars { grid-template-columns: minmax(180px, 1fr) 80px 90px 90px 90px 90px 90px 90px 110px; }
.list-head.sups, .list-row.sups { grid-template-columns: minmax(180px, 1fr) 80px 240px 150px 120px 120px 110px; }
.list-head.stages, .list-row.stages { grid-template-columns: 80px minmax(180px, 1fr) 90px 90px 90px 110px; }
.list-head.sr, .list-row.sr { grid-template-columns: 200px 180px 150px minmax(220px, 1fr); }
.list-head .sort-th {
  background: none; border: none; padding: 0; font-size: 12px;
  display: block; width: 100%; text-align: center;
  color: var(--muted); font-weight: 600; cursor: pointer;
}
.list-head .sort-th:hover { color: var(--accent2); }
.list-head .sort-add {
  position: absolute; top: 50%; right: 0; transform: translateY(-50%);
  background: none; border: none; padding: 0 2px; font-size: 12px; line-height: 1;
  color: var(--muted); opacity: .5; cursor: pointer;
}
.list-head .sort-add:hover { color: var(--accent2); opacity: 1; }
.list-head .sort-add.active { color: var(--accent2); opacity: 1; }
.list-head { color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--line); }
.list { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel); }
.list-row { border-bottom: 1px solid var(--line); cursor: pointer; font-size: 14px; }
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: var(--panel2); }
.list-row .name { font-weight: 600; }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  font-size: 12px; font-weight: 700; text-align: center; width: fit-content;
}
.badge.r5 { background: #7a1f1b; color: #ffd9d4; }
.badge.r4 { background: #6b4b0f; color: #ffe9b8; }
.badge.r3 { background: #33445a; color: #cfe3ff; }
.badge.role { background: var(--panel2); color: var(--muted); border: 1px solid var(--line); }
.badge.role.r-1 { background: #4a2320; color: #ffb0a6; border-color: rgba(255, 122, 110, .55); }
.badge.role.r-2 { background: #16304a; color: #a6d0ff; border-color: rgba(90, 169, 255, .55); }
.badge.role.r-3 { background: #163a2c; color: #93e8c3; border-color: rgba(67, 210, 154, .55); }
.badge.lv { background: #3a2c14; color: var(--accent2); border: 1px solid #7a5c1f; }
.badge.ultimate { background: #3a2c14; color: var(--accent2); border: 1px solid #7a5c1f; }
.pager { display: flex; gap: 10px; justify-content: center; align-items: center; margin-top: 14px; color: var(--muted); font-size: 13px; }
.pager button { padding: 5px 12px; }
.num { font-variant-numeric: tabular-nums; color: var(--muted); }
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px; margin: 14px 0;
}
.stat-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.stat-card .k { font-size: 12px; color: var(--muted); }
.stat-card .v { font-size: 24px; font-weight: 700; margin-top: 4px; }
.stat-card .v small { font-size: 13px; color: var(--muted); font-weight: 400; }
.progress { height: 6px; background: var(--panel2); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent2)); }

/* ===== 爬取数据进度 ===== */
.crawl-progress { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.crawl-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.crawl-step {
  font-size: 12px; padding: 2px 9px; border-radius: 6px;
  border: 1px solid var(--line); color: var(--muted); background: var(--panel2);
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.crawl-step.active { color: #fff; background: var(--accent); border-color: var(--accent); }
.crawl-step.done { color: var(--ok); border-color: var(--ok); }
.crawl-bar { height: 8px; }
.crawl-detail { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 600; white-space: nowrap; }
td.mono { font-variant-numeric: tabular-nums; }
h3 { margin: 18px 0 8px; font-size: 15px; color: var(--accent2); border-left: 3px solid var(--accent); padding-left: 8px; }
.tags span, .chip {
  display: inline-block; background: var(--panel2); border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 10px; font-size: 12px; margin: 2px 4px 2px 0;
}
.tag-chip { cursor: pointer; }
.tag-chip:hover { border-color: var(--accent2); color: var(--accent2); }
.chip.cond { border-color: var(--accent); color: var(--accent2); }
.conds { margin-top: 6px; }
.effect { color: var(--muted); font-size: 12px; line-height: 1.6; }
.effect + .effect { margin-top: 4px; }
.wfx { margin: 2px 0; }
.wfx-name { color: var(--accent2); font-size: 12px; font-weight: 600; }
.wfx-desc { color: var(--muted); font-size: 12px; line-height: 1.5; white-space: pre-line; }
.wfx + .wfx { border-top: 1px dashed var(--line); padding-top: 4px; margin-top: 4px; }
.tag-menu {
  position: fixed; z-index: 100; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.5);
  display: flex; flex-direction: column; gap: 4px;
}
.tag-menu button {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); padding: 7px 12px; font-size: 13px; text-align: left; white-space: nowrap;
}
.tag-menu button:hover { border-color: var(--accent2); color: var(--accent2); }
.muted { color: var(--muted); font-size: 12px; }
.sr-name { font-weight: 600; }
.list-row.sr .sr-effect {
  white-space: pre-line; overflow: visible; text-overflow: clip;
  text-align: left;
}
.list-row.sups .sup-tags-cell {
  white-space: normal; overflow: visible; text-overflow: clip;
}
.list .empty { grid-column: 1 / -1; }
.tagbar { display: flex; gap: 6px; flex-wrap: wrap; margin: -6px 0 12px; min-height: 26px; }
.sel-tag { display: inline-flex; align-items: center; gap: 4px; }
.chip-x {
  background: none; border: none; color: var(--muted); font-size: 13px;
  padding: 0 2px; cursor: pointer; line-height: 1;
}
.chip-x:hover { color: var(--accent); }
.link-name {
  background: none; border: none; color: var(--accent2); padding: 0;
  font-size: 13px; font-weight: 600; cursor: pointer;
  text-decoration: underline dotted; text-underline-offset: 3px;
}
.link-name:hover { color: #ffd97a; }
.result-count { color: var(--muted); font-size: 12px; margin: -6px 0 8px; }
.overview-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 4px 0 14px;
}
.overview-actions .cond-btn { margin-left: 0; }
.overview-actions .muted { flex-basis: 100%; }
.sync-info {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px;
  background: var(--panel2); font-size: 13px; line-height: 1.8;
  margin-bottom: 10px;
}
.sync-info b { color: var(--accent2); }
.effect-chip {
  background: none; border: none; color: var(--accent2); padding: 0;
  font-size: 12px; font-weight: 600; cursor: pointer;
  text-decoration: underline dotted; text-underline-offset: 2px;
}
.effect-chip:hover { color: #ffd97a; }
.sup-cond { cursor: pointer; }
.sup-cond:hover { border-color: var(--accent2); color: var(--accent2); }
.sup-branch { cursor: pointer; }
.sup-branch:hover { border-color: var(--accent2); color: var(--accent2); }
.cond-or { color: var(--accent2); font-weight: 700; margin: 0 4px; }
.skills { display: flex; flex-direction: column; gap: 8px; }
.skill-block {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  background: var(--panel2);
}
.skill-name {
  color: var(--accent2); font-weight: 600; font-size: 13px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.skill-desc {
  color: var(--muted); font-size: 12px; line-height: 1.6;
  white-space: pre-line; margin-top: 4px;
}
.effect-block {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px;
  margin-bottom: 8px; background: var(--panel2);
}
.effect-block .effect { color: var(--text); font-size: 13px; font-weight: 600; }
.effect-block .tags { margin-top: 6px; }
.unit-edit-btns, .char-edit-btns { display: inline-flex; gap: 6px; margin-left: 10px; flex-wrap: wrap; }
.unit-edit-btns .cond-btn, .char-edit-btns .cond-btn { margin-left: 0; padding: 3px 10px; font-size: 12px; }
.edit-input {
  width: 74px; background: var(--panel2); border: 1px solid var(--line);
  border-radius: 6px; color: var(--text); padding: 3px 6px; font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.edit-input.wide { width: 130px; }
textarea.edit-input { width: 240px; min-height: 40px; resize: vertical; font-family: inherit; }
.edit-select {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 6px;
  color: var(--text); padding: 3px 6px; font-size: 12px;
}
.edit-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 2px 0; }
.edit-hint { color: var(--muted); font-size: 11px; margin: 2px 0 8px; }
.edit-remove { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 13px; }
.edit-remove:hover { color: #ff8f8f; }
.ult-tag { border-color: var(--accent); color: var(--accent2); }
.sbox { position: relative; }
.sbox-input { padding-right: 26px; }
.sbox .sbox-clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--muted); font-size: 15px;
  cursor: pointer; padding: 2px 4px; line-height: 1;
}
.sbox .sbox-clear:hover { color: var(--accent); }
.sbox-list {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 60;
  min-width: 220px; max-width: 340px; max-height: 320px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 2px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.5); padding: 6px;
}
.sbox-list .empty { padding: 10px; }
.sbox-list .sbox-item {
  display: block; width: 100%; text-align: left; background: transparent;
  border: none; color: var(--text); padding: 7px 10px; font-size: 13px;
  border-radius: 6px; cursor: pointer;
}
.sbox-list .sbox-item:hover { background: var(--panel2); color: var(--accent2); }
.sbox-list .sbox-item .opt-count { color: var(--muted); font-size: 12px; }
.sbox-list .sbox-item:hover .opt-count { color: inherit; }
.toolbar .reset-btn { background: var(--panel2); border-color: var(--line); color: var(--muted); }
.toolbar .reset-btn:hover { border-color: var(--accent); color: var(--text); }
.form-toggle {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px;
  color: var(--muted); cursor: pointer; user-select: none;
  padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel2);
}
.form-toggle:hover { border-color: var(--accent); color: var(--text); }
.form-toggle input { margin: 0; accent-color: var(--accent); }
.form-toggle:has(input:checked) { border-color: var(--accent); color: var(--accent2); }
.cond-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.desc { color: var(--muted); font-size: 13px; line-height: 1.7; white-space: pre-line; }
.hidden { display: none !important; }
.star-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.star-label { color: var(--muted); font-size: 13px; margin-right: 4px; }
.star-btn, .form-btn {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); padding: 6px 12px; font-size: 13px; cursor: pointer;
}
.star-btn.active, .form-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.cond-btn { margin-left: auto; background: var(--panel2); border: 1px solid var(--accent2); color: var(--accent2); }
.cond-btn.active { background: var(--accent2); border-color: var(--accent2); color: #241a05; }
.cond-btn:disabled { opacity: .5; cursor: not-allowed; }
.cap-chip {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 12px; font-size: 12px; color: var(--muted);
}
.add { color: var(--ok); font-size: 12px; }
.hint { color: var(--muted); font-size: 12px; margin: 6px 0 10px; }
.calc-wrap { display: grid; grid-template-columns: 1fr 1fr 1.15fr; gap: 14px; align-items: start; }
.calc-side { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.mods-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; align-items: end; }
.mods-grid label { flex-direction: row; align-items: center; gap: 6px; margin-bottom: 0; min-width: 0; }
.mods-grid input, .mods-grid select { min-width: 0; max-width: 100%; }
.mods-grid input[type="checkbox"] { width: auto; }
.calc-actions { display: flex; gap: 10px; margin-top: 14px; }
.calc-side label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.calc-side input, .calc-side select { margin-top: 2px; }
.pick-row { display: flex; gap: 6px; }
.pick-row input { flex: 1; }
.pick-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.pick-btns .pick-btn { margin: 0; padding: 8px 16px; font-size: 14px; }
.pick-infos { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 6px; }
.pick-infos .pick-info { display: inline-flex; align-items: center; gap: 6px; }
.stat-row { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 8px; }
.stat-row label { flex-direction: row; align-items: center; gap: 6px; margin-bottom: 0; }
.stat-row input { width: 110px; }
.weapon-info {
  display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center;
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px;
  background: var(--panel2); font-size: 12px; margin-bottom: 10px;
}
.weapon-info b { color: var(--accent2); }
.weapon-info input { width: 80px; padding: 2px 6px; }
.panel-row {
  display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center;
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px;
  background: var(--panel2); font-size: 12px; margin-bottom: 10px;
}
.panel-row label { flex-direction: row; align-items: center; gap: 4px; margin-bottom: 0; }
.panel-row input { width: 64px; padding: 2px 6px; }
.panel-row b { color: var(--accent2); }
.panel-row .muted { margin-left: 4px; }
.pick-btn {
  background: var(--panel2); border: 1px solid var(--line); color: var(--muted);
  border-radius: 8px; padding: 4px 10px; font-size: 12px; cursor: pointer; white-space: nowrap;
}
.pick-btn:hover { border-color: var(--accent2); color: var(--accent2); }
.skill-pick { width: 100%; text-align: center; margin: -4px 0 10px; }
.pick-info { font-size: 12px; color: var(--accent2); margin: -6px 0 10px; min-height: 16px; }
.ab-head { display: block; font-size: 13px; color: var(--muted); margin: 4px 0 4px; }
.ability-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.ab-row {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 10px; font-size: 12px; cursor: pointer;
}
.ab-row .ab-main { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ab-row .ab-name { font-weight: 600; color: var(--text); }
.ab-row .muted { font-size: 11px; white-space: normal; }
.ab-switch { width: auto; margin: 0; flex-shrink: 0; }
.empty.small { padding: 8px; font-size: 12px; }
.star-select { width: 100%; margin: -4px 0 10px; }
.damage-final {
  font-size: 14px; color: var(--muted); margin-bottom: 10px;
  padding: 12px 14px; border: 1px solid var(--accent); border-radius: 10px;
  background: var(--panel2);
}
.damage-final b { font-size: 26px; color: var(--accent2); }
#d-result tr.dead { color: var(--accent); font-weight: 700; }
.remain-hp {
  font-size: 14px; color: var(--muted); margin-top: 8px;
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel2);
}
.remain-hp b { color: var(--ok); font-size: 18px; }
#d-summary { margin-top: 12px; }
.picker-list .picker-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  border-bottom: 1px solid var(--line); cursor: pointer; font-size: 13px;
}
.picker-row:hover { background: var(--panel2); }
.picker-row .name { font-weight: 600; flex: 1; }
.picker-list .picker-row.picker-grid {
  display: grid; grid-template-columns: 2fr 60px 80px 1.5fr 1.5fr 1fr 1fr;
  gap: 8px; align-items: center;
}
.picker-list .picker-row.picker-grid .name { flex: none; }
.picker-head { color: var(--muted); font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--line); }
.picker-list .picker-head {
  display: grid; grid-template-columns: 2fr 60px 80px 1.5fr 1.5fr 1fr 1fr;
  gap: 8px; align-items: center; padding: 6px 12px;
}
.picker-list .picker-row.picker-row-sup {
  display: block; padding: 6px 12px;
}
.picker-list .picker-row.picker-row-sup .row-line {
  display: flex; gap: 8px; align-items: baseline; line-height: 1.5;
  font-size: 12px;
}
.picker-list .picker-row.picker-row-sup .row-line:first-child {
  font-size: 13px;
}
.picker-list .picker-row.picker-row-sup .row-line .name { font-weight: 600; }
.picker-head > * { border-left: 1px solid var(--line); padding: 0 6px; text-align: center; }
.picker-head > *:first-child { border-left: none; }
.picker-head .picker-sort {
  background: none; border: none; padding: 0; font-size: 12px;
  color: var(--muted); font-weight: 600; cursor: pointer;
  width: 100%; text-align: center;
}
.picker-head .picker-sort:hover { color: var(--accent2); }
.checks { display: flex; gap: 18px; margin: 6px 0 14px; }
.checks label { flex-direction: row; align-items: center; gap: 6px; }
.calc-result { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; min-height: 0; max-height: 76vh; overflow-y: auto; }
.ability-list { max-height: 210px; overflow-y: auto; padding-right: 4px; }
.calc-side .pick-btn { padding: 4px 8px; font-size: 12px; }
.calc-side .pick-row input { min-width: 0; }
.side-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.reset-btn.small { padding: 3px 10px; font-size: 12px; }
.calc-result h3 { margin-top: 4px; }
.calc-result-head {
  position: sticky; top: 0; z-index: 3; background: var(--panel);
  padding-bottom: 10px; margin-bottom: 8px; border-bottom: 1px solid var(--line);
}
.sim-summary {
  display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel2); font-size: 13px; color: var(--muted);
}
.sim-summary b { color: var(--accent2); }
.step-row { display: flex; justify-content: space-between; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 14px; }
.step-row:last-child { border-bottom: none; }
.step-row .lbl { color: var(--muted); }
.step-row .val { font-variant-numeric: tabular-nums; font-weight: 600; }
.step-row.final .val { color: var(--accent2); font-size: 20px; }
.empty { padding: 30px; text-align: center; color: var(--muted); }
.options { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.option {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 12px; cursor: pointer; font-size: 13px;
}
.option:hover { border-color: var(--accent); }
.pair-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; margin-bottom: 10px;
}
.pair-card .head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pair-card .name { font-weight: 700; font-size: 15px; }
.score-line { display: flex; gap: 16px; align-items: center; margin: 8px 0; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.score-bar { flex: 1; min-width: 120px; height: 8px; background: var(--panel2); border-radius: 5px; overflow: hidden; }
.score-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); }
.pair-card .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pair-card .chips span {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 6px;
  font-size: 11px; padding: 3px 8px; color: var(--muted);
}
.pair-section { margin-top: 18px; }
.pair-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 16px;
}
.pair-result-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 16px;
}
.pair-head-unit {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 15px;
}
.pair-result-panel table .sort-th {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
  padding: 0;
}
.pair-result-panel table .sort-th:hover { color: var(--accent2); }
.pair-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.pair-title { font-size: 16px; font-weight: 700; }
.pair-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 9px 0;
  border-top: 1px dashed var(--line);
}
.pair-row:first-of-type { border-top: none; }
.pair-label { color: var(--muted); font-size: 13px; min-width: 52px; }
.pair-label-gap { margin-left: 6px; }
.seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.seg-btn {
  background: var(--panel2);
  border: none;
  padding: 6px 18px;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}
.seg-btn + .seg-btn { border-left: 1px solid var(--line); }
.seg-btn:hover { color: var(--accent); }
.seg-btn.active { background: var(--accent2); color: #241a05; font-weight: 600; }
.pair-match-btn { margin-left: auto; }
.pair-filter-row { align-items: flex-start; padding-top: 10px; }
.pair-filter-wrap { flex: 1 1 420px; min-width: 0; }
.pair-filter-wrap .toolbar { margin: 0; row-gap: 8px; }
.pair-filter-wrap .tagbar { margin: 8px 0 0; min-height: 22px; }
.pair-selected {
  flex: 1;
  min-width: 260px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
}
.pair-sel-info { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pair-sel-clear {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  margin-left: auto;
  padding: 2px 6px;
  border-radius: 6px;
}
.pair-sel-clear:hover { color: var(--accent); background: var(--panel); }
#pair-reset-all { margin-left: 0; flex-shrink: 0; }
.pair-weapon-info {
  flex: 1;
  min-width: 300px;
  display: flex;
  align-items: center;
  gap: 8px 14px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  color: var(--muted);
}
.pair-weapon-info b { color: var(--text); }
.pair-field { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.pair-field input[type="number"] {
  width: 92px;
  padding: 5px 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
}
.pair-field select {
  padding: 5px 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
}
.pair-field-check { gap: 4px; cursor: pointer; }
.pair-pilot { cursor: pointer; }
.pair-pilot:hover { background: var(--panel2); }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: grid; place-items: center; z-index: 50; overscroll-behavior: contain; }
.modal.hidden { display: none; }
.modal-box {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  width: min(960px, 92vw); max-height: 86vh; overflow-y: auto;
  padding: max(18px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left));
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-head span { font-size: 18px; font-weight: 700; }
#modal-close { background: transparent; border: none; font-size: 22px; color: var(--muted); }
#modal-close:hover { color: var(--accent); }
footer { text-align: center; color: var(--muted); font-size: 12px; padding: 16px; border-top: 1px solid var(--line); }
footer a { color: var(--accent2); text-decoration: none; }
@media (max-width: 900px) {
  .calc-wrap { grid-template-columns: 1fr; }
  .list-head { display: none; }
  .list-row, .list-row.units, .list-row.chars, .list-row.sups, .list-row.stages, .list-row.sr {
    grid-template-columns: 2fr 1fr; font-size: 13px;
  }
}

/* P0-3: Honor prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* P0-10: Screen-reader-only utility for aria-live region */
.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;
}

/* P0-9: Skip link for keyboard navigation */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: 0 0 8px 0;
  font-size: 14px;
  font-weight: 600;
  z-index: 1000;
  transition: top .15s ease;
}
.skip-link:focus {
  top: 0;
}

/* =====================================================================
 * Phase 2 · P1 设计系统升级（全部是新增类，不覆盖原有样式）
 * ===================================================================== */

/* ---------- P1-10: text-wrap 防孤行（全局标题/正文） ---------- */
h1, h2, h3, h4, h5, h6, .title, .head, .stat-card .k, .modal-head span, .list-head {
  text-wrap: balance;
}
p, .effect, .desc, .skill-desc, .ability-desc, .notes, td, li, .list-row, .sub {
  text-wrap: pretty;
}
/* 数字表格列全局等宽对齐 */
.num, .mono, .stat-card .v, .weapon-table td.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* ---------- P1-4: Button 五级层级系统（新增类，后续可逐步替换） ---------- */
/* 层级优先级：Filled Primary > Filled Tonal > Outlined > Text > Icon-only
   统一高度 40px（窄屏 44px，符合 Apple HIG 最小触控尺寸） */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 20px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  transition:
    background-color 150ms ease,
    color 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease,
    transform 100ms ease,
    filter 150ms ease;
}
.btn:disabled, .btn[aria-disabled="true"] {
  opacity: .5;
  cursor: not-allowed;
  transform: none !important;
  filter: none !important;
}

/* 1. Primary Filled（主操作：红色填充） */
.btn-primary {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(230, 69, 60, .25);
}
.btn-primary:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: var(--shadow-1), 0 4px 14px rgba(230, 69, 60, .32);
}
.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  filter: brightness(.96);
}

/* 2. Filled Tonal（次级强调：金色填充） */
.btn-tonal {
  background: var(--accent2);
  color: #1a1405;
}
.btn-tonal:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(245, 185, 60, .28);
}
.btn-tonal:active:not(:disabled) { transform: translateY(0); filter: brightness(.97); }

/* 3. Outlined（中性操作：描边） */
.btn-outlined {
  background: transparent;
  border-color: var(--outline);
  color: var(--text);
}
.btn-outlined:hover:not(:disabled) {
  background: var(--surface-variant);
  border-color: var(--accent);
  color: var(--text);
}
.btn-outlined:active:not(:disabled) { background: var(--surface-dim); }

/* 4. Text（弱化操作：纯文字） */
.btn-text {
  background: transparent;
  border: none;
  color: var(--muted);
  height: 36px;
  padding: 0 12px;
}
.btn-text:hover:not(:disabled) {
  color: var(--text);
  background: var(--surface-variant);
}

/* 5. Icon-only（纯图标 36×36） */
.btn-icon {
  background: transparent;
  border: none;
  color: var(--muted);
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
  border-radius: var(--radius-md);
}
.btn-icon:hover:not(:disabled) {
  color: var(--text);
  background: var(--surface-variant);
}

/* ---------- P1-5: Card 三级 Elevation（MD3 风格） ---------- */
/* 三种风格：elevated（阴影，默认）、filled（背景色块）、outlined（描边）
   所有卡片统一 hover 抬升效果 + 按压反馈 */
.card {
  background: var(--surface);
  border-radius: var(--radius-xl);
  transition:
    box-shadow 200ms ease,
    transform 200ms cubic-bezier(.2, .8, .2, 1),
    background-color 150ms ease,
    border-color 150ms ease;
}

.card-elevated {
  border: 1px solid var(--outline-variant);
  box-shadow: var(--shadow-1);
}
.card-elevated:hover {
  box-shadow: var(--shadow-2);
  transform: translateY(-2px);
}
.card-elevated:active {
  transform: translateY(0);
  box-shadow: var(--shadow-1);
}

.card-filled {
  background: var(--surface-variant);
  border: none;
}
.card-filled:hover {
  background: var(--surface-bright);
  transform: translateY(-1px);
}

.card-outlined {
  background: transparent;
  border: 1px solid var(--outline-variant);
}
.card-outlined:hover {
  border-color: var(--outline);
  background: var(--surface-dim);
}

/* ---------- P1-7: 长列表性能优化 ---------- */
.list-row {
  content-visibility: auto;
  contain-intrinsic-size: auto 40px;
}

/* ---------- P1-6: 响应式断点扩充（在原 900px 之外新增 4 档） ---------- */
/* 大屏：≥1280px 时面板更宽松、详情双栏 */
@media (min-width: 1280px) {
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .summary-cards { gap: 20px; }
  header { padding: 14px 28px; }
  main { padding: 18px 28px; }
}

/* 普通平板 / 中等屏：1024–1279px */
@media (max-width: 1279px) and (min-width: 1024px) {
  header { padding: 12px 20px; }
  main { padding: 16px 20px; }
}

/* 平板竖屏：768–1023px —— 详情单栏、工具栏换行间距 */
@media (max-width: 1023px) and (min-width: 768px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .toolbar { flex-wrap: wrap; }
  main { padding: 14px 16px; }
}

/* 手机：481–767px —— tab 横向滚动、列表卡片化 */
@media (max-width: 767px) {
  header {
    padding: 10px 14px;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
  }
  #tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  #tabs::-webkit-scrollbar { display: none; }
  #tabs button { flex: 0 0 auto; }
  main { padding: var(--space-3) var(--space-3) var(--space-4); }
  .toolbar {
    flex-wrap: wrap;
    gap: var(--space-2);
  }
  .toolbar > * { flex: 1 1 calc(50% - var(--space-2)); min-width: 0; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
}

/* ==============================================================
   Step 1 · 背景氛围 / 字体深化
   ============================================================== */

/* ---- 1.1 主色 Tonal Palette 深化 + HUD 辅助色 ---- */
:root {
  --accent-tone-10: #3a100c;
  --accent-tone-20: #5e1a14;
  --accent-tone-30: #8a261d;
  --accent-tone-40: #b53529;
  --accent: #e6453c;
  --accent-tone-70: #ef6d66;
  --accent-tone-80: #f59590;
  --accent-tone-90: #fbbebb;

  --hud-green: #4db6ac;
  --hud-amber: #f5b93c;
  --hud-red:   #e6453c;
  --hud-blue:  #6bb6ff;
  --hud-dot: rgba(77, 182, 172, 0.9);
}

/* ---- 1.2 字体 family 深化（回退链内置中文优先，不依赖 CDN） ---- */
:root {
  --font-display: "HarmonyOS Sans SC", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-body:    "HarmonyOS Sans SC", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono:    "JetBrains Mono", "IBM Plex Mono", "Consolas", ui-monospace, "SF Mono", "Courier New", monospace;
}

/* ---- 1.3 背景氛围：顶部红光 + 1.5% noise 纹理 ---- */
body {
  background:
    radial-gradient(ellipse 80% 42% at 50% -5%, rgba(230, 69, 60, 0.065), rgba(230, 69, 60, 0.015) 55%, transparent 72%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.025 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>"),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- 1.4 驾驶舱扫描线 overlay（pointer-events: none） ---- */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.018) 0px,
    rgba(255, 255, 255, 0.018) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
  opacity: 0.7;
}

/* reduced-motion 保护：减弱扫描线强度 */
@media (prefers-reduced-motion: reduce) {
  body::after { opacity: 0.25; }
}

/* 手机：481–767px 补充：列表卡片化（非表头行） */
@media (max-width: 767px) {
  .list-body > .list-row {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    border: 1px solid var(--outline-variant);
    background: var(--surface-dim);
    margin-bottom: var(--space-2);
  }
  .list-body > .list-row:hover {
    background: var(--surface-variant);
    border-color: var(--outline);
  }
}

/* 小屏手机：≤480px —— 按钮最小触控 44px */
@media (max-width: 480px) {
  .btn, nav button, .sbox-clear, .chip-x {
    min-height: 44px;
  }
  .btn-icon { width: 44px; height: 44px; min-width: 44px; }
  input, select { min-height: 44px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .modal-box {
    width: 96vw;
    max-height: 92vh;
    border-radius: var(--radius-lg);
  }
}

/* ==============================================================
   Step 2 · Header 重构：Logo 切角 + HUD 状态条 + Tab 色带
   ============================================================== */

/* ---- 2.1 通用切角 clip-path（G 世纪战术终端风格） ---- */
:root {
  --clip-corner-tr: polygon(
    0 0, calc(100% - 10px) 0, 100% 10px,
    100% 100%, 0 100%
  );
  --clip-corner-both: polygon(
    10px 0, calc(100% - 10px) 0, 100% 10px,
    100% calc(100% - 10px), calc(100% - 10px) 100%,
    10px 100%, 0 calc(100% - 10px), 0 10px
  );
  --tab-color-hud-blue:  var(--hud-blue);
  --tab-color-hud-red:   var(--hud-red);
  --tab-color-hud-amber: var(--hud-amber);
  --tab-color-hud-green: var(--hud-green);
  --tab-color-role2:     #b2a6ff;
}

/* ---- 2.2 Logo：六边形切角 + 红黑渐变 + 扫描线扫过 ---- */
.logo {
  position: relative;
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  clip-path: polygon(
    28% 0, 72% 0, 100% 50%,
    72% 100%, 28% 100%, 0 50%
  );
  background:
    linear-gradient(135deg, #7a1b15 0%, var(--accent) 45%, var(--accent-tone-70) 70%, #fff2 100%);
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.18),
    inset 0 2px 6px rgba(255, 180, 170, 0.35),
    0 0 22px rgba(230, 69, 60, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 320ms cubic-bezier(.2,.8,.2,1), filter 320ms ease;
}
.logo:hover { transform: rotate(-6deg) scale(1.04); filter: brightness(1.06); }
.logo-inner {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.06em;
  color: #fff;
  text-shadow: 0 1px 0 rgba(0,0,0,0.35), 0 0 10px rgba(255,200,200,0.35);
  position: relative;
  z-index: 2;
}
.logo-scan {
  position: absolute;
  top: -30%;
  left: -30%;
  width: 60%;
  height: 160%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.22) 50%,
    transparent 100%
  );
  transform: skewX(-18deg);
  z-index: 1;
  animation: logo-sweep 5.5s cubic-bezier(.2,.8,.2,1) infinite;
}
@keyframes logo-sweep {
  0%   { transform: translateX(0%)  skewX(-18deg); opacity: 0; }
  10%  { opacity: 1; }
  60%  { transform: translateX(420%) skewX(-18deg); opacity: 0.9; }
  100% { transform: translateX(420%) skewX(-18deg); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .logo-scan { animation: none; }
  .logo:hover { transform: none; }
}

/* ---- 2.3 brand 布局升级：logo + 文字 + 右对齐 HUD 状态条 ---- */
header {
  background:
    linear-gradient(180deg, #121a26 0%, #0c1218 70%, #090d12 100%);
  border-bottom: 1px solid var(--outline-variant);
  padding: var(--space-5) var(--space-6);
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  justify-content: flex-start;
}
.brand-text { margin-right: auto; }
.brand-text .title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #f1f3f6;
  font-family: var(--font-display);
}
.brand-text .sub {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.03em;
  margin-top: 2px;
}

/* ---- 2.4 HUD 状态条 ---- */
.hud-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--surface-dim);
  border: 1px solid var(--outline-variant);
  clip-path: var(--clip-corner-tr);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.hud-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--hud-green);
  box-shadow: 0 0 0 0 rgba(77, 182, 172, 0.6);
  animation: hud-pulse 2s ease-out infinite;
}
@keyframes hud-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(77, 182, 172, 0.55); }
  70%  { box-shadow: 0 0 0 10px rgba(77, 182, 172, 0); }
  100% { box-shadow: 0 0 0 0   rgba(77, 182, 172, 0); }
}
.hud-label { color: #c2d1e5; font-weight: 600; }
.hud-sep { opacity: 0.4; }
.hud-time,
.hud-dbstat { color: #e7ecf4; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) {
  .hud-dot { animation: none; }
}

/* ---- 2.5 Tab 色带系统：左侧竖条 + active 顶部光带 ---- */
#tabs {
  margin-top: var(--space-4);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  position: relative;
}
nav button {
  position: relative;
  padding: 10px 18px 10px 22px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px 6px 6px 4px;
  cursor: pointer;
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
  overflow: hidden;
  letter-spacing: 0.02em;
}
/* 左侧色带：按 data-tab-color 映射 */
nav button::before {
  content: "";
  position: absolute;
  left: 0; top: 10%; bottom: 10%;
  width: 3px;
  background: var(--tab-color-hud-blue);
  border-radius: 2px;
  opacity: 0.7;
  transition: opacity 200ms ease, transform 200ms ease;
}
nav button[data-tab-color="hud-red"]::before   { background: var(--hud-red); }
nav button[data-tab-color="hud-amber"]::before { background: var(--hud-amber); }
nav button[data-tab-color="hud-green"]::before { background: var(--hud-green); }
nav button[data-tab-color="hud-blue"]::before  { background: var(--hud-blue); }
nav button[data-tab-color="role2"]::before     { background: var(--tab-color-role2); }

/* Hover 态 */
nav button:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}
nav button:hover::before { opacity: 1; transform: scaleY(1.05); }

/* Active 态：填充 + 顶部光带 */
nav button.active {
  background: var(--surface-dim);
  color: #f3f5f8;
  border-color: var(--outline-variant);
}
nav button.active::before { opacity: 1; transform: scaleY(1.1); }

/* 顶部扫描光带 —— 仅 active tab */
nav button.active::after {
  content: "";
  position: absolute;
  left: 0; top: 0; right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--accent) 40%,
    var(--accent2) 70%,
    transparent 100%
  );
  opacity: 0.95;
}

/* ---- 2.6 Header HUD 光带（导航下的三槽能量条） ---- */
.hud-light-bar {
  margin-top: var(--space-3);
  height: 3px;
  display: grid;
  grid-template-columns: 1.2fr 0.5fr 2.2fr;
  gap: 8px;
}
.hud-light-bar span {
  position: relative;
  display: block;
  background: var(--surface-variant);
  border-radius: 2px;
  overflow: hidden;
}
.hud-light-bar span::after {
  content: "";
  position: absolute;
  inset: 0;
  transform-origin: left center;
  border-radius: 2px;
}
.hud-light-bar span:nth-child(1)::after {
  background: linear-gradient(90deg, var(--hud-red), var(--accent-tone-70));
  width: 82%;
  box-shadow: 0 0 10px rgba(230, 69, 60, 0.5);
}
.hud-light-bar span:nth-child(2)::after {
  background: linear-gradient(90deg, var(--hud-amber), #ffe18a);
  width: 55%;
}
.hud-light-bar span:nth-child(3)::after {
  background: linear-gradient(90deg, var(--hud-green), #b6f1ea, var(--hud-blue));
  width: 68%;
  box-shadow: 0 0 8px rgba(77, 182, 172, 0.4);
}

/* ---- 2.7 HUD / 移动端响应式调整 ---- */
@media (max-width: 767px) {
  .brand { flex-wrap: wrap; }
  .hud-status {
    order: 3;
    width: 100%;
    justify-content: center;
    padding: 8px 12px;
    font-size: 11px;
  }
  .logo { width: 44px; height: 44px; }
  .logo-inner { font-size: 15px; }
  .brand-text .title { font-size: 18px; }
}
@media (max-width: 480px) {
  header { padding: 10px 12px; }
  .brand-text .sub { display: none; }
}

/* ==============================================================
   Step 3 · 概览页仪表盘：KPI 卡 + 操作面板 + 刻度进度条
   ============================================================== */

/* ---- 3.1 概览页 2/3 + 1/3 双栏布局 ---- */
.overview-dashboard {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-6);
  align-items: start;
  margin-bottom: var(--space-6);
}
.overview-hero-title {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: 4px;
}
.overview-hero-title h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #eef1f5;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: none;
  position: relative;
}
.overview-hero-title h3::before {
  content: "▎";
  color: var(--accent);
  margin-right: 8px;
  font-weight: 400;
}
.overview-hero-title .hero-caption {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.08em;
}

/* ---- 3.2 KPI 四宫格（2×2） ---- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.kpi-card {
  position: relative;
  padding: var(--space-5);
  background:
    linear-gradient(180deg, var(--surface) 0%, var(--surface-dim) 100%);
  border: 1px solid var(--outline-variant);
  clip-path: var(--clip-corner-tr);
  box-shadow: var(--shadow-1);
  transition: transform 280ms cubic-bezier(.2,.8,.2,1),
              box-shadow 280ms ease,
              border-color 280ms ease;
  overflow: hidden;
}
.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-2);
  border-color: var(--outline);
}

/* 顶部切角装饰条（右上斜切 + 细光带） */
.kpi-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent 80%);
  opacity: 0.85;
}
/* 角标图标位（右下） */
.kpi-card::after {
  content: "";
  position: absolute;
  right: -14px; bottom: -14px;
  width: 80px; height: 80px;
  border-radius: 999px;
  background: radial-gradient(circle, var(--kpi-glow, rgba(230,69,60,0.12)) 0%, transparent 70%);
  pointer-events: none;
}
.kpi-card[data-color="units"]      { --kpi-glow: rgba(230,69,60,0.16); }
.kpi-card[data-color="characters"] { --kpi-glow: rgba(107,182,255,0.16); }
.kpi-card[data-color="supporters"] { --kpi-glow: rgba(245,185,60,0.16); }
.kpi-card[data-color="stages"]     { --kpi-glow: rgba(77,182,172,0.16); }

.kpi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}
.kpi-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #cdd7e6;
}
.kpi-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--kpi-icon-bg, rgba(230,69,60,0.14));
  color: var(--kpi-icon-color, var(--accent));
  font-size: 15px;
  opacity: 0.9;
}
.kpi-card[data-color="units"]      .kpi-icon { --kpi-icon-bg: rgba(230,69,60,0.16);    --kpi-icon-color: var(--hud-red); }
.kpi-card[data-color="characters"] .kpi-icon { --kpi-icon-bg: rgba(107,182,255,0.16);   --kpi-icon-color: var(--hud-blue); }
.kpi-card[data-color="supporters"] .kpi-icon { --kpi-icon-bg: rgba(245,185,60,0.18);   --kpi-icon-color: var(--hud-amber); }
.kpi-card[data-color="stages"]     .kpi-icon { --kpi-icon-bg: rgba(77,182,172,0.18);    --kpi-icon-color: var(--hud-green); }

.kpi-value-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: var(--space-4);
}
.kpi-value {
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #f8fafc;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.kpi-expected {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--muted);
}

/* ---- 3.3 10 格分段刻度进度条（弹药计数器风格） ---- */
.segment-bar {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
  height: 8px;
}
.segment-bar span {
  display: block;
  background: var(--surface-variant);
  border-radius: 2px;
  transition: background-color 300ms ease, box-shadow 300ms ease;
  position: relative;
  overflow: hidden;
}
.segment-bar span.on {
  background: var(--seg-color, var(--accent));
  box-shadow: 0 0 4px var(--seg-glow, rgba(230,69,60,0.5));
}
.segment-bar.near  span:nth-child(10).on { opacity: 0.6; }
.kpi-card[data-color="units"]      .segment-bar { --seg-color: linear-gradient(180deg, var(--accent-tone-70), var(--accent)); --seg-glow: rgba(230,69,60,0.55); }
.kpi-card[data-color="characters"] .segment-bar { --seg-color: linear-gradient(180deg, #8ec9ff, var(--hud-blue));        --seg-glow: rgba(107,182,255,0.55); }
.kpi-card[data-color="supporters"] .segment-bar { --seg-color: linear-gradient(180deg, #ffd67a, var(--hud-amber));       --seg-glow: rgba(245,185,60,0.55); }
.kpi-card[data-color="stages"]     .segment-bar { --seg-color: linear-gradient(180deg, #8ae4da, var(--hud-green));       --seg-glow: rgba(77,182,172,0.55); }

.kpi-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-3);
  font-size: 11.5px;
  font-family: var(--font-mono);
  color: var(--muted);
  letter-spacing: 0.05em;
}
.kpi-foot .kpi-pct { color: #eef1f5; font-weight: 600; }

/* ---- 3.4 右侧操作面板卡 ---- */
.op-panel {
  background:
    linear-gradient(180deg, var(--surface-dim) 0%, #0d131a 100%);
  border: 1px solid var(--outline-variant);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  box-shadow: var(--shadow-1);
  position: sticky;
  top: var(--space-5);
}
.op-panel h4 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: #eef1f5;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--outline-variant);
  letter-spacing: 0.02em;
}
.op-panel h4::before {
  content: "⚙ ";
  color: var(--accent2);
  margin-right: 4px;
  opacity: 0.9;
}
.op-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-variant);
  border: 1px solid var(--outline);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: var(--space-4);
  gap: var(--space-3);
  font-size: 12.5px;
}
.op-status .stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: #e3ebf5;
}
.op-status .stat-chip::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 999px;
  background: var(--hud-green);
  box-shadow: 0 0 6px rgba(77,182,172,0.7);
}
.op-status.is-warn .stat-chip::before { background: var(--hud-amber); box-shadow: 0 0 6px rgba(245,185,60,0.7); }
.op-status.is-error .stat-chip::before { background: var(--hud-red);   box-shadow: 0 0 6px rgba(230,69,60,0.7); }

.op-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.op-actions .btn {
  width: 100%;
  justify-content: flex-start;
  padding: 0 var(--space-4);
  gap: 8px;
}
.op-actions .btn .btn-glyph {
  display: inline-block;
  width: 18px;
  text-align: center;
  opacity: 0.85;
}
.op-msg {
  margin-top: var(--space-3);
  font-size: 12.5px;
  color: var(--muted);
  font-family: var(--font-mono);
  letter-spacing: 0.03em;
  min-height: 18px;
}

/* ---- 3.5 次级统计（原先剩下的 4 个小卡） ---- */
.overview-mini-title {
  grid-column: 1 / -1;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: #d7dee8;
  letter-spacing: 0.02em;
  padding-top: var(--space-2);
  margin-bottom: -8px;
}
.overview-mini-title::before {
  content: "▍";
  color: var(--accent2);
  margin-right: 8px;
}

/* ---- 3.6 响应式：小屏单列 ---- */
@media (max-width: 1023px) {
  .overview-dashboard {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }
  .op-panel { position: static; }
}
@media (max-width: 640px) {
  .kpi-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .kpi-card:hover { transform: none; box-shadow: var(--shadow-1); }
  .segment-bar span { transition: none; }
}

/* ==============================================================
   Step 4 · 列表行增强：hover 红线指示带 + 数值迷你属性条 + Badge 切角
   ============================================================== */

/* ---- 4.1 hover 红线指示带（左侧竖向能量条） ---- */
.list-row {
  position: relative;
  transition: background-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}
.list-row::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-tone-70));
  box-shadow: 0 0 8px rgba(230, 69, 60, 0.6);
  transform: scaleY(0);
  transform-origin: center;
  opacity: 0;
  transition: transform 220ms cubic-bezier(.2,.8,.2,1), opacity 220ms ease;
  z-index: 2;
}
.list-row:hover::before {
  transform: scaleY(1);
  opacity: 1;
}
.list-row:hover {
  background: linear-gradient(90deg, rgba(230, 69, 60, 0.06) 0%, var(--panel2) 28%);
  box-shadow: inset 0 0 0 1px rgba(230, 69, 60, 0.15);
}
.list-row:active {
  transform: translateX(2px);
}

/* ---- 4.2 数值迷你属性条（弹药计数器风格的单元格内 bar） ---- */
.stat-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
}
.stat-cell .stat-num {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 600;
  color: #e3ebf5;
  line-height: 1.1;
}
.stat-cell .mini-bar {
  width: 100%;
  max-width: 64px;
  height: 3px;
  background: var(--surface-variant);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.stat-cell .mini-bar i {
  display: block;
  height: 100%;
  border-radius: 2px;
  transition: width 320ms cubic-bezier(.2,.8,.2,1);
}
.stat-cell .mini-bar i.hud-red    { background: linear-gradient(90deg, var(--accent-tone-70), var(--accent)); box-shadow: 0 0 4px rgba(230,69,60,0.5); }
.stat-cell .mini-bar i.hud-amber  { background: linear-gradient(90deg, #ffd67a, var(--hud-amber)); box-shadow: 0 0 4px rgba(245,185,60,0.45); }
.stat-cell .mini-bar i.hud-blue   { background: linear-gradient(90deg, #8ec9ff, var(--hud-blue)); box-shadow: 0 0 4px rgba(107,182,255,0.45); }
.stat-cell .mini-bar i.hud-green  { background: linear-gradient(90deg, #8ae4da, var(--hud-green)); box-shadow: 0 0 4px rgba(77,182,172,0.45); }
.stat-cell .mini-bar i.hud-violet { background: linear-gradient(90deg, #c4b5ff, #b2a6ff); box-shadow: 0 0 4px rgba(178,166,255,0.45); }

/* 行内数值单元格（保留 .num 兼容，新增 .stat-cell 增强） */
.list-row .num { font-variant-numeric: tabular-nums; }

/* ---- 4.3 Badge 切角化（稀有度/类型/LV） ---- */
.list-row .badge {
  clip-path: polygon(0 0, calc(100% - 5px) 0, 100% 5px, 100% 100%, 5px 100%, 0 calc(100% - 5px));
  padding: 3px 10px 3px 8px;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
  position: relative;
}
.badge.r5 { border-color: rgba(255, 217, 212, 0.18); }
.badge.r4 { border-color: rgba(255, 233, 184, 0.18); }
.badge.role.r-1 { border-color: rgba(230, 69, 60, 0.5); }
.badge.role.r-2 { border-color: rgba(43, 108, 176, 0.5); }
.badge.role.r-3 { border-color: rgba(47, 158, 110, 0.5); }

/* reduced-motion：关闭行内压感反馈 */
@media (prefers-reduced-motion: reduce) {
  .list-row::before { transition: none; transform: none; opacity: 1; }
  .list-row:hover { transform: none; }
  .list-row:active { transform: none; }
}

/* ==============================================================
   Step 5 · 详情模态框双栏布局：sticky 摘要 + 子tab + 雷达图
   ============================================================== */

/* ---- 5.1 modal-box 宽度与高度升级（容纳双栏） ---- */
.modal-box.modal-detail {
  width: min(1180px, 94vw);
  max-height: 88vh;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.modal-detail .modal-head {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--outline-variant);
  margin-bottom: 0;
  background: linear-gradient(180deg, var(--surface-bright), var(--surface));
  flex-shrink: 0;
}
.modal-detail #modal-body {
  flex: 1;
  overflow: hidden;
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 0;
}

/* ---- 5.2 左侧 sticky 摘要 ---- */
.detail-summary {
  padding: 18px 18px 18px 20px;
  border-right: 1px solid var(--outline-variant);
  background: linear-gradient(180deg, var(--surface-dim) 0%, var(--surface) 100%);
  overflow-y: auto;
  overscroll-behavior: contain;
  position: sticky;
  top: 0;
  max-height: calc(88vh - 64px);
}
.detail-summary .ds-role-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.detail-summary .ds-desc {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 14px;
  max-height: 96px;
  overflow-y: auto;
}
.detail-summary .ds-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
  margin-bottom: 14px;
}
.detail-summary .ds-stat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px dashed var(--outline-variant);
  padding: 4px 0;
  font-size: 12px;
}
.detail-summary .ds-stat .ds-k { color: var(--muted); letter-spacing: 0.04em; }
.detail-summary .ds-stat .ds-v {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #e3ebf5;
  font-family: var(--font-display);
}
.detail-summary .ds-stat .ds-v small { color: var(--ok); font-weight: 600; font-size: 11px; margin-left: 2px; }

/* ---- 5.3 左侧小结标题（机体备注 / 机体属性 / 地形适性） ---- */
.detail-summary .ds-sec {
  margin: 18px 0 8px;
  font-size: 12.5px;
  color: var(--accent2);
  letter-spacing: .05em;
}
#unit-wfx-wrap { margin-bottom: 2px; }
#unit-wfx-wrap .ds-sec { margin-bottom: 6px; }

/* 5.3a 左侧属性区控件紧凑化 + 达成条件开关 */
.detail-summary .star-bar {
  gap: 5px;
  margin-bottom: 8px;
}
.detail-summary .star-label { font-size: 12px; margin-right: 2px; }
.detail-summary .form-btn, .detail-summary .star-btn { padding: 4px 9px; font-size: 12px; }
.cond-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 6px;
  margin: 2px 0 10px;
}
.cond-row .tags { margin: 0; }
.cond-chip { cursor: pointer; }
.cond-chip:hover { border-color: var(--accent2); color: var(--accent2); }
.cond-chip.on { border-color: var(--accent); color: var(--accent2); background: rgba(230, 69, 60, 0.14); }

/* ---- 5.4 右侧内容区（无 tab，区块顺序堆叠） ---- */
.detail-content {
  padding: 16px 20px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  min-width: 0;
}
.detail-content h3 { margin: 22px 0 10px; }
.detail-content > h3:first-child { margin-top: 6px; }

/* 响应式：小屏单栏 */
@media (max-width: 1023px) {
  .modal-box.modal-detail { width: 96vw; max-height: 90vh; }
  .modal-detail #modal-body { grid-template-columns: 1fr; }
  .detail-summary {
    border-right: none;
    border-bottom: 1px solid var(--outline-variant);
    max-height: none;
    position: static;
  }
}

/* ==============================================================
   Step 6 · 全局转场动效：Staggered Reveal + Tab切换 + Modal打开
   ============================================================== */

/* ---- 6.1 列表 Staggered Reveal（每行错峰淡入） ---- */
.list-row.stagger-in {
  animation: row-reveal 360ms cubic-bezier(.2,.8,.2,1) backwards;
}
@keyframes row-reveal {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- 6.2 Tab 切换淡入 ---- */
.tab.active {
  animation: tab-fade 280ms ease;
}
@keyframes tab-fade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- 6.3 Modal 打开动画（缩放 + 淡入） ---- */
.modal:not(.hidden) .modal-box {
  animation: modal-pop 280ms cubic-bezier(.2,.8,.2,1);
}
@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal:not(.hidden) {
  animation: modal-backdrop 200ms ease;
}
@keyframes modal-backdrop {
  from { background: rgba(0, 0, 0, 0); }
  to   { background: rgba(0, 0, 0, 0.65); }
}

/* reduced-motion：关闭所有转场动效 */
@media (prefers-reduced-motion: reduce) {
  .list-row.stagger-in,
  .tab.active,
  .modal:not(.hidden) .modal-box,
  .modal:not(.hidden) {
    animation: none !important;
  }
}

/* ==============================================================
   Step 7 · 伤害计算 / 配对页视觉统一：切角面板 + 分段分数条 + HUD按钮
   ============================================================== */

/* ---- 7.1 切角面板（calc-side / pair-panel / pair-result-panel） ---- */
.calc-side,
.pair-panel,
.pair-result-panel {
  clip-path: polygon(
    0 0, calc(100% - 14px) 0, 100% 14px,
    100% 100%, 14px 100%, 0 calc(100% - 14px)
  );
  position: relative;
}
.calc-side::before,
.pair-panel::before,
.pair-result-panel::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent 70%);
  opacity: 0.75;
  pointer-events: none;
}
.calc-side::after,
.pair-panel::after,
.pair-result-panel::after {
  content: "";
  position: absolute;
  bottom: 0; right: 0;
  width: 28px; height: 28px;
  background: radial-gradient(circle at 100% 100%, rgba(230, 69, 60, 0.14) 0%, transparent 60%);
  pointer-events: none;
}
/* 为切角让出 padding（避免内容被裁切） */
.calc-side { padding: 16px 18px 18px; }
.pair-panel,
.pair-result-panel { padding: 16px 20px 20px; }

/* calc-result 也加切角 + 顶部 HUD 角标 */
.calc-result {
  clip-path: polygon(
    0 0, calc(100% - 14px) 0, 100% 14px,
    100% 100%, 14px 100%, 0 calc(100% - 14px)
  );
  position: relative;
}
.calc-result::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--hud-amber), transparent 70%);
  opacity: 0.85;
  pointer-events: none;
}

/* ---- 7.2 分段分数条（替代线性 score-bar） ---- */
.seg-score-bar {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 2px;
  flex: 1;
  min-width: 120px;
  height: 8px;
}
.seg-score-bar span {
  display: block;
  background: var(--surface-variant);
  border-radius: 1.5px;
  transition: background-color 280ms ease, box-shadow 280ms ease;
}
.seg-score-bar span.on {
  background: linear-gradient(180deg, var(--accent2), #c98820);
  box-shadow: 0 0 4px rgba(245, 185, 60, 0.5);
}
.seg-score-bar.tier-s span.on   { background: linear-gradient(180deg, var(--accent-tone-70), var(--accent)); box-shadow: 0 0 5px rgba(230,69,60,0.6); }
.seg-score-bar.tier-a span.on   { background: linear-gradient(180deg, #ffd67a, var(--hud-amber)); box-shadow: 0 0 4px rgba(245,185,60,0.5); }
.seg-score-bar.tier-b span.on   { background: linear-gradient(180deg, #8ec9ff, var(--hud-blue)); box-shadow: 0 0 4px rgba(107,182,255,0.5); }
.seg-score-bar.tier-c span.on   { background: linear-gradient(180deg, #8ae4da, var(--hud-green)); box-shadow: 0 0 4px rgba(77,182,172,0.45); }
.seg-score-bar.tier-low span.on { background: var(--outline); box-shadow: none; }
.seg-score-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
  font-size: 13px;
  color: var(--muted);
}
.seg-score-label {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  color: var(--accent2);
  min-width: 48px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.seg-score-grade {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.06em;
}
.seg-score-grade.s    { background: rgba(230,69,60,0.2);  color: var(--accent); }
.seg-score-grade.a    { background: rgba(245,185,60,0.2); color: var(--accent2); }
.seg-score-grade.b    { background: rgba(107,182,255,0.2); color: var(--hud-blue); }
.seg-score-grade.c    { background: rgba(77,182,172,0.2); color: var(--hud-green); }
.seg-score-grade.low { background: var(--surface-variant); color: var(--muted); }

/* ---- 7.3 HUD 按钮（pick-btn / 主操作）战术终端风格 ---- */
.calc-side .pick-btn,
#pair-select-unit,
#pair-select-weapon,
#pair-select-uskill,
#pair-enemy-default,
#pair-enemy-tags-btn,
#pair-match,
#d-calc,
.cond-btn,
.effect-chip {
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 100ms ease, filter 160ms ease;
}
.calc-side .pick-btn:hover,
#pair-select-unit:hover,
#pair-select-weapon:hover,
#pair-match:not(:disabled):hover,
#d-calc:hover {
  border-color: var(--accent2);
  color: var(--accent2);
  filter: brightness(1.06);
}
.calc-side .pick-btn:active,
#d-calc:active {
  transform: translateY(1px);
  filter: brightness(0.96);
}
#d-calc,
#pair-match:not(:disabled) {
  background: linear-gradient(135deg, var(--accent-tone-30), var(--accent));
  border: 1px solid var(--accent-tone-40);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 8px rgba(230, 69, 60, 0.3);
}
#d-calc:hover,
#pair-match:not(:disabled):hover {
  filter: brightness(1.08);
  box-shadow: 0 4px 14px rgba(230, 69, 60, 0.4);
}

/* pair-result-panel 表格优化 */
.pair-result-panel table { font-size: 13px; }
.pair-result-panel th,
.pair-result-panel td { padding: 8px 10px; }
.pair-result-panel .pair-pilot {
  cursor: pointer;
  transition: background-color 160ms ease;
}
.pair-result-panel .pair-pilot:hover {
  background: linear-gradient(90deg, rgba(230, 69, 60, 0.06), transparent 80%);
}

/* damage-final 升级（切角 + HUD 角标） */
.damage-final {
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  position: relative;
}
.damage-final::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: linear-gradient(180deg, var(--accent), var(--accent-tone-70));
  opacity: 0.85;
}
.damage-final b {
  font-family: var(--font-display);
  letter-spacing: 0.01em;
  text-shadow: 0 0 12px rgba(245, 185, 60, 0.4);
}

/* reduced-motion：关闭分段条过渡 */
@media (prefers-reduced-motion: reduce) {
  .seg-score-bar span { transition: none; }
  .calc-side::before, .pair-panel::before, .pair-result-panel::before,
  .calc-result::before, .damage-final::before { opacity: 0.6; }
}

/* ==============================================================
   组队页
   ============================================================== */
.team-toolbar { flex-wrap: wrap; align-items: center; }
.team-custom-field { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.team-custom-field input { width: 80px; }
.team-custom-wrap { display: inline-flex; gap: 8px; align-items: center; }

.team-bench-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-bottom: 12px; padding: 8px 10px;
  background: var(--panel, #182030); border: 1px solid var(--border, #2a3344);
  border-radius: 8px;
}
.team-bench-bar .muted { font-size: 12px; margin-right: 4px; }

.team-row { margin-bottom: 16px; }
.team-row-head {
  display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
  flex-wrap: wrap;
}
.team-title { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--text); letter-spacing: 0.03em; }
.team-row-head .muted { font-size: 12px; }
.team-remove { margin-left: auto; }

.team-grid {
  display: grid;
  grid-template-columns: minmax(150px, 1.1fr) repeat(5, minmax(140px, 1fr));
  grid-template-rows: auto auto;
  gap: 8px;
  align-items: stretch;
}

.team-card {
  position: relative;
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  min-height: 96px;
  transition: border-color 140ms ease, background-color 140ms ease;
}
.team-card:hover { border-color: var(--accent2); }
.team-supporter-card { grid-row: 1 / span 2; }
.team-unit-card { grid-row: 1; }
.team-pilot-card { grid-row: 2; }

.team-card-name { font-weight: 600; font-size: 13px; margin-bottom: 6px; line-height: 1.3; }
.team-card-empty {
  color: var(--muted); font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  height: 100%; min-height: 80px; text-align: center;
}

.team-card-ctl { margin-bottom: 6px; }
.team-card-ctl label { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.team-card-ctl select {
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  color: var(--text); padding: 2px 4px; font-size: 12px; cursor: pointer;
}

.team-card-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px 8px; }
.team-stat { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; font-size: 12px; color: var(--muted); }
.team-stat b { color: var(--text); font-family: var(--font-mono); font-size: 12px; }

.team-weapon { margin-top: 6px; font-size: 12px; color: var(--accent2); }
.team-weapon-btn {
  margin-top: 6px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 6px; color: var(--muted); padding: 3px 8px; font-size: 12px; cursor: pointer;
}
.team-weapon-btn:hover { border-color: var(--accent); color: var(--text); }

.team-conds { margin-top: 8px; font-size: 11px; color: var(--muted); line-height: 1.5; }
.team-skills { margin-top: 6px; display: flex; flex-direction: column; gap: 2px; }
.team-skill { font-size: 11px; color: var(--accent2); line-height: 1.4; }
.team-applied {
  position: absolute; top: 6px; right: 8px; color: var(--accent2);
  font-size: 12px; font-weight: 700;
}

/* ---------- 机体 / 驾驶员「类型」视觉语言 ----------
   三型各有一枚色彩身份：攻击型=红、耐久型=蓝、支援型=绿。
   卡片用「左侧色条 + 顶部色晕」表达，选择器列表用色条，徽标同色系。 */
.team-card[data-role]::before {
  content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--role-c, transparent);
}
.team-card[data-role="1"] { --role-c: var(--type-atk); --role-bg: var(--type-atk-soft); }
.team-card[data-role="2"] { --role-c: var(--type-tank); --role-bg: var(--type-tank-soft); }
.team-card[data-role="3"] { --role-c: var(--type-sup); --role-bg: var(--type-sup-soft); }
.team-card[data-role="0"] { --role-c: var(--type-unknown); --role-bg: var(--type-unknown-soft); }
.team-unit-card[data-role], .team-pilot-card[data-role] {
  background: linear-gradient(180deg, var(--role-bg), transparent 52%), var(--panel2);
  padding-left: 13px;
}

.team-card-type { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; flex-wrap: wrap; }
.type-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px 2px 2px; border-radius: 999px;
  font-size: 11px; font-weight: 600; line-height: 1.2; white-space: nowrap;
  color: var(--role-c, var(--muted));
  background: var(--role-bg, rgba(255, 255, 255, .04));
  border: 1px solid rgba(255, 255, 255, .07);
}
.type-chip i {
  font-style: normal; font-weight: 700; font-size: 10px;
  width: 15px; height: 15px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--role-c, var(--type-unknown)); color: #0b0f14;
}
.type-chip.t-atk { --role-c: var(--type-atk); --role-bg: var(--type-atk-soft); }
.type-chip.t-tank { --role-c: var(--type-tank); --role-bg: var(--type-tank-soft); }
.type-chip.t-sup { --role-c: var(--type-sup); --role-bg: var(--type-sup-soft); }
.type-chip.t-unknown { --role-c: var(--type-unknown); --role-bg: var(--type-unknown-soft); }

/* 组队页类型图例 */
.team-legend { display: inline-flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.team-legend span { display: inline-flex; align-items: center; gap: 4px; }
.team-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.team-legend .lg-1 { background: var(--type-atk); }
.team-legend .lg-2 { background: var(--type-tank); }
.team-legend .lg-3 { background: var(--type-sup); }

/* 历史数据中的跨队伍重复提示 */
.team-conflict {
  margin: 0 0 12px; padding: 10px 12px; border-radius: 10px;
  background: rgba(245, 185, 60, .10);
  border: 1px solid rgba(245, 185, 60, .35);
  color: #ffe0a3; font-size: 12px; line-height: 1.65;
}
.team-conflict b { color: var(--accent2); }
.team-conflict .muted { color: var(--muted); }

/* 归档数据说明：关卡 / 事件相关表自爬取范围裁剪后不再更新 */
.archived-note {
  margin: 0 0 12px; padding: 10px 12px; border-radius: 10px;
  background: var(--panel2); border: 1px dashed var(--line);
  color: var(--muted); font-size: 12px; line-height: 1.75;
}
.archived-note .arch-tag {
  display: inline-block; margin-right: 6px; padding: 1px 7px;
  border-radius: 999px; font-size: 11px; font-weight: 700;
  background: var(--type-unknown-soft);
  border: 1px solid rgba(133, 147, 166, .5);
  color: #c6d0dd;
}
.archived-note b { color: var(--text); font-weight: 600; }

/* 选择器：行内类型色条 + 屏蔽提示 */
.picker-list .picker-row[data-role] { position: relative; padding-left: 16px; }
.picker-list .picker-row[data-role]::before {
  content: ""; position: absolute; left: 0; top: 5px; bottom: 5px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--role-c, transparent);
}
.picker-list .picker-row[data-role="1"] { --role-c: var(--type-atk); }
.picker-list .picker-row[data-role="2"] { --role-c: var(--type-tank); }
.picker-list .picker-row[data-role="3"] { --role-c: var(--type-sup); }
.picker-list .picker-row[data-role="0"] { --role-c: var(--type-unknown); }
.picker-exclude-hint {
  padding: 8px 12px; font-size: 12px; color: var(--accent2);
  background: rgba(245, 185, 60, .08); border-bottom: 1px solid var(--line);
}

/* 原作关联跳转 */
.ds-canonical { margin-bottom: 8px; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ds-canonical .jump-chip { cursor: pointer; border-color: var(--accent2); color: var(--accent2); }
.ds-canonical .jump-chip:hover { background: var(--accent); color: #fff; }

/* 原作映射页 */
.map-table { width: 100%; border-collapse: collapse; }
.map-table th, .map-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
.map-table th { color: var(--muted); font-weight: 600; }
.map-name { background: none; border: none; color: var(--accent); cursor: pointer; font-size: 13px; padding: 0; }
.map-name:hover { color: var(--accent2); text-decoration: underline; }
.map-act-col { white-space: nowrap; width: 110px; }
.map-signal[data-signal="manual"] { border-color: var(--ok); color: var(--ok); }
.map-signal[data-signal="active"] { border-color: var(--accent2); color: var(--accent2); }
.map-signal[data-signal="mention"] { border-color: var(--hud-amber); color: var(--hud-amber); }
.map-signal[data-signal="role"] { color: var(--muted); }

/* ===== 队伍状态摘要（队伍卡片底部） ===== */
.team-status {
  margin-top: 12px; padding-top: 10px;
  border-top: 1px dashed var(--line);
  display: grid; gap: 8px;
}
.ts-title { font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.ts-sec {
  border-left: 3px solid var(--line); border-radius: 8px;
  background: var(--panel2); padding: 7px 10px;
}
.ts-sec.ts-atk { border-left-color: var(--type-atk); }
.ts-sec.ts-sup { border-left-color: var(--type-sup); }
.ts-sec.ts-tank { border-left-color: var(--type-tank); }
.ts-sec.ts-empty { background: transparent; border-left-style: dashed; }
.ts-sec.ts-syn { border-left-color: var(--accent); }
.ts-chip.bonus { border-color: var(--warning); color: var(--accent2); }
.ts-chip.dcut { border-color: #2b6cb0; color: #a8d4ff; background: #17324d; }
.ts-chip.mut { opacity: .6; }
.ts-tag.used { margin-left: 4px; font-size: 11px; color: #9fe8c8; }
.ts-mtype { min-width: 36px; color: var(--text); font-weight: 700; }
/* 多台攻击型时，每台一组（左侧竖线分组） */
.ts-mgroup {
  flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center;
  gap: 4px 14px; padding: 5px 0 5px 10px;
  border-left: 2px solid var(--line);
}
.ts-mgroup + .ts-mgroup { margin-top: 2px; }
.ts-mhit { font-variant-numeric: tabular-nums; }
.ts-mhit.ok { color: #9fe8c8; }
.ts-mhit.part { color: var(--accent2); }
.ts-mhit.bad { color: #ffc3bd; }
.ts-tag.best {
  margin-left: 6px; padding: 1px 6px; border-radius: 999px;
  font-size: 11px; font-weight: 400;
  border: 1px solid var(--warning); color: var(--accent2);
  background: var(--warning-container);
}
.ts-syn-bonus {
  flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center;
  gap: 4px 8px; margin-top: 4px;
}
.ts-chip.bonusall {
  max-width: 100%; white-space: normal; line-height: 1.6;
  border-color: var(--warning); color: var(--accent2); background: var(--warning-container);
}

/* ===== 协同结论 / 防御覆盖：与及格线、加分项一致的带底条块 =====
   三类语义各一种填充：达标=绿底、减分项=红底、无法判定=中性底、加分项=琥珀底 */
.ts-line {
  flex-basis: 100%; display: block;
  padding: 6px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface-variant);
  color: var(--text); font-size: 12px; line-height: 1.75;
}
.ts-line.ok {
  border-color: var(--success); background: var(--success-container); color: #9fe8c8;
}
.ts-line.bad {
  border-color: var(--error); background: var(--error-container); color: #ffc3bd;
}
.ts-line.na { color: var(--muted); }
.ts-syn-base { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 4px; }
.ts-supcounts, .ts-mechs { gap: 6px; }
.ts-chip.sup { border-color: #2f9e6e; color: #9fe8c8; background: #1d3d30; }
.ts-match .ts-mline { flex-basis: 100%; }
.ts-match .ts-mrows { flex-basis: 100%; display: grid; gap: 2px; }
.ts-mrow { display: inline-flex; align-items: center; gap: 6px; }
.ts-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 3px;
}
.ts-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--type-unknown); flex: none; }
.ts-atk .ts-dot { background: var(--type-atk); }
.ts-sup .ts-dot { background: var(--type-sup); }
.ts-tank .ts-dot { background: var(--type-tank); }
.ts-body {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 4px 14px; font-size: 12px; color: var(--muted); line-height: 1.7;
}
.ts-body.ts-none { color: var(--muted); opacity: .8; }
.ts-kv b { color: var(--text); font-weight: 700; }
.ts-kv .num { color: var(--accent); font-variant-numeric: tabular-nums; }
.ts-chip {
  display: inline-block; padding: 1px 7px; border-radius: 999px;
  font-size: 11px; border: 1px solid var(--line);
  background: var(--panel); color: var(--muted); white-space: nowrap;
}
.ts-chip.up, .ts-chip.ok { border-color: var(--success); color: #9fe8c8; background: var(--success-container); }
/* down = 敌方的负面特效标记（琥珀）；bad = 减分项/未达标（红）——
   两者语义不同，此前共用一套琥珀色会让人把"减分项"误读成"加分项" */
.ts-chip.down { border-color: var(--warning); color: var(--accent2); background: var(--warning-container); }
.ts-chip.bad { border-color: var(--error); color: #ffc3bd; background: var(--error-container); }
.ts-eff { display: inline-flex; align-items: center; gap: 6px; }
.ts-match {
  flex-basis: 100%; display: flex; align-items: center; flex-wrap: wrap;
  gap: 6px; margin-top: 4px; font-size: 12px; color: var(--muted);
}
.ts-match b { font-variant-numeric: tabular-nums; }
.ts-match.ok b { color: #9fe8c8; }
.ts-match.part b { color: var(--accent2); }
.ts-match.bad b { color: #ffb4ae; }
.ts-syns {
  flex-basis: 100%; margin: 4px 0 0; padding-left: 16px;
  display: grid; gap: 2px;
}
.ts-mechs { gap: 6px; }
.ts-chip.mech { border-color: #2b6cb0; color: #a8d4ff; background: #17324d; }
.ts-note { margin-left: 4px; }
.ts-syn.counted .ts-note { color: #9fe8c8; }
.ts-syn.impossible .ts-note { color: var(--muted); }
.ts-syn.potential .ts-note { color: var(--accent2); }
.ts-syn.counted { color: #9fe8c8; }
.ts-syn.potential { color: var(--text); }
.ts-syn.impossible { color: var(--muted); opacity: .55; }
