/* ==========================================================================
   卫戍协议 · 干员速查  —  纯 CSS，无框架，主题由 html[data-theme] 驱动
   ========================================================================== */

:root {
  --bg: #0e1014;
  --bg-soft: #13161c;
  --surface: #181c24;
  --surface-2: #1f2430;
  --border: #2a3040;
  --border-strong: #3a4356;
  --text: #e8ecf3;
  --text-dim: #a3adbe;
  --text-mute: #6c7688;
  --accent: #e0b04a;
  --accent-soft: rgba(224, 176, 74, 0.14);
  /* 「叠层核心」的描边色：比选中态的实心金浅一档 */
  --accent-line: rgba(224, 176, 74, 0.5);
  /* 速查工具坞的细边：淡淡一层金，不跟主内容抢眼 */
  --accent-faint: rgba(224, 176, 74, 0.22);
  --accent-2: #5cc8c0;
  --accent-2-soft: rgba(92, 200, 192, 0.14);
  /* 「隐秘核心」生命值：比主色更偏红，和普通生命值一眼区分 */
  --secret: #e2705f;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  --radius: 10px;
  --radius-lg: 14px;
  --maxw: 1280px;
  --font: "Segoe UI", -apple-system, "Microsoft YaHei", "PingFang SC",
    "Hiragino Sans GB", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
}

html[data-theme="light"] {
  --bg: #f2f4f7;
  --bg-soft: #e9ecf1;
  --surface: #ffffff;
  --surface-2: #f4f6fa;
  --border: #dfe4ec;
  --border-strong: #c5cddb;
  --text: #1b2230;
  --text-dim: #55617a;
  --text-mute: #8a94a8;
  --accent: #b8862f;
  --accent-soft: rgba(184, 134, 47, 0.12);
  --accent-line: rgba(184, 134, 47, 0.55);
  --accent-faint: rgba(184, 134, 47, 0.26);
  --accent-2: #2a9d95;
  --accent-2-soft: rgba(42, 157, 149, 0.12);
  --secret: #bf4430;
  --shadow: 0 6px 20px rgba(20, 30, 50, 0.10);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image:
    radial-gradient(900px 420px at 12% -10%, rgba(224, 176, 74, 0.10), transparent 65%),
    radial-gradient(760px 380px at 88% 0%, rgba(92, 200, 192, 0.08), transparent 62%);
  background-repeat: no-repeat;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }
button { font-family: inherit; font-size: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------------------------------------------------------------- topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 20px;
  background: rgba(14, 16, 20, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
html[data-theme="light"] .topbar { background: rgba(242, 244, 247, 0.85); }

.topbar .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
}
.topbar .brand:hover { text-decoration: none; }

.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: block;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(224, 176, 74, 0.55);
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(224, 176, 74, 0.3);
}
html[data-theme="light"] .brand-mark {
  border-color: rgba(169, 124, 34, 0.4);
  box-shadow: 0 2px 8px rgba(169, 124, 34, 0.18);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 15px; letter-spacing: 0.06em; }
.brand-text small { color: var(--text-mute); font-size: 11px; letter-spacing: 0.14em; }

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.btn-ghost,
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.btn-icon { width: 32px; padding: 0; }
.btn-ghost:hover,
.btn-icon:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-2);
  text-decoration: none;
}

/* ---------------------------------------------------------------- layout */

.app {
  flex: 1 1 auto;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px 20px 60px;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--text-mute);
}
.crumbs a { color: var(--text-dim); }
.crumbs .sep { color: var(--border-strong); }
.crumbs .here { color: var(--text); }

.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-mute);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.muted { color: var(--text-mute); }

/* ---------------------------------------------------------------- home */

.hero { padding: 18px 0 24px; }
.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(24px, 3.4vw, 34px);
  letter-spacing: 0.04em;
  font-weight: 700;
}
.hero h1 .accent { color: var(--accent); }
.hero p { margin: 0; color: var(--text-dim); max-width: 64ch; }
.hero p.season-source {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-mute);
  max-width: 72ch;
}

.season-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.season-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  min-height: 152px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--surface-2), var(--surface) 62%);
  color: var(--text);
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.season-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 40%, var(--accent-soft));
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.season-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
  text-decoration: none;
}
.season-card:hover::after { opacity: 1; }

.season-card.is-pending { opacity: 0.42; cursor: not-allowed; filter: grayscale(0.7); }
.season-card.is-pending:hover { transform: none; border-color: var(--border); box-shadow: none; }

.season-index { font-size: 11px; letter-spacing: 0.22em; color: var(--accent); }
.season-title { font-size: 19px; font-weight: 600; }
.season-meta { font-size: 13px; color: var(--text-mute); }
.season-cta { margin-top: auto; font-size: 13px; color: var(--accent); }

/* 期数页标题右侧的「速查工具」小坞：一格一个速查入口，横排三格（叠层手 / BOSS / 装备），
   灰底 + 一层淡金细边，比盟约卡小得多，不跟主内容抢注意力 */
.hero-with-entries {
  display: flex;
  /* 宽不够时工具坞整块换到下一行，而不是被挤出屏幕 */
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 24px;
}
.hero-with-entries .hero-text { flex: 1 1 auto; min-width: 0; }
.hero-with-entries .tool-dock { margin-left: auto; }

.tool-dock {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 9px 9px;
  border: 1px solid var(--accent-faint);
  border-radius: var(--radius);
  background: var(--surface);
}
.tool-dock-title {
  font-size: 10px;
  line-height: 1.2;
  letter-spacing: 0.18em;
  text-align: center;
  color: var(--text-mute);
}
.tool-dock-grid { display: flex; gap: 6px; }

.tool-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 54px;
  height: 54px;
  /* 灰底 + 细边框：一格小方块，比盟约卡小得多，也不抢眼 */
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--text-dim);
  text-decoration: none;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}
a.tool-tile:hover,
a.tool-tile:focus-visible {
  border-color: var(--accent-line);
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}
a.tool-tile .tool-icon { color: var(--accent); opacity: 0.78; }
a.tool-tile:hover .tool-icon,
a.tool-tile:focus-visible .tool-icon { opacity: 1; }

/* 还没做完的入口：虚线框 + 降透明度，点不动（title / aria 里写明「暂未开放」） */
.tool-tile.is-soon {
  border-style: dashed;
  opacity: 0.55;
  cursor: not-allowed;
}
.tool-icon { font-size: 14px; line-height: 1; color: var(--text-mute); }
.tool-name { font-size: 11px; line-height: 1.1; letter-spacing: 0.04em; }

/* ------------------------------------------------------------ season view */

.group-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 26px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.group-head h2 { margin: 0; font-size: 17px; letter-spacing: 0.1em; font-weight: 600; }
.group-head .count { font-size: 12px; color: var(--text-mute); }
.group-head.core h2 { color: var(--accent); }
.group-head.extra h2 { color: var(--accent-2); }

.covenant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 12px;
}

