:root {
    --ink-bg: #030406; --ink-panel: rgba(12, 16, 20, 0.85);
    --jade-green: #00e676; --antique-gold: #d4af37; --bronze-border: #4a4031;
    --text-main: #e0e0e0; --text-muted: #5e6b73; --alert-red: #ff3b30;
    --tier-0: #889299; --tier-1: #4caf50; --tier-2: #2196f3; --tier-3: #9c27b0; --tier-4: #e8c76b;
    --tier-5: #ff5252; --tier-6: #ff4081;
    --app-vh: 100vh;
    --top-bar-total: calc(62px + env(safe-area-inset-top, 0px));
    /* 层级：全屏(坊市/造化等) ≤ --z-fullscreen-top；任意弹窗须高于全屏；抽卡结果/翻牌在其上；法宝阁已满等须高于翻牌；法宝详情再其上；系统提示/二次确认最前（引导等特殊层除外） */
    --z-fullscreen-top: 9940;
    --z-modal-over-fullscreen: 9980;
    /** 洞府内二次弹窗（如造化丹房·炼制修为丹），须高于 #cave-module-modal */
    --z-modal-over-cave: 9992;
    --z-gacha-result: 10060;
    --z-gacha-flip: 10062;
    --z-fabao-bag-full-modal: 10068;
    --z-item-detail: 10070;
    --z-dialog-confirm: 10150;
    --z-toast: 10180;
}

*::-webkit-scrollbar { display: none; }
* { scrollbar-width: none; }
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0; padding: 0; background-color: #000;
    font-family: 'STKaiti', 'KaiTi', '华文楷体', serif;
    color: var(--text-main); overflow: hidden; user-select: none; -webkit-tap-highlight-color: transparent;
    display: flex; justify-content: center; align-items: center;
}

#mobile-wrapper {
    position: relative; width: 100%; max-width: 480px;
    height: var(--app-vh, 100vh);
    min-height: var(--app-vh, 100vh);
    max-height: var(--app-vh, 100vh);
    background: radial-gradient(circle at center, #0a0f14 0%, var(--ink-bg) 100%);
    overflow: hidden; box-shadow: 0 0 50px rgba(0, 0, 0, 0.9);
}

#gameCanvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; transition: opacity 0.3s ease; opacity: 0; }
#panel-combat.active ~ #gameCanvas { opacity: 1; pointer-events: auto; }

#flash-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 2; background: #fff; opacity: 0; pointer-events: none; transition: opacity 0.1s; }

.toast-msg {
    position: absolute; top: 20%; left: 50%; transform: translate(-50%, -50%) scale(0.8);
    background: rgba(5, 8, 10, 0.95); border: 1px solid var(--antique-gold);
    color: #fff; padding: 12px 20px; border-radius: 6px; z-index: var(--z-toast, 10180);
    opacity: 0; pointer-events: none; font-size: 14px; text-align: center;
    max-width: min(340px, 88vw); white-space: normal; word-break: break-word; line-height: 1.45;
    font-weight: bold; box-shadow: 0 5px 20px rgba(0,0,0,0.9); letter-spacing: 0.5px;
    transition: opacity 0.2s ease-out, transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.toast-msg.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
/* 底栏上方：祭出法宝点槽位等提示，避免挡住灵枢槽 */
.toast-msg.toast--bottom {
    top: auto;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%) scale(0.8);
}
.toast-msg.toast--bottom.show { transform: translateX(-50%) scale(1); }
/* 顶栏下方：需避让 HUD 时用 */
.toast-msg.toast--top {
    top: calc(var(--top-bar-total) + 12px);
    transform: translateX(-50%) scale(0.8);
}
.toast-msg.toast--top.show { transform: translateX(-50%) scale(1); }

.modal-wrapper {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.85);
    display: none; justify-content: center; align-items: center; backdrop-filter: blur(5px);
}
/* 全屏遮罩命中层：flex 留白、底栏「点击空白处关闭」::after（pointer-events:none）等区域在部分 WebView 会点穿到底层 UI */
.modal-wrapper::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    background: rgba(0, 0, 0, 0.02);
    pointer-events: auto;
}
.modal-wrapper > .modal-content,
.modal-wrapper > .dialog-box {
    position: relative;
    z-index: 1;
}
.dialog-box, .modal-content {
    background: linear-gradient(135deg, rgba(17,20,24,0.95) 0%, rgba(6,7,10,0.95) 100%);
    border: 1px solid var(--bronze-border); border-radius: 8px; width: 85%; padding: 25px; text-align: center;
    box-shadow: 0 15px 50px rgba(0,0,0,1), inset 0 0 20px rgba(255,255,255,0.02); box-sizing: border-box;
    max-height: min(85vh, calc(100vh - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
    touch-action: manipulation;
}
/* 中间区域滚动，标题与底部按钮始终可见 */
.modal-body-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
    text-align: inherit;
}
.modal-body-scroll--left { text-align: left; }
.modal-footer {
    flex-shrink: 0;
    margin-top: 12px;
    padding-top: 4px;
    padding-bottom: max(0px, env(safe-area-inset-bottom, 0px));
}
.dialog-confirm-actions-row {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
}
.dialog-confirm-actions-row > .btn,
.dialog-confirm-actions-row > button.btn {
    min-width: 110px;
}
.btn.btn-cancel-danger {
    border-color: #c62828;
    color: #ffcdd2;
    background: linear-gradient(180deg, #3a1818 0%, #1c0a0a 100%);
    box-shadow: 0 0 10px rgba(255, 82, 82, 0.18), 0 2px 6px rgba(0, 0, 0, 0.62);
    text-shadow: 0 0 4px rgba(255, 100, 100, 0.28);
}
/* 遮罩底部轻提示：不放在弹窗内容里 */
.modal-wrapper:not([data-backdrop-close="false"])::after{
    content: "点击空白处关闭";
    position: absolute;
    left: 50%;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    letter-spacing: 1px;
    color: rgba(224, 224, 224, 0.72);
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 6px 18px rgba(0,0,0,0.55);
    pointer-events: none;
    user-select: none;
}

/* 纳戒：固定弹窗尺寸，内容超出仅在中间滚动 */
#inventory-modal .modal-content{
    width: min(92vw, 460px) !important;
    height: min(78vh, calc(100vh - 46px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)));
    max-height: none;
}
#inventory-modal .modal-body-scroll{
    padding-right: 4px;
}
#inventory-modal #inventory-modal-container.bag-grid {
    padding: 14px 8px 18px 8px;
    gap: clamp(5px, 1.6vw, 9px);
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
}

