/* 召唤师峡谷对决 · 暗夜符文游戏主题 v2 */
:root {
  --bg0: #04060f;
  --bg1: #0b1026;
  --bg2: #141a3c;
  --card: rgba(19, 23, 55, .88);
  --card2: rgba(29, 34, 78, .92);
  --line: rgba(138, 118, 255, .26);
  --line-strong: rgba(255, 215, 106, .55);
  --gold: #ffd76a;
  --gold2: #ffb020;
  --violet: #8b7bff;
  --cyan: #4dd6ff;
  --green: #54e29b;
  --red: #ff6b6b;
  --txt: #ece8ff;
  --txt2: #a69fd6;
  --txt3: #6f6aa3;
  --radius: 18px;
  --shadow: 0 12px 34px rgba(0, 0, 0, .42);
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  font-size: 15px;
  color: var(--txt);
  background:
    radial-gradient(900px 480px at 88% -8%, rgba(104, 74, 255, .22), transparent 58%),
    radial-gradient(800px 460px at -10% 110%, rgba(42, 120, 255, .13), transparent 55%),
    linear-gradient(180deg, #080b1d 0%, #04060f 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
button, input, select, textarea { font-family: inherit; font-size: 16px; }
button { cursor: pointer; border: 0; }
.hidden { display: none !important; }

/* 全局符文光点氛围 */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(2px 2px at 20% 30%, rgba(255,255,255,.35), transparent),
    radial-gradient(1.5px 1.5px at 70% 16%, rgba(255,255,255,.28), transparent),
    radial-gradient(2px 2px at 82% 62%, rgba(141,120,255,.4), transparent),
    radial-gradient(1.5px 1.5px at 12% 78%, rgba(141,120,255,.35), transparent),
    radial-gradient(1.5px 1.5px at 45% 88%, rgba(255,215,106,.25), transparent),
    radial-gradient(2px 2px at 60% 42%, rgba(255,255,255,.16), transparent);
}

/* ---------- 登录 ---------- */
#login-view { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; position: relative; z-index: 1; }
.login-box {
  width: 100%; max-width: 380px; text-align: center; position: relative;
  background: linear-gradient(165deg, rgba(35, 38, 92, .92), rgba(13, 15, 40, .94));
  border: 1px solid rgba(150, 130, 255, .35);
  border-radius: 28px; padding: 42px 26px 30px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.04), 0 24px 70px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.08);
}
.login-box::before {
  content: ""; position: absolute; inset: -1px; border-radius: 28px; pointer-events: none;
  background: linear-gradient(120deg, rgba(255,215,106,.5), transparent 30%, transparent 70%, rgba(110,90,255,.55));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; padding: 1px;
}
.logo-ring {
  width: 104px; height: 104px; margin: 0 auto 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(circle, #2b2f72 0%, #151741 60%, #0a0c22 100%);
  border: 2px solid transparent;
  background-clip: padding-box;
  box-shadow: 0 0 0 2px rgba(255,215,106,.55), 0 0 42px rgba(139,123,255,.65), inset 0 0 26px rgba(255,215,106,.16);
  animation: ringGlow 3.6s ease-in-out infinite;
}
@keyframes ringGlow { 0%,100% { box-shadow: 0 0 0 2px rgba(255,215,106,.5), 0 0 26px rgba(139,123,255,.5) } 50% { box-shadow: 0 0 0 2px rgba(255,215,106,.9), 0 0 56px rgba(255,190,70,.8) } }
.logo-ring span { font-size: 50px; filter: drop-shadow(0 0 10px rgba(255,200,80,.8)); }
.login-box h1 {
  font-size: 27px; letter-spacing: 3px;
  background: linear-gradient(180deg, #fff 10%, var(--gold) 70%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-weight: 900;
}
.login-box .sub { color: var(--txt2); margin: 10px 0 22px; font-size: 13px; letter-spacing: 2px; }
.login-msg { color: var(--txt); font-size: 14px; min-height: 22px; margin-bottom: 12px; }
.hint { margin-top: 20px; color: var(--txt3); font-size: 12px; line-height: 1.8; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 18px; border-radius: 14px; font-weight: 800; font-size: 15px;
  color: #fff; position: relative;
  background: linear-gradient(135deg, #6a5cff, #4336c2);
  box-shadow: 0 6px 18px rgba(90, 70, 235, .35), inset 0 1px 0 rgba(255,255,255,.18);
  transition: transform .12s ease, filter .2s ease;
}
.btn:active { transform: scale(.96); }
.btn.primary {
  background: linear-gradient(135deg, #ffd76a 0%, #ff9d3d 100%);
  color: #241a03; box-shadow: 0 6px 20px rgba(255, 170, 50, .4), inset 0 1px 0 rgba(255,255,255,.4);
}
.btn.ghost { background: rgba(255,255,255,.06); border: 1px solid rgba(160,140,255,.35); color: var(--txt2); box-shadow: none; }
.btn.danger { background: linear-gradient(135deg, #ff5f5f, #a62b2b); }
.btn.gold { background: linear-gradient(135deg, #ffd76a, #e89a1f); color: #2b1c02; }
.btn.green { background: linear-gradient(135deg, #54e29b, #1e9e62); }
.btn:disabled { filter: grayscale(.8); opacity: .5; cursor: not-allowed; }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 11px; }

/* ---------- 主壳 ---------- */
#app { min-height: 100vh; position: relative; z-index: 1; padding-bottom: 88px; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(5, 7, 18, .96), rgba(5, 7, 18, .72));
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(138, 118, 255, .2);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 17px; letter-spacing: 1px; }
.brand .brand-ico {
  width: 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #6a5cff, #2a2370);
  box-shadow: 0 0 12px rgba(139,123,255,.6);
  font-size: 16px;
}
.me-chip {
  display: flex; align-items: center; gap: 9px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(138,118,255,.28);
  border-radius: 999px; padding: 4px 12px 4px 5px;
}
.me-chip img { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--gold); background: #232a63; }
.me-chip .me-txt { text-align: right; line-height: 1.15; }
.me-chip b { display: block; font-size: 13px; max-width: 84px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.me-chip .me-gold { font-size: 12px; color: var(--gold); font-weight: 800; }

#content { max-width: 760px; margin: 0 auto; padding: 14px 12px 30px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 14px 2px 12px; }
.section-title h2 {
  font-size: 20px; letter-spacing: 1px;
  background: linear-gradient(90deg, #fff, #c9b8ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.section-title h2::before { content: "✦ "; color: var(--gold); }
.mini { color: var(--txt3); font-size: 12px; }

/* ---------- 卡片 ---------- */
.card {
  position: relative;
  background: linear-gradient(160deg, rgba(30, 34, 78, .92), rgba(16, 18, 44, .94));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 16px; margin-bottom: 13px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.05);
  overflow: hidden;
}
.card::before {
  content: ""; position: absolute; top: 0; left: 14px; right: 14px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,215,106,.6), transparent);
}
.card h3 { font-size: 15px; color: var(--gold); margin-bottom: 11px; letter-spacing: .5px; display: flex; align-items: center; gap: 6px; }
.card.highlight { border-color: var(--line-strong); box-shadow: 0 0 22px rgba(255, 200, 80, .12), var(--shadow); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 14.5px; }
.row .lbl { color: var(--txt2); }
.row .val { color: #fff; font-weight: 700; text-align: right; }
.tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  background: rgba(120, 100, 255, .18); color: #cdc4ff; border: 1px solid rgba(140,120,255,.2);
}
.tag.gold { background: rgba(255, 190, 60, .15); color: var(--gold); border-color: rgba(255,215,106,.35); }
.tag.red { background: rgba(230, 70, 70, .16); color: #ff9c9c; border-color: rgba(255,90,90,.3); }
.tag.green { background: rgba(70, 200, 120, .14); color: var(--green); border-color: rgba(84,226,155,.3); }
.tag.cyan { background: rgba(70, 180, 255, .14); color: var(--cyan); border-color: rgba(77,214,255,.3); }

/* ---------- 召唤师信息条 ---------- */
.summoner-card { display: flex; align-items: center; gap: 14px; }
.summoner-card .sc-avatar {
  width: 66px; height: 66px; border-radius: 20px; flex-shrink: 0;
  border: 2px solid var(--gold); background: linear-gradient(145deg, #333a8f, #171a44);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  box-shadow: 0 0 18px rgba(255, 200, 80, .25);
}
.summoner-card .sc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.summoner-card .sc-info { flex: 1; min-width: 0; }
.sc-name { font-size: 19px; font-weight: 900; color: #fff; }
.sc-lv {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 6px;
  background: linear-gradient(135deg, #ffd76a, #ff9d3d); color: #241a03;
  font-size: 12px; font-weight: 900; border-radius: 8px; padding: 1px 8px;
  vertical-align: 2px;
}
.exp-track { height: 8px; border-radius: 999px; background: rgba(0,0,0,.45); margin: 8px 0 4px; overflow: hidden; border: 1px solid rgba(255,255,255,.08); }
.exp-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #8b7bff, #ffd76a); box-shadow: 0 0 10px rgba(139,123,255,.7); transition: width .5s ease; }
.sc-sub { color: var(--txt2); font-size: 12px; }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex;
  background: rgba(8, 10, 26, .96);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(138, 118, 255, .24);
  padding: 6px 4px calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 30px rgba(0,0,0,.4);
}
.tabbar button {
  flex: 1; background: none; color: var(--txt3);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 4px 2px 6px; border-radius: 14px;
  transition: color .15s ease;
}
.tabbar button i { font-style: normal; font-size: 23px; line-height: 1; filter: grayscale(.4); }
.tabbar button span { font-size: 13px; font-weight: 800; letter-spacing: .5px; }
.tabbar button.active { color: var(--gold); }
.tabbar button.active i { filter: none; text-shadow: 0 0 14px rgba(255, 210, 90, .85); transform: translateY(-1px); }
.tabbar button.active span { text-shadow: 0 0 10px rgba(255, 210, 90, .5); }

/* ---------- 英雄 ---------- */
.hero-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.hero-card {
  position: relative; border-radius: 18px; overflow: hidden;
  background: linear-gradient(165deg, rgba(58, 50, 128, .72), rgba(15, 16, 40, .95));
  border: 1px solid rgba(145, 125, 255, .28);
  padding: 0 0 12px;
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
}
.hero-card.locked { filter: saturate(.2) brightness(.6); }
.hero-card.active { border-color: var(--gold); box-shadow: 0 0 26px rgba(255, 200, 80, .3), 0 10px 28px rgba(0,0,0,.35); }
.hero-art {
  position: relative; height: 116px;
  display: flex; align-items: center; justify-content: center;
  font-size: 58px;
  background:
    radial-gradient(circle at 30% 20%, rgba(110, 92, 230, .55), transparent 55%),
    linear-gradient(180deg, #241f57, #121234);
  overflow: hidden;
}
.hero-art::after {
  content: ""; position: absolute; left: -30%; right: -30%; top: -80%; height: 130%;
  background: linear-gradient(115deg, transparent 42%, rgba(255,255,255,.13) 50%, transparent 58%);
  animation: shine 5.5s ease-in-out infinite;
}
@keyframes shine { 0%, 55% { transform: translateY(-20%); } 75%, 100% { transform: translateY(130%); } }
.hero-art img { width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 1; }
.hero-card .nm { font-weight: 900; color: #fff; font-size: 16px; padding: 9px 12px 0; }
.hero-card .tt { font-size: 12px; color: var(--txt2); padding: 1px 12px 9px; }
.hero-card .act { display: flex; gap: 8px; padding: 0 12px; }
.hero-card .act .btn { flex: 1; }
.badge-active {
  position: absolute; top: 9px; right: 9px; z-index: 3;
  background: linear-gradient(135deg, #ffd76a, #ff9d3d); color: #241a03;
  font-size: 12px; font-weight: 900; padding: 3px 10px; border-radius: 999px;
  box-shadow: 0 3px 10px rgba(255, 180, 60, .5);
}

/* ---------- 属性与装备 ---------- */
.stat-row { display: flex; align-items: center; gap: 9px; padding: 8px 0; border-bottom: 1px dashed rgba(138,118,255,.14); }
.stat-row .s-ico { width: 32px; height: 32px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; background: rgba(120,100,255,.14); flex-shrink: 0; }
.stat-row .s-name { width: 42px; color: var(--txt2); font-size: 13px; }
.stat-row .s-val { flex: 1; color: #fff; font-weight: 800; font-size: 15px; }
.stat-row .s-add { color: var(--green); font-size: 12px; font-weight: 700; min-width: 42px; text-align: right; }
.stat-row .s-btns { display: flex; gap: 7px; }
.stat-row .s-btns button {
  width: 32px; height: 32px; border-radius: 10px; font-weight: 900; font-size: 17px;
  background: rgba(120,100,255,.2); color: #fff; border: 1px solid rgba(140,120,255,.3);
}
.stat-row .s-btns button:disabled { opacity: .3; }

/* ---------- 战斗 ---------- */
#battle-view { min-height: 100vh; display: flex; flex-direction: column; position: relative; z-index: 1; background: radial-gradient(800px 500px at 50% -10%, rgba(84, 66, 190, .28), transparent 65%), linear-gradient(180deg, #0a0d24, #05060f 70%); }
.battle-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; background: rgba(5,7,18,.7); backdrop-filter: blur(8px); }
.battle-title { font-weight: 900; font-size: 16px; color: var(--gold); letter-spacing: 2px; }
.arena { flex: 1; display: flex; align-items: flex-start; justify-content: space-between; padding: 18px 14px 6px; position: relative; min-height: 300px; }
#fx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }
.unit { width: 42%; text-align: center; position: relative; z-index: 2; }
.unit .u-avatar {
  width: 116px; height: 116px; margin: 0 auto; border-radius: 24px;
  display: flex; align-items: center; justify-content: center; font-size: 54px;
  background: radial-gradient(circle at 35% 25%, #6b58e0, #181545);
  border: 3px solid #8b7bff; overflow: hidden;
  box-shadow: 0 0 28px rgba(120, 95, 255, .45), inset 0 0 18px rgba(0,0,0,.4);
}
.unit .u-avatar img { width: 100%; height: 100%; object-fit: cover; }
.unit .u-name { font-weight: 900; color: #fff; margin: 9px 0 2px; font-size: 16px; }
.unit .u-title { font-size: 11px; color: var(--txt2); margin-bottom: 8px; }
.hpbar { height: 16px; background: rgba(0, 0, 0, .55); border-radius: 999px; overflow: hidden; border: 1px solid rgba(255,255,255,.16); position: relative; }
.hpfill { height: 100%; width: 100%; background: linear-gradient(90deg, #2ec97a, #a2f5c2); border-radius: 999px; transition: width .5s ease; }
.unit.right .hpfill { background: linear-gradient(90deg, #ff4d4d, #ffb199); }
.hptext { font-size: 12px; color: var(--txt); margin-top: 5px; font-weight: 700; }
.u-buffs { margin-top: 8px; min-height: 22px; display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }
.vs {
  position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%);
  font-size: 34px; font-weight: 900; font-style: italic;
  background: linear-gradient(180deg, #ffd76a, #ff8a3d);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 12px rgba(255,180,60,.6));
}
.log {
  flex: 1; max-height: 190px; overflow-y: auto; margin: 8px 14px;
  background: rgba(0, 0, 0, .42); border-radius: 14px; padding: 9px 12px;
  font-size: 13px; color: #cfc9f4; line-height: 1.8; border: 1px solid rgba(130,110,255,.16);
}
.log .ev-act { color: var(--gold); font-weight: 700; }
.log .ev-dmg { color: #ff9d9d; }
.log .ev-heal { color: var(--green); }
.log .ev-shield { color: var(--cyan); }
.log .ev-cc { color: #ffb066; }
.log .ev-finish { color: var(--gold); font-weight: 900; font-size: 15px; text-align: center; }
.log .ev-soul { color: #c6a0ff; }
.unit.lunge-left { animation: lungeL .32s ease; }
.unit.lunge-right { animation: lungeR .32s ease; }
@keyframes lungeL { 0% { transform: translateX(0) } 45% { transform: translateX(16px) } 100% { transform: translateX(0) } }
@keyframes lungeR { 0% { transform: translateX(0) } 45% { transform: translateX(-16px) } 100% { transform: translateX(0) } }
.dmg-pop { position: absolute; font-weight: 900; color: #ff8a5c; font-size: 26px; animation: popUp .8s ease forwards; text-shadow: 0 0 10px rgba(255, 80, 40, .85); pointer-events: none; }
@keyframes popUp { 0% { opacity: 1; transform: translateY(0) scale(1) } 100% { opacity: 0; transform: translateY(-52px) scale(1.35) } }

.actions {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px;
  padding: 10px 12px calc(14px + env(safe-area-inset-bottom));
  background: rgba(7, 9, 22, .94); backdrop-filter: blur(12px);
  border-top: 1px solid rgba(138, 118, 255, .18);
}
.actions .btn {
  width: 100%; padding: 11px 4px; border-radius: 15px;
  flex-direction: column; gap: 3px; font-size: 14px; min-height: 68px;
}
.actions .btn b {
  width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 900; background: rgba(255,255,255,.16); color: #fff;
  box-shadow: inset 0 0 8px rgba(0,0,0,.25);
}
.actions .btn small { font-size: 10px; opacity: .9; font-weight: 600; line-height: 1.2; }
.actions .btn.skill-r { background: linear-gradient(135deg, #e0493b, #6d1212); box-shadow: 0 6px 20px rgba(230, 70, 50, .4), inset 0 1px 0 rgba(255,255,255,.16); }
.actions .btn.skill-q { background: linear-gradient(135deg, #2e7be0, #123a75); }
.actions .btn.skill-w { background: linear-gradient(135deg, #2ea86b, #0e5232); }
.actions .btn.skill-e { background: linear-gradient(135deg, #d9822e, #7a3d0b); }
.actions .btn.basic-a { background: linear-gradient(135deg, #6a5cff, #332a8c); }
.actions .btn.locked { filter: grayscale(1); opacity: .42; }
.battle-tip { text-align: center; padding: 7px; font-size: 13px; color: var(--txt2); background: rgba(7,9,22,.8); font-weight: 600; }

/* ---------- 弹层 ---------- */
#sheet { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, .62); backdrop-filter: blur(4px); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; color: #fff; border-bottom: 1px solid rgba(138,118,255,.2); }
.sheet-head b { font-size: 17px; }
.sheet-head button { background: none; color: var(--txt2); font-size: 20px; width: 36px; height: 36px; border-radius: 12px; }
.sheet-body { width: 100%; max-width: 640px; background: linear-gradient(180deg, #1c2150, #101233); border-radius: 24px 24px 0 0; max-height: 84vh; overflow-y: auto; border: 1px solid rgba(138,118,255,.3); border-bottom: 0; box-shadow: 0 -14px 50px rgba(0,0,0,.5); }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--txt2); margin-bottom: 6px; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border-radius: 13px; border: 1px solid rgba(138,118,255,.32);
  background: rgba(8, 10, 26, .72); color: #fff; outline: none;
}
.field input:focus, .field textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255,215,106,.12); }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 112px; transform: translateX(-50%); z-index: 90;
  background: linear-gradient(135deg, rgba(28, 30, 74, .97), rgba(15, 17, 44, .97));
  border: 1px solid rgba(255, 215, 106, .55); color: #fff; padding: 12px 22px;
  border-radius: 14px; font-size: 14.5px; font-weight: 600;
  box-shadow: 0 10px 36px rgba(0,0,0,.5), 0 0 20px rgba(255,190,70,.12);
}

@media (min-width: 680px) {
  .hero-grid { grid-template-columns: repeat(3, 1fr); }
  .arena { min-height: 380px; }
  .unit .u-avatar { width: 150px; height: 150px; }
}

/* ---------- 页面子导航 ---------- */
.subnav {
  display: flex; gap: 6px; margin: 2px 0 14px; padding: 4px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(138,118,255,.18);
  border-radius: 16px;
}
.subnav button {
  flex: 1; padding: 9px 4px; border-radius: 12px; background: none;
  color: var(--txt2); font-weight: 800; font-size: 14px;
}
.subnav button.active {
  background: linear-gradient(135deg, rgba(110,92,230,.35), rgba(70,54,180,.3));
  color: #fff; box-shadow: inset 0 0 0 1px rgba(160,140,255,.35), 0 3px 12px rgba(90,70,220,.25);
}

/* ---------- 出战英雄详情 ---------- */
.hero-detail { padding: 16px; }
.hd-head { display: flex; gap: 14px; align-items: center; }
.hd-art {
  width: 96px; height: 96px; flex-shrink: 0; border-radius: 18px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; font-size: 48px;
  background: radial-gradient(circle at 30% 20%, rgba(110,92,230,.5), #151640);
  border: 2px solid rgba(255,215,106,.5);
  box-shadow: 0 0 22px rgba(139,123,255,.35);
}
.hd-art img { width: 100%; height: 100%; object-fit: cover; }
.hd-meta { flex: 1; min-width: 0; }
.hd-name { font-size: 21px; font-weight: 900; color: #fff; }
.hd-tags { margin: 6px 0 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.hd-skills { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; color: #d8d2ff;
  background: rgba(10,12,30,.6); border: 1px solid rgba(138,118,255,.22);
  border-radius: 999px; padding: 3px 9px 3px 3px;
}
.skill-chip b {
  width: 20px; height: 20px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; font-size: 11px; font-weight: 900; color: #fff;
}
.sk-p { background: #8f8fa8; }
.sk-q { background: #2e7be0; }
.sk-w { background: #2ea86b; }
.sk-e { background: #d9822e; }
.sk-r { background: #e0493b; }
.hd-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.hd-actions .btn { flex: 1; min-width: 110px; }
.dot {
  display: inline-flex; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  align-items: center; justify-content: center; background: #fff; color: #8a5c00;
  font-size: 12px; font-weight: 900; box-shadow: 0 0 8px rgba(255,215,106,.6);
}

/* ---------- 属性可视化条 ---------- */
.stat-bars { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.stat-bar .sb-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--txt2); margin-bottom: 4px; }
.stat-bar .sb-top b { color: #fff; font-size: 13px; }
.sb-track { height: 8px; border-radius: 999px; background: rgba(0,0,0,.45); overflow: hidden; border: 1px solid rgba(255,255,255,.07); }
.sb-fill { height: 100%; border-radius: 999px; }
.sb-hp { background: linear-gradient(90deg, #ff5f7a, #ff9db0); }
.sb-atk { background: linear-gradient(90deg, #ff8a3d, #ffc46b); }
.sb-ap { background: linear-gradient(90deg, #8b7bff, #c6a0ff); }
.sb-armor { background: linear-gradient(90deg, #4dd6ff, #9be9ff); }
.sb-mr { background: linear-gradient(90deg, #2ea86b, #8cf0b2); }
.sb-spd { background: linear-gradient(90deg, #ffd76a, #fff2b8); }

/* ---------- 设施 ---------- */
.fac-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fac-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  background: linear-gradient(160deg, rgba(40,44,105,.9), rgba(16,18,44,.95));
  border: 1px solid rgba(138,118,255,.3); border-radius: 18px; padding: 16px;
  box-shadow: var(--shadow); cursor: pointer;
  transition: transform .12s ease;
}
.fac-card:active { transform: scale(.97); }
.fac-card.gold { border-color: rgba(255,215,106,.5); }
.fac-card .fac-ico {
  width: 46px; height: 46px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  font-size: 24px; background: linear-gradient(135deg, rgba(110,92,230,.35), rgba(40,30,110,.4));
  margin-bottom: 6px;
}
.fac-card.gold .fac-ico { background: linear-gradient(135deg, rgba(255,190,60,.3), rgba(160,90,10,.35)); }
.fac-card b { color: #fff; font-size: 16px; }
.fac-card span { color: var(--txt3); font-size: 12px; line-height: 1.5; }
.fac-card.ghost-card { cursor: default; filter: saturate(.35) brightness(.72); border-style: dashed; }

@media (min-width: 680px) {
  .stat-bars { grid-template-columns: repeat(3, 1fr); }
  .fac-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ================= 界面 v4：战斗与弹窗精修 ================= */

/* ---- 战斗舞台 ---- */
#battle-view { background: radial-gradient(1000px 600px at 50% -12%, rgba(88, 60, 220, .34), transparent 62%), linear-gradient(180deg, #0b0e28 0%, #05060f 78%); }
.battle-top { padding: 12px 14px; background: linear-gradient(180deg, rgba(6,7,18,.92), rgba(6,7,18,.6)); border-bottom: 1px solid rgba(138,118,255,.22); }
.battle-title { font-size: 18px; letter-spacing: 3px; text-shadow: 0 0 14px rgba(255,200,80,.5); }
.arena {
  display: grid; grid-template-columns: 1fr auto 1fr; grid-template-rows: auto 1fr;
  align-items: start; gap: 8px;
  padding: 20px 10px 10px; min-height: 320px;
}
.unit { width: auto; }
.unit .u-portrait {
  position: relative; width: 128px; height: 148px; margin: 0 auto; border-radius: 18px;
  background: radial-gradient(circle at 50% 24%, rgba(118, 92, 245, .55), rgba(13, 12, 42, .92) 72%);
  border: 2px solid rgba(160, 140, 255, .5);
  box-shadow: 0 10px 34px rgba(0,0,0,.5), 0 0 24px rgba(120, 95, 255, .35), inset 0 0 26px rgba(0,0,0,.5);
  overflow: hidden;
}
.unit.left .u-portrait { border-color: rgba(255, 215, 106, .55); box-shadow: 0 10px 34px rgba(0,0,0,.5), 0 0 24px rgba(255,190,80,.28); }
.u-portrait::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.45));
}
.unit .u-avatar {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 0;
  background: transparent; box-shadow: none; font-size: 66px;
}
.unit .u-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.unit .u-name { margin: 10px 0 0; font-size: 17px; text-shadow: 0 2px 10px rgba(0,0,0,.8); }
.unit .u-title { margin-bottom: 7px; }
.unit .hpbar { height: 13px; border-width: 1.5px; }
.unit .hpfill { position: relative; }
.unit .hpfill::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.35), transparent 55%);
}
.unit .hptext { text-shadow: 0 1px 4px rgba(0,0,0,.9); }
.vs {
  position: static; transform: none; font-size: 40px; margin-top: 48px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.vs::after {
  content: ""; width: 2px; height: 120px; border-radius: 2px;
  background: linear-gradient(180deg, transparent, rgba(255,215,106,.5), transparent);
}
.log {
  grid-column: 1 / -1; width: 100%; max-height: 112px;
  margin: 4px 0 0; padding: 8px 14px; font-size: 12.5px;
  background: rgba(4, 5, 14, .66); border-radius: 12px; backdrop-filter: blur(6px);
}
.log::-webkit-scrollbar { width: 4px; }
.log::-webkit-scrollbar-thumb { background: rgba(138,118,255,.4); border-radius: 4px; }

/* 命中闪白 */
.unit .flash {
  position: absolute; inset: 0; border-radius: 18px; pointer-events: none;
  background: rgba(255,255,255,.85); opacity: 0;
}
.unit.hit .flash { animation: hitFlash .32s ease; }
@keyframes hitFlash { 0% { opacity: .9 } 100% { opacity: 0 } }

/* 行动条 */
.actions {
  grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 8px 10px calc(12px + env(safe-area-inset-bottom));
}
.actions .btn { min-height: 74px; border-radius: 16px; }
.actions .btn b {
  width: 32px; height: 32px; font-size: 16px;
  box-shadow: 0 0 10px rgba(255,255,255,.25), inset 0 0 8px rgba(0,0,0,.3);
}
.battle-tip {
  padding: 8px; font-size: 14px; letter-spacing: 1px;
  background: linear-gradient(90deg, transparent, rgba(138,118,255,.12), transparent);
}

/* ---- 弹层通用 ---- */
#sheet { flex-direction: column; align-items: center; justify-content: center; padding: 20px 12px; background: rgba(3, 4, 12, .72); }
.sheet-head {
  width: 100%; max-width: 560px; border-radius: 24px 24px 0 0;
  background: linear-gradient(180deg, #1e2358, #191d4b);
  border: 1px solid rgba(138,118,255,.32); border-bottom: 0;
}
.sheet-body {
  width: 100%; max-width: 560px; border-radius: 0 0 24px 24px; border: 1px solid rgba(138,118,255,.32);
  max-height: 86vh; overflow-y: auto;
  background: linear-gradient(180deg, #1b2050, #111338);
  box-shadow: 0 24px 80px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.06);
}
.sheet-head { padding: 18px 20px 14px; border-bottom: 1px solid rgba(138,118,255,.18); }
.sheet-head b { font-size: 18px; letter-spacing: .5px; }
.sheet-head button { font-size: 16px; color: var(--txt2); }
.sheet-scroll { overflow-y: auto; max-height: 46vh; padding: 4px 18px; -webkit-overflow-scrolling: touch; }
.sheet-foot {
  padding: 12px 18px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(138,118,255,.16);
  background: rgba(10, 12, 32, .6);
}

/* ---- 加点弹窗 ---- */
.pts-head {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, rgba(110,92,230,.22), rgba(50,40,140,.2));
  border: 1px solid rgba(160,140,255,.3); border-radius: 16px; padding: 12px 16px; margin-bottom: 14px;
}
.pts-head .pts-num { font-size: 26px; font-weight: 900; color: var(--gold); line-height: 1; }
.pts-head .pts-lbl { font-size: 12px; color: var(--txt2); margin-top: 2px; }
.pt-row {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,.03); border: 1px solid rgba(138,118,255,.14);
  border-radius: 16px; padding: 10px 12px; margin-bottom: 9px;
}
.pt-ico {
  width: 44px; height: 44px; border-radius: 13px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  background: linear-gradient(145deg, rgba(110,92,230,.35), rgba(30,24,90,.4));
  border: 1px solid rgba(160,140,255,.25);
}
.pt-mid { flex: 1; min-width: 0; }
.pt-mid .pt-name { font-weight: 800; color: #fff; font-size: 15px; }
.pt-mid .pt-desc { font-size: 11px; color: var(--txt3); }
.pt-val { text-align: right; min-width: 96px; }
.pt-val .pv { font-size: 19px; font-weight: 900; color: #fff; }
.pt-val .pv-delta { font-size: 13px; font-weight: 800; color: var(--green); min-height: 16px; display: block; }
.pt-ops { display: flex; gap: 8px; }
.pt-ops button {
  width: 40px; height: 40px; border-radius: 13px; font-size: 22px; font-weight: 900;
  background: linear-gradient(135deg, rgba(110,92,230,.45), rgba(60,45,180,.5));
  color: #fff; border: 1px solid rgba(170,150,255,.4);
  box-shadow: 0 4px 12px rgba(60,45,180,.25), inset 0 1px 0 rgba(255,255,255,.2);
  transition: transform .08s ease;
}
.pt-ops button:active { transform: scale(.9); }
.pt-ops button:disabled { opacity: .3; box-shadow: none; }
.pt-ops button.minus { background: linear-gradient(135deg, rgba(255,90,90,.28), rgba(150,40,40,.3)); border-color: rgba(255,120,120,.3); }

/* ---- 加点面板 v5 ---- */
.apt-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 12px 16px 0;
  background: linear-gradient(135deg, rgba(110,92,230,.25), rgba(38,28,110,.3));
  border: 1px solid rgba(160,140,255,.32); border-radius: 18px;
  padding: 9px 14px;
}
.apt-pts { display: flex; align-items: baseline; gap: 8px; }
.apt-pts b {
  font-size: 27px; font-weight: 900; color: var(--gold); line-height: 1;
  text-shadow: 0 0 18px rgba(255,210,90,.6);
}
.apt-pts span { color: var(--txt2); font-size: 12px; }
.apt-pts i {
  font-style: normal; font-size: 11px; color: var(--green); font-weight: 700;
  background: rgba(84,226,155,.12); border: 1px solid rgba(84,226,155,.3);
  border-radius: 999px; padding: 2px 8px;
}
.apt-help { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.apt-help span { color: var(--txt3); font-size: 11px; }
.apt-tip { font-size: 10.5px; color: var(--txt3); text-align: center; margin: 5px 0 9px; }
.apt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.apt-cell {
  position: relative;
  background: linear-gradient(165deg, rgba(40,44,105,.55), rgba(16,18,46,.85));
  border: 1px solid rgba(138,118,255,.2); border-radius: 16px;
  padding: 9px 11px 8px; overflow: hidden;
}
.apt-cell.bump { border-color: var(--gold); box-shadow: 0 0 18px rgba(255,200,80,.25); }
.apt-cell.bump::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at center, rgba(255,215,106,.18), transparent 70%);
  animation: aptGlow .5s ease;
}
@keyframes aptGlow { 0% { opacity: 1 } 100% { opacity: 0 } }
.apt-head { display: flex; align-items: center; gap: 6px; }
.apt-ico { font-size: 15px; }
.apt-name { font-size: 12.5px; font-weight: 800; color: #e6e1ff; }
.apt-tag {
  margin-left: auto; font-size: 10px; font-weight: 900; color: var(--gold);
  opacity: 0; transform: translateY(3px); transition: all .18s ease;
  background: rgba(255,200,80,.14); border-radius: 999px; padding: 1px 6px;
}
.apt-tag.on { opacity: 1; transform: translateY(0); }
.apt-val {
  font-size: 22px; font-weight: 900; color: #fff; margin: 2px 0 1px;
  font-variant-numeric: tabular-nums; line-height: 1.1;
}
.apt-main { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.apt-track { height: 5px; border-radius: 999px; background: rgba(0,0,0,.5); overflow: hidden; margin-bottom: 7px; }
.apt-fill { height: 100%; border-radius: 999px; transition: width .3s ease; }
.apt-fill-hp { background: linear-gradient(90deg, #ff5f7a, #ff9db0); }
.apt-fill-atk { background: linear-gradient(90deg, #ff8a3d, #ffc46b); }
.apt-fill-ap { background: linear-gradient(90deg, #8b7bff, #c6a0ff); }
.apt-fill-armor { background: linear-gradient(90deg, #4dd6ff, #9be9ff); }
.apt-fill-mr { background: linear-gradient(90deg, #2ea86b, #8cf0b2); }
.apt-fill-spd { background: linear-gradient(90deg, #ffd76a, #fff2b8); }
.apt-ops { display: flex; gap: 6px; align-items: center; }
.apt-plus, .apt-minus {
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 900; color: #fff; transition: transform .08s ease;
}
.apt-plus {
  width: 32px; height: 32px; margin-left: auto; font-size: 18px;
  background: linear-gradient(135deg, #6fe0a5, #1f9a63);
  box-shadow: 0 4px 14px rgba(40,190,120,.35), inset 0 1px 0 rgba(255,255,255,.3);
}
.apt-plus:active { transform: scale(.88); }
.apt-plus:disabled { filter: grayscale(1); opacity: .4; box-shadow: none; }
.apt-minus {
  width: 24px; height: 24px; font-size: 13px;
  background: linear-gradient(135deg, rgba(255,110,110,.4), rgba(160,45,45,.45));
  border: 1px solid rgba(255,120,120,.35);
}
.apt-minus:active { transform: scale(.9); }
.apt-minus:disabled { opacity: .25; }
.apt-foot { display: flex; gap: 8px; align-items: center; }
.apt-foot .btn { padding: 9px 12px; font-size: 13px; }
.apt-foot .btn.gold { flex: 2; }
.apt-foot .btn.gold.ready:not(:disabled) { animation: savePulse 1.6s ease-in-out infinite; }
@keyframes savePulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(255,190,60,.35); }
  50% { box-shadow: 0 4px 26px rgba(255,190,60,.75); }
}
@media (max-width: 380px) {
  .apt-grid { grid-template-columns: 1fr; }
}
