/* ============================================================
   《问道长生》v1.6 · 插画卡牌斗法舞台
   仅作用于 .modal.combat-modal（由 js/ui/modals.js 传入固定类名）
   规范色：宣纸 #f3ecdb / 深青 #244d52 / 古金 #9a7412 / 朱砂 #a8362c
   动效只用 transform 与 opacity
   ============================================================ */

.modal.combat-modal {
  --duel-paper: #f3ecdb;
  --duel-paper-deep: #e9dfc8;
  --duel-teal: #244d52;
  --duel-teal-soft: #3f6f57;
  --duel-gold: #9a7412;
  --duel-cinnabar: #a8362c;
  --duel-ink: #2b2620;
  --duel-soft: #5a5248;
  --duel-faint: #8a8072;
  position: relative;
  width: calc(100vw - 40px) !important;
  max-width: 1040px !important;
  padding: 18px 20px 18px !important;
  border: 1px solid rgba(154, 116, 18, 0.75) !important;
  border-radius: 5px !important;
  background:
    radial-gradient(ellipse at 18% 0%, rgba(36, 77, 82, 0.07), transparent 48%),
    radial-gradient(ellipse at 86% 100%, rgba(168, 54, 44, 0.05), transparent 52%),
    repeating-linear-gradient(0deg, rgba(91, 82, 72, 0.018) 0 1px, transparent 1px 4px),
    var(--duel-paper) !important;
  box-shadow:
    0 18px 52px rgba(43, 38, 32, 0.42),
    inset 0 0 0 4px rgba(255, 252, 242, 0.62),
    inset 0 0 0 5px rgba(154, 116, 18, 0.16);
  animation: duel-modal-in 0.28s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}

/* 战斗行动后的重渲染：整框不再入场，避免连续闪动 */
.modal.combat-modal.modal-still {
  animation: none !important;
}

.modal.combat-modal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg,
    transparent,
    rgba(168, 54, 44, 0.68) 18%,
    rgba(154, 116, 18, 0.55) 50%,
    rgba(168, 54, 44, 0.68) 82%,
    transparent);
  pointer-events: none;
}

.modal.combat-modal h1 {
  margin-bottom: 2px;
  color: var(--duel-cinnabar);
  font-size: 23px;
  letter-spacing: 0.32em;
  text-shadow: 0 1px 0 rgba(255, 252, 242, 0.85);
  overflow-wrap: anywhere;
}

.modal.combat-modal h1::before {
  content: "◈ ";
  color: var(--duel-gold);
  font-size: 0.62em;
  letter-spacing: 0;
}

.modal.combat-modal .sub {
  margin-bottom: 12px;
  color: var(--duel-soft);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.modal.combat-modal .sub .ico-tag {
  width: 13px;
  height: 13px;
  color: var(--duel-gold);
}

.modal.combat-modal .body {
  font-size: 15px;
}

.modal.combat-modal .btn {
  transition: transform 0.15s, opacity 0.15s;
}

/* ---------- 斗法舞台 ---------- */
.combat-stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 14px 14px 11px;
  border: 1px solid rgba(154, 116, 18, 0.5);
  border-radius: 4px;
  background:
    radial-gradient(ellipse at 50% 112%, rgba(36, 77, 82, 0.12), transparent 56%),
    radial-gradient(ellipse at 50% -12%, rgba(154, 116, 18, 0.08), transparent 48%),
    linear-gradient(180deg, rgba(255, 252, 242, 0.78), rgba(233, 223, 200, 0.55));
  box-shadow:
    inset 0 0 0 1px rgba(255, 252, 242, 0.82),
    inset 0 0 34px rgba(154, 116, 18, 0.045),
    0 2px 7px rgba(43, 38, 32, 0.06);
}

.combat-stage::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 36%;
  z-index: 0;
  background:
    radial-gradient(ellipse at 18% 100%, rgba(36, 77, 82, 0.1), transparent 58%),
    radial-gradient(ellipse at 74% 108%, rgba(36, 77, 82, 0.08), transparent 56%);
  pointer-events: none;
}

.combat-stage::after {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 9px;
  height: 1px;
  z-index: 0;
  background: linear-gradient(90deg, transparent, rgba(154, 116, 18, 0.35), transparent);
  pointer-events: none;
}

