/* ============================================================
 * 302 数学二 · 2D 像素大世界（PC）
 * ------------------------------------------------------------
 * 只负责「世界视口 + 浮层 UI」，人物与地形全部画在 canvas 里。
 * ============================================================ */

.world {
    position: relative;
    height: calc(100vh - 132px);
    min-height: 480px;
    overflow: hidden;
    background: #0b1220;
    border-top: 1px solid rgba(120, 170, 255, 0.10);
    border-bottom: 1px solid rgba(120, 170, 255, 0.10);
}

#worldCanvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    cursor: crosshair;
    touch-action: none;
}

/* ?world=3d：Three.js 渲染层铺满世界区域，HUD 仍在上层 */
.world3d-canvas {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    touch-action: none;
}

/* 3D 场景上的 2D 覆盖层：NPC 名牌 / 待机气泡 / 玩家气场，不接收鼠标 */
.world3d-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: block;
    pointer-events: none;
}

/* ---------- 左上角：当前营地 ---------- */
.world-hud {
    position: absolute;
    top: 14px;
    left: 16px;
    right: 16px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    pointer-events: none;
    z-index: 3;
}

.world-area {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 9px 14px;
    border-radius: 10px;
    background: rgba(8, 14, 26, 0.78);
    border: 1px solid rgba(125, 211, 252, 0.28);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
    min-width: 210px;
}

.world-area b {
    font-size: 14px;
    letter-spacing: 0.5px;
    color: #e2f2ff;
}

.world-area span {
    font-size: 11.5px;
    color: #8aa0c4;
    font-variant-numeric: tabular-nums;
}

/* ---------- 右上角：小地图 ---------- */
.world-mini-wrap {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

#worldMini {
    width: 190px;
    height: 122px;
    display: block;
    border-radius: 10px;
    border: 1px solid rgba(125, 211, 252, 0.32);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
    image-rendering: pixelated;
    cursor: pointer;
    opacity: 0.94;
    transition: opacity 0.18s, transform 0.18s;
}

#worldMini:hover {
    opacity: 1;
    transform: translateY(-1px);
}

.world-mini-wrap .mini-tip {
    font-size: 10.5px;
    font-style: normal;
    color: #7d92b5;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

/* ---------- 任务面板 ---------- */
.quest-box {
    position: absolute;
    top: 122px;
    left: 16px;
    z-index: 3;
    width: 316px;
    padding: 10px 12px 12px;
    border-radius: 12px;
    background: rgba(8, 14, 26, 0.82);
    border: 1px solid rgba(120, 170, 255, 0.22);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
}

.quest-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 7px;
    margin-bottom: 6px;
    border-bottom: 1px solid rgba(120, 170, 255, 0.14);
    font-size: 12.5px;
    font-weight: 700;
    color: #dce9ff;
}

.quest-head i {
    font-size: 10.5px;
    font-style: normal;
    font-weight: 400;
    color: #6f86a8;
}

.quest-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.q-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 8px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #c3d4ef;
    text-align: left;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.q-row:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(120, 170, 255, 0.22);
}

.q-row.tracked {
    background: rgba(251, 191, 36, 0.09);
    border-color: rgba(251, 191, 36, 0.42);
}

.q-chip {
    flex: 0 0 auto;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.q-row.main .q-chip {
    color: #fde68a;
    background: rgba(251, 191, 36, 0.16);
    border: 1px solid rgba(251, 191, 36, 0.38);
}

.q-row.side .q-chip {
    color: #7dd3fc;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.32);
}

.q-row.zt .q-chip {
    color: #c4b5fd;
    background: rgba(167, 139, 250, 0.14);
    border: 1px solid rgba(167, 139, 250, 0.36);
}

.q-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.q-body b {
    font-size: 12px;
    color: #f1f7ff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.q-body em {
    font-size: 10.5px;
    font-style: normal;
    color: #8aa0c4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.q-dist {
    flex: 0 0 auto;
    font-size: 10.5px;
    color: #6f86a8;
    font-variant-numeric: tabular-nums;
}

.q-done {
    padding: 8px 4px;
    font-size: 11.5px;
    color: #7d92b5;
    text-align: center;
}

/* ---------- 缩放控件 ---------- */
.world-zoom {
    position: absolute;
    right: 16px;
    bottom: 14px;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 6px;
    border-radius: 10px;
    background: rgba(8, 14, 26, 0.82);
    border: 1px solid rgba(120, 170, 255, 0.24);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
}

.world-zoom button {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(120, 170, 255, 0.18);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.05);
    color: #dce9ff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    transition: background 0.15s, border-color 0.15s;
}

.world-zoom button:hover {
    background: rgba(125, 211, 252, 0.16);
    border-color: rgba(125, 211, 252, 0.45);
}

#worldZoomVal {
    min-width: 42px;
    text-align: center;
    font-size: 11px;
    color: #8aa0c4;
    font-variant-numeric: tabular-nums;
}

/* ---------- 左上角：营地 + 天气/坐骑 ---------- */
.world-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.world-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.world-chips span {
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(8, 14, 26, 0.74);
    border: 1px solid rgba(120, 170, 255, 0.18);
    font-size: 11px;
    color: #9db2d6;
    white-space: nowrap;
}

/* ============================================================
 * 坐骑 / 皮肤
 * ============================================================ */
.gear-mask {
    position: fixed;
    inset: 0;
    z-index: 190;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(4, 10, 8, 0.86);
    backdrop-filter: blur(8px);
}

.gear-mask.show { display: flex; }

.gear-panel {
    width: min(1020px, 96vw);
    height: min(700px, 92vh);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(23, 40, 31, 0.99), rgba(10, 20, 16, 0.99));
    border: 2px solid rgba(214, 178, 106, 0.45);
    box-shadow: 0 34px 90px rgba(0, 0, 0, 0.75), 0 0 60px rgba(52, 211, 153, 0.12);
    animation: pop 0.2s ease-out;
}

.gear-head {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(214, 178, 106, 0.26);
    background: linear-gradient(90deg, rgba(52, 211, 153, 0.14), rgba(251, 191, 36, 0.06), transparent);
}

.gear-title {
    font-size: 16px;
    font-weight: 800;
    color: #f3ecd8;
    letter-spacing: 1px;
    white-space: nowrap;
}

.gear-tabs {
    display: flex;
    gap: 6px;
    flex: 1;
}

.gear-tab {
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(214, 178, 106, 0.22);
    background: rgba(255, 255, 255, 0.04);
    color: #b9cbbf;
    font-size: 12px;
    font-weight: 600;
}

.gear-tab:hover { background: rgba(52, 211, 153, 0.12); color: #d9f3e2; }

.gear-tab.active {
    background: rgba(52, 211, 153, 0.16);
    border-color: rgba(52, 211, 153, 0.55);
    color: #a7f3d0;
}

.gear-frag {
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(251, 191, 36, 0.4);
    background: rgba(251, 191, 36, 0.1);
    font-size: 11.5px;
    font-weight: 700;
    color: #fcd34d;
    white-space: nowrap;
}

.gear-body {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 360px 1fr;
}

.gear-grid {
    overflow-y: auto;
    padding: 14px;
    border-right: 1px solid rgba(214, 178, 106, 0.2);
    background: rgba(0, 0, 0, 0.18);
}

.gear-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 11px;
    margin-bottom: 7px;
    text-align: left;
    border-radius: 10px;
    border: 1px solid rgba(214, 178, 106, 0.16);
    background: rgba(255, 255, 255, 0.03);
    color: #dce9ff;
    transition: all 0.15s;
}

.gear-card:hover {
    background: rgba(52, 211, 153, 0.08);
    border-color: rgba(52, 211, 153, 0.4);
}

.gear-card.equipped {
    border-color: rgba(251, 191, 36, 0.6);
    background: rgba(251, 191, 36, 0.08);
}

.gear-card.locked { opacity: 0.55; }

.gear-card.c-rare { border-color: rgba(56, 189, 248, 0.35); }
.gear-card.c-legend {
    border-color: rgba(251, 191, 36, 0.55);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(255, 255, 255, 0.03));
}

.gear-ico {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.24);
    font-size: 18px;
}

.gear-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gear-info b {
    font-size: 12.5px;
    color: #f1f7ff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gear-info em {
    font-size: 10.5px;
    font-style: normal;
    color: #8aa0c4;
}

.gear-flag {
    flex: 0 0 auto;
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 9.5px;
    font-weight: 800;
    color: #10231a;
    background: #fbbf24;
}

.gear-detail {
    overflow-y: auto;
    padding: 22px 24px;
}

.gear-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    margin-bottom: 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(52, 211, 153, 0.05));
    border: 1px solid rgba(214, 178, 106, 0.35);
}

.gear-hero-ico {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(251, 191, 36, 0.26);
}

.gear-hero-name {
    font-size: 20px;
    font-weight: 800;
    color: #fdf6e3;
}

.gear-hero-sub {
    margin-top: 3px;
    font-size: 11.5px;
    color: #9eb5a6;
}

.gear-desc {
    padding: 12px 14px;
    margin-bottom: 12px;
    border-left: 3px solid rgba(52, 211, 153, 0.6);
    border-radius: 0 8px 8px 0;
    background: rgba(52, 211, 153, 0.05);
    font-size: 13px;
    line-height: 1.8;
    color: #d8e6dc;
}

.gear-req {
    padding: 10px 12px;
    margin-bottom: 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(120, 170, 255, 0.12);
    font-size: 12px;
    color: #b9cbbf;
}

.skin-rarity {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    vertical-align: 2px;
}