/* 全屏场景 .shop-fullscreen / .fabao-summon-fs 等为 --z-fullscreen-top；旧版 inline z-index 低于此时由下列规则抬升 */
#tower-victory-modal.modal-wrapper,
#consumable-modal.modal-wrapper,
#inventory-modal.modal-wrapper,
#auto-smelt-modal.modal-wrapper,
#fabao-affix-compare-modal.modal-wrapper,
.cave-module-modal-wrap.modal-wrapper,
#cave-module-modal.modal-wrapper {
    z-index: var(--z-modal-over-fullscreen) !important;
}

#alchemy-cultivation-refine-modal.modal-wrapper {
    z-index: var(--z-modal-over-cave) !important;
}

/* 法宝阁已满：十连翻牌层 10062，须在其上否则继续抽取时点满背包弹窗被挡住 */
#fabao-bag-full-modal.modal-wrapper {
    z-index: var(--z-fabao-bag-full-modal) !important;
}

/* 法宝 / 残魂详情：须高于恭喜获得/翻牌(10060–10062)，否则造化寻宝内点详情被全屏与抽卡层挡住 */
.item-modal-host.modal-wrapper {
    z-index: var(--z-item-detail) !important;
    pointer-events: auto;
    isolation: isolate;
}

/* 法宝详情打开时，或任意弹窗点遮罩关闭后的 420ms 内：切断下层命中（与 inventory 延迟解除同一套属性，避免合成 click 穿透）
 * 注意：仅给父节点 pointer-events:none 时，子元素默认 auto 仍会接点击（CSS 规范），故对全屏/面板等需加 * 或具体子层 */
#mobile-wrapper[data-fabao-item-modal-open] .panel,
#mobile-wrapper[data-fabao-item-modal-open] .panel *,
#mobile-wrapper[data-fabao-item-modal-open] #topBar,
#mobile-wrapper[data-fabao-item-modal-open] #topBar *,
#mobile-wrapper[data-fabao-item-modal-open] #bottomNav,
#mobile-wrapper[data-fabao-item-modal-open] #bottomNav *,
#mobile-wrapper[data-fabao-item-modal-open] #shop-fullscreen,
#mobile-wrapper[data-fabao-item-modal-open] #shop-fullscreen *,
#mobile-wrapper[data-fabao-item-modal-open] #relic-fullscreen,
#mobile-wrapper[data-fabao-item-modal-open] #relic-fullscreen *,
#mobile-wrapper[data-fabao-item-modal-open] #fabao-summon-fullscreen,
#mobile-wrapper[data-fabao-item-modal-open] #fabao-summon-fullscreen *,
#mobile-wrapper[data-fabao-item-modal-open] #fabao-refine-fullscreen,
#mobile-wrapper[data-fabao-item-modal-open] #fabao-refine-fullscreen *,
#mobile-wrapper[data-fabao-item-modal-open] #beast-scene,
#mobile-wrapper[data-fabao-item-modal-open] #beast-scene *,
#mobile-wrapper[data-fabao-item-modal-open] #gameCanvas,
#mobile-wrapper[data-fabao-item-modal-open] #task-widget,
#mobile-wrapper[data-fabao-item-modal-open] #task-widget *,
#mobile-wrapper[data-fabao-item-modal-open] #training-arena-hud,
#mobile-wrapper[data-fabao-item-modal-open] #training-arena-hud *,
#mobile-wrapper[data-fabao-item-modal-open] #training-arena-stats-panel,
#mobile-wrapper[data-fabao-item-modal-open] #training-arena-stats-panel *,
#mobile-wrapper[data-fabao-item-modal-open] #qiyu-widget,
#mobile-wrapper[data-fabao-item-modal-open] #qiyu-widget *,
#mobile-wrapper[data-fabao-item-modal-open] #gacha-result-modal,
#mobile-wrapper[data-fabao-item-modal-open] #gacha-result-grid,
#mobile-wrapper[data-fabao-item-modal-open] #gacha-result-grid *,
#mobile-wrapper[data-fabao-item-modal-open] #gacha-ten-flip-modal,
#mobile-wrapper[data-fabao-item-modal-open] #gacha-ten-flip-modal .gacha-ten-flip-bg,
#mobile-wrapper[data-fabao-item-modal-open] #gacha-ten-flip-shell,
#mobile-wrapper[data-fabao-item-modal-open] #gacha-ten-flip-shell *,
#mobile-wrapper[data-fabao-item-modal-open] #guide-dialog,
#mobile-wrapper[data-fabao-item-modal-open] #tribulation-ui,
#mobile-wrapper[data-fabao-item-modal-open] #weak-guide-finger {
    pointer-events: none !important;
}

/* 仙缘奇遇·映像厚礼与全局激励按钮样式见 style-app.css：.btn.rewarded-ad-btn */

/* 主界面服药：抽屉在 .panel 内，关遮罩时会 armModalBackdropPointerReleaseDelay()，全面板 pointer-events 被关约 420ms；
 * 若不例外，「服药」按钮与抽屉层无法收到点击，表现为关闭后偶发再也打不开（快连点时必现）。 */
#mobile-wrapper[data-fabao-item-modal-open] #btn-pill-drawer,
#mobile-wrapper[data-fabao-item-modal-open] #pill-drawer-layer,
#mobile-wrapper[data-fabao-item-modal-open] #pill-drawer-layer * {
    pointer-events: auto !important;
}

/* 全局提示与二次确认：须高于法宝详情与抽卡层 */
#custom-dialog.modal-wrapper,
#custom-confirm-dialog.modal-wrapper {
    z-index: var(--z-dialog-confirm) !important;
}

/* 天降灵宝：层级须高于纳戒、坊市/造化全屏，避免从纳戒开宝箱时结果被挡住 */
.modal-wrapper--gacha-result,
#gacha-result-modal.modal-wrapper {
    z-index: var(--z-gacha-result);
    position: fixed;
    left: 50%;
    top: 0;
    bottom: 0;
    width: min(100vw, 480px);
    max-width: 480px;
    transform: translateX(-50%);
    right: auto;
    box-sizing: border-box;
}

