:root {
  --bg: #0a0e12;
  --bg-2: #0f151b;
  --panel: #131b23;
  --panel-2: #18222c;
  --line: #26333f;
  --line-2: #33424f;
  --text: #d7e0e8;
  --text-dim: #8b9aa8;
  --accent: #15FF8C;
  --accent-2: #0BD476;
  --danger: #e14b4b;
  --info: #4b9fe1;
  --diff-red: #e05555;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* 触屏基础：去掉点击高亮闪烁、消除 300ms 点击延迟 */
* { -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; -webkit-appearance: none; appearance: none; font-family: inherit; }
img { -webkit-user-drag: none; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
  min-height: 100vh;
  line-height: 1.5;
  background-image:
    radial-gradient(circle at 12% -5%, rgba(21,255,140,0.07), transparent 45%),
    radial-gradient(circle at 92% 6%, rgba(11,212,118,0.035), transparent 50%);
}

.scanlines {
  position: fixed; inset: 0; pointer-events: none; z-index: 999;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 2px, rgba(0,0,0,0.10) 3px);
  mix-blend-mode: overlay;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  position: sticky; top: 0; z-index: 10;
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(21,255,140,.38), transparent);
  pointer-events: none;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-logo {
  height: 36px; width: auto; display: block;
  filter: drop-shadow(0 0 12px rgba(21,255,140,.32));
}
.brand-text { border-left: 1px solid rgba(21,255,140,.28); padding-left: 14px; }
.brand-text h1 { font-size: 17px; letter-spacing: 2px; }
.brand-text .sub { font-size: 10px; color: var(--text-dim); letter-spacing: 3px; }

.container { max-width: 1200px; margin: 0 auto; padding: 22px 18px 60px; }