.combat-stage.is-boss {
  border-color: rgba(168, 54, 44, 0.42);
  box-shadow:
    inset 0 0 0 1px rgba(255, 252, 242, 0.82),
    inset 0 0 42px rgba(168, 54, 44, 0.055),
    0 2px 7px rgba(43, 38, 32, 0.06);
}

.combat-stage.is-phase2 .duel-enemy .duel-portrait {
  border-color: rgba(168, 54, 44, 0.55);
}

.duel-arena {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 220px) minmax(0, 1fr);
  gap: 14px;
  align-items: end;
}

.duel-side {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.duel-center {
  min-width: 0;
  align-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

/* ---------- 插画框 ---------- */
.duel-portrait {
  position: relative;
  height: clamp(170px, 24vw, 280px);
  min-width: 0;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border: 1px solid rgba(154, 116, 18, 0.36);
  border-radius: 3px 3px 1px 1px;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(154, 116, 18, 0.13), transparent 62%),
    linear-gradient(180deg, rgba(255, 252, 242, 0.45), rgba(233, 223, 200, 0.35));
}

.duel-portrait::before {
  content: "";
  position: absolute;
  top: 7px;
  right: 7px;
  bottom: 0;
  left: 7px;
  z-index: 3;
  border: 1px solid rgba(154, 116, 18, 0.24);
  border-bottom: none;
  pointer-events: none;
}

.duel-portrait::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 0;
  height: 1px;
  z-index: 3;
  background: linear-gradient(90deg, transparent, rgba(36, 77, 82, 0.35), transparent);
  pointer-events: none;
}

.player-portrait {
  background:
    radial-gradient(ellipse at 50% 104%, rgba(36, 77, 82, 0.12), transparent 62%),
    radial-gradient(ellipse at 50% 12%, rgba(255, 252, 242, 0.75), transparent 55%),
    linear-gradient(180deg, rgba(255, 252, 242, 0.55), rgba(233, 223, 200, 0.4));
}

.enemy-portrait {
  background:
    radial-gradient(ellipse at 50% 104%, rgba(168, 54, 44, 0.1), transparent 62%),
    radial-gradient(ellipse at 50% 10%, rgba(255, 252, 242, 0.7), transparent 52%),
    linear-gradient(180deg, rgba(255, 252, 242, 0.48), rgba(233, 223, 200, 0.42));
}

.portrait-wash {
  position: absolute;
  left: 50%;
  bottom: -12%;
  z-index: 1;
  width: 76%;
  height: 44%;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(43, 38, 32, 0.14), transparent 68%);
  pointer-events: none;
}

.duel-art {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 8px 12px rgba(43, 38, 32, 0.18));
  -webkit-user-select: none;
  user-select: none;
}

.mark-portrait {
  align-items: center;
}

.duel-beast-mark {
  position: relative;
  z-index: 2;
  width: min(64%, 200px);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.duel-beast-ico {
  position: relative;
  z-index: 2;
  width: 52%;
  height: 52%;
  color: var(--duel-teal);
  stroke-width: 1.15;
  filter: drop-shadow(0 4px 8px rgba(43, 38, 32, 0.16));
}

.duel-beast-glyph {
  position: relative;
  z-index: 2;
  color: var(--duel-teal);
  font-size: 54px;
  line-height: 1;
}

/* 五行纹阵：外环刻度 + 内环虚线 + 五枚元素印 */
.element-array {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  border: 1px solid rgba(154, 116, 18, 0.5);
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg,
    rgba(154, 116, 18, 0.2) 0deg 1deg,
    transparent 1deg 30deg);
  box-shadow:
    inset 0 0 0 7px rgba(255, 252, 242, 0.28),
    inset 0 0 18px rgba(154, 116, 18, 0.06);
}

.element-array::before {
  content: "";
  position: absolute;
  top: 15%;
  right: 15%;
  bottom: 15%;
  left: 15%;
  border: 1px dashed rgba(36, 77, 82, 0.32);
  border-radius: 50%;
}

.element-array::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1px;
  height: 70%;
  transform: translate(-50%, -50%) rotate(36deg);
  background: linear-gradient(180deg, transparent, rgba(154, 116, 18, 0.25), transparent);
}