/* 天降灵宝：单抽/少量结果水平居中（避免 5 列网格时只占左一格、右侧留白） */
#gacha-result-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: flex-start;
    align-items: flex-start;
    gap: 8px;
    margin: 12px 0 8px;
    width: 100%;
    box-sizing: border-box;
}
#gacha-result-grid .item-slot {
    width: clamp(58px, 16vw, 72px);
    flex: 0 0 auto;
    max-width: 20%;
    box-sizing: border-box;
    min-height: 0;
}

.modal-content--obtain-reward .obtain-reward-title {
    color: var(--tier-4);
    font-size: 24px;
    text-shadow: 0 0 10px var(--tier-4);
    margin-bottom: 8px;
}
.obtain-reward-subtitle {
    font-size: 13px;
    color: rgba(200, 200, 200, 0.88);
    line-height: 1.55;
    margin: 0 4px 10px;
    text-align: center;
}
.modal-footer--obtain-reward {
    display: flex;
    justify-content: center;
}
.modal-footer--obtain-reward .btn-obtain-accept {
    padding: 10px 36px;
    width: auto;
    min-width: 120px;
    max-width: 200px;
    box-sizing: border-box;
    margin: 0 auto;
    display: block;
}

.modal-header-fixed {
    flex-shrink: 0;
}
.modal-content > .dialog-title,
.dialog-box > .dialog-title {
    flex-shrink: 0;
}
.dialog-title { color: var(--antique-gold); font-size: 20px; font-weight: bold; margin-bottom: 15px; letter-spacing: 2px; text-shadow: 0 2px 4px #000; }
.modal-header-fixed .dialog-title { margin-bottom: 10px; }
.dialog-content { color: var(--text-main); font-size: 14px; margin-bottom: 0; line-height: 1.6; }
.modal-body-scroll > .dialog-content:not(:last-child) { margin-bottom: 16px; }

/* ========== 修士属性弹窗（更清爽的分组排版） ========== */
.modal-content--stats {
    width: 88%;
    text-align: left;
    padding: 18px 16px 16px;
}
.dialog-title--center { text-align: center; }
.btn-full { width: 100%; box-sizing: border-box; }

.stats-sheet {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.22) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px;
    box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.55);
}
.stats-section + .stats-section { margin-top: 12px; }
.stats-section-title {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--antique-gold);
    color: color-mix(in srgb, var(--antique-gold) 92%, #fff);
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.18);
    border-radius: 999px;
    padding: 6px 10px;
    margin: 2px 0 10px;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
}
.stats-grid--onecol { grid-template-columns: 1fr; }
@media (max-width: 380px) {
    .stats-grid { grid-template-columns: 1fr; }
}
.stats-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.stats-label {
    font-size: 12px;
    color: rgba(224, 224, 224, 0.82);
    white-space: nowrap;
    min-width: 0;
    letter-spacing: 0.5px;
}
.stats-value {
    font-size: 13px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-variant-numeric: tabular-nums;
    /* 数值统一颜色，避免五颜六色显得花 */
    color: rgba(244, 236, 208, 0.92);
    white-space: nowrap;
    text-align: right;
}
@media (max-width: 420px) {
    .stats-item { gap: 6px; }
    .stats-label { white-space: normal; line-height: 1.3; }
    .stats-value { font-size: 12px; }
}
.stats-value--muted { color: rgba(244, 236, 208, 0.72); }
.stats-value--hp,
.stats-value--atk,
.stats-value--def,
.stats-value--crit,
.stats-value--life,
.stats-value--reflect,
.stats-value--exp { color: rgba(244, 236, 208, 0.92); }

.stats-value--elem { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }
.stats-slash { opacity: 0.45; padding: 0 6px; }
.stats-plus { opacity: 0.55; padding-right: 2px; }

.stats-resonance {
    font-size: 11px;
    color: rgba(224, 224, 224, 0.62);
    line-height: 1.5;
    padding: 10px 10px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px dashed rgba(255, 255, 255, 0.12);
}
.stats-res-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 0 0 8px;
}
.stats-res-row:last-child { margin-bottom: 0; }
.stats-res-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: rgba(212, 175, 55, 0.95);
    background: rgba(212, 175, 55, 0.09);
    border: 1px solid rgba(212, 175, 55, 0.18);
    padding: 2px 8px;
    border-radius: 999px;
    flex-shrink: 0;
}
.stats-res-name { color: rgba(224, 224, 224, 0.62); }
.stats-muted { color: rgba(224, 224, 224, 0.45); }

.stats-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-input {
    width: 100%; padding: 12px; background: rgba(0,0,0,0.5); border: 1px solid var(--bronze-border);
    color: #fff; border-radius: 4px; box-sizing: border-box; outline: none; font-size: 14px; text-align: center; font-family: sans-serif;
}
.auth-input:focus { border-color: var(--jade-green); box-shadow: inset 0 0 5px rgba(0,230,118,0.3); }

#guide-dialog {
    position: absolute; bottom: 85px; left: 10px; right: 10px;
    background: linear-gradient(135deg, rgba(10, 20, 15, 0.95) 0%, rgba(5, 10, 8, 0.95) 100%);
    border: 1px solid var(--jade-green); border-radius: 8px; padding: 12px 15px;
    z-index: 10080; display: flex; align-items: center; gap: 12px;
    box-shadow: 0 5px 20px rgba(0, 230, 118, 0.2), inset 0 0 10px rgba(0,230,118,0.1);
    transition: opacity 0.3s, top 0.4s ease, bottom 0.4s ease, transform 0.15s, border-color 0.15s;
    max-height: none;
    overflow: visible;
}

