:root {
    --ink: #2b2620;
    --ink-soft: #5c554b;
    --paper: #f3efe4;
    --paper-2: #e9e3d3;
    --cinnabar: #b03a2e;   /* 朱砂红 */
    --cinnabar-2: #c0392b;
    --bamboo: #4a7c59;     /* 竹青 */
    --bamboo-2: #6b8e5a;
    --gold: #c9a227;
    --shadow: 0 6px 20px rgba(40, 30, 20, 0.18);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(1200px 600px at 70% -10%, #fbf8ef 0%, rgba(251,248,239,0) 60%),
        linear-gradient(160deg, #f3efe4 0%, #e7e0cf 100%);
    min-height: 100vh;
    padding: 24px 16px 64px;
}

.xx-conn {
    position: fixed; top: 14px; right: 16px; z-index: 5;
    font-size: 13px; padding: 6px 12px; border-radius: 20px;
    background: rgba(255,255,255,0.6); border: 1px solid rgba(90,70,50,0.15);
    color: var(--ink-soft);
}
.xx-conn.on { color: var(--bamboo); }
.xx-conn.off { color: var(--cinnabar); }

/* ---- 境界卡 ---- */
.hero {
    max-width: 860px; margin: 12px auto 26px;
    display: flex; gap: 28px; align-items: center;
    background: linear-gradient(135deg, rgba(255,255,255,0.7), rgba(255,255,255,0.35));
    border: 1px solid rgba(90,70,50,0.15); border-radius: 20px;
    padding: 22px 28px; box-shadow: var(--shadow);
}
.hero-avatar { position: relative; width: 132px; height: 132px; flex: 0 0 auto; display: grid; place-items: center; }
.hero-avatar img {
    position: relative; z-index: 2; width: 100%; height: 100%; object-fit: contain; border-radius: 50%;
    filter: drop-shadow(0 6px 14px rgba(80,60,120,0.28));
    animation: floatY 5s ease-in-out infinite;
}
/* 紫色灵光：呼吸 */
.aura {
    position: absolute; inset: -16%; border-radius: 50%; z-index: 0;
    background: radial-gradient(circle at 50% 56%, rgba(150,110,220,0.55) 0%, rgba(120,90,200,0.3) 42%, rgba(120,90,200,0) 70%);
    filter: blur(6px);
    animation: auraPulse 3.4s ease-in-out infinite;
}
/* 旋转法环：金紫渐变 */
.halo {
    position: absolute; inset: -6%; border-radius: 50%; z-index: 1;
    background: conic-gradient(from 0deg, rgba(201,162,39,0) 0deg, rgba(201,162,39,0.85) 60deg, rgba(160,120,220,0.15) 140deg, rgba(201,162,39,0) 200deg, rgba(201,162,39,0.6) 300deg, rgba(201,162,39,0));
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 3px));
    animation: spin 12s linear infinite; opacity: 0.85;
}
/* 紫色雷光：闭关打坐时闪现 */
.bolt {
    position: absolute; inset: -4%; border-radius: 50%; z-index: 2; pointer-events: none; opacity: 0;
    background: conic-gradient(from 0deg, transparent 0deg, rgba(222,205,255,0.9) 4deg, transparent 9deg, transparent 70deg, rgba(222,205,255,0.75) 74deg, transparent 80deg, transparent 160deg, rgba(222,205,255,0.85) 164deg, transparent 170deg, transparent 250deg, rgba(222,205,255,0.8) 254deg, transparent 260deg);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
}
.hero.cultivating .bolt { animation: spin 3s linear infinite, flicker 2.6s ease-in-out infinite; }
/* 金色虚线法环：反向缓转 */
.ring {
    position: absolute; inset: -10%; border-radius: 50%;
    border: 2px dashed rgba(201,162,39,0.45); opacity: 0.7; z-index: 1;
    animation: spinRev 26s linear infinite;
}
/* 金色灵光上浮 */
.sparks { position: absolute; inset: -12%; z-index: 3; pointer-events: none; }
.sparks i {
    position: absolute; bottom: 6%; width: 6px; height: 6px; border-radius: 50%;
    background: radial-gradient(circle, rgba(201,162,39,0.95), rgba(201,162,39,0));
    animation: sparkleRise 4.2s linear infinite;
}
.sparks i:nth-child(1) { left: 20%; animation-delay: 0s; }
.sparks i:nth-child(2) { left: 42%; animation-delay: 1s; }
.sparks i:nth-child(3) { left: 62%; animation-delay: 2.1s; }
.sparks i:nth-child(4) { left: 80%; animation-delay: 3s; }
.hero-info { flex: 1; min-width: 0; }
.hero-realm {
    font-size: 40px; font-weight: 800; letter-spacing: 4px;
    background: linear-gradient(90deg, var(--cinnabar), var(--gold));
    -webkit-background-clip: text; background-clip: text; color: transparent;
    font-family: "KaiTi", "STKaiti", serif;
}
.hero-sub {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    color: var(--ink-soft); font-size: 14px; margin: 2px 0 4px;
}
.hs-name { white-space: nowrap; }
.hero-sub2 {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    color: var(--ink-soft); font-size: 13px; margin: 0 0 12px;
}
.hero-rebirth { color: var(--gold); font-weight: 600; }
.hc-btn { margin-left: 8px; border: 1px solid rgba(90,70,50,0.2); background: rgba(255,255,255,0.6); color: var(--ink-soft);
    border-radius: 12px; padding: 1px 10px; font-size: 12px; cursor: pointer; }