.element-array .rune {
  position: absolute;
  z-index: 3;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(154, 116, 18, 0.38);
  border-radius: 50%;
  background: var(--duel-paper);
  color: var(--duel-faint);
  font-style: normal;
  font-size: 11px;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(43, 38, 32, 0.08);
}

.element-array .rune-1 { top: 4%; left: 50%; }
.element-array .rune-2 { top: 32%; left: 94%; }
.element-array .rune-3 { top: 84%; left: 78%; }
.element-array .rune-4 { top: 84%; left: 22%; }
.element-array .rune-5 { top: 32%; left: 6%; }

.element-array .rune.on {
  border-color: var(--duel-cinnabar);
  background: #fff8e8;
  color: var(--duel-cinnabar);
  box-shadow: 0 0 0 2px rgba(168, 54, 44, 0.08), 0 1px 2px rgba(43, 38, 32, 0.1);
}

.duel-element-badge {
  position: absolute;
  left: 8px;
  bottom: 7px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  border: 1px solid rgba(154, 116, 18, 0.45);
  border-radius: 999px;
  background: rgba(243, 236, 219, 0.88);
  color: var(--duel-soft);
  font-size: 11px;
  letter-spacing: 0.08em;
  line-height: 1.7;
}

.duel-element-badge .ico {
  width: 12px;
  height: 12px;
  color: var(--duel-gold);
}

/* ---------- 名牌与气血 ---------- */
.duel-nameplate {
  padding: 7px 9px 8px;
  border: 1px solid rgba(154, 116, 18, 0.38);
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(255, 252, 242, 0.82), rgba(243, 236, 219, 0.64));
  box-shadow: inset 0 0 0 1px rgba(255, 252, 242, 0.65);
}

.player-plate { border-left: 2px solid rgba(36, 77, 82, 0.55); }
.enemy-plate { border-left: 2px solid rgba(168, 54, 44, 0.55); }

.duel-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  font-size: 14.5px;
  line-height: 1.45;
}

.duel-name b {
  color: var(--duel-ink);
  font-weight: 700;
  letter-spacing: 0.09em;
  overflow-wrap: anywhere;
}

.enemy-plate .duel-name b { color: var(--duel-cinnabar); }

.duel-role {
  color: var(--duel-faint);
  font-size: 11.5px;
  letter-spacing: 0.08em;
}

.duel-name .momentum {
  margin-left: auto;
  gap: 2px;
}

.duel-name .momentum i {
  width: 7px;
  height: 7px;
  border-color: var(--duel-gold);
}

.duel-name .momentum i.on {
  background: var(--duel-gold);
  box-shadow: none;
}

.duel-vitals { margin-top: 5px; }

.duel-vital-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  color: var(--duel-soft);
  font-size: 11.5px;
  line-height: 1.5;
}

.duel-vital-line b {
  color: var(--duel-ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.duel-bar {
  position: relative;
  height: 10px;
  margin: 2px 0 5px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(43, 38, 32, 0.12);
  box-shadow: inset 0 1px 2px rgba(43, 38, 32, 0.14);
}

.duel-bar > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 2px;
  transition: none;
}

.duel-bar > i::after {
  content: "";
  display: block;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent);
}

.duel-bar.hp > i {
  background: linear-gradient(90deg, #8f2c23, var(--duel-cinnabar));
}

.duel-bar.mp > i {
  background: linear-gradient(90deg, var(--duel-teal), var(--duel-teal-soft));
}

.duel-nameplate .momentum-note {
  margin-top: 3px;
  color: var(--duel-gold);
  font-size: 11.5px;
}

/* ---------- 中央意图 ---------- */
.duel-vs {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(154, 116, 18, 0.58);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 252, 242, 0.95), rgba(233, 223, 200, 0.65));
  color: var(--duel-cinnabar);
  font-size: 16px;
  line-height: 1;
  box-shadow: inset 0 0 0 3px rgba(255, 252, 242, 0.55);
}

.duel-vs::before,
.duel-vs::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 22px;
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(154, 116, 18, 0.4), transparent);
}

.duel-vs::before { top: -9px; }
.duel-vs::after { bottom: -9px; }