.mode-panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 14px 18px; margin-bottom: 18px;
  display: flex; gap: 32px; flex-wrap: wrap;
}
.mode-block { flex: 1; min-width: 200px; }
.mode-label { font-size: 12px; color: var(--text-dim); letter-spacing: 2px; margin-bottom: 8px; }
.mode-group { display: flex; gap: 10px; flex-wrap: wrap; }
.mode-btn {
  background: var(--panel-2); color: var(--text-dim);
  border: 1px solid var(--line); padding: 8px 22px; border-radius: 6px;
  cursor: pointer; font-size: 14px; transition: all .15s;
}
.mode-btn:hover { border-color: var(--accent); color: var(--text); }
.mode-btn.active { background: var(--accent); color: #0a0e12; border-color: var(--accent); font-weight: 700; }

.roll-actions { display: flex; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.btn-primary, .btn-secondary, .btn-ghost {
  padding: 13px 24px; border-radius: 6px; cursor: pointer;
  font-size: 15px; font-weight: 700; letter-spacing: 1px; transition: all .15s;
  border: 1px solid transparent;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0a0e12; border: none;
  box-shadow: 0 4px 20px rgba(21,255,140,0.25);
  display: flex; align-items: center; gap: 8px;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 26px rgba(21,255,140,0.4); }
.btn-primary.busy { opacity: .75; cursor: progress; animation: busyPulse 1s infinite; }
@keyframes busyPulse { 0%,100%{ box-shadow: 0 4px 20px rgba(21,255,140,.25);} 50%{ box-shadow: 0 4px 32px rgba(21,255,140,.65);} }
.btn-secondary { background: var(--panel-2); color: var(--text); border-color: var(--line-2); }
.btn-secondary:hover { border-color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text-dim); border-color: var(--line); display: inline-flex; align-items: center; gap: 8px; }
.btn-ghost:hover { color: var(--danger); border-color: var(--danger); background: rgba(225,75,75,.08); }
.roll-actions .btn-ghost { margin-left: auto; }
.btn-ghost .btn-icon { font-size: 13px; opacity: .85; }

/* 抽取状态条 */
.status-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--line-2);
  border-radius: 6px; padding: 10px 16px; margin-bottom: 22px;
  transition: border-color .2s, background .2s;
}
.status-bar.rolling {
  border-left-color: var(--accent);
  background: linear-gradient(90deg, rgba(21,255,140,0.10), var(--panel) 45%);
}
.status-bar.idle { border-left-color: var(--line-2); }
.status-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim); flex-shrink: 0;
}
.status-bar.rolling .status-dot { background: var(--accent); animation: dotBlink .8s infinite; }
@keyframes dotBlink { 0%,100%{ opacity:1; box-shadow:0 0 0 0 rgba(21,255,140,.6);} 50%{ opacity:.35; box-shadow:0 0 0 6px rgba(21,255,140,0);} }
.status-text {
  font-size: 13px; color: var(--text); letter-spacing: .5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.status-bar.rolling .status-text { color: var(--accent); }
.status-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.progress-track {
  width: 140px; height: 5px; background: var(--panel-2); border-radius: 3px; overflow: hidden;
  border: 1px solid var(--line);
}
.progress-fill {
  height: 100%; width: 0%; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .25s ease;
}
.progress-num { font-size: 11px; color: var(--text-dim); font-variant-numeric: tabular-nums; }

.card-section { margin-bottom: 26px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-head h2 { font-size: 15px; letter-spacing: 2px; display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; background: var(--accent); display: inline-block; transform: rotate(45deg); }
.section-head .hint { font-size: 12px; color: var(--text-dim); }

/* 地图卡片 */
.map-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 18px; min-height: 120px; position: relative;
  display: flex; align-items: center; gap: 20px;
}
.map-preview {
  width: 220px; height: 148px; border-radius: 8px; flex-shrink: 0;
  background: var(--panel-2); border: 1px solid var(--line-2); overflow: hidden;
}
.map-preview img { width: 100%; height: 100%; object-fit: cover; }
.map-info h3 { font-size: 20px; display: flex; align-items: center; gap: 10px; }
.diff-tag {
  font-size: 11px; padding: 2px 10px; border-radius: 3px;
  background: rgba(224,85,85,0.15); color: var(--diff-red);
  border: 1px solid var(--diff-red); letter-spacing: 1px;
}
.map-meta { display: flex; gap: 10px; margin: 6px 0; }
.map-mode { font-size: 11px; padding: 2px 10px; border-radius: 3px; color: var(--info); border: 1px solid var(--info); }
.map-diff { font-size: 11px; color: var(--accent); }
.map-desc { font-size: 13px; color: var(--text-dim); }

/* 小队 */
.squad-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px; align-items: start;
}
.member-col {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px;
}
.member-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px dashed var(--line-2);
}
.member-no { font-size: 14px; font-weight: 700; letter-spacing: 2px; color: var(--accent); }
.member-slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 8px; }

.equip-card {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; position: relative;
  display: flex; align-items: center; gap: 12px; transition: border-color .15s; min-height: 72px;
}
.equip-card .slot-name {
  font-size: 10px; color: var(--text-dim); letter-spacing: 2px;
  position: absolute; top: 6px; left: 10px;
}
.equip-card .icon {
  width: 52px; height: 52px; margin-top: 8px; flex-shrink: 0;
  background: rgba(0,0,0,0.25); border: 1px solid var(--line-2); border-radius: 6px;
  display: grid; place-items: center; overflow: hidden;
  position: relative;
}
/* 绝对定位让 100% 高度稳定生效：网格子项里 height:100% 会被当成 auto，
   图片按原始比例撑高后被 overflow 裁掉，只剩顶部一条 */
.equip-card .icon img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: contain;
}
.equip-card .icon .ph { font-size: 22px; opacity: .55; }
.equip-card .item-name { font-size: 13px; font-weight: 600; margin-top: 8px; flex: 1; }
.equip-card .tag {
  font-size: 10px; padding: 2px 8px; border-radius: 3px;
  color: var(--info); border: 1px solid var(--info); white-space: nowrap;
}
.equip-card .tag.lv { color: var(--accent); border-color: var(--accent); }
.equip-card .tag.role { color: var(--accent-2); border-color: var(--accent-2); }