.skin-rarity.c-common { color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.4); }
.skin-rarity.c-rare { color: #7dd3fc; border: 1px solid rgba(56, 189, 248, 0.5); background: rgba(56, 189, 248, 0.1); }
.skin-rarity.c-legend { color: #fde68a; border: 1px solid rgba(251, 191, 36, 0.55); background: rgba(251, 191, 36, 0.12); }

/* ---------- 底部操作提示 ---------- */
.world-hint {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    z-index: 3;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(8, 14, 26, 0.72);
    border: 1px solid rgba(120, 170, 255, 0.18);
    color: #9db2d6;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    backdrop-filter: blur(4px);
}

.world-hint b {
    color: #fbbf24;
}

/* ---------- 靠近角色时的交互条 ---------- */
.world-prompt {
    position: absolute;
    left: 50%;
    bottom: 52px;
    transform: translateX(-50%) translateY(6px);
    z-index: 4;
    padding: 9px 18px;
    border-radius: 10px;
    background: rgba(10, 16, 30, 0.92);
    border: 1px solid rgba(251, 191, 36, 0.55);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 18px rgba(251, 191, 36, 0.14);
    color: #e8f1ff;
    font-size: 13px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.16s, transform 0.16s;
}

.world-prompt:not([hidden]) {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.world-prompt b {
    color: #fde68a;
}

.world-prompt kbd {
    display: inline-block;
    padding: 1px 7px;
    margin-right: 4px;
    border-radius: 5px;
    background: rgba(251, 191, 36, 0.16);
    border: 1px solid rgba(251, 191, 36, 0.45);
    color: #fcd34d;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
}

/* ---------- 生成中 ---------- */
.world-loading {
    position: absolute;
    inset: 0;
    z-index: 8;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0b1220;
    color: #9db2d6;
    font-size: 14px;
    letter-spacing: 2px;
    transition: opacity 0.45s;
}

.world-loading.off {
    opacity: 0;
    pointer-events: none;
}

/* ============================================================
 * 背包 / 秘籍 / 公式速查
 * ============================================================ */
.bag-mask {
    position: fixed;
    inset: 0;
    z-index: 190;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(4, 10, 8, 0.86);
    backdrop-filter: blur(8px);
}

.bag-mask.show { display: flex; }

.bag-panel {
    width: min(1120px, 96vw);
    height: min(780px, 92vh);
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(23, 40, 31, 0.99), rgba(10, 20, 16, 0.99));
    border: 2px solid rgba(214, 178, 106, 0.45);
    box-shadow: 0 34px 90px rgba(0, 0, 0, 0.75), 0 0 60px rgba(52, 211, 153, 0.12);
    animation: pop 0.2s ease-out;
}

.bag-head {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(214, 178, 106, 0.26);
    background: linear-gradient(90deg, rgba(52, 211, 153, 0.14), rgba(251, 191, 36, 0.06), transparent);
}

.bag-title {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #f3ecd8;
    white-space: nowrap;
}

.bag-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    flex: 1;
}

.bag-tab {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(214, 178, 106, 0.22);
    background: rgba(255, 255, 255, 0.04);
    color: #b9cbbf;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.15s;
}

.bag-tab:hover { background: rgba(52, 211, 153, 0.12); color: #d9f3e2; }

.bag-tab.active {
    background: rgba(52, 211, 153, 0.16);
    border-color: rgba(52, 211, 153, 0.55);
    color: #a7f3d0;
}

.bag-body {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 310px 1fr;
}

.bag-list {
    overflow-y: auto;
    padding: 14px;
    border-right: 1px solid rgba(214, 178, 106, 0.2);
    background: rgba(0, 0, 0, 0.18);
}

.bag-count {
    font-size: 11.5px;
    color: #7f9a88;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

.bag-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 11px;
    margin-bottom: 7px;
    text-align: left;
    border-radius: 10px;
    border: 1px solid rgba(214, 178, 106, 0.16);
    background: rgba(255, 255, 255, 0.03);
    color: #dce9ff;
    transition: all 0.15s;
}

.bag-item:hover {
    background: rgba(52, 211, 153, 0.08);
    border-color: rgba(52, 211, 153, 0.4);
}

.bag-item.active {
    background: rgba(251, 191, 36, 0.09);
    border-color: rgba(251, 191, 36, 0.55);
    box-shadow: 0 0 16px rgba(251, 191, 36, 0.1);
}

.bag-item.t3.active { border-color: rgba(251, 113, 133, 0.7); }

.bag-book {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.28);
    font-size: 16px;
}

.bag-item-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bag-item-body b {
    font-size: 12.5px;
    color: #f1f7ff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bag-item-body em {
    font-size: 10.5px;
    font-style: normal;
    color: #8aa0c4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bag-new {
    position: absolute;
    top: 7px;
    right: 7px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #10231a;
    background: #fbbf24;
    border-radius: 999px;
    padding: 1px 6px;
}

.bag-detail {
    overflow-y: auto;
    padding: 20px 24px 28px;
}

.bag-empty,
.bag-detail-empty {
    padding: 40px 14px;
    text-align: center;
    color: #7f9a88;
    font-size: 12.5px;
    line-height: 2;
}

.bag-detail-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* ---------- 秘籍正文 ---------- */
.book-head {
    padding: 16px 18px;
    border-radius: 12px;
    background:
        linear-gradient(135deg, rgba(251, 191, 36, 0.14), rgba(52, 211, 153, 0.06)),
        #1b2a22;
    border: 1px solid rgba(214, 178, 106, 0.4);
    margin-bottom: 14px;
}

.book-head.t3 {
    background:
        linear-gradient(135deg, rgba(251, 113, 133, 0.16), rgba(251, 191, 36, 0.08)),
        #2a1b20;
    border-color: rgba(251, 113, 133, 0.5);
}

.book-head.cheat-head {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.14), rgba(167, 139, 250, 0.08)), #17232e;
    border-color: rgba(125, 211, 252, 0.4);
}

.book-kicker {
    font-size: 11px;
    letter-spacing: 1.5px;
    color: #fbbf24;
}

.book-title {
    margin-top: 4px;
    font-size: 21px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #fdf6e3;
}

.book-sub {
    margin-top: 4px;
    font-size: 11.5px;
    color: #9eb5a6;
}

.book-intro {
    padding: 12px 14px;
    margin-bottom: 14px;
    border-left: 3px solid rgba(251, 191, 36, 0.6);
    border-radius: 0 8px 8px 0;
    background: rgba(251, 191, 36, 0.05);
    font-size: 13px;
    line-height: 1.85;
    color: #d8e6dc;
}

.book-sec {
    margin-bottom: 16px;
}

.book-sec ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.book-sec li {
    position: relative;
    padding-left: 14px;
    font-size: 12.5px;
    line-height: 1.75;
    color: #c9dbd0;
}

.book-sec li::before {
    content: '·';
    position: absolute;
    left: 2px;
    color: #fbbf24;
    font-weight: 800;
}

.book-h {
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px dashed rgba(214, 178, 106, 0.24);
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #fde68a;
}

.book-pat {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 9px 12px;
    margin-bottom: 7px;
    border-radius: 9px;
    background: rgba(52, 211, 153, 0.06);
    border-left: 2px solid rgba(52, 211, 153, 0.6);
}

.book-pat b {
    font-size: 12.5px;
    color: #a7f3d0;
}

.book-pat span {
    font-size: 12px;
    line-height: 1.75;
    color: #b9cbbf;
}

.book-foot {
    margin-top: 18px;
    padding-top: 10px;
    border-top: 1px solid rgba(214, 178, 106, 0.18);
    text-align: right;
    font-size: 11px;
    color: #34d399;
}

/* ---------- 速查表 ---------- */
.cheat-rows {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.cheat-row {
    display: grid;
    grid-template-columns: minmax(150px, 38%) 1fr;
    gap: 12px;
    padding: 7px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.028);
    border: 1px solid rgba(120, 170, 255, 0.08);
}

.cheat-k {
    font-size: 12px;
    color: #fde68a;
    font-weight: 600;
}

.cheat-v {
    font-size: 12px;
    color: #d6e4da;
    line-height: 1.65;
}

/* ============================================================
 * 获得秘籍弹窗
 * ============================================================ */
.loot-mask {
    position: fixed;
    inset: 0;
    z-index: 195;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(4, 10, 8, 0.82);
    backdrop-filter: blur(7px);
}

.loot-mask.show { display: flex; }

.loot-card {
    width: min(430px, 92vw);
    padding: 26px 26px 22px;
    text-align: center;
    border-radius: 16px;
    background:
        radial-gradient(circle at 50% 0%, rgba(251, 191, 36, 0.16), transparent 62%),
        linear-gradient(180deg, #22382c, #122016);
    border: 2px solid rgba(251, 191, 36, 0.55);
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.7), 0 0 46px rgba(251, 191, 36, 0.16);
    animation: lootIn 0.32s cubic-bezier(.2, .9, .25, 1.2);
}

@keyframes lootIn {
    0% { transform: translateY(18px) scale(0.92); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

.loot-kicker {
    font-size: 11px;
    letter-spacing: 4px;
    color: #fbbf24;
}

.loot-book {
    margin: 10px 0 4px;
    font-size: 54px;
    line-height: 1;
    filter: drop-shadow(0 0 22px rgba(251, 191, 36, 0.6));
}

.loot-title {
    font-size: 21px;
    font-weight: 800;
    color: #fdf6e3;
    letter-spacing: 0.5px;
}

.loot-sub {
    margin-top: 6px;
    font-size: 12px;
    color: #9eb5a6;
}

.loot-hint {
    margin-top: 14px;
    font-size: 11.5px;
    color: #8aa0c4;
}

.loot-hint kbd {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 5px;
    background: rgba(251, 191, 36, 0.16);
    border: 1px solid rgba(251, 191, 36, 0.45);
    color: #fcd34d;
    font-family: inherit;
    font-weight: 700;
}

.loot-btns {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.loot-btns .btn {
    flex: 1;
    padding: 10px;
}

.wp-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    margin-bottom: 12px;
    border-radius: 10px;
    background: rgba(251, 191, 36, 0.06);
    border: 1px solid rgba(251, 191, 36, 0.22);
    font-size: 12px;
    color: #8aa0c4;
}

.wp-head b {
    font-size: 15px;
    color: #fcd34d;
}

.wp-empty {
    padding: 46px 20px;
    text-align: center;
    color: #7d92b5;
    font-size: 13px;
    line-height: 2;
    border: 1px dashed rgba(120, 170, 255, 0.18);
    border-radius: 12px;
}

.wp-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wp-card {
    display: flex;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    text-align: left;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(120, 170, 255, 0.16);
    color: #dce9ff;
    transition: transform 0.16s, border-color 0.16s, background 0.16s;
}

.wp-card:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(251, 191, 36, 0.42);
}

.wp-card.t3 {
    border-color: rgba(251, 113, 133, 0.32);
    background: linear-gradient(135deg, rgba(251, 113, 133, 0.08), rgba(255, 255, 255, 0.03));
}

.wp-ico {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
    border-radius: 10px;
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.28);
}

.wp-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.wp-name {
    font-size: 13.5px;
    font-weight: 700;
    color: #f1f7ff;
}

.wp-name i {
    margin-left: 8px;
    font-size: 10.5px;
    font-style: normal;
    font-weight: 600;
    color: #fbbf24;
    padding: 1px 6px;
    border-radius: 999px;
    border: 1px solid rgba(251, 191, 36, 0.32);
}

.wp-chap {
    font-size: 11px;
    color: #7d92b5;
}

.wp-intro {
    font-size: 12px;
    line-height: 1.6;
    color: #a9bcd8;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wp-foot {
    font-size: 11px;
    color: #6f86a8;
    font-variant-numeric: tabular-nums;
}


/* ============================================================
 * 场景切换：左上角入口 + 世界地图面板 + 切换黑场
 * ============================================================ */
.world-scene {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 196px;
    justify-content: flex-start;
    padding: 4px 11px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(20, 34, 58, 0.92), rgba(10, 18, 32, 0.92));
    border: 1px solid rgba(125, 211, 252, 0.32);
    color: #dbeafe;
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
    transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
    white-space: nowrap;
}
.world-scene:hover {
    border-color: rgba(125, 211, 252, 0.7);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.world-scene b { font-size: 11.5px; color: #f1f7ff; }
.world-scene em {
    font-style: normal;
    color: #7dd3fc;
    font-size: 10.5px;
    padding-left: 6px;
    border-left: 1px solid rgba(125, 211, 252, 0.24);
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.scene-fade {
    position: absolute;
    inset: 0;
    z-index: 30;
    background: #05080f;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}
.scene-fade.on { opacity: 1; }

.scene-mask {
    position: fixed;
    inset: 0;
    z-index: 205;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(3, 7, 14, 0.78);
    backdrop-filter: blur(6px);
}
.scene-mask.show { display: flex; }

.scene-panel {
    width: min(1040px, 96vw);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    border: 1px solid rgba(125, 211, 252, 0.22);
    background: linear-gradient(160deg, rgba(15, 25, 43, 0.99), rgba(7, 12, 22, 0.99));
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7);
    overflow: hidden;
}

.scene-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(125, 211, 252, 0.14);
}
.scene-head > div { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.scene-head b { font-size: 17px; color: #f1f7ff; letter-spacing: 0.5px; }
.scene-head span { font-size: 12px; color: #7f95b8; }

.scene-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 16px 20px;
    overflow-y: auto;
}

.scene-card {
    display: flex;
    flex-direction: column;
    text-align: left;
    padding: 0;
    border-radius: 14px;
    border: 1px solid rgba(125, 211, 252, 0.16);
    background: rgba(11, 19, 33, 0.9);
    color: inherit;
    font-family: inherit;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.scene-card:hover:not(.locked) {
    transform: translateY(-3px);
    border-color: rgba(125, 211, 252, 0.55);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
}
.scene-card.current {
    border-color: rgba(251, 191, 36, 0.65);
    box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.25), 0 12px 30px rgba(0, 0, 0, 0.45);
}
.scene-card.locked { cursor: not-allowed; opacity: 0.55; }

.sc-art {
    position: relative;
    display: block;
    height: 104px;
    background:
        radial-gradient(120% 90% at 15% 20%, color-mix(in srgb, var(--ca) 82%, white 18%), transparent 60%),
        linear-gradient(135deg, var(--ca), var(--cb));
    overflow: hidden;
}
.sc-art::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.10) 0 2px, transparent 2px 6px),
        linear-gradient(180deg, transparent 45%, rgba(4, 9, 18, 0.72));
}
.sc-icon {
    position: absolute;
    right: 12px;
    bottom: 6px;
    z-index: 2;
    font-size: 42px;
    font-style: normal;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.5));
    opacity: 0.92;
}
.sc-music {
    position: absolute;
    left: 10px;
    bottom: 8px;
    z-index: 2;
    font-style: normal;
    font-size: 11px;
    color: rgba(248, 252, 255, 0.92);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}