.duel-intent.intent-card {
  width: 100%;
  padding: 11px 10px 10px;
  border: 1px solid rgba(154, 116, 18, 0.55);
  border-top: 3px solid var(--duel-cinnabar);
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(255, 252, 242, 0.92), rgba(243, 236, 219, 0.75));
  box-shadow:
    0 3px 12px rgba(43, 38, 32, 0.1),
    inset 0 0 0 1px rgba(255, 252, 242, 0.6);
}

.duel-intent .intent-label {
  color: var(--duel-gold);
  font-size: 10.5px;
  letter-spacing: 0.32em;
}

.duel-intent .intent-main {
  gap: 5px;
  margin: 3px 0 2px;
  color: var(--duel-teal);
  font-size: 16.5px;
}

.duel-intent .intent-main .intent-ico {
  width: 19px;
  height: 19px;
}

.duel-intent .intent-desc {
  color: var(--duel-soft);
  font-size: 12px;
  line-height: 1.55;
}

.duel-intent.intent-heavy {
  border-color: rgba(168, 54, 44, 0.6);
  border-top-color: var(--duel-cinnabar);
  background: linear-gradient(180deg, rgba(168, 54, 44, 0.1), rgba(243, 236, 219, 0.82));
}

.duel-intent.intent-heavy .intent-main { color: var(--duel-cinnabar); }

.duel-intent.intent-cast {
  border-color: rgba(36, 77, 82, 0.55);
  border-top-color: var(--duel-teal);
  background: linear-gradient(180deg, rgba(36, 77, 82, 0.09), rgba(243, 236, 219, 0.82));
}

.duel-intent.intent-cast .intent-main { color: var(--duel-teal); }

.duel-intent.intent-heal {
  border-color: rgba(154, 116, 18, 0.55);
  border-top-color: var(--duel-gold);
  background: linear-gradient(180deg, rgba(154, 116, 18, 0.1), rgba(243, 236, 219, 0.82));
}

.duel-intent.intent-heal .intent-main { color: var(--duel-gold); }

.duel-intent.intent-guard {
  border-color: rgba(36, 77, 82, 0.5);
  border-top-color: var(--duel-teal);
  background: linear-gradient(180deg, rgba(36, 77, 82, 0.08), rgba(243, 236, 219, 0.82));
}

.duel-intent.intent-guard .intent-main { color: var(--duel-teal); }

.duel-intent.intent-drain {
  border-color: rgba(168, 54, 44, 0.5);
  border-top-color: #7a2a22;
  background: linear-gradient(180deg, rgba(122, 42, 34, 0.09), rgba(243, 236, 219, 0.82));
}

.duel-intent.intent-drain .intent-main { color: #7a2a22; }

.combat-stage .combat-hint {
  position: relative;
  z-index: 1;
  margin: 10px 0 0;
  padding-top: 7px;
  border-top: 1px dashed rgba(154, 116, 18, 0.28);
  color: var(--duel-faint);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  line-height: 1.6;
  text-align: center;
}

/* ---------- 战报（默认折叠） ---------- */
.battle-log-wrap { margin-top: 9px; }

.combat-log-details > summary.battle-log-head {
  list-style: none;
  padding: 5px 9px;
  border: 1px solid rgba(154, 116, 18, 0.28);
  border-radius: 2px;
  background: rgba(255, 252, 242, 0.42);
  cursor: pointer;
}

.combat-log-details > summary.battle-log-head::-webkit-details-marker { display: none; }

.combat-log-details > summary.battle-log-head:hover {
  background: rgba(255, 252, 242, 0.72);
}

.combat-log-details[open] > summary.battle-log-head {
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

.combat-log-details .log-arrow {
  display: inline-block;
  color: var(--duel-gold);
  font-size: 10px;
  transition: transform 0.15s;
}

.combat-log-details[open] .log-arrow { transform: rotate(90deg); }

.combat-log-details .log-title { flex: 1; }

.combat-log-details .battle-log { margin-top: 5px; }

.battle-log-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px 3px;
  color: var(--duel-gold);
  font-size: 11px;
  letter-spacing: 0.28em;
}

.battle-log-head span:last-child {
  color: var(--duel-faint);
  letter-spacing: 0.12em;
}

.modal.combat-modal .battle-log {
  max-height: 118px;
  overflow-y: auto;
  padding: 7px 10px;
  border: 1px solid rgba(154, 116, 18, 0.28);
  border-left: 3px solid rgba(36, 77, 82, 0.55);
  border-radius: 2px;
  background: rgba(255, 252, 242, 0.55);
  color: var(--duel-soft);
  font-size: 12.5px;
  line-height: 1.62;
}

.modal.combat-modal .battle-log .lg-gold { color: var(--duel-gold); }
.modal.combat-modal .battle-log .lg-red { color: var(--duel-cinnabar); }
.modal.combat-modal .battle-log .lg-cyan,
.modal.combat-modal .battle-log .lg-green,
.modal.combat-modal .battle-log .lg-purple { color: var(--duel-teal); }
.modal.combat-modal .battle-log .lg-gray { color: var(--duel-faint); }

/* ---------- 招式牌 ---------- */
.combat-actions.duel-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 10px;
}