.cov-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s;
}
.cov-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  background: var(--surface-2);
  box-shadow: var(--shadow);
  text-decoration: none;
}
.cov-card.extra:hover { border-color: var(--accent-2); }

.cov-icon {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(150deg, var(--surface-2), var(--bg-soft));
  border: 1px solid var(--border-strong);
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  flex: none;
}
.cov-card.extra .cov-icon { color: var(--accent-2); }
.cov-icon img { width: 100%; height: 100%; object-fit: contain; }
/* PRTS 图标是白线稿 + 透明底，套一层圆形深色底纹才看得见（同 PRTS 模板） */
.cov-icon.has-img {
  border-radius: 50%;
  border-color: rgba(224, 176, 74, 0.55);
  background: radial-gradient(circle at 50% 42%, #8a6a24 0%, #2b2418 58%, #14100b 100%);
}
.cov-card.extra .cov-icon.has-img,
.cov-hero.extra .cov-icon.has-img {
  border-color: rgba(92, 200, 192, 0.55);
  background: radial-gradient(circle at 50% 42%, #2b8f79 0%, #1c2b2b 58%, #0e1414 100%);
}

.cov-name { font-size: 14px; font-weight: 600; letter-spacing: 0.04em; text-align: center; }
.cov-need { font-size: 11px; color: var(--text-mute); }

/* ---------------------------------------------------------- covenant view */

.cov-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(140deg, var(--surface-2), var(--surface) 70%);
}
.cov-hero .cov-icon { width: 76px; height: 76px; font-size: 28px; }
.cov-hero h1 { margin: 0; font-size: 22px; letter-spacing: 0.06em; }
.cov-hero .cov-sub { margin: 4px 0 0; font-size: 13px; color: var(--text-mute); }
.cov-hero-body { flex: 1 1 auto; min-width: 0; }
/* 返回盟约列表：hero 右侧的实心按钮（进盟约页第一眼就能看到回程） */
.cov-hero .cov-back {
  margin-left: auto;
  flex: none;
  height: 38px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
/* 手机端只留箭头 + 一个「返回」，省下宽度 */
.cov-hero .cov-back .back-arrow { margin-right: 5px; font-size: 15px; }
/* 「返回「来源盟约」」的名字可能很长：桌面版给文案一个上限，超出显示省略号（完整名字在 title 里） */
.cov-hero .cov-back .back-text {
  display: inline-block;
  max-width: 14em;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}
.cov-hero .cov-back .back-text-short { display: none; }
.cov-hero .cov-back:hover,
.cov-hero .cov-back:focus-visible {
  color: #14161c;
  background: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}
.cov-hero.extra .cov-back {
  color: var(--accent-2);
  border-color: rgba(92, 200, 192, 0.5);
  background: var(--accent-2-soft);
}
.cov-hero.extra .cov-back:hover,
.cov-hero.extra .cov-back:focus-visible {
  color: #0f1a1a;
  background: var(--accent-2);
  border-color: var(--accent-2);
}

/* 干员详情底部的返回：整行按钮，抽屉滚到最下面也一眼可见 */
.detail .detail-back {
  display: flex;
  width: 100%;
  height: 38px;
  margin-top: 2px;
  justify-content: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.detail .detail-back:hover,
.detail .detail-back:focus-visible {
  color: #14161c;
  background: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}
/* 同一颗底部按钮两种用法：桌面端回上一屏（「← 返回盟约效果」/「← 返回叠层手列表」），
   手机端（详情变底部抽屉）换成「✕ 关闭干员卡片」——点一下直接收起抽屉。
   两套文案都在 DOM 里，按屏幕宽度显示其中一套，屏幕阅读器也只会读到当前那套。 */
.detail .detail-back .close-icon,
.detail .detail-back .close-text { display: none; }

.cov-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  align-items: start;
}

/* 附加盟约（小盟约）详情页：页面里的主色按钮 / 选中态统一用盟约图标的蓝绿，
   和头图图标、右上角「返回」保持一套；核心盟约仍然用金色。 */
.cov-layout.extra .stack-toggle[aria-pressed="true"] {
  border-color: var(--accent-2);
  background: var(--accent-2-soft);
  color: var(--accent-2);
}
/* 手机 / 窄屏的「盟约效果」默认是灰按钮，这一页也提成蓝绿，和同排的叠层核心一致 */
.cov-layout.extra .sheet-btn {
  color: var(--accent-2);
  border-color: rgba(92, 200, 192, 0.5);
  background: var(--accent-2-soft);
}
.cov-layout.extra .sheet-btn:hover,
.cov-layout.extra .sheet-btn:focus-visible {
  color: #0f1a1a;
  border-color: var(--accent-2);
  background: var(--accent-2);
  text-decoration: none;
}
html[data-theme="light"] .cov-layout.extra .sheet-btn:hover,
html[data-theme="light"] .cov-layout.extra .sheet-btn:focus-visible { color: #fff; }
/* 选中的干员卡：金框金底换成蓝绿框蓝绿底（含投影） */
.cov-layout.extra .op-card[aria-pressed="true"] {
  border-color: var(--accent-2);
  background: var(--accent-2-soft);
  box-shadow: 0 0 0 1px var(--accent-2) inset, 0 6px 16px rgba(92, 200, 192, 0.18);
}
/* 叠层视图里的「核心」卡：浅金描边 / 金色名字 / 核心角标也跟着换色 */
.cov-layout.extra .op-grid.stack-view .op-card[data-stack="strong"] {
  border-color: rgba(92, 200, 192, 0.5);
}
.cov-layout.extra .op-grid.stack-view .op-card[data-stack="strong"]:hover,
.cov-layout.extra .op-grid.stack-view .op-card[data-stack="strong"][aria-pressed="true"] {
  border-color: var(--accent-2);
}
.cov-layout.extra .op-grid.stack-view .op-card[data-stack="strong"] .op-name {
  color: var(--accent-2);
}
.cov-layout.extra .op-grid.stack-view .op-card[data-stack="strong"] .op-stack-badge {
  background: var(--accent-2);
  color: #0f1a1a;
}
html[data-theme="light"] .cov-layout.extra .op-grid.stack-view .op-card[data-stack="strong"] .op-stack-badge {
  color: #fff;
}
/* 编辑态卡片底部的小方块：本页点亮的「核」和四个盟约类型也换成蓝绿 */
.cov-layout.extra .opt-sq.is-on[data-kind="strong"],
.cov-layout.extra .opt-sq.is-on[data-kind="output"],
.cov-layout.extra .opt-sq.is-on[data-kind="survival"],
.cov-layout.extra .opt-sq.is-on[data-kind="economy"],
.cov-layout.extra .opt-sq.is-on[data-kind="general"] {
  border-color: var(--accent-2);
  background: var(--accent-2);
  color: #0f1a1a;
}
html[data-theme="light"] .cov-layout.extra .opt-sq.is-on[data-kind="strong"],
html[data-theme="light"] .cov-layout.extra .opt-sq.is-on[data-kind="output"],
html[data-theme="light"] .cov-layout.extra .opt-sq.is-on[data-kind="survival"],
html[data-theme="light"] .cov-layout.extra .opt-sq.is-on[data-kind="economy"],
html[data-theme="light"] .cov-layout.extra .opt-sq.is-on[data-kind="general"] {
  color: #fff;
}
/* 抽屉里「返回叠层手列表 / 返回本盟约」那颗整行按钮 */
.cov-layout.extra .detail .detail-back {
  color: var(--accent-2);
  border-color: rgba(92, 200, 192, 0.5);
  background: var(--accent-2-soft);
}
.cov-layout.extra .detail .detail-back:hover,
.cov-layout.extra .detail .detail-back:focus-visible {
  color: #0f1a1a;
  border-color: var(--accent-2);
  background: var(--accent-2);
  text-decoration: none;
}
html[data-theme="light"] .cov-layout.extra .detail .detail-back:hover,
html[data-theme="light"] .cov-layout.extra .detail .detail-back:focus-visible { color: #fff; }
/* 小盟约页里的等阶角标、盟约效果 / 特质里的高亮文字、精锐标签也统一成蓝绿 */
.cov-layout.extra .op-tier,
.cov-layout.extra .effect-text em,
.cov-layout.extra .trait-up-label {
  color: var(--accent-2);
}
.cov-layout.extra .trait-up { border-left-color: var(--accent-2); }

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.panel-head h2 { margin: 0; font-size: 13px; letter-spacing: 0.16em; color: var(--text-dim); font-weight: 600; }
.panel-head .hint { font-size: 12px; color: var(--text-mute); }

.op-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
  padding: 14px;
}
/* 空盟约（如「绝技」没有固定成员）时，提示占满整行 */
.op-grid > .empty {
  grid-column: 1 / -1;
  padding: 24px 16px;
  background: transparent;
}

.op-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.op-card:hover { transform: translateY(-2px); border-color: var(--border-strong); background: var(--surface-2); }
.op-card[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px var(--accent) inset, 0 6px 16px rgba(224, 176, 74, 0.18);
}

.op-avatar {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  background: linear-gradient(150deg, var(--surface-2), var(--bg-soft));
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-mute);
}
.op-avatar img { width: 100%; height: 100%; object-fit: cover; }

.op-name {
  font-size: 12px;
  line-height: 1.25;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.op-tier {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: rgba(10, 12, 16, 0.78);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
}

/* 「核心叠层手」卡片左上角的推荐大拇指（主色金）：
   查看态是静态角标，编辑态是个能点的小按钮，点一下切换推荐 */
.op-pick {
  position: absolute;
  top: 4px;
  left: 4px;
  height: 22px;
  min-width: 22px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--accent);
  color: #14161c;
  cursor: default;
  /* 小卡上的角标本来只有 16px，离远一点就看不清；放大后补一层投影更跳出来 */
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.op-pick svg { width: 14px; height: 14px; display: block; fill: currentColor; }
/* 编辑态：还没标推荐时是个暗底描边的空位，点一下变实心金 */
button.op-pick {
  background: rgba(10, 12, 16, 0.78);
  border-color: var(--border-strong);
  color: var(--accent);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
button.op-pick:hover { border-color: var(--accent); }
button.op-pick[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #14161c;
}
html[data-theme="light"] button.op-pick { background: rgba(255, 255, 255, 0.92); }

/* 「核心叠层手」里标了 👍 的推荐卡：套用盟约详情页「核心叠层」卡的同款浅金描边；
   选中 / 悬停时回到实金，保持和普通卡片的选中态一致 */
.op-card.is-picked:not([aria-pressed="true"]) { border-color: var(--accent-line); }
.op-card.is-picked:not([aria-pressed="true"]):hover { border-color: var(--accent); }

/* ------------------------------------------------------------ 叠层核心 */

.panel-tools { display: flex; align-items: center; gap: 8px; min-width: 0; }
.stack-toggle { height: 26px; padding: 0 10px; font-size: 12px; white-space: nowrap; }
/* 「核心叠层手」页编辑时的「＋ 添加」 */
.stacker-add { height: 26px; padding: 0 10px; font-size: 12px; white-space: nowrap; }
/* 「盟约效果」按钮：只有手机/窄屏（详情变底部抽屉）时才出现，桌面端详情常驻右栏 */
.sheet-btn { display: none; height: 26px; padding: 0 10px; font-size: 12px; white-space: nowrap; }
.stack-toggle[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.op-stack-badge { display: none; }
.op-grid.stack-view .op-card {
  transition: transform 0.15s, opacity 0.18s, filter 0.18s,
    border-color 0.18s, background 0.18s, box-shadow 0.18s;
}
/* 没有叠层能力：压暗去色 */
.op-grid.stack-view .op-card[data-stack="none"] { opacity: 0.26; filter: grayscale(1); }
.op-grid.stack-view .op-card[data-stack="none"]:hover { opacity: 0.5; filter: grayscale(0.4); }
/* 浅色主题下压得太狠会看不见，留一点对比度 */
html[data-theme="light"] .op-grid.stack-view .op-card[data-stack="none"] { opacity: 0.42; }
html[data-theme="light"] .op-grid.stack-view .op-card[data-stack="none"]:hover { opacity: 0.6; }
/* 选中的「无叠层」卡仍然保持淡化：之前选中就取消淡化，点一下再移开鼠标会变回全亮，
   看着像能给本盟约叠层；这里只回到比未选中稍亮一点，选中态交给金色描边 + 底纹 */
.op-grid.stack-view .op-card[data-stack="none"][aria-pressed="true"] { opacity: 0.6; filter: grayscale(0.8); }
html[data-theme="light"] .op-grid.stack-view .op-card[data-stack="none"][aria-pressed="true"] { opacity: 0.66; }
.op-grid.stack-view .op-card[data-stack="none"][aria-pressed="true"]:hover { opacity: 0.78; filter: grayscale(0.35); }
html[data-theme="light"] .op-grid.stack-view .op-card[data-stack="none"][aria-pressed="true"]:hover { opacity: 0.82; filter: grayscale(0.35); }
/* 有一点叠层能力：正常显示 */
/* 叠层能力特别强：浅金描边 + 金色名字 + 左上角「核心」角标。
   描边用半透明金（--accent-line），比「选中」态的实金描边浅一档，
   这样选中时金框明显更亮，不会被误认成「只是核心」 */
.op-grid.stack-view .op-card[data-stack="strong"] {
  border-color: var(--accent-line);
}
.op-grid.stack-view .op-card[data-stack="strong"]:hover { border-color: var(--accent); }
/* 选中的核心卡回到实金描边 + 底纹，和其余卡片的选中态一致 */
.op-grid.stack-view .op-card[data-stack="strong"][aria-pressed="true"] {
  border-color: var(--accent);
}
.op-grid.stack-view .op-card[data-stack="strong"] .op-name {
  color: var(--accent);
  font-weight: 600;
}
.op-grid.stack-view .op-card[data-stack="strong"] .op-stack-badge {
  display: grid;
  place-items: center;
  position: absolute;
  top: 4px;
  left: 4px;
  height: 16px;
  padding: 0 4px;
  border-radius: 4px;
  background: var(--accent);
  color: #14161c;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ---------------------------------------------------------- 核心叠层手 */

/* 头图上的「◈」标记：套用盟约图标的圆形底纹 */
.stacker-hero .stacker-icon {
  border-radius: 50%;
  border-color: var(--accent-line);
  background: radial-gradient(circle at 50% 42%, #8a6a24 0%, #2b2418 58%, #14100b 100%);
  color: var(--accent);
  font-size: 30px;
}

/* 两级筛选：第一级盟约类型，第二级等阶（没有成员的等阶不渲染） */
.stacker-filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 14px;
}
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.filter-label {
  margin-right: 2px;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--text-mute);
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.filter-chip:hover { color: var(--text); border-color: var(--accent-line); }
.filter-chip[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.filter-count { font-size: 10px; color: var(--text-mute); }
.filter-chip[aria-pressed="true"] .filter-count { color: var(--accent); }

/* ------------------------------------------------------------ 体系核心 */

/* 推荐体系卡片：干员头部 + 会点亮的盟约 + 攻略备注 + 推荐搭配 */
.system-op { position: relative; }
.system-badge {
  margin-left: auto;
  flex: none;
  padding: 2px 8px;
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.system-block { display: flex; flex-direction: column; gap: 8px; }

.system-covs { display: flex; flex-wrap: wrap; gap: 8px; }
.system-cov {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 44px;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.system-cov.is-active { opacity: 1; }
.system-cov-icon {
  width: 28px;
  height: 28px;
  font-size: 14px;
}
.system-cov.is-active .system-cov-icon { border-color: var(--accent); }
.system-cov-name {
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  font-size: 10px;
  line-height: 1.3;
  color: var(--text-mute);
}
.system-cov.is-active .system-cov-name { color: var(--accent); }

.system-note {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent-line);
  border-radius: 0 8px 8px 0;
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.system-note em { font-style: normal; color: var(--accent); }
.system-note-input {
  width: 100%;
  min-height: 104px;
  padding: 9px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.65;
  resize: vertical;
}
.system-note-input::placeholder { color: var(--text-mute); }
.system-note-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.system-note-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 10.5px;
  color: var(--text-mute);
}
.system-view-op {
  align-self: flex-start;
  height: 28px;
  padding: 0 12px;
  font-size: 12px;
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.system-view-op:hover { border-color: var(--accent); background: var(--accent); color: #14161c; }

/* 一位体系核心可以挂多套体系：第一行是体系切换标签 */
.system-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.system-tab {
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.system-tab:hover { color: var(--text); border-color: var(--accent-line); }
.system-tab.is-on {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
.system-tab.is-add {
  border-style: dashed;
  color: var(--text-mute);
  background: transparent;
}
.system-tab.is-add:hover { color: var(--accent); border-color: var(--accent-line); }

.system-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.system-tools .btn-ghost { height: 26px; padding: 0 10px; font-size: 12px; }
.system-tools .btn-ghost.danger:hover { color: var(--secret); border-color: var(--secret); }
.system-add-system {
  align-self: flex-start;
  height: 28px;
  padding: 0 12px;
  font-size: 12px;
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.system-add-system:hover { border-color: var(--accent); background: var(--accent); color: #14161c; }

/* 编辑态的体系核心卡没有底部小方块，不留那块空白 */
.stacker-card.is-editing { padding-bottom: 8px; }

/* 推荐搭配里的「任意灵巧」这类盟约占位：虚线边 + 通用图标 */
.pair-chip.cov.placeholder { border-style: dashed; background: transparent; }
.pair-chip.cov.placeholder .pair-name { color: var(--text-dim); }
.pair-chip.cov.placeholder .pair-icon.has-img {
  border-color: rgba(164, 176, 194, 0.55);
  background: radial-gradient(circle at 50% 42%, #4a5262 0%, #242a34 58%, #14171d 100%);
}

/* ------------------------------------------------- 干员卡片弹层（体系核心） */

.op-card-mask {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(6, 8, 12, 0.62);
  backdrop-filter: blur(2px);
}
html[data-theme="light"] .op-card-mask { background: rgba(20, 30, 50, 0.35); }
body.op-card-open { overflow: hidden; }

.op-card-dialog {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 520px;
  max-height: 86vh;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.op-card-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.op-card-dialog-head h3 { margin: 0; font-size: 15px; letter-spacing: 0.04em; }
.op-card-dialog-head p { margin: 2px 0 0; font-size: 11px; color: var(--text-mute); }
.op-card-dialog-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.op-card-dialog-body .detail-op .op-avatar { width: 56px; height: 56px; }
.op-card-dialog-body > .effect-block + .pair-ops { margin-top: 2px; }

@media (max-width: 560px) {
  .op-card-mask { padding: 8px; }
  .op-card-dialog { max-height: 92vh; }
  .op-card-dialog-head { padding: 10px 12px; }
  .op-card-dialog-body { padding: 12px 12px 16px; }
  .system-view-op { align-self: stretch; text-align: center; }
}

/* ------------------------------------------------------- BOSS / 敌人速查 */

/* 头图上的「✦ / ⌖」：沿用核心叠层手那枚圆形底纹，只换中间的图形 */
.boss-hero .boss-icon,
.enemy-hero .enemy-icon {
  border-radius: 50%;
  border-color: var(--accent-line);
  background: radial-gradient(circle at 50% 42%, #8a6a24 0%, #2b2418 58%, #14100b 100%);
  color: var(--accent);
  font-size: 30px;
}

.boss-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  align-items: start;
}

.boss-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.boss-head { display: flex; align-items: center; gap: 10px; }
.boss-avatar { width: 52px; height: 52px; flex: none; border-radius: 10px; }
.boss-avatar img { width: 100%; height: 100%; object-fit: contain; }
.boss-title { flex: 1 1 auto; min-width: 0; }
.boss-title h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: 0.02em; }
.boss-title p {
  margin: 3px 0 0;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--text-mute);
  /* 摘要行「标准模拟 … · 终极模拟 … · 隐秘核心 …」在窄卡里放不下就折两行；
     每一段自己不断行（nowrap），只在「·」处折，避免「684万」被拆成两行 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.boss-sub-item { white-space: nowrap; }
.boss-sub-sep { margin: 0 4px; color: var(--text-mute); }

/* 卡片右上角的 PRTS 出口：细金边的胶囊，不跟生命值表格抢眼 */
.boss-link {
  flex: none;
  align-self: center;
  padding: 2px 9px;
  border: 1px solid var(--accent-faint);
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.5;
  white-space: nowrap;
  color: var(--accent);
}
.boss-link:hover,
.boss-link:focus-visible {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  text-decoration: none;
}

.boss-hp {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.boss-hp th,
.boss-hp td { padding: 4px 6px; border-bottom: 1px solid var(--border); }
.boss-hp thead th {
  padding-top: 0;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-mute);
}
.boss-hp thead th:first-child,
.boss-hp tbody th { text-align: left; }
.boss-hp thead th:not(:first-child),
.boss-hp tbody td { text-align: right; }
.boss-hp tbody th { font-weight: 400; color: var(--text-dim); white-space: nowrap; }
.boss-hp tbody tr:last-child th,
.boss-hp tbody tr:last-child td { border-bottom: 0; }
.boss-hp-none { color: var(--text-mute); }
/* 隐秘核心：PRTS 原文用红字标，这里也偏红 */
.boss-secret { color: var(--secret); font-weight: 600; }
/* 极速模拟那一行（在折叠区里）用主色提一下 */
.boss-hp tbody tr.boss-fast th,
.boss-hp tbody tr.boss-fast td { color: var(--accent); }

.boss-levels { border-top: 1px dashed var(--border); padding-top: 8px; }
.boss-levels summary {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
  list-style: none;
}
.boss-levels summary::-webkit-details-marker { display: none; }
.boss-levels summary::before { content: "▸"; font-size: 10px; color: var(--text-mute); }
.boss-levels[open] summary { color: var(--accent); }
.boss-levels[open] summary::before { content: "▾"; color: var(--accent); }
/* 20 级一张长表：自己在框里滚，别把卡片撑成一条 */
.boss-levels-body {
  max-height: 232px;
  margin-top: 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* 敌人：按分组铺开的小头像一个一个，点一下跳 PRTS 敌方页面 */
.enemy-group { margin-bottom: 16px; }
.enemy-head h2 { display: flex; align-items: center; gap: 6px; }
.enemy-group-icon { width: 22px; height: 22px; object-fit: contain; }
.enemy-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.enemy-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 76px;
  padding: 6px 4px 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  color: var(--text);
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
.enemy-card:hover,
.enemy-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--accent-line);
  background: var(--surface-2);
  text-decoration: none;
}
.enemy-avatar { width: 100%; border-radius: 8px; font-size: 16px; }
.enemy-avatar img { object-fit: contain; }
.enemy-name {
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  max-width: 100%;
  /* 名字大多 5–9 个字，一行放不下就折两行再省略（悬停 / 长按有完整名字） */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.enemy-filters { margin-bottom: 14px; }
.enemy-search {
  height: 26px;
  width: 190px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
}
.enemy-search::placeholder { color: var(--text-mute); }
.enemy-search:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-2);
}
.enemy-source { margin: 14px 0 0; font-size: 11.5px; color: var(--text-mute); }


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

.detail {
  position: sticky;
  top: 74px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}
.detail h2 { margin: 0 0 2px; font-size: 13px; letter-spacing: 0.16em; color: var(--text-dim); font-weight: 600; }

.detail-op { display: flex; align-items: center; gap: 12px; }
.detail-op .op-avatar { width: 64px; height: 64px; flex: none; aspect-ratio: auto; }
.detail-op .name { font-size: 18px; font-weight: 600; line-height: 1.2; }
.detail-op .meta { font-size: 12px; color: var(--text-mute); }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 11px;
  letter-spacing: 0.04em;
}
.chip.core { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.chip.extra { border-color: var(--accent-2); color: var(--accent-2); background: var(--accent-2-soft); }

.effect-block { display: flex; flex-direction: column; gap: 8px; }
.effect-label { font-size: 11px; letter-spacing: 0.18em; color: var(--text-mute); }
.effect-text {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.effect-text em { font-style: normal; color: var(--accent); }
.effect-text .bonus {
  display: block;
  margin-top: 8px;
  padding: 8px 10px;
  border-left: 2px solid var(--accent-2);
  background: var(--accent-2-soft);
  border-radius: 0 8px 8px 0;
  color: var(--text-dim);
  font-size: 13px;
}

/* 精锐（升级后）特质 */
.trait-up {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: var(--surface-2);
}
.trait-up-label {
  display: inline-block;
  margin-bottom: 2px;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--accent);
}
.trait-up .effect-text { font-size: 13px; color: var(--text-dim); }

.detail-empty { color: var(--text-mute); font-size: 13px; }

/* ------------------------------------------------------------ 攻略选择 */

.page-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: -6px 0 12px;
}
.page-tools-hint { font-size: 12px; color: var(--text-mute); }
.page-tools-hint b { color: var(--text); font-weight: 600; }
.guide-toggle { height: 28px; padding: 0 11px; font-size: 12px; white-space: nowrap; }

/* 顶栏入口（#guide-entry，宽屏才有）：默认 hidden，由 js/app.js 在「期数 / 盟约」页打开。
   .btn-ghost 自带 display，会盖掉 [hidden] 的默认样式，所以这里补一条。 */
#guide-entry[hidden] { display: none; }
#guide-entry[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

/* 桌面端用顶栏那个入口就够了，页面里这颗按钮不再重复显示（只留左边的指引文字） */
@media (min-width: 561px) {
  .page-tools .guide-toggle { display: none; }
}
.guide-toggle[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.guide-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px dashed var(--accent-line);
  border-radius: var(--radius);
  background: var(--accent-soft);
}
.guide-badge {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #14161c;
  font-size: 11px;
  font-weight: 700;
}
.guide-state { font-size: 12px; color: var(--text-dim); }
.guide-bar .guide-current-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.guide-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.guide-actions .btn-ghost { height: 26px; padding: 0 10px; font-size: 12px; background: var(--surface); }
.guide-actions .btn-ghost[disabled] { opacity: 0.45; cursor: not-allowed; }
.guide-tip { flex: 1 1 100%; margin: 0; font-size: 12px; line-height: 1.6; color: var(--text-dim); }
.guide-tip b { color: var(--text); font-weight: 600; }
.guide-tip code { font-size: 11px; padding: 1px 4px; border-radius: 4px; background: var(--surface-2); }

/* ---- 攻略选择弹层：预设 + 我的攻略，点一行直接切换 ---- */

.guide-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(6, 8, 12, 0.62);
  backdrop-filter: blur(2px);
}
html[data-theme="light"] .guide-mask { background: rgba(20, 30, 50, 0.35); }
body.guide-open { overflow: hidden; }

.guide-dialog {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 720px;
  max-height: 86vh;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.guide-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}
.guide-dialog-head h3 {
  margin: 0 0 3px;
  font-size: 16px;
  letter-spacing: 0.04em;
}
.guide-dialog-head p {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-mute);
}
.guide-dialog-head code {
  font-size: 11px;
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text-dim);
}

.guide-scroll {
  padding: 4px 16px 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.guide-section + .guide-section { margin-top: 14px; }
.guide-section h4 {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 8px 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--text-mute);
}
.guide-section h4 span {
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--text-mute);
  opacity: 0.78;
}

.guide-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
}
.guide-row + .guide-row { margin-top: 6px; }
.guide-pick {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg-soft);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.guide-pick:hover { border-color: var(--border-strong); background: var(--surface-2); }
.guide-row.is-active .guide-pick {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.guide-kind {
  width: 26px;
  height: 26px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}
.guide-kind.local { color: var(--accent-2); }
.guide-main { display: flex; flex-direction: column; min-width: 0; }
.guide-name {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.guide-meta {
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-mute);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.guide-active-badge {
  margin-left: auto;
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #14161c;
  font-size: 10px;
  font-weight: 700;
}
.guide-row-tools {
  display: flex;
  flex-direction: row;
  gap: 4px;
  flex: none;
}
.guide-tool {
  width: 30px;
  min-height: 30px;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.guide-tool:hover { border-color: var(--border-strong); color: var(--text); }
.guide-tool.danger:hover { color: var(--secret); border-color: var(--secret); }
.guide-empty {
  margin: 4px 0;
  padding: 14px 12px;
  border: 1px dashed var(--border-strong);
  border-radius: 9px;
  color: var(--text-mute);
  font-size: 12px;
  text-align: center;
}

.guide-dialog-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
}
.guide-foot-left,
.guide-foot-right { display: flex; flex-wrap: wrap; gap: 6px; }
.guide-dialog-foot .btn-ghost {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  background: var(--surface);
}
.guide-dialog-foot .btn-ghost.primary {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

@media (max-width: 560px) {
  .guide-mask { padding: 8px; }
  .guide-dialog { max-height: 92vh; }
  .guide-dialog-head { padding: 10px 12px 8px; }
  .guide-dialog-head h3 { font-size: 15px; }
  .guide-scroll { padding: 2px 12px 12px; }
  .guide-dialog-foot { padding: 8px 12px; }
  .guide-foot-left,
  .guide-foot-right { width: 100%; }
  .guide-dialog-foot .btn-ghost { flex: 1 1 auto; }
  .guide-row-tools { flex-direction: row; }
  .guide-tool { width: 28px; }
}

/* 推荐搭配：小图标 / 小头像 + 名字；没内容时整块不占位 */
.pair-covs,
.pair-ops {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.pair-covs { margin-top: 8px; }
.pair-ops { margin-top: 2px; }
.pair-covs:empty,
.pair-ops:empty { display: none; }
.pair-label { font-size: 10px; letter-spacing: 0.16em; color: var(--text-mute); }
.pair-empty { font-size: 11px; color: var(--text-mute); }

.pair-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.pair-chip.cov.core { border-color: var(--accent-line); background: var(--accent-soft); }
.pair-chip.cov.extra { border-color: rgba(92, 200, 192, 0.5); background: var(--accent-2-soft); }

.pair-main {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px 2px 2px;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.5;
  cursor: pointer;
  text-decoration: none;
}
.pair-main:hover { color: var(--text); text-decoration: none; }
.pair-chip.cov.core .pair-main { color: var(--accent); }
.pair-chip.cov.extra .pair-main { color: var(--accent-2); }
.pair-name { max-width: 7em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pair-avatar,
.pair-icon {
  width: 18px;
  height: 18px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-soft);
  font-size: 9px;
  font-weight: 700;
  color: var(--text-mute);
}
.pair-avatar img,
.pair-icon img { width: 100%; height: 100%; object-fit: cover; }
.pair-icon img { object-fit: contain; }
.pair-icon.has-img {
  border: 1px solid var(--accent-line);
  background: radial-gradient(circle at 50% 42%, #8a6a24 0%, #2b2418 58%, #14100b 100%);
}
.pair-chip.cov.extra .pair-icon.has-img {
  border-color: rgba(92, 200, 192, 0.55);
  background: radial-gradient(circle at 50% 42%, #2b8f79 0%, #1c2b2b 58%, #0e1414 100%);
}

.pair-del {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-right: 2px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-mute);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.pair-del:hover { background: rgba(255, 120, 120, 0.16); color: #ff9b9b; }

.pair-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border: 1px dashed var(--border-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--text-mute);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.pair-add:hover { border-color: var(--accent); color: var(--accent); }

/* 编辑态干员卡：底部一排小方块，点哪个就是哪个
   （核心 / 可叠 / 不叠 是单选；核心叠层手页的 输 / 生 / 经 / 通 可以多选，
   每颗自己开合，挂几个类型就亮几颗） */
.op-card.is-editing { padding-bottom: 24px; cursor: pointer; }
.op-card.is-editing .op-stack-badge { display: none; }
.opt-row {
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: 3px;
  display: flex;
  gap: 2px;
}
.opt-sq {
  flex: 1 1 0;
  min-width: 0;
  height: 16px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px dashed var(--border-strong);
  border-radius: 3px;
  background: rgba(10, 12, 16, 0.78);
  color: var(--text-mute);
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  cursor: pointer;
}
.opt-sq:hover { border-color: var(--accent-line); color: var(--text); }
html[data-theme="light"] .opt-sq { background: rgba(255, 255, 255, 0.92); }
/* 选中那一块：叠层判定沿用三色（核金 / 可青 / 不灰）；盟约类型（输 / 生 / 经 / 通）
   点亮后统一用页面主色（金），不再各配一色——只看「亮没亮」 */
.opt-sq.is-on { border-style: solid; }
.opt-sq.is-on[data-kind="strong"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #14161c;
}
.opt-sq.is-on[data-kind="some"] {
  border-color: var(--accent-2);
  background: var(--accent-2-soft);
  color: var(--accent-2);
}
.opt-sq.is-on[data-kind="none"] {
  border-color: var(--text-mute);
  background: var(--surface-2);
  color: var(--text);
}
.opt-sq.is-on[data-kind="output"],
.opt-sq.is-on[data-kind="survival"],
.opt-sq.is-on[data-kind="economy"],
.opt-sq.is-on[data-kind="general"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #14161c;
}
html[data-theme="light"] .opt-sq.is-on[data-kind="strong"],
html[data-theme="light"] .opt-sq.is-on[data-kind="output"],
html[data-theme="light"] .opt-sq.is-on[data-kind="survival"],
html[data-theme="light"] .opt-sq.is-on[data-kind="economy"],
html[data-theme="light"] .opt-sq.is-on[data-kind="general"] {
  background: var(--accent);
  color: #fff;
}
/* 编辑时「不叠」的卡别压得太暗，底部的方块还要看得见 */
.op-grid.stack-view.is-editing .op-card[data-stack="none"] { opacity: 0.62; }
.op-grid.stack-view.is-editing .op-card[data-stack="none"]:hover { opacity: 0.82; }

/* 详情里的盟约类型选择：只在编辑态出现，查看时和普通干员特质一样。
   编辑态一颗颗按钮可以多选（至少留一颗）；查看态用同款样式的 span 列出来。 */
.type-editor { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.type-editor-label {
  width: 100%;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--text-mute);
}
.type-opt {
  height: 24px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
}
.type-opt:hover { color: var(--text); border-color: var(--accent-line); }
/* 点亮的类型统一用页面主色金（输出 / 生存 / 经济 / 通用不再各配一色） */
.type-opt.is-on {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}
/* 查看态的类型标签是 span：外观一致，只是点不动 */
.type-editor span.type-opt { cursor: default; }

/* --------------------------------------------------------------- picker */

.picker-mask {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(6, 8, 12, 0.62);
  backdrop-filter: blur(2px);
}
html[data-theme="light"] .picker-mask { background: rgba(20, 30, 50, 0.35); }
body.picker-open { overflow: hidden; }

.picker {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  max-height: 82vh;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.picker-head h3 { margin: 0; font-size: 15px; letter-spacing: 0.04em; }
.picker-close {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-dim);
  cursor: pointer;
}
.picker-close:hover { border-color: var(--border-strong); color: var(--text); }
.picker-hint { margin: 0; padding: 8px 14px 0; font-size: 12px; color: var(--text-mute); }
.picker-filter {
  margin: 10px 14px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
}
.picker-filter:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.picker-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
  padding: 0 14px 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.pick-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.pick-item:hover { border-color: var(--border-strong); background: var(--surface-2); }
.pick-item.is-on { border-color: var(--accent); background: var(--accent-soft); }
.pick-item.is-hidden { display: none; }
.pick-icon,
.pick-avatar {
  width: 26px;
  height: 26px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-2);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-mute);
}
.pick-icon img,
.pick-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pick-icon img { object-fit: contain; }
.pick-icon.has-img {
  background: radial-gradient(circle at 50% 42%, #8a6a24 0%, #2b2418 58%, #14100b 100%);
}
.pick-text { display: flex; flex-direction: column; min-width: 0; }
.pick-name { font-size: 13px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-sub { font-size: 10.5px; color: var(--text-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-check { margin-left: auto; font-size: 12px; color: var(--accent); opacity: 0; }
.pick-item.is-on .pick-check { opacity: 1; }

.picker-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.picker-count { font-size: 12px; color: var(--text-dim); }

/* ---------------------------------------------------------------- toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 90;
  transform: translate(-50%, 8px);
  max-width: min(92vw, 460px);
  padding: 9px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12.5px;
  box-shadow: var(--shadow);
  opacity: 0;
  animation: toast-in 0.18s ease forwards;
  pointer-events: none;
}
.toast.is-out { animation: toast-out 0.4s ease forwards; }
@keyframes toast-in { to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, -6px); } }

@media (max-width: 980px) {
  .cov-layout { grid-template-columns: minmax(0, 1fr); }

  /* 手机 / 窄屏：干员特质与盟约效果改成「底部抽屉」。
     点头像直接从底部滑出，不用先滚到页面最下面再滚回来；
     抽屉内部自己滚动（overscroll-behavior 防止滚动传到页面） */
  .detail {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    max-width: 760px;
    max-height: 62vh;
    margin: 0 auto;
    padding: 8px 14px calc(14px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border-strong);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    background: var(--surface);
    box-shadow: 0 -16px 36px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    visibility: hidden;
    transform: translateY(104%);
    transition: transform 0.24s ease, visibility 0.24s;
  }
  html[data-theme="light"] .detail { box-shadow: 0 -12px 30px rgba(20, 30, 50, 0.18); }
  /* 顶部小横条：暗示可以点外面收起 */
  .detail::before {
    content: "";
    align-self: center;
    flex: none;
    width: 36px;
    height: 4px;
    margin: 0 0 4px;
    border-radius: 2px;
    background: var(--border-strong);
  }
  .detail.is-open { visibility: visible; transform: translateY(0); }
  body.sheet-open { overflow: hidden; }
  .sheet-btn { display: inline-flex; }

  /* 抽屉里干员详情底部的整行按钮：不写「返回盟约效果」，直接是「关闭干员卡片」（点一下收起抽屉） */
  .detail .detail-back .back-arrow,
  .detail .detail-back .back-text { display: none; }
  .detail .detail-back .close-icon,
  .detail .detail-back .close-text { display: inline; }
  .detail .detail-back .close-icon { font-size: 12px; }
}

/* ---------------- 小屏（手机）：整体瘦身，一屏看更多、少上下滑 ---------------- */
@media (max-width: 560px) {
  .app { padding: 10px 10px 28px; }

  /* 顶栏 54px → 约 38px：常驻的横幅越矮，能看的正文越多 */
  .topbar { padding: 5px 12px; gap: 10px; }
  .brand-mark { width: 26px; height: 26px; border-radius: 8px; }
  .brand-text strong { font-size: 13px; letter-spacing: 0.02em; }
  .brand-text small { display: none; }
  .topbar-actions { gap: 6px; }
  .btn-ghost,
  .btn-icon { height: 28px; padding: 0 9px; font-size: 12px; }
  .btn-icon { width: 28px; padding: 0; }

  .crumbs { margin-bottom: 8px; font-size: 11px; gap: 4px; }

  .hero { padding: 6px 0 10px; }
  .hero h1 { font-size: 21px; margin-bottom: 4px; }
  .hero p { font-size: 12.5px; line-height: 1.55; }
  .hero p.season-source { display: none; }

  .season-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 10px; }
  .season-card { min-height: 0; padding: 13px 14px; gap: 3px; }
  .season-title { font-size: 17px; }
  .season-meta { font-size: 12px; }
  .season-cta { font-size: 12px; }

  .group-head { margin: 14px 0 8px; padding-bottom: 5px; gap: 8px; }
  .group-head h2 { font-size: 15px; }
  .group-head .count { font-size: 11px; }

  .covenant-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; }
  .cov-card { padding: 9px 5px 7px; gap: 5px; border-radius: 8px; }
  .cov-icon { width: 44px; height: 44px; font-size: 18px; border-radius: 8px; }
  .cov-icon.has-img { border-radius: 50%; }
  .cov-name { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
  .cov-need { font-size: 10px; }

  /* 盟约头图：图标 + 名字 + 返回键塞进一行（原来返回键独占 44px 高的一行） */
  .cov-hero { flex-wrap: nowrap; gap: 10px; padding: 9px 10px; margin-bottom: 10px; border-radius: var(--radius); }
  .cov-hero > div { min-width: 0; }
  .cov-hero .cov-icon { width: 42px; height: 42px; font-size: 17px; }
  .cov-hero h1 { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cov-hero .cov-sub {
    margin-top: 2px;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .cov-hero .cov-back { margin-left: auto; height: 26px; padding: 0 8px; font-size: 11px; }
  .cov-hero .cov-back .back-text { display: none; }
  .cov-hero .cov-back .back-text-short { display: inline; }
  .cov-hero .cov-back .back-arrow { margin-right: 4px; font-size: 13px; }

  /* 干员卡：76px → 64px，360px 宽的屏幕从 3 列变 4 列 */
  .panel-head { padding: 7px 10px; gap: 8px; }
  .panel-head h2 { font-size: 12px; letter-spacing: 0.12em; }
  .panel-head .hint { display: none; }
  .panel-tools { gap: 6px; }
  .stack-toggle,
  .stacker-add,
  .sheet-btn { height: 24px; padding: 0 8px; font-size: 11px; }

  .op-grid { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; padding: 8px; }
  .op-card { padding: 4px 3px 5px; gap: 3px; border-radius: 8px; }
  .op-avatar { border-radius: 6px; font-size: 16px; }
  .op-name { font-size: 11px; }
  .op-tier { top: 2px; right: 2px; min-width: 15px; height: 15px; padding: 0 3px; font-size: 9px; }
  .op-pick { top: 2px; left: 2px; height: 18px; min-width: 18px; padding: 0 3px; border-radius: 5px; }
  .op-pick svg { width: 12px; height: 12px; }
  .op-grid.stack-view .op-card[data-stack="strong"] .op-stack-badge {
    top: 2px;
    left: 2px;
    height: 14px;
    padding: 0 3px;
    font-size: 9px;
  }

  /* 底部抽屉里的排版：比桌面端小一号，长文本在 62vh 内基本一屏读完 */
  .detail h2 { font-size: 12px; }
  .detail-op { gap: 10px; }
  .detail-op .op-avatar { width: 44px; height: 44px; }
  .detail-op .name { font-size: 16px; }
  .detail-op .meta { font-size: 11px; }
  .chip { height: 20px; padding: 0 7px; font-size: 10px; }
  .effect-label { font-size: 10px; letter-spacing: 0.14em; }
  .effect-text { font-size: 13px; line-height: 1.68; }
  .trait-up { margin-top: 8px; padding: 8px 10px; }
  .trait-up .effect-text { font-size: 12.5px; }

  /* 自建攻略：手机上工具条、搭配胶囊、选择弹层都缩一档 */
  .page-tools { margin: -2px 0 8px; gap: 6px; }
  .page-tools-hint { display: none; }
  .guide-toggle { height: 24px; padding: 0 8px; font-size: 11px; }
  /* 手机上入口就在页面里（#/3 面包屑下面那行），顶栏这颗不必再挤一个位置 */
  #guide-entry { display: none; }
  .guide-bar { gap: 6px 8px; padding: 8px 10px; margin-bottom: 10px; }
  .guide-state { font-size: 11px; }
  .guide-actions { width: 100%; margin-left: 0; }
  .guide-actions .btn-ghost { flex: 1 1 auto; height: 24px; padding: 0 8px; font-size: 11px; }
  .guide-tip { font-size: 11px; }
  .pair-covs,
  .pair-ops { gap: 4px; }
  .pair-main { font-size: 10px; padding: 1px 6px 1px 1px; gap: 4px; }
  .pair-avatar,
  .pair-icon { width: 16px; height: 16px; }
  .pair-del { width: 16px; height: 16px; font-size: 12px; }
  .pair-add { height: 20px; min-width: 20px; font-size: 11px; }
  .cov-hero .pair-name { max-width: 5.5em; }
  .opt-sq { height: 14px; font-size: 9px; }
  .op-card.is-editing { padding-bottom: 20px; }
  /* 核心叠层手：速查工具坞、筛选条、类型方块都缩一档 */
  .hero-with-entries { gap: 8px 10px; }
  .tool-dock { gap: 4px; padding: 5px 6px 6px; }
  .tool-dock-title { font-size: 9px; letter-spacing: 0.1em; }
  .tool-dock-grid { gap: 3px; }
  .tool-tile { width: 38px; height: 38px; gap: 2px; border-radius: 7px; }
  .tool-icon { font-size: 11px; }
  .tool-name { font-size: 9.5px; letter-spacing: 0; }
  .stacker-filters { gap: 6px; margin-bottom: 10px; }
  .filter-chip { height: 24px; padding: 0 8px; font-size: 11px; }
  .filter-count { font-size: 9px; }
  .filter-label { font-size: 10px; }
  .stacker-hero .stacker-icon { font-size: 17px; }
  .boss-hero .boss-icon,
  .enemy-hero .enemy-icon { font-size: 17px; }

  /* BOSS 卡：一列铺满，表格瘦身 */
  .boss-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .boss-card { padding: 10px 11px; gap: 8px; }
  .boss-avatar { width: 44px; height: 44px; border-radius: 8px; }
  .boss-title h2 { font-size: 14px; }
  .boss-title p { font-size: 11px; }
  .boss-hp { font-size: 12px; }
  .boss-hp th,
  .boss-hp td { padding: 3px 4px; }
  .boss-levels-body { max-height: 200px; }

  /* 敌人卡：76px → 66px，360px 宽也能一行五张 */
  .enemy-card { width: 66px; padding: 5px 3px 6px; }
  .enemy-name { font-size: 10.5px; }
  .enemy-group-icon { width: 18px; height: 18px; }
  .enemy-grid { gap: 6px; }
  .enemy-head { flex-wrap: wrap; row-gap: 2px; }
  .enemy-search { width: 100%; flex: 1 1 auto; height: 24px; }
  /* BOSS / 敌人速查的副标题比盟约头图长得多，允许折两行（其它头图仍一行省略） */
  .boss-hero .cov-sub,
  .enemy-hero .cov-sub {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal;
  }

  .type-opt { height: 22px; padding: 0 8px; font-size: 11px; }
  .picker { max-height: 86vh; }
  .picker-list { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); padding: 0 10px 10px; }
  .picker-head,
  .picker-foot { padding: 8px 10px; }
  .picker-filter { margin: 8px 10px; height: 30px; }

  .site-footer { padding: 12px 12px 18px; font-size: 10.5px; }
  .site-footer p { margin: 2px 0; }
}

/* 触屏设备没有「悬停」：去掉上浮效果，避免点过的卡片一直翘着 */
@media (hover: none) {
  .op-card:hover,
  .cov-card:hover,
  .enemy-card:hover,
  .season-card:hover { transform: none; }
}

/* 点按优化：这些元素在手机上不再等 300ms 双击缩放，点一下立刻响应
   （收起底部抽屉的「点空白处」也因此更跟手；双指缩放不受影响） */
.op-card,
.cov-card,
.season-card,
.btn-ghost,
.btn-icon,
.stack-toggle,
.sheet-btn,
.pair-chip,
.filter-chip,
.type-opt,
.opt-sq,
.tool-tile,
.enemy-card,
.pick-item { touch-action: manipulation; }

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

.site-footer {
  border-top: 1px solid var(--border);
  padding: 18px 20px 26px;
  text-align: center;
  font-size: 12px;
  color: var(--text-mute);
}
.site-footer p { margin: 4px 0; }
.site-footer a { color: var(--text-dim); }
.site-icp { margin-top: 8px !important; font-size: 11px; letter-spacing: 0.03em; }
.site-icp a { color: var(--text-mute); }
.site-icp a:hover { color: var(--text-dim); }