.sc-here {
    position: absolute;
    left: 10px;
    top: 9px;
    z-index: 2;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(251, 191, 36, 0.9);
    color: #2a1a02;
    font-weight: 800;
}
.sc-lock {
    position: absolute;
    right: 10px;
    top: 9px;
    z-index: 2;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(8, 14, 26, 0.82);
    color: #cbd5e1;
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.sc-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px 12px;
}
.sc-body b { font-size: 14px; color: #f1f7ff; }
.sc-body em {
    font-style: normal;
    font-size: 10.5px;
    color: #8aa0c2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sc-body p {
    margin: 2px 0 4px;
    font-size: 11px;
    line-height: 1.55;
    color: #a9bcd8;
    min-height: 34px;
}
.sc-bar {
    display: block;
    height: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
    overflow: hidden;
}
.sc-bar i {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #38bdf8, #34d399);
}
.sc-prog { font-size: 10.5px; color: #7f95b8; font-variant-numeric: tabular-nums; }

.scene-foot {
    padding: 10px 20px 14px;
    border-top: 1px solid rgba(125, 211, 252, 0.10);
    font-size: 11px;
    color: #6f86a8;
}
.scene-foot kbd {
    padding: 1px 6px;
    border-radius: 5px;
    border: 1px solid rgba(125, 211, 252, 0.3);
    background: rgba(125, 211, 252, 0.10);
    color: #bae6fd;
    font-family: inherit;
}

.q-scene {
    display: inline-block;
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #7dd3fc;
    font-size: 10px;
    border: 1px solid rgba(125, 211, 252, 0.28);
    border-radius: 999px;
    padding: 1px 6px;
}

@media (max-width: 820px) {
    .scene-grid { grid-template-columns: 1fr 1fr; }
    .scene-card .sc-body p { display: none; }
    .sc-body { gap: 3px; }
    .scene-head span { display: none; }
}

/* ============================================================
 * 世界地图（M）：手绘地图底图 + 区域热点
 * ============================================================ */
.worldmap-panel {
    position: relative;
    width: min(1400px, 95vw, calc(88vh * 1.6));
    aspect-ratio: 3000 / 1874;
    max-height: 90vh;
    border-radius: 14px;
    overflow: hidden;
    background: #0b1a1c;
    border: 10px solid #6b3f17;
    box-shadow:
        inset 0 0 0 2px rgba(255, 214, 140, 0.45),
        0 0 0 2px #3a1f0a,
        0 30px 90px rgba(0, 0, 0, 0.75);
    animation: wmIn 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.worldmap-art {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    user-select: none;
    pointer-events: none;
}

.worldmap-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(120% 90% at 50% 45%, transparent 42%, rgba(3, 8, 10, 0.55) 100%),
        linear-gradient(180deg, rgba(4, 10, 12, 0.38), transparent 24%, transparent 74%, rgba(4, 10, 12, 0.5));
}

.worldmap-head {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 6;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px 30px;
    background: linear-gradient(180deg, rgba(4, 10, 12, 0.82), transparent);
    pointer-events: none;
}

.wm-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}
.wm-title b {
    font-size: 20px;
    letter-spacing: 2px;
    color: #ffe7b3;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}
.wm-title span {
    font-size: 11px;
    color: rgba(235, 240, 230, 0.68);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.wm-current {
    margin-left: auto;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 214, 140, 0.45);
    background: rgba(14, 26, 24, 0.82);
    color: #ffe0a0;
    font-size: 11px;
    white-space: nowrap;
    pointer-events: none;
}

.wm-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(255, 214, 140, 0.4);
    background: rgba(10, 18, 16, 0.85);
    color: #ffe7b3;
    font-size: 16px;
    cursor: pointer;
    pointer-events: auto;
    transition: background 0.18s, transform 0.18s;
}
.wm-close:hover { background: rgba(120, 45, 35, 0.9); transform: rotate(90deg); }

.worldmap-spots {
    position: absolute;
    inset: 0;
    z-index: 4;
}

.wm-spot {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    background: none;
    color: #fff;
    font-family: inherit;
    cursor: pointer;
}

.wm-ring {
    position: absolute;
    left: 50%;
    top: 27px;
    width: 74px;
    height: 74px;
    margin: -37px 0 0 -37px;
    border-radius: 50%;
    border: 1px solid rgba(255, 214, 140, 0.55);
    background: radial-gradient(circle, rgba(255, 214, 140, 0.24), transparent 68%);
    animation: wmPulse 2.8s ease-out infinite;
    pointer-events: none;
}

.wm-pin {
    position: relative;
    z-index: 2;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 24px;
    background: radial-gradient(circle at 35% 28%, #45604f, #14251f 72%);
    border: 2px solid #d9b26a;
    box-shadow:
        0 0 0 3px rgba(15, 24, 20, 0.75),
        0 8px 18px rgba(0, 0, 0, 0.55),
        inset 0 0 14px rgba(255, 220, 150, 0.18);
    transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.wm-spot:hover .wm-pin,
.wm-spot:focus-visible .wm-pin {
    transform: scale(1.12);
    border-color: #ffe7b3;
    box-shadow:
        0 0 0 3px rgba(255, 220, 150, 0.22),
        0 0 26px rgba(255, 200, 90, 0.55),
        inset 0 0 18px rgba(255, 230, 160, 0.32);
}

.wm-tag {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 10px 5px;
    border-radius: 8px;
    background: rgba(6, 14, 15, 0.8);
    border: 1px solid rgba(217, 178, 106, 0.45);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(3px);
}
.wm-tag b {
    font-size: 12px;
    letter-spacing: 0.5px;
    color: #ffe7b3;
    white-space: nowrap;
}
.wm-tag em {
    font-style: normal;
    font-size: 10px;
    color: #a9c0b8;
    white-space: nowrap;
}
.wm-bar {
    display: block;
    width: 78px;
    height: 3px;
    margin-top: 2px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}
.wm-bar i {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #e8b45a, #6ee7b7);
}

.wm-spot.current .wm-pin {
    border-color: #ffe08a;
    box-shadow:
        0 0 0 3px rgba(255, 214, 120, 0.25),
        0 0 30px rgba(255, 200, 90, 0.6),
        inset 0 0 16px rgba(255, 230, 160, 0.4);
}
.wm-spot.current .wm-ring { animation-duration: 1.7s; }
.wm-spot.current .wm-tag { border-color: rgba(255, 214, 120, 0.8); }

.wm-here {
    position: absolute;
    top: -13px;
    z-index: 3;
    padding: 1px 8px;
    border-radius: 999px;
    background: #f2c14e;
    color: #2a1802;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.wm-spot.locked .wm-pin { filter: grayscale(0.72); opacity: 0.72; }
.wm-spot.locked .wm-tag { opacity: 0.8; }
.wm-spot.locked { cursor: not-allowed; }
.wm-lock {
    position: absolute;
    top: -8px;
    right: -10px;
    z-index: 3;
    font-size: 14px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

.worldmap-tip {
    position: absolute;
    left: 18px;
    bottom: 54px;
    z-index: 6;
    width: 312px;
    padding: 12px 14px;
    border-radius: 12px;
    background: linear-gradient(160deg, rgba(10, 22, 22, 0.93), rgba(6, 14, 16, 0.95));
    border: 1px solid rgba(217, 178, 106, 0.42);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
    pointer-events: none;
}
.worldmap-tip.show {
    opacity: 1;
    visibility: visible;
    transform: none;
}
.worldmap-tip b {
    display: block;
    margin-bottom: 2px;
    font-size: 16px;
    color: #ffe7b3;
    letter-spacing: 0.5px;
}
.wm-tip-track {
    display: block;
    margin-bottom: 6px;
    font-size: 10.5px;
    color: #8fd8c7;
}
.worldmap-tip p {
    margin: 0 0 6px;
    font-size: 11.5px;
    line-height: 1.6;
    color: #b9cbc4;
}
.worldmap-tip em {
    font-style: normal;
    font-size: 10.5px;
    line-height: 1.5;
    color: #8aa39b;
}
.wm-tip-lock {
    display: block;
    margin-top: 6px;
    font-size: 10.5px;
    color: #fca5a5;
}
.worldmap-tip.locked { border-color: rgba(248, 113, 113, 0.35); }

.worldmap-foot {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 6;
    padding: 12px 18px 10px;
    text-align: right;
    font-size: 10.5px;
    color: rgba(235, 240, 230, 0.62);
    background: linear-gradient(0deg, rgba(4, 10, 12, 0.78), transparent);
    pointer-events: none;
}
.worldmap-foot kbd {
    padding: 1px 6px;
    border-radius: 5px;
    border: 1px solid rgba(255, 214, 140, 0.35);
    background: rgba(255, 214, 140, 0.12);
    color: #ffe7b3;
    font-family: inherit;
}

@keyframes wmIn {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: none; }
}
@keyframes wmPulse {
    0% { transform: scale(0.7); opacity: 0.9; }
    70% { transform: scale(1.9); opacity: 0; }
    100% { transform: scale(1.9); opacity: 0; }
}

@media (max-width: 900px) {
    .worldmap-panel { border-width: 6px; }
    .wm-title span { display: none; }
    .wm-pin { width: 42px; height: 42px; font-size: 19px; }
    .wm-tag em { display: none; }
    .wm-tag { padding: 3px 7px; }
    .wm-tag b { font-size: 10.5px; }
    .wm-bar { width: 60px; }
    .worldmap-tip { width: 220px; left: 10px; bottom: 44px; padding: 9px 10px; }
    .worldmap-tip p { display: none; }
    .worldmap-foot { font-size: 9.5px; }
}

/* 区域主题色：让六个模块一眼能分开 */
.wm-spot.theme-market .wm-pin {
    background: radial-gradient(circle at 35% 28%, #6f8a4a, #1e2a15 72%);
    border-color: #e0bd6a;
}
.wm-spot.theme-celestial .wm-pin {
    background: radial-gradient(circle at 35% 28%, #6f9db3, #162a35 72%);
    border-color: #a8dcf0;
}
.wm-spot.theme-snow .wm-pin {
    background: radial-gradient(circle at 35% 28%, #9fbcc9, #1a2a33 72%);
    border-color: #d6f2ff;
}
.wm-spot.theme-city .wm-pin {
    background: radial-gradient(circle at 35% 28%, #5b4a72, #1a1426 72%);
    border-color: #f4a6d7;
}
.wm-spot.theme-island .wm-pin {
    background: radial-gradient(circle at 35% 28%, #8f9a52, #1e2a1c 72%);
    border-color: #e8d79a;
}
.wm-spot.theme-palace .wm-pin {
    background: radial-gradient(circle at 35% 28%, #4b5a9a, #141a33 72%);
    border-color: #b8c8ff;
}

/* ============================================================
 * 坐骑 / 皮肤：试穿预览台
 * ============================================================ */
.gear-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.gear-stage {
    position: relative;
    flex: 0 0 auto;
    height: 236px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid rgba(214, 178, 106, 0.2);
    background:
        radial-gradient(circle at 50% 46%, rgba(52, 211, 153, 0.11), transparent 62%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.28));
}

#gearPreview {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
}

.gear-preview-tag {
    position: absolute;
    left: 14px;
    top: 12px;
    right: 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    pointer-events: none;
}
.gp-line {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(8, 14, 12, 0.74);
    border: 1px solid rgba(214, 178, 106, 0.3);
    font-size: 10.5px;
    color: #cfe3d8;
}
.gp-line i { font-style: normal; color: #8aa39b; }
.gp-line b { font-size: 11px; color: #ffe7b3; }
.gp-line em { font-style: normal; font-size: 9.5px; color: #fca5a5; }
.gp-hint { font-size: 10px; color: #7f95b8; }

.gear-detail {
    flex: 1;
    min-height: 0;
    padding: 16px 22px 20px;
}

@media (max-width: 900px) {
    .gear-stage { height: 168px; }
    .gp-hint { display: none; }
}

/* ============================================================
 * 天下第一武道会：开赛卡 / 任务面板
 * ============================================================ */
.arena-mask {
    position: fixed;
    inset: 0;
    z-index: 198;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(12, 6, 4, 0.84);
    backdrop-filter: blur(6px);
}
.arena-mask.show { display: flex; }

.arena-panel {
    width: min(960px, 96vw);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 16px;
    border: 2px solid rgba(232, 180, 90, 0.55);
    background: linear-gradient(160deg, #2a1a12, #140c09);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.82), 0 0 50px rgba(245, 199, 106, 0.10);
    animation: pop 0.22s ease-out;
}

.arena-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(232, 180, 90, 0.25);
}
.arena-brand {
    font-size: 16px;
    letter-spacing: 1px;
    color: #ffe7b3;
}
.arena-round {
    margin-left: auto;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid rgba(232, 180, 90, 0.45);
    background: rgba(245, 199, 106, 0.10);
    color: #f5c76a;
    font-size: 11px;
    white-space: nowrap;
}

.arena-body {
    display: grid;
    grid-template-columns: 276px 1fr;
    gap: 22px;
    padding: 20px;
    overflow-y: auto;
}

.arena-portrait {
    position: relative;
    height: 296px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid rgba(232, 180, 90, 0.30);
    background:
        radial-gradient(circle at 50% 42%, rgba(245, 199, 106, 0.18), transparent 65%),
        linear-gradient(180deg, #3a2416, #1a100b);
    overflow: hidden;
}
#arenaFace {
    max-width: 96%;
    max-height: 96%;
    object-fit: contain;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.6));
}
.arena-stars {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 8px;
    text-align: center;
    font-size: 13px;
    letter-spacing: 2px;
    color: #f5c76a;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.arena-info h3 {
    margin: 2px 0 6px;
    font-size: 24px;
    color: #ffe7b3;
    letter-spacing: 1px;
}
.arena-quote {
    margin: 0 0 14px;
    padding: 9px 12px;
    border-left: 3px solid rgba(232, 180, 90, 0.6);
    background: rgba(245, 199, 106, 0.07);
    border-radius: 0 8px 8px 0;
    font-size: 12.5px;
    line-height: 1.7;
    color: #dfc9a8;
}

.arena-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.am-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 5px 0;
    border-bottom: 1px dashed rgba(232, 180, 90, 0.16);
    font-size: 11.5px;
}
.am-row span { color: #8aa39b; }
.am-row b { color: #f1e3c8; font-weight: 700; text-align: right; }
.am-note {
    margin-top: 8px;
    font-size: 10px;
    line-height: 1.6;
    color: #7f95b8;
}

.arena-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 18px;
    border-top: 1px solid rgba(232, 180, 90, 0.20);
}

/* ---- 武道会 HUD：体力 / COMBO / 仙豆 ---- */
.arena-hud {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 10px 18px;
    border-bottom: 1px solid rgba(232, 180, 90, 0.16);
    background: rgba(0, 0, 0, 0.18);
}
.ah-hp {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 240px;
    min-width: 190px;
}
.ah-ico { font-size: 13px; }
.ah-track {
    position: relative;
    flex: 1;
    height: 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.10);
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
}
.ah-track i {
    display: block;
    height: 100%;
    width: 100%;
    border-radius: 6px;
    transition: width 0.35s ease, background 0.35s;
}
.ah-track i.ok { background: linear-gradient(90deg, #34d399, #10b981); }
.ah-track i.warn { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.ah-track i.danger { background: linear-gradient(90deg, #f87171, #dc2626); }
.ah-hp b {
    font-size: 11px;
    font-weight: 700;
    color: #e8dcc4;
    min-width: 64px;
    text-align: right;
}
.ah-side { display: flex; gap: 8px; }
.ah-combo,
.ah-bean {
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: #9fb2cd;
    white-space: nowrap;
}
.ah-combo.on {
    color: #ffd479;
    border-color: rgba(245, 199, 106, 0.55);
    background: rgba(245, 199, 106, 0.14);
    box-shadow: 0 0 10px rgba(245, 199, 106, 0.25);
}
.ah-bean.off { opacity: 0.4; text-decoration: line-through; }

/* ---- 魔王血条 ---- */
.arena-boss {
    padding: 9px 18px 11px;
    border-bottom: 1px solid rgba(239, 68, 68, 0.28);
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.16), rgba(239, 68, 68, 0.03));
}
.ab-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}
.ab-top span {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #ffb4b4;
}
.ab-top em { font-size: 10px; color: #f0a9a9; font-style: normal; }
.ab-track { display: flex; gap: 6px; }
.ab-track i {
    flex: 1;
    height: 9px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    transition: background 0.3s, box-shadow 0.3s;
}
.ab-track i.on {
    background: linear-gradient(90deg, #ef4444, #b91c1c);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

/* ---- 母题条 ---- */
.am-moot {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 9px 11px;
    margin-bottom: 8px;
    border-radius: 10px;
    border: 1px solid rgba(56, 225, 197, 0.28);
    background: linear-gradient(135deg, rgba(56, 225, 197, 0.10), rgba(56, 225, 197, 0.02));
}
.am-no {
    flex: none;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #04121a;
    background: #38e1c5;
}
.am-moot b {
    display: block;
    margin-bottom: 2px;
    font-size: 12.5px;
    color: #d8fff6;
}
.am-moot em {
    display: block;
    font-style: normal;
    font-size: 10.5px;
    line-height: 1.55;
    color: #8fc7bb;
}
.am-freq {
    margin-bottom: 6px;
    font-size: 10px;
    line-height: 1.6;
    color: #8fa6c4;
}
.am-freq b { color: #ffd479; }

/* ---- 母题图鉴 ---- */
.arena-dex {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 18px 16px;
    border-top: 1px solid rgba(232, 180, 90, 0.16);
}
.dex-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
}
.dex-head b { font-size: 13px; color: #ffe7b3; }
.dex-head span { font-size: 10.5px; color: #8aa39b; }
.dex-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 8px;
}
.dex-card {
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 10px;
    padding: 9px 11px;
    background: rgba(255, 255, 255, 0.03);
    opacity: 0.55;
    filter: grayscale(0.6);
}
.dex-card.lit {
    opacity: 1;
    filter: none;
    border-color: rgba(56, 225, 197, 0.35);
    background: linear-gradient(135deg, rgba(56, 225, 197, 0.08), rgba(0, 0, 0, 0));
}
.dc-top {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 5px;
}
.dc-no {
    padding: 1px 5px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 800;
    color: #04121a;
    background: #94a3b8;
}
.dex-card.lit .dc-no { background: #38e1c5; }
.dc-group { font-size: 10px; color: #8aa39b; }
.dc-badge { margin-left: auto; font-size: 9.5px; color: #6ee7b7; }
.dc-badge.off { color: #6b7f99; }
.dc-name {
    margin-bottom: 3px;
    font-size: 12.5px;
    font-weight: 700;
    color: #f1e3c8;
}
.dc-cmd { font-size: 10px; line-height: 1.55; color: #9fb2cd; }
.dc-stat { margin-top: 5px; font-size: 9.5px; color: #7f95b8; }

/* ---- 擂台结算里的血条 ---- */
.settle-bars {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 10px 0 4px;
}
.sb-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10.5px;
    color: #9fb2cd;
}
.sb-row > span { flex: none; min-width: 58px; }
.sb-row > b { flex: none; min-width: 52px; text-align: right; color: #e8dcc4; font-weight: 700; }
.sb-track {
    flex: 1;
    height: 9px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.10);
    overflow: hidden;
}
.sb-track i {
    display: block;
    height: 100%;
    border-radius: 5px;
    transition: width 0.4s ease;
}
.sb-track i.ok { background: linear-gradient(90deg, #34d399, #10b981); }
.sb-track i.warn { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.sb-track i.danger { background: linear-gradient(90deg, #f87171, #dc2626); }
.sb-row.boss > span { color: #ffb4b4; }

/* 任务面板里的擂台入口 */
.q-arena-head {
    padding: 4px 2px 2px;
    font-size: 12px;
    color: #f5c76a;
}
.q-arena-head b { color: #ffe7b3; }
.q-arena-sub {
    margin-bottom: 7px;
    font-size: 11px;
    color: #a9bcd8;
}
.q-row.arena {
    border-color: rgba(232, 180, 90, 0.55);
    background: linear-gradient(135deg, rgba(245, 199, 106, 0.13), rgba(245, 199, 106, 0.03));
}
.q-row.arena .q-chip {
    background: rgba(245, 199, 106, 0.22);
    color: #ffe7b3;
}

@media (max-width: 720px) {
    .arena-body { grid-template-columns: 1fr; padding: 14px; }
    .arena-portrait { height: 170px; }
    .arena-info h3 { font-size: 19px; }
    .am-row { font-size: 10.5px; }
    .arena-hud { padding: 9px 12px; gap: 9px; }
    .arena-boss { padding: 8px 12px 10px; }
    .arena-dex { padding: 10px 12px 14px; }
    .dex-grid { grid-template-columns: 1fr; }
}

/* ============================================================
 * 皮肤 / 坐骑：展示台 + 换装 CG
 * ============================================================ */
.gear-stage { cursor: pointer; }
.gear-stage.rarity-common {
    background:
        radial-gradient(circle at 50% 44%, rgba(52, 211, 153, 0.16), transparent 62%),
        radial-gradient(circle at 78% 18%, rgba(251, 191, 36, 0.08), transparent 40%),
        linear-gradient(180deg, rgba(12, 30, 22, 0.9), rgba(4, 10, 8, 0.96));
}
.gear-stage.rarity-rare {
    background:
        radial-gradient(circle at 50% 44%, rgba(56, 189, 248, 0.20), transparent 60%),
        radial-gradient(circle at 80% 16%, rgba(167, 139, 250, 0.16), transparent 42%),
        linear-gradient(180deg, rgba(7, 22, 38, 0.94), rgba(3, 8, 16, 0.98));
}
.gear-stage.rarity-legend {
    background:
        radial-gradient(circle at 50% 42%, rgba(251, 191, 36, 0.18), transparent 58%),
        radial-gradient(circle at 80% 14%, rgba(192, 132, 252, 0.22), transparent 45%),
        radial-gradient(circle at 20% 90%, rgba(56, 189, 248, 0.12), transparent 45%),
        linear-gradient(180deg, rgba(28, 12, 44, 0.96), rgba(7, 4, 16, 0.99));
}

.gear-preview-hero {
    position: absolute;
    left: 16px;
    top: 14px;
    max-width: 56%;
    display: flex;
    flex-direction: column;
    gap: 3px;
    pointer-events: none;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.85);
}
.gph-kicker {
    font-size: 10px;
    letter-spacing: 3px;
    color: #f5c76a;
    text-transform: uppercase;
}
.gear-preview-hero b {
    font-size: 21px;
    letter-spacing: 1px;
    color: #fff6dc;
}
.gear-preview-hero em {
    font-style: normal;
    font-size: 11px;
    line-height: 1.5;
    color: rgba(226, 236, 248, 0.78);
}
.gph-lore {
    margin-top: 2px;
    font-size: 10.5px;
    line-height: 1.55;
    color: rgba(203, 216, 232, 0.62);
}
.gear-preview-cue {
    position: absolute;
    right: 14px;
    bottom: 12px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 214, 140, 0.32);
    background: rgba(8, 14, 12, 0.72);
    color: #d6c39a;
    font-size: 9.5px;
    letter-spacing: 0.4px;
    pointer-events: none;
}

/* ---------- 换装 CG ---------- */
.gear-cg {
    position: fixed;
    inset: 0;
    z-index: 260;
    display: none;
    overflow: hidden;
    background: #03060a;
}
.gear-cg.show {
    display: block;
    animation: gcIn 0.35s ease-out;
}
#gearCgCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}
.gc-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(2, 5, 9, 0.92) 0%, rgba(2, 5, 9, 0.55) 38%, transparent 62%),
        radial-gradient(120% 100% at 68% 50%, transparent 36%, rgba(2, 5, 9, 0.8) 100%);
}
.gc-info {
    position: absolute;
    left: 6%;
    top: 50%;
    z-index: 2;
    width: min(430px, 40vw);
    transform: translateY(-50%);
    animation: gcTextIn 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) 0.12s both;
}
.gc-kicker {
    display: block;
    margin-bottom: 10px;
    font-size: 11px;
    letter-spacing: 7px;
    color: #f5c76a;
}
.gc-info h2 {
    margin: 0 0 8px;
    font-size: clamp(30px, 4vw, 52px);
    line-height: 1.12;
    letter-spacing: 2px;
    color: #fff6dc;
    text-shadow: 0 4px 28px rgba(0, 0, 0, 0.9), 0 0 40px rgba(251, 191, 36, 0.22);
}
.gc-rarity {
    display: inline-block;
    margin-bottom: 14px;
    padding: 3px 12px;
    border-radius: 999px;
    border: 1px solid currentColor;
    font-size: 11px;
    letter-spacing: 2px;
}
.gc-rarity.c-common { color: #a7b3c4; }
.gc-rarity.c-rare { color: #7dd3fc; }
.gc-rarity.c-legend { color: #fbbf24; }
.gc-info p {
    margin: 0 0 22px;
    max-width: 360px;
    font-size: 13px;
    line-height: 1.85;
    color: #c8d4e2;
}
#gcClose {
    min-width: 132px;
    letter-spacing: 4px;
}
.gc-flash {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: #fff;
    opacity: 0;
    animation: gcFlash 0.55s ease-out forwards;
}

@keyframes gcIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes gcFlash {
    0% { opacity: 0.85; }
    100% { opacity: 0; }
}
@keyframes gcTextIn {
    from { opacity: 0; transform: translateY(calc(-50% + 20px)); }
    to { opacity: 1; transform: translateY(-50%); }
}

@media (max-width: 700px) {
    .gc-info {
        left: 6%;
        right: 6%;
        top: auto;
        bottom: 6%;
        width: auto;
        transform: none;
        animation: gcTextInMobile 0.55s ease-out 0.12s both;
    }
    .gc-info h2 { font-size: 28px; }
    .gc-info p { font-size: 11.5px; margin-bottom: 12px; }
    .gc-kicker { letter-spacing: 4px; }
    .gear-preview-hero b { font-size: 17px; }
    .gear-preview-hero em { display: none; }
    .gear-preview-cue { display: none; }
}
@keyframes gcTextInMobile {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: none; }
}

/* 试穿台信息分层：左上大标题，右上皮/坐骑小标签，右下角提示 */
.gear-preview-tag {
    left: auto;
    right: 14px;
    top: 14px;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}
.gear-preview-tag .gp-hint { display: none; }
.gear-preview-hero::before {
    content: '';
    position: absolute;
    inset: -10px -16px -8px -10px;
    z-index: -1;
    background: linear-gradient(90deg, rgba(3, 8, 6, 0.82), rgba(3, 8, 6, 0.35) 62%, transparent);
    border-radius: 10px;
}

/* ============================================================
 * pokebonk 风格皮肤（样张，body.pb-skin）
 * 白卡 + 藏青字 + 橙色强调，信息贴四角、不挡场景。
 * 只在 ?skin=pb 时挂到 body 上，关掉皮肤立即恢复原样。
 * ============================================================ */
body.pb-skin .world-area,
body.pb-skin .quest-box,
body.pb-skin .world-hint {
    background: #fffdf7;
    border: 0;
    border-radius: 18px;
    color: #2a2440;
    box-shadow: 0 3px 0 rgba(42, 36, 64, 0.10), 0 16px 30px rgba(42, 36, 64, 0.22);
    backdrop-filter: none;
}

body.pb-skin .world-area b { color: #2a2440; font-weight: 800; }
body.pb-skin .world-area span { color: #7a7290; }

body.pb-skin .quest-head {
    color: #2a2440;
    font-weight: 800;
    border-bottom: 2px solid rgba(42, 36, 64, 0.08);
}
body.pb-skin .quest-head i { color: #9890a8; }
body.pb-skin .q-row { color: #4a4360; border-radius: 12px; }
body.pb-skin .q-row:hover { background: rgba(255, 122, 42, 0.12); }
body.pb-skin .q-row.on { background: rgba(255, 122, 42, 0.18); }

body.pb-skin .world-prompt {
    background: #fffdf7;
    border: 0;
    border-radius: 999px;
    color: #2a2440;
    font-weight: 700;
    box-shadow: 0 3px 0 rgba(42, 36, 64, 0.12), 0 14px 26px rgba(42, 36, 64, 0.24);
    backdrop-filter: none;
}
body.pb-skin .world-prompt b { color: #e0561c; }
body.pb-skin .world-prompt kbd {
    background: #ffe9d8;
    border: 1px solid #ffc59b;
    color: #d2571a;
    border-radius: 8px;
}
body.pb-skin .world-hint b { color: #e0561c; }

body.pb-skin #worldMini {
    border: 3px solid #fffdf7;
    border-radius: 16px;
    box-shadow: 0 10px 26px rgba(42, 36, 64, 0.30);
    opacity: 1;
}

body.pb-skin .world-scene {
    background: #fffdf7;
    border: 0;
    color: #2a2440;
    font-weight: 800;
    box-shadow: 0 3px 0 rgba(42, 36, 64, 0.10), 0 10px 22px rgba(42, 36, 64, 0.20);
}
body.pb-skin .world-scene b { color: #e0561c; }
body.pb-skin .world-scene em { color: #9890a8; }

body.pb-skin .world-zoom {
    background: #fffdf7;
    border: 0;
    border-radius: 14px;
    color: #4a4360;
    box-shadow: 0 3px 0 rgba(42, 36, 64, 0.10), 0 10px 22px rgba(42, 36, 64, 0.20);
}
body.pb-skin .world-zoom button {
    background: #f7f2e7;
    border: 1px solid rgba(42, 36, 64, 0.12);
    color: #2a2440;
}
body.pb-skin .world-zoom button:hover {
    background: #ffe9d8;
    border-color: #ffc59b;
}
body.pb-skin #worldZoomVal { color: #5a5270; }

/* 任务卡内部文字：白底上必须换成深色，否则会糊成一片 */
body.pb-skin .q-body b { color: #2a2440; font-weight: 700; }
body.pb-skin .q-body em { color: #8a8298; }
body.pb-skin .q-dist { color: #8a8298; }
body.pb-skin .q-done { color: #8a8298; }
body.pb-skin .q-row.tracked {
    background: #fff2e6;
    border-color: #ffc59b;
}
body.pb-skin .q-row.main .q-chip {
    color: #a35a00; background: #fff0d6; border: 1px solid #f3c97e;
}
body.pb-skin .q-row.side .q-chip {
    color: #1b6fa8; background: #e2f4ff; border: 1px solid #a8dcff;
}
body.pb-skin .q-row.zt .q-chip {
    color: #6d4bb5; background: #f0e9ff; border: 1px solid #cbb9f5;
}

body.pb-skin .world-chips span {
    background: #fffdf7;
    border: 0;
    color: #4a4360;
    font-weight: 600;
    box-shadow: 0 2px 0 rgba(42, 36, 64, 0.08), 0 8px 16px rgba(42, 36, 64, 0.16);
}
body.pb-skin .world-mini-wrap .mini-tip {
    color: #fffdf7;
    text-shadow: 0 1px 4px rgba(20, 16, 36, 0.55);
}

/* ---------- 生活应用工坊：夜市定价 ---------- */
.craft-mask {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(4, 10, 8, 0.86);
    backdrop-filter: blur(8px);
}

.craft-mask.show { display: flex; }

.craft-panel {
    width: min(820px, 96vw);
    max-height: 94vh;
    overflow: auto;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(23, 40, 31, 0.99), rgba(10, 20, 16, 0.99));
    border: 2px solid rgba(214, 178, 106, 0.45);
    box-shadow: 0 34px 90px rgba(0, 0, 0, 0.75), 0 0 60px rgba(251, 191, 36, 0.10);
    animation: pop 0.2s ease-out;
}

.craft-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(214, 178, 106, 0.22);
}

.craft-title {
    flex: 1;
    font-weight: 800;
    color: #fde68a;
}

.craft-title span {
    margin-left: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
}

.craft-wallet { font-size: 13px; color: #fde68a; }

.craft-close {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: transparent;
    color: #cbd5e1;
    cursor: pointer;
}

.craft-body { padding: 14px 16px 20px; }

.craft-stage {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
}

.craft-brief {
    margin: 12px 0 8px;
    font-size: 13px;
    line-height: 1.75;
    color: #cbd5e1;
}

.craft-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(8, 16, 12, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.craft-kv { display: flex; gap: 6px; align-items: baseline; font-size: 13px; color: #cbd5e1; }
.craft-kv i { font-style: normal; font-size: 12px; color: #94a3b8; }
.craft-kv b { color: #f8fafc; }
.craft-kv.hl b { font-size: 15px; color: #fbbf24; }
.craft-best { width: 100%; font-size: 12px; color: #86efac; }

.craft-ctrl {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
}

.craft-row {
    display: flex;
    flex: 1 1 320px;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #cbd5e1;
}

.craft-row input[type="range"] { flex: 1; accent-color: #fbbf24; }
.craft-row b { min-width: 64px; text-align: right; color: #fde68a; }

.craft-input {
    flex: 1;
    min-width: 120px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(4, 10, 8, 0.8);
    color: #f8fafc;
    font-size: 14px;
}

.craft-unit { color: #94a3b8; }

.craft-btn {
    padding: 9px 16px;
    border-radius: 10px;
    border: 1px solid rgba(251, 191, 36, 0.55);
    background: linear-gradient(180deg, rgba(251, 191, 36, 0.95), rgba(217, 119, 6, 0.95));
    color: #26170a;
    font-weight: 800;
    cursor: pointer;
}

.craft-btn.ghost {
    background: transparent;
    border-color: rgba(148, 163, 184, 0.4);
    color: #cbd5e1;
}

.craft-tip {
    margin: 10px 0 0;
    font-size: 12.5px;
    line-height: 1.7;
    color: #94a3b8;
}

.craft-ok { width: 100%; font-size: 13px; color: #86efac; }
.craft-bad { width: 100%; font-size: 13px; color: #fca5a5; }

/* 关卡翻页：← 1 2 3 → */
.craft-pager {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.craft-pg {
    width: 32px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(8, 16, 12, 0.7);
    color: #cbd5e1;
    font-size: 14px;
    cursor: pointer;
}

.craft-pg:hover:not(:disabled) { border-color: rgba(251, 191, 36, 0.6); color: #fde68a; }
.craft-pg:disabled { opacity: 0.32; cursor: default; }

.craft-dots { display: flex; gap: 6px; }

.craft-dot {
    min-width: 28px;
    height: 30px;
    padding: 0 6px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(8, 16, 12, 0.7);
    color: #94a3b8;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.craft-dot.done { color: #86efac; border-color: rgba(52, 211, 153, 0.4); }

.craft-dot.on {
    color: #fde68a;
    border-color: rgba(251, 191, 36, 0.75);
    background: rgba(251, 191, 36, 0.14);
}

.craft-pg-hint { margin-left: auto; font-size: 11px; color: #64748b; }

/* 「自由实验台」那一页：淡青色，和判分的三关区分开 */
.craft-dot.lab { border-style: dashed; border-color: rgba(125, 211, 252, 0.45); }
.craft-dot.lab.on {
    border-style: solid;
    color: #a5f3fc;
    border-color: rgba(125, 211, 252, 0.8);
    background: rgba(125, 211, 252, 0.14);
}
.craft-lab-note {
    margin: 10px 0 0;
    padding: 9px 12px;
    border-radius: 9px;
    font-size: 12.5px;
    line-height: 1.7;
    color: #7dd3fc;
    background: rgba(125, 211, 252, 0.07);
    border-left: 3px solid rgba(125, 211, 252, 0.55);
}

/* ================= 心魔（Demon） =================
   五只心魔 = 你自己说出来的五个怕。面板走暗红紫，和工坊的暖金区分开。 */
.dm-mask {
    position: fixed;
    inset: 0;
    z-index: 240;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: radial-gradient(circle at 50% 38%, rgba(52, 12, 24, 0.92), rgba(4, 2, 6, 0.95));
    backdrop-filter: blur(8px);
}

.dm-mask.show { display: flex; }

.dm-panel {
    width: min(880px, 96vw);
    max-height: 92vh;
    overflow: auto;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(28, 12, 22, 0.99), rgba(9, 5, 10, 0.99));
    border: 1px solid rgba(239, 68, 68, 0.38);
    box-shadow: 0 34px 90px rgba(0, 0, 0, 0.8), 0 0 70px rgba(239, 68, 68, 0.12);
    animation: pop 0.2s ease-out;
}

.dm-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(239, 68, 68, 0.22);
}

.dm-title { flex: 1; font-weight: 800; color: #fecaca; }
.dm-progress { font-size: 12px; color: #fca5a5; }

.dm-close {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: transparent;
    color: #cbd5e1;
    cursor: pointer;
}

.dm-body { padding: 14px 16px 12px; }

.dm-lead { margin: 0 0 12px; font-size: 13px; line-height: 1.75; color: #cbd5e1; }

.dm-next {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 11px 12px;
    margin-bottom: 14px;
    border-radius: 12px;
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.16), rgba(239, 68, 68, 0.03));
    border: 1px solid rgba(239, 68, 68, 0.3);
    font-size: 13px;
    color: #fecaca;
}

.dm-next span { font-size: 12px; color: #cbd5e1; }
.dm-next .dm-btn { margin-left: auto; }
.dm-next.done {
    background: linear-gradient(90deg, rgba(52, 211, 153, 0.14), rgba(52, 211, 153, 0.03));
    border-color: rgba(52, 211, 153, 0.32);
    color: #a7f3d0;
}

.dm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.dm-card {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 13px 14px;
    border-radius: 14px;
    background: rgba(18, 10, 16, 0.86);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.dm-card.sealed { background: rgba(10, 22, 17, 0.86); border-color: rgba(52, 211, 153, 0.32); }
.dm-card-top { display: flex; align-items: center; gap: 10px; }
.dm-em {
    width: 30px;
    font-size: 26px;
    line-height: 1;
    text-align: center;
    filter: drop-shadow(0 0 10px var(--c));
}
.dm-card-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dm-card-name h4 { margin: 0; font-size: 15px; color: #fecaca; }
.dm-card.sealed .dm-card-name h4 { color: #a7f3d0; }

.dm-state {
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(239, 68, 68, 0.16);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.dm-state.ok {
    background: rgba(52, 211, 153, 0.14);
    border-color: rgba(52, 211, 153, 0.35);
    color: #a7f3d0;
}

.dm-hp {
    position: relative;
    height: 12px;
    border-radius: 999px;
    background: rgba(127, 29, 29, 0.4);
    overflow: hidden;
}

.dm-hp i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #ef4444, #f97316);
    transition: width 0.25s ease;
}

.dm-hp b {
    position: absolute;
    right: 4px;
    top: 1px;
    padding: 0 5px;
    border-radius: 6px;
    background: rgba(10, 5, 8, 0.86);
    font-size: 10px;
    line-height: 10px;
    color: #fee2e2;
}

.dm-hp.big { height: 18px; }
.dm-hp.big b { top: 1px; font-size: 11px; line-height: 16px; }
.dm-hp.big i { background: linear-gradient(90deg, #dc2626, #fb923c); }

.dm-why { min-height: 40px; margin: 0; font-size: 12px; line-height: 1.65; color: #94a3b8; }
.dm-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.dm-tags span {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.16);
    color: #cbd5e1;
}

.dm-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 2px;
}
.dm-stat { font-size: 11px; color: #64748b; }

.dm-btn {
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid rgba(239, 68, 68, 0.6);
    background: linear-gradient(180deg, #ef4444, #b91c1c);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.dm-btn:hover { filter: brightness(1.08); }

.dm-btn.ghost {
    background: transparent;
    border-color: rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

.dm-btn:disabled { opacity: 0.5; cursor: default; }

.dm-back {
    padding: 0 0 10px;
    border: 0;
    background: transparent;
    color: #94a3b8;
    font-size: 12px;
    cursor: pointer;
}

.dm-arena {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 14px;
    border-radius: 14px;
    background: radial-gradient(circle at 18% 50%, rgba(239, 68, 68, 0.14), rgba(10, 5, 10, 0.6));
    border: 1px solid rgba(239, 68, 68, 0.18);
}

.dm-face {
    font-size: 52px;
    line-height: 1;
    filter: drop-shadow(0 0 18px var(--c));
    transition: transform 0.18s ease;
}

.dm-face.hit { transform: translateY(7px) scale(0.9); }
.dm-face.taunt { transform: translateX(5px) scale(1.05); }
.dm-side { flex: 1; min-width: 0; }
.dm-side h3 { margin: 0 0 8px; font-size: 16px; color: #fecaca; }
.dm-lv { margin-left: 6px; font-size: 11px; font-weight: 600; color: #94a3b8; }
.dm-say { margin: 8px 0 0; font-size: 12px; color: #fca5a5; }

.dm-q { margin-top: 14px; }
.dm-qtag { font-size: 11px; letter-spacing: 0.04em; color: #94a3b8; }
.dm-qt { margin: 8px 0 12px; font-size: 15px; line-height: 1.8; color: #f8fafc; }
.dm-opts { display: grid; gap: 8px; }

.dm-opt {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(10, 16, 14, 0.8);
    color: #e2e8f0;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.dm-opt b {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: rgba(239, 68, 68, 0.16);
    color: #fca5a5;
    font-size: 11px;
}

.dm-opt:hover { border-color: rgba(239, 68, 68, 0.5); background: rgba(239, 68, 68, 0.08); }
.dm-opt.ok { border-color: #34d399; background: rgba(52, 211, 153, 0.12); color: #d1fae5; }
.dm-opt.bad { border-color: #ef4444; background: rgba(239, 68, 68, 0.14); color: #fecaca; }
.dm-opt:disabled { cursor: default; }

.dm-ansrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.dm-input {
    flex: 1;
    min-width: 160px;
    padding: 9px 11px;
    border-radius: 10px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    background: rgba(6, 6, 10, 0.9);
    color: #f8fafc;
    font-size: 15px;
}

.dm-unit { font-size: 12px; color: #94a3b8; }
.dm-fb { margin-top: 12px; font-size: 13px; color: #cbd5e1; }
.dm-fb:empty { display: none; }
.dm-fb.ok { border-left: 3px solid #34d399; padding-left: 10px; }
.dm-fb.bad { border-left: 3px solid #ef4444; padding-left: 10px; }
.dm-fb b { display: block; margin-bottom: 4px; color: #f8fafc; }
.dm-fb p { margin: 0 0 8px; line-height: 1.75; }
.dm-fb .dm-again { font-size: 12px; color: #94a3b8; }

.dm-win { padding: 18px 8px 8px; text-align: center; }
.dm-win-em { font-size: 56px; line-height: 1; opacity: 0.55; filter: drop-shadow(0 0 22px var(--c)); }
.dm-win h3 { margin: 8px 0 4px; font-size: 20px; color: #a7f3d0; }
.dm-win-line { margin: 0 0 14px; font-size: 12px; color: #94a3b8; }
.dm-win-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; font-size: 12px; color: #cbd5e1; }
.dm-win-stats b { color: #fde68a; }
.dm-win-tip { max-width: 520px; margin: 14px auto 18px; font-size: 12px; line-height: 1.8; color: #94a3b8; }
.dm-win-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

@media (max-width: 640px) {
    .dm-grid { grid-template-columns: 1fr; }
    .dm-face { font-size: 42px; }
    .dm-panel { max-height: 94vh; }
}

/* ================= 图书馆（Library） =================
   走进去看「一类题讲不完的东西」：左章节、中列表、右阅读区。
   正文是独立 H5（library/*.html），所以面板本身只负责框住它。 */
.lib-mask {
    position: fixed; inset: 0; z-index: 210;
    display: flex; align-items: center; justify-content: center;
    padding: 1.6vh 1.5vw;
    background: rgba(4, 8, 14, 0.72);
    backdrop-filter: blur(3px);
    opacity: 0; visibility: hidden;
    transition: opacity 0.18s, visibility 0.18s;
}
.lib-mask.show { opacity: 1; visibility: visible; }

.lib-panel {
    width: min(1500px, 97vw); height: min(920px, 93vh);
    display: flex; flex-direction: column;
    border-radius: 16px; overflow: hidden;
    background: linear-gradient(180deg, #121a24, #0d141d);
    border: 1px solid rgba(232, 180, 90, 0.35);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.lib-head {
    display: flex; align-items: center; gap: 12px;
    padding: 13px 18px;
    border-bottom: 1px solid rgba(120, 170, 255, 0.14);
    background: rgba(10, 16, 24, 0.9);
}
.lib-brand { display: flex; align-items: baseline; gap: 10px; font-size: 16px; color: #f4e8cd; }
.lib-brand b { font-weight: 700; letter-spacing: 1px; }
.lib-brand span { font-size: 12px; color: #8ea0b6; }
.lib-close {
    margin-left: auto; width: 30px; height: 30px; border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    background: rgba(255, 255, 255, 0.04); color: #cbd5e1; font-size: 14px;
}
.lib-close:hover { background: rgba(248, 113, 113, 0.16); color: #fecaca; }

.lib-body { flex: 1; display: flex; min-height: 0; }

/* —— 左：章节导航 —— */
.lib-nav {
    width: 236px; flex: 0 0 236px; overflow-y: auto;
    padding: 12px 10px 20px;
    border-right: 1px solid rgba(120, 170, 255, 0.12);
    background: rgba(8, 12, 18, 0.6);
}
.lib-group {
    margin: 14px 0 6px; padding-left: 8px;
    font-size: 11px; letter-spacing: 1.5px; color: #5f7189;
}
.lib-cat {
    width: 100%; display: flex; align-items: center; gap: 8px;
    padding: 8px 9px; margin-bottom: 3px; border-radius: 9px;
    border: 1px solid transparent; background: transparent;
    color: #b9c7d8; font-size: 12.5px; text-align: left; line-height: 1.4;
}
.lib-cat:hover { background: rgba(125, 211, 252, 0.07); }
.lib-cat.on {
    background: rgba(232, 180, 90, 0.12);
    border-color: rgba(232, 180, 90, 0.4);
    color: #fde68a;
}
.lib-cat.empty { opacity: 0.45; }
.lib-cat i { font-style: normal; flex: 0 0 auto; }
.lib-cat span { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.lib-cat b {
    flex: 0 0 auto; font-size: 11px; font-weight: 700;
    padding: 0 6px; border-radius: 999px;
    background: rgba(255, 255, 255, 0.06); color: #94a3b8;
}
.lib-cat.on b { background: rgba(232, 180, 90, 0.25); color: #fde68a; }

/* —— 中：文章列表 —— */
.lib-list {
    width: 292px; flex: 0 0 292px; overflow-y: auto;
    padding: 14px 12px 24px;
    border-right: 1px solid rgba(120, 170, 255, 0.12);
}
.lib-list-head {
    font-size: 11px; letter-spacing: 1px; color: #6b7d93;
    margin: 0 0 10px 4px;
}
.lib-card {
    display: block; width: 100%; text-align: left;
    padding: 12px 13px; margin-bottom: 9px;
    border-radius: 11px; border: 1px solid rgba(120, 170, 255, 0.14);
    background: rgba(255, 255, 255, 0.03); color: #dbe6f3;
    transition: all 0.14s;
}
.lib-card:hover { border-color: rgba(125, 211, 252, 0.45); transform: translateY(-1px); }
.lib-card.on { border-color: rgba(232, 180, 90, 0.6); background: rgba(232, 180, 90, 0.09); }
.lib-card b { display: block; font-size: 13.5px; line-height: 1.5; margin-bottom: 4px; }
.lib-card p { margin: 0 0 7px; font-size: 12px; line-height: 1.65; color: #8ea0b6; }
.lib-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 10.5px; color: #6b7d93; }
.lib-meta span { padding: 1px 6px; border-radius: 5px; background: rgba(255, 255, 255, 0.05); }
.lib-meta em {
    font-style: normal; padding: 1px 6px; border-radius: 5px;
    background: rgba(125, 211, 252, 0.10); color: #7dd3fc;
}

/* —— 右：阅读区 —— */
.lib-read {
    flex: 1; min-width: 0; display: flex; flex-direction: column;
    background: #0a0f16;
}
.lib-read-empty {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 6px; color: #6b7d93; text-align: center; padding: 30px;
}
.lib-read-empty b { color: #b9c7d8; font-size: 15px; }
.lib-read-empty p { margin: 0; font-size: 12.5px; line-height: 1.9; }
.lib-read-empty[hidden] { display: none; }
.lib-empty { padding: 40px 18px; text-align: center; color: #6b7d93; }
.lib-empty b { color: #b9c7d8; }
.lib-empty p { font-size: 12px; line-height: 1.9; }
.lib-empty code {
    font-family: Consolas, monospace; font-size: 11.5px;
    background: rgba(125, 211, 252, 0.1); color: #7dd3fc;
    padding: 1px 5px; border-radius: 4px;
}
.lib-empty-ico { font-size: 34px; margin-bottom: 6px; opacity: 0.7; }

.lib-read-bar {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 16px;
    border-bottom: 1px solid rgba(120, 170, 255, 0.12);
    background: rgba(8, 12, 18, 0.85);
    font-size: 12.5px; color: #dbe6f3;
}
.lib-read-bar[hidden] { display: none; }
.lib-read-bar b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-read-bar a { margin-left: auto; color: #7dd3fc; text-decoration: none; flex: 0 0 auto; }
.lib-read-bar a:hover { text-decoration: underline; }

.lib-frame { flex: 1; width: 100%; border: 0; background: #0f1620; }
.lib-frame[hidden] { display: none; }

@media (max-width: 900px) {
    .lib-panel { height: 92vh; }
    .lib-nav { width: 150px; flex-basis: 150px; }
    .lib-list { width: 210px; flex-basis: 210px; }
    .lib-cat span { font-size: 11.5px; }
}
@media (max-width: 700px) {
    .lib-body { flex-direction: column; }
    .lib-nav {
        width: 100%; flex: 0 0 auto; max-height: 34%;
        display: flex; flex-wrap: wrap; gap: 4px;
        border-right: 0; border-bottom: 1px solid rgba(120, 170, 255, 0.12);
    }
    .lib-group { width: 100%; }
    .lib-cat { width: auto; }
    .lib-list { width: 100%; flex: 1 1 auto; max-height: 40%; border-right: 0; }
    .lib-read { flex: 1 1 40%; }
}

/* ================= 图书馆 · 三个分区 =================
   解析（H5 阅读）/ 大佬经验（人物 + 经验卡）/ 实验台（画布 + 滑块） */
.lib-tabs { display: flex; gap: 6px; margin-left: 18px; flex-wrap: wrap; }
.lib-tab {
    padding: 6px 13px; border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.03);
    color: #9fb0c4; font-size: 12.5px; font-weight: 600;
    transition: all 0.14s;
}
.lib-tab:hover { border-color: rgba(125, 211, 252, 0.45); color: #cfe6ff; }
.lib-tab.on {
    background: rgba(232, 180, 90, 0.16);
    border-color: rgba(232, 180, 90, 0.55);
    color: #fde68a;
}

/* —— 大佬经验：左边人物 —— */
.lib-elder {
    width: 100%; display: flex; align-items: center; gap: 10px;
    padding: 8px 9px; margin-bottom: 5px; border-radius: 10px;
    border: 1px solid transparent; background: transparent; text-align: left;
}
.lib-elder:hover { background: rgba(125, 211, 252, 0.07); }
.lib-elder.on {
    background: rgba(232, 180, 90, 0.12);
    border-color: rgba(232, 180, 90, 0.4);
}
.le-face {
    width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%;
    background: #0d1420; overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.3);
    display: block; position: relative;
}
.le-face img {
    width: 100%; height: 100%; object-fit: cover; object-position: 50% 26%;
    mix-blend-mode: screen; transform: scale(1.5);
}
.le-txt { min-width: 0; }
.le-txt b { display: block; font-size: 12.5px; color: #dbe6f3; }
.le-txt em {
    display: block; font-style: normal; font-size: 10.5px; color: #7d8ea3;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* —— 大佬经验：中间条目 —— */
.lib-card.lib-tipcard { padding: 11px 12px; }
.lib-card.lib-tipcard b { font-size: 12.5px; line-height: 1.6; margin: 0; font-weight: 600; }

/* —— 大佬经验：右侧正文 —— */
.lib-tip-page {
    display: block; text-align: left; overflow-y: auto;
    padding: 30px 40px 40px; align-items: flex-start; justify-content: flex-start;
}
.lib-tip-who { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.ltw-face {
    width: 52px; height: 52px; border-radius: 50%; overflow: hidden;
    background: #0d1420; border: 1px solid rgba(232, 180, 90, 0.4); flex: 0 0 52px;
}
.ltw-face img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 24%; mix-blend-mode: screen; transform: scale(1.45); }
.ltw-name b { display: block; font-size: 16px; color: #f4e8cd; }
.ltw-name em { font-style: normal; font-size: 12px; color: #8ea0b6; }
.lib-tip-intro {
    margin: 12px 0 4px; padding-left: 12px;
    border-left: 2px solid rgba(232, 180, 90, 0.45);
    color: #a9b8c9; font-size: 13px; font-style: italic;
}
.lib-tip-title {
    margin: 20px 0 12px; font-size: 19px; line-height: 1.5; color: #ffe9b8;
    border: 0; padding: 0;
}
.lib-tip-body { font-size: 14.5px; line-height: 2; color: #d5e0ec; }
.lib-tip-body .katex { font-size: 1.05em; }
.lib-tip-foot {
    margin-top: 26px; padding-top: 14px;
    border-top: 1px dashed rgba(148, 163, 184, 0.18);
    font-size: 12px; color: #6b7d93;
}
.lib-next {
    margin-left: 8px; padding: 4px 12px; border-radius: 7px;
    border: 1px solid rgba(232, 180, 90, 0.5);
    background: rgba(232, 180, 90, 0.12); color: #fde68a;
    font-size: 12px; font-weight: 600;
}
.lib-next:hover { background: rgba(232, 180, 90, 0.24); }

/* —— 实验台 —— */
.lib-lab { flex: 1; display: flex; flex-direction: column; min-height: 0; background: #0a0f16; }
.lib-lab[hidden] { display: none; }
.lib-lab-head {
    display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
    padding: 10px 16px 8px;
    border-bottom: 1px solid rgba(120, 170, 255, 0.12);
}
.lib-lab-head b { font-size: 14px; color: #cfe6ff; }
.lib-lab-head span { font-size: 12px; color: #7d8ea3; }
.lib-lab canvas {
    width: 100%; height: auto; display: block;
    background: #0b1613; border-bottom: 1px solid rgba(120, 170, 255, 0.12);
}
.lib-lab-ctl { padding: 12px 18px 18px; display: flex; flex-direction: column; gap: 10px; }
.lib-slider {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    font-size: 12.5px; color: #b9c7d8;
}
.lib-slider span { width: 150px; flex: 0 0 auto; color: #8ea0b6; }
.lib-slider input[type=range] { flex: 1 1 160px; accent-color: #7dd3fc; }
.lib-slider b {
    min-width: 70px; text-align: right; color: #fde68a;
    font-variant-numeric: tabular-nums;
}
.lib-slider em { flex: 0 0 auto; font-style: normal; font-size: 11px; color: #5f7189; }
.lib-lab-read {
    margin-top: 4px; padding: 10px 13px; border-radius: 9px;
    background: rgba(125, 211, 252, 0.06);
    border-left: 3px solid rgba(125, 211, 252, 0.55);
    font-size: 12.5px; line-height: 1.8; color: #a9c7dd;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 900px) {
    .lib-tabs { margin-left: 8px; }
    .lib-tab { padding: 5px 9px; font-size: 11.5px; }
    .lib-tip-page { padding: 20px 20px 30px; }
    .lib-slider span { width: 100%; }
}

/* ============================================================
   天下第一武道会 · 拳皇式对战舞台（只在 .battle-mask.mode-arena 生效）
   ------------------------------------------------------------
   上方：双人血条 + 题目板；下方：左我右敌的擂台。
   答对 → 左侧冲刺出拳，火花 + 伤害数字 + 面板震屏；
   答错 → 右侧反击，玩家吃伤害。普通关卡不受任何影响。
   ============================================================ */
.battle-mask.mode-arena {
    padding: 0;
    background:
        radial-gradient(circle at 50% 8%, rgba(120, 40, 12, 0.5), transparent 58%),
        rgba(2, 3, 8, 0.94);
}
/* 普通关卡：场景容器不参与布局，body / stage 仍是面板的 flex 子项 */
.battle-scene { display: contents; }
.battle-mask.mode-arena .battle-figure { display: none; }
/* 擂台赛全屏：整块包住视口，题目板与选手共用同一块场景 */
.battle-mask.mode-arena .battle-panel {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: none;
    max-height: none;
    border-radius: 0;
    border: 0;
    background: linear-gradient(180deg, rgba(26, 14, 12, 0.98), rgba(8, 7, 14, 0.99));
    box-shadow: none;
}
.battle-mask.mode-arena .battle-head {
    padding: 8px 16px;
    background: transparent;
    border-bottom: 1px solid rgba(255, 156, 82, 0.12);
}
.battle-mask.mode-arena .monster { display: none; }
/* 一个图层：题目浮在擂台上方，选手站在同一块场景的左右 */
.battle-mask.mode-arena .battle-scene {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: block;
    overflow: hidden;
}
.battle-mask.mode-arena .battle-body {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: clamp(280px, 38vh, 400px);   /* 下方留出选手站位 */
    z-index: 2;
    padding: 14px clamp(14px, 3vw, 34px) 8px;
    overflow-y: auto;
}
.battle-mask.mode-arena .q-card {
    max-width: 1120px;
    margin: 0 auto;
    padding: 12px 14px;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(16, 12, 22, 0.86), rgba(10, 9, 16, 0.8));
    border: 1px solid rgba(255, 176, 96, 0.22);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(2px);
}
/* 结算页没有选手了，把给擂台让出的位置收回来 */
.battle-mask.mode-arena.arena-settled .battle-body { bottom: 0; padding-bottom: 20px; }

/* ---------- 顶部双血条 ---------- */
.kof-hud { display: none; }
.battle-mask.mode-arena .kof-hud {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 10px 14px 12px;
    background: linear-gradient(180deg, rgba(255, 122, 40, 0.16), transparent 78%);
    border-bottom: 1px solid rgba(255, 156, 82, 0.16);
}
.kof-hud[hidden] { display: none !important; }
.kh-side { flex: 1 1 0; min-width: 0; }
.kh-nm { display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.kh-p1 .kh-nm { justify-content: flex-start; }
.kh-p2 .kh-nm { justify-content: flex-end; }
.kh-nm b {
    font-size: 14px; letter-spacing: 0.04em; color: #ffe9c9;
    text-shadow: 0 2px 8px #000, 0 0 14px rgba(255, 160, 70, 0.4);
}
.kh-nm em {
    font-style: normal; font-size: 10.5px; color: #f0a97a;
    font-variant-numeric: tabular-nums;
}
.kh-bar {
    position: relative; height: 16px; border-radius: 4px; overflow: hidden;
    background: linear-gradient(180deg, #1a0d07, #2b1208);
    border: 2px solid rgba(255, 186, 118, 0.45);
    box-shadow: 0 0 14px rgba(255, 120, 40, 0.22), inset 0 2px 6px rgba(0, 0, 0, 0.75);
}
.kh-bar i {
    position: absolute; top: 0; bottom: 0; left: 0; width: 100%;
    background: linear-gradient(180deg, #ffe8a3, #f59e0b 46%, #b45309);
    box-shadow: 0 0 12px rgba(255, 176, 60, 0.6);
    transition: width 0.58s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.kh-p2 .kh-bar i {
    left: auto; right: 0;
    background: linear-gradient(180deg, #ffc0b4, #ef4444 46%, #7f1d1d);
    box-shadow: 0 0 12px rgba(255, 80, 60, 0.55);
}
.kh-mid {
    flex: 0 0 auto; min-width: 62px; align-self: stretch;
    display: flex; align-items: center; justify-content: center;
}
.kh-mid span {
    font-size: 19px; font-weight: 900; font-style: italic; letter-spacing: 0.06em;
    color: #ffd479;
    text-shadow: 0 0 16px rgba(255, 180, 60, 0.75), 0 3px 0 #7c2d12;
}

/* ---------- 擂台 ---------- */
.kof-stage {
    position: relative; flex: 0 0 clamp(230px, 38vh, 520px);
    min-height: 200px; overflow: hidden;
    display: none;
    background:
        radial-gradient(ellipse at 50% 120%, rgba(255, 140, 60, 0.24), transparent 62%),
        linear-gradient(180deg, #0a0918 0%, #171029 46%, #241018 74%, #120a0c 100%);
    border-top: 1px solid rgba(255, 156, 82, 0.24);
    border-bottom: 1px solid rgba(255, 156, 82, 0.24);
}
.battle-mask.mode-arena .kof-stage {
    display: block;
    position: absolute; inset: 0; z-index: 1;
    flex: none; height: auto; min-height: 0;
    border: 0;
}
.kof-stage[hidden] { display: none !important; }

/* 观众席：一排排暖色小点，只在上半部，压暗后像远处的灯 */
.kof-crowd {
    position: absolute; left: 0; right: 0; top: 0; height: 112px;
    background-image:
        radial-gradient(circle, rgba(255, 205, 150, 0.26) 1.4px, transparent 2px),
        radial-gradient(circle, rgba(255, 160, 90, 0.18) 1.2px, transparent 2px);
    background-size: 26px 20px, 38px 30px;
    background-position: 0 0, 12px 9px;
    opacity: 0.55;
    -webkit-mask-image: linear-gradient(180deg, #000 10%, transparent 92%);
    mask-image: linear-gradient(180deg, #000 10%, transparent 92%);
}
.kof-floor {
    position: absolute; left: 0; right: 0; bottom: 0; height: 12%; min-height: 64px;
    background:
        repeating-linear-gradient(90deg, rgba(255, 176, 110, 0.16) 0 2px, transparent 2px 88px),
        linear-gradient(180deg, rgba(255, 132, 58, 0.24), rgba(64, 20, 10, 0.55));
    border-top: 2px solid rgba(255, 194, 126, 0.44);
    box-shadow: inset 0 -18px 40px rgba(0, 0, 0, 0.55), inset 0 12px 30px rgba(255, 130, 50, 0.18);
}
.kof-fighter {
    position: absolute; bottom: 3%; height: 40%; width: 30%;
    display: flex; align-items: flex-end; justify-content: center;
    will-change: transform;
}
/* 脚下气焰：深色角色也能从背景里立起来（左金右红） */
.kof-fighter::before {
    content: ''; position: absolute; left: 50%; bottom: -4%;
    width: 128%; height: 64%; transform: translateX(-50%);
    border-radius: 50%; z-index: -1;
    background: radial-gradient(ellipse, rgba(255, 176, 70, 0.42), transparent 70%);
    filter: blur(16px);
}
.kof-p2::before {
    background: radial-gradient(ellipse, rgba(255, 70, 50, 0.46), transparent 70%);
}
.kof-p1 { left: 5%; }
.kof-p2 { right: 5%; }
/* 右侧选手镜像，面朝左边（用独立 scale 属性，不和待机动画的 transform 打架） */
.kof-p2 .kof-sprite { scale: -1 1; filter: brightness(1.1) drop-shadow(0 14px 22px rgba(0, 0, 0, 0.7)); }
.kof-p2:hover .kof-sprite { filter: brightness(1.18) drop-shadow(0 0 16px rgba(255, 170, 90, 0.6)); }
.kof-sprite {
    display: block; width: 100%; height: 100%; object-fit: contain; object-position: bottom center;
    filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.7));
    transform-origin: bottom center;
    animation: kofIdle 2.8s ease-in-out infinite;
}
.kof-p2 .kof-sprite { animation-delay: -1.1s; }
.kof-shadow {
    position: absolute; bottom: 2px; left: 50%; width: 112px; height: 16px;
    margin-left: -56px; border-radius: 50%;
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.62), transparent 72%);
}
@keyframes kofIdle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* ---------- 打击动画 ---------- */
.kof-stage.hit .kof-p1 { animation: kofDash 0.66s cubic-bezier(0.2, 0.9, 0.3, 1); }
.kof-stage.hit .kof-p2 { animation: kofHurt 0.66s ease-out; }
.kof-stage.hurt .kof-p2 { animation: kofDashBack 0.66s cubic-bezier(0.2, 0.9, 0.3, 1); }
.kof-stage.hurt .kof-p1 { animation: kofHurtLeft 0.66s ease-out; }

@keyframes kofDash {
    0% { transform: translateX(0) scale(1); }
    24% { transform: translateX(78px) scale(1.07); }
    40% { transform: translateX(78px) scale(1.07); }
    100% { transform: translateX(0) scale(1); }
}
@keyframes kofDashBack {
    0% { transform: translateX(0) scale(1); }
    24% { transform: translateX(-78px) scale(1.07); }
    40% { transform: translateX(-78px) scale(1.07); }
    100% { transform: translateX(0) scale(1); }
}
@keyframes kofHurt {
    0%, 26% { transform: translateX(0) rotate(0); filter: none; }
    32% { transform: translateX(22px) rotate(5deg); filter: brightness(2.6) saturate(0) drop-shadow(0 0 22px #fff); }
    52% { transform: translateX(52px) rotate(7deg); filter: brightness(1.7) saturate(0.6); }
    76% { transform: translateX(30px) rotate(3deg); filter: brightness(1.15); }
    100% { transform: translateX(0) rotate(0); filter: none; }
}
@keyframes kofHurtLeft {
    0%, 26% { transform: translateX(0) rotate(0); filter: none; }
    32% { transform: translateX(-22px) rotate(-5deg); filter: brightness(2.6) saturate(0) drop-shadow(0 0 22px #fff); }
    52% { transform: translateX(-52px) rotate(-7deg); filter: brightness(1.7) saturate(0.6); }
    76% { transform: translateX(-30px) rotate(-3deg); filter: brightness(1.15); }
    100% { transform: translateX(0) rotate(0); filter: none; }
}

/* ---------- 特效层 ---------- */
.kof-fx { position: absolute; inset: 0; pointer-events: none; }
.kof-spark {
    position: absolute; width: 168px; height: 168px; margin: -84px 0 0 -84px;
    background: radial-gradient(circle, #fff 0 7%, #ffe9a8 13%, rgba(255, 130, 40, 0.92) 26%, transparent 64%);
    mix-blend-mode: screen;
    animation: kofSpark 0.5s ease-out forwards;
}
@keyframes kofSpark {
    0% { transform: scale(0.18); opacity: 1; }
    55% { transform: scale(1.12); opacity: 0.95; }
    100% { transform: scale(1.55); opacity: 0; }
}
.kof-slash {
    position: absolute; width: 240px; height: 9px; margin: -4px 0 0 -120px;
    background: linear-gradient(90deg, transparent, #fff 42%, #ffd479 55%, transparent);
    transform: rotate(-34deg);
    filter: drop-shadow(0 0 10px rgba(255, 200, 110, 0.9));
    animation: kofSlash 0.36s ease-out forwards;
}
@keyframes kofSlash {
    0% { clip-path: inset(0 100% 0 0); opacity: 1; }
    65% { clip-path: inset(0 0 0 0); opacity: 1; }
    100% { clip-path: inset(0 0 0 100%); opacity: 0; }
}
.kof-dmg {
    position: absolute; transform: translate(-50%, -50%);
    font-size: 34px; font-weight: 900; font-style: italic; letter-spacing: 0.02em;
    color: #fff; white-space: nowrap;
    text-shadow: 0 0 12px #ff9d2e, 0 3px 0 #7c2d12, 0 0 34px rgba(255, 120, 40, 0.85);
    animation: kofDmg 0.86s cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
}
@keyframes kofDmg {
    0% { opacity: 0; transform: translate(-50%, -30%) scale(0.5); }
    26% { opacity: 1; transform: translate(-50%, -60%) scale(1.3); }
    100% { opacity: 0; transform: translate(-50%, -160%) scale(1); }
}
.kof-sub {
    position: absolute; transform: translate(-50%, -50%);
    font-size: 12px; font-weight: 800; letter-spacing: 0.08em;
    color: #ffd8a8; text-shadow: 0 2px 8px #000;
    animation: kofDmg 0.9s ease-out forwards;
    animation-delay: 0.06s;
}
/* 开场 / 魔王战的白字演出 */
.kof-go {
    position: absolute; left: 0; right: 0; top: 34%;
    text-align: center; pointer-events: none;
    font-size: 52px; font-weight: 900; font-style: italic; letter-spacing: 0.1em;
    color: #fff;
    text-shadow: 0 0 22px rgba(255, 180, 80, 0.95), 0 5px 0 #7f1d1d, 0 0 60px rgba(255, 120, 40, 0.6);
    animation: kofGo 0.95s cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
}
@keyframes kofGo {
    0% { opacity: 0; transform: scale(1.9); letter-spacing: 0.5em; }
    30% { opacity: 1; transform: scale(1); letter-spacing: 0.1em; }
    72% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.06); }
}
.battle-panel.shake { animation: kofShake 0.42s ease-in-out; }
@keyframes kofShake {
    0%, 100% { transform: translate(0, 0) rotate(0); }
    18% { transform: translate(-7px, 4px) rotate(-0.35deg); }
    38% { transform: translate(6px, -4px) rotate(0.35deg); }
    58% { transform: translate(-5px, 3px) rotate(-0.2deg); }
    78% { transform: translate(3px, -2px) rotate(0.1deg); }
}

@media (max-width: 720px) {
    .battle-mask.mode-arena .kof-hud { padding: 8px 10px 10px; gap: 6px; }
    .kh-nm b { font-size: 12px; }
    .kh-nm em { font-size: 9.5px; }
    .kh-bar { height: 12px; }
    .kh-mid { min-width: 42px; }
    .kh-mid span { font-size: 15px; }
    .kof-crowd { height: 30%; }
    .kof-floor { height: 16%; min-height: 52px; }
    .kof-fighter { height: 38%; bottom: 3%; width: 44%; }
    .kof-p1 { left: 1%; }
    .kof-p2 { right: 1%; }
    .kof-dmg { font-size: 26px; }
    .battle-mask.mode-arena .battle-body {
        bottom: clamp(250px, 36vh, 330px);
        padding: 10px 10px 8px;
    }
    .battle-mask.mode-arena .q-card { padding: 10px 10px; }
}
/* 矮屏（手机横屏 / 小笔记本）把题目区留多一点 */
@media (max-height: 700px) {
    .battle-mask.mode-arena .battle-body { bottom: clamp(220px, 40vh, 320px); }
    .kof-fighter { height: 36%; }
    .kof-go { font-size: 38px; top: 24%; }
}