.hc-btn:hover { color: var(--cinnabar); border-color: var(--cinnabar); }
.hero-stats { display: flex; gap: 26px; margin-bottom: 12px; }
.hstat { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.hval { font-size: 24px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.hlabel { font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.exp-bar { height: 12px; border-radius: 8px; background: var(--paper-2); overflow: hidden; }
.exp-fill {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, var(--bamboo), var(--bamboo-2));
    transition: width 0.5s ease;
}
.exp-label { font-size: 12px; color: var(--ink-soft); margin-top: 6px; }

/* ---- Tab 导航 + 面板网格 ---- */
.tabbar {
    max-width: 860px; margin: 4px auto 18px;
    display: flex; gap: 6px; overflow-x: auto;
    background: rgba(255,255,255,0.62);
    border: 1px solid rgba(90,70,50,0.15);
    border-radius: 14px; padding: 6px;
    box-shadow: var(--shadow);
    scrollbar-width: none;
}
.tabbar::-webkit-scrollbar { display: none; }
.tabbar .tab {
    flex: 1 1 0; min-width: 0; border: none; cursor: pointer;
    background: transparent; color: var(--ink-soft);
    padding: 10px 16px; font-size: 14px; font-weight: 600;
    border-radius: 10px; font-family: inherit; text-align: center; white-space: nowrap;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.tabbar .tab:hover { color: var(--ink); }
.tabbar .tab.on {
    background: linear-gradient(135deg, var(--bamboo), var(--bamboo-2));
    color: #fff; box-shadow: 0 2px 8px rgba(74,124,89,0.28);
}

.stage { max-width: 860px; margin: 0 auto; }
.panel {
    display: none;
    grid-template-columns: 1fr 1fr; gap: 16px;
    align-items: start; /* 全站规则：每张卡只用自己的高度，不被同排邻居拉伸 */
}
.panel.on { display: grid; }
.card {
    background: rgba(255,255,255,0.62); border: 1px solid rgba(90,70,50,0.15);
    border-radius: 16px; padding: 18px; box-shadow: var(--shadow);
}
.card h2 { margin: 0 0 14px; font-size: 17px; font-family: "KaiTi","STKaiti",serif; color: var(--ink); }
.cult-card { text-align: center; position: relative; overflow: hidden; }

/* 占满整行的卡：长列表（灵兽名册 / 果位七行 / 宗门八块）半宽会挤扁，一律给整行 */
.panel > .card.wide { grid-column: 1 / -1; }
/* cult-row 内也要能占整行（交易坊「在售」整行两列摆） */
.cult-row > .card.wide { grid-column: 1 / -1; }

/* 修炼行：挂机与突破并排 */
.cult-row { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 16px; 
    margin-bottom: 16px;
    grid-column: 1 / -1; /* 让cult-row跨越整个panel宽度 */
    align-items: start;  /* 等宽但不等高：短的那张按自己内容收，别被邻卡拉伸出空白 */
}
.cult-row > .card { 
    grid-column: span 1; 
    margin-bottom: 0;
}

/* 历练的三个玩法卡：各只有一行按钮 + 一段状态，三列并排比竖着堆少两次滚动 */
.cult-row.row3 { grid-template-columns: repeat(3, 1fr); }

/* ---- 折叠卡（成就 / 图鉴等长列表）---- */
.card.collapsible > .collapsible-body { transition: max-height 0.28s ease, opacity 0.2s ease; overflow: hidden; }
.card.collapsible.collapsed > .collapsible-body { display: none; }
.collapse-toggle { cursor: pointer; user-select: none; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
/* 折叠箭头：自绘 SVG（app.js GLYPHS.chevron，默认朝下），不再是边框拼的 V */
.collapse-toggle .chevron {
    display: inline-flex; width: 14px; height: 14px; flex: 0 0 auto;
    color: var(--ink-soft); transition: transform 0.2s ease;
}
.collapse-toggle .chevron svg.gl { width: 100%; height: 100%; }
.card.collapsible.collapsed .collapse-toggle .chevron { transform: rotate(-90deg); }
/* 收起时标题下面那 14px 空当看着像掉了一截，收掉 */
.card.collapsible.collapsed > .collapse-toggle { margin-bottom: 0; }
/* 卡内小节折叠（如卖出记录）：同一套箭头，体随父卡折叠状态走 */
.sub-collapse.collapsed > .collapsible-body { display: none; }
.sub-collapse.collapsed .collapse-toggle .chevron { transform: rotate(-90deg); }
/* 小节收起后标题下面不留空当（成就分类、图鉴分节同一套） */
.sub-collapse.collapsed > .collapse-toggle { margin-bottom: 0; }
/* 收起后的卡只剩标题一行：允许它比最小内容还窄，好让摘要截断而不是把整页撑出横向滚动 */
.card.collapsible.collapsed { min-width: 0; }
/* 宗门卡收起后留一行摘要：名字 · 等级 · 身份 · 人数，超长截断不换行 */
.sect-sum {
    font-size: 12px; font-weight: 400; color: var(--ink-soft);
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 通用卡面摘要：收起后标题右侧仍报一个核心数（成率 / 已做几项 / 可收几块），超出宽度截断 */
.card-sum {
    font-size: 12px; font-weight: 400; color: var(--ink-soft);
    min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.card-sum:empty { display: none; }

/* ---- 按钮 ---- */
.btn {
    border: none; border-radius: 12px; padding: 11px 20px; font-size: 15px;
    cursor: pointer; color: #fff; background: var(--ink-soft);
    transition: transform 0.1s ease, filter 0.2s ease; font-weight: 600;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, var(--bamboo), var(--bamboo-2)); }
.btn.gold { background: linear-gradient(135deg, var(--gold), #a8841c); color: #2b2620; }
/* 按钮副行：价格固定另起一行，免得在窄按钮里折成「（8000 灵 / 石）」 */
.btn-cost { display: block; margin-top: 1px; font-size: 0.82em; font-weight: 500; opacity: 0.72; line-height: 1.25; }
/* 价格里的一个词：换行只发生在词缝，数字和括号里的字数不许被劈开 */
.btn-word { white-space: nowrap; }

/* ---- 打坐 ---- */
.cult-body { display: flex; align-items: center; justify-content: center; gap: 26px; flex-wrap: wrap; }
.cult-meta { text-align: left; color: var(--ink-soft); font-size: 14px; }
.cult-timer { font-size: 22px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.cult-rate { margin: 4px 0; }
.cult-provision { color: var(--bamboo-2); font-weight: 600; min-height: 18px; }
.particles { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.4s; }
.cult-card.cultivating .particles { opacity: 1; }
.hero.cultivating .hero-avatar { animation: avatarGlow 1.7s ease-in-out infinite; }
.hero.cultivating .aura { animation-duration: 1.8s; filter: blur(8px) saturate(1.4); }
.hero.cultivating .halo { animation-duration: 5s; }
.hero.cultivating .hero-avatar img { animation-duration: 2.6s; }
.cult-card.cultivating .btn.primary { background: linear-gradient(135deg, var(--cinnabar), var(--cinnabar-2)); }

@keyframes breathe {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(201,162,39,0.0); }
    50% { transform: scale(1.06); box-shadow: 0 0 26px 4px rgba(201,162,39,0.35); }
}
.particles::before, .particles::after,
.particles span {
    content: ''; position: absolute; bottom: -10px; width: 7px; height: 7px; border-radius: 50%;
    background: radial-gradient(circle, rgba(201,162,39,0.9), rgba(201,162,39,0));
    animation: rise 3.4s linear infinite;
}
.particles::before { left: 30%; animation-delay: 0s; }
.particles::after { left: 55%; animation-delay: 1.1s; }
.particles span { left: 72%; animation-delay: 2.0s; }
@keyframes rise {
    0% { transform: translateY(0) scale(0.6); opacity: 0; }
    20% { opacity: 0.9; }
    100% { transform: translateY(-150px) scale(1.1); opacity: 0; }
}

/* ---- 突破 ---- */
.bt-body { text-align: center; }
.bt-target { font-size: 15px; color: var(--ink-soft); margin-bottom: 6px; }
.bt-target b { color: var(--cinnabar); font-size: 17px; }
.bt-chance { font-size: 15px; margin-bottom: 12px; }
.bt-chance b { color: var(--bamboo-2); font-size: 20px; }
/* 天花板跟着成率本体走：只看 72% 会以为还能更高，它其实已经贴着这一世的上限了 */
.bt-chance .bt-sub { font-size: 12px; color: var(--ink-soft); margin-left: 4px; }
.bt-hint { min-height: 20px; margin-top: 10px; font-size: 13px; color: var(--ink-soft); }

/* 心魔：一条细尺 + 一句代价说明，不抢主按钮的视线 */
.bt-xinmo { max-width: 320px; margin: 0 auto 12px; }
.bt-xinmo-head {
    display: flex; align-items: baseline; justify-content: center; gap: 8px;
    font-size: 13px; color: var(--ink-soft);
}
.bt-xinmo-head b { color: var(--ink); font-size: 15px; }
.bt-xinmo-head #bt-xinmo-eff { font-size: 12px; color: var(--ink-soft); }
.bt-xinmo-bar {
    height: 5px; margin-top: 5px; border-radius: 3px; overflow: hidden;
    background: rgba(43, 38, 32, 0.10);
}
.bt-xinmo-bar i {
    display: block; height: 100%; width: 0;
    background: linear-gradient(90deg, var(--bamboo-2), var(--cinnabar));
    transition: width 0.3s ease;
}
.bt-xinmo.hot .bt-xinmo-head b,
.bt-xinmo.hot #bt-xinmo-eff { color: var(--cinnabar); }
.bt-xinmo.hot .bt-xinmo-bar i { background: var(--cinnabar); }
.bt-meditate { margin-top: 10px; }
.bt-meditate-note { margin-top: 6px; font-size: 12px; color: var(--ink-soft); min-height: 16px; }
/* 天劫逐道战报：破一道亮一枚，折一道留灰 */
.bt-bolts { display: flex; justify-content: center; gap: 10px; margin-bottom: 10px; font-size: 22px; line-height: 1; }
.bt-bolts i { font-style: normal; }
.bt-bolts i.hit { color: var(--cinnabar); }
.bt-bolts i.miss { color: rgba(43, 38, 32, 0.25); }
.bt-xinmo-delta { margin-top: 8px; font-size: 13px; color: var(--cinnabar); }

/* ---- 签到 ---- */
.check-body { display: flex; align-items: center; gap: 18px; }
.check-meta { font-size: 14px; color: var(--ink-soft); }
.check-meta b { color: var(--ink); font-size: 18px; }
.check-status { margin-top: 4px; }
.check-record { margin-top: 14px; font-size: 13px; }
.check-record summary { cursor: pointer; color: var(--ink); }
.check-record summary span { display: inline-block; color: var(--ink-soft); }
.check-record-hint { color: var(--ink-soft); line-height: 1.6; }
.check-days { max-height: 240px; overflow-y: auto; }
.check-day { display: flex; gap: 8px; align-items: center; padding: 6px 0; border-top: 1px solid rgba(90,70,50,0.15); }
.check-day time { font-variant-numeric: tabular-nums; white-space: nowrap; }
.check-day-status { margin-left: auto; color: var(--ink-soft); }
.check-day .btn { padding: 6px 12px; font-size: 12px; flex: 0 0 auto; white-space: nowrap; }

/* ---- 今日必做 ---- */
.daily-list { display: flex; flex-direction: column; gap: 8px; }
.daily-task {
    display: grid; grid-template-columns: 28px 1fr auto auto; gap: 10px; align-items: center;
    padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,0.45);
    border: 1px solid rgba(90,70,50,0.15); cursor: pointer; transition: all 0.15s ease;
}
.daily-task:hover { background: rgba(255,255,255,0.65); border-color: var(--gold); }
.daily-task.done { opacity: 0.55; cursor: default; background: rgba(255,255,255,0.3); }
.daily-task .dt-icon { font-size: 18px; text-align: center; }
.daily-task .dt-name { font-weight: 700; color: var(--ink); font-size: 14px; }
.daily-task .dt-progress { font-size: 12px; color: var(--bamboo-2); font-weight: 600; white-space: nowrap; }
.daily-task .dt-expire { font-size: 11px; color: var(--cinnabar); font-weight: 600; white-space: nowrap; }
.daily-task.done .dt-name { text-decoration: line-through; color: var(--ink-soft); }
/* 每秒改写的倒计时数字：等宽，免得整句文案跟着左右抽动 */
.cd { font-variant-numeric: tabular-nums; }

/* ---- 手札 / 排行 ---- */
.log { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow-y: auto; }
.log li { padding: 7px 4px; border-bottom: 1px dashed rgba(90,70,50,0.12); font-size: 13px; color: var(--ink-soft); }
.log li .act { color: var(--ink); font-weight: 600; }
.log li .note { color: var(--cinnabar); }
.rank { list-style: none; margin: 0 0 10px; padding: 0; counter-reset: r; }
.rank li { counter-increment: r; display: flex; align-items: center; gap: 10px; padding: 6px 4px; font-size: 14px; border-bottom: 1px dashed rgba(90,70,50,0.12); }
.rank li::before { content: counter(r); width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 50%; background: var(--paper-2); color: var(--ink-soft); font-size: 12px; }
.rank li:nth-child(1)::before { background: var(--gold); color: #2b2620; }
.rank li:nth-child(2)::before { background: #b9b2a2; color: #2b2620; }
.rank li:nth-child(3)::before { background: #c79a6b; color: #2b2620; }
.rank .rname { flex: 1; font-weight: 600; }
.rank .rrealm { color: var(--cinnabar); font-size: 13px; white-space: nowrap; }
.rank .rpow { color: var(--bamboo-2); font-weight: 700; font-variant-numeric: tabular-nums; }
/* 世数小标：战力榜与弟子名录的境界列共用，压到 11px 灰字，好让境界本名仍是第一眼 */
.life-tag { color: var(--ink-soft); font-size: 11px; margin-left: 4px; white-space: nowrap; }
.stats { font-size: 12px; color: var(--ink-soft); border-top: 1px solid rgba(90,70,50,0.12); padding-top: 8px; }

/* ---- 事件抽屉：居中弹窗（突破 / 奇遇统一走这里）---- */
.modal-mask {
    position: fixed; inset: 0; background: rgba(20,15,10,0.35);
    display: none; z-index: 20;
    opacity: 0; transition: opacity 0.24s ease;
}
.modal-mask.show { display: flex; align-items: center; justify-content: center; opacity: 1; }
/* 确认框要盖在任何窗口之上：它在 index.html 里排在任选窗之前，同为 z-index 20 时会被后一个窗口压住看不见 */
#ask-modal { z-index: 70; }
.modal {
    width: min(380px, 92vw); max-width: none;
    background: linear-gradient(160deg, #fff, #f1ead9);
    padding: 28px 24px; text-align: center;
    box-shadow: 0 8px 32px rgba(40,30,20,0.28);
    border: 1px solid rgba(90,70,50,0.15);
    border-radius: 16px;
    /* 卡片比屏幕高时自己滚：不设上限的话弹窗按内容长高、上下都溢出手机屏，
       顶上的标题直接被切掉（实测三门择一在 553px 高的视口里顶边 -106） */
    max-height: calc(100vh - 28px);
    overflow-y: auto;
    transform: translateY(20px) scale(0.96);
    transition: transform 0.28s cubic-bezier(.2,.7,.3,1);
    animation: none;
}
.modal-mask.show .modal { transform: translateY(0) scale(1); }
.modal-title { font-size: 26px; font-weight: 800; margin-bottom: 10px; font-family: "KaiTi","STKaiti",serif; }
.modal-title.ok { color: var(--bamboo-2); }
.modal-title.fail { color: var(--cinnabar); }
.modal-text { color: var(--ink-soft); margin-bottom: 18px; font-size: 14px; line-height: 1.6; }
.ask-btns { display: flex; gap: 12px; }
.ask-btns .btn { flex: 1; padding: 11px 0; font-size: 15px; }
.modal.flash-ok { box-shadow: 0 0 40px 6px rgba(74,124,89,0.5); }
.modal.flash-fail { box-shadow: 0 0 40px 6px rgba(176,58,46,0.5); }

/* ---- toast ---- */
.toast {
    position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%) translateY(20px);
    background: rgba(43,38,32,0.92); color: #f3efe4; padding: 10px 20px; border-radius: 24px;
    font-size: 14px; opacity: 0; pointer-events: none; transition: all 0.3s ease; z-index: 30;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- 功法 / 丹炉 ---- */
.gongfa-card .branch-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.branch-btn {
    text-align: left; border: 1px solid rgba(90,70,50,0.18); border-radius: 12px;
    background: rgba(255,255,255,0.5); padding: 10px 12px; cursor: pointer; transition: all 0.15s;
}
.branch-btn:hover { border-color: var(--gold); }
.branch-btn.sel { border-color: var(--cinnabar); background: rgba(176,58,46,0.08); box-shadow: inset 0 0 0 2px rgba(176,58,46,0.15); }
.branch-btn .bname { font-weight: 700; color: var(--ink); font-size: 15px; }
.branch-btn .btag { font-size: 12px; color: var(--cinnabar); margin-top: 2px; line-height: 1.35; }
.branch-btn .bdesc { font-size: 12px; color: var(--ink-soft); margin-top: 3px; line-height: 1.4; }
/* 斗法轴独占一行：小胶囊平铺、放不下才换行，整列卡片因此同高。
   数字整句挂在整行 tooltip 上（战力派生的那句），牌面只认「偏哪几轴」 */
.branch-btn .b-axes {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
    margin-top: 6px; cursor: help;
}
.branch-btn .b-axes .ax-lead { font-size: 11px; color: var(--ink-soft); margin-right: 2px; }
.branch-btn .b-axes .ax-chip {
    font-size: 11px; line-height: 1; padding: 3px 5px; border-radius: 999px;
    color: var(--cinnabar); background: rgba(176,58,46,0.07);
    border: 1px solid rgba(176,58,46,0.25); white-space: nowrap;
}
.branch-current { margin-top: 10px; font-size: 13px; color: var(--ink-soft); }
.branch-current b { color: var(--cinnabar); }

.recipe-list { display: flex; flex-direction: column; gap: 10px; }
.recipe {
    display: flex; align-items: center; gap: 12px; border: 1px solid rgba(90,70,50,0.15);
    border-radius: 12px; padding: 10px 12px; background: rgba(255,255,255,0.45);
}
.recipe .rinfo { flex: 1; min-width: 0; }
.recipe .rname { font-weight: 700; color: var(--ink); }
.recipe .rdesc { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.recipe .rcost { font-size: 12px; color: var(--bamboo-2); margin-top: 2px; }
.recipe .btn { flex: 0 0 auto; }
/* 丹方产出物（灵兽丹）的库存：与符箓卡同款小徽标，0 库存只描边不涂色 */
.r-owned {
    font-size: 10px; padding: 1px 6px; margin-left: 6px; border-radius: 8px;
    border: 1px solid var(--bamboo); color: var(--bamboo); font-weight: 700; vertical-align: 2px;
}
.r-owned.blank { border-color: rgba(90,70,50,0.22); color: rgba(92,85,75,0.55); }

/* ---- P2：灵兽 / 宗门 / 论道交友 ---- */
/* 灵兽卡三层：合计加成（结论）→ 在阵 + 材料库存（状态）→ 名册（每只的个体操作） */
/* 合计与每日吐纳并一行：都是全卡结论，各占一行白多一条缝（窄屏放不下时吐纳整体落到下一行） */
.beast-card .beast-sum { display: inline-block; margin: 0 12px 8px 0; }
.beast-card .beast-breath {
    display: inline-block; margin: 0 0 8px; font-size: 12px; color: var(--bamboo-2);
    font-variant-numeric: tabular-nums;
}
.beast-card .beast-breath b { color: var(--ink); font-weight: 700; }
.beast-card .beast-breath:empty { display: none; }
.beast-zone { margin-bottom: 9px; }
.beast-zone-label {
    display: inline-block; vertical-align: middle;
    font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--ink-soft);
    margin: 0 10px 4px 0; font-variant-numeric: tabular-nums;
}
.beast-zone-label b { color: var(--ink); }
.beast-roster-note { font-weight: 400; letter-spacing: 0; color: rgba(92,85,75,0.65); }
.beast-mats { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; vertical-align: middle; }
.mat-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px;
    border: 1px solid rgba(90,70,50,0.15); border-radius: 10px;
    background: rgba(255,255,255,0.45); font-size: 12px; color: var(--ink);
}
.mat-chip .mat-owned { font-weight: 700; color: var(--bamboo); font-variant-numeric: tabular-nums; }
.mat-chip.blank { color: rgba(92,85,75,0.6); }
.mat-chip.blank .mat-owned { color: rgba(92,85,75,0.5); }
.mat-chip .mat-note {
    font-style: normal; font-size: 10px; padding: 1px 6px; border-radius: 8px;
    border: 1px solid rgba(90,70,50,0.22); color: var(--ink-soft);
}
/* 灵兽任选卡 */
.beast-choice-cards { display: flex; flex-wrap: wrap; gap: 8px; }
.choice-card {
    display: flex; align-items: center; gap: 8px;
    border: 1px solid rgba(90,70,50,0.3); border-radius: 12px; padding: 8px 12px;
    cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s;
    background: rgba(255,250,240,0.6);
}
.choice-card:hover { border-color: var(--bamboo); box-shadow: 0 0 0 1px var(--bamboo); }
.choice-card .choice-icon { font-size: 20px; }
.choice-card .choice-info { display: flex; flex-direction: column; gap: 2px; }
.choice-card .choice-name { font-weight: 600; font-size: 13px; color: var(--ink); }
.choice-card .choice-count { font-size: 11px; color: var(--ink-soft); }
.choice-card.rar-5 { border-color: rgba(180,130,255,0.5); background: rgba(220,200,255,0.15); }
.choice-card.rar-5:hover { border-color: rgb(160,100,240); box-shadow: 0 0 0 1px rgb(160,100,240); }
.choice-card.rar-6 { border-color: rgba(255,180,80,0.5); background: rgba(255,220,160,0.15); }
.choice-card.rar-6:hover { border-color: rgb(230,160,50); box-shadow: 0 0 0 1px rgb(230,160,50); }
/* 任选弹窗：一行一只，五只摆进同一个窗口（不再竖着摞成一长条） */
.choice-modal-box { width: min(380px, 92vw); max-width: none; display: flex; flex-direction: column; }
.choice-sub { font-size: 12px; color: var(--ink-soft); margin-bottom: 8px; text-align: center; }
.choice-list {
    display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px;
    max-height: 52vh; overflow-y: auto;
}
.choice-beast {
    display: flex; flex-direction: row; align-items: center; gap: 8px;
    padding: 5px 10px; text-align: left;
    border: 1px solid rgba(90,70,50,0.2); border-radius: 10px; cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.choice-beast:hover { border-color: var(--bamboo); background: rgba(106,156,106,0.08); }
/* 已有也能再选：只是标出来，不灰掉不挡手点 */
.choice-beast.owned { opacity: 0.72; }
.choice-beast.owned:hover { opacity: 1; }
/* 立绘定尺：图标 span 必须带尺寸类，否则 img 退回 webp 原图（160×160）把整行撑高 */
.choice-beast .cb-icon { width: 38px; height: 38px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.choice-pic.ic { width: 38px; height: 38px; }
.choice-beast .cb-info { display: none; }
.choice-beast .cb-name {
    font-weight: 600; font-size: 13px; line-height: 1.2; flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.choice-beast .cb-tag { font-size: 10px; padding: 1px 6px; border-radius: 6px; flex-shrink: 0; }
.choice-beast .cb-note { font-size: 11px; color: var(--ink-soft); flex-shrink: 0; }
.choice-beast .cb-tag.owned-tag { background: rgba(90,70,50,0.12); color: var(--ink-soft); }
.choice-beast .cb-tag.new-tag { background: rgba(106,156,106,0.2); color: var(--bamboo); }
/* 出战位一排摆开：格数随果位等规则涨（4→5+），auto-fit 让全部格子均分同一行不折行 */
.beast-slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; }
.beast-slot {
    display: flex; flex-direction: row; align-items: center; gap: 8px; text-align: left;
    border: 1px dashed rgba(90,70,50,0.3); border-radius: 12px; padding: 8px 9px;
    background: rgba(255,255,255,0.28);
}
.beast-slot:not(.filled) { justify-content: center; }
.beast-slot .beast-icon.ic { width: 40px; height: 40px; }
/* 名字独占第一行，星徽与等级固定第二行：不论名字长短、有没有星，五个格子都是同一个节奏；
   第二行装不下星徽+等级时（窄窗/手机）等级单独落到第三行，名字与星徽都不省略 */
.beast-slot .slot-info {
    display: flex; flex-wrap: wrap; align-items: center; align-content: center; gap: 3px 4px;
    min-width: 0; flex: 1;
}
.beast-slot.filled { border-style: solid; background: rgba(255,255,255,0.55); }
.beast-slot.clickable { cursor: pointer; transition: background 0.15s ease, transform 0.15s ease; }
.beast-slot.clickable:hover { background: rgba(255,255,255,0.85); transform: translateY(-1px); }
.beast-slot .slot-name {
    flex: 0 0 100%; min-width: 0;
    max-width: 100%; font-size: 13px; font-weight: 700; color: var(--ink);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.beast-slot .slot-stars { display: inline-flex; align-items: center; flex: 0 0 auto; }
.beast-slot .slot-stars .stars { display: inline-flex; align-items: center; gap: 1px; }
.beast-slot .slot-stars .st { width: 16px; height: 16px; object-fit: contain; display: block; }
/* 等级 10px：「Lv.100 顶」和星徽并排才塞得进 ~92px 的文字区（11px 会多 3px 被迫折到第三行） */
.beast-slot .slot-lv { flex: 0 0 auto; font-size: 10px; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.beast-slot .slot-empty { font-size: 12px; color: rgba(92,85,75,0.6); }

/* 名册两列：宽屏一行摆两只摘要，窄屏 auto-fill 自然落回一列；只有合计行与「展开全部」独占整行。
   展开的培养台留在自己那一格里：跨整行会让这张卡从一列宽当场翻成整排宽，点一下钮名册就横向抖一下。
   操作台排不下就多折一行——只许变高，不许变宽 */
.beast-list {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(min(400px, 100%), 1fr));
    gap: 6px; align-items: start;
}
.beast-list .branch-current,
.beast-more-btn { grid-column: 1 / -1; }
.beast-more-btn { justify-self: center; }
.beast-item {
    display: flex; flex-direction: column; gap: 4px;
    border: 1px solid rgba(90,70,50,0.15); border-left: 3px solid rgba(92,85,75,0.45);
    border-radius: 12px; padding: 6px 10px; background: rgba(255,255,255,0.45);
}
.beast-item.on { background: rgba(255,255,255,0.66); }
/* ---- 灵兽升品卡（独立一张卡）：跟名册一样两列，宽屏一行摆两只，窄屏 auto-fill 落回一列。
       每格自己竖着排（名 → 档位 → 加成 → 动作钮），不让长价目把钮撑成横贯一条 ---- */
.beast-promote-card .promote-list {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(min(400px, 100%), 1fr));
    gap: 6px; align-items: start;
}
.promote-row {
    display: flex; flex-direction: column; gap: 5px;
    border: 1px solid rgba(90,70,50,0.15); border-left: 3px solid rgba(92,85,75,0.45);
    border-radius: 12px; padding: 7px 10px; background: rgba(255,255,255,0.45);
}
.promote-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.promote-id { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-weight: 700; color: var(--ink); }
.promote-id b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.promote-tier { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; }
.promote-arrow { font-style: normal; opacity: 0.5; font-size: 12px; }
.promote-eff { font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
/* 升品要清零等级：这行是唯一的提醒，字色压深一点，别让人扫过去没看见 */
.promote-clear { font-size: 12px; color: var(--cinnabar); font-variant-numeric: tabular-nums; }
.promote-row .promote-btn { flex: 0 0 auto; align-self: flex-end; max-width: 100%; }
/* 价目一样一行、按钮摆在价目右边：一行挤三样材料，最长那条必然折行，断在哪不确定，
   字就被顶出格子；一样一行，断行位置才是确定的。每行挂个「耗」字头，
   才认得出这是这一只兽的价，不是整张卡的总数 */
.promote-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.promote-side { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.promote-cost-item { display: block; font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.promote-cost-label { font-weight: 600; color: var(--ink); margin-right: 2px; }
/* 缺的那样当场标红写「（缺）」，按钮上的「·差」看不懂，两边对不上 */
.promote-cost-item .lack, .promote-extra .lack { color: var(--cinnabar); font-weight: 600; }
/* 跨档补丹另起一行：混在价目里看不出是另一笔 */
.promote-extra { font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.promote-extra b { font-weight: 600; color: var(--ink); margin-right: 2px; }
/* 每一组数字不许从中间断开：断成「+415.0」和「（喂回后）」两半，看着像两个数；
   「（缺）」也跟着它那一项走，不会被甩到下一行变成另一件事 */
.promote-metric, .promote-cost-lead,
.promote-extra-lead, .promote-clear-a { white-space: nowrap; }
.promote-none { grid-column: 1 / -1; font-size: 12px; color: var(--ink-soft); padding: 4px 2px; }
/* ---- 灵宠传承卡（独立一张卡）：跟升品卡同一个骨架——两列、每格竖排、按钮贴右下 ---- */
.beast-transfer-card .transfer-list {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(min(400px, 100%), 1fr));
    gap: 6px; align-items: start;
}
.transfer-note { grid-column: 1 / -1; font-size: 12px; color: var(--ink-soft); padding: 0 2px 2px; }
.transfer-none { grid-column: 1 / -1; font-size: 12px; color: var(--ink-soft); padding: 4px 2px; }
.transfer-row {
    display: flex; flex-direction: column; gap: 5px;
    border: 1px solid rgba(90,70,50,0.15); border-left: 3px solid rgba(92,85,75,0.45);
    border-radius: 12px; padding: 7px 10px; background: rgba(255,255,255,0.45);
}
.transfer-head { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.transfer-id { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-weight: 700; color: var(--ink); }
.transfer-id b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.transfer-meta { font-size: 12px; color: var(--ink-soft); }
.transfer-eff { font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.transfer-row .transfer-btn { align-self: flex-end; max-width: 100%; }
.beast-item.rar-2 { border-left-color: var(--bamboo); }
.beast-item.rar-3 { border-left-color: var(--gold); }
.beast-item.rar-4 { border-left-color: var(--cinnabar); }
/* 神品鎏金、圣品宝蓝、道品紫（紫气东来），越往上越离「人间烟火」远 */
.beast-item.rar-5 { border-left-color: #d8961e; }
.beast-item.rar-6 { border-left-color: #4f8fd0; }
.beast-item.rar-7 { border-left-color: #9a6fd0; }
.beast-more-btn { align-self: center; margin-top: 4px; font-size: 12px; padding: 6px 16px; }
/* 摘要行一行到底：宽了让名字省略号顶住，不许把在阵/按钮挤下一行
   （两列名册一格才 400px 出头，5 星徽标+顶阶等级刚好超线会折行） */
.beast-line { display: flex; align-items: center; flex-wrap: nowrap; gap: 2px; min-width: 0; font-weight: 700; color: var(--ink); }
.beast-line-acts { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.beast-line-acts .btn { white-space: nowrap; padding: 4px 7px; font-size: 11px; }
.beast-id { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 0 1 auto; }
.beast-id b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.beast-line > .beast-tag, .beast-line > .beast-lv { flex: 0 0 auto; white-space: nowrap; }
.beast-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 6px; }
.beast-name { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 6px; font-weight: 700; color: var(--ink); min-width: 0; }
.beast-icon { font-size: 17px; line-height: 1; }
.beast-tag {
    font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 8px;
    border: 1px solid rgba(90,70,50,0.22); color: var(--ink-soft);
}
/* 品阶色：徽标靠描边+字色，出战位名字只用字色，不套框（套框的话 rar-1 没有框，
   同一排就会出现有的名字有框、有的没有） */
.beast-tag.rar-2 { border-color: rgba(74,124,89,0.5); }
.beast-tag.rar-3 { border-color: rgba(201,162,39,0.6); }
.beast-tag.rar-4 { border-color: rgba(176,58,46,0.5); }
.beast-tag.rar-5 { border-color: rgba(216,150,30,0.55); }
.beast-tag.rar-6 { border-color: rgba(79,143,208,0.5); }
.beast-tag.rar-7 { border-color: rgba(154,111,208,0.55); }
.slot-name.rar-2 { color: var(--bamboo); }
.slot-name.rar-3 { color: #9a7c17; }
.slot-name.rar-4 { color: var(--cinnabar); }
.slot-name.rar-5 { color: #a06c0c; }
.slot-name.rar-6 { color: #3a72ad; }
.slot-name.rar-7 { color: #7b52bd; }
/* 星级是养成进度标记：不套框——星君立绘自带描边与光晕，再套框会与品阶徽标同形，
   也和出战位的裸星不一致；圆满那档靠彩星立绘与加粗区分 */
.beast-tag.star { border-color: transparent; color: var(--ink-soft); padding: 1px 4px; }
.beast-tag.star.max { color: #9a7c17; font-weight: 700; }
/* 星级徽标：星君立绘一颗（段位由立绘配色区分）+ 段内序号 ×N */
.beast-tag .stars { display: inline-flex; align-items: center; gap: 2px; }
.beast-tag .stars .st { width: 16px; height: 16px; object-fit: contain; display: block; }
.stars .stn { font-style: normal; font-size: 11px; line-height: 1; font-weight: 700; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
/* 在阵/未出战：状态徽标，在阵用实底（身份标记不靠透明度堆） */
.beast-tag.on { border-color: var(--gold); background: var(--gold); color: #2b2620; }
.beast-tag.off { border-color: rgba(176,58,46,0.4); color: var(--cinnabar); }
.beast-bar { height: 4px; border-radius: 3px; background: rgba(90,70,50,0.12); overflow: hidden; }
.beast-bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--bamboo), var(--gold)); }
.beast-num { font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.beast-num em { font-style: normal; color: var(--cinnabar); }
.beast-lv { font-size: 12px; color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums; }
.beast-sum { margin-top: 8px; font-size: 12px; color: var(--bamboo-2); }
.beast-floor { color: var(--gold); }
.beast-capture { margin-top: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.beast-capture .btn { padding: 8px 14px; font-size: 13px; }
/* 缔结单独成卡后，缔结区是卡头底下第一个元素，不再吃名册底下那口 12px 空气 */
.beast-capture-card .beast-capture { margin-top: 0; }
.beast-card { position: relative; }
/* 缔结的连掷档位条 + 单颗动作钮：档位条只管选档，动作钮是一颗普通大小的钮。
   别让动作钮去分掉整行余量（实测灵兽卡整行 847px，按钮能撑到 700px 宽，
   一颗绿按钮横贯整张卡，看着像另一个模块）；等宽等高只管档位条内部的几个档。 */
.beast-cast { display: inline-flex; align-items: stretch; gap: 6px; flex: 0 1 auto; }
.beast-cast .btn { flex: 0 0 auto; min-width: 84px; height: 34px; padding: 0 16px; white-space: nowrap; }
.beast-cost { font-size: 12px; color: var(--ink-soft); }
/* 缔结这一行的互动：成率跳动、保底十点、目标预览与施法反馈，全部只读服务端下发的数字 */
.beast-cost.bump { animation: costBump 0.4s ease; }
@keyframes costBump {
    0%, 100% { transform: translateX(0); }
    35% { transform: translateX(3px); }
    70% { transform: translateX(-2px); }
}
.beast-capture-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; margin-top: 7px; }
.beast-pity { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.beast-pity b { margin-left: 4px; font-weight: 700; }
/* 显形概率：四档一行摆开，颜色与名册/图鉴同一套 rar-* 档位 */
.beast-odds { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: 11px; color: var(--ink-soft); min-width: 0; }
.beast-odds .odds-label { margin-right: 2px; }
.beast-odds .odds-chip {
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 999px;
    border: 1px solid rgba(90,70,50,0.2); font-variant-numeric: tabular-nums; cursor: default;
}
.beast-odds .odds-chip b { font-weight: 700; }
.beast-odds .odds-chip.rar-1 { border-color: rgba(90,70,50,0.28); }
.beast-odds .odds-chip.rar-2 { border-color: rgba(46,125,90,0.45); color: var(--bamboo-2); }
.beast-odds .odds-chip.rar-3 { border-color: rgba(201,162,39,0.6); color: var(--gold); }
.beast-odds .odds-chip.rar-4 { border-color: rgba(176,58,46,0.5); color: var(--cinnabar); }
.beast-odds .odds-chip.rar-5 { border-color: rgba(216,150,30,0.55); color: #a06c0c; }
.beast-odds .odds-chip.rar-6 { border-color: rgba(79,143,208,0.5); color: #3a72ad; }
.beast-odds .odds-chip.rar-7 { border-color: rgba(154,111,208,0.55); color: #7b52bd; }
/* 每档保底（凡品→道品七档）：一格一档，欠了几掷 / 多少掷兜住。
   档名沿用图鉴那套配色，玩家扫一眼就知道哪个数对应哪一档 */
.pity-tier { gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.pity-tier .tier-item { display: inline-flex; align-items: center; gap: 2px; }
.pity-tier .tier-item b { margin-left: 0; }
.pity-tier .tier-sep { color: rgba(90, 70, 50, 0.3); }
.pity-tier .t-2 { color: var(--bamboo-2); }
.pity-tier .t-3 { color: var(--gold); }
.pity-tier .t-4 { color: var(--cinnabar); }
.pity-tier .t-5 { color: #a06c0c; }
.pity-tier .t-6 { color: #3a72ad; }
.pity-tier .t-7 { color: #7b52bd; }
/* 缔结自动放归：勾一个品阶，本档及以下新收的当场放归。
   这是个开关不是动作——点一下就改设置，不许长得像「缔结」那类按钮，也不许自己开火。 */
.beast-auto { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--ink-soft); }
.beast-auto[hidden] { display: none; }
.beast-auto-label { flex: 0 0 auto; }
.beast-auto-tiers { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.beast-auto .auto-chip {
    font: inherit; font-size: 11px; line-height: 1; padding: 4px 10px; cursor: pointer;
    border: 1px solid rgba(90,70,50,0.22); border-radius: 999px;
    background: rgba(255,255,255,0.5); color: var(--ink-soft);
    transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}
.beast-auto .auto-chip:hover { border-color: var(--bamboo); color: var(--bamboo-2); }
.beast-auto .auto-chip.on { border-color: var(--bamboo); background: rgba(74,124,89,0.14); color: var(--bamboo-2); font-weight: 700; }
.beast-auto .auto-chip.rar-1.on { border-color: rgba(90,70,50,0.55); background: rgba(90,70,50,0.08); color: var(--ink); }
.beast-auto .auto-chip.rar-2.on { border-color: rgba(46,125,90,0.6); background: rgba(74,124,89,0.12); color: var(--bamboo-2); }
.beast-auto .auto-chip.rar-3.on { border-color: rgba(201,162,39,0.7); background: rgba(201,162,39,0.12); color: var(--gold); }
.beast-auto .auto-chip.rar-4.on { border-color: rgba(176,58,46,0.6); background: rgba(176,58,46,0.1); color: var(--cinnabar); }
.beast-auto .auto-chip.rar-5.on { border-color: rgba(216,150,30,0.7); background: rgba(216,150,30,0.12); color: #a06c0c; }
.beast-auto .auto-chip.rar-6.on { border-color: rgba(79,143,208,0.6); background: rgba(79,143,208,0.1); color: #3a72ad; }
.beast-auto .auto-chip.rar-7.on { border-color: rgba(154,111,208,0.7); background: rgba(154,111,208,0.12); color: #7b52bd; }
.beast-auto-note { font-size: 11px; color: var(--ink-soft); }

/* ---- 灵宠传承弹窗：旧宠投料 → 没养过的新宠；比例与加购价都由服务端下发 ---- */
.tr-box { width: min(420px, 94vw); text-align: left; }
.tr-box .modal-title { text-align: center; font-size: 22px; }
.tr-flow { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 14px; margin-bottom: 14px; color: var(--ink); }
.tr-flow b { font-size: 15px; }
.tr-flow .tr-arrow { color: var(--ink-soft); }
.tr-sec { margin-bottom: 13px; }
.tr-sec[hidden] { display: none; }
.tr-sec-label { font-size: 11px; color: var(--ink-soft); margin-bottom: 6px; }
.tr-src { font-size: 12px; color: var(--ink-soft); line-height: 1.7; }
.tr-none { font-size: 12px; color: var(--ink-soft); }
.tr-pick, .tr-pct { display: flex; flex-wrap: wrap; gap: 5px; }
.tr-chip {
    font: inherit; font-size: 12px; line-height: 1; padding: 6px 11px; cursor: pointer;
    border: 1px solid rgba(90,70,50,0.22); border-radius: 999px;
    background: rgba(255,255,255,0.5); color: var(--ink-soft);
    transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}
.tr-chip:hover:not(.off) { border-color: var(--bamboo); color: var(--bamboo-2); }
.tr-chip.on { border-color: var(--bamboo); background: rgba(74,124,89,0.14); color: var(--bamboo-2); font-weight: 700; }
.tr-chip.off { opacity: 0.42; cursor: not-allowed; }
.tr-cost { font-size: 12px; color: var(--ink-soft); margin-top: 7px; line-height: 1.6; }
.tr-cost b { color: var(--gold); }
.tr-res {
    font-size: 12px; line-height: 1.7; color: var(--ink); text-align: left;
    background: rgba(255,255,255,0.6); border: 1px solid rgba(90,70,50,0.14);
    border-radius: 10px; padding: 10px 12px; margin-bottom: 14px;
}
.tr-res[hidden] { display: none; }
.tr-res-row { display: flex; justify-content: space-between; gap: 12px; }
.tr-res-row > span:first-child { color: var(--ink-soft); flex: 0 0 auto; }
.tr-res-row > span:last-child { text-align: right; }
/* 缔结过程动画层：法阵转（等回信）→ 逐只显形 → 汇总，由玩家点收。
   遮罩按视口铺满、汇总摆视口正中：灵兽卡实测 847×1062，比一屏还高，
   盖在它身上居中会把小卡甩到屏幕外（量过：顶边 701、底边 1227，视口只有 900）。
   颜色框画在 .cast-stage 上，遮罩只按最好那档染一圈光晕 ——
   框画在遮罩上就成了「半个屏幕一个框」，没人会去看框里的内容。 */
.beast-cast-fx {
    position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center;
    padding: 16px; cursor: pointer; overflow: hidden;
    background: rgba(34, 26, 16, 0.42);
    /* 光晕收窄：原来一圈 110px 的染色铺满整屏，遮罩看着比窗口大得多；颜色交给小卡自己的边框 */
    box-shadow: inset 0 0 48px var(--fx-soft, rgba(90, 70, 50, 0.14));
}
.beast-cast-fx.rar-1 { --fx: rgba(92,85,75,0.62); --fx-soft: rgba(92,85,75,0.16); }
.beast-cast-fx.rar-2 { --fx: var(--bamboo); --fx-soft: rgba(74,124,89,0.2); }
.beast-cast-fx.rar-3 { --fx: var(--gold); --fx-soft: rgba(201,162,39,0.22); }
.beast-cast-fx.rar-4 { --fx: var(--cinnabar); --fx-soft: rgba(176,58,46,0.26); }
/* 神品以上四档：与名册 rar-5/6/7 同一套色，新档不落到灰兜底 */
.beast-cast-fx.rar-5 { --fx: #d8961e; --fx-soft: rgba(216,150,30,0.24); }
.beast-cast-fx.rar-6 { --fx: #4f8fd0; --fx-soft: rgba(79,143,208,0.24); }
.beast-cast-fx.rar-7 { --fx: #9a6fd0; --fx-soft: rgba(154,111,208,0.28); }
@keyframes fxFrame {
    0%, 100% { box-shadow: 0 18px 40px rgba(20,15,10,0.4), inset 0 0 14px var(--fx-soft, rgba(90,70,50,0.12)); }
    50% { box-shadow: 0 18px 40px rgba(20,15,10,0.4), inset 0 0 26px var(--fx-soft, rgba(90,70,50,0.12)), 0 0 12px var(--fx-soft, rgba(90,70,50,0.12)); }
}
@media (prefers-reduced-motion: reduce) { .cast-stage { animation: none; } }
.beast-cast-fx[hidden] { display: none; }
.cast-stage {
    /* 固定大小：这一屏不随这一掷收了几只而变 —— ×1 与 ×100 长得一模一样大，
       溢出的清单自己滚，标题与结算数字不跟着走（原来按内容长高，×100 一次能把窗口撑到半屏） */
    width: 420px; height: 420px; max-width: calc(100vw - 32px); max-height: calc(100vh - 32px);
    display: flex; flex-direction: column; justify-content: center; overflow: hidden; text-align: center;
    padding: 18px 16px 14px; border: 3px solid var(--fx, rgba(90,70,50,0.32)); border-radius: 14px;
    background: radial-gradient(circle at 50% 30%, rgba(255,252,243,0.99), rgba(240,228,206,0.98));
    animation: fxFrame 1.8s ease-in-out infinite;
}
.cast-stage.done { justify-content: flex-start; }
.cast-ring { position: relative; width: 112px; height: 112px; margin: 0 auto; }
.cast-ring i {
    position: absolute; inset: 0; border-radius: 50%;
    border: 2px dashed rgba(176,58,46,0.42); animation: castSpin 1.7s linear infinite;
}
.cast-ring i:nth-child(2) { inset: 15px; border-style: solid; border-color: rgba(201,162,39,0.55); animation-duration: 1.1s; animation-direction: reverse; }
.cast-ring i:nth-child(3) { inset: 30px; border-style: dotted; animation-duration: 2.6s; }
.cast-ring b {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: 30px; animation: castPulse 0.95s ease-in-out infinite;
}
@keyframes castSpin { to { transform: rotate(360deg); } }
@keyframes castPulse { 0%, 100% { transform: scale(1); opacity: .82; } 50% { transform: scale(1.18); opacity: 1; } }
.cast-word { margin-top: 12px; font-size: 14px; font-weight: 700; color: var(--cinnabar); }
.cast-hint { margin-top: 6px; font-size: 11px; color: var(--ink-soft); }
.cast-title { flex: 0 0 auto; font-family: "KaiTi","STKaiti",serif; font-size: 18px; font-weight: 700; color: var(--ink); }
/* 清单不再自己套一层滚动条：汇总卡已经按视口收高，两级嵌套滚动没人分得清该滚哪个 */
.cast-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 8px;
    margin: 12px 0 10px;
    flex: 1 1 auto; min-height: 0; overflow-y: auto;   /* 收得多的那一次滚这里，窗口不长大 */
}
.cast-card {
    display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 4px;
    border: 2px solid var(--cc, rgba(90,70,50,0.25)); border-radius: 10px;
    background: rgba(255,255,255,0.72); animation: castIn .42s ease backwards;
}
.cast-card.rar-1 { --cc: rgba(92,85,75,0.5); }
.cast-card.rar-2 { --cc: var(--bamboo); }
.cast-card.rar-3 { --cc: var(--gold); }
.cast-card.rar-4 { --cc: var(--cinnabar); }
.cast-card.rar-5 { --cc: #d8961e; }
.cast-card.rar-6 { --cc: #4f8fd0; }
.cast-card.rar-7 { --cc: #9a6fd0; }
@keyframes castIn { from { opacity: 0; transform: translateY(12px) scale(.86); } to { opacity: 1; transform: none; } }
.cast-icon.ic { width: 38px; height: 38px; font-size: 28px; }
.cast-name { font-size: 13px; font-weight: 700; color: var(--ink); }
.cast-tag { font-size: 10px; }
.cast-out { font-size: 10px; color: var(--ink-soft); text-align: center; }
.cast-tally { flex: 0 0 auto; margin-top: 4px; font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.cast-tally b { color: var(--ink); font-weight: 700; }
.cast-tally b.rar-4 { color: var(--cinnabar); }
.cast-tally b.rar-5 { color: #a06c0c; }
.cast-tally b.rar-6 { color: #3a72ad; }
.cast-tally b.rar-7 { color: #7b52bd; }
.cast-stop { flex: 0 0 auto; margin-top: 6px; font-size: 11px; color: var(--cinnabar); }
/* 施法态：只盖住这一掷的往返，回信一到就摘掉，动画不替服务端下结论 */
.beast-capture .btn.casting { pointer-events: none; animation: casting 0.7s ease; }
@keyframes casting {
    0%, 100% { transform: none; filter: none; box-shadow: none; }
    25% { transform: rotate(-1.5deg) scale(0.97); }
    55% { filter: brightness(1.22); box-shadow: 0 0 16px 3px rgba(201, 162, 39, 0.4); }
    80% { transform: rotate(1.5deg) scale(1.02); }
}
.beast-item.fresh { animation: freshIn 1.5s ease; }
@keyframes freshIn {
    0% { box-shadow: 0 0 0 0 rgba(201, 162, 39, 0.5); }
    35% { box-shadow: 0 0 0 6px rgba(201, 162, 39, 0.26); }
    100% { box-shadow: 0 0 0 0 rgba(201, 162, 39, 0); }
}
/* 这一场刚收进来的那几只：整行按稀有色描一圈，直到点开培养台看过为止（弹窗盖着的时候来不及看，不能只闪一下就完） */
.beast-item.just-in { --ji: rgba(92,85,75,0.62); --jit: #5c554b; border-color: var(--ji); box-shadow: 0 0 0 2px var(--ji); }
.beast-item.just-in.rar-2 { --ji: var(--bamboo); --jit: var(--bamboo); }
.beast-item.just-in.rar-3 { --ji: var(--gold); --jit: #9a7c17; }
.beast-item.just-in.rar-4 { --ji: var(--cinnabar); --jit: var(--cinnabar); }
.beast-item.just-in.rar-5 { --ji: #d8961e; --jit: #a06c0c; }
.beast-item.just-in.rar-6 { --ji: #4f8fd0; --jit: #3a72ad; }
.beast-item.just-in.rar-7 { --ji: #9a6fd0; --jit: #7b52bd; }
.beast-tag.new { border-color: var(--ji); color: var(--jit); font-weight: 700; }
.beast-actions { margin-top: 12px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.btn.ghost {
    background: transparent; color: var(--ink-soft);
    border: 1px solid rgba(90,70,50,0.22); box-shadow: none;
}
.btn.ghost:hover { color: var(--cinnabar); border-color: rgba(176,58,46,0.45); filter: none; }

.sect-current { font-size: 13px; color: var(--ink-soft); margin-bottom: 10px; }
.sect-current b { color: var(--cinnabar); }
.sect-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sect-input {
    border: 1px solid rgba(90,70,50,0.2); border-radius: 10px; padding: 8px 10px;
    font-size: 13px; background: rgba(255,255,255,0.6); color: var(--ink); min-width: 120px;
}
.sect-input:disabled { opacity: 0.5; }
.sect-form .btn { padding: 8px 14px; font-size: 13px; }
.sect-rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sect-rank li { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.sect-rank .srk {
    width: 22px; height: 22px; flex: 0 0 auto; border-radius: 50%;
    background: var(--gold); color: #2b2620; font-weight: 700; font-size: 12px;
    display: grid; place-items: center;
}
.sect-rank .srname { font-weight: 700; color: var(--ink); min-width: 70px; }
.sect-rank .srinfo { color: var(--ink-soft); font-size: 12px; }
/* 榜单里的镇妖渊战况：层数比人数更话痨，窄屏允许折到第二行，不让名字被挤没 */
.sect-rank li { flex-wrap: wrap; }
.sect-rank .srboss {
    margin-left: auto; font-size: 11px; color: var(--ink-soft); white-space: nowrap;
    padding: 1px 7px; border-radius: 9px; border: 1px solid rgba(90,70,50,0.16);
    font-variant-numeric: tabular-nums;
}

.social-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.social-row .sect-input { min-width: 180px; }
.social-meta { font-size: 12px; color: var(--ink-soft); }
#dual-meta { color: var(--cinnabar); font-weight: 600; }

/* ---- P3：奇遇 / 成就 / 图鉴 / 天劫 ---- */
.ach-sum { font-size: 13px; color: var(--ink-soft); margin-bottom: 10px; }
.ach-sum b { color: var(--cinnabar); }
.ach-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ach-item {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
    border: 1px solid rgba(90,70,50,0.15); border-radius: 10px; padding: 7px 10px;
    background: rgba(255,255,255,0.35); opacity: 0.6;
}
.ach-item.on { opacity: 1; background: rgba(201,162,39,0.12); border-color: var(--gold); }
.ach-icon {
    flex: 0 0 auto; width: 24px; height: 24px; line-height: 24px;
    text-align: center; font-size: 16px;
    filter: grayscale(0.55); opacity: 0.55;
    border-radius: 50%; background: rgba(255,255,255,0.5);
}
.ach-item.on .ach-icon { filter: none; opacity: 1; background: rgba(201,162,39,0.18); }
.ach-name { font-weight: 700; color: var(--ink); min-width: 72px; }
.ach-desc { flex: 1; min-width: 8em; color: var(--ink-soft); }
.ach-bonus { color: var(--bamboo-2); font-weight: 600; font-size: 12px; text-align: right; }

.codex-count { font-size: 13px; color: var(--gold); font-weight: 700; }
.codex-sub { margin: 14px 0 8px; font-size: 13px; color: var(--ink-soft); font-weight: 600; }
.codex-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.codex-item {
    border: 1px solid rgba(90,70,50,0.15); border-radius: 10px; padding: 8px 10px;
    background: rgba(255,255,255,0.3); opacity: 0.55; filter: grayscale(0.6);
}
.codex-item.got { opacity: 1; filter: none; background: rgba(74,124,89,0.1); border-color: var(--bamboo); }
/* 灵兽图鉴的稀有度描边：凡品不加色，良/上/仙依次竹青、金、朱砂（与灵兽卡左侧描边同一套语义） */
.codex-item.got.rar-2 { border-color: rgba(74,124,89,0.85); }
.codex-item.got.rar-3 { border-color: rgba(201,162,39,0.9); }
.codex-item.got.rar-4 { border-color: rgba(176,58,46,0.8); background: rgba(176,58,46,0.07); }
.codex-item.got.rar-5 { border-color: rgba(216,150,30,0.85); background: rgba(216,150,30,0.06); }
.codex-item.got.rar-6 { border-color: rgba(79,143,208,0.8); background: rgba(79,143,208,0.06); }
.codex-item.got.rar-7 { border-color: rgba(154,111,208,0.85); background: rgba(154,111,208,0.07); }
.codex-name { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ink); font-size: 13px; }
.codex-icon {
    flex: 0 0 auto; width: 20px; text-align: center; font-size: 15px; line-height: 1;
    filter: grayscale(0.6); opacity: 0.6;
}
.codex-icon.codex-img {
    width: 32px; height: 32px; object-fit: contain;
}
.codex-item.got .codex-icon { filter: none; opacity: 1; }
.codex-item.got .codex-icon.codex-img { display: block; }
.codex-desc { font-size: 11px; color: var(--ink-soft); margin-top: 2px; line-height: 1.4; }

/* ---- v2.2.8：宗门历练 / 切磋候选 / 图鉴奖赏 / 轮回转世 ---- */
.hero-title { color: var(--gold); font-weight: 700; }

.sect-task {
    margin: 12px 0; padding: 10px 12px; border-radius: 12px;
    background: rgba(201,162,39,0.08); border: 1px dashed rgba(90,70,50,0.22);
}
.st-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--ink); }
.st-head b { color: var(--cinnabar); }
.st-expire { font-size: 12px; color: var(--cinnabar); font-weight: 700; white-space: nowrap; }
.st-desc { font-size: 12px; color: var(--ink-soft); margin: 4px 0 8px; line-height: 1.5; }
.st-bar { height: 10px; border-radius: 6px; background: var(--paper-2); overflow: hidden; }
.st-fill { height: 100%; background: linear-gradient(90deg, var(--bamboo), var(--gold)); transition: width 0.4s ease; }
.st-meta { margin-top: 6px; font-size: 12px; color: var(--ink-soft); }
.st-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.st-actions .sect-input { width: 100px; min-width: 100px; }
.st-actions .btn { padding: 8px 14px; font-size: 13px; }
.st-warn { font-size: 12px; color: var(--cinnabar); }

.rival-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin: 2px 0 12px; }
.rival {
    display: flex; flex-direction: column; align-items: stretch; gap: 3px; text-align: left; cursor: pointer;
    border: 1px solid rgba(90,70,50,0.16); border-radius: 10px; padding: 8px 10px;
    background: rgba(255,255,255,0.45); color: var(--ink); font-size: 12px;
}
.rival:hover { border-color: var(--gold); }
.rival.near { border-color: var(--bamboo); background: rgba(74,124,89,0.09); }
.rival:not(.near) { opacity: 0.72; }
.rv-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.rv-name { font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-realm { color: var(--cinnabar); font-size: 12px; white-space: nowrap; }
.rv-bottom { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.rv-pow { color: var(--bamboo-2); font-weight: 700; font-variant-numeric: tabular-nums; }
.rv-tag { font-size: 10px; padding: 1px 5px; border-radius: 8px; background: var(--paper-2); color: var(--ink-soft); }
.rival.near .rv-tag { background: var(--bamboo); color: #fff; }
.rival-empty { grid-column: 1 / -1; font-size: 12px; color: var(--ink-soft); }

.branch-btn.locked { opacity: 0.5; border-style: dashed; }

.codex-progress { height: 8px; border-radius: 6px; background: var(--paper-2); overflow: hidden; margin: 6px 0 10px; }
.codex-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--bamboo)); transition: width 0.4s ease; }
.codex-rewards { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px; }
.cr-head { font-size: 12px; color: var(--ink-soft); }
.cr-item {
    display: flex; align-items: center; gap: 8px; font-size: 12px; opacity: 0.6;
    border: 1px solid rgba(90,70,50,0.15); border-radius: 10px; padding: 6px 9px;
    background: rgba(255,255,255,0.35);
}
.cr-item.on { opacity: 1; background: rgba(201,162,39,0.14); border-color: var(--gold); }
.cr-pct { width: 34px; flex: 0 0 auto; font-weight: 800; color: var(--gold); }
.cr-name { font-weight: 700; color: var(--ink); white-space: nowrap; }
.cr-desc { flex: 1; min-width: 0; color: var(--ink-soft); }
.cr-state { color: var(--bamboo-2); font-weight: 600; white-space: nowrap; }

.rebirth-card .btn { width: 100%; }
/* 轮回卡的家底与永久增益：等宽芯片自排，标签左、数值右，一行摆得下四枚 */
.rb-chips {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 6px; margin-bottom: 10px;
}
.rb-chip {
    display: flex; align-items: baseline; gap: 5px; min-width: 0; padding: 5px 9px;
    border-radius: 10px; border: 1px solid rgba(90, 70, 50, 0.18);
    background: rgba(255, 255, 255, 0.45); font-size: 12px; color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
}
.rb-chip b { font-weight: 700; color: var(--cinnabar); }
.rb-chip i { font-style: normal; opacity: 0.78; }
/* 折算率是随芯片行摆的一条口径，独占整行，免得挤成第二列 */
.rb-rule {
    grid-column: 1 / -1; font-size: 12px; color: var(--ink-soft); margin-top: 2px;
}
.rb-rule b { color: var(--cinnabar); }

/* ---- v2.3.2：轮回转世果位图录 ---- */
/* 转世卡内部的分节线；功德林与果位已各自成卡，卡头就是分界，不再叠一条线 */
.rb-gate, .rb-ledger, .rb-fate {
    margin-top: 14px; padding-top: 14px; border-top: 1px solid rgba(90,70,50,0.12);
}
/* 空节不占位：够不着门槛时得失清单整块消失，不留一条孤线 */
.rb-gate:empty, .rb-ledger:empty, .rb-fate:empty { display: none; }
.merit-shop, .fruit-book { margin-top: 0; }
.rb-sub {
    font-size: 13px; color: var(--ink-soft); margin: 0 0 8px; font-weight: 600;
}
/* 卡头已经写了名字，卡内只需要一行规则说明 */
.sub-note {
    font-size: 12px; color: var(--ink-soft); margin: -6px 0 10px;
}
/* 折叠体是 overflow:hidden 的 BFC，不吞子级的负上边距——那 6px 会把首行说明顶出容器
   裁掉上半截（果位图录实测被切）。BFC 里的首行 sub-note 负边距一律归零。 */
.collapsible-body > .sub-note:first-child { margin-top: 0; }
.rb-rows { font-size: 13px; line-height: 1.7; color: var(--ink-soft); }
.rb-rows b { color: var(--cinnabar); }
/* 「距转世」那根进度条：跟首页修为条同一套色，读得出是在走同一段路 */
.rb-bar { margin: 8px 0 6px; }

/* 命格只剩一行结果：转世时由天掷出，玩家看结果，不再有得挑 */
.rb-fate-next {
    font-size: 13px; line-height: 1.6; color: var(--ink-soft); margin-top: 4px;
}
.rb-fate-next b { color: var(--cinnabar); }

.fruit-row {
    display: grid; grid-template-columns: 56px 90px 1fr auto; gap: 8px;
    align-items: center; padding: 8px 0; border-bottom: 1px dashed rgba(90,70,50,0.1);
    font-size: 13px;
}
.fruit-at { color: var(--ink-soft); text-align: right; }
.fruit-name { font-weight: 600; color: var(--ink); }
.fruit-desc { color: var(--ink-soft); }
.fruit-tag {
    font-size: 12px; padding: 2px 8px; border-radius: 10px;
    background: rgba(90,70,50,0.08); color: var(--ink-soft);
}
.fruit-row.got .fruit-name { color: var(--gold); }
.fruit-row.next .fruit-name { color: var(--bamboo); }
/* 前世录：一行一世，落点/舍/得/命格/日子。列宽按最长一串数字（七位修为 + 分位符）留足，不缩写 */
.lives-head, .lives-row {
    display: grid; grid-template-columns: auto minmax(120px, 1.1fr) minmax(190px, 1.6fr) minmax(130px, 1fr) 62px 74px;
    gap: 8px; align-items: center; font-size: 13px;
}
.lives-head {
    color: var(--ink-soft); font-size: 12px; padding-bottom: 6px;
    border-bottom: 1px solid rgba(90, 70, 50, 0.16);
}
.lives-head span:first-child { min-width: 62px; }
.lives-row { padding: 8px 0; border-bottom: 1px dashed rgba(90, 70, 50, 0.1); }
.lv-no { color: var(--ink); font-weight: 600; white-space: nowrap; }
/* 最新一条是「本世」：括号里两个字要轻，别抢世数 */
.lv-no i { font-style: normal; font-weight: 500; opacity: 0.72; }
.lv-land { color: var(--ink-soft); min-width: 0; }
.lv-land b { color: var(--cinnabar); font-weight: 600; }
.lv-lost, .lv-gain { color: var(--ink-soft); min-width: 0; font-variant-numeric: tabular-nums; }
.lv-gain { color: var(--bamboo-2); }
.lv-el { color: var(--ink); white-space: nowrap; }
.lv-at { color: var(--ink-soft); font-size: 12px; white-space: nowrap; text-align: right; }
.lives-miss { font-size: 12px; color: var(--ink-soft); padding: 8px 0; }
/* 功德林：一行一件事，右侧只给一个动作；买不到的一律不出现按钮
   动作列定宽：理由标签比按钮长，跟着内容走会把说明挤成竖条，三行高度参差 */
.ms-row {
    display: grid; grid-template-columns: 96px 1fr 84px; gap: 8px;
    align-items: center; padding: 8px 0; border-bottom: 1px dashed rgba(90,70,50,0.1);
    font-size: 13px;
}
.ms-name { font-weight: 600; color: var(--ink); }
.ms-desc { color: var(--ink-soft); }
.ms-row.done .ms-name { color: var(--bamboo); }
.ms-row.blocked, .ms-row.poor { opacity: 0.62; }
.ms-tag {
    font-size: 12px; padding: 2px 8px; border-radius: 10px;
    background: rgba(90,70,50,0.08); color: var(--ink-soft);
}
/* 理由标签比按钮长（如「已有待选的命格，先做抉择」）：定宽列里换行居中，不许顶破说明列 */
.ms-row .ms-tag { justify-self: stretch; text-align: center; white-space: normal; line-height: 1.35; }
.btn-ms {
    font-size: 12px; padding: 4px 10px; border-radius: 12px; white-space: nowrap;
    background: var(--cinnabar); color: #fff; border: none; cursor: pointer;
}
.btn-ms:hover { background: var(--cinnabar-2); }
.btn-ms:disabled { opacity: 0.4; cursor: not-allowed; }
/* 夺舍令掷出的三张命：和转世命格抉择分开摆，避免读成「这两处选一张就行」 */
.ms-offer {
    padding: 8px 10px; margin-bottom: 8px; border-radius: 8px;
    background: rgba(255,255,255,0.5); border: 1px solid rgba(90,70,50,0.1);
}
.ms-offer-t { font-size: 13px; color: var(--ink); margin-bottom: 6px; }
.ms-offer-hint { font-size: 12px; color: var(--ink-soft); margin-top: 6px; }
.btn-ms.ms-pick { margin-right: 6px; }

.rank li.me { background: rgba(201,162,39,0.16); border-radius: 8px; }

/* ---- v2.3.0：宗门库藏 / 常驻建设 / 弟子名录 / 切磋推送 ---- */
/* 库藏并入宗门等级行的右半：只读数字合一张行，等级卡不再上下叠两块；
   窄屏放不下时折到第二行，数字与单位不许拆开 */
.sect-level .st-head { flex-wrap: wrap; row-gap: 2px; }
.sl-treasury {
    font-size: 12px; color: var(--ink-soft); min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font-variant-numeric: tabular-nums; cursor: help;
}
.sl-treasury b { color: var(--cinnabar); font-weight: 800; margin-right: 2px; }

.sect-sub-title { margin: 14px 0 6px; font-size: 14px; color: var(--ink-soft); font-weight: 600; }
.sect-buildings { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
/* 图标 / 名称+等级 / 加成三列各自定宽或带下限，余量全给花费列：整条封顶提示比「下一级 50 灵石」宽一倍多，
   让花费列自己按内容撑开就会把加成列挤窄，五行的起点各不相同，看着就是错开的。
   第二列写成 minmax(112px, max-content)：112 只是下限，字号被浏览器放大时按内容长出去，
   配合下面两个 nowrap，「Lv.12 / 12」绝不会再被折成两行 */
.building-row {
    display: grid; grid-template-columns: 26px minmax(112px, max-content) 288px minmax(0, 1fr) auto; gap: 8px; align-items: center; text-align: left;
    border: 1px solid rgba(90,70,50,0.15); border-radius: 10px; padding: 7px 10px;
    background: rgba(255,255,255,0.4); font-size: 12px; color: var(--ink);
}
.building-row.maxed { background: rgba(201,162,39,0.12); border-color: var(--gold); }
.bd-icon { font-size: 18px; text-align: center; }
.bd-main { display: flex; align-items: baseline; gap: 6px; }
.bd-name { font-weight: 700; white-space: nowrap; }
.bd-lv { color: var(--bamboo-2); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bd-desc { color: var(--ink-soft); }
.bd-cost { color: var(--cinnabar); font-weight: 600; text-align: right; }
.building-row .btn { padding: 5px 12px; font-size: 12px; }
/* 五殿同辉：五座建筑的最低级各抬一档全宗战力，挂在建设列表头上，不另占一张卡 */
.sect-fivehall { font-size: 12px; color: var(--ink-soft); margin: 0 0 8px; line-height: 1.5; }
.sect-fivehall b { color: var(--cinnabar); font-variant-numeric: tabular-nums; }

/* ---- 镇妖渊：全宗共打一条血，每日按人头出手 ---- */
.sect-boss-card[hidden] { display: none; }
.sect-boss { display: flex; flex-direction: column; gap: 10px; }
.sb-top { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: start; }
span.ic.sb-art {
    width: 96px; height: 96px; padding: 4px; border-radius: 14px;
    border: 1px solid rgba(176,58,46,0.24);
    background: radial-gradient(circle at 50% 45%, rgba(176,58,46,0.14), rgba(255,255,255,0.5) 72%);
}
.sb-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sb-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.sb-name { font-size: 16px; font-weight: 700; color: var(--ink); font-family: "KaiTi","STKaiti",serif; }
.sb-layer { font-size: 12px; font-weight: 700; color: var(--cinnabar); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sb-cycle { font-size: 11px; color: var(--ink-soft); padding: 1px 8px; border-radius: 10px; background: rgba(90,70,50,0.08); white-space: nowrap; }
.sb-phase {
    font-size: 11px; font-weight: 700; color: var(--cinnabar); white-space: nowrap;
    padding: 1px 8px; border-radius: 10px; border: 1px solid rgba(176,58,46,0.45);
}
.sb-hpbar {
    position: relative; height: 16px; border-radius: 9px; overflow: hidden;
    background: var(--paper-2); border: 1px solid rgba(90,70,50,0.12);
}
.sb-hpfill {
    height: 100%; border-radius: 8px;
    background: linear-gradient(90deg, #8f2f27, var(--cinnabar));
    transition: width 0.6s ease;
}
/* 70% / 35% 两条阶段线：到线以下伤害加成放大，线画在血条上，玩家看得见自己在哪儿 */
.sb-mark {
    position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px;
    background: rgba(255,255,255,0.75); box-shadow: 0 0 2px rgba(40,30,20,0.45);
}
.sb-mark::after {
    content: ""; position: absolute; top: 0; left: -2px;
    border-left: 3px solid transparent; border-right: 3px solid transparent;
    border-top: 4px solid rgba(255,255,255,0.85);
}
.sb-hpmeta { font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; line-height: 1.4; }
.sb-hpmeta b { color: var(--ink); }
.sb-hpmeta .sb-rec { color: var(--bamboo-2); font-weight: 700; }
.sb-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.sb-badge {
    font-size: 11px; padding: 3px 9px; border-radius: 10px; white-space: nowrap;
    border: 1px solid rgba(90,70,50,0.18); background: rgba(255,255,255,0.45);
    color: var(--ink-soft); font-variant-numeric: tabular-nums;
}
.sb-badge b { color: var(--ink); }
.sb-badge.hot { border-color: var(--gold); color: var(--cinnabar); }
.sb-badge.hot b { color: var(--cinnabar); }
.sb-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sb-actions .btn { min-width: 168px; padding: 9px 16px; font-size: 14px; white-space: nowrap; }
.sb-my { font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.sb-my b { color: var(--cinnabar); }
.sb-reward {
    font-size: 12px; color: var(--ink-soft); line-height: 1.6;
    border-left: 2px solid rgba(201,162,39,0.55); padding-left: 8px;
}
.sb-reward b { color: var(--cinnabar); font-variant-numeric: tabular-nums; }
.sb-sub { font-size: 12px; font-weight: 700; color: var(--ink-soft); margin: 0; }
.sb-feed {
    display: flex; flex-direction: column; gap: 3px;
    padding: 8px 10px; border-radius: 10px;
    border: 1px solid rgba(90,70,50,0.16); background: rgba(255,255,255,0.45);
    font-size: 12px; color: var(--ink-soft);
}
.sb-feed .sb-feed-head {
    display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
    font-weight: 700; color: var(--ink); font-size: 12px;
}
.sb-hit { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; line-height: 1.45; }
.sb-hit .sb-hd { min-width: 84px; font-weight: 700; color: var(--cinnabar); font-variant-numeric: tabular-nums; }
.sb-hit .sb-tag {
    font-size: 10px; padding: 0 6px; border-radius: 8px;
    border: 1px solid rgba(201,162,39,0.55); color: #8a6d12;
}
.sb-hit .sb-tag.red { border-color: rgba(176,58,46,0.45); color: var(--cinnabar); }
.sb-hit.kill { color: var(--cinnabar); font-weight: 700; }
.sb-hit.sb-daily { color: var(--bamboo-2); }
.sb-rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.sb-rank li {
    display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: baseline;
    font-size: 12px; padding: 4px 9px; border-radius: 8px;
    border: 1px solid rgba(90,70,50,0.1); background: rgba(255,255,255,0.4);
}
.sb-rank li.me { border-color: var(--gold); }
.sb-rank .sb-rk {
    width: 20px; height: 20px; border-radius: 50%; background: var(--gold); color: #2b2620;
    font-weight: 700; font-size: 11px; display: grid; place-items: center; align-self: center;
}
.sb-rank .sb-rname { font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-rank .sb-rdmg { color: var(--ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sb-rank .sb-rnone { grid-template-columns: 1fr; color: var(--ink-soft); }
.sb-lastkill { font-size: 12px; color: var(--ink-soft); line-height: 1.6; }
.sb-lastkill b { color: var(--cinnabar); }

.sect-roster { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.roster-item {
    /* 战力是 bigNum 全写不缩写，七位就要 8ch：原先钉死 50px（=7.5ch），超长的右对齐行
       会退回左对齐并往右溢出，把「掌门/弟子」压住。列宽改按 ch 跟着字号走，换字体也不顶邻居；
       名字列封到 300px，余量交给贡献列，境界/战力/身份这一组因此整体靠左。 */
    display: grid; grid-template-columns: 10px minmax(0, 300px) 74px 11ch 44px minmax(90px, 1fr); gap: 8px; align-items: center;
    border: 1px solid rgba(90,70,50,0.12); border-radius: 10px; padding: 6px 10px;
    background: rgba(255,255,255,0.35); font-size: 12px; color: var(--ink);
}
.roster-item.role-founder { background: rgba(201,162,39,0.14); border-color: var(--gold); }
.roster-item.role-elder { background: rgba(74,124,89,0.1); border-color: var(--bamboo); }
.roster-empty { color: var(--ink-soft); font-size: 12px; padding: 6px 10px; list-style: none; }
.rd-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(90,70,50,0.24); }
.roster-item.online .rd-dot { background: var(--bamboo); box-shadow: 0 0 6px rgba(74,124,89,0.6); }
.rd-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-realm { color: var(--cinnabar); text-align: center; white-space: nowrap; }
.rd-pow { color: var(--bamboo-2); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; overflow: hidden; }
.rd-role { color: var(--ink-soft); text-align: center; font-size: 11px; }
.rd-contrib { color: var(--ink-soft); text-align: right; font-variant-numeric: tabular-nums; }

.st-daily { font-size: 11px; color: var(--bamboo-2); font-weight: 700; margin-left: 6px; padding: 1px 8px; border-radius: 10px; background: rgba(74,124,89,0.14); }

/* ---- v2.3.3：宗门等级经验条 / 每日上缴 / 灵兽喂养倍率 ---- */
.sect-level {
    margin: 12px 0 8px; padding: 8px 12px; border-radius: 10px;
    background: rgba(255,255,255,0.55); border: 1px solid rgba(90,70,50,0.14);
}
.sect-level .st-head { font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.sect-level .st-bar { height: 12px; }
.sect-level .st-meta { margin-top: 5px; }
.sl-lv { color: var(--cinnabar); font-weight: 800; font-variant-numeric: tabular-nums; }

/* 双轨：贡献闸门 + 工程燃料，各一条进度条 */
.sect-track { margin-top: 8px; }
.sect-track-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12px; }
.sect-track-name { color: var(--ink); font-weight: 700; }
.sect-track-val { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.sect-unlocks { margin-top: 8px; font-size: 12px; color: var(--ink-soft); line-height: 1.6; }
.sect-unlocks-title { margin-right: 6px; color: var(--ink); font-weight: 700; }
.sect-unlock { display: inline-block; margin-right: 10px; white-space: nowrap; }
.sect-unlock b { color: var(--cinnabar); font-variant-numeric: tabular-nums; }

.sect-project {
    margin: 10px 0 12px; padding: 10px 12px; border-radius: 12px;
    background: rgba(74,124,89,0.06); border: 1px solid rgba(90,70,50,0.14);
}
.sect-project .st-head { font-weight: 700; color: var(--ink); }
.sect-project .sect-input { width: 100px; min-width: 100px; }
.sect-project .st-actions .btn { padding: 8px 14px; font-size: 13px; }
.pr-have { font-size: 12px; }

.sect-donate {
    margin: 10px 0 12px; padding: 10px 12px; border-radius: 12px;
    background: rgba(201,162,39,0.06); border: 1px solid rgba(90,70,50,0.14);
}
.sect-donate .st-head { font-weight: 700; color: var(--ink); }
.sect-select {
    padding: 7px 9px; border-radius: 9px; font-size: 13px; color: var(--ink);
    border: 1px solid rgba(90,70,50,0.2); background: rgba(255,255,255,0.6);
}
.sect-donate .sect-input { width: 100px; min-width: 100px; }
.sect-donate .st-actions .btn { padding: 8px 14px; font-size: 13px; }
.dn-have { font-size: 12px; }

/* ---- 宗门大比 ---- */
.sect-tourney {
    margin: 10px 0 12px; padding: 10px 12px; border-radius: 12px;
    background: rgba(176,58,46,0.05); border: 1px solid rgba(90,70,50,0.14);
}
.sect-tourney .st-head { font-weight: 700; color: var(--ink); }
.sect-tourney .st-actions .btn { white-space: nowrap; }
.tn-chip {
    margin-left: 8px; padding: 1px 9px; border-radius: 10px;
    font-size: 11px; font-weight: 700; background: rgba(201,162,39,0.2); color: #8a6d12;
}
.tn-chip.tn-ok { background: rgba(74,124,89,0.16); color: var(--bamboo); }
.tn-chip.tn-done { background: rgba(90,70,50,0.12); color: var(--ink-soft); }
.tn-sub { margin: 12px 0 5px; font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.tn-teams, .tn-hist {
    list-style: none; margin: 0 0 4px; padding: 0;
    display: flex; flex-direction: column; gap: 4px;
}
.tn-teams li, .tn-hist li {
    display: flex; align-items: baseline; gap: 8px; font-size: 12px;
    padding: 4px 8px; border-radius: 8px; background: rgba(255,255,255,0.4);
}
.tn-teams li.mine { background: rgba(201,162,39,0.14); box-shadow: inset 2px 0 0 var(--gold); }
.tn-tname { font-weight: 700; color: var(--ink); }
.tn-tinfo { margin-left: auto; color: var(--ink-soft); font-size: 11px; white-space: nowrap; }
.tn-bracket { display: grid; grid-template-columns: max-content minmax(0,1fr); gap: 4px 8px; align-items: start; }
/* 对阵按「一轮一行」压：轮次徽章在左，该轮对局横排折行——逐场竖排太占地。
   整张表合成一个网格（行壳 display:contents），徽章列按全表最长的轮名定宽：
   轮名会到「十六强赛」「32 强赛」，写死列宽就折成两行，行与行也对不齐 */
.tn-roundrow { display: contents; }
.tn-bracket > .tn-roundmatches { grid-column: 1 / -1; }
.tn-round {
    justify-self: start; white-space: nowrap;
    font-size: 11px; font-weight: 700; color: var(--cinnabar);
    background: rgba(176,58,46,0.08); padding: 2px 10px; border-radius: 10px;
}
.tn-roundmatches { display: flex; flex-wrap: wrap; gap: 3px 14px; font-size: 12px; padding: 2px 0; }
.tn-dm { display: inline-flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.tn-roundmatches .tn-team { display: inline; }
.tn-roundmatches .tn-bye { font-size: 11px; color: var(--ink-soft); }
.tn-match {
    display: grid; grid-template-columns: minmax(0,1fr) 52px minmax(0,1fr); gap: 6px; align-items: center;
    padding: 5px 10px; border-radius: 8px; background: rgba(255,255,255,0.4); font-size: 12px;
}
.tn-team {
    text-align: right; color: var(--ink);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tn-team.b { text-align: left; }
.tn-team.win { color: var(--cinnabar); font-weight: 700; }
.tn-team.mine { text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.tn-score { text-align: center; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
/* 观战只读重演：按钮自绘，跟对阵行同高，窄屏折行也不挤 */
.tn-watch {
    align-self: center; margin-left: 2px; padding: 0 7px; line-height: 17px;
    font: inherit; font-size: 11px; color: var(--cinnabar); white-space: nowrap;
    background: transparent; border: 1px solid rgba(176,58,46,0.35); border-radius: 9px;
    cursor: pointer;
}
.tn-watch:hover { border-color: var(--cinnabar); background: rgba(176,58,46,0.08); }
.tn-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.tn-points li {
    display: grid; grid-template-columns: 20px minmax(0,1fr) auto; gap: 8px; align-items: center;
    font-size: 12px; padding: 3px 8px; border-radius: 8px; background: rgba(255,255,255,0.4);
}
.tn-pk {
    width: 18px; height: 18px; border-radius: 50%; background: var(--gold); color: #2b2620;
    font-weight: 700; font-size: 11px; display: grid; place-items: center;
}
.tn-pname { font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-pname.mine { color: var(--cinnabar); }
.tn-pnum { color: var(--ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tn-hist li { display: grid; grid-template-columns: 76px minmax(0,1fr) auto; gap: 8px; align-items: baseline; }

/* ---- 比赛竞猜：押注按钮带队名（等宽等高），彩池居中、赔率进 title，已押徽标居中 ---- */
.tn-bet { grid-template-columns: minmax(0,1fr) minmax(0,1.4fr) minmax(0,1fr); }
.bet-pool {
    text-align: center; font-size: 12px; color: var(--ink-soft); white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums;
}
.bet-pool b { color: var(--ink); font-weight: 700; }
.bet-mine {
    justify-self: center; padding: 2px 10px; border-radius: 10px; max-width: 100%;
    background: rgba(74,124,89,0.14); color: var(--bamboo); font-size: 11px; font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bet-btn {
    width: 100%; padding: 5px 10px; font-size: 12px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.st-actions .bet-amount { width: 76px; min-width: 76px; }
.tn-hdate { color: var(--ink-soft); font-size: 11px; }
.tn-hname { font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-hinfo { color: var(--ink-soft); font-size: 11px; white-space: nowrap; }

/* 培养台这一排：喂养/升星按内容起排；一排放不下时整排折行，不许把按钮压扁到字挤出去
   价格副行允许换行，但 .btn-word 锁住每个词（数字连单位是一词），断点只落在词缝 */
.beast-feed { display: flex; align-items: stretch; gap: 6px; flex-wrap: wrap; }
.beast-feed .btn { padding: 5px 9px; font-size: 13px; white-space: nowrap; }
.beast-feed .btn.grow { flex: 1 1 auto; min-width: 68px; }
/* 键面窄时价格行在词缝处折行（顿号就是那道缝），别让副行顶出按钮 */
.beast-feed .btn-cost { white-space: normal; }
.beast-feed .btn.beast-tier { flex: 0 0 auto; }
/* 右对齐的那颗是「放归」：它占了原来出战/休整的贴右位置，出战/休整挪到它后面
   （两颗都在行尾贴着，喂养·升星在左边一串） */
.beast-feed .btn.beast-release { flex: 0 0 auto; margin-left: auto; }
.beast-feed .btn.beast-deploy { flex: 0 0 auto; }
.beast-tier, .craft-tier { font-variant-numeric: tabular-nums; letter-spacing: 0.3px; }
/* 炼丹/绘符/缔结行里的倍率档：贴在成本下面，选档与「炼制/绘制/缔结」是两个动作，不能挤进同一个按钮 */
.craft-tiers { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.beast-cast .craft-tiers { margin-top: 0; align-items: center; }
.recipe .craft-tier, .tal-item .craft-tier, .beast-cast .craft-tier {
    font: inherit; font-size: 12px; line-height: 1; padding: 5px 10px; cursor: pointer;
    border: 1px solid rgba(90,70,50,0.22); border-radius: 9px;
    background: rgba(255,255,255,0.5); color: var(--ink-soft);
    transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}
/* 档位条里的几颗等宽：×1 与 ×10 差一个字宽，看着就是一高一矮两排小片 */
.beast-cast .craft-tier { min-width: 48px; }
.recipe .craft-tier:hover, .tal-item .craft-tier:hover, .beast-cast .craft-tier:hover { border-color: var(--bamboo); color: var(--bamboo-2); }
.recipe .craft-tier.on, .tal-item .craft-tier.on, .beast-cast .craft-tier.on {
    border-color: var(--bamboo); background: rgba(74,124,89,0.14);
    color: var(--bamboo-2); font-weight: 700;
}

/* ---- 洞府灵田：地块按行当给的地数自排（散修 3、灵草师 4），空地虚线、生长实线、成熟描青 ---- */
.field-plots { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.field-plot {
    border: 1px dashed rgba(90,70,50,0.25); border-radius: 12px; padding: 10px 6px;
    min-height: 96px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 5px; text-align: center; background: rgba(255,255,255,0.32);
}
.field-plot.growing, .field-plot.ripe { border-style: solid; }
.field-plot.ripe { border-color: var(--bamboo); background: rgba(74,124,89,0.10); }
.field-plot-icon { font-size: 22px; line-height: 1; }
/* PNG 种子图标（iconSpan）：尺寸吃原 emoji 字号的位置 */
span.ic.field-plot-ic { width: 20px; height: 20px; }
span.ic.field-seed-ic { width: 14px; height: 14px; }
.field-seed { display: inline-flex; align-items: center; gap: 5px; }
.field-plot-name { font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.field-plot-state { font-size: 12px; font-weight: 700; color: var(--ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.field-plot.ripe .field-plot-state { color: var(--bamboo-2); }
.field-plot-bar { width: 84%; height: 5px; border-radius: 3px; background: rgba(90,70,50,0.12); overflow: hidden; }
.field-plot-bar i { display: block; height: 100%; background: var(--bamboo); }
/* 单块播种：空地里那颗钮，选好种子点它就只种这一块（一地一种） */
.field-plant-one {
    font: inherit; font-size: 12px; line-height: 1; padding: 5px 12px; cursor: pointer;
    border: 1px solid rgba(90,70,50,0.24); border-radius: 9px; font-weight: 700;
    background: rgba(255,255,255,0.6); color: var(--bamboo-2);
    transition: border-color 0.16s ease, background 0.16s ease;
}
.field-plant-one:hover:not(:disabled) { border-color: var(--bamboo); background: rgba(74,124,89,0.14); }
.field-plant-one:disabled { opacity: 0.45; cursor: not-allowed; }
.field-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.field-seeds { display: flex; gap: 6px; flex-wrap: wrap; }
.field-seed {
    font: inherit; font-size: 12px; line-height: 1; padding: 6px 10px; cursor: pointer;
    border: 1px solid rgba(90,70,50,0.22); border-radius: 9px;
    background: rgba(255,255,255,0.5); color: var(--ink-soft); font-variant-numeric: tabular-nums;
    transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}
.field-seed:hover { border-color: var(--bamboo); color: var(--bamboo-2); }
.field-seed.on { border-color: var(--bamboo); background: rgba(74,124,89,0.14); color: var(--bamboo-2); font-weight: 700; }
.field-seed:disabled { opacity: 0.45; cursor: not-allowed; }
.field-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.field-actions .btn { flex: 0 0 auto; }
.field-hint { margin-top: 8px; font-size: 12px; color: var(--ink-soft); }
.field-hint:empty { display: none; }

/* 切磋战报：右上角滑入抽屉，5s 自动收回 */
.spar-notice {
    position: fixed; top: 78px; right: 16px; width: 300px; max-width: calc(100vw - 24px);
    background: rgba(255,255,255,0.92); border: 1px solid rgba(90,70,50,0.18);
    border-left: 3px solid var(--cinnabar); border-radius: 12px;
    box-shadow: 0 12px 32px rgba(90,70,50,0.18);
    padding: 10px 12px; z-index: 40;
    transform: translateX(calc(100% + 24px)); opacity: 0; pointer-events: none;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
}
.spar-notice.show { transform: translateX(0); opacity: 1; pointer-events: auto; }
.sn-body { display: flex; flex-direction: column; gap: 4px; padding-right: 20px; }
.sn-title { font-size: 13px; font-weight: 700; color: var(--cinnabar); }
.sn-text { font-size: 12px; color: var(--ink-soft); line-height: 1.5; }
.sn-text b { color: var(--cinnabar); }
.sn-close {
    position: absolute; top: 6px; right: 6px; width: 22px; height: 22px;
    border-radius: 50%; border: none; background: transparent; color: var(--ink-soft);
    font-size: 18px; line-height: 1; cursor: pointer;
}
.sn-close:hover { color: var(--cinnabar); }
.modal-actions { display: flex; gap: 10px; justify-content: center; }

/* 天劫突破弹窗（雷暴风） */
#bt-modal.trib { background: rgba(20, 16, 30, 0.72); }
#bt-modal.trib .modal {
    background: linear-gradient(160deg, #2a2440, #4a2350);
    color: #f3e9ff; border: 1px solid #7d5bd6;
    box-shadow: 0 0 30px rgba(125,91,214,0.6);
}
#bt-modal.trib .modal-title { color: #ffd86b; }
#bt-modal.trib .modal-title.fail { color: #ff6b6b; }

/* 渡劫画面：左边坐着人，右边才是战报。人坐在框底，雷从头顶那排 ⚡ 落下来 */
#bt-modal.trib .modal {
    width: min(560px, 94vw);
    display: flex; align-items: center; gap: 16px;
    padding: 22px 20px 20px; text-align: left;
}
#bt-modal.trib .bt-report { flex: 1 1 auto; min-width: 0; }
#bt-modal.trib .bt-report .btn { display: block; margin: 0 auto; }
.bt-art { position: relative; flex: 0 0 auto; }
.bt-art[hidden] { display: none; }
/* 画幅固定成 461x640 那张画布的比例：图没到位时占位符占同一块地方，弹窗不会先小后大 */
.bt-art-img, .bt-art-no {
    width: var(--bt-art-w, 172px);
    aspect-ratio: 461 / 640;
}
.bt-art-img { display: block; object-fit: contain; filter: drop-shadow(0 6px 18px rgba(0,0,0,0.45)); }
.bt-art-img[hidden] { display: none; }
.bt-art-no {
    display: grid; place-items: center;
    font-family: "KaiTi","STKaiti",serif; font-size: 58px; font-style: normal;
    color: rgba(255,216,107,0.45);
    border: 1px dashed rgba(255,216,107,0.28); border-radius: 12px;
}
.bt-art-no[hidden] { display: none; }
/* 窄屏摆不下两栏：人挪到战报上面居中坐着。高度再吃紧就跟着视口缩，
   否则立绘把战报顶出弹窗、玩家得先滚一下才看得到折在哪一道雷 */
@media (max-width: 600px) {
    #bt-modal.trib .modal { flex-direction: column; align-items: center; text-align: center; gap: 10px; }
    .bt-art { --bt-art-w: min(148px, 42vw, 26vh); }
}

/* 奇遇演出 */
#enc-modal .enc-modal-box { position: relative; overflow: hidden; }
#enc-modal .enc-flash {
    position: absolute; inset: 0; background: radial-gradient(circle at 50% 0%, rgba(255,216,107,0.5), transparent 60%);
    opacity: 0; pointer-events: none;
}
#enc-modal .enc-flash.flash { animation: encFlash 0.9s ease; }
@keyframes encFlash {
    0% { opacity: 0; } 20% { opacity: 1; } 100% { opacity: 0; }
}

/* 三门择一：每扇门是一张卡，所得与凶险都摊在脸上 */
#enc-choice-modal .enc-choice-box { width: min(520px, 94vw); text-align: left; }
/* 标题收窄一档：26px 时「仙缘奇遇 · 三门择一」在窄屏里折成两行，白白吃掉门的滚动空间 */
#enc-choice-modal .modal-title { text-align: center; font-size: 20px; }
.enc-choice-sub {
    text-align: center; font-size: 12px; color: var(--ink-soft);
    margin: -4px 0 12px;
}
/* 三扇门自己滚：标题与「换一批 / 稍后再择」必须一直看得见，
   否则门一多就把唯一的退出键顶到屏外（实测视口 553px 时按钮落在 663~761） */
.enc-doors { display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 265px); overflow-y: auto; }
.enc-door {
    display: block; width: 100%; text-align: left; cursor: pointer;
    padding: 11px 13px; border-radius: 12px;
    background: rgba(255,255,255,0.62); border: 1px solid rgba(90,70,50,0.16);
    font-family: inherit; color: var(--ink); font-size: 13px; line-height: 1.55;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.enc-door:hover:not(:disabled) { background: rgba(255,255,255,0.92); border-color: var(--gold); }
.enc-door:disabled { opacity: 0.55; cursor: default; }
.enc-door.picked { border-color: var(--cinnabar); background: rgba(201,162,39,0.14); }
.enc-door-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.enc-door-name { font-size: 15px; font-weight: 700; font-family: "KaiTi","STKaiti",serif; }
/* 命格只留标签，解释挪 title：三门择一在手机屏里高度紧张，长解释会把卡撑成两行 */
.enc-door-fate {
    font-size: 11px; padding: 1px 8px; border-radius: 10px; white-space: nowrap;
    background: rgba(90,70,50,0.08); color: var(--ink-soft); cursor: help;
}
.enc-door-fate.fate-ke { background: rgba(176,58,46,0.12); color: var(--cinnabar); }
.enc-door-fate.fate-sheng, .enc-door-fate.fate-tong { background: rgba(74,124,89,0.14); color: var(--bamboo-2); }
.enc-door-fate.fate-shengNi { background: rgba(201,162,39,0.18); color: #8a6c14; }
.enc-door-tag {
    font-size: 11px; padding: 1px 8px; border-radius: 10px; white-space: nowrap;
    background: rgba(90,70,50,0.08); color: var(--ink-soft);
}
.enc-door-tag.险 { background: rgba(176,58,46,0.12); color: var(--cinnabar); }
.enc-door-tag.重险 { background: var(--cinnabar); color: #fff; }
.enc-door-desc { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.enc-door-gain { font-size: 13px; color: var(--ink); margin-top: 5px; font-weight: 600; }
.enc-door-risk { font-size: 12px; color: var(--cinnabar); margin-top: 2px; }
.enc-door-omen { font-size: 11px; color: var(--ink-soft); margin-top: 2px; }
.enc-choice-actions { margin-top: 16px; flex-direction: column; gap: 8px; }
.enc-choice-actions .btn { width: 100%; padding: 9px 12px; font-size: 14px; }
/* 副行（盘缠/余量）固定另起一行且不许折行：两个按钮并排时宽度只有百来像素，
   「再耗 6 灵草（余 2）」折成三行会把整张卡撑到屏外 */
.enc-choice-actions .btn-cost { white-space: nowrap; font-size: 11px; }
/* 图鉴里的见闻进度 */
.codex-omen { font-size: 11px; color: var(--gold); margin-top: 3px; }

/* ---- 关键帧 ---- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spinRev { to { transform: rotate(-360deg); } }
@keyframes floatY { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes auraPulse {
    0%, 100% { transform: scale(0.92); opacity: 0.55; }
    50% { transform: scale(1.1); opacity: 1; }
}
@keyframes sparkleRise {
    0% { transform: translateY(0) scale(0.5); opacity: 0; }
    15% { opacity: 1; }
    100% { transform: translateY(-115px) scale(1.2); opacity: 0; }
}
@keyframes flicker {
    0%, 100% { opacity: 0.1; }
    42% { opacity: 0.85; }
    48% { opacity: 0.25; }
    54% { opacity: 1; }
    60% { opacity: 0.15; }
}
@keyframes avatarGlow {
    0%, 100% { filter: drop-shadow(0 0 0 rgba(150,110,220,0)); }
    50% { filter: drop-shadow(0 0 22px rgba(150,110,220,0.7)); }
}
@keyframes cardIn {
    from { opacity: 0; transform: translateY(16px) scale(0.985); }
    to { opacity: 1; transform: none; }
}
@keyframes shimmer { to { background-position: 200% center; } }
@keyframes barShine { 0% { transform: translateX(-100%); } 55%, 100% { transform: translateX(120%); } }
@keyframes bump { 50% { transform: scale(1.2); color: var(--gold); } }
@keyframes sweep { 0% { left: -60%; opacity: 0; } 30% { opacity: 1; } 100% { left: 120%; opacity: 0; } }
@keyframes listIn { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }

/* ---- 整页动效 ---- */
.hero { animation: cardIn 0.5s cubic-bezier(.2,.7,.3,1) both; }
.hero-realm { background-size: 200% auto; animation: shimmer 5s linear infinite; }

/* 入场动画只 backwards 预填：both/forwards 会让播完的卡一直占着 stacking context，
   卡里 z=60 的自绘下拉会被 DOM 靠后的下一张卡整卡盖住（实测求购单品类下拉被在售压住） */
.panel .card { animation: cardIn 0.55s cubic-bezier(.2,.7,.3,1) backwards; }
.panel .card:nth-child(1) { animation-delay: .04s; }
.panel .card:nth-child(2) { animation-delay: .10s; }
.panel .card:nth-child(3) { animation-delay: .16s; }
.panel .card:nth-child(4) { animation-delay: .22s; }
.panel .card:nth-child(5) { animation-delay: .28s; }
.panel .card:nth-child(6) { animation-delay: .34s; }
.panel .card:nth-child(7) { animation-delay: .40s; }

.exp-fill { position: relative; overflow: hidden; }
.exp-fill::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.65), transparent);
    transform: translateX(-100%); animation: barShine 2.8s ease-in-out infinite;
}
.hval { transition: color 0.3s ease; }
.hval.bump { animation: bump 0.4s ease; }

.btn { position: relative; overflow: hidden; }
.btn::after {
    content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.5), transparent);
    transform: skewX(-20deg); opacity: 0; pointer-events: none;
}
.btn:hover::after { animation: sweep 0.7s ease; }

.log li, .rank li { animation: listIn 0.3s ease both; }

/* ---- v2.3.1：本命法宝 / 五行命格 ---- */
.hero-element {
    margin-left: 8px; font-size: 12px; padding: 2px 8px; border-radius: 10px;
    border: 1px solid rgba(90,70,50,0.22); background: rgba(255,255,255,0.55);
    color: var(--ink); font-weight: 600; vertical-align: 1px;
}

/* 本命法宝 + 炼器台同一张卡：法宝状态条在上、炼器台整宽在下。
   实测器魂清单是 minmax(300px) 自适应两列，塞半栏会塌成一列（卡多出 400px），
   所以不做左右分栏；铸器魂 → 装进槽仍是自上而下一条线 */
.weapon-forge { display: flex; flex-direction: column; gap: 14px; }
.weapon-forge .forge-body { min-width: 0; }
.forge-sub { margin-top: 0; }

.weapon-body { display: flex; flex-direction: column; gap: 8px; }
.weapon-name { font-size: 15px; font-weight: 800; color: var(--ink); }
.weapon-bar { height: 10px; border-radius: 7px; background: var(--paper-2); overflow: hidden; }
.weapon-fill {
    height: 100%; width: 0; border-radius: 7px; transition: width 0.4s ease;
    background: linear-gradient(90deg, var(--gold), var(--bamboo));
}
.weapon-meta { font-size: 12px; color: var(--ink-soft); }
.weapon-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.weapon-actions .btn { flex: 1; min-width: 130px; padding: 9px 12px; font-size: 13px; }
.weapon-hint { font-size: 12px; color: var(--ink-soft); min-height: 16px; }

/* 器魂槽位条：格子数 = 法宝阶数，装的魂在格子里报名字 */
.weapon-slots { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; }
.ws-label { font-weight: 700; color: var(--ink); }
.ws-slot {
    padding: 3px 8px; border-radius: 8px; border: 1px dashed rgba(90, 70, 50, 0.3);
    color: var(--ink-soft); background: var(--paper-2); white-space: nowrap;
}
.ws-slot.on { border-style: solid; border-color: rgba(201, 162, 39, 0.55); color: var(--ink); font-weight: 600; }

/* 炼器台：炼材芯片 + 器魂清单（整行宽，一行一枚，右侧只放成本与单个按钮） */
.forge-count { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.codex-cat { font-size: 11px; font-weight: 600; color: var(--ink-soft); margin-left: 4px; }
.forge-mats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.fm-chip {
    display: inline-flex; align-items: baseline; gap: 4px; padding: 4px 9px; border-radius: 9px;
    border: 1px solid rgba(90, 70, 50, 0.22); background: var(--paper-2); font-size: 12px; color: var(--ink-soft);
}
.fm-chip b { font-size: 13px; color: var(--ink); }
.fm-chip i { font-style: normal; font-size: 11px; opacity: 0.75; }
.forge-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; }
.soul-row {
    display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px;
    border: 1px solid rgba(90, 70, 50, 0.18); background: var(--paper-2);
}
.soul-row.on { border-color: rgba(201, 162, 39, 0.6); }
.soul-main { flex: 1; min-width: 0; }
.soul-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; font-weight: 800; color: var(--ink); }
.soul-tag { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 8px; border: 1px solid rgba(74, 124, 89, 0.6); color: var(--bamboo); }
.soul-tag.dim { border-color: rgba(90, 70, 50, 0.28); color: var(--ink-soft); }
.soul-desc { font-size: 12px; color: var(--ink-soft); margin-top: 3px; line-height: 1.45; }
.soul-eff { font-size: 12px; color: var(--ink); margin-top: 4px; }
.soul-eff s { opacity: 0.55; text-decoration-color: rgba(90, 70, 50, 0.5); }
.soul-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.soul-cost { font-size: 11px; color: var(--ink-soft); text-align: right; line-height: 1.45; }
.soul-side .btn { padding: 7px 12px; font-size: 12px; min-width: 66px; }
/* 温养与装卸并排：两钮同宽同行，未铸时只剩一枚也不会挪位置 */
.soul-btns { display: flex; gap: 6px; }
/* 品阶跟着效果那一行走：名行只有图标+名+在槽，多塞一枚 chip 在手机端就把图标顶到下一行 */
.soul-grade {
    display: inline-block; margin-right: 5px; font-size: 10px; font-weight: 700;
    padding: 1px 6px; border-radius: 8px;
    border: 1px solid rgba(201, 162, 39, 0.55); color: var(--gold);
}
.soul-max { font-style: normal; font-size: 10px; opacity: 0.7; margin-left: 5px; }
.slot-row { border-style: dashed; }
.forge-hint { font-size: 12px; color: var(--ink-soft); margin-top: 8px; min-height: 16px; }
.forge-empty { font-size: 12px; color: var(--ink-soft); }
/* 脉标题：横贯整行的分组带，比魂卡矮一档，不参与等宽栅格（十七枚魂分四脉，一屏装不下） */
.soul-school {
    grid-column: 1 / -1; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
    padding: 2px 2px 4px; font-size: 12px; color: var(--ink-soft);
    border-bottom: 1px solid rgba(90, 70, 50, 0.16);
}
.soul-school .ss-name { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 800; color: var(--ink); }
.soul-school .ss-icon.ic { width: 16px; height: 16px; }
.soul-school .ss-num { font-weight: 700; }
.soul-school .ss-desc { opacity: 0.8; }
/* 产出/战力读数与炼材同排但换了脸色：那一栏报的是「装上的魂正在给你什么」 */
.fm-chip.zone { border-color: rgba(74, 124, 89, 0.42); }
.fm-chip.zone b { color: var(--bamboo); }

.rv-elem { font-size: 10px; padding: 1px 5px; border-radius: 8px; border: 1px solid rgba(90,70,50,0.2); color: var(--ink-soft); white-space: nowrap; }
.rv-rel { font-size: 10px; padding: 1px 5px; border-radius: 8px; font-weight: 700; white-space: nowrap; }
.rv-rel.win { border: 1px solid var(--bamboo); color: var(--bamboo); }
.rv-rel.lose { border: 1px solid var(--cinnabar); color: var(--cinnabar); }

.tomb-current { font-size: 14px; font-weight: 800; color: var(--ink); margin-bottom: 4px; }
.tomb-next { font-size: 13px; color: var(--ink-soft); margin-bottom: 8px; }
.tomb-next b { color: var(--cinnabar); font-weight: 700; }
/* 登顶后的碑林：当日五块碑平铺成一行芯片（择碑这条轴独占一行），选中只描金边、不铺底 */
.tomb-steles { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; margin-bottom: 8px; }
.tomb-steles:empty { display: none; }
.ts-chip {
    display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left;
    border: 1px solid rgba(90,70,50,0.2); background: rgba(255,255,255,0.6);
    border-radius: 10px; padding: 5px 8px; cursor: pointer; font-family: inherit;
    font-variant-numeric: tabular-nums;
}
.ts-chip.on { border-color: var(--gold); background: rgba(255,255,255,0.85); box-shadow: inset 0 0 0 1px var(--gold); }
.ts-name { font-size: 12px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.ts-chip.on .ts-name { color: var(--ink); }
.ts-odds { font-size: 12px; font-weight: 600; color: var(--ink); }
/* 今日已试：整块退一层，不许再按；数字换成「已试」，位置不动 */
.ts-chip.done { opacity: 0.55; cursor: default; }
.ts-chip.done .ts-odds { font-weight: 500; color: var(--ink-soft); }
.ts-tip { color: var(--ink-soft); }
.tomb-hint { font-size: 12px; color: var(--ink-soft); margin-top: 6px; }

/* ---- 五行灵塔：五座塔是平行的一排芯片（择塔这条轴独占一行），选中只描边、不铺底；
   值日与塔心只写在文字里，同一条轴上不同叠两套视觉状态。芯片折行由 grid 拉平，卡高不随状态变。 */
.tower-duty { font-size: 12px; color: var(--ink-soft); margin-bottom: 6px; }
.tower-duty b { color: var(--cinnabar); font-weight: 700; }
.tower-rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 6px; margin-bottom: 8px; }
.tower-rows:empty { display: none; }
.tw-chip {
    display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left;
    border: 1px solid rgba(90, 70, 50, 0.2); background: rgba(255, 255, 255, 0.6);
    border-radius: 10px; padding: 5px 8px; cursor: pointer; font-family: inherit;
    font-variant-numeric: tabular-nums;
}
.tw-chip.on { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.tw-name { font-size: 12px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.tw-chip.on .tw-name { color: var(--ink); }
.tw-odds { font-size: 12px; font-weight: 600; color: var(--ink); }
/* 第三行不截字：宁可折成两行，也不能让人看不出这座塔今日打到几层 */
.tw-best { font-size: 11px; color: var(--ink-soft); }
.tw-chip.done { opacity: 0.55; cursor: default; }
.tw-chip.done .tw-odds { font-weight: 500; color: var(--ink-soft); }
.tw-good { color: var(--bamboo); font-weight: 700; }
/* 焚符行：「此刻斗法用哪枚命」独占一行，五枚符在下面平铺；auto-fit 让窄屏折行也等宽，余时只在句子里跳 */
.tower-fate { display: grid; grid-template-columns: repeat(auto-fit, minmax(126px, 1fr)); gap: 6px; margin-bottom: 8px; align-items: start; }
.tower-fate:empty { display: none; }
.tf-cur { grid-column: 1 / -1; font-size: 12px; color: var(--ink-soft); }
.tf-cur b { color: var(--cinnabar); font-weight: 700; }
.tf-cur.on { color: var(--ink); }
.tf-chip {
    display: flex; align-items: center; gap: 5px; width: 100%;
    border: 1px solid rgba(90, 70, 50, 0.2); background: rgba(255, 255, 255, 0.6);
    border-radius: 10px; padding: 4px 7px; cursor: pointer; font-family: inherit;
    font-variant-numeric: tabular-nums;
}
.tf-chip.on { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.tf-chip.empty { opacity: 0.5; }
.tf-chip:disabled { cursor: default; }
.tf-name { font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.tf-num { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.tower-next { font-size: 13px; color: var(--ink-soft); margin-bottom: 8px; }
.tower-next b { color: var(--cinnabar); font-weight: 700; }
.tower-hint { font-size: 12px; color: var(--ink-soft); margin-top: 6px; }

/* ---- 历练三副本：万兽窟 / 照心镜 / 万里押镖 ----
   三张卡同一套芯片语言（择定只描金边、不铺底；不可用整块退一层，位置不挪）。
   卡高不随状态变：血条、芯片行、明细行都固定占位，没开跑也写「满血」而不是留白。 */
.hunt-hp { font-size: 12px; color: var(--ink-soft); margin-bottom: 6px; }
.hunt-hp b { color: var(--ink); font-weight: 700; }
.hunt-hpbar { height: 7px; border-radius: 5px; background: var(--paper-2); overflow: hidden; margin-top: 4px; }
.hunt-hpbar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--bamboo), var(--gold)); }
.hunt-hpbar.low i { background: var(--cinnabar); }
.hunt-doors { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 6px; margin-bottom: 8px; }
.hunt-doors:empty { display: none; }
.hd-chip {
    display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left;
    border: 1px solid rgba(90, 70, 50, 0.2); background: rgba(255, 255, 255, 0.6);
    border-radius: 10px; padding: 5px 8px; cursor: pointer; font-family: inherit;
    font-variant-numeric: tabular-nums;
}
.hd-chip.on { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.hd-name { font-size: 12px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.hd-chip.on .hd-name { color: var(--ink); }
.hd-odds { font-size: 12px; font-weight: 600; color: var(--ink); }
.hd-pay { font-size: 11px; color: var(--ink-soft); }
.hd-chip:disabled { opacity: 0.55; cursor: default; }
/* 卡面里的丹名/符名前面那颗小图标：跟正文同一基线，不额外撑高行 */
span.ic.dg-ic { width: 14px; height: 14px; vertical-align: -0.2em; }
.dg-good { color: var(--bamboo); font-weight: 700; }
.dg-bad { color: var(--cinnabar); font-weight: 700; }
.hunt-next { font-size: 13px; color: var(--ink-soft); margin-bottom: 8px; }
.hunt-next b { color: var(--cinnabar); font-weight: 700; }
.hunt-hint { font-size: 12px; color: var(--ink-soft); margin-top: 6px; }

.mirror-xinmo { font-size: 12px; color: var(--ink-soft); margin-bottom: 6px; }
.mirror-xinmo b { color: var(--cinnabar); font-weight: 700; }
.mirror-layers { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 6px; margin-bottom: 8px; }
.mirror-layers:empty { display: none; }
.ml-chip {
    display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left;
    border: 1px solid rgba(90, 70, 50, 0.2); background: rgba(255, 255, 255, 0.6);
    border-radius: 10px; padding: 5px 8px; cursor: pointer; font-family: inherit;
    font-variant-numeric: tabular-nums;
}
.ml-chip.on { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.ml-name { font-size: 12px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.ml-chip.on .ml-name { color: var(--ink); }
.ml-odds { font-size: 12px; font-weight: 600; color: var(--ink); }
.ml-pay { font-size: 11px; color: var(--ink-soft); }
.ml-chip.done { opacity: 0.55; cursor: default; }
.ml-chip.done .ml-odds { font-weight: 500; color: var(--ink-soft); }
.mirror-next { font-size: 13px; color: var(--ink-soft); margin-bottom: 8px; }
.mirror-next b { color: var(--cinnabar); font-weight: 700; }
.mirror-hint { font-size: 12px; color: var(--ink-soft); margin-top: 6px; }

.escort-bag { font-size: 12px; color: var(--ink-soft); margin-bottom: 6px; }
.escort-bag b { color: var(--ink); font-weight: 700; }
.escort-legs { display: grid; grid-template-columns: repeat(auto-fit, minmax(74px, 1fr)); gap: 6px; margin-bottom: 8px; }
.escort-legs:empty { display: none; }
.el-chip {
    display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left;
    border: 1px solid rgba(90, 70, 50, 0.2); background: rgba(255, 255, 255, 0.6);
    border-radius: 10px; padding: 5px 7px; font-family: inherit;
    font-variant-numeric: tabular-nums;
}
.el-chip.now { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.el-chip.passed { border-color: var(--bamboo); }
.el-chip.lost { opacity: 0.5; }
.el-name { font-size: 12px; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.el-chip.now .el-name, .el-chip.passed .el-name { color: var(--ink); }
.el-pay { font-size: 11px; color: var(--ink); font-variant-numeric: tabular-nums; }
.el-wx { font-size: 11px; color: var(--ink-soft); }
.escort-next { font-size: 13px; color: var(--ink-soft); margin-bottom: 8px; }
.escort-next b { color: var(--cinnabar); font-weight: 700; }
.escort-hint { font-size: 12px; color: var(--ink-soft); margin-top: 6px; }

/* ---- v2.3.2：战力拆解 / 五行相生与同韵 / 符箓 / 秘境 / 战报结算 ---- */
.pw-sum { font-size: 14px; color: var(--ink); margin-bottom: 6px; }
.pw-sum b { color: var(--cinnabar); font-size: 18px; font-variant-numeric: tabular-nums; }
/* 公式单独一行小字：正文只留结论，展开的口径细节在这行里 */
.pw-formula { font-size: 11px; color: var(--ink-soft); margin: -2px 0 6px; font-variant-numeric: tabular-nums; }
.pw-sub { font-size: 12px; color: var(--ink-soft); margin: 10px 0 4px; font-weight: 700; letter-spacing: 1px; }
.pw-list { display: flex; flex-direction: column; gap: 4px; }
.pw-row {
    display: grid; grid-template-columns: minmax(78px, 1.4fr) 2fr 62px 68px;
    /* 四格按基线对齐：右列第一行（分摊战力）跟本行数值落在同一条基线上，
       不会飘在行首让人分不清是哪一项的。 */
    align-items: baseline; gap: 8px; font-size: 12px;
}
.pw-row.zero { opacity: 0.5; }
/* 名字不再截成「本命法宝（神…」：宁可折行，也不能让人认不出自己那一项 */
.pw-name { color: var(--ink); overflow-wrap: break-word; }
.pw-bar { height: 7px; border-radius: 5px; background: var(--paper-2); overflow: hidden; align-self: start; margin-top: 3px; }
.pw-bar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--gold), var(--bamboo)); }
.pw-val { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* 右列：分摊到这一项的战力 + 它占总战力的百分比，两行写 */
.pw-eff { text-align: right; color: var(--ink-soft); font-variant-numeric: tabular-nums; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.35; white-space: nowrap; }
.pw-eff b { font-weight: 600; color: var(--ink-soft); }
.pw-eff i { font-style: normal; font-size: 10px; opacity: 0.75; }
.pw-note { margin-top: 10px; font-size: 12px; color: var(--ink-soft); }

/* 产出加成：只加日进、不进战力，所以独立成段，不混进上面「各行相加=战力」的行里。
   数字靠右、来源另起一行小字，窄屏时来源行自己折行，不许把卡片撑出横向滚动。 */
.pw-inc { border-top: 1px dashed var(--paper-2); padding-top: 6px; }
.pw-inc-item + .pw-inc-item { margin-top: 8px; }
.pw-inc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 12px; }
.pw-inc-name { color: var(--ink); }
.pw-inc-mult { font-weight: 600; color: var(--cinnabar); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pw-inc-note { font-size: 11px; color: var(--ink-soft); margin-top: 1px; }
.pw-inc-src { display: flex; flex-wrap: wrap; gap: 0 6px; font-size: 11px; color: var(--ink-soft); margin-top: 2px; }
.pw-inc-src span { white-space: nowrap; }
.pw-inc-src span + span::before { content: '·'; margin-right: 6px; opacity: 0.55; }

.rv-gen { font-size: 10px; padding: 1px 5px; border-radius: 8px; font-weight: 700; white-space: nowrap; }
.rv-gen.win { border: 1px solid var(--bamboo); color: var(--bamboo); }
.rv-gen.lose { border: 1px solid var(--cinnabar); color: var(--cinnabar); }
.b-elem { font-size: 10px; padding: 1px 6px; margin-left: 6px; border-radius: 8px; border: 1px solid rgba(90,70,50,0.24); color: var(--ink-soft); vertical-align: 2px; }
.b-yun {
    font-size: 10px; padding: 1px 6px; margin-left: 6px; border-radius: 8px;
    border: 1px solid var(--gold); color: var(--gold); font-weight: 700; vertical-align: 2px;
}
.branch-btn.tongyun { border-color: rgba(201,162,39,0.6); }
/* 同韵没吃到：芯片形状不动，只把金换成朱砂，一眼是「正亏着」而不是「这里有货」 */
.b-yun.miss { border-color: var(--cinnabar); color: var(--cinnabar); font-weight: 600; }

.talisman-list { display: flex; flex-direction: column; gap: 10px; }
.tal-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    border: 1px solid rgba(90,70,50,0.15); border-radius: 12px; background: rgba(255,255,255,0.45);
}
/* 绘制/炼制两颗按钮同字宽同内边距，不给 min-width 才能一模一样大；档位由 ×1/×5 那条选档带表达 */
.tal-craft-btn { white-space: nowrap; }
.tal-item.owned { border-color: rgba(201,162,39,0.55); }
.tal-info { flex: 1; min-width: 0; }
.tal-name { font-weight: 700; color: var(--ink); }
.tal-icon { margin-right: 6px; }
.tal-scope {
    font-size: 10px; padding: 1px 6px; margin-left: 6px; border-radius: 8px;
    border: 1px solid rgba(90,70,50,0.22); color: var(--ink-soft); vertical-align: 2px;
}
.tal-owned {
    font-size: 10px; padding: 1px 6px; margin-left: 6px; border-radius: 8px;
    border: 1px solid var(--bamboo); color: var(--bamboo); font-weight: 700; vertical-align: 2px;
}
.tal-owned.blank { border-color: rgba(90,70,50,0.22); color: rgba(92,85,75,0.55); }
.tal-desc { font-size: 12px; color: var(--ink-soft); margin-top: 2px; line-height: 1.4; }
.tal-cost { font-size: 12px; color: var(--bamboo-2); margin-top: 2px; }
.tal-item .btn { flex: 0 0 auto; }
.talisman-sum { margin-top: 10px; font-size: 12px; color: var(--ink-soft); }

.tal-pick { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-soft); flex-wrap: wrap; }
.tal-select {
    font: inherit; font-size: 12px; color: var(--ink); padding: 4px 8px;
    border: 1px solid rgba(90,70,50,0.22); border-radius: 9px; background: rgba(255,255,255,0.6);
    max-width: 260px;
}
.tal-select:disabled { opacity: 0.55; }

.realm-state { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.rm-open { color: var(--bamboo); }
.rm-closed { color: var(--ink-soft); }
#realm-cd { font-variant-numeric: tabular-nums; color: var(--cinnabar); }
.realm-windows { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.rm-win {
    font-size: 11px; padding: 2px 8px; border-radius: 9px;
    border: 1px solid rgba(90,70,50,0.2); color: var(--ink-soft); background: rgba(255,255,255,0.4);
}
.rm-win.on { border-color: var(--cinnabar); color: var(--cinnabar); font-weight: 700; }
/* 场次牌上的守灵五行：一个字，配色沿用战斗标记那套，玩家据此挑场次 */
.rm-elem { margin-left: 5px; font-weight: 700; }
.rm-elem.e-jin { color: #a8841c; }
.rm-elem.e-mu { color: #4a7c59; }
.rm-elem.e-shui { color: #406a83; }
.rm-elem.e-huo { color: #b03a2e; }
.rm-elem.e-tu { color: #8b6a3e; }
.realm-reward { font-size: 12px; color: var(--ink-soft); margin-bottom: 8px; line-height: 1.5; }
.realm-reward b { color: var(--ink); font-variant-numeric: tabular-nums; }
/* 守灵明牌：烧符之前把命格、加减与胜率一次说全，红绿只点方向不复述文字 */
.realm-guard { font-size: 12px; color: var(--ink-soft); margin-bottom: 8px; line-height: 1.5; }
.realm-guard b { color: var(--ink); font-variant-numeric: tabular-nums; }
.wx-good { color: var(--bamboo); font-weight: 700; }
.wx-bad { color: var(--cinnabar); font-weight: 700; }

/* 单按钮弹窗：卡身左对齐是为了排明细表，但收尾那一下必须落在视线正中 */
.enc-modal-box > .btn { display: block; margin: 0 auto; }

/* ---- 传书（服务端发物资的信箱）---- */
.xx-topright {
    position: fixed; top: 14px; right: 16px; z-index: 5;
    display: flex; align-items: center; gap: 8px;
}
.xx-topright .xx-conn { position: static; }
.xx-mail, .hc-btn.xx-logout, .hc-btn.xx-pwd, .xx-skip {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; padding: 6px 12px; border-radius: 20px; cursor: pointer;
    background: rgba(255,255,255,0.6); border: 1px solid rgba(90,70,50,0.15);
    color: var(--ink-soft); font-family: inherit; height: 32px; line-height: 1;
    box-sizing: border-box; margin: 0;
}
.xx-skip { white-space: nowrap; user-select: none; }
.xx-skip input { width: 14px; height: 14px; margin: 0; accent-color: var(--cinnabar); cursor: pointer; }
.uid-chip {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; padding: 6px 12px; border-radius: 20px; cursor: pointer;
    background: rgba(176,58,46,0.10); border: 2px solid var(--cinnabar);
    color: var(--cinnabar); font-family: inherit; height: 32px; line-height: 1;
    box-sizing: border-box; margin: 0; font-weight: 600;
}
.xx-mail:hover, .hc-btn.xx-logout:hover, .hc-btn.xx-pwd:hover, .xx-skip:hover { color: var(--cinnabar); border-color: rgba(176,58,46,0.4); }
.uid-chip:hover { background: rgba(176,58,46,0.18); }
.uid-chip b { font-weight: 700; }
.hc-btn.xx-logout, .hc-btn.xx-pwd { background: rgba(255,255,255,0.6); }
.xx-mail[hidden], .xx-mail-badge[hidden] { display: none; }
/* 上面那条 .hc-btn.xx-pwd 写了 display:inline-flex，比 UA 的 [hidden]{display:none} 更具体：
   不加这一句，「改密」按钮在没登录时照样露出来（点了只会撞服务端的鉴权闸门） */
.hc-btn.xx-pwd[hidden] { display: none; }
/* 同一条陷阱：.xx-skip 也写了 display:inline-flex，登录前那个 hidden 得单独压回去 */
.xx-skip[hidden] { display: none; }
.xx-mail-badge {
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: var(--cinnabar); color: #f7f2e6;
    font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
    font-variant-numeric: tabular-nums;
}
/* 有待领物资时角标转金：未读是「有信」，金色才是「有货可领」 */
.xx-mail-badge.claimable { background: var(--gold); color: #2b2620; }
.mail-modal-box { width: min(560px, 94vw); text-align: left; padding: 20px 22px; }
.mail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.mail-head-title { font-size: 20px; font-weight: 800; font-family: "KaiTi","STKaiti",serif; }
.mail-sum { font-size: 12px; color: var(--ink-soft); margin-bottom: 12px; }
.mail-list { display: flex; flex-direction: column; gap: 10px; max-height: 52vh; overflow-y: auto; padding-right: 4px; }
.mail-empty { padding: 28px 0; text-align: center; font-size: 13px; color: var(--ink-soft); }
.mail-item {
    background: rgba(255,255,255,0.72); border: 1px solid rgba(90,70,50,0.15);
    border-left: 3px solid rgba(90,70,50,0.2); border-radius: 12px; padding: 10px 12px;
}
.mail-item.unread { border-left-color: var(--cinnabar); }
/* 已领与过期只降不删：让玩家看得见「这封我领过了」 */
.mail-item.claimed, .mail-item.expired { opacity: 0.62; border-left-color: rgba(90,70,50,0.15); }
.mail-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.mail-name { font-size: 14px; font-weight: 700; }
.mail-time { font-size: 11px; color: var(--ink-soft); flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.mail-body { font-size: 12px; color: var(--ink-soft); line-height: 1.6; margin-top: 4px; }
.mail-attach { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mail-chip {
    font-size: 12px; padding: 3px 9px; border-radius: 9px;
    border: 1px solid rgba(201,162,39,0.45); color: var(--ink);
    background: rgba(201,162,39,0.10); font-variant-numeric: tabular-nums;
}
.mail-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.mail-state { font-size: 12px; color: var(--ink-soft); }
.mail-item.unread .mail-state { color: var(--cinnabar); }
.mail-claim { padding: 6px 16px; font-size: 13px; }
.mail-btns { display: flex; gap: 10px; margin-top: 12px; }
/* 领取是主行动，占满余量；清空已读只当收尾的次要动作，别抢重量 */
.mail-claim-all { flex: 1; }
.mail-clear-read { flex: 0 0 auto; }
.mail-note { margin-top: 8px; font-size: 11px; color: var(--ink-soft); text-align: center; }

/* ---- v2.3.6：自绘 SVG glyph 库（app.js 内嵌 GLYPHS）；PNG 水合成功前与失败后的兜底都是它 ---- */
/* 内联小图标：跟正文同色（currentColor），1em 方块贴基线，用在 h2/h3、toast、战报标题里 */
svg.gl {
    width: 1em; height: 1em; fill: currentColor;
    vertical-align: -0.125em; overflow: visible;
}
/* 坐进 span.ic 的 glyph（PNG 水合前/后兜底）：铺满 span 已定的尺寸槽 */
span.ic > svg.gl, i.gl-i > svg.gl { width: 100%; height: 100%; display: block; vertical-align: baseline; }
/* 静态 HTML 里的占位（index.html 的 data-gl）：尺寸跟字号走；span 形态吃同一条 PNG 水合管线 */
i.gl-i, span.ic.gl-i {
    display: inline-block; width: 1em; height: 1em;
    vertical-align: -0.125em; font-style: normal;
}
h2 i.gl-i, h3 i.gl-i, h2 span.ic.gl-i, h3 span.ic.gl-i { width: 1.05em; height: 1.05em; margin-right: 2px; }
.toast-ic { display: inline-flex; align-items: center; margin-right: 6px; font-size: 1.15em; }
.toast-ic svg.gl { width: 1em; height: 1em; }
/* 兜底 glyph 别比正文抢眼：徽标槽里再压一点透明度，PNG 正常时根本看不见 */
span.ic > svg.gl { opacity: 0.9; }
.dt-expire svg.gl { vertical-align: -0.15em; }
.beast-line .gl, .mat-chip .gl { vertical-align: -0.15em; }

/* ---- v2.3.5：Q 版小图标（assets/<种类>_<key>.webp）；span 里留的 emoji 只在缺图时露出 ---- */
span.ic {
    display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 auto; vertical-align: middle;
}
.ic-img { display: block; width: 100%; height: 100%; object-fit: contain; }
.beast-icon.ic { width: 22px; height: 22px; }
.soul-icon.ic { width: 32px; height: 32px; }
.codex-icon.ic { width: 32px; height: 32px; }
.bd-icon.ic { width: 26px; height: 26px; }
.tal-icon.ic { width: 20px; height: 20px; }
.tf-ic.ic { width: 18px; height: 18px; }
.mat-icon.ic { width: 16px; height: 16px; }
.st-icon.ic { width: 20px; height: 20px; }
.tn-head-ic.ic { width: 18px; height: 18px; vertical-align: -3px; margin-right: 2px; }
.tn-title { display: inline-flex; align-items: center; gap: 4px; }
.st-lead { display: inline-flex; align-items: center; gap: 6px; }
.tab-ic.ic { width: 18px; height: 18px; margin-right: 6px; }
.mail-ic.ic { width: 16px; height: 16px; margin-right: 5px; }
.br-icon.ic { width: 20px; height: 20px; margin-right: 6px; }
.r-icon.ic { width: 22px; height: 22px; margin-right: 7px; }
.cur-icon.ic { width: 18px; height: 18px; margin-right: 5px; }
/* 成就是圆形白/金底，emoji 时代靠它撑出徽章感；换成整幅插画后底色会像贴纸一样糊在画后，只在回落 emoji 时留着 */
.ach-icon:has(img) { background: transparent; }

/* ---- 坊市：铜币是坊内唯一价签 ---- */
.coin-bal { font-size: 15px; font-weight: 700; color: var(--ink); }
.coin-bal b { color: var(--gold); font-size: 26px; margin: 0 3px; }
.coin-src { margin: 6px 0 12px; font-size: 12px; color: var(--ink-soft); line-height: 1.55; }
.coin-convert { display: flex; gap: 8px; }
.coin-convert .btn { flex: 1 1 auto; }
.coin-hint { margin-top: 10px; font-size: 12px; color: var(--ink-soft); line-height: 1.65; }
.coin-hint b { color: var(--gold); }

/* 铜钱袋占整行：余额与来路占左，凝铜钮占右。钮不许铺满整行（会撑成一条长绿条） */
.coin-card.wide {
    display: grid; grid-template-columns: minmax(0, 1fr) max-content;
    column-gap: 16px; align-items: start;
}
.coin-card.wide > h2 { grid-column: 1 / -1; }
.coin-card.wide .coin-bal { grid-column: 1; grid-row: 2; }
.coin-card.wide .coin-src { grid-column: 1; grid-row: 3; margin-bottom: 0; }
.coin-card.wide .coin-convert { grid-column: 2; grid-row: 2 / span 2; align-self: start; }
.coin-card.wide .coin-convert .btn { flex: 0 0 auto; }
.coin-card.wide .coin-hint { grid-column: 1 / -1; grid-row: 4; }

/* 选物：灵石、灵草与身上的丹符，等宽栅格排开——名字左、数字右对齐成一条线 */
.mk-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 6px; margin-bottom: 12px; }
.mk-chip {
    display: inline-flex; align-items: center; gap: 5px; width: 100%;
    border: 1px solid rgba(90,70,50,0.2); background: rgba(255,255,255,0.6);
    border-radius: 10px; padding: 6px 10px; font-size: 13px; font-weight: 600;
    color: var(--ink-soft); cursor: pointer; font-family: inherit;
    font-variant-numeric: tabular-nums;
}
/* 选中只描金边（内圈一圈金线加描边感），不铺金底——状态走边不走填充 */
.mk-chip.on {
    border-color: var(--gold); background: rgba(255,255,255,0.85); color: var(--ink);
    box-shadow: inset 0 0 0 1px var(--gold);
}
.mk-chip-own { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--ink); }
/* 库存 0 的芯片：图标灰化、底色更淡，整体退一层；数字保持灰，选中也不转色 */
.mk-chip.zero { background: rgba(255,255,255,0.35); }
.mk-chip.zero .mk-ic { filter: grayscale(1); opacity: 0.55; }
.mk-chip-own.zero, .mk-chip.on .mk-chip-own.zero { color: var(--ink-soft); opacity: 0.65; font-weight: 500; }
.mk-ic.ic { width: 18px; height: 18px; font-size: 14px; }
.mk-empty { font-size: 12px; color: var(--ink-soft); }

/* 买卖方向：一行平铺的芯片，选中只描金边（与下面选物芯片同一套状态语言） */
.mk-modes { display: flex; gap: 6px; margin-bottom: 12px; }
.mk-mode {
    flex: 0 0 auto; border: 1px solid rgba(90,70,50,0.2); background: rgba(255,255,255,0.6);
    border-radius: 10px; padding: 6px 18px; font-size: 13px; font-weight: 600;
    color: var(--ink-soft); cursor: pointer; font-family: inherit;
}
.mk-mode.on {
    border-color: var(--gold); background: rgba(255,255,255,0.85); color: var(--ink);
    box-shadow: inset 0 0 0 1px var(--gold);
}
.mk-mode:disabled { opacity: 0.5; cursor: default; }

/* 一张表单走完两个方向：数量/总价各占一半，两颗钮跟在右端 */
.mk-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.mk-field { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-soft); }
.mk-form .btn { flex: 0 0 auto; }
/* 三颗填价钮独占一行：它们是「把总价填成某个参照价」的一组动作，不是提交按钮的同伴。
   主行因此恒定为 数量/总价/提交 三格，市场有无挂单都不会让控件换位 */
.mk-fill { display: flex; flex: 1 1 100%; gap: 8px; flex-wrap: wrap; }
/* 等宽取最宽那颗的自然宽（130 = 六字标签）：三颗一排看着是一组，不是三个长度随机的按钮 */
.mk-form .mk-fill .btn { flex: 0 0 auto; min-width: 130px; }
.mk-input {
    width: 100%; border: 1px solid rgba(90,70,50,0.22); border-radius: 10px;
    padding: 9px 10px; font-size: 15px; font-family: inherit; background: rgba(255,255,255,0.7); color: var(--ink);
}
.mk-hint { margin-top: 10px; font-size: 12px; color: var(--ink-soft); line-height: 1.65; }
.mk-hint b { color: var(--gold); }
.mk-warn { color: var(--cinnabar); font-weight: 600; }
/* 窄屏（手机）四个控件挤不进一行：数量/总价各占半行，两颗钮并排落到下一行 */
@media (max-width: 560px) {
    .mk-form .mk-field { flex: 1 1 calc(50% - 4px); }
    .mk-form .btn { flex: 1 1 0; }
    /* 填价那一行三颗等宽，标签再长也不让它换行错开高度 */
    .mk-form .mk-fill .btn { flex: 1 1 0; min-width: 0; padding: 9px 4px; font-size: 12px; }
}

/* 货行：左侧名与件数（副注另起一行），右侧价与动作钮 */
.mk-list { display: flex; flex-direction: column; }
/* 品类分段头：求购单按品类摆出来时，一段一个头，免得单子混成一堆看不出谁要什么 */
.mk-cat-head {
    margin: 10px 0 2px; padding-bottom: 4px; font-size: 12px; color: var(--ink-soft);
    border-bottom: 1px solid rgba(90,70,50,0.16);
}
.mk-cat-head:first-child { margin-top: 0; }
/* 在售多列：整行卡里条目多时左右摊开；列宽低于 250px 自动回落（窄屏不硬挤），
   250 是按三列算的：3×250 + 2×26 间距 = 802 ≤ 卡内容宽 822，标准窗宽刚好放下三列 */
.mk-cols {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr));
    gap: 0 26px; align-items: start;
}
/* 求购单两列：行的副注比在售长（谁求购的+官价+押金说明），三列挤不下就两列摊开；
   380 是按两列算的：2×380 + 26 间距 = 786 ≤ 卡内容宽 822 */
.mk-cols2 { grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr)); }
/* 多列态行内收一收：列窄了，行距、按钮、字号都让一让 */
.mk-cols .mk-row { padding: 7px 0; }
.mk-cols .mk-row-name { font-size: 13px; }
.mk-cols .mk-row-price { font-size: 13px; }
.mk-cols .mk-act { padding: 5px 9px; font-size: 12px; }
/* 网格里不分列的东西：品类分段头横贯整行（求购单按品类分段），空提示也不挤进一格 */
.mk-cols .mk-cat-head, .mk-cols .mk-empty { grid-column: 1 / -1; }
/* 在售筛选行：品类 + 排序两个下拉，贴在表头下 */
.mk-filters { display: flex; gap: 8px; margin-bottom: 10px; }
.mk-filter {
    flex: 1 1 0; min-width: 0; box-sizing: border-box; padding: 8px 11px;
    border: 1px solid rgba(90,70,50,0.22); border-radius: 10px;
    background: rgba(255,255,255,0.55); font: inherit; font-size: 13px; color: var(--ink);
}
.mk-filter:focus { outline: none; border-color: rgba(74,124,89,0.55); background: rgba(255,255,255,0.8); }
/* ---- 自绘下拉框：原生 select 隐藏当数据源（.cus-sel-src），外观与展开列表全自绘 ---- */
.cus-sel-src { display: none !important; }
.cus-sel { position: relative; display: inline-flex; min-width: max-content; }
.cus-sel-btn {
    /* 两列网格：当前项与隐形标尺同格叠放，按钮宽 = 最长选项而不是「当前项 + 最长选项」 */
    display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px;
    align-items: center; width: 100%; box-sizing: border-box; padding: 8px 11px;
    border: 1px solid rgba(90,70,50,0.22); border-radius: 10px;
    background: rgba(255,255,255,0.55); font: inherit; font-size: 13px; color: var(--ink);
    cursor: pointer;
}
.cus-sel-btn:focus-visible { outline: none; border-color: rgba(74,124,89,0.55); background: rgba(255,255,255,0.8); }
.cus-sel.disabled .cus-sel-btn { opacity: 0.55; cursor: default; }
.cus-sel-label { grid-area: 1 / 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 隐形标尺：按最长选项撑出按钮宽度，选中项换长换短控件不抖、文字不截 */
.cus-sel-ruler { grid-area: 2 / 1; visibility: hidden; height: 0; overflow: hidden; white-space: nowrap; }
.cus-sel-caret {
    grid-area: 1 / 2 / span 2; display: inline-flex; width: 13px; height: 13px; margin-right: 2px;
    color: var(--ink-soft); transition: transform 0.15s ease;
}
.cus-sel-caret svg.gl { width: 100%; height: 100%; }
.cus-sel.open .cus-sel-caret { transform: rotate(180deg); }
.cus-sel-list {
    display: none; position: absolute; top: calc(100% + 4px); left: 0; right: auto; z-index: 60;
    flex-direction: column; padding: 4px; max-height: 240px; overflow-y: auto;
    width: max-content; min-width: 100%; max-width: min(320px, calc(100vw - 24px));
    border: 1px solid rgba(90,70,50,0.22); border-radius: 10px;
    background: #fdfbf5; box-shadow: 0 6px 18px rgba(60,45,30,0.18);
}
.cus-sel.open .cus-sel-list { display: flex; }
/* 展开期间宿主折叠卡临时取消裁剪（.collapsible-body 平时 overflow:hidden，需压过上面那条的优先级） */
.card.collapsible > .collapsible-body.cus-sel-host { overflow: visible; }
/* 视口下方放不下时向上展开；右侧放不下时贴着按钮右沿往左摊 */
.cus-sel.drop-up .cus-sel-list { top: auto; bottom: calc(100% + 4px); }
.cus-sel.drop-left .cus-sel-list { left: auto; right: 0; }
.cus-sel-opt {
    /* 列表盒是 flex 列 + max-height：项默认可缩，选项一多就把每项压扁，字被 overflow:hidden 切掉半行 */
    flex: 0 0 auto;
    padding: 8px 10px; border-radius: 7px; font-size: 13px; color: var(--ink);
    cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cus-sel-opt + .cus-sel-opt { margin-top: 2px; }
.cus-sel-opt:hover { background: rgba(74,124,89,0.12); }
.cus-sel-opt.on { font-weight: 600; background: rgba(74,124,89,0.08); }
/* 级联二级菜单：主项右侧带 ›，悬停滑出子层；子层挂在 .cus-sel 根上（列表盒滚动会裁内嵌层） */
.cus-sel-opt.has-sub { position: relative; padding-right: 26px; }
.cus-sel-subcaret {
    position: absolute; right: 9px; top: 50%; width: 11px; height: 11px;
    transform: translateY(-50%) rotate(-90deg); color: var(--ink-soft); pointer-events: none;
}
.cus-sel-subcaret svg.gl { width: 100%; height: 100%; }
.cus-sel-sub-wrap {
    display: none; position: absolute; z-index: 61; flex-direction: column; padding: 4px;
    min-width: max-content; border: 1px solid rgba(90,70,50,0.22); border-radius: 10px;
    background: #fdfbf5; box-shadow: 0 6px 18px rgba(60,45,30,0.18);
}
.cus-sel-sub-wrap.open { display: flex; }
/* 主列表一关子层必须跟着消失，别留一个悬空的 open 态等下次展开 */
.cus-sel:not(.open) .cus-sel-sub-wrap { display: none; }
/* 挂单筛选行里两个下拉均分宽度；赛前焚符的小下拉沿用 tal-select 的字号 */
.mk-filters .cus-sel { flex: 1 1 0; min-width: 0; }
.tal-pick .cus-sel-btn { padding: 4px 8px; font-size: 12px; border-radius: 9px; border-color: rgba(90,70,50,0.22); }
.tal-pick .cus-sel { max-width: 260px; }
.sect-donate .cus-sel-btn { padding: 7px 9px; border-radius: 9px; }
.mk-row { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px dashed rgba(90,70,50,0.14); }
.mk-row:last-child { border-bottom: none; }
.mk-row-main { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mk-row-name { font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; }
.mk-row-qty { font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.mk-row-sub { flex: 1 1 100%; font-size: 11px; color: var(--ink-soft); }
.mk-row-side { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.mk-row-price { font-size: 14px; font-weight: 700; color: var(--gold); white-space: nowrap; }
.mk-act { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.mk-foot { margin-top: 10px; font-size: 12px; color: var(--ink-soft); }

/* ---- 自动交易：两个开关 + 两张规则表 + 两笔总数 ---- */
.mk-auto-switches { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.mk-auto-switches .bt-auto { font-size: 13px; }
.mk-auto-block { margin-bottom: 14px; }
.mk-auto-head {
    display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
    font-size: 13px; font-weight: 600; color: var(--ink);
    padding-bottom: 5px; margin-bottom: 8px; border-bottom: 1px solid rgba(90,70,50,0.14);
}
.mk-auto-tip { font-size: 11px; font-weight: 400; color: var(--ink-soft); }
.mk-auto-rules { display: flex; flex-direction: column; gap: 8px; }
/* 一条规则：选物 | 保留/目标 | 每批(仅买) | 定价%/上限% | 删；副注（官价与现有）另起一行 */
.mk-auto-rule {
    display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap;
    padding: 8px 0; border-bottom: 1px dashed rgba(90,70,50,0.12);
}
.mk-auto-rule:last-child { border-bottom: none; }
.mk-auto-rule .mk-auto-item { flex: 1 1 150px; min-width: 0; }
.mk-auto-rule .cus-sel { flex: 1 1 150px; min-width: 0; }
.mk-auto-rule .cus-sel-btn { width: 100%; }
.mk-auto-num { flex: 0 0 92px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-soft); }
.mk-auto-num input {
    width: 100%; box-sizing: border-box; border: 1px solid rgba(90,70,50,0.22); border-radius: 10px;
    padding: 8px 9px; font-size: 14px; font-family: inherit; background: rgba(255,255,255,0.7); color: var(--ink);
}
.mk-auto-del { flex: 0 0 auto; padding: 8px 12px; font-size: 12px; border-radius: 10px; }
.mk-auto-note { flex: 1 1 100%; font-size: 11px; color: var(--ink-soft); }
.mk-auto-add { margin-top: 8px; padding: 7px 14px; font-size: 12px; }
.mk-auto-form { margin-top: 4px; }
@media (max-width: 560px) {
    .mk-auto-num { flex: 1 1 calc(50% - 4px); }
    .mk-auto-rule .mk-auto-item, .mk-auto-rule .cus-sel { flex: 1 1 100%; }
}

/* 721–900px 窄桌面：五格并排时单格只剩 ~136px，13px 五字名会超 7px；
   按视口缩到 11–13px，保证名字完整（更低宽度走手机竖排样式，不在此列） */
@media (min-width: 721px) and (max-width: 900px) {
    .beast-slot .slot-name { font-size: clamp(11px, 1.5vw, 13px); }
}
/* 721–840px 再窄一档：图标与内边距各收一点，把星徽+等级那行留在同一行；
   768px 以下仍差 1px 装不下，等级会落到第三行（不省略任何字） */
@media (min-width: 721px) and (max-width: 840px) {
    .beast-slot { gap: 6px; padding: 8px 7px; }
    .beast-slot .beast-icon.ic { width: 36px; height: 36px; }
}

@media (max-width: 720px) {
    body { padding: 16px 12px 92px; }
    .hero { flex-direction: column; text-align: center; gap: 14px; padding: 18px; }
    .hero-avatar { width: 96px; height: 96px; }
    .hero-realm { font-size: 28px; letter-spacing: 2px; }
    .hero-sub { gap: 6px; font-size: 13px; justify-content: center; }
    .hero-sub2 { gap: 6px; font-size: 12px; justify-content: center; }
    .hs-name { white-space: normal; }
    .hc-btn { margin-left: 0; padding: 2px 10px; }
    .hero-title { color: var(--gold); font-weight: 700; }
    .hero-rebirth { color: var(--gold); font-weight: 600; }
    .uid-chip { margin-left: 0; font-size: 11px; padding: 1px 7px; }
    /* .hero 在手机端是 column 且 align-items:center，hero-info 不撑满就把整条数值压成「文字那么宽」，
       五项会首尾相贴。先让它占满卡宽，五项才真的等分。 */
    .hero-info { width: 100%; }
    .hero-stats { gap: 0 6px; }
    .hstat { flex: 1 1 0; min-width: 0; padding: 0; text-align: center; }
    .hval { font-size: clamp(13px, 3.6vw, 16px); }
    .hlabel { font-size: 10px; }
    /* minmax(0,1fr)：卡片的最小内容宽度不再把轨道撑出视口 */
    .panel { grid-template-columns: minmax(0, 1fr); }
    .cult-row { grid-template-columns: minmax(0, 1fr); }
    .cult-row.row3 { grid-template-columns: minmax(0, 1fr); }
    /* 铜钱袋在窄屏回到单列：余额在上，凝铜钮在下 */
    .coin-card.wide { grid-template-columns: 1fr; }
    .coin-card.wide .coin-bal,
    .coin-card.wide .coin-src,
    .coin-card.wide .coin-convert,
    .coin-card.wide .coin-hint { grid-column: 1; grid-row: auto; }
    .coin-card.wide .coin-convert .btn { flex: 1 1 auto; }
    .gongfa-card .branch-grid { grid-template-columns: 1fr; }
    /* 前世录窄屏改上下排：一行一世变两张行，数字整串留着不缩写，表头让位给行内的自说明文案 */
    .lives-head { display: none; }
    .lives-row { grid-template-columns: 1fr auto; gap: 2px 8px; padding: 9px 0; }
    .lives-row .lv-no { grid-column: 1; grid-row: 1; }
    .lives-row .lv-at { grid-column: 2; grid-row: 1; }
    .lives-row .lv-land, .lives-row .lv-lost,
    .lives-row .lv-gain, .lives-row .lv-el { grid-column: 1 / -1; font-size: 12px; }
    /* 表头没了，孤零零一枚命格名要自报家门 */
    .lives-row .lv-el::before { content: '投胎命格 '; opacity: 0.7; }
    /* 手机端：功德林与果位的三列会把说明挤成一条竖排，改成名与动作占一行、说明独吞整行 */
    .ms-row { grid-template-columns: 1fr auto; grid-template-areas: "name act" "desc desc"; row-gap: 2px; }
    .ms-row .ms-name { grid-area: name; }
    .ms-row .ms-desc { grid-area: desc; }
    .ms-row .ms-tag, .ms-row .btn-ms { grid-area: act; justify-self: end; }
    .fruit-row { grid-template-columns: auto 1fr auto; grid-template-areas: "at name tag" "desc desc desc"; row-gap: 2px; }
    .fruit-row .fruit-at { grid-area: at; text-align: left; }
    .fruit-row .fruit-name { grid-area: name; }
    .fruit-row .fruit-tag { grid-area: tag; }
    .fruit-row .fruit-desc { grid-area: desc; }
    .pw-row { grid-template-columns: minmax(64px, 1.1fr) 1.3fr 50px 60px; gap: 6px; }
    .pw-eff { font-size: 11px; }
    .pw-eff i { font-size: 9px; }
    .tal-item { flex-wrap: wrap; }
    /* 手机端灵兽卡：出战四格仍一排（数量是规则的一部分，不该折行看不出上限），只压字号 */
    .mat-chip { padding: 4px 8px; font-size: 11px; }
    .beast-roster-note { display: none; }
    /* 手机端摘要行放不下一整行：允许折行，按钮整组落到第二行右对齐，字号收紧少占位 */
    .beast-line { flex-wrap: wrap; row-gap: 2px; }
    .beast-line-acts { gap: 4px; }
    .beast-line-acts .btn { padding: 4px 7px; }
    .beast-lv { font-size: 11px; }
    .beast-slots { gap: 6px; }
    /* 手机端四格仍一排，一行摆不下左右结构：回退上下排，图标缩回小格 */
    .beast-slot { flex-direction: column; justify-content: center; text-align: center; gap: 2px; padding: 6px 4px; }
    .beast-slot .beast-icon.ic { width: 22px; height: 22px; }
    .beast-slot .slot-info { align-items: center; justify-content: center; width: 100%; gap: 1px 3px; }
    .beast-slot .slot-name { font-size: 12px; white-space: normal; line-height: 1.2; }
    .beast-slot .slot-lv { font-size: 10px; }
    /* 360/375 窄机：文字区只剩 ~42px，「Lv.100 顶」再小一档才不省略 */
    @media (max-width: 380px) { .beast-slot .slot-lv { font-size: 9px; } }
    .beast-capture { gap: 8px; }
    .beast-cast { flex: 1 1 100%; }
    .beast-cast .btn { min-width: 0; }
    /* 手机端灵田：地块数随行当变（散修 3、灵草师 4），一排四块字要顶出格子，改两列 */
    .field-plots { gap: 6px; }
    .field-plot { min-height: 84px; padding: 8px 4px; }
    .field-plot-icon { font-size: 18px; }
    span.ic.field-plot-ic { width: 16px; height: 16px; }
    .field-plot-name, .field-plot-state { font-size: 11px; }
    .field-actions { flex: 1 1 100%; }
    .field-actions .btn { flex: 1 1 0; }
    /* 手机端建设行：两行字太长，改成等级 / 说明 / 成本竖排，按钮在右侧跨三行 */
    .building-row { grid-template-columns: 26px minmax(0, 1fr) auto; row-gap: 2px; }
    .building-row .bd-icon { grid-column: 1; grid-row: 1; }
    .building-row .bd-main { grid-column: 2; grid-row: 1; }
    .building-row .bd-desc { grid-column: 2; grid-row: 2; }
    .building-row .bd-cost { grid-column: 2; grid-row: 3; white-space: normal; text-align: left; }
    .building-row .btn { grid-column: 3; grid-row: 1 / span 3; align-self: center; }
    /* 手机端镇妖渊：立绘收小给名字让位；出手按钮独占一行，战报长短不把它推走 */
    .sb-top { grid-template-columns: 72px minmax(0, 1fr); gap: 10px; }
    span.ic.sb-art { width: 72px; height: 72px; }
    .sb-actions .btn { flex: 1 1 100%; }
    .sb-hit .sb-hd { min-width: 72px; }
    /* 手机端名录：六列固定宽度在 300px 卡里放不下，改两行——名字与贡献一行，境界/战力/职位一行 */
    .roster-item {
        grid-template-columns: 10px minmax(0, 1fr) auto auto;
        grid-template-areas:
            "dot name name contrib"
            "dot realm pow role";
        row-gap: 2px;
    }
    .roster-item .rd-dot { grid-area: dot; }
    .roster-item .rd-name { grid-area: name; }
    .roster-item .rd-realm { grid-area: realm; text-align: left; }
    .roster-item .rd-pow { grid-area: pow; }
    .roster-item .rd-role { grid-area: role; }
    .roster-item .rd-contrib { grid-area: contrib; }
    /* 手机端炼魂：300px 最小列宽比卡内宽还大，列表会撑出卡外 */
    .forge-list { grid-template-columns: minmax(0, 1fr); }
    /* 手机端炼器台标题：法宝阶名 + 器魂/在槽/温养三段摘要一行放不下，宁可换两行也不把卡撑宽 */
    .weapon-card > .collapse-toggle { flex-wrap: wrap; white-space: normal; }
    /* 四脉标题：句子长短不一，有的换两行有的换一行会参差；固定让解说独占第二行，四段一样高 */
    .soul-school .ss-desc { flex-basis: 100%; }
    /* 一行两枚按钮并排会把右侧吃到 144px，器魂名只剩 80px 高；改竖排，右侧宽等于最宽那枚 */
    .soul-btns { flex-direction: column; align-items: flex-end; }
    /* 手机端：tab 吸底，单手可达 */
    .tabbar {
        position: fixed; left: 8px; right: 8px; bottom: 8px; margin: 0;
        z-index: 12; border-radius: 16px; padding: 5px;
        background: rgba(255,255,255,0.86);
        -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
        box-shadow: 0 -4px 20px rgba(40,30,20,0.16);
    }
    /* 七个 tab 挤在一栏：字号、间隙、内边距一起收紧到「图标+两字」留出 2px 以上余量 */
    .tabbar { gap: 3px; }
    .tabbar .tab { padding: 9px 1px; font-size: 13px; }
    .tabbar .tab-ic.ic { width: 12px; height: 12px; margin-right: 2px; }
    /* 余量吃完就没图标，只留文字（再挤就是裁字，不如放手） */
    @media (max-width: 351px) { .tabbar .tab-ic.ic { display: none; } }
    /* 手机端右上角：三个按钮缩小并允许换行 */
    .xx-topright { gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 50vw; }
    .xx-mail, .hc-btn.xx-logout, .hc-btn.xx-pwd, .xx-skip { font-size: 12px; padding: 5px 10px; height: 30px; }
    .uid-chip { font-size: 12px; padding: 5px 10px; height: 30px; border-width: 2px; }
    .modal { width: 100%; }
    /* 手机端信箱：列表按视口收高度，避免整页跟着弹窗一起滚 */
    .mail-modal-box { width: 100%; padding: 16px 14px; }
    .mail-list { max-height: 58vh; }
    .mail-top { align-items: flex-start; }
    .xx-mail { padding: 5px 10px; }
}

/* ---- 账号：登录 / 注册 / 设密 遮罩 ---- */
.auth-modal { width: min(400px, 92vw); }
.auth-title { font-size: 24px; font-weight: 800; margin-bottom: 14px; font-family: "KaiTi","STKaiti",serif;
    background: linear-gradient(90deg, var(--cinnabar), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.auth-tab { flex: 1; border: 1px solid rgba(90,70,50,0.18); background: rgba(255,255,255,0.5); color: var(--ink-soft);
    border-radius: 10px; padding: 9px 10px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.15s; }
.auth-tab.on { border-color: var(--cinnabar); background: rgba(176,58,46,0.08); color: var(--cinnabar); }
.auth-pane { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.auth-uid-row { font-size: 13px; color: var(--ink-soft); }
.auth-uid-row b { color: var(--cinnabar); }
.auth-input { width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid rgba(90,70,50,0.2);
    background: #fff; color: var(--ink); font-size: 15px; outline: none; }
.auth-input:focus { border-color: var(--cinnabar); }
.auth-msg { min-height: 16px; font-size: 13px; color: var(--cinnabar); text-align: center; }
.auth-msg:empty { min-height: 0; }
.auth-hint { font-size: 12px; color: var(--ink-soft); line-height: 1.5; text-align: left; }
.auth-modal .btn { width: 100%; margin-top: 4px; }

/* ---- 斗法属性：战力派生出来的五项，摆在这里而不是藏在战报里 ---- */
.combat-card .cc-grid {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px; margin: 4px 0 10px;
}
.cc-tile {
    padding: 9px 8px 8px; border-radius: 10px; text-align: center;
    border: 1px solid rgba(90,70,50,0.16);
    background: linear-gradient(160deg, rgba(255,255,255,0.7), rgba(255,255,255,0.35));
}
.cc-label { font-size: 11.5px; color: var(--ink-soft); white-space: nowrap; }
.cc-value {
    margin-top: 3px; font-size: 19px; font-weight: 800; color: var(--ink);
    font-variant-numeric: tabular-nums; line-height: 1.2; overflow-wrap: anywhere;
}
.cc-tile.key .cc-value { color: var(--cinnabar); }
.cc-note { font-size: 12px; color: var(--ink-soft); line-height: 1.6; }
.cc-note b { color: var(--ink); }
.cc-note .cc-base { color: var(--ink-soft); }
.cc-branch { margin-top: 4px; color: var(--bamboo); }
@media (max-width: 720px) {
    .combat-card .cc-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
    .cc-tile { padding: 7px 3px 6px; border-radius: 8px; }
    .cc-label { font-size: 10.5px; }
    .cc-value { font-size: 14px; }
}

/* ---- 战斗舞台：过程是演的，账是开战前就结好的 ---- */
body.battle-lock { overflow: hidden; }
.battle-stage {
    position: fixed; inset: 0; z-index: 40; display: none; padding: 14px;
    --bs-accent: #8a6a2f;
    --bs-glow: rgba(201,162,39,0.16);
    --bs-bg: none;
    background: radial-gradient(1200px 820px at 50% 112%, #241d16 0%, #120f0b 72%);
}
/* 场景画铺满整块舞台，宣纸画幅浮在它上面——示例图里剑冢的剑林是在画框外的 */
.battle-stage::before {
    content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background-image: var(--bs-bg);
    background-size: cover; background-position: 50% 46%;
    opacity: 0.7;
}
.battle-stage::after {
    content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background:
        radial-gradient(120% 82% at 50% 44%, rgba(16,12,9,0) 26%, rgba(16,12,9,0.55) 100%),
        linear-gradient(180deg, rgba(16,12,9,0.52), rgba(16,12,9,0.16) 42%, rgba(16,12,9,0.7));
}
.battle-stage.show { display: flex; align-items: center; justify-content: center; }
/* 跳过战斗场景：匾额、画幅、函盘整块收掉，场景画与压暗也不铺，只剩一张结果卡浮在底色上 */
.battle-stage.no-scene .bs-scene { display: none; }
.battle-stage.no-scene::before,
.battle-stage.no-scene::after { display: none; }
.battle-stage[data-theme="spar"] { --bs-accent: #406a83; --bs-glow: rgba(64,106,131,0.35); --bs-bg: url("assets/bg_battle_spar.webp"); }
.battle-stage[data-theme="tomb"] { --bs-accent: #8f2f27; --bs-glow: rgba(143,47,39,0.34); --bs-bg: url("assets/bg_battle_tomb.webp"); }
.battle-stage[data-theme="realm"] { --bs-accent: #4a7c59; --bs-glow: rgba(74,124,89,0.32); --bs-bg: url("assets/bg_battle_realm.webp"); }
.battle-stage[data-theme="abyss"] { --bs-accent: #8a3b22; --bs-glow: rgba(138,59,34,0.36); --bs-bg: url("assets/bg_battle_abyss.webp"); }
.battle-stage[data-theme="tourney"] { --bs-accent: #a2761f; --bs-glow: rgba(162,118,31,0.30); --bs-bg: url("assets/bg_battle_tourney.webp"); }

/* 匾额在上、画幅居中、函盘在下 */
.bs-scene {
    position: relative; z-index: 1;
    display: flex; flex-direction: column; gap: 11px; min-height: 0;
    width: min(1020px, 100%); height: min(94vh, 880px);
}
.bs-crown { flex: 0 0 auto; text-align: center; }
.bs-crown[hidden] { display: none; }
.bs-crown-title {
    margin: 0; font-family: "KaiTi","STKaiti",serif;
    font-size: 34px; font-weight: 800; letter-spacing: 7px; line-height: 1.25;
    color: #f6e9c8; text-shadow: 0 2px 10px rgba(0,0,0,0.66), 0 0 24px var(--bs-glow);
    overflow-wrap: anywhere;
}
.bs-score {
    margin-top: 5px; display: flex; align-items: center; justify-content: center; gap: 13px;
    font-size: 14.5px; color: rgba(246,233,200,0.88); font-variant-numeric: tabular-nums;
    text-shadow: 0 1px 6px rgba(0,0,0,0.6);
}
.bs-score[hidden] { display: none; }
.bs-score b { font-size: 23px; letter-spacing: 2px; color: #ffd972; }
.bs-score .bs-dots { display: inline-flex; gap: 6px; }
.bs-score .bs-dots i {
    width: 11px; height: 11px; border-radius: 50%;
    border: 1px solid rgba(246,233,200,0.5); background: rgba(255,255,255,0.1);
}
.bs-score .bs-dots i.on { background: #6fbf7a; border-color: #cfe9cf; }

.bs-frame {
    position: relative; flex: 1 1 auto; min-height: 0;
    display: flex; flex-direction: column;
    padding: 58px 22px 14px; overflow: hidden; color: var(--ink);
    border: 1px solid rgba(120,90,50,0.5); border-radius: 12px;
    box-shadow: 0 26px 70px rgba(0,0,0,0.55), inset 0 0 0 6px rgba(247,240,223,0.6);
    /* 场景画铺在画幅里，宣纸只在四周与下半压深：示例图中剑林/云海就是透过画框看得见的 */
    background:
        radial-gradient(105% 88% at 50% 42%,
            rgba(247,240,225,0.44) 0%, rgba(241,232,212,0.74) 56%, rgba(228,215,187,0.93) 100%),
        var(--bs-bg) 50% 46% / cover no-repeat;
}
.bs-frame::before {
    content: ""; position: absolute; inset: 9px; z-index: 2; pointer-events: none;
    border: 1px solid rgba(201,162,39,0.45);
}
/* 画幅内的水渍：普通对决只留宣纸底色，镇妖渊要让渊景从妖物身后透出来 */
.bs-frame::after {
    content: ""; position: absolute; inset: 1px; z-index: 0; pointer-events: none;
    background-image:
        radial-gradient(120% 92% at 50% 0%, rgba(255,255,255,0.55), rgba(255,255,255,0) 58%),
        radial-gradient(70% 60% at 0% 100%, rgba(143,90,40,0.12), rgba(0,0,0,0) 60%),
        radial-gradient(72% 62% at 100% 100%, var(--bs-glow), rgba(0,0,0,0) 62%);
    background-repeat: no-repeat;
    box-shadow: inset 0 0 90px rgba(90,60,30,0.16);
}
.battle-stage.mode-boss .bs-frame::after {
    background-image:
        linear-gradient(180deg, rgba(248,241,226,0.8), rgba(240,231,211,0.66) 46%, rgba(230,218,192,0.84)),
        var(--bs-bg),
        radial-gradient(72% 62% at 100% 100%, var(--bs-glow), rgba(0,0,0,0) 62%);
    background-size: auto, cover, auto;
    background-position: 50% 0, 50% 46%, 100% 100%;
}
/* 大比观战：描金画框 + 四角朱印 */
.battle-stage.mode-series .bs-frame {
    box-shadow: 0 0 0 3px #c9a227, 0 0 0 5px #6b4a2a, 0 0 0 6px rgba(201,162,39,0.55),
        0 26px 70px rgba(0,0,0,0.55), inset 0 0 0 6px rgba(247,240,223,0.6);
}
.bs-corner { display: none; }
.battle-stage.mode-series .bs-corner {
    display: grid; place-items: center; position: absolute; z-index: 3;
    width: 25px; height: 25px; border-radius: 3px;
    font-family: "KaiTi","STKaiti",serif; font-size: 14px; font-weight: 800; font-style: normal;
    color: #fdeed3; background: linear-gradient(180deg, #b03a2e, #7d2119);
    box-shadow: 0 2px 6px rgba(0,0,0,0.35), inset 0 0 0 1px rgba(255,235,205,0.45);
}
.bs-corner-tl { top: 12px; left: 12px; }
.bs-corner-tr { top: 12px; right: 12px; }
.bs-corner-bl { bottom: 12px; left: 12px; }
.bs-corner-br { bottom: 12px; right: 12px; }

.bs-plaque {
    position: absolute; top: 13px; left: 50%; transform: translateX(-50%); z-index: 3;
    display: flex; align-items: center; justify-content: center;
    min-width: 176px; max-width: 76%; padding: 7px 22px;
    font-family: "KaiTi","STKaiti",serif; font-size: 20px; font-weight: 800;
    letter-spacing: 4px; line-height: 1.35; text-align: center; overflow-wrap: anywhere;
    color: #f6e7c4; text-shadow: 0 1px 2px rgba(0,0,0,0.6);
    border: 1px solid rgba(201,162,39,0.75); border-radius: 5px;
    background:
        repeating-linear-gradient(90deg, rgba(255,255,255,0.05) 0 3px, rgba(0,0,0,0) 3px 8px),
        linear-gradient(180deg, #4b3323, #31201a);
    box-shadow: 0 8px 18px rgba(0,0,0,0.42), inset 0 0 0 3px rgba(201,162,39,0.16);
}
.bs-plaque[hidden] { display: none; }
.bs-plaque::before, .bs-plaque::after {
    content: ""; position: absolute; top: -13px; width: 2px; height: 13px;
    background: linear-gradient(180deg, rgba(201,162,39,0.25), rgba(201,162,39,0.9));
}
.bs-plaque::before { left: 24%; }
.bs-plaque::after { right: 24%; }

/* 镇妖渊：妖名、妖血、分层与变招 */
.bs-boss { flex: 0 0 auto; position: relative; z-index: 1; display: flex; flex-direction: column; gap: 4px; padding: 0 4px 4px; }
.bs-boss[hidden] { display: none; }
.bs-boss-name {
    font-family: "KaiTi","STKaiti",serif; font-size: clamp(24px, 5vh, 36px);
    font-weight: 800; letter-spacing: 6px; line-height: 1.2; text-align: center;
    overflow-wrap: anywhere; color: #c0392b;
    text-shadow: -1px -1px 0 #fff8e6, 1px -1px 0 #fff8e6, -1px 1px 0 #fff8e6, 1px 1px 0 #fff8e6,
        0 3px 0 #fff8e6, 0 6px 16px rgba(143,47,39,0.35);
}
.bs-boss-row { display: flex; align-items: flex-start; gap: 10px; }
.bs-boss-bar {
    position: relative; flex: 1 1 auto; min-width: 0; height: 22px; margin-top: 17px;
    border-radius: 11px; border: 1px solid rgba(48,34,24,0.72);
    background: linear-gradient(180deg, #2b241d, #171310);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 2px 6px rgba(0,0,0,0.28);
}
.bs-boss-fill {
    position: absolute; left: 0; top: 0; bottom: 0; width: 100%;
    border-radius: 10px 0 0 10px; transition: width 0.28s ease;
    background: linear-gradient(180deg, #f0a15c, #c0392b 62%, #8f2f27);
    box-shadow: inset 0 -4px 6px rgba(0,0,0,0.16);
}
.bs-boss-ticks { position: absolute; inset: 0; }
.bs-boss-ticks i {
    position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px;
    background: rgba(255,241,214,0.7); font-style: normal;
}
.bs-boss-ticks i b {
    position: absolute; bottom: 100%; left: 4px; margin-bottom: 3px;
    font-size: 10px; font-weight: 700; letter-spacing: 0.3px; white-space: nowrap;
    color: var(--ink-soft);
}
.bs-boss-hptext {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end;
    padding-right: 10px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.4px; color: #fff;
    font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}
.bs-boss-tag {
    flex: 0 0 auto; margin-top: 17px; font-size: 12px; font-weight: 800; white-space: nowrap;
    color: #fdeed3; padding: 4px 11px; border-radius: 4px;
    border: 1px solid rgba(255,226,190,0.35);
    background: linear-gradient(180deg, #b03a2e, #7d2119);
    box-shadow: 0 3px 8px rgba(0,0,0,0.28);
}
.bs-boss-tag[hidden] { display: none; }
.bs-cycle { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--ink-soft); }
.bs-cycle[hidden] { display: none; }
.bs-cycle b { font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; letter-spacing: 0.5px; }
.bs-cycle i {
    position: relative; display: block; width: 132px; height: 9px; border-radius: 5px; overflow: hidden;
    border: 1px solid rgba(60,45,30,0.4); background: rgba(247,240,223,0.6);
}
.bs-cycle s { display: block; height: 100%; width: 100%; text-decoration: none; background: linear-gradient(90deg, #c0392b, #8f2f27); }
/* 一格一层，进度条本身就是层数表 */
.bs-cycle i::after {
    content: ""; position: absolute; inset: 0;
    background: repeating-linear-gradient(90deg, rgba(60,45,30,0.42) 0 1px, rgba(0,0,0,0) 1px calc(100% / 12));
}

.bs-arena {
    flex: 1 1 auto; min-height: 0; display: flex; align-items: stretch;
    gap: 10px; padding: 6px 0 2px; position: relative; z-index: 1;
}
.bs-side {
    flex: 1 1 0; min-width: 0; display: flex; flex-direction: column;
    align-items: center; justify-content: flex-end; gap: 7px;
    position: relative; padding-bottom: 2px;
}
.bs-artwrap {
    flex: 1 1 auto; min-height: 0; width: 100%;
    display: flex; align-items: flex-end; justify-content: center;
    position: relative;
}
/* 立绘都是站像：我方青白袍，对手朱红袍，妖灵自成一派 */
.bs-art {
    max-width: 100%; max-height: 100%; object-fit: contain;
    filter: drop-shadow(0 12px 16px rgba(48,32,18,0.3));
    transition: transform 0.2s ease;
}
.bs-noart {
    width: clamp(84px, 18vh, 140px); height: clamp(84px, 18vh, 140px);
    display: grid; place-items: center; border-radius: 50%;
    border: 2px solid rgba(201,162,39,0.5);
    background: radial-gradient(circle at 50% 40%, #fff, #ece1c8);
    font-family: "KaiTi","STKaiti",serif; font-size: 40px; color: var(--bs-accent);
}
.bs-noart[hidden] { display: none; }
.bs-artwrap::after {
    content: ""; position: absolute; left: 16%; right: 16%; bottom: 2px; height: 14px;
    background: radial-gradient(ellipse at center, rgba(60,40,20,0.3), rgba(60,40,20,0) 70%);
    pointer-events: none;
}

/* 名牌：两头出尖的木牌，外端一枚朱印，内端一颗五行钻 */
.bs-plate {
    --notch: 12px;
    flex: 0 0 auto; max-width: 100%; padding: 1px;
    clip-path: polygon(var(--notch) 0, calc(100% - var(--notch)) 0, 100% 50%,
        calc(100% - var(--notch)) 100%, var(--notch) 100%, 0 50%);
    background: linear-gradient(180deg, #d8b45c, #9c7722);
}
.bs-plate-in {
    display: flex; align-items: center; justify-content: center; gap: 7px; flex-wrap: wrap;
    padding: 4px 14px; border-radius: 1px;
    clip-path: polygon(var(--notch) 0, calc(100% - var(--notch)) 0, 100% 50%,
        calc(100% - var(--notch)) 100%, var(--notch) 100%, 0 50%);
    background: linear-gradient(180deg, #fdf8ea, #eee1c4);
}
.bs-side.right .bs-plate { background: linear-gradient(180deg, #e0b64a, #8c5a1c); }
.bs-side.right .bs-plate-in { background: linear-gradient(180deg, #62302a, #3b1b16); }
.bs-stamp {
    flex: 0 0 auto; width: 19px; height: 19px; display: grid; place-items: center;
    font-family: "KaiTi","STKaiti",serif; font-size: 12px; font-weight: 800; font-style: normal;
    color: #fdeed3; border-radius: 2px;
    background: linear-gradient(180deg, #b03a2e, #7d2119);
    box-shadow: inset 0 0 0 1px rgba(255,235,205,0.4);
}
.bs-side.right .bs-stamp {
    color: #4a2a12;
    background: linear-gradient(180deg, #f0d282, #c9a227);
    box-shadow: inset 0 0 0 1px rgba(90,50,20,0.35);
}
.bs-stamp[hidden] { display: none; }
.bs-name {
    font-size: 15.5px; font-weight: 800; color: var(--ink); line-height: 1.4;
    overflow-wrap: anywhere; text-align: center; max-width: 100%;
}
.bs-realm { font-size: 11.5px; color: var(--ink-soft); white-space: nowrap; }
.bs-side.right .bs-name { color: #f7e8ca; }
.bs-side.right .bs-realm { color: rgba(247,232,202,0.76); }
.bs-mark {
    position: relative; flex: 0 0 auto; width: 18px; height: 18px;
    display: grid; place-items: center; font-style: normal;
    font-size: 10px; font-weight: 800; color: var(--ink-soft);
}
.bs-mark[hidden] { display: none; }
.bs-mark::before {
    content: ""; position: absolute; inset: 0; transform: rotate(45deg);
    border: 1px solid currentColor; border-radius: 2px; background: rgba(255,255,255,0.5);
}
.bs-side.right .bs-mark::before { background: rgba(255,240,214,0.12); }
.bs-mark.e-jin { color: #a8841c; }
.bs-mark.e-mu { color: #4a7c59; }
.bs-mark.e-shui { color: #406a83; }
.bs-mark.e-huo { color: #b03a2e; }
.bs-mark.e-tu { color: #8b6a3e; }
/* 深红名牌上的五行字要抬亮，否则朱砂压在暗底上看不清 */
.bs-side.right .bs-mark.e-jin { color: #e6c56a; }
.bs-side.right .bs-mark.e-mu { color: #8fc9a2; }
.bs-side.right .bs-mark.e-shui { color: #86b6d4; }
.bs-side.right .bs-mark.e-huo { color: #e88a7a; }
.bs-side.right .bs-mark.e-tu { color: #d6b184; }

/* 血条：剑形端饰 + 条内右对齐的完整数值 */
.bs-hprow { flex: 0 0 auto; display: flex; align-items: center; gap: 7px; width: 100%; max-width: 340px; }
.bs-side.right .bs-hprow { flex-direction: row-reverse; }
.bs-blade { flex: 0 0 auto; width: 18px; height: 18px; color: #4a8f45; }
.bs-blade .gl { width: 18px; height: 18px; display: block; }
.bs-side.right .bs-blade { color: #b03a2e; }
.bs-hp {
    position: relative; flex: 1 1 auto; min-width: 0; height: 22px;
    border-radius: 11px; overflow: hidden;
    border: 1px solid rgba(48,34,24,0.72);
    background: linear-gradient(180deg, #2b241d, #171310);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 2px 6px rgba(0,0,0,0.28);
}
.bs-hp-fill {
    position: absolute; inset: 0; width: 100%;
    border-radius: 10px 0 0 10px; transition: width 0.28s ease;
    background: linear-gradient(180deg, #a8d977, #4a9a44 62%, #2f7233);
    box-shadow: inset 0 -4px 6px rgba(0,0,0,0.14);
}
.bs-side.right .bs-hp-fill { background: linear-gradient(180deg, #e0574a, #a52a22 62%, #7d1f19); }
.bs-hp-text {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end;
    padding-right: 10px; font-size: 11.5px; font-weight: 800; color: #fff; letter-spacing: 0.3px;
    font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px rgba(0,0,0,0.8); z-index: 1;
}
.bs-remain {
    position: absolute; left: 4px; bottom: 4px; z-index: 2;
    font-size: 11.5px; font-weight: 700; letter-spacing: 0.5px; white-space: nowrap;
    color: #f7e8ca; padding: 3px 10px; border-radius: 4px;
    border: 1px solid rgba(201,162,39,0.45);
    background: linear-gradient(180deg, #46372a, #2a2018);
    box-shadow: 0 3px 8px rgba(0,0,0,0.28);
}
.bs-remain[hidden] { display: none; }
.bs-pop { position: absolute; top: 20%; left: 0; right: 0; height: 0; pointer-events: none; }
.bs-pop span {
    position: absolute; left: 50%; transform: translateX(-50%);
    font-family: "KaiTi","STKaiti",serif; font-weight: 800; font-size: 26px;
    color: var(--cinnabar); text-shadow: 0 1px 0 #fff8e6, 0 3px 8px rgba(255,245,225,0.6);
    animation: bsFloat 0.8s ease-out forwards;
}
.bs-pop span.crit { font-size: 32px; color: #a01f16; }
@keyframes bsFloat {
    0% { opacity: 0; transform: translate(-50%, 10px) scale(0.85); }
    22% { opacity: 1; transform: translate(-50%, 0) scale(1.04); }
    100% { opacity: 0; transform: translate(-50%, -34px) scale(1); }
}
.bs-side.strike-left .bs-art { transform: translateX(12px) scale(1.03); }
.bs-side.strike-right .bs-art { transform: translateX(-12px) scale(1.03); }

/* 示意图里只有斗法血条两端带刀；观战是尖头条，镇妖渊的妖名妖血都在上方大条里 */
.battle-stage.mode-boss .bs-blade,
.battle-stage.mode-series .bs-blade { display: none; }
/* 渊战的中列本就没有内容：第 N 刀写在战报里，五行乘区也不参与群妖 */
.battle-stage.mode-boss .bs-center { display: none; }
.battle-stage.mode-boss .bs-side.right .bs-plate,
.battle-stage.mode-boss .bs-side.right .bs-hprow { display: none; }

.bs-center {
    flex: 0 0 196px; display: flex; flex-direction: column;
    align-items: center; justify-content: flex-end; gap: 8px;
    position: relative; z-index: 1; padding-top: 4px;
}
/* 观战有挂轴：轴在上、回合数仍贴着血条那一行 */
.battle-stage.mode-series .bs-center { flex-basis: 214px; justify-content: space-between; }
/* 第 N 局：上下带轴的挂轴 */
.bs-banner {
    position: relative; padding: 7px 20px; border-radius: 2px; white-space: nowrap;
    font-family: "KaiTi","STKaiti",serif; font-size: 15px; font-weight: 800; letter-spacing: 4px;
    color: var(--ink);
    background: linear-gradient(180deg, #fdf8ea, #e9dcbe);
    box-shadow: 0 4px 10px rgba(40,28,18,0.24), inset 0 0 0 1px rgba(201,162,39,0.4);
}
.bs-banner[hidden] { display: none; }
.bs-banner::before, .bs-banner::after {
    content: ""; position: absolute; left: -9px; right: -9px; height: 7px; border-radius: 4px;
    background: linear-gradient(180deg, #7a5330, #3b2718);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.bs-banner::before { top: -5px; }
.bs-banner::after { bottom: -5px; }
.bs-below { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.bs-round {
    font-family: "KaiTi","STKaiti",serif; font-size: 17px; font-weight: 800;
    color: var(--ink); white-space: nowrap; letter-spacing: 2px;
}
.bs-round::before, .bs-round::after { content: "◇"; color: var(--gold); margin: 0 7px; font-size: 11px; }
.bs-mods {
    font-size: 11.5px; line-height: 1.45; color: var(--ink-soft); text-align: center;
    font-variant-numeric: tabular-nums; min-height: 16px; white-space: nowrap;
}

/* 函盘：倍速印、战报、镇妖台印、跳过 */
.bs-tray {
    flex: 0 0 auto; display: flex; align-items: center; gap: 12px; padding: 10px 14px;
    border-radius: 12px; border: 1px solid rgba(201,162,39,0.4);
    background: linear-gradient(180deg, rgba(45,39,32,0.94), rgba(22,18,14,0.96));
    box-shadow: 0 14px 30px rgba(0,0,0,0.48);
}
.bs-speeds { flex: 0 0 auto; display: flex; gap: 8px; }
.bs-speed {
    width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
    font-family: "KaiTi","STKaiti",serif; font-size: 14px; font-weight: 800;
    color: #3a2f22; background: linear-gradient(180deg, #f6ecd4, #ddc9a2);
    border: 1px solid rgba(120,90,50,0.55); font-variant-numeric: tabular-nums;
    box-shadow: 0 3px 7px rgba(0,0,0,0.32), inset 0 0 0 2px rgba(255,255,255,0.4);
}
.bs-speed:hover { background: linear-gradient(180deg, #fffaf0, #e6d4ae); }
.bs-speed.on {
    background: linear-gradient(180deg, #fffaf0, #f0e2c2);
    box-shadow: 0 0 0 2px var(--bs-accent), 0 0 14px var(--bs-glow), inset 0 0 0 2px rgba(255,255,255,0.5);
}
.bs-feed {
    flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: center;
    gap: 9px; padding: 7px 14px; border-radius: 9px;
    border: 1px solid rgba(201,162,39,0.26);
    background: linear-gradient(180deg, rgba(64,54,43,0.9), rgba(34,28,22,0.92));
    color: #f1e7d2; font-size: 14px;
}
.bs-feed-ico { flex: 0 0 auto; width: 17px; height: 17px; color: #e0703a; }
.bs-feed-ico .gl { width: 17px; height: 17px; display: block; }
.bs-feed-bolt { flex: 0 0 auto; width: 15px; height: 15px; color: #ffd86b; }
.bs-feed-bolt .gl { width: 15px; height: 15px; display: block; }
.bs-feed-bolt[hidden] { display: none; }
.bs-feed-round { flex: 0 0 auto; color: var(--gold); font-size: 12.5px; letter-spacing: 1px; white-space: nowrap; }
.bs-feed-round:empty { display: none; }
.bs-feed-text { line-height: 1.45; overflow-wrap: anywhere; }
.bs-feed-text .bs-dmg { color: #ff9a7a; font-weight: 800; font-variant-numeric: tabular-nums; }
.bs-feed-text .bs-crit { color: #ffd86b; font-weight: 800; }
.bs-crest {
    flex: 0 0 auto; font-size: 12px; font-weight: 700; letter-spacing: 0.5px; white-space: nowrap;
    color: #4a2a12; padding: 5px 13px; border-radius: 999px;
    border: 1px solid rgba(120,80,20,0.5);
    background: linear-gradient(180deg, #f0d282, #c9a227);
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}
.bs-crest[hidden] { display: none; }
.bs-skip {
    flex: 0 0 auto; min-width: 88px; height: 36px; border-radius: 999px; cursor: pointer;
    font-family: "KaiTi","STKaiti",serif; font-size: 15px; font-weight: 800; letter-spacing: 3px;
    color: #6a5c46; border: 1px solid rgba(120,90,50,0.5);
    background: linear-gradient(180deg, #f6ecd4, #ddc9a2);
    box-shadow: 0 3px 8px rgba(0,0,0,0.3), inset 0 0 0 2px rgba(255,255,255,0.4);
}
.bs-skip:hover { background: linear-gradient(180deg, #fffaf0, #e6d4ae); color: #4a3f2c; }

.battle-stage.mode-boss .bs-side.left { flex: 0 0 30%; }
.battle-stage.mode-boss .bs-side.right { flex: 1 1 70%; }
.battle-stage.mode-boss .bs-side.left .bs-hprow { max-width: 100%; }
.battle-stage.mode-boss .bs-noart { width: clamp(64px, 12vh, 96px); height: clamp(64px, 12vh, 96px); }

.bs-result {
    position: absolute; inset: 0; z-index: 5;
    display: flex; align-items: center; justify-content: center;
    background: rgba(24,18,12,0.52);
}
.bs-result[hidden] { display: none; }
.bs-result-box {
    width: min(420px, 90%); max-height: 84%; overflow-y: auto;
    padding: 24px 24px 20px; text-align: center;
    border: 1px solid rgba(120,90,50,0.4);
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(0,0,0,0.4), inset 0 0 0 5px rgba(247,240,223,0.7);
    background:
        radial-gradient(120% 90% at 50% 0%, rgba(255,255,255,0.8), rgba(255,255,255,0) 60%),
        linear-gradient(165deg, #f8f1e1, #eadfc7);
    animation: bsResultIn 0.28s cubic-bezier(.2,.7,.3,1);
}
@keyframes bsResultIn {
    from { opacity: 0; transform: translateY(14px) scale(0.97); }
    to { opacity: 1; transform: none; }
}
.bs-result-title {
    font-family: "KaiTi","STKaiti",serif; font-size: 28px; font-weight: 800;
    letter-spacing: 3px; margin-bottom: 6px;
}
.bs-result-title.win { color: var(--bamboo); }
.bs-result-title.lose { color: var(--cinnabar); }
.bs-result-title.neutral { color: var(--gold); }
.bs-result-verdict { font-size: 13px; color: var(--ink-soft); line-height: 1.6; margin-bottom: 12px; }
.bs-result-body { display: flex; flex-direction: column; gap: 5px; margin-bottom: 16px; }
.bs-result-line {
    font-size: 13px; color: var(--ink); line-height: 1.55;
    padding: 3px 0; border-bottom: 1px dashed rgba(90,70,50,0.16);
}
.bs-result-line:last-child { border-bottom: 0; }
.bs-result-line .k { color: var(--ink-soft); margin-right: 8px; }
.bs-result-line .v { font-weight: 700; font-variant-numeric: tabular-nums; }
.bs-result-line .v.good { color: var(--bamboo); }
.bs-result-line .v.bad { color: var(--cinnabar); }
.bs-result-box .btn { min-width: 140px; }

@media (max-width: 720px) {
    .battle-stage { padding: 8px; }
    .battle-stage::before { opacity: 0.62; }
    .bs-scene { height: min(96vh, 100%); gap: 8px; }
    .bs-crown-title { font-size: 24px; letter-spacing: 4px; }
    .bs-score { font-size: 12.5px; gap: 8px; }
    .bs-score b { font-size: 18px; }
    .bs-frame { width: 100%; height: 100%; max-height: none; padding: 46px 12px 10px; border: 0; border-radius: 8px; box-shadow: none; }
    .bs-frame::before { inset: 5px; }
    .battle-stage.mode-series .bs-frame { box-shadow: 0 0 0 2px #c9a227, 0 0 0 3px #6b4a2a; }
    .bs-corner { width: 20px; height: 20px; font-size: 11px; }
    .bs-plaque { top: 9px; min-width: 0; max-width: 96%; padding: 5px 12px; font-size: 14.5px; letter-spacing: 1px; white-space: nowrap; }
    .bs-plaque::before { left: 18%; }
    .bs-plaque::after { right: 18%; }
    .bs-boss { padding: 0 2px 2px; }
    .bs-boss-name { font-size: 21px; letter-spacing: 3px; }
    .bs-boss-bar { height: 19px; margin-top: 15px; }
    .bs-boss-hptext { font-size: 10px; padding-right: 7px; }
    .bs-boss-ticks i b { font-size: 9px; }
    .bs-boss-tag { font-size: 10.5px; padding: 3px 8px; margin-top: 15px; }
    .bs-cycle { gap: 6px; font-size: 10.5px; }
    .bs-cycle i { width: 96px; }
    .bs-arena { gap: 3px; padding: 4px 0 0; }
    /* 窄屏：中栏只剩「回合 N」一行字（倍速/跳过都在下面函盘里），
       留在中间会把两侧挤成 108px、人物只有 150px 高。把它挂到舞台顶上的空档，
       两侧立绘才能平分整幅；画框左右本来各有留白，立绘再各借 6px。 */
    .bs-center {
        position: absolute; top: 2px; left: 50%; transform: translateX(-50%);
        flex: 0 0 auto; width: max-content; max-width: 96%; gap: 4px;
    }
    .battle-stage.mode-series .bs-center { justify-content: flex-start; }
    /* 立绘再往外各借 6px 画框留白（负 margin 配 width:100% 只会平移不会变宽，得显式加宽） */
    .bs-artwrap { width: calc(100% + 12px); }
    .bs-round { font-size: 13px; letter-spacing: 1px; }
    .bs-round::before, .bs-round::after { margin: 0 4px; }
    .bs-banner { font-size: 12.5px; padding: 5px 14px; letter-spacing: 2px; }
    .bs-mods { display: none; }
    .bs-side { gap: 5px; }
    .bs-noart { width: clamp(72px, 15vh, 104px); height: clamp(72px, 15vh, 104px); font-size: 32px; }
    .bs-plate { --notch: 8px; }
    .bs-plate-in { gap: 5px; padding: 3px 9px; }
    .bs-stamp { width: 16px; height: 16px; font-size: 10px; }
    .bs-name { font-size: 13px; }
    .bs-realm { font-size: 10.5px; }
    .bs-mark { width: 15px; height: 15px; font-size: 9px; }
    .bs-hprow { gap: 5px; max-width: 100%; }
    .bs-blade { width: 15px; height: 15px; }
    .bs-blade .gl { width: 15px; height: 15px; }
    .bs-hp { height: 18px; }
    .bs-hp-text { font-size: 9.5px; padding-right: 7px; }
    .bs-remain { font-size: 10px; padding: 2px 7px; }
    .bs-pop span { font-size: 21px; }
    .bs-pop span.crit { font-size: 26px; }
    /* 窄屏：战报独占一行，倍速与跳过落在第二行，免得挤成一列竖排 */
    .bs-tray { gap: 8px; padding: 8px 10px; flex-wrap: wrap; }
    .bs-feed { flex: 1 1 100%; order: -1; font-size: 12.5px; gap: 6px; min-height: 30px; padding: 6px 9px; }
    .bs-speeds { order: 1; }
    .bs-crest { order: 2; flex: 1 1 auto; text-align: center; justify-content: center; font-size: 10.5px; padding: 4px 9px; }
    .bs-skip { order: 3; margin-left: auto; min-width: 66px; height: 33px; font-size: 13px; letter-spacing: 1px; }
    .bs-speed { width: 33px; height: 33px; font-size: 12.5px; }
    .bs-feed-round { font-size: 11px; }
    .bs-result-box { width: 100%; max-height: 88%; padding: 18px 16px 16px; }
    .bs-result-title { font-size: 24px; }
    .battle-stage.mode-boss .bs-side.left { flex: 0 0 32%; }
    .battle-stage.mode-boss .bs-side.right { flex: 1 1 68%; }
    .battle-stage.mode-boss .bs-noart { width: 64px; height: 64px; }
}

/* ---- 百工 · 轮回道场 ---- */
/* 行当芯片：等宽自排，点别的那一行就是转业 */
.job-chips {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px; margin-bottom: 10px;
}
.job-chip {
    display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
    padding: 6px 10px; border-radius: 10px; cursor: pointer; text-align: left;
    border: 1px solid rgba(90,70,50,0.18); background: rgba(255,255,255,0.45);
    color: var(--ink-soft); font-size: 12px; line-height: 1.35; font-family: inherit;
}
.job-chip .jc-name { font-size: 13px; font-weight: 700; color: var(--ink); }
.job-chip .jc-tag { opacity: 0.8; }
.job-chip.on { background: rgba(201,162,39,0.16); border-color: var(--gold); }
.job-chip.on .jc-name { color: var(--gold); }
.job-chip:disabled { cursor: default; }
/* 工位行：等级 + 进度条 + 距下一档，三样一行摆得下 */
.job-status {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px;
    align-items: center; font-size: 12px; color: var(--ink-soft); margin-bottom: 8px;
}
.js-lv { font-weight: 700; color: var(--ink); white-space: nowrap; }
.js-bar { height: 8px; border-radius: 6px; background: var(--paper-2); overflow: hidden; }
.js-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--bamboo), var(--gold)); }
.js-next { white-space: nowrap; }
/* 今日开的三门活：一行一门，右侧一颗开工钮 */
.job-work {
    display: grid; grid-template-columns: minmax(84px, 1fr) minmax(0, 1.6fr) 62px;
    grid-template-areas: "name out btn"; gap: 8px; align-items: center;
    padding: 8px 0; border-bottom: 1px dashed rgba(90,70,50,0.1); font-size: 13px;
}
.jw-name { grid-area: name; font-weight: 600; color: var(--ink); }
.jw-out { grid-area: out; color: var(--ink-soft); font-size: 12px; min-width: 0; }
.jw-btn { grid-area: btn; font-size: 12px; padding: 5px 0; border-radius: 12px; white-space: nowrap; }
.job-none { font-size: 12px; color: var(--ink-soft); padding: 8px 0; }
.job-note { font-size: 12px; color: var(--ink-soft); margin-top: 10px; line-height: 1.6; }

/* 道场：印记一行一枚，说明居中，胜率与动作靠右 */
.trial-status { font-size: 12px; color: var(--ink-soft); margin-bottom: 8px; }
.trial-status b { color: var(--cinnabar); }
.trial-mark {
    display: grid; grid-template-columns: 92px minmax(0, 1fr) 76px 62px;
    grid-template-areas: "head desc chance btn"; gap: 8px; align-items: center;
    padding: 8px 0; border-bottom: 1px dashed rgba(90,70,50,0.1); font-size: 13px;
}
.tm-head { grid-area: head; display: flex; align-items: baseline; gap: 5px; min-width: 0; }
.tm-name { font-weight: 700; color: var(--ink); white-space: nowrap; }
.tm-held { color: var(--ink-soft); font-size: 12px; font-variant-numeric: tabular-nums; }
.tm-desc {
    grid-area: desc; color: var(--ink-soft); font-size: 12px; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tm-chance { grid-area: chance; color: var(--ink-soft); font-size: 12px; white-space: nowrap; text-align: right; }
.tm-tag {
    grid-area: btn; font-size: 12px; padding: 3px 8px; border-radius: 10px; text-align: center;
    background: rgba(90,70,50,0.08); color: var(--ink-soft);
}
.tm-btn { grid-area: btn; font-size: 12px; padding: 5px 0; border-radius: 12px; white-space: nowrap; }
.trial-mark.full .tm-name { color: var(--gold); }
.trial-note { font-size: 12px; color: var(--ink-soft); margin-top: 10px; line-height: 1.6; }

/* ---- 立言·道藏 ---- */
/* 芯片行：价格、手里、落笔后余、距破境、今日笔数、污稿概率、残页 —— 落笔决策全在这几个数上 */
.ts-chips {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 6px; margin-bottom: 10px;
}
.ts-chip {
    display: flex; align-items: baseline; gap: 5px; min-width: 0; padding: 5px 9px;
    border-radius: 10px; border: 1px solid rgba(90, 70, 50, 0.18);
    background: rgba(255, 255, 255, 0.45); font-size: 12px; color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ts-chip b { font-weight: 700; color: var(--cinnabar); }
.ts-chip i { font-style: normal; opacity: 0.78; }
/* 烧完就跌破破境线的那一格改朱砂描边：数字照常明牌，只把「这一笔会拖慢破境」说出声 */
.ts-chip.risk { border-color: rgba(176, 58, 46, 0.45); background: rgba(176, 58, 46, 0.06); }
.ts-sub {
    font-size: 13px; color: var(--ink-soft); margin: 14px 0 8px; font-weight: 600;
}
.ts-sub:first-of-type { margin-top: 0; }
.ts-sub span { color: var(--cinnabar); font-variant-numeric: tabular-nums; }
/* 七卷一行一枚：第二行永远占位（已成/缺 与点定按钮同高），按钮出现时别的卷不动 */
.ts-vols {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 6px;
}
.ts-vol {
    display: grid; grid-template-rows: auto 26px; gap: 4px; justify-items: center;
    padding: 7px 4px 5px; border-radius: 12px; text-align: center;
    border: 1px solid rgba(90, 70, 50, 0.18); background: rgba(255, 255, 255, 0.4);
}
.ts-vol.got { border-color: var(--gold); background: rgba(201, 162, 39, 0.14); }
.ts-vol-name { font-size: 12px; font-weight: 700; color: var(--ink); }
.ts-vol.got .ts-vol-name { color: var(--gold); }
.ts-vol-miss { font-size: 12px; color: var(--ink-soft); }
.ts-vol-btn { width: 100%; font-size: 11px; padding: 4px 0; border-radius: 10px; }
/* 落笔按钮独占一行，宽度不随芯片行数变 */
.ts-act { margin-top: 12px; }
.ts-act .btn { width: 100%; }
.ts-rule { font-size: 12px; color: var(--ink-soft); margin-top: 10px; line-height: 1.6; }
.ts-books { margin-top: 4px; }
/* 七部一览：部名 / 效果 / 状态，状态列固定占位，写成「已立/在写/未动」时行高不变 */
.ts-book {
    display: grid; grid-template-columns: 78px minmax(0, 1fr) 52px;
    grid-template-areas: "name eff state"; gap: 8px; align-items: center;
    padding: 8px 0; border-bottom: 1px dashed rgba(90,70,50,0.1); font-size: 13px;
}
.tb-name { grid-area: name; font-weight: 700; color: var(--ink); white-space: nowrap; }
.tb-eff { grid-area: eff; color: var(--ink-soft); font-size: 12px; min-width: 0; }
.tb-state { grid-area: state; font-size: 12px; text-align: right; white-space: nowrap; color: var(--ink-soft); }
.ts-book.done .tb-name, .ts-book.done .tb-eff { color: var(--gold); }
.ts-book.done .tb-state { color: var(--bamboo); font-weight: 700; }
.ts-book.writing .tb-state { color: var(--cinnabar); font-weight: 700; }

@media (max-width: 720px) {
    /* 窄屏：说明另起一行，名字与胜率、动作同排 */
    .trial-mark {
        grid-template-columns: minmax(0, 1fr) auto 62px;
        grid-template-areas: "head chance btn" "desc desc desc";
    }
    .job-work {
        grid-template-columns: minmax(0, 1fr) 62px;
        grid-template-areas: "name btn" "out out";
    }
    .jw-out { white-space: normal; }
    /* 四行当挤在一行里看不清，窄屏改两列 */
    .job-chips {
        grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
    }
    /* 立言：部名与状态同排，效果说明另起一行（340px 一行塞不下「灵石与灵草产出 +12%」） */
    .ts-book {
        grid-template-columns: minmax(0, 1fr) 52px;
        grid-template-areas: "name state" "eff eff";
    }
    .tb-eff { white-space: normal; line-height: 1.5; }
}

/* ---- 行当：三张整卡并排，规则差异写在牌面上 ---- */
.pro-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pro-btn {
    text-align: left; font: inherit; cursor: pointer; transition: all 0.15s;
    border: 1px solid rgba(90,70,50,0.18); border-radius: 12px;
    background: rgba(255,255,255,0.5); padding: 10px 12px;
}
.pro-btn:hover { border-color: var(--gold); }
.pro-btn .pname { font-size: 15px; font-weight: 700; color: var(--ink); }
.pro-btn .ptag { font-size: 11px; color: var(--cinnabar); margin-left: 6px; white-space: nowrap; }
.pro-btn .pperk { font-size: 12px; color: var(--bamboo-2); margin-top: 4px; line-height: 1.4; }
.pro-btn .pdesc { font-size: 12px; color: var(--ink-soft); margin-top: 4px; line-height: 1.4; }
.pro-btn.on { border-color: var(--gold); background: rgba(201,162,39,0.16); cursor: default; }
.pro-btn.on .pname { color: var(--gold); }
.pro-current { margin-top: 10px; font-size: 12px; color: var(--ink-soft); line-height: 1.6; }

/* ---- 开炉炼药：规则一行（成率 + 余炉 + 三味药材），配方沿用丹炉那张的行形状 ---- */
.furnace-rules { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.fr-lead { font-size: 12px; color: var(--ink-soft); white-space: nowrap; cursor: help; }
.fr-lead b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.fr-mat {
    display: inline-flex; align-items: center; gap: 5px; font-size: 12px; line-height: 1;
    padding: 5px 9px; border-radius: 999px; cursor: help; white-space: nowrap;
    border: 1px solid rgba(74,124,89,0.4); background: rgba(74,124,89,0.09); color: var(--bamboo-2);
}
.fr-mat b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.fr-mat.blank { border-color: rgba(90,70,50,0.22); background: none; color: rgba(92,85,75,0.6); }
.fr-mat.blank b { color: rgba(92,85,75,0.6); }
span.ic.fr-ic { width: 14px; height: 14px; }
/* 药力行：与丹方名同一行，只说「吃了值多少」，不铺开算法 */
.fr-buff {
    font-size: 11px; line-height: 1; padding: 3px 7px; margin-left: 6px; border-radius: 8px;
    vertical-align: 2px; white-space: nowrap; cursor: help;
    border: 1px solid rgba(201,162,39,0.5); color: var(--gold); background: rgba(201,162,39,0.08);
}
.furnace-list { display: flex; flex-direction: column; gap: 10px; }

/* ---- 药力库存：一行一句结论（此刻挂着哪枚、还剩多久），丹与服用口同排 ---- */
.pill-stock { margin-top: 12px; }
.ps-head { font-size: 12px; color: var(--ink-soft); margin-bottom: 8px; line-height: 1.6; }
.ps-head b { color: var(--cinnabar); font-weight: 700; }
.ps-rem { font-variant-numeric: tabular-nums; }
.ps-list { display: flex; flex-wrap: wrap; gap: 8px; }
.ps-item {
    display: inline-flex; align-items: center; gap: 6px; font-size: 13px; line-height: 1;
    padding: 5px 8px; border-radius: 12px; white-space: nowrap;
    border: 1px solid rgba(90,70,50,0.16); background: rgba(255,255,255,0.5);
}
.ps-item.blank { opacity: 0.6; }
.ps-item.blank .ps-take { pointer-events: none; }
span.ic.ps-ic { width: 18px; height: 18px; }
.ps-num { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.ps-take { font-size: 12px; padding: 4px 10px; border-radius: 10px; }

@media (max-width: 720px) {
    /* 三行当并排读不清，窄屏改一列 */
    .pro-grid { grid-template-columns: 1fr; }
    /* 地数最多四块：窄屏两列才不会把 3+1 挤成孤零零一块 */
    .field-plots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .fr-buff { display: block; margin-left: 0; margin-top: 4px; }
}