.system-intro-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10077;
    background: rgba(2, 4, 8, 0.5);
    pointer-events: auto;
}
.system-intro-spotlight {
    display: none;
    position: absolute;
    left: 0;
    top: 0;
    width: 10px;
    height: 10px;
    border-radius: 10px;
    z-index: 10079;
    pointer-events: none;
    box-shadow: 0 0 0 9999px rgba(2, 4, 8, 0.48), 0 0 0 2px rgba(100, 200, 255, 0.95), 0 0 24px rgba(100, 200, 255, 0.35);
    transition: left 0.16s ease, top 0.16s ease, width 0.16s ease, height 0.16s ease, border-radius 0.16s ease;
}
.system-intro-floating-pointer {
    display: none;
    position: absolute;
    left: 0;
    top: 0;
    z-index: 10088;
    pointer-events: none;
    font-size: 28px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.9));
    animation-duration: 0.55s;
    animation-iteration-count: infinite;
    animation-direction: alternate;
    animation-timing-function: ease-in-out;
}
.system-intro-floating-pointer[data-dir="down"] {
    animation-name: guideFloatPointerDown;
}
.system-intro-floating-pointer[data-dir="up"] {
    animation-name: guideFloatPointerUp;
}
.system-intro-target {
    position: relative;
    z-index: 10086 !important;
    pointer-events: auto !important;
    box-shadow: 0 0 0 2px rgba(120, 210, 255, 0.95), 0 0 16px rgba(100, 200, 255, 0.45) !important;
    animation: systemIntroPulse 1s infinite alternate !important;
    overflow: visible !important;
}
.system-intro-target-passive {
    pointer-events: auto !important;
    box-shadow: 0 0 0 1px rgba(120, 210, 255, 0.45) !important;
}
@keyframes systemIntroPulse {
    from {
        transform: scale(1);
        filter: brightness(1);
    }
    to {
        transform: scale(1.03);
        filter: brightness(1.15);
    }
}
.system-intro-dialog {
    position: absolute;
    bottom: 85px;
    left: 10px;
    right: 10px;
    background: linear-gradient(135deg, rgba(12, 22, 28, 0.97) 0%, rgba(6, 12, 14, 0.97) 100%);
    border: 1px solid rgba(100, 200, 255, 0.55);
    border-radius: 8px;
    padding: 12px 15px;
    z-index: 10082;
    display: none;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 6px 24px rgba(80, 180, 255, 0.2), inset 0 0 12px rgba(100, 200, 255, 0.08);
    max-height: min(42vh, 300px);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transition: top 0.25s ease, bottom 0.25s ease;
}
/* 顶栏锚定：高亮区在屏幕下半时上移对话框，避免挡住修炼区/开关等（panel-main 有 isolation，子元素 z-index 无法压过本框） */
.system-intro-dialog.system-intro-dialog--anchor-top {
    max-height: min(38vh, 280px);
    bottom: auto;
}
.system-intro-dialog .guide-title {
    color: rgba(120, 210, 255, 0.95);
}
.system-intro-headline {
    font-size: 14px;
    font-weight: 700;
    color: #e8f4ff;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}
#system-intro-desc {
    white-space: pre-line;
}
.system-intro-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
    align-self: flex-end;
}
.system-intro-skip-btn {
    border: none;
    background: transparent;
    font: inherit;
    font-size: 11px;
    color: rgba(160, 180, 200, 0.65);
    text-decoration: underline;
    cursor: pointer;
    padding: 5px;
}
.system-intro-skip-btn:active {
    opacity: 0.85;
}
.system-intro-next.guide-skip {
    border: none;
    background: transparent;
    font: inherit;
    color: rgba(120, 210, 255, 0.9);
    text-decoration: underline;
    cursor: pointer;
    padding: 5px;
    flex-shrink: 0;
}
.system-intro-next.guide-skip:active {
    opacity: 0.85;
}
#guide-lock-mask {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(2, 4, 8, 0.6);
    z-index: 9996;
    pointer-events: none;
}
#mobile-wrapper[data-guide-lock] #guide-lock-mask {
    display: block;
}
#mobile-wrapper[data-guide-spotlight] #guide-lock-mask {
    display: none;
}
#guide-spotlight {
    display: none;
    position: absolute;
    left: 0;
    top: 0;
    width: 10px;
    height: 10px;
    border-radius: 10px;
    z-index: 9998;
    pointer-events: none;
    box-shadow: 0 0 0 9999px rgba(2, 4, 8, 0.48), 0 0 0 2px rgba(0, 230, 118, 0.95), 0 0 24px rgba(0, 230, 118, 0.38);
    transition: left 0.16s ease, top 0.16s ease, width 0.16s ease, height 0.16s ease, border-radius 0.16s ease;
}
#guide-floating-pointer {
    display: none;
    position: absolute;
    left: 0;
    top: 0;
    z-index: 10090;
    pointer-events: none;
    font-size: 28px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.9));
    animation-duration: 0.55s;
    animation-iteration-count: infinite;
    animation-direction: alternate;
    animation-timing-function: ease-in-out;
}
#guide-floating-pointer[data-dir="down"] {
    animation-name: guideFloatPointerDown;
}
#guide-floating-pointer[data-dir="up"] {
    animation-name: guideFloatPointerUp;
}
@keyframes guideFloatPointerDown {
    from { transform: translate(-50%, -100%); }
    to { transform: translate(-50%, calc(-100% - 10px)); }
}
@keyframes guideFloatPointerUp {
    from { transform: translate(-50%, 0); }
    to { transform: translate(-50%, 10px); }
}
/* 顶栏锚定：给下方留出单次寻宝/翻牌/行囊等操作区 */
#guide-dialog.guide-dialog--anchor-top {
    max-height: min(38vh, 280px);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    align-items: flex-start;
}
.guide-avatar {
    width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--jade-green);
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="%230a1a15"/><text x="50" y="60" font-size="30" fill="%2300e676" text-anchor="middle" font-family="serif">仙</text></svg>') center/cover;
    box-shadow: 0 0 10px var(--jade-green); flex-shrink: 0;
}
.guide-text { font-size: 13px; color: #fff; line-height: 1.55; text-shadow: 0 1px 2px #000; flex: 1; min-width: 0; }
#guide-desc { white-space: pre-line; }
.guide-title { font-weight: bold; color: var(--jade-green); font-size: 13px; margin-bottom: 2px; }
.guide-progress { font-size: 10px; color: var(--text-muted); letter-spacing: 0.5px; margin-bottom: 6px; }
.guide-skip { font-size: 11px; color: #666; cursor: pointer; text-decoration: underline; padding: 5px; flex-shrink: 0; align-self: flex-end; }

/* 开局问道：沉浸式全黑屏旁白（移动端：安全区 + 可滚动 + dvh） */
#opening-qa-dialog {
    display: none;
    position: fixed;
    inset: 0;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    /* 高于 #login-overlay(100000)，便于进游戏后先铺满黑屏再淡出登录层 */
    z-index: 100010;
    background: #000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding:
        max(12px, env(safe-area-inset-top, 0px))
        max(14px, env(safe-area-inset-right, 0px))
        max(12px, env(safe-area-inset-bottom, 0px))
        max(14px, env(safe-area-inset-left, 0px));
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.34s ease;
    overflow: hidden;
    isolation: isolate;
    min-height: 100vh;
    min-height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    touch-action: pan-y;
}
#opening-qa-dialog.opening-qa-dialog--open {
    display: flex;
}
#opening-qa-dialog::before {
    content: '';
    position: absolute;
    inset: -20% -10%;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 45% 32%, rgba(255, 235, 170, 0.07), transparent 58%),
        radial-gradient(ellipse at 68% 70%, rgba(160, 145, 255, 0.06), transparent 62%),
        radial-gradient(ellipse at center, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.84) 68%);
    filter: blur(0.4px);
    animation: openingQaBgDrift 11s ease-in-out infinite alternate;
    z-index: 0;
}
#opening-qa-dialog::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at center, transparent 46%, rgba(0, 0, 0, 0.72) 100%),
        repeating-linear-gradient(
            0deg,
            rgba(255, 255, 255, 0.028) 0px,
            rgba(255, 255, 255, 0.028) 1px,
            transparent 2px,
            transparent 4px
        );
    mix-blend-mode: screen;
    opacity: 0.22;
    animation: openingQaFilmGrain 0.28s steps(2) infinite;
    z-index: 0;
}
#opening-qa-dialog.is-visible {
    opacity: 1;
}
.opening-qa-panel {
    width: 100%;
    max-width: min(92vw, 540px);
    position: relative;
    z-index: 1;
    padding: clamp(12px, 2vh, 22px) clamp(8px, 3vw, 16px);
    color: #eceff1;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.22s ease, transform 0.22s ease;
    box-sizing: border-box;
    flex: 0 1 auto;
    min-height: 0;
    max-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 28px);
    max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 28px);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.opening-qa-panel.is-fading-out {
    opacity: 0;
    transform: translateY(-4px);
}
.opening-qa-panel.is-fading-in {
    opacity: 0;
    transform: translateY(4px);
}
.opening-qa-question {
    font-size: clamp(17px, 2.8vh, 26px);
    line-height: 1.85;
    color: #f5f7fa;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.88), 0 0 14px rgba(255, 230, 160, 0.08);
    margin-bottom: 20px;
    white-space: pre-line;
    letter-spacing: 0.3px;
    overflow-wrap: anywhere;
    word-break: break-word;
}
.opening-qa-char {
    opacity: 0;
    display: inline-block;
    transform: translateY(2px);
    filter: blur(1.8px);
    animation: openingQaCharReveal 0.26s ease forwards;
}
.opening-qa-char--space {
    white-space: pre;
}
.opening-qa-options {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.opening-qa-options.is-hidden {
    visibility: hidden;
    opacity: 0;
    transform: translateY(5px);
}
.opening-qa-options.is-visible {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.26s ease, transform 0.26s ease;
}
.opening-qa-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    touch-action: manipulation;
    border: 1px solid rgba(255, 235, 180, 0.18);
    border-radius: 14px;
    padding: 13px 14px;
    background:
        linear-gradient(165deg, rgba(255, 245, 210, 0.12), rgba(255, 245, 210, 0.03) 35%, rgba(20, 20, 24, 0.56) 100%);
    color: #f2f2f2;
    text-align: left;
    line-height: 1.65;
    letter-spacing: 0.3px;
    cursor: pointer;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.03),
        0 8px 28px rgba(0, 0, 0, 0.46);
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    animation: openingQaOptionRise 0.35s ease both;
}
.opening-qa-option:hover,
.opening-qa-option:active {
    border-color: rgba(255, 232, 150, 0.62);
    background:
        linear-gradient(165deg, rgba(255, 240, 190, 0.2), rgba(255, 240, 190, 0.06) 35%, rgba(24, 22, 26, 0.68) 100%);
    box-shadow:
        inset 0 0 0 1px rgba(255, 250, 226, 0.15),
        0 14px 34px rgba(0, 0, 0, 0.58);
    transform: translateY(-1px);
}
.opening-qa-option:disabled {
    opacity: 0.62;
    cursor: default;
}
.opening-qa-option-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-top: 2px;
    border-radius: 999px;
    border: 1px solid rgba(255, 232, 150, 0.55);
    color: #ffe89c;
    font-size: 15px;
    font-weight: 700;
    background: radial-gradient(circle at 30% 30%, rgba(255, 238, 170, 0.28), rgba(255, 238, 170, 0.06) 52%, rgba(8, 8, 8, 0.44) 100%);
    box-shadow: inset 0 0 10px rgba(255, 238, 170, 0.12), 0 0 14px rgba(255, 238, 170, 0.16);
    flex-shrink: 0;
}
.opening-qa-option-text {
    display: block;
    flex: 1;
    min-width: 0;
    color: #f3f5f7;
    font-size: clamp(15px, 3.9vw, 17px);
    letter-spacing: 0.35px;
    overflow-wrap: anywhere;
    word-break: break-word;
}
@media (max-width: 380px) {
    .opening-qa-panel {
        max-width: 100%;
        padding-left: 10px;
        padding-right: 10px;
    }
    .opening-qa-question {
        font-size: clamp(16px, 4.2vw, 20px);
    }
}
@keyframes openingQaBgDrift {
    from { transform: scale(1) translate3d(-1.2%, -0.8%, 0); }
    to { transform: scale(1.04) translate3d(1.2%, 1%, 0); }
}
@keyframes openingQaFilmGrain {
    0% { transform: translate3d(0, 0, 0); opacity: 0.18; }
    25% { transform: translate3d(-1%, 1%, 0); opacity: 0.24; }
    50% { transform: translate3d(1%, -1%, 0); opacity: 0.2; }
    75% { transform: translate3d(-0.7%, -0.6%, 0); opacity: 0.23; }
    100% { transform: translate3d(0.8%, 0.7%, 0); opacity: 0.18; }
}
@keyframes openingQaOptionRise {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes openingQaCharReveal {
    from { opacity: 0; transform: translateY(2px); filter: blur(1.8px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* 创角流程：问答后进入，选角色 + 命名 */
#character-create-dialog {
    --character-create-bg-image: none;
    display: none;
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: 100%;
    z-index: 100011;
    background:
        radial-gradient(ellipse at 52% 22%, rgba(255, 255, 255, 0.05), transparent 46%),
        linear-gradient(180deg, #111418 0%, #07090c 72%, #040507 100%);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding:
        max(12px, env(safe-area-inset-top, 0px))
        max(12px, env(safe-area-inset-right, 0px))
        max(12px, env(safe-area-inset-bottom, 0px))
        max(12px, env(safe-area-inset-left, 0px));
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.32s ease;
    isolation: isolate;
}
#character-create-dialog.character-create-dialog--open {
    display: flex;
}
#character-create-dialog.is-visible {
    opacity: 1;
}
.character-create-panel {
    width: 100%;
    max-width: min(94vw, 560px);
    --character-create-card-width: min(74vw, 320px);
    position: relative;
    z-index: 1;
    color: #f2f4f8;
}
.character-create-stage {
    width: 100%;
}
.character-create-figure-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(8px, 3vw, 20px);
}
.character-create-arrow {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(255, 240, 190, 0.45);
    background: rgba(7, 8, 10, 0.62);
    color: #f2deb5;
    font-size: 20px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.character-create-arrow:active {
    transform: scale(0.98);
}
.character-create-figure-card {
    width: var(--character-create-card-width);
    aspect-ratio: 9 / 16;
    height: auto;
    min-height: 0;
    border-radius: 20px;
    border: 1px solid rgba(142, 156, 170, 0.42);
    background-image:
        linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 24%),
        var(--character-create-bg-image),
        linear-gradient(180deg, #1a1e24 0%, #0b0d11 100%);
    background-size: auto, cover, auto;
    background-position: center center, center center, center center;
    background-repeat: no-repeat, no-repeat, no-repeat;
    position: relative;
    overflow: hidden;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.62), inset 0 0 22px rgba(255, 255, 255, 0.03);
}
.character-create-figure-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    pointer-events: none;
    z-index: 1;
    background:
        radial-gradient(ellipse at 50% 45%, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.38) 82%),
        linear-gradient(180deg, rgba(6, 8, 12, 0.06) 0%, rgba(6, 8, 12, 0.14) 100%);
    box-shadow: inset 0 0 0 1px rgba(8, 10, 14, 0.7);
}
.character-create-poem {
    position: absolute;
    top: 34px;
    left: 18px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 3px;
    line-height: 1.3;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.72);
    user-select: none;
    pointer-events: none;
    z-index: 3;
    padding: 6px 2px;
    background: transparent;
    border-radius: 10px;
}
.character-create-figure {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: none;
    z-index: 2;
}
.character-create-figure-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    display: block;
    filter: saturate(1.06) brightness(1.03) contrast(1.02) drop-shadow(0 6px 18px rgba(0, 0, 0, 0.5));
}
.character-create-head {
    position: absolute;
    left: 50%;
    top: 26px;
    width: 52px;
    height: 52px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: radial-gradient(circle at 36% 34%, #f6e7db 0%, #d7bba8 62%, #b4937d 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.character-create-body {
    position: absolute;
    left: 50%;
    top: 68px;
    width: 132px;
    height: 258px;
    transform: translateX(-50%);
    border-radius: 58px 58px 28px 28px;
    background: linear-gradient(180deg, var(--char-main, #f2f4f8) 0%, var(--char-sub, #a9b3bf) 100%);
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.2), 0 8px 18px rgba(0, 0, 0, 0.44);
}
.character-create-weapon {
    position: absolute;
    right: 8px;
    top: 72px;
    width: 10px;
    height: 220px;
    border-radius: 999px;
    background: linear-gradient(180deg, #e9edf2 0%, #9aa4af 100%);
    transform: rotate(8deg);
    box-shadow: 0 0 10px rgba(220, 228, 240, 0.42);
}
.character-create-role-name {
    display: none;
}
.character-create-footer {
    margin-top: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}
.character-create-main-btn,
.character-create-sub-btn {
    border: none;
    border-radius: 12px;
    min-width: 128px;
    padding: 11px 20px;
    font-size: 17px;
    letter-spacing: 1px;
    cursor: pointer;
}
.character-create-main-btn {
    background: linear-gradient(180deg, #161a1f 0%, #07090c 100%);
    color: #ffe89c;
    border: 1px solid rgba(255, 232, 156, 0.58);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.48), inset 0 0 16px rgba(255, 232, 156, 0.1);
}
.character-create-main-btn:disabled {
    opacity: 0.45;
    cursor: default;
}
.character-create-sub-btn {
    background: linear-gradient(180deg, #2d3238 0%, #1a1e22 100%);
    color: rgba(228, 236, 244, 0.9);
    border: 1px solid rgba(228, 236, 244, 0.3);
}
.character-create-name-row {
    margin-top: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: var(--character-create-card-width);
    max-width: var(--character-create-card-width);
    margin-left: auto;
    margin-right: auto;
}
#character-create-name-input {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 232, 156, 0.34);
    background: rgba(0, 0, 0, 0.56);
    color: #dfece8;
    font-size: 17px;
    text-align: center;
    outline: none;
}
#character-create-random-name-btn,
.character-create-random-name-btn {
    flex: 0 0 66px;
    width: 66px;
    height: 44px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 232, 156, 0.38);
    background: linear-gradient(180deg, #14181d 0%, #07090c 100%);
    color: #f7e4a1;
    font-size: 15px;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.42);
}
#character-create-random-name-btn:active,
.character-create-random-name-btn:active {
    transform: scale(0.98);
}
#character-create-name-input::placeholder {
    color: rgba(151, 181, 172, 0.68);
}
#character-create-name-input:focus {
    border-color: rgba(255, 232, 156, 0.72);
    box-shadow: 0 0 0 2px rgba(255, 232, 156, 0.16);
}
.character-create-figure-card[data-role-style="sword"],
#character-create-figure-name[data-role-style="sword"] {
    --char-main: #f2f4f8;
    --char-sub: #cad0d8;
}
.character-create-figure-card[data-role-style="staff"],
#character-create-figure-name[data-role-style="staff"] {
    --char-main: #6f879e;
    --char-sub: #4f6274;
}