.skill-hand {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.skill-hand-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px;
}

.skill-hand-title {
  color: var(--duel-gold);
  font-size: 12px;
  letter-spacing: 0.3em;
}

.skill-hand-note {
  color: var(--duel-faint);
  font-size: 10.5px;
}

.modal.combat-modal .skill-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.modal.combat-modal .skill-btn.skill-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  margin: 0;
  padding: 9px 10px 8px;
  border: 1px solid rgba(154, 116, 18, 0.42);
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(255, 252, 242, 0.95), rgba(239, 229, 208, 0.78));
  box-shadow:
    inset 0 0 0 1px rgba(255, 252, 242, 0.55),
    0 1px 3px rgba(43, 38, 32, 0.07);
  color: var(--duel-ink);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.15s, opacity 0.15s;
}

.modal.combat-modal .skill-btn.skill-card::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(154, 116, 18, 0.45), transparent);
  pointer-events: none;
}

@media (hover: hover) {
  .modal.combat-modal .skill-btn.skill-card:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: var(--duel-cinnabar);
  }
}

.modal.combat-modal .skill-btn.skill-card:active:not(:disabled) {
  transform: translateY(0);
}

.modal.combat-modal .skill-btn.skill-card:disabled,
.modal.combat-modal .skill-btn.skill-card.low-mp:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  border-color: rgba(138, 128, 114, 0.35);
  background: linear-gradient(180deg, rgba(243, 236, 219, 0.7), rgba(233, 223, 200, 0.65));
  box-shadow: none;
  transform: none;
}

.modal.combat-modal .skill-btn.skill-card:disabled::before {
  opacity: 0;
}

.sk-top {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  min-width: 0;
}

.sk-top .sk-ico {
  width: 15px;
  height: 15px;
  margin-top: 2px;
  color: var(--duel-gold);
}