.empty-hint { color: var(--text-dim); font-size: 14px; text-align: center; padding: 30px 0; }

/* 主体双栏布局 */
.layout { display: flex; gap: 20px; align-items: flex-start; }
.layout-main { flex: 1; min-width: 0; }

/* 右侧装备清单 */
.loadout-panel {
  width: 300px; flex-shrink: 0; position: sticky; top: 80px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; max-height: calc(100vh - 110px); overflow-y: auto;
}
.loadout-head { display: flex; align-items: center; margin-bottom: 12px; }
.loadout-head h2 { font-size: 14px; letter-spacing: 1px; display: flex; align-items: center; gap: 8px; }
.loadout-list { display: flex; flex-direction: column; gap: 14px; }
.loadout-group { border-bottom: 1px dashed var(--line-2); padding-bottom: 10px; }
.loadout-group:last-child { border-bottom: none; padding-bottom: 0; }
.loadout-group-title {
  font-size: 11px; color: var(--accent); letter-spacing: 2px; font-weight: 700;
  margin-bottom: 6px;
}
.loadout-empty { font-size: 12px; color: var(--text-dim); padding: 2px 0 4px; letter-spacing: .5px; }
.loadout-row {
  display: flex; align-items: center; gap: 8px; padding: 4px 0;
}
.loadout-row img {
  width: 30px; height: 30px; object-fit: contain; flex-shrink: 0;
  background: rgba(0,0,0,0.25); border: 1px solid var(--line-2); border-radius: 4px;
}
.loadout-row .ph { font-size: 18px; flex-shrink: 0; }
/* 地图缩略图用横向比例，避免方框里出现大量留白 */
.loadout-thumb.map { display: block; flex-shrink: 0; }
.loadout-thumb.map img { width: 48px; height: 31px; object-fit: cover; }
.loadout-slot { font-size: 10px; color: var(--text-dim); width: 34px; flex-shrink: 0; }
.loadout-name { font-size: 12px; flex: 1; color: var(--text); }
.loadout-row .tag { font-size: 9px; padding: 1px 6px; border-radius: 3px; white-space: nowrap; }
.loadout-row .diff-tag { font-size: 9px; padding: 1px 6px; border-radius: 3px; }

/* 清单滚自己，结果按钮钉在底部 */
.loadout-panel { display: flex; flex-direction: column; }
.loadout-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; }

/* 随机完成后出现：存图 / 分享 */
.result-actions {
  display: none; gap: 10px; margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--line); flex-shrink: 0;
}
.result-actions.show { display: flex; animation: resultIn .28s ease both; }
@keyframes resultIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.result-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 11px 10px; font-size: 13.5px; letter-spacing: .5px;
  border-radius: 7px; min-height: 42px;
}
.result-btn .btn-icon { font-size: 13px; }

/* 逐件随机中的待定槽位 */
.equip-card.pending { opacity: 0.48; }
.equip-card.pending .item-name { color: var(--text-dim); }

/* 落定高亮 */
@keyframes settlePop {
  0%   { transform: scale(.96); box-shadow: 0 0 0 0 rgba(21,255,140,.55); }
  45%  { transform: scale(1.02); box-shadow: 0 0 0 8px rgba(21,255,140,0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(21,255,140,0); }
}
.equip-card.flash {
  animation: settlePop .45s ease;
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(21,255,140,.14), var(--panel-2));
}
@keyframes mapPop {
  0% { box-shadow: 0 0 0 0 rgba(21,255,140,.5); }
  50% { box-shadow: 0 0 0 12px rgba(21,255,140,0); }
  100% { box-shadow: 0 0 0 0 rgba(21,255,140,0); }
}
.map-card.flash { animation: mapPop .6s ease; border-color: var(--accent); }