/* 天命之路 · 幽暗地窟剧情 */
.destiny-narration-root {
    position: absolute;
    inset: 0;
    z-index: 10070;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 20px;
    box-sizing: border-box;
}
.destiny-narration-text {
    color: #eceff1;
    font-size: 15px;
    line-height: 1.7;
    text-align: center;
    max-width: 340px;
    text-shadow: 0 1px 4px #000;
}
/* 与 #trials-hub[hidden] 同理：作者样式 display:flex 会盖掉 [hidden]，读档/收 UI 后仍全黑或残留剧情框 */
.destiny-narration-root[hidden],
#destiny-narration-root[hidden] {
    display: none !important;
}
.dr-abyss-room-fade {
    position: absolute;
    inset: 0;
    z-index: 10060;
    background: radial-gradient(ellipse at 50% 38%, #1a1525 0%, #050508 70%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease-in-out;
}
.dr-abyss-room-fade[hidden],
#dr-abyss-room-fade[hidden] {
    display: none !important;
}
.destiny-story-dialog {
    position: absolute;
    bottom: 88px;
    left: 10px;
    right: 10px;
    background: linear-gradient(135deg, rgba(10, 20, 15, 0.96) 0%, rgba(5, 10, 8, 0.96) 100%);
    border: 1px solid var(--jade-green);
    border-radius: 8px;
    padding: 12px 15px;
    z-index: 10072;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 5px 20px rgba(0, 230, 118, 0.18), inset 0 0 10px rgba(0, 230, 118, 0.08);
    cursor: pointer;
}
.destiny-story-dialog.destiny-story-dialog--mystery {
    border-color: #7c4dff;
    box-shadow: 0 5px 22px rgba(124, 77, 255, 0.25), inset 0 0 12px rgba(124, 77, 255, 0.12);
}
.destiny-story-dialog.destiny-story-dialog--mystery .guide-title {
    color: #b39ddb;
}
.destiny-story-dialog #destiny-story-desc {
    white-space: pre-line;
}
#destiny-story-next.guide-skip {
    border: none;
    background: transparent;
    font: inherit;
    color: #8bc34a;
}
.destiny-story-dialog[hidden],
#destiny-story-dialog[hidden] {
    display: none !important;
}
.dr-abyss-floating-ui {
    position: absolute;
    left: 0;
    right: 0;
    bottom: max(22%, 160px);
    z-index: 10062;
    pointer-events: none;
    text-align: center;
}
.dr-abyss-inject-progress-wrap {
    pointer-events: none;
    margin: 0 auto 10px;
    max-width: 288px;
    padding: 0 8px;
    box-sizing: border-box;
}
.dr-abyss-inject-progress-track {
    height: 9px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(212, 175, 55, 0.42);
    overflow: hidden;
}
.dr-abyss-inject-progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    background: linear-gradient(90deg, #6d4c41 0%, #e8c76b 55%, #ffecb3 100%);
    box-shadow: 0 0 10px rgba(255, 213, 79, 0.35);
}
.dr-abyss-interact-btn {
    pointer-events: auto;
    margin-top: 0;
}
/* 与 .destiny-story-dialog[hidden] 同理：.btn 的 display:inline-block 会盖掉 [hidden]，导致已收起仍显示「注入灵力」 */
#dr-abyss-floating-ui[hidden],
.dr-abyss-floating-ui[hidden] {
    display: none !important;
}
#dr-abyss-interact-btn[hidden],
.dr-abyss-interact-btn[hidden] {
    display: none !important;
}
.dr-abyss-interact-btn:disabled {
    opacity: 0.92;
    cursor: wait;
}
.dr-abyss-rune-banner {
    position: absolute;
    top: 118px;
    left: 12px;
    right: 12px;
    z-index: 10064;
    text-align: center;
    color: #81d4fa;
    font-size: 13px;
    font-weight: bold;
    text-shadow: 0 1px 4px #000;
}
.dr-abyss-pillar-panel {
    position: absolute;
    bottom: 150px;
    left: 10px;
    right: 10px;
    z-index: 10065;
    background: rgba(8, 12, 18, 0.94);
    border: 1px solid var(--jade-green);
    border-radius: 8px;
    padding: 10px 12px;
    pointer-events: auto;
}
.dr-abyss-pillar-panel-title {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 6px;
}
.dr-abyss-pillar-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}
.dr-pillar-btn-active {
    box-shadow: 0 0 0 1px rgba(0, 230, 180, 0.95), 0 0 16px rgba(0, 230, 180, 0.55) !important;
    border-color: rgba(0, 230, 180, 0.95) !important;
    color: #9ff7df !important;
    animation: guidePulse 0.9s infinite alternate !important;
}
.dr-abyss-rift-panel {
    position: absolute;
    bottom: 130px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10066;
    pointer-events: auto;
    text-align: center;
    min-width: 248px;
    max-width: min(94vw, 340px);
    padding: 0;
    background: transparent;
    border: none;
    filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.65));
}
.dr-abyss-rift-panel[hidden],
#dr-abyss-rift-panel[hidden] {
    display: none !important;
}
.dr-abyss-rift-panel-inner {
    background: linear-gradient(145deg, rgba(10, 18, 14, 0.97) 0%, rgba(5, 8, 12, 0.98) 100%);
    border: 1px solid var(--jade-green);
    border-radius: 8px;
    padding: 12px 14px 14px;
    box-shadow:
        0 5px 22px rgba(0, 230, 118, 0.14),
        inset 0 0 0 1px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.dr-abyss-rift-title {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--jade-green);
    margin: 0 0 6px;
    text-shadow: 0 0 12px rgba(0, 230, 118, 0.35), 0 1px 2px rgba(0, 0, 0, 0.9);
}
.dr-abyss-rift-stats {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    margin: 10px 0 12px;
    flex-wrap: wrap;
}
.dr-abyss-rift-stats-sep {
    color: rgba(94, 107, 115, 0.85);
    font-weight: bold;
    user-select: none;
}
.dr-abyss-rift-progress {
    font-size: 16px;
    font-weight: 700;
    color: #ffe7c8;
    letter-spacing: 0.06em;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.95), 0 1px 2px rgba(0, 0, 0, 0.85);
}
.dr-abyss-rift-qte-wrap {
    margin: 2px auto 0;
    width: min(100%, 300px);
    box-sizing: border-box;
}
.dr-abyss-rift-qte-track {
    position: relative;
    height: 22px;
    border-radius: 4px;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(18, 10, 14, 0.98) 0%, rgba(8, 6, 10, 0.99) 100%);
    border: 1px solid rgba(212, 175, 55, 0.42);
    box-shadow:
        inset 0 2px 10px rgba(0, 0, 0, 0.75),
        inset 0 0 0 1px rgba(0, 0, 0, 0.4);
}
.dr-abyss-rift-qte-track::before {
    content: "";
    position: absolute;
    inset: 2px;
    border-radius: 2px;
    border: 1px solid rgba(0, 230, 118, 0.08);
    pointer-events: none;
    z-index: 2;
}
.dr-abyss-rift-qte-track.dr-rift-qte-perfect-hit {
    border-color: rgba(255, 224, 130, 0.88);
    box-shadow:
        inset 0 2px 10px rgba(0, 0, 0, 0.65),
        0 0 18px rgba(255, 213, 79, 0.45),
        0 0 28px rgba(0, 230, 118, 0.22);
}
.dr-abyss-rift-qte-zone {
    position: absolute;
    top: 1px;
    bottom: 1px;
    z-index: 0;
}
.dr-abyss-rift-qte-zone-left {
    left: 25%;
    width: 15%;
    background: linear-gradient(
        90deg,
        rgba(0, 180, 130, 0.22) 0%,
        rgba(0, 230, 118, 0.32) 50%,
        rgba(0, 180, 130, 0.22) 100%
    );
    box-shadow: inset 0 0 12px rgba(0, 230, 118, 0.12);
}
.dr-abyss-rift-qte-zone-center {
    left: 40%;
    width: 20%;
    background: linear-gradient(
        90deg,
        rgba(184, 134, 11, 0.35) 0%,
        rgba(232, 199, 107, 0.55) 45%,
        rgba(255, 236, 179, 0.42) 100%
    );
    box-shadow: inset 0 0 14px rgba(255, 213, 79, 0.2);
}
.dr-abyss-rift-qte-zone-right {
    left: 60%;
    width: 15%;
    background: linear-gradient(
        90deg,
        rgba(0, 180, 130, 0.22) 0%,
        rgba(0, 230, 118, 0.32) 50%,
        rgba(0, 180, 130, 0.22) 100%
    );
    box-shadow: inset 0 0 12px rgba(0, 230, 118, 0.12);
}
.dr-abyss-rift-qte-ball {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 18px;
    margin-left: -9px;
    margin-top: -9px;
    border-radius: 50%;
    z-index: 3;
    background: radial-gradient(
        circle at 32% 28%,
        #fff8e7 0%,
        #e8c76b 28%,
        #b8860b 58%,
        #3d2914 100%
    );
    border: 1px solid rgba(255, 236, 200, 0.75);
    box-shadow:
        0 0 10px rgba(255, 213, 79, 0.55),
        0 0 20px rgba(212, 175, 55, 0.28),
        inset 0 -2px 4px rgba(0, 0, 0, 0.45);
    pointer-events: none;
}
.dr-abyss-rift-qte-ball.dr-rift-qte-perfect-hit {
    transform: scale(1.14);
    box-shadow:
        0 0 14px rgba(0, 230, 118, 0.65),
        0 0 26px rgba(255, 224, 130, 0.5),
        inset 0 -2px 4px rgba(0, 0, 0, 0.35);
}
/* 通用 QTE UI 动效类（供 qte-ui.js 复用） */
.qte-ui-perfect-hit {
    transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.dr-abyss-rift-timer {
    font-size: 12px;
    color: #c8e6d5;
    letter-spacing: 0.06em;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}
.dr-abyss-rift-tap-btn.btn {
    min-width: 132px;
    letter-spacing: 0.14em;
}

.guide-target {
    position: relative; z-index: 10002 !important; pointer-events: auto !important;
    box-shadow: 0 0 0 2px var(--jade-green), 0 0 15px var(--jade-green) !important;
    animation: guidePulse 1s infinite alternate !important;
    border-color: var(--jade-green) !important; color: var(--jade-green) !important;
    overflow: visible !important; 
}
.guide-target-passive {
    pointer-events: auto !important;
}
#mobile-wrapper[data-guide-lock] .guide-target-passive {
    pointer-events: auto !important;
}
.guide-target::before {
    content: "👇"; position: absolute; top: -35px; left: 50%; transform: translateX(-50%);
    font-size: 28px; animation: pointBounce 0.5s infinite alternate; z-index: 9001; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8)); pointer-events: none;
}
#mobile-wrapper[data-guide-lock] .guide-target::before {
    display: none;
}
@keyframes guidePulse { from { transform: scale(1); filter: brightness(1); } to { transform: scale(1.05); filter: brightness(1.3); } }
@keyframes pointBounce { from { top: -35px; } to { top: -45px; } }

/* 纳戒格子：手指改到格子下方内侧，避免被滚动区上沿裁切 */
#bag-container .item-slot.guide-target::before {
    top: auto;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
    animation: guidePointBagSlot 0.55s infinite alternate;
}
@keyframes guidePointBagSlot {
    from { bottom: 2px; opacity: 0.88; }
    to { bottom: 8px; opacity: 1; }
}

/* 灵枢待选槽：引导手指放在槽内底部，避免被卡片裁切 */
#slots-container .slot-box.slot-pick-target.guide-target {
    overflow: visible;
}
#slots-container .slot-box.slot-pick-target.guide-target::before {
    top: auto;
    bottom: 1px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 16px;
    animation: guidePointPivotSlot 0.55s infinite alternate;
}
@keyframes guidePointPivotSlot {
    from { bottom: 1px; }
    to { bottom: 5px; }
}

/* 引导第 1 步·法宝详情：仅允许祭出，其余按钮视觉弱化并屏蔽点击（与 JS 守卫双保险） */
#item-modal.guide-equip-only-footer #modal-btn-smelt,
#item-modal.guide-equip-only-footer #modal-fabao-refine-link {
    pointer-events: none !important;
    opacity: 0.32;
    filter: grayscale(0.65);
}