.sk-name {
  display: block;
  min-width: 0;
  color: var(--duel-ink);
  font-size: 13.5px;
  letter-spacing: 0.02em;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.sk-meta {
  display: block;
  color: var(--duel-faint);
  font-size: 10.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.sk-cost {
  display: block;
  width: 100%;
  margin-top: auto;
  padding-top: 3px;
  border-top: 1px dashed rgba(154, 116, 18, 0.24);
  color: var(--duel-gold);
  font-size: 10px;
  line-height: 1.5;
  text-align: right;
}

.sk-cost b {
  font-size: 12px;
  font-weight: 700;
}

.sk-cost.lack { color: var(--duel-cinnabar); }

.skill-card:disabled .sk-name,
.skill-card:disabled .sk-meta { color: var(--duel-faint); }

.skill-card:disabled .sk-cost { color: var(--duel-cinnabar); }
.skill-card:disabled .sk-cost b { color: var(--duel-cinnabar); }

.modal.combat-modal .combat-empty {
  padding: 10px;
  border: 1px dashed rgba(154, 116, 18, 0.3);
  border-radius: 2px;
  background: rgba(255, 252, 242, 0.5);
  color: var(--duel-faint);
  font-size: 12.5px;
  text-align: center;
}

/* ---------- 行动牌 ---------- */
.duel-main-acts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.duel-main-acts .btn {
  min-width: 0;
  margin: 0;
  padding: 8px 8px 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  letter-spacing: 0.08em;
}

.duel-act-btn .act-name { font-size: 14px; }

.duel-act-btn .act-sub {
  color: var(--duel-faint);
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

.duel-act-btn.btn.primary .act-sub {
  color: rgba(255, 252, 242, 0.85);
}

.duel-subacts {
  display: flex;
}

.duel-subacts .btn {
  flex: 0 1 auto;
  min-width: 120px;
  margin: 0;
  padding: 6px 12px;
  font-size: 12.5px;
  letter-spacing: 0.12em;
}

.modal.combat-modal .combat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding-top: 1px;
}

.modal.combat-modal .combat-pills .btn.small {
  flex: 0 1 auto;
  margin: 0;
}

/* ---------- 战果 ---------- */
.duel-result {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.modal.combat-modal .combat-rewards {
  padding: 9px 11px;
  border: 1px solid rgba(154, 116, 18, 0.45);
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(154, 116, 18, 0.08), rgba(255, 252, 242, 0.62));
  margin-bottom: 0;
}

.duel-result .duel-leave { margin: 0; }

/* ---------- 行动反馈（仅 transform / opacity） ---------- */
.impact-flash,
.guard-ripple {
  position: absolute;
  left: 50%;
  top: 48%;
  z-index: 5;
  width: 88px;
  height: 88px;
  margin: -44px 0 0 -44px;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.impact-flash {
  border: 1px solid rgba(168, 54, 44, 0.42);
  background: radial-gradient(circle,
    rgba(168, 54, 44, 0.3) 0 10%,
    rgba(168, 54, 44, 0.14) 28%,
    transparent 62%);
  transform: scale(0.5);
}

.guard-ripple {
  border: 1px solid rgba(36, 77, 82, 0.5);
  background: radial-gradient(circle,
    transparent 42%,
    rgba(36, 77, 82, 0.14) 58%,
    rgba(36, 77, 82, 0.28) 70%,
    transparent 74%);
  transform: scale(0.7);
}

.modal.combat-modal .dmg-float {
  top: 46%;
  right: 10px;
  z-index: 6;
  font-size: 21px;
}

.modal.combat-modal .dmg-float.crit { font-size: 27px; }

.combat-stage.fx-strike .duel-enemy .duel-art {
  animation: duel-strike 0.34s ease-out both;
}

.combat-stage.fx-strike .duel-enemy .impact-flash {
  animation: duel-impact 0.42s ease-out both;
}

.combat-stage.fx-hurt .duel-player .duel-art {
  animation: duel-hurt 0.34s ease-out both;
}

.combat-stage.fx-hurt .duel-player .impact-flash {
  animation: duel-impact 0.42s ease-out both;
}

.combat-stage.fx-guard .duel-player .guard-ripple {
  animation: duel-guard 0.5s ease-out both;
}

.combat-stage.fx-guard .duel-player .duel-art {
  animation: duel-brace 0.36s ease-out both;
}

.combat-stage.fx-crit .impact-flash {
  animation-duration: 0.58s;
}

.combat-stage.fx-crit .dmg-float {
  font-size: 27px;
  color: #8f2c23;
}

/* 首次入场：仅在没有 modal-still 时播放，战斗重渲染不会重放 */
.modal.combat-modal:not(.modal-still) .duel-player {
  animation: duel-enter-left 0.34s ease-out both;
}

.modal.combat-modal:not(.modal-still) .duel-enemy {
  animation: duel-enter-right 0.34s ease-out both;
}

.modal.combat-modal:not(.modal-still) .duel-center {
  animation: duel-enter-center 0.4s ease-out both;
}

@keyframes duel-modal-in {
  from { opacity: 0; transform: scale(0.985) translateY(6px); }
  to { opacity: 1; transform: none; }
}

@keyframes duel-enter-left {
  from { opacity: 0; transform: translateX(-14px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes duel-enter-right {
  from { opacity: 0; transform: translateX(14px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes duel-enter-center {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes duel-strike {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(7px); }
  42% { transform: translateX(-4px); }
  64% { transform: translateX(3px); }
}

@keyframes duel-hurt {
  0%, 100% { transform: translateX(0); }
  18% { transform: translateX(-8px); }
  40% { transform: translateX(5px); }
  62% { transform: translateX(-3px); }
}

@keyframes duel-brace {
  0%, 100% { transform: scale(1); }
  26% { transform: scale(1.025); }
  48% { transform: scale(0.992); }
}

@keyframes duel-impact {
  0% { opacity: 0; transform: scale(0.55); }
  22% { opacity: 1; transform: scale(1.08); }
  100% { opacity: 0; transform: scale(1.45); }
}

@keyframes duel-guard {
  0% { opacity: 0; transform: scale(0.65); }
  30% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.28); }
}

/* ---------- 新游戏向导首屏：浅高山河横幅 ---------- */
.welcome-banner {
  position: relative;
  height: 100px;
  margin: 2px 0 14px;
  overflow: hidden;
  border: 1px solid rgba(154, 116, 18, 0.45);
  border-radius: 3px;
  background: #e9dfc8;
  box-shadow:
    inset 0 0 0 1px rgba(255, 252, 242, 0.6),
    0 6px 16px rgba(43, 38, 32, 0.1);
}

.welcome-landscape {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
}

.welcome-banner::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(243, 236, 219, 0.06),
    transparent 35%,
    rgba(36, 77, 82, 0.16));
}

@media (max-width: 480px) {
  .welcome-banner {
    height: 80px;
    margin-bottom: 12px;
  }
}

/* ---------- 手机：375 宽无横向溢出 ---------- */
@media (max-width: 720px) {
  .modal.combat-modal {
    padding: 14px 13px 15px !important;
  }

  .modal.combat-modal h1 {
    font-size: 20px;
    letter-spacing: 0.26em;
  }

  .modal.combat-modal .sub {
    margin-bottom: 9px;
    font-size: 12px;
  }

  .combat-stage {
    padding: 10px 9px 9px;
  }

  .duel-arena {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "player enemy"
      "intent intent";
    gap: 8px;
    align-items: stretch;
  }

  .duel-player { grid-area: player; }
  .duel-enemy { grid-area: enemy; }

  .duel-center {
    grid-area: intent;
    align-self: stretch;
    margin-top: 2px;
  }

  .duel-vs { display: none; }

  .duel-portrait {
    height: 120px;
  }

  .duel-intent.intent-card {
    padding: 8px 9px;
    border-top-width: 2px;
  }

  .duel-name { font-size: 13px; }
  .duel-role { font-size: 10.5px; }
  .duel-vital-line { font-size: 10.5px; }
  .duel-bar { height: 9px; }

  .duel-element-badge {
    padding: 0 6px;
    font-size: 10px;
  }

  .modal.combat-modal .skill-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .duel-main-acts { gap: 5px; }
  .duel-main-acts .btn { padding: 7px 4px 6px; }
  .duel-act-btn .act-name { font-size: 12.5px; }
  .duel-act-btn .act-sub { font-size: 9.5px; }

  .skill-hand-head {
    flex-wrap: wrap;
    gap: 2px 8px;
  }

  .skill-hand-note { font-size: 10px; }

  .modal.combat-modal .battle-log {
    max-height: 108px;
    font-size: 12px;
  }
}

@media (max-width: 380px) {
  .modal.combat-modal {
    padding: 12px 10px 13px !important;
  }

  .combat-stage { padding: 8px 7px 8px; }
  .duel-arena { gap: 6px; }
  .duel-portrait { height: 116px; }

  .duel-name {
    gap: 2px 4px;
    font-size: 12.5px;
  }

  .duel-nameplate { padding: 6px 7px; }
  .duel-vital-line { font-size: 10px; }

  .modal.combat-modal .skill-btn.skill-card { padding: 8px 8px 7px; }
  .sk-name { font-size: 12.5px; }
  .sk-meta { font-size: 10px; }

  .duel-main-acts { grid-template-columns: 1fr 1fr; }
  .duel-main-acts .btn[data-act="auto"] { grid-column: 1 / -1; }
}

/* ---------- 减少动效 / 全局动画开关 ---------- */
@media (prefers-reduced-motion: reduce) {
  .modal.combat-modal,
  .modal.combat-modal *,
  .modal.combat-modal *::before,
  .modal.combat-modal *::after {
    animation: none !important;
    transition: none !important;
  }
}

body.no-anim .modal.combat-modal,
body.no-anim .modal.combat-modal *,
body.no-anim .modal.combat-modal *::before,
body.no-anim .modal.combat-modal *::after {
  animation: none !important;
  transition: none !important;
}
