/* ===================================================================
 * style.css — 星穹铁道放置版全部样式
 * 拆自原 index.html 内联 <style>，行为不变；新增第三阶段战技点/能量样式。
 * =================================================================== *//* ===================================================================
     主题变量：参照星铁 UI（深空底 + 琥珀金 + 冷白文字）
     后续阶段换肤只改这里，不动结构样式
     =================================================================== */
  :root {
    --bg: #0f0f1a;
    --bg-soft: #16162a;
    --line: rgba(216, 185, 106, 0.28);
    --line-soft: rgba(255, 255, 255, 0.08);
    --gold: #d8b96a;
    --gold-dim: #9c8450;
    --text: #e8e6f0;
    --text-dim: #9a97ad;
    --quantum: #a06bd4;
    --up: #7fd4a0;
    --down: #ff8a5c;
  }

  * { box-sizing: border-box; }

  body {
    margin: 0;
    height: 100%;
    background:
      radial-gradient(1200px 600px at 20% -10%, rgba(160, 107, 212, 0.18), transparent 60%),
      radial-gradient(900px 500px at 90% 0%, rgba(216, 185, 106, 0.10), transparent 55%),
      var(--bg);
    color: var(--text);
    font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.6;
  }

  .topbar {
    padding: 26px 32px 18px;
    border-bottom: 1px solid var(--line-soft);
  }
  .topbar h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--text);
  }
  .topbar h1 .accent { color: var(--gold); }
  .topbar p {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--text-dim);
    letter-spacing: 0.5px;
  }

  /* ==== 角色卡片 ==== */
  .card {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 0;
    background: linear-gradient(180deg, rgba(22, 22, 42, 0.96), rgba(15, 15, 26, 0.96));
    border: 1px solid var(--line);
    border-radius: 4px;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.55), 0 8px 32px rgba(0, 0, 0, 0.4);
    overflow: hidden;
  }

  .portrait {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 18px;
    min-height: 320px;
    background:
      radial-gradient(120% 80% at 50% 0%, rgba(160, 107, 212, 0.55), transparent 65%),
      linear-gradient(160deg, #241a3a 0%, #12101f 100%);
    border-right: 1px solid var(--line-soft);
  }
  .portrait .rarity {
    position: absolute;
    top: 14px;
    left: 16px;
    font-size: 12px;
    color: var(--gold);
    letter-spacing: 2px;
  }
  .portrait .pname {
    position: relative;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 3px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
  }
  .portrait .ptags {
    position: relative;
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-dim);
    letter-spacing: 1px;
  }
  .portrait .ptags .el { color: var(--quantum); }

  .panel { padding: 20px 22px 18px; }

  .panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line-soft);
  }
  .panel-head .title { font-size: 15px; letter-spacing: 1px; }
  .panel-head .title b { color: var(--gold); font-weight: 600; }
  .panel-head .lv { font-size: 12px; color: var(--text-dim); }

  .stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px 34px;
    margin-top: 10px;
  }
  .stat-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
  }
  .stat-row .k { color: var(--text-dim); font-size: 13px; }
  .stat-row .v { font-variant-numeric: tabular-nums; font-size: 15px; }
  .stat-row .v.hi { color: var(--gold); }

  .dmg-boost {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--line-soft);
  }
  .dmg-boost .hd {
    font-size: 12px;
    color: var(--text-dim);
    letter-spacing: 1px;
    margin-bottom: 8px;
  }
  .dmg-chips { display: flex; flex-wrap: wrap; gap: 6px; }
  .chip {
    padding: 3px 9px;
    font-size: 12px;
    border: 1px solid var(--line-soft);
    border-radius: 2px;
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
  }
  .chip.on { border-color: var(--line); color: var(--gold); background: rgba(216, 185, 106, 0.08); }

  /* ==== 行动条（按 currentAV 升序，越靠左越先行动） ==== */
  .bar-title {
    font-size: 12px;
    color: var(--text-dim);
    letter-spacing: 1px;
    margin-bottom: 8px;
  }
  .bar-title span { color: #5f5c72; }
  .actionbar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .av-card {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    min-width: 118px;
    padding: 8px 10px;
    background: rgba(22, 22, 42, 0.85);
    border: 1px solid var(--line-soft);
    border-radius: 3px;
  }
  .av-card .av-name { font-size: 12px; }
  .av-card .av-val {
    font-size: 13px;
    color: var(--gold);
    font-variant-numeric: tabular-nums;
  }
  .av-card.enemy { border-color: rgba(255, 110, 110, 0.25); }
  .av-card.acting {
    border-color: var(--gold);
    box-shadow: 0 0 0 1px var(--gold), 0 0 14px rgba(216, 185, 106, 0.35);
  }

  /* ==== 战斗区 ==== */
  .field {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 16px;
    margin-top: 18px;
  }
  .field .card { grid-template-columns: 168px 1fr; position: relative; }
  .field .portrait { min-height: 238px; padding: 14px; }
  .field .portrait .pname { font-size: 21px; }
  .field .panel { padding: 14px 16px 14px; }
  .card.enemy .portrait {
    background:
      radial-gradient(120% 80% at 50% 0%, rgba(212, 96, 96, 0.5), transparent 65%),
      linear-gradient(160deg, #341a1a 0%, #12101f 100%);
  }

  .hp { margin-top: 10px; }
  .hp-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 1px;
    overflow: hidden;
  }
  .hp-bar i {
    display: block;
    height: 100%;
    width: 100%;
    background: #6fcf97;
    transition: width 0.18s linear;
  }
  .hp-bar.mid i { background: #e6c34a; }
  .hp-bar.low i { background: #e2604a; }
  .hp-txt {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
  }

  .key-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px 16px;
    margin-top: 10px;
  }
  .key-stats div {
    display: flex;
    justify-content: space-between;
    padding-bottom: 3px;
    font-size: 12px;
    color: var(--text-dim);
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
  }
  .key-stats b {
    color: var(--text);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
  }

  .res-line {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.9;
  }
  .res-line em { color: #ff9c9c; font-style: normal; }

  /* ==== 受击表现：抖动 / 闪光 / 飘字（纯 CSS 动画） ==== */
  @keyframes shakeX {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-7px); }
    60% { transform: translateX(7px); }
  }
  .card.shake { animation: shakeX 0.2s ease; }

  @keyframes hitFlash {
    0%, 100% { box-shadow: inset 0 0 0 rgba(255, 60, 60, 0); }
    35% { box-shadow: inset 0 0 60px rgba(255, 60, 60, 0.5); }
  }
  .card.hit { animation: hitFlash 0.2s ease; }

  .dmg-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: visible;
  }
  .dmg-num {
    position: absolute;
    left: 50%;
    top: 34%;
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
    animation: floatUp 1s ease-out forwards;
  }
  .dmg-num.crit { font-size: 31px; color: var(--gold); }
  @keyframes floatUp {
    0% { opacity: 0; transform: translate(-50%, 6px) scale(0.9); }
    18% { opacity: 1; transform: translate(-50%, 0) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -54px) scale(1.06); }
  }

  /* ==== 控制区 ==== */
  .controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
  }
  .btn {
    padding: 6px 16px;
    background: rgba(22, 22, 42, 0.9);
    border: 1px solid var(--line-soft);
    border-radius: 3px;
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    letter-spacing: 1px;
    cursor: pointer;
  }
  .btn:hover { border-color: var(--gold); color: var(--gold); }
  .btn.primary { border-color: var(--line); color: var(--gold); background: rgba(216, 185, 106, 0.12); }
  .btn.active { border-color: var(--gold); color: var(--gold); background: rgba(216, 185, 106, 0.2); }
  .ctrl-note { margin-left: 4px; font-size: 12px; color: var(--text-dim); }
  .ctrl-note b { color: var(--gold); font-weight: 500; }

  /* ==== 战斗日志 ==== */
  .log-wrap {
    margin-top: 16px;
    border: 1px solid var(--line-soft);
    border-radius: 4px;
    overflow: hidden;
  }
  .log-title {
    display: flex;
    justify-content: space-between;
    padding: 9px 14px;
    background: rgba(22, 22, 42, 0.85);
    font-size: 12px;
    color: var(--gold-dim);
    letter-spacing: 1px;
  }
  .log {
    height: 224px;
    overflow-y: auto;
    padding: 8px 14px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 12.5px;
    line-height: 1.9;
    color: var(--text-dim);
  }
  .log-line { white-space: pre-wrap; }
  .log-line.crit { color: #f0d38b; }
  .log-line.enemy { color: #e3a3a3; }
  .log-line.sys { color: var(--gold); }

  /* ==== 明细面板 ==== */
  .detail { margin-top: 18px; border: 1px solid var(--line-soft); border-radius: 4px; }
  .detail-toggle {
    width: 100%;
    padding: 12px 16px;
    background: rgba(22, 22, 42, 0.8);
    border: 0;
    color: var(--text);
    font-size: 13px;
    letter-spacing: 1px;
    text-align: left;
    cursor: pointer;
  }
  .detail-toggle:hover { color: var(--gold); }
  .detail-body { display: none; padding: 4px 16px 18px; }
  .detail.open .detail-body { display: block; }

  .sec-title {
    margin: 16px 0 8px;
    font-size: 12px;
    color: var(--gold-dim);
    letter-spacing: 1.5px;
  }

  table { width: 100%; border-collapse: collapse; font-size: 13px; }
  th, td {
    padding: 6px 8px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-variant-numeric: tabular-nums;
  }
  th { color: var(--text-dim); font-weight: 400; font-size: 12px; }
  td.num, th.num { text-align: right; }
  tbody tr:hover { background: rgba(255, 255, 255, 0.03); }

  .badge {
    display: inline-block;
    min-width: 46px;
    padding: 1px 6px;
    font-size: 11px;
    text-align: center;
    border-radius: 2px;
    border: 1px solid var(--line-soft);
    color: var(--text-dim);
  }
  .badge.pct { color: #9ccaff; border-color: rgba(156, 202, 255, 0.3); }
  .badge.flat { color: #ffc98a; border-color: rgba(255, 201, 138, 0.3); }
  .badge.cond { color: var(--text-dim); border-style: dashed; }

  input.val {
    width: 82px;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--line-soft);
    border-radius: 2px;
    color: var(--text);
    font-family: inherit;
    font-size: 12px;
    text-align: right;
    font-variant-numeric: tabular-nums;
  }
  input.val:focus { outline: none; border-color: var(--gold); }

  .hint {
    margin: 12px 0 0;
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.8;
  }
  .hint code {
    padding: 1px 5px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    color: var(--gold);
    font-size: 11px;
  }

/* ==== 第三阶段：战技点与能量 ==== */
.resource-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 9px 14px;
  background: rgba(22, 22, 42, 0.7);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
}
.rb-label { font-size: 12px; color: var(--text-dim); letter-spacing: 1px; }
.rb-hint { margin-left: auto; font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.sp-dots { display: flex; gap: 6px; }
.sp-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid rgba(216, 185, 106, 0.55);
  background: rgba(255, 255, 255, 0.04);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.sp-dot.on {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 8px rgba(216, 185, 106, 0.6);
}

.energy { margin-top: 7px; }
.energy-bar {
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 1px;
  overflow: hidden;
}
.energy-bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: #6aa9d8;
  transition: width 0.18s linear, background 0.2s ease;
}
.energy-bar.full i { background: var(--gold); box-shadow: 0 0 10px rgba(216, 185, 106, 0.75); }
.energy-txt {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.energy-txt.full { color: var(--gold); }

.av-card .av-ult {
  margin-left: 4px;
  font-size: 11px;
  color: var(--gold);
  text-shadow: 0 0 6px rgba(216, 185, 106, 0.8);
}

/* ===================================================================
   第四阶段：队伍战斗（4 人 vs 群怪）
   =================================================================== */
.resource-bar .rb-hint { margin-left: 2px; margin-right: auto; }
.rb-note { font-size: 11.5px; color: #6f6a86; }

/* ==== 战场：左敌右我 ==== */
.arena {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 14px;
  align-items: start;
}
.side { min-width: 0; }
.side-title {
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 1px;
}
.team { display: flex; flex-direction: column; gap: 8px; }

/* ==== 单位卡片（紧凑型） ==== */
.unit {
  position: relative;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  padding: 9px 11px;
  background: rgba(22, 22, 42, 0.85);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
}
.unit.ally { border-color: rgba(160, 107, 212, 0.30); background: rgba(26, 20, 38, 0.82); }
.unit.enemy { border-color: rgba(212, 96, 96, 0.30); background: rgba(34, 20, 26, 0.82); }
.unit.acting { box-shadow: 0 0 0 1px var(--gold), 0 0 12px rgba(216, 185, 106, 0.25); }
.unit.dead { opacity: 0.32; filter: grayscale(1); }

.unit .ava {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 2px;
  border: 1px solid var(--el);
  background: linear-gradient(160deg, var(--el), #101018);
  color: #fff;
  font-size: 17px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
}
.unit .body { min-width: 0; }
.unit .row1 { display: flex; align-items: baseline; gap: 6px; }
.unit .nm { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unit .role {
  padding: 0 4px;
  font-size: 10px;
  color: var(--gold);
  border: 1px solid rgba(216, 185, 106, 0.35);
  border-radius: 2px;
}
.unit .lv { margin-left: auto; font-size: 11px; color: var(--text-dim); }

.unit .bar {
  height: 7px;
  margin-top: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 1px;
  overflow: hidden;
}
.unit .bar i {
  display: block;
  width: 100%;
  height: 100%;
  background: #6fcf97;
  transition: width 0.18s linear, background 0.2s ease;
}
.unit .bar.hp.mid i { background: #e6c34a; }
.unit .bar.hp.low i { background: #e2604a; }
.unit .bar.energy i { background: #6aa9d8; }
.unit .bar.energy.full i { background: var(--gold); box-shadow: 0 0 8px rgba(216, 185, 106, 0.7); }
.unit .bar.tough i { background: #e9e5d6; }
.unit .bar.tough.wounded i { background: #e8c65a; }
.unit .bar.tough.broken i { background: #4a4657; }

.unit .mini {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.unit .tough-label {
  display: flex;
  justify-content: space-between;
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.unit .tg-state.on { color: #e8735c; }
.unit .weak {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  font-size: 11px;
  color: var(--text-dim);
}
.unit .weak span {
  min-width: 18px;
  padding: 0 3px;
  text-align: center;
  color: #d9d4c6;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 2px;
}

/* ==== 行动条敌我底色 ==== */
.av-card.ally { background: rgba(30, 22, 44, 0.9); }
.av-card.enemy { background: rgba(40, 22, 26, 0.9); }
.av-card .av-broken {
  margin-left: 4px;
  padding: 0 3px;
  font-size: 10px;
  color: #e8735c;
  border: 1px solid rgba(232, 115, 92, 0.5);
  border-radius: 2px;
}

/* ==== 日志里的全队战技点 ==== */
.log-sp {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  margin-right: 14px;
  font-size: 11.5px;
  color: var(--text-dim);
}
.log-sp-dots { display: inline-flex; gap: 4px; }
.log-sp .sp-dot { width: 9px; height: 9px; }
.log-line.break { color: #ff9c7a; }

/* ==== 主C 属性面板卡 ==== */
.panel-card { margin-top: 16px; }
.panel-card .portrait { min-height: 220px; }
.log-line.heal { color: #8fd6a8; }

/* ==== 状态图标（第四/五阶段） ==== */
.unit .status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 5px;
}
.unit .status-row:empty { display: none; }
.st-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 9px;
  line-height: 1;
  cursor: help;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #0f0f1a;
}
.st-dot.buff { background: #d8b96a; border-color: #f0dca6; }
.st-dot.debuff { background: #e2604a; border-color: #ff9c8a; color: #fff; }
.st-dot.control { background: #8a6bd4; border-color: #b9a4ee; color: #fff; }
.log-line.status { color: #c8a6f0; }
.log-line.buff { color: #f0d38b; }

/* ===================================================================
   第六阶段：遗器测试台（弹出层）
   =================================================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 6, 12, 0.72);
  backdrop-filter: blur(2px);
}
.modal[hidden] { display: none; }
.modal-box {
  width: min(1040px, 94vw);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: #14141f;
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 14px;
}
.modal-hint { margin-left: 10px; font-size: 11.5px; color: var(--text-dim); }
.modal-body {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 0;
  min-height: 0;
  overflow: hidden;
}
.relic-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 12px 14px;
}
.relic-col + .relic-col { border-left: 1px solid var(--line-soft); }
.col-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--gold-dim);
  letter-spacing: 1px;
}
.relic-slots { display: flex; flex-direction: column; gap: 6px; }
.relic-slot {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 7px 9px;
  background: rgba(22, 22, 42, 0.8);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  cursor: pointer;
}
.relic-slot:hover { border-color: var(--gold); }
.relic-slot.empty { opacity: 0.55; }
.relic-slot .slot-name { font-size: 12px; color: var(--text-dim); }
.relic-slot .slot-main { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.relic-slot .slot-lv { font-size: 11px; color: var(--gold); }
.relic-slot .set-tag { font-size: 10.5px; color: #9a97ad; }

.bag-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  overflow-y: auto;
  max-height: 58vh;
  padding-right: 4px;
}
.relic-item {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 6px 9px;
  background: rgba(22, 22, 42, 0.6);
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: pointer;
  font-size: 12px;
}
.relic-item:hover { border-color: var(--gold); background: rgba(216, 185, 106, 0.06); }
.relic-item .star { color: var(--gold); font-size: 11px; }
.relic-item .item-main { font-variant-numeric: tabular-nums; }
.relic-item .item-sub { color: var(--text-dim); font-size: 11px; }
.set-summary {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--text-dim);
  line-height: 1.9;
}
.set-summary .on { color: var(--gold); }

/* ===================================================================
   第七阶段：资源条 / 关卡控制 / 结算弹窗 / 遗器详情
   =================================================================== */
.res-bar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 9px 14px;
  margin-bottom: 12px;
  background: rgba(22, 22, 42, 0.7);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  font-size: 12.5px;
  color: var(--text-dim);
}
.res-item b { color: var(--gold); font-weight: 500; font-variant-numeric: tabular-nums; }
.res-spacer { flex: 1; }
.ctrl-sep { width: 1px; height: 18px; background: var(--line-soft); margin: 0 4px; }
.btn.mini { padding: 3px 10px; font-size: 12px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  z-index: 60;
  padding: 9px 18px;
  background: rgba(22, 22, 42, 0.96);
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--text);
  font-size: 13px;
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: 0.2s ease;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { border-color: #e2604a; color: #ffb4a4; }

.modal-box.narrow { width: min(480px, 92vw); }
.modal-body.single { display: block; padding: 14px 18px; max-height: 58vh; overflow: auto; }
.modal-foot { padding: 10px 16px; border-top: 1px solid var(--line-soft); text-align: right; }
.rs-title { margin-bottom: 10px; font-size: 14px; letter-spacing: 1px; }
.rs-title.ok { color: var(--gold); }
.rs-title.bad { color: #ff9c8a; }
.rs-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 12.5px;
  color: var(--text-dim);
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}
.rs-row b { color: var(--text); font-variant-numeric: tabular-nums; }
.rs-row b.dim { color: var(--text-dim); }
.rs-sep { height: 1px; margin: 10px 0; background: var(--line-soft); }
.rs-drop { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 12.5px; }
.rs-drop .star { color: var(--gold); }

.relic-detail {
  margin-top: 10px;
  padding: 10px;
  background: rgba(22, 22, 42, 0.75);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  font-size: 12px;
}
.detail-empty { color: var(--text-dim); font-size: 12px; line-height: 1.7; }
.dt-head { display: flex; justify-content: space-between; margin-bottom: 6px; color: var(--gold); }
.dt-lv { color: var(--text-dim); font-size: 11px; }
.dt-row {
  display: grid;
  grid-template-columns: 1fr auto 46px;
  gap: 6px;
  padding: 2px 0;
  color: var(--text-dim);
}
.dt-row b { color: var(--text); font-variant-numeric: tabular-nums; }
.dt-row i { color: #7f7b93; font-style: normal; font-size: 10.5px; text-align: right; }
.dt-row.main b { color: var(--gold); }
.dt-actions { display: flex; gap: 8px; margin-top: 10px; }
.relic-item.selected, .relic-slot.focused { border-color: var(--gold); background: rgba(216, 185, 106, 0.1); }
.relic-slot.can-put { border-color: rgba(216, 185, 106, 0.6); border-style: dashed; }

/* ===================================================================
   第八阶段：编队 / 跃迁
   =================================================================== */
.gacha-top, .gacha-sub {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 16px; border-bottom: 1px solid var(--line-soft);
  font-size: 12.5px; color: var(--text-dim);
}
.gacha-top .res-item b, .gacha-sub b { color: var(--gold); }
.gacha-result { padding: 14px 16px; max-height: 52vh; overflow: auto; }
.gacha-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.gacha-card {
  padding: 12px 8px; border: 1px solid var(--line-soft); border-radius: 3px;
  background: rgba(22, 22, 42, 0.8); text-align: center;
}
.gacha-card.r5 {
  border-color: #e8c65a;
  animation: gachaGlow 1.3s ease-in-out infinite alternate;
}
.gacha-card.r4 { border-color: #a678d8; box-shadow: 0 0 10px rgba(166, 120, 216, 0.4); }
.gacha-card.r3 { opacity: 0.7; }
@keyframes gachaGlow {
  from { box-shadow: 0 0 6px rgba(232, 198, 90, 0.3); }
  to   { box-shadow: 0 0 22px rgba(232, 198, 90, 0.85); }
}
.gc-star { color: #d8b96a; font-size: 11px; letter-spacing: 1px; }
.gc-name { margin-top: 5px; font-size: 13px; }
.gacha-card.r5 .gc-name { color: #f7dd93; }
.gacha-card.r4 .gc-name { color: #c9a8f0; }
.gc-sub { margin-top: 4px; font-size: 10.5px; color: var(--text-dim); line-height: 1.5; }

/* 编队卡片：名字与副信息拉开距离 */
.relic-slot .set-tag, .relic-item .item-sub { margin-left: 6px; }
.relic-item .item-sub { color: var(--text-dim); }

/* ==== 全局免责声明：最高层级常驻条（任何界面/弹窗之上，不挡交互） ==== */
#disclaimer-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 999999;
  pointer-events: none;            /* 不遮挡任何点击/拖拽 */
  padding: 3px 12px 4px;
  text-align: center;
  font-size: 10px; line-height: 1.45; letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.4);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0.85) 34%);
  user-select: none;
  -webkit-user-select: none;
}
/* 移动端：放在底部导航栏上方（导航栏正常置底，声明压在其上沿的预留区），不遮内容 */
@media (max-width: 768px) {
  #disclaimer-bar {
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    padding: 2px 8px;
    font-size: 9px; line-height: 1.4; letter-spacing: 0;
    background: rgba(0, 0, 0, 0.85);
  }
}

/* ===================================================================
   高分辨率适配（2026-11-20 重构）
   已废弃「body 全局 zoom 等比放大」方案——2K/4K 不是拉大版 1080P。
   现行方案：style-responsive.css 末尾的「高分辨率分档适配」
   （≥2000px 2K 档 / ≥3200px 4K 档）：控件尺寸设上限微调，
   多余屏幕空间全部让给主内容区横向舒展与每行信息数量。
   =================================================================== */

/* 弹窗关闭按钮：统一加大热区与字号（ID 特异性压过后续表级样式） */
#modal-layer .modal-x {
  width: 34px; height: 34px; min-width: 34px; padding: 0;
  border-radius: 50%; display: grid; place-items: center;
  font-size: 18px; line-height: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(180, 200, 255, 0.22);
}