/* 清单徽标 */
.loadout-head { justify-content: space-between; }
.loadout-badge {
  font-size: 10px; padding: 2px 8px; border-radius: 3px;
  color: var(--text-dim); border: 1px solid var(--line-2); letter-spacing: 1px;
}
.loadout-badge.rolling { color: var(--accent); border-color: var(--accent); animation: badgeBlink 1s infinite; }
@keyframes badgeBlink { 0%,100%{opacity:1;} 50%{opacity:.4;} }
.loadout-badge.ready { color: #4ad07a; border-color: #4ad07a; }

@media (max-width: 900px) {
  /* align-items:stretch 必加：竖向排列时若仍为 flex-start，
     子容器会按内容宽度收缩，空状态下整列会被压窄 */
  .layout { flex-direction: column; align-items: stretch; }
  .loadout-panel { width: 100%; position: static; max-height: none; }
}

.footer {
  text-align: center; padding: 28px 20px 34px;
  color: var(--text-dim); font-size: 12px;
  border-top: 1px solid var(--line);
}

/* 署名区块 */
.credit {
  display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: center;
  gap: 8px 18px; margin-bottom: 14px; padding: 11px 20px;
  border: 1px solid rgba(21,255,140,.22); border-radius: 8px;
  background: rgba(21,255,140,.05);
}
.credit-item { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; }
.credit-label {
  font-size: 10px; letter-spacing: 2px; color: var(--accent);
  border: 1px solid rgba(21,255,140,.38); border-radius: 3px;
  padding: 2px 5px; line-height: 1.3;
}
.credit-name { color: #e6edf3; font-weight: 600; letter-spacing: .5px; }
.credit-vx {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  color: var(--accent); font-weight: 700; letter-spacing: .6px;
  user-select: all; -webkit-user-select: all; cursor: text;
  padding: 1px 5px; border-radius: 3px; background: rgba(21,255,140,.12);
}
.credit-sep { width: 1px; height: 15px; background: rgba(255,255,255,.14); }
.footer-note { font-size: 11px; line-height: 1.7; opacity: .78; letter-spacing: .3px; }

/* 底部进度线、手机端提示：默认隐藏，仅在手机布局启用 */
.bar-progress { display: none; }
.hint-m { display: none; }

/* ============================================================
   移动端适配（≤640px）
   - 操作条固定在底部，单手拇指可达
   - 装备卡改竖排两列，图标为主、名称单行省略
   - 适配 iPhone 刘海 / 底部安全区、去掉 hover 残留
   ============================================================ */
@media (max-width: 640px) {
  html { -webkit-text-size-adjust: 100%; }

  body {
    min-height: 100vh;
    min-height: 100dvh;
    font-size: 14px;
    /* 给固定底栏让位 */
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
  }

  /* 手机上扫描线会压低图标清晰度，关掉 */
  .scanlines { display: none; }
  .container { padding: 12px 12px 24px; }

  /* ---------- 顶部栏 ---------- */
  .topbar { padding: 9px 13px; }
  .brand { gap: 8px; }
  .brand-logo { height: 30px; filter: drop-shadow(0 0 8px rgba(21,255,140,.3)); }
  .brand-text { padding-left: 8px; }
  .brand-text h1 { font-size: 13px; letter-spacing: .5px; }
  .brand-text .sub { font-size: 7px; letter-spacing: 1.2px; }

  /* ---------- 前置条件：等宽分段控件 ---------- */
  .mode-panel {
    flex-direction: column; gap: 11px;
    padding: 12px; margin-bottom: 12px; border-radius: 10px;
  }
  .mode-block { min-width: 0; }
  .mode-label { font-size: 11px; letter-spacing: 1.5px; margin-bottom: 6px; }
  .mode-group { gap: 7px; flex-wrap: nowrap; }
  .mode-btn {
    flex: 1; min-width: 0; padding: 10px 4px;
    font-size: 13px; min-height: 40px; border-radius: 7px; text-align: center;
  }
  /* 触屏上 hover 会「粘住」，这里复位 */
  .mode-btn:hover { border-color: var(--line); color: var(--text-dim); }
  .mode-btn.active, .mode-btn.active:hover {
    background: var(--accent); color: #0a0e12; border-color: var(--accent);
  }

  /* ---------- 状态条 ---------- */
  .status-bar {
    flex-direction: column; align-items: stretch; gap: 7px;
    padding: 9px 12px; margin-bottom: 14px; border-radius: 8px;
  }
  .status-left { gap: 8px; }
  .status-text {
    font-size: 12px; line-height: 1.45;
    white-space: normal; overflow: visible; text-overflow: clip;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .status-right { width: 100%; gap: 8px; }
  .progress-track { flex: 1; width: auto; height: 4px; }

  /* ---------- 固定底部操作条 ---------- */
  .roll-actions {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    margin: 0; gap: 8px; align-items: center;
    padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
    display: grid; grid-template-columns: 1fr auto;
    background: rgba(10, 14, 18, 0.95);
    -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }
  /* 底栏顶沿的极细进度线：滚到哪都能看到进度 */
  .bar-progress {
    display: block; position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: rgba(255, 255, 255, .07); overflow: hidden;
  }
  .bar-progress i {
    display: block; height: 100%; width: 0;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width .25s ease;
  }

  /* 顺序：主操作（占据剩余宽度）· 清空图标 */
  #rollAllBtn { order: 1; }
  #clearAllBtn { order: 2; }

  .roll-actions .btn-primary {
    justify-content: center; gap: 6px;
    padding: 12px 8px; font-size: 14px; letter-spacing: .5px;
    min-height: 46px; border-radius: 7px;
  }
  .btn-primary:hover { transform: none; }
  .roll-actions .btn-primary:active { transform: scale(.98); }
  .roll-actions .btn-secondary {
    padding: 12px 10px; font-size: 12px;
    min-height: 46px; border-radius: 7px; white-space: nowrap;
  }
  .roll-actions .btn-ghost {
    margin-left: 0; padding: 12px; min-width: 46px;
    min-height: 46px; border-radius: 7px; justify-content: center;
  }
  .roll-actions .btn-ghost .btn-label { display: none; }

  /* ---------- 区块标题 ---------- */
  .card-section { margin-bottom: 18px; }
  .section-head { margin-bottom: 9px; }
  .section-head h2 { font-size: 13.5px; letter-spacing: 1px; gap: 7px; }
  .dot { width: 6px; height: 6px; }
  .hint-d { display: none; }
  .hint-m { display: inline; font-size: 10px; }
  .empty-hint { font-size: 13px; padding: 24px 0; }

  /* ---------- 地图卡：图上文下 ---------- */
  .map-card {
    flex-direction: column; align-items: stretch; gap: 11px;
    padding: 11px; min-height: 0; border-radius: 10px;
  }
  .map-preview { width: 100%; height: auto; aspect-ratio: 3 / 2; border-radius: 8px; }
  .map-info h3 { font-size: 17px; gap: 8px; }
  .map-meta { margin: 5px 0; gap: 8px; }
  .map-desc { font-size: 12px; line-height: 1.5; }

  /* ---------- 小队：单列成员 + 两列槽位 ---------- */
  .squad-grid { grid-template-columns: 1fr; gap: 11px; }
  .member-col { padding: 9px; border-radius: 10px; }
  .member-head { margin-bottom: 8px; padding-bottom: 7px; }
  .member-no { font-size: 13px; letter-spacing: 1.5px; }
  .member-slots { grid-template-columns: 1fr 1fr; gap: 7px; }

  /* 装备卡：竖排，图标为主 */
  .equip-card {
    flex-direction: column; align-items: center; gap: 0;
    padding: 22px 5px 7px; min-height: 0; text-align: center;
    border-radius: 9px;
    -webkit-user-select: none; user-select: none;
    -webkit-touch-callout: none;
  }
  .equip-card .slot-name { top: 5px; left: 7px; font-size: 9px; letter-spacing: .8px; }
  .equip-card .icon {
    width: 100%; height: 62px; margin-top: 0;
    background: transparent; border: none; border-radius: 0;
    overflow: hidden;
  }
  .equip-card .icon .ph { font-size: 20px; }
  .equip-card .item-name {
    width: 100%; margin-top: 5px; font-size: 11px; line-height: 1.3;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .equip-card .tag { font-size: 9px; padding: 1px 6px; margin-top: 4px; }

  /* ---------- 装备清单 ---------- */
  .layout { gap: 0; }
  .loadout-panel { padding: 12px; border-radius: 10px; }
  .loadout-head { margin-bottom: 10px; }
  .loadout-head h2 { font-size: 13px; }
  .loadout-list { gap: 12px; }
  .loadout-row { gap: 7px; padding: 5px 0; }
  .loadout-row img { width: 32px; height: 32px; border-radius: 5px; }
  .loadout-name { font-size: 12px; }
  .loadout-slot { width: 30px; font-size: 9px; letter-spacing: 0; }
  .loadout-group-title { font-size: 10px; margin-bottom: 4px; }

  /* ---------- 页脚 ---------- */
  .footer { padding: 20px 14px 22px; }
  .credit {
    flex-direction: column; gap: 9px; width: 100%;
    padding: 11px 14px; border-radius: 9px;
  }
  .credit-sep { display: none; }
  .credit-item { font-size: 12px; }
  .footer-note { font-size: 10.5px; line-height: 1.65; }
}

/* 小屏（iPhone SE 等 ≤380px）再压一档 */
@media (max-width: 380px) {
  .container { padding: 10px 10px 22px; }
  .member-slots { gap: 6px; }
  .equip-card { padding: 23px 4px 7px; }
  .equip-card .icon { height: 52px; }
  .equip-card .item-name { font-size: 10.5px; }
  .roll-actions .btn-primary { font-size: 13px; }
  .roll-actions .btn-secondary { font-size: 11px; padding: 12px 8px; }
}

/* ================= 结果图预览 / 轻提示 ================= */
.card-modal {
  position: fixed; inset: 0; z-index: 1200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(4, 7, 10, .88);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .2s ease;
}
.card-modal[hidden] { display: none; }
.card-modal.show { opacity: 1; }
.card-modal-inner {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  max-width: min(560px, 100%); max-height: 100%;
  transform: scale(.965); transition: transform .2s ease;
}
.card-modal.show .card-modal-inner { transform: scale(1); }
.card-modal-inner img {
  max-width: 100%; max-height: calc(100vh - 160px);
  width: auto; border-radius: 10px; border: 1px solid var(--line-2);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .65);
  -webkit-touch-callout: default;
}
.card-modal-hint { font-size: 12.5px; color: var(--text-dim); letter-spacing: .3px; }
.card-modal-close {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line-2);
  padding: 9px 28px; border-radius: 7px; font-size: 13px; cursor: pointer;
}
.card-modal-close:hover { border-color: var(--accent); color: var(--accent); }

.toast {
  position: fixed; left: 50%; bottom: 96px; z-index: 1300;
  transform: translate(-50%, 12px);
  background: rgba(19, 27, 35, .97); border: 1px solid var(--line-2);
  color: var(--text); font-size: 13px; padding: 10px 18px; border-radius: 8px;
  opacity: 0; pointer-events: none; white-space: nowrap;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .55);
  transition: opacity .22s ease, transform .22s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
  /* 手机端不嵌套滚动：清单自然铺开，按钮跟在列表后面 */
  .loadout-panel { max-height: none; overflow: visible; }
  .loadout-list { overflow: visible; }
  .result-actions { margin-top: 14px; padding-top: 14px; }
  .result-btn { padding: 13px 10px; font-size: 13.5px; min-height: 46px; }
  .card-modal { padding: 14px; }
  .card-modal-inner img { max-height: calc(100vh - 190px); }
  .card-modal-hint { font-size: 12px; }
  .toast { bottom: 82px; font-size: 12.5px; }
}

.result-btn.busy { opacity: .72; cursor: progress; }
