        @import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Roboto:wght@400;500&display=swap');

        :root {
            --bg-color: #050505;
            --ui-border: #4a3b2a;
            --text-gold: #c7b377;
            --text-red: #c23b22;
            --text-blue: #4d69cd;
            --item-unique: #908858;
            --item-rare: #ffff00;
            --item-magic: #4850b8;
            --item-normal: #ffffff;
        }

        body {
            margin: 0;
            overflow: hidden;
            background-color: var(--bg-color);
            color: #ccc;
            font-family: 'Cinzel', serif;
            user-select: none;
            -webkit-user-select: none;
        }

        #game-container {
            position: relative;
            width: 100vw;
            height: 100vh;
            background: #000;
        }

        canvas {
            display: block;
            image-rendering: pixelated;
        }

        /* 濒危视觉警告：低HP时屏幕边缘红光 */
        #low-hp-vignette {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.3s ease;
            box-shadow: inset 0 0 150px 60px rgba(180, 0, 0, 0.7);
            z-index: 50;
        }

        #low-hp-vignette.active {
            opacity: 1;
            animation: lowHpPulse 1.2s ease-in-out infinite;
        }

        @keyframes lowHpPulse {

            0%,
            100% {
                box-shadow: inset 0 0 120px 40px rgba(180, 0, 0, 0.5);
            }

            50% {
                box-shadow: inset 0 0 180px 80px rgba(220, 0, 0, 0.8);
            }
        }

        .ui-layer {
            position: absolute;
            pointer-events: none;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
        }

        #minimap-container {
            position: absolute;
            top: 20px;
            right: 20px;
            width: 150px;
            height: 150px;
            border: 2px solid var(--ui-border);
            background: rgba(0, 0, 0, 0.8);
            border-radius: 4px;
            overflow: hidden;
            pointer-events: auto;
            z-index: 50;
            /* 立体光影 */
            box-shadow:
                0 0 15px rgba(0, 0, 0, 0.8),
                inset 0 0 20px rgba(0, 0, 0, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.03);
        }

        #minimap {
            width: 100%;
            height: 100%;
            display: block;
        }

        #bottom-hud {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 140px;
            background: linear-gradient(to top, #111 0%, transparent 100%);
            display: flex;
            justify-content: space-between;
            align-items: flex-end;
            padding: 0 20px 10px;
            box-sizing: border-box;
            pointer-events: auto;
        }

        .orb-container {
            width: 130px;
            height: 130px;
            position: relative;
            background: #000;
            border-radius: 50%;
            /* 外部边框模拟金属镶嵌 */
            box-shadow:
                0 0 10px #000,
                inset 0 0 20px #000;
            overflow: hidden;
            z-index: 10;
        }

        /* 玻璃反光层 (高光) */
        .orb-container::after {
            content: '';
            position: absolute;
            top: 10%;
            left: 15%;
            width: 30%;
            height: 20%;
            border-radius: 50%;
            background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0) 70%);
            transform: rotate(-45deg);
            pointer-events: none;
            z-index: 5;
        }

        /* 玻璃底部反光 (Frestnel Effect) */
        .orb-container::before {
            content: '';
            position: absolute;
            bottom: 5%;
            left: 20%;
            width: 60%;
            height: 20%;
            border-radius: 50%;
            background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0) 70%);
            pointer-events: none;
            z-index: 5;
        }

        .orb-fill {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            transition: height 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
        }

        #health-orb .orb-fill {
            /* 更加深邃和立体的红色液体 */
            background: linear-gradient(to top, #4a0000 0%, #8a0e0e 50%, #ff4d4d 100%);
            box-shadow: 0 0 30px #ff0000 inset;
        }

        #health-orb {
            border: 3px solid #522;
        }

        #mana-orb .orb-fill {
            /* 更加深邃和立体的蓝色液体 */
            background: linear-gradient(to top, #001a4d 0%, #0e2a8a 50%, #4d94ff 100%);
            box-shadow: 0 0 30px #0055ff inset;
        }

        #mana-orb {
            border: 3px solid #225;
        }

        .orb-text {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-weight: bold;
            font-size: 18px;
            color: #fff;
            text-shadow: 0 0 5px #000, 0 0 10px #000;
            z-index: 6;
            pointer-events: none;
        }

        #center-hud {
            display: flex;
            flex-direction: column;
            align-items: center;
            /* 稍微下移以贴合屏幕底部 */
            padding-bottom: 5px;
            gap: 2px;
            flex: 1;
            max-width: 600px;
            margin: 0 10px;
            position: relative;
            z-index: 5;
        }

        /* 装饰性纹理 */
        #center-hud::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.05'/%3E%3C/svg%3E");
            opacity: 0.3;
            pointer-events: none;
            z-index: -1;
        }

        /* 经验浮动区（D 方案 2026-08-17）：Base/Job 经验 + Zeny 贴经验条上方，竖排淡入淡出 */
        #job-xp-container { position: relative; }
        .exp-feed {
            position: absolute;
            left: 0; right: 0; bottom: calc(100% + 4px);
            display: flex; flex-direction: column; align-items: center;
            gap: 1px; pointer-events: none; z-index: 6;
        }
        .exp-feed .feed-item {
            font-size: 12px; font-weight: 700; text-shadow: 1px 1px 2px #000;
            padding: 1px 8px; border-radius: 4px; background: rgba(0,0,0,0.45);
            animation: feedIn 2.6s ease-out forwards;
            white-space: nowrap;
        }
        @keyframes feedIn {
            0% { opacity: 0; transform: translateY(6px); }
            8% { opacity: 1; transform: translateY(0); }
            80% { opacity: 1; }
            100% { opacity: 0; transform: translateY(-10px); }
        }

        /* 右侧最近获得面板（D 方案 2026-08-17）：掉落/Zeny 记录，逐条淡入，保留可回看 */
        #loot-feed { pointer-events: none; }
        #loot-feed .loot-item {
            font-size: 12px; padding: 3px 8px; border-radius: 4px;
            background: rgba(10, 10, 14, 0.72); border-left: 3px solid #4a4a55;
            color: #e8e8e8; text-shadow: 1px 1px 2px #000; white-space: nowrap;
            animation: lootIn 4s ease-out forwards;
        }
        #loot-feed .loot-item.kind-card  { border-left-color: #c084fc; }
        #loot-feed .loot-item.kind-equip { border-left-color: #fbbf24; }
        #loot-feed .loot-item.kind-mat   { border-left-color: #4ade80; }
        #loot-feed .loot-item.kind-zeny  { border-left-color: #ffd700; }
        @keyframes lootIn {
            0% { opacity: 0; transform: translateX(20px); }
            6% { opacity: 1; transform: translateX(0); }
            88% { opacity: 1; }
            100% { opacity: 0; }
        }

        .belt-bar {
            display: flex;
            gap: 5px;
            margin-bottom: 2px;
            background: #000;
            padding: 4px;
            border: 1px solid #333;
            border-radius: 4px;
            margin-top: 5px;
        }

        .belt-slot {
            width: 58px;
            height: 38px;
            background: #080808;
            border: 1px solid #444;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            position: relative;
            cursor: pointer;
            font-size: 16px;
            gap: 1px;
            box-shadow: inset 0 0 5px #000;
        }

        .belt-slot:hover {
            border-color: var(--text-gold);
        }

        .belt-icon {
            font-size: 14px;
            line-height: 1;
            width: 28px;
            height: 28px;
            background-repeat: no-repeat;
            background-position: center;
            background-size: contain;
        }

        .belt-name {
            font-size: 10px;
            color: #ccc;
            line-height: 1;
            width: 100%;
            text-align: center;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            padding: 0 2px;
        }

        .belt-key {
            position: absolute;
            top: -8px;
            left: 50%;
            transform: translateX(-50%);
            font-size: 10px;
            color: #888;
            background: #000;
            padding: 0 3px;
            z-index: 5;
        }

        .belt-count {
            position: absolute;
            bottom: 0;
            right: 2px;
            font-size: 10px;
            color: #fff;
            font-weight: bold;
            text-shadow: 1px 1px 0 #000;
            z-index: 5;
        }

        .xp-container {
            width: 95%;
            /* 稍微加宽 */
            display: flex;
            align-items: center;
            gap: 5px;
            margin: 2px auto;
        }

        .xp-bar {
            flex: 1;
            height: 8px;
            background: #222;
            border: 1px solid #444;
            border-radius: 4px;
            position: relative;
            overflow: hidden;
        }

        .xp-fill {
            height: 100%;
            background: #c7b377;
            width: 0%;
            transition: width 0.45s cubic-bezier(0.34, 1.4, 0.5, 1);   /* 弹性曲线：获得经验时"先涨后微弹"（2026-08-17） */
        }

        .job-xp-fill {
            background: #4d94ff;
        }

        .job-level-display {
            color: #4d94ff;
        }

        .xp-percentage {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 9px;
            color: var(--text-gold);
            font-weight: bold;
            text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
            pointer-events: none;
        }

        .level-display {
            color: var(--text-gold);
            font-weight: bold;
            font-size: 14px;
            white-space: nowrap;
            min-width: 70px;
            text-align: right;
        }

        .skill-bar {
            display: flex;
            gap: 3px;
            margin-top: 2px;
            margin-bottom: 5px;
            background: #000;
            padding: 4px;
            border: 1px solid #333;
            border-radius: 4px;
        }

        .skill-btn {
            width: 42px;
            height: 42px;
            background: #1a1a1a;
            border: 2px solid #444;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 11px;
            color: #888;
            cursor: pointer;
            position: relative;
            box-shadow: inset 0 0 10px #000;
            transition: all 0.1s;
        }

        /* 技能按钮按下效果 */
        .skill-btn:active {
            transform: scale(0.95);
            box-shadow: inset 0 0 15px #000;
            border-color: #222;
        }

        .skill-btn.active {
            border-color: var(--text-gold);
            color: var(--text-gold);
        }

        .skill-btn .key {
            position: absolute;
            top: 2px;
            left: 2px;
            font-size: 10px;
            color: #fff;
        }

        .skill-btn .lvl {
            position: absolute;
            bottom: 2px;
            right: 2px;
            font-size: 10px;
            color: #aaa;
        }

        /* 扇形CD遮罩 */
        .skill-btn .cd-sweep {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            border-radius: 4px;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.1s;
        }

        .skill-btn .cd-sweep.active {
            opacity: 1;
            background: conic-gradient(rgba(0, 0, 0, 0.85) var(--cd-progress, 0%),
                    transparent var(--cd-progress, 0%));
        }

        .skill-btn .cd-time {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 14px;
            font-weight: bold;
            color: #fff;
            text-shadow: 0 0 4px #000, 0 0 8px #000;
            z-index: 2;
            opacity: 0;
            pointer-events: none;
        }

        .skill-btn .cd-time.active {
            opacity: 1;
        }
        .skill-btn .cd-time.urgent {
            color: #ff5555;
        }

        /* 技能按钮点击波纹效果 */
        .skill-btn::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 0;
            height: 0;
            background: radial-gradient(circle, rgba(255, 200, 100, 0.6) 0%, transparent 70%);
            border-radius: 50%;
            transform: translate(-50%, -50%);
            opacity: 0;
            transition: width 0.3s, height 0.3s, opacity 0.3s;
        }

        .skill-btn.clicked::after {
            width: 80px;
            height: 80px;
            opacity: 0;
        }

        /* 增强按下效果 */
        .skill-btn:active {
            transform: scale(0.9) translateY(2px);
            box-shadow: inset 0 0 20px #000, inset 0 5px 10px rgba(0, 0, 0, 0.8);
            border-color: #222;
            filter: brightness(0.8);
        }

        /* 腰带格子点击效果 */
        .belt-slot {
            transition: all 0.1s;
        }

        .belt-slot:active {
            transform: scale(0.92) translateY(2px);
            filter: brightness(0.7);
        }

        .panel {
            position: absolute;
            background: rgba(10, 10, 12, 0.95);
            border: 2px solid var(--ui-border);
            user-select: none;   /* 防文本选择吞 click（点装备名/文字不再选中） */
            /* 立体光影：外阴影 + 内阴影 + 边缘高光 */
            box-shadow:
                0 0 20px rgba(0, 0, 0, 0.9),
                0 8px 32px rgba(0, 0, 0, 0.7),
                inset 0 1px 0 rgba(255, 255, 255, 0.05),
                inset 0 0 60px rgba(0, 0, 0, 0.5),
                inset 0 -2px 10px rgba(0, 0, 0, 0.3);
            padding: 15px;
            color: var(--text-gold);
            pointer-events: auto;
            display: none;
            width: 320px;
            z-index: 60;
        }

        .panel-header {
            text-align: center;
            font-size: 1.2em;
            margin-bottom: 15px;
            border-bottom: 1px solid var(--ui-border);
            padding-bottom: 5px;
            cursor: move;
            user-select: none;
        }

        .panel-close {
            position: absolute;
            top: 8px;
            right: 10px;
            cursor: pointer;
            width: 22px;
            height: 22px;
            border-radius: 50%;
            /* 红色宝石渐变 */
            background: radial-gradient(circle at 30% 30%, #ff6666 0%, #cc2222 50%, #880000 100%);
            border: 2px solid #4a3b2a;
            box-shadow:
                0 0 3px rgba(0, 0, 0, 0.8),
                inset 0 -2px 4px rgba(0, 0, 0, 0.4),
                inset 0 2px 4px rgba(255, 255, 255, 0.2);
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            font-size: 12px;
            font-weight: bold;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
            transition: all 0.15s ease;
        }

        .panel-close:hover {
            background: radial-gradient(circle at 30% 30%, #ff8888 0%, #ee3333 50%, #aa0000 100%);
            box-shadow:
                0 0 8px rgba(255, 0, 0, 0.5),
                inset 0 -2px 4px rgba(0, 0, 0, 0.4),
                inset 0 2px 4px rgba(255, 255, 255, 0.3);
            transform: scale(1.1);
        }

        .panel-close:active {
            transform: scale(0.95);
            box-shadow:
                0 0 3px rgba(0, 0, 0, 0.8),
                inset 0 2px 4px rgba(0, 0, 0, 0.5);
        }

        #stats-panel {
            top: 10%;
            left: 20px;
        }

        .stat-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 8px;
            font-size: 0.9em;
        }

        .stat-btn {
            background: #2a2418;
            border: 1.5px solid #d4af37;
            width: 32px;
            height: 26px;
            line-height: 22px;
            text-align: center;
            cursor: pointer;
            color: #ffd700;
            font-weight: bold;
            font-size: 18px;
            border-radius: 3px;
            margin-left: 4px;
            padding: 0;
            box-shadow: 0 0 4px rgba(212, 175, 55, 0.4);
        }

        .stat-btn:hover { background: #4a3a20; border-color: #fff; color: #fff; box-shadow: 0 0 8px rgba(255, 215, 0, 0.8); }
        .stat-btn:disabled { background: #1a1a1a; color: #000; border-color: #222; cursor: not-allowed; box-shadow: none; }

        .stat-cost {
            color: var(--text-blue);
            font-size: 0.85em;
            margin-right: 4px;
            user-select: none;
        }

        /* 角色面板分组卡片（2026-08-24 信息分组：职业/素质/战斗/抗性） */
        .stat-group {
            background: rgba(0, 0, 0, 0.28);
            border: 1px solid #3a3326;
            border-radius: 6px;
            padding: 8px 10px;
            margin-bottom: 10px;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
        }
        .stat-group:last-of-type { margin-bottom: 0; }
        .stat-group-title {
            font-family: 'Cinzel', serif;
            color: var(--text-gold);
            font-size: 0.82em;
            font-weight: bold;
            letter-spacing: 1px;
            text-align: center;
            margin: -2px 0 8px;
            padding-bottom: 4px;
            border-bottom: 1px solid #3a3326;
            text-shadow: 0 1px 2px #000;
        }

        #inventory-panel {
            top: 10%;
            right: 20px;
            width: 320px;
        }

        .equipment-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 6px;
            margin-bottom: 20px;
            justify-items: center;
        }

        .equip-slot, .ro-equip-slot {
            width: 48px;
            height: 48px;
            border: 1px solid #444;
            background: #080808;
            display: none;
            align-items: center;
            justify-content: center;
            position: relative;
            cursor: pointer;
            overflow: hidden;
        }

        .equip-slot-placeholder { width: 48px; height: 48px; }
        body:not(.ro-mode) .equip-slot { display: flex; }
        body:not(.ro-mode) .ro-equip-slot { display: none; }
        body.ro-mode .equip-slot { display: none; }
        body.ro-mode .equip-slot-placeholder { display: none; }
        body.ro-mode .equipment-grid {
            grid-template-columns: repeat(5, 1fr);
            gap: 4px;
        }
        body.ro-mode .ro-equip-slot {
            display: flex;
            width: 48px;
            height: 48px;
            font-size: 9px;
        }
        .ro-equip-slot img,
        .ro-equip-slot .item-sprite {
            max-width: 36px;
            max-height: 36px;
        }

        /* RO 技能树面板：RO 模式隐藏暗黑技能，显示 RO 树 */
        body.ro-mode #diablo-skills { display: none; }
        body:not(.ro-mode) #ro-skill-tree { display: none; }
        #ro-skill-tree {
            max-height: 460px;
            overflow-y: auto;
            padding-right: 4px;
        }
        .ro-skill-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            padding: 6px 8px;
            margin-bottom: 6px;
            background: rgba(20, 16, 12, 0.7);
            border: 1px solid #3a2f24;
            border-radius: 4px;
        }
        .ro-skill-row.locked { opacity: 0.5; }
        .ro-skill-row > div:nth-child(2) { flex: 1; min-width: 0; }   /* 中间容器占满剩余空间，让 Lv 列稳定贴右 */
        .ro-skill-ico {
            flex: 0 0 36px;
            width: 36px;
            height: 36px;
            margin-right: 8px;
            border: 1px solid #3a3a42;
            border-radius: 4px;
            background-color: #14110c;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            image-rendering: pixelated;
        }
        .ro-skill-name { font-size: 12px; color: #ffe9b0; font-weight: bold; white-space: normal; overflow: visible; }
        .ro-skill-meta { font-size: 10px; color: #aaa; margin-top: 2px; white-space: normal; overflow: visible; }
        .ro-skill-lv { font-size: 12px; color: #fff; white-space: nowrap; display: flex; align-items: center; gap: 6px; justify-content: flex-end; flex-shrink: 0; min-width: 95px; }
        .ro-skill-branch { font-size: 10px; color: #c9a; margin: 10px 0 4px; border-bottom: 1px solid #3a2f24; padding-bottom: 2px; }

        .bag-grid {
            display: grid;
            grid-template-columns: repeat(6, 1fr);
            gap: 4px;
        }

        .stash-grid {
            display: grid;
            grid-template-columns: repeat(6, 1fr);
            gap: 4px;
        }

        .bag-slot {
            width: 48px;
            height: 48px;
            border: 1px solid #333;
            background: #080808;
            position: relative;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            user-select: none;
        }

        /* 拖拽中的格：半透 + 红边框 */
        .bag-slot.dragging { opacity: 0.45; border-color: #a04040; }

        /* 丢弃区：宽 6 列网格（与 bag-grid 对齐），醒目的红色虚线 + 半透红填充 */
        .bag-trash {
            margin-top: 6px;
            height: 56px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            font-size: 12px;
            color: #ff8a8a;
            background: rgba(60, 20, 20, 0.55);
            border: 2px dashed #8a3a3a;
            border-radius: 5px;
            user-select: none;
            transition: background 0.12s, border-color 0.12s, transform 0.12s;
        }
        .bag-trash-icon { font-size: 22px; line-height: 1; }
        .bag-trash-text { color: #c98a8a; }
        /* drag 元素进入：高亮（红实心边框 + 提亮背景） */
        .bag-trash.drag-over {
            background: rgba(120, 30, 30, 0.75);
            border-color: #ff5050;
            border-style: solid;
            transform: scale(1.015);
        }
        .bag-trash.drag-over .bag-trash-icon { transform: scale(1.2); }
        .bag-trash.drag-over .bag-trash-text { color: #fff; }

        /* 背包翻页条（6x6 分页：上一页 / 页码 / 下一页） */
        .bag-pager {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            margin: 6px 0 4px;
            padding: 4px 6px;
            background: rgba(0, 0, 0, 0.45);
            border: 1px solid #333;
            border-radius: 5px;
        }
        .bag-pager-btn {
            background: #2a3a4a;
            color: #9fd3ff;
            border: 1px solid #3a5a7a;
            border-radius: 4px;
            padding: 3px 10px;
            font-size: 11px;
            cursor: pointer;
            white-space: nowrap;
        }
        .bag-pager-btn:hover:not(:disabled) { background: #34506a; }
        .bag-pager-btn:disabled { opacity: 0.35; cursor: not-allowed; }
        .bag-pager-ind { font-size: 11px; color: #c9b37a; white-space: nowrap; }
        .bag-pager-ind b { color: #ffcc00; }

        .item-count {
            position: absolute;
            bottom: 2px;
            right: 2px;
            color: #fff;
            font-size: 10px;
            font-weight: bold;
            text-shadow: 1px 1px 0 #000;
        }

        #skills-panel {
            top: 15%;
            left: 340px;
            width: 400px;
        }

        .skill-row {
            display: flex;
            align-items: center;
            margin-bottom: 15px;
            background: rgba(0, 0, 0, 0.3);
            padding: 5px;
            border: 1px solid #333;
        }

        .skill-icon {
            width: 40px;
            height: 40px;
            background: #222;
            border: 1px solid #555;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 20px;
            margin-right: 10px;
        }

        /* Skill Sprites */
        .skill-sprite {
            width: 32px;
            height: 32px;
            background-image: url('skills.png');
            background-size: 400% 100%;
            background-repeat: no-repeat;
            display: inline-block;
            vertical-align: middle;
            image-rendering: pixelated;
        }

        .skill-attack {
            background-position: 0% 0%;
        }

        .skill-fireball {
            background-position: 33.333% 0%;
        }

        .skill-thunder {
            background-position: 66.666% 0%;
        }

        .skill-multishot {
            background-position: 100% 0%;
        }

        .skill-info {
            flex: 1;
        }

        .skill-name {
            font-weight: bold;
            color: var(--text-gold);
            font-size: 0.9em;
        }

        .skill-desc {
            font-size: 0.7em;
            color: #888;
        }

        #shop-panel {
            top: 10%;
            left: 50%;
            transform: translateX(-50%);
            width: 400px;
        }

        .gamble-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 10px;
            margin-top: 10px;
        }

        .gamble-slot {
            background: #111;
            border: 1px solid #444;
            padding: 10px;
            text-align: center;
            cursor: pointer;
            transition: background 0.2s;
        }

        .gamble-slot:hover {
            background: #222;
            border-color: var(--text-gold);
        }

        .gamble-price {
            color: gold;
            font-size: 0.9em;
            margin-top: 5px;
        }

        .shop-item-icon {
            width: 32px;
            height: 32px;
            margin: 0 auto 5px auto;
            background-image: url('/client/assets/items.png?v=kro12');
            background-size: 400% 400%;
            background-repeat: no-repeat;
            image-rendering: pixelated;
        }

        .shop-section-title {
            text-align: center;
            color: #888;
            font-size: 12px;
            margin-top: 10px;
            margin-bottom: 5px;
            border-bottom: 1px solid #333;
            padding-bottom: 2px;
        }

        #quest-panel {
            top: 15%;
            left: 20px;
            width: 300px;
            max-height: 85%;
            overflow-y: auto;
        }

        #achievements-panel {
            top: 10%;
            left: 20px;
            width: 350px;
            max-height: 85%;
            overflow-y: auto;
        }

        /* 自定义滚动条样式 */
        #achievements-panel::-webkit-scrollbar {
            width: 8px;
        }

        #achievements-panel::-webkit-scrollbar-track {
            background: rgba(0, 0, 0, 0.3);
            border-radius: 4px;
        }

        #achievements-panel::-webkit-scrollbar-thumb {
            background: #444;
            border-radius: 4px;
            border: 1px solid #666;
        }

        #achievements-panel::-webkit-scrollbar-thumb:hover {
            background: #555;
        }

        /* Firefox支持 */
        #achievements-panel {
            scrollbar-width: thin;
            scrollbar-color: #444 rgba(0, 0, 0, 0.3);
        }

        /* 任务面板自定义滚动条样式 */
        #quest-panel::-webkit-scrollbar {
            width: 8px;
        }

        #quest-panel::-webkit-scrollbar-track {
            background: rgba(0, 0, 0, 0.3);
            border-radius: 4px;
        }

        #quest-panel::-webkit-scrollbar-thumb {
            background: #444;
            border-radius: 4px;
            border: 1px solid #666;
        }

        #quest-panel::-webkit-scrollbar-thumb:hover {
            background: #555;
        }

        /* Firefox支持 */
        #quest-panel {
            scrollbar-width: thin;
            scrollbar-color: #444 rgba(0, 0, 0, 0.3);
        }

        .achievement-item {
            padding: 10px;
            margin-bottom: 10px;
            background: rgba(0, 0, 0, 0.3);
            border: 1px solid #333;
            border-radius: 5px;
        }

        .achievement-item.completed {
            border-color: var(--text-gold);
            background: rgba(218, 165, 32, 0.1);
        }

        .achievement-item.completed::before {
            content: "✓ ";
            color: var(--text-gold);
            font-weight: bold;
            margin-right: 5px;
        }

        .ach-name {
            color: var(--text-gold);
            font-size: 14px;
            font-weight: bold;
            margin-bottom: 5px;
        }

        .ach-desc {
            color: #aaa;
            font-size: 12px;
            margin-bottom: 5px;
        }

        .ach-progress {
            color: #888;
            font-size: 11px;
            text-align: right;
        }

        #stash-panel {
            top: 15%;
            right: 20px;
            left: auto;
            width: 350px;
        }

        .quest-item {
            border: 1px solid #444;
            padding: 10px;
            margin-bottom: 10px;
            background: rgba(0, 0, 0, 0.5);
        }

        .quest-title {
            color: var(--text-gold);
            font-weight: bold;
            margin-bottom: 5px;
        }

        .quest-status {
            font-size: 0.8em;
            color: #888;
        }

        .quest-status.completed {
            color: #00ff00;
        }

        #dialog-box {
            position: absolute;
            bottom: 160px;
            left: 50%;
            transform: translateX(-50%);
            width: 500px;
            background: rgba(0, 0, 0, 0.9);
            border: 2px solid var(--ui-border);
            padding: 20px;
            color: #ccc;
            display: none;
            z-index: 100;
            pointer-events: auto;
            /* 立体光影 */
            box-shadow:
                0 0 25px rgba(0, 0, 0, 0.9),
                0 10px 40px rgba(0, 0, 0, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.05),
                inset 0 0 50px rgba(0, 0, 0, 0.4);
        }

        .dialog-name {
            color: var(--text-gold);
            font-weight: bold;
            margin-bottom: 10px;
            font-size: 1.2em;
        }

        .dialog-text {
            margin-bottom: 20px;
            line-height: 1.5;
        }

        .dialog-options {
            display: flex;
            flex-wrap: wrap;
            gap: 6px 8px;
            justify-content: flex-end;
        }

        .dialog-btn {
            background: #333;
            border: 1px solid #555;
            color: #fff;
            padding: 5px 12px;
            cursor: pointer;
            font-family: 'Cinzel', serif;
            max-width: 160px;   /* 单按钮最大宽度（避免挤超容器） */
            white-space: nowrap;
            font-size: 13px;
        }

        .dialog-btn:hover {
            border-color: var(--text-gold);
            color: var(--text-gold);
        }

        .drop-label {
            position: absolute;
            background: rgba(0, 0, 0, 0.7);
            padding: 2px 5px;
            border: 1px solid #333;
            font-size: 12px;
            cursor: pointer;
            transform: translate(-50%, -50%);
            z-index: 10;
            pointer-events: auto;
        }

        .drop-label:hover {
            background: rgba(50, 50, 50, 0.9);
            border-color: #666;
        }

        #tooltip {
            position: fixed;
            background: rgba(5, 5, 8, 0.95);
            border: 1px solid var(--text-gold);
            padding: 10px;
            pointer-events: none;
            z-index: 9999;
            display: none;
            max-width: 280px;
            max-height: 72vh;
            overflow-y: auto;
            font-size: 14px;
            /* 立体光影 */
            box-shadow:
                0 0 20px rgba(0, 0, 0, 0.9),
                0 5px 25px rgba(0, 0, 0, 0.7),
                inset 0 1px 0 rgba(255, 255, 255, 0.05),
                inset 0 0 30px rgba(0, 0, 0, 0.4);
        }

        .tooltip-title {
            font-weight: bold;
            margin-bottom: 5px;
        }

        .tooltip-type {
            color: #888;
            font-size: 12px;
            margin-bottom: 5px;
        }

        .tooltip-stat {
            color: #aaa;
            display: block;
        }

        .tt-action {
            color: #ffcc00;
            cursor: pointer;
            margin-top: 4px;
            font-size: 12px;
            border-top: 1px dashed #555;
            padding-top: 4px;
        }
        .tt-action:hover { color: #fff; text-decoration: underline; }
        /* 装备详情分区（照旧游戏 eqDetailHTML，暗色适配） */
        .eq-sec {
            font-weight: 700; font-size: 12px; color: #7dd3fc;
            margin: 8px 0 3px; border-left: 3px solid #3a6ea8; padding-left: 6px;
        }
        .eq-grid { display: grid; grid-template-columns: 5em 1fr; gap: 2px 10px; font-size: 12px; }   /* 固定 k 列 5em（4 中文字），保证所有 grid 块对齐 */
        .eq-grid .k { color: #8a8a8a; white-space: nowrap; }
        .eq-grid .v { color: #e8e8e8; }
        .eq-grid .v.hl { color: #ffd700; font-weight: 700; }
        .eq-cond { font-size: 12px; color: #cbd5e1; line-height: 1.7; }

        .tooltip-desc {
            color: #cbd5e1;
            font-size: 12px;
            line-height: 1.5;
            margin-top: 6px;
            border-top: 1px dashed #333;
            padding-top: 6px;
        }
        .tooltip-subhead {
            color: #ffcc00;
            font-size: 11px;
            margin-top: 8px;
            margin-bottom: 2px;
        }
        .tooltip-level {
            font-size: 11px;
            color: #ddd;
            line-height: 1.5;
            padding: 1px 0;
        }

        .card-embed-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 6px 8px;
            margin-bottom: 4px;
            background: #2a2a32;
            border: 1px solid #444;
            border-radius: 4px;
            cursor: pointer;
            font-size: 13px;
        }
        .card-embed-row:hover { border-color: #ffcc00; background: #33333d; }

        /* 铁匠忽克连面板 */
        .huklen-tabs { display: flex; gap: 6px; margin-bottom: 10px; }
        .huklen-tab { flex: 1; background: #2a2a33; color: #aaa; border: 1px solid #444; border-radius: 5px; padding: 6px; cursor: pointer; font-size: 13px; }
        .huklen-tab.active { background: #c8923a; color: #1a1a1f; font-weight: bold; border-color: #ffcc66; }
        .huklen-row { border: 1px solid #555; border-radius: 5px; padding: 7px 9px; margin-bottom: 6px; background: #23232b; }
        .huklen-row:hover { border-color: #ffcc66; }
        .huklen-row .nm { color: #fff; font-size: 13px; font-weight: bold; }
        .huklen-row .ds { color: #bbb; font-size: 11px; margin-top: 2px; }
        .huklen-ore-btn { display: block; width: 100%; text-align: left; background: #2a2a33; color: #ddd; border: 1px solid #555; border-radius: 5px; padding: 6px 8px; margin-top: 5px; cursor: pointer; font-size: 12px; }
        .huklen-ore-btn:hover { border-color: #ffcc66; background: #33333d; }
        .huklen-ore-btn:disabled { opacity: .5; cursor: not-allowed; }
        .huklen-note { color: #9fe0a8; font-size: 11px; margin: 6px 0; }
        .huklen-empty { color: #888; font-size: 13px; text-align: center; padding: 20px; }

        #notification-area {
            position: absolute;
            top: 60px;
            left: 50%;
            transform: translateX(-50%);
            color: var(--text-gold);
            font-size: 16px;
            text-shadow: 0 0 5px #000;
            pointer-events: none;
            transition: opacity 0.5s;
            opacity: 0;
            text-align: center;
        }

        #interaction-msg {
            position: absolute;
            top: 70%;
            left: 50%;
            transform: translate(-50%, -50%);
            color: #fff;
            font-size: 18px;
            font-weight: bold;
            text-shadow: 0 0 5px #000;
            pointer-events: none;
            display: none;
            z-index: 100;
            background: rgba(0, 0, 0, 0.7);
            padding: 8px 16px;
            border: 1px solid #c7b377;
            border-radius: 4px;
            font-family: 'Cinzel', serif;
        }

        #floor-display {
            position: absolute;
            top: 20px;
            left: 20px;
            color: #bbb;
            font-size: 1.4em;
            font-weight: bold;
            text-shadow: 2px 2px 0 #000;
            pointer-events: none;
            z-index: 10;
        }

        /* 任务追踪器位于左侧下方 */
        #quest-tracker {
            position: absolute;
            top: 60px;
            left: 20px;
            text-align: left;
            pointer-events: none;
            z-index: 10;
            max-width: 300px;
        }

        .tracker-title {
            color: #c7b377;
            font-weight: bold;
            font-size: 14px;
            text-shadow: 1px 1px 0 #000;
        }

        .tracker-desc {
            color: #aaa;
            font-size: 12px;
            margin-top: 2px;
            text-shadow: 1px 1px 0 #000;
        }

        .menu-btns {
            position: absolute;
            bottom: 150px;
            right: 20px;
            display: flex;
            flex-direction: column;
            gap: 5px;
            pointer-events: auto;
        }

        .sys-btn {
            background: #222;
            border: 1px solid #555;
            color: #aaa;
            padding: 5px 10px;
            cursor: pointer;
            font-family: 'Cinzel', serif;
            position: relative;
        }

        .sys-btn:hover {
            border-color: var(--text-gold);
            color: var(--text-gold);
        }

        .notification-badge {
            position: absolute;
            top: -3px;
            right: -3px;
            width: 10px;
            height: 10px;
            background-color: #ff3333;
            border-radius: 50%;
            box-shadow: 0 0 4px #ff0000;
            display: none;
        }

        #start-screen {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: #000;
            z-index: 200;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            pointer-events: auto;
            overflow: hidden;
        }

        /* 视频背景 */
        #start-screen-video {
            position: absolute;
            top: 50%;
            left: 50%;
            min-width: 100%;
            min-height: 100%;
            width: auto;
            height: auto;
            transform: translate(-50%, -50%);
            z-index: 0;
            object-fit: cover;
        }

        /* 视频遮罩层，确保文字清晰可见 */
        #start-screen::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.4);
            z-index: 0;
        }

        #start-screen>*:not(video) {
            position: relative;
            z-index: 1;
            transform: translateY(200px);
        }

        #floating-texts-container {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 10000;
            /* 确保在最上层 */
        }

        .floating-text {
            position: absolute;
            font-weight: bold;
            font-size: 14px;
            text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
            pointer-events: none;
            transform: translate(-50%, -50%);
            transition: none;
        }

        h1 {
            color: #8a0e0e;
            font-size: 4em;
            margin-bottom: 0;
            text-shadow: 0 0 20px #ff0000;
            letter-spacing: 5px;
        }

        h2 {
            color: #555;
            margin-top: 0;
            font-size: 1.2em;
        }

        #welcome-back {
            color: #ffcc00;
            font-size: 1.2em;
            font-family: 'Cinzel', serif;
            text-shadow: 0 0 10px #ff6600;
        }

        .start-btn {
            margin-top: 20px;
            padding: 15px 40px;
            background: #111;
            border: 2px solid #8a0e0e;
            color: #ccc;
            font-size: 1.5em;
            cursor: pointer;
            font-family: 'Cinzel', serif;
            transition: all 0.3s;
        }

        .start-btn:hover {
            background: #8a0e0e;
            color: #000;
            box-shadow: 0 0 30px #8a0e0e;
        }

        .reset-btn {
            margin-top: 20px;
            padding: 8px 15px;
            background: #220000;
            border: 1px solid #500;
            color: #888;
            font-size: 0.9em;
            cursor: pointer;
            font-family: 'Cinzel', serif;
        }

        .reset-btn:hover {
            background: #400;
            color: #fff;
        }

        /* Settings */
        .settings-box {
            margin-top: 20px;
            display: flex;
            gap: 20px;
        }

        .setting-item {
            color: #fff;
            font-size: 14px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .setting-item:hover {
            color: #fff;
        }

        .setting-item input {
            cursor: pointer;
        }

        /* 卖出提示淡出动画 */
        @keyframes fadeOut {
            0% {
                opacity: 1;
            }

            70% {
                opacity: 1;
            }

            100% {
                opacity: 0;
            }
        }

        /* 自动战斗按钮容器 */
        .auto-battle-container {
            position: absolute;
            top: 180px;
            right: 20px;
            display: flex;
            align-items: center;
            gap: 4px;
            z-index: 50;
        }

        .auto-battle-btn {
            padding: 7px 12px;
            background: rgba(40, 40, 40, 0.9);
            border: 2px solid #555;
            border-radius: 5px 0 0 5px;
            color: #888;
            font-size: 12px;
            cursor: pointer;
            pointer-events: auto;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .auto-battle-btn:hover {
            background: rgba(60, 60, 60, 0.95);
            border-color: #777;
        }

        .auto-battle-btn.active {
            background: rgba(200, 80, 80, 0.9);
            border-color: #ff4444;
            color: #fff;
            box-shadow: 0 0 20px rgba(255, 68, 68, 0.5);
        }

        .auto-battle-btn.active:hover {
            background: rgba(220, 100, 100, 0.95);
        }

        .auto-battle-settings-btn {
            padding: 10px 12px;
            background: rgba(40, 40, 40, 0.9);
            border: 2px solid #555;
            border-radius: 0 5px 5px 0;
            color: #888;
            font-size: 14px;
            cursor: pointer;
            pointer-events: auto;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .auto-battle-settings-btn:hover {
            background: rgba(60, 60, 60, 0.95);
            border-color: #777;
            color: #ffcc00;
        }

        #auto-battle-icon {
            font-size: 18px;
        }

        #auto-battle-text {
            font-weight: bold;
        }

        /* 自定义复选框样式 */
        .checkbox-label {
            position: relative;
            display: inline-block;
            cursor: pointer;
        }

        .checkbox-label input[type="checkbox"] {
            position: absolute;
            opacity: 0;
            cursor: pointer;
            width: 0;
            height: 0;
        }



        /* 滑块样式优化 */
        input[type="range"] {
            -webkit-appearance: none;
            appearance: none;
            width: 120px;
            height: 6px;
            background: #333;
            border-radius: 3px;
            outline: none;
            margin-right: 10px;
        }

        input[type="range"]::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 16px;
            height: 16px;
            background: #ff4444;
            border-radius: 50%;
            cursor: pointer;
            transition: all 0.2s;
        }

        input[type="range"]::-webkit-slider-thumb:hover {
            background: #ff6666;
            transform: scale(1.1);
        }

        input[type="range"]::-moz-range-thumb {
            width: 16px;
            height: 16px;
            background: #ff4444;
            border-radius: 50%;
            cursor: pointer;
            border: none;
            transition: all 0.2s;
        }

        input[type="range"]::-moz-range-thumb:hover {
            background: #ff6666;
            transform: scale(1.1);
        }

        /* 在线系统样式 */
        #nickname-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.9);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 9999;
        }

        .nickname-dialog {
            background: rgba(20, 20, 25, 0.95);
            border: 2px solid #4a3b2a;
            padding: 30px 40px;
            text-align: center;
            border-radius: 8px;
        }

        .nickname-title {
            color: #c7b377;
            font-size: 24px;
            margin-bottom: 10px;
        }

        .nickname-desc {
            color: #888;
            font-size: 14px;
            margin-bottom: 20px;
        }

        #nickname-input {
            width: 200px;
            padding: 10px 15px;
            font-size: 16px;
            background: #111;
            border: 1px solid #444;
            color: #fff;
            text-align: center;
            border-radius: 4px;
            font-family: 'Cinzel', serif;
        }

        #nickname-input:focus {
            outline: none;
            border-color: #c7b377;
        }

        #nickname-confirm {
            display: block;
            width: 100%;
            margin-top: 15px;
            padding: 10px;
            background: #333;
            border: 1px solid #555;
            color: #c7b377;
            font-size: 16px;
            cursor: pointer;
            font-family: 'Cinzel', serif;
            border-radius: 4px;
        }

        #nickname-confirm:hover {
            background: #444;
            border-color: #c7b377;
        }

        #online-count {
            position: absolute;
            top: 20px;
            left: 50%;
            transform: translateX(-50%);
            color: #88ff88;
            font-size: 14px;
            background: rgba(0, 0, 0, 0.7);
            padding: 5px 15px;
            border-radius: 15px;
            pointer-events: none;
            z-index: 50;
        }

        /* ========== 稀有度光效 - 暗金/套装物品呼吸光晕 ========== */

        /* 暗金物品光效 (rarity 3/4) - 金色呼吸光晕 */
        .bag-slot.rarity-unique,
        .equip-slot.rarity-unique {
            animation: uniqueGlow 2.5s ease-in-out infinite;
        }

        @keyframes uniqueGlow {

            0%,
            100% {
                box-shadow: inset 0 0 8px rgba(144, 136, 88, 0.3),
                    0 0 6px rgba(144, 136, 88, 0.2);
            }

            50% {
                box-shadow: inset 0 0 15px rgba(199, 179, 119, 0.5),
                    0 0 12px rgba(199, 179, 119, 0.4);
            }
        }

        /* 套装物品光效 (rarity 5) - 绿色呼吸光晕 */
        .bag-slot.rarity-set,
        .equip-slot.rarity-set {
            animation: setGlow 2.5s ease-in-out infinite;
        }

        @keyframes setGlow {

            0%,
            100% {
                box-shadow: inset 0 0 8px rgba(0, 180, 0, 0.3),
                    0 0 6px rgba(0, 180, 0, 0.2);
            }

            50% {
                box-shadow: inset 0 0 15px rgba(0, 255, 0, 0.5),
                    0 0 12px rgba(0, 255, 0, 0.4);
            }
        }

        /* 稀有物品光效 (rarity 2) - 黄色微弱光晕 */
        .bag-slot.rarity-rare,
        .equip-slot.rarity-rare {
            animation: rareGlow 3s ease-in-out infinite;
        }

        @keyframes rareGlow {

            0%,
            100% {
                box-shadow: inset 0 0 5px rgba(255, 255, 0, 0.15);
            }

            50% {
                box-shadow: inset 0 0 10px rgba(255, 255, 0, 0.25);
            }
        }

        /* ========== 关键词高亮增强 ========== */
        .tooltip-stat.fire-stat {
            text-shadow: 0 0 8px rgba(255, 68, 0, 0.6);
        }

        .tooltip-stat.cold-stat {
            text-shadow: 0 0 8px rgba(68, 136, 255, 0.6);
        }

        .tooltip-stat.lightning-stat {
            text-shadow: 0 0 8px rgba(255, 255, 68, 0.6);
        }

        .tooltip-stat.poison-stat {
            text-shadow: 0 0 8px rgba(68, 255, 68, 0.6);
        }

        /* ========== 装备需求不足遮罩 ========== */
        .bag-slot.requirement-not-met,
        .equip-slot.requirement-not-met {
            position: relative;
        }

        .bag-slot.requirement-not-met::after,
        .equip-slot.requirement-not-met::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(180, 0, 0, 0.35);
            pointer-events: none;
            z-index: 2;
        }

        /* 需求不足的边框变红 */
        .bag-slot.requirement-not-met {
            border-color: #882222 !important;
        }

        /* ========== 信息层级优化 - 数值使用无衬线字体 ========== */

        /* Tooltip 数值使用 Roboto */
        .tooltip-stat {
            font-family: 'Roboto', sans-serif;
            font-size: 13px;
            letter-spacing: 0.3px;
        }

        .tooltip-type {
            font-family: 'Roboto', sans-serif;
        }

        /* 角色面板数值 */
        .stat-row {
            font-family: 'Roboto', sans-serif;
        }

        .stat-row span:first-child {
            font-family: 'Cinzel', serif;
        }

        /* 血球/蓝球数值 */
        .orb-text {
            font-family: 'Roboto', sans-serif;
        }

        /* 物品数量 */
        .item-count {
            font-family: 'Roboto', sans-serif;
        }

        /* 腰带数量 */
        .belt-count {
            font-family: 'Roboto', sans-serif;
        }

        /* 经验百分比 */
        .xp-percentage {
            font-family: 'Roboto', sans-serif;
        }

        /* 成就进度 */
        .ach-progress {
            font-family: 'Roboto', sans-serif;
        }

        /* 商店价格 */
        .gamble-price {
            font-family: 'Roboto', sans-serif;
        }

        /* Settings Panel Tabs */
        .settings-tabs {
            display: flex;
            justify-content: space-around;
            margin-bottom: 15px;
            border-bottom: 1px solid #333;
            padding-bottom: 10px;
            margin-top: 5px;
        }

        .tab-btn {
            background: transparent;
            border: none;
            color: #888;
            font-family: inherit;
            font-size: 14px;
            cursor: pointer;
            padding: 5px 10px;
            position: relative;
            transition: color 0.2s;
        }

        .tab-btn:hover {
            color: #aeaeae;
        }

        .tab-btn.active {
            color: var(--text-gold);
            font-weight: bold;
        }

        .tab-btn.active::after {
            content: '';
            position: absolute;
            bottom: -11px;
            left: 0;
            width: 100%;
            height: 2px;
            background: var(--text-gold);
            box-shadow: 0 0 5px var(--text-gold);
        }

        .tab-content {
            animation: fadeIn 0.3s ease;
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
            }

            to {
                opacity: 1;
            }
        }

        /* ========== RO 商店系统样式 ========== */
        #ro-shop .ro-shop-tabs { display: flex; gap: 8px; margin: 6px 0 12px; border-bottom: 1px solid #333; padding-bottom: 8px; }
        #ro-shop .ro-shop-tab {
            background: transparent; border: 1px solid #444; color: #aaa;
            font-family: inherit; font-size: 13px; padding: 5px 16px; border-radius: 4px;
            cursor: pointer; transition: all .15s;
        }
        #ro-shop .ro-shop-tab:hover { color: #ddd; border-color: #666; }
        #ro-shop .ro-shop-tab.active {
            color: #1a1a1a; background: var(--text-gold); border-color: var(--text-gold); font-weight: bold;
        }
        #ro-shop .ro-shop-grid {
            display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px;
            max-height: 340px; overflow-y: auto; padding: 4px;
        }
        #ro-shop .ro-shop-slot {
            background: rgba(255, 255, 255, 0.04); border: 1px solid #333; border-radius: 4px;
            padding: 6px 4px; text-align: center; cursor: pointer; transition: all .12s;
            display: flex; flex-direction: column; align-items: center; justify-content: space-between; min-height: 74px;
            user-select: none;
        }
        #ro-shop .ro-shop-slot:hover { background: rgba(255, 215, 0, 0.12); border-color: var(--text-gold); transform: translateY(-1px); }
        #ro-shop .ro-shop-slot .rs-icon { width: 40px; height: 40px; line-height: 40px; text-align: center; margin: 2px auto 0; background-repeat: no-repeat; }
        #ro-shop .ro-shop-slot .rs-name { font-size: 11px; color: #ddd; line-height: 1.2; word-break: break-all; }
        #ro-shop .ro-shop-slot .rs-sub { font-size: 9px; color: #888; margin-top: 2px; }
        #ro-shop .ro-shop-slot .rs-price { font-size: 11px; color: #ffd700; margin-top: 4px; font-weight: bold; }
        #ro-shop .ro-shop-slot .rs-price.cant { color: #ff6b6b; }
        #ro-shop .ro-shop-page { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 12px; }
        #ro-shop .ro-shop-page-btn {
            background: #2a2a2a; border: 1px solid #555; color: #ddd;
            font-family: inherit; font-size: 13px; padding: 6px 14px; border-radius: 4px; cursor: pointer;
        }
        #ro-shop .ro-shop-page-btn:hover:not(:disabled) { background: #3a3a3a; border-color: var(--text-gold); }
        #ro-shop .ro-shop-page-btn:disabled { opacity: .35; cursor: not-allowed; }
        #ro-shop .ro-shop-page-info { color: #bbb; font-size: 13px; min-width: 60px; text-align: center; }
        #ro-shop .ro-shop-zeny { text-align: center; margin-top: 8px; font-size: 12px; color: #9aa; }
        #ro-shop .ro-shop-zeny span { color: #ffd700; font-weight: bold; }
        #ro-shop .ro-shop-hint { text-align: center; margin-top: 6px; font-size: 11px; color: #8cc; }
        #ro-shop .ro-shop-qty-row { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 8px 0 4px; font-size: 12px; color: #ccd; }
        #ro-shop .ro-shop-qty-row input { width: 64px; padding: 3px 6px; background: #1c1c22; color: #fff; border: 1px solid #555; border-radius: 4px; font-size: 13px; text-align: center; }
        #ro-shop .ro-shop-qty-tip { font-size: 10px; color: #888; }

        /* ========== RO 地图面板（按旧游戏方式旅行） ========== */
        body:not(.ro-mode) #btn-map { display: none; }
        #map-panel .map-list {
            max-height: 460px; overflow-y: auto; padding: 4px 2px;
        }
        #map-panel .map-region {
            color: var(--text-gold); font-size: 13px; font-weight: bold;
            margin: 12px 0 4px; padding-bottom: 3px; border-bottom: 1px solid #333;
        }
        #map-panel .map-region:first-child { margin-top: 2px; }
        #map-panel .map-row {
            display: flex; align-items: center; justify-content: space-between;
            padding: 7px 10px; margin: 3px 0; border-radius: 4px;
            background: rgba(255, 255, 255, 0.04); border: 1px solid #2e2e2e;
            cursor: pointer; transition: all .12s;
        }
        #map-panel .map-row:hover { background: rgba(255, 215, 0, 0.12); border-color: var(--text-gold); }
        #map-panel .map-row.locked { opacity: .45; cursor: not-allowed; background: rgba(255, 255, 255, 0.02); }
        #map-panel .map-row.locked:hover { background: rgba(255, 255, 255, 0.02); border-color: #2e2e2e; }
        #map-panel .map-row.current { border-color: #4d94ff; background: rgba(77, 148, 255, 0.12); }
        #map-panel .map-name { font-size: 13px; color: #e8e8e8; }
        #map-panel .map-meta { font-size: 11px; color: #8a8a8a; }

        /* ========== 怪物图鉴（照旧游戏 bestiary，暗色面板风格） ========== */
        #bestiary-panel .bestiary-search { margin: 6px 0 8px; }
        #bestiary-panel .bestiary-search input {
            width: 100%; padding: 7px 10px; background: #0d0d11; border: 1px solid #333;
            border-radius: 5px; color: #ddd; font-size: 12px; outline: none;
        }
        #bestiary-panel .bestiary-search input:focus { border-color: var(--text-gold); }
        #bestiary-panel .bestiary-tabs {
            display: flex; gap: 5px; flex-wrap: wrap; max-height: 78px; overflow: auto;
            margin-bottom: 8px; padding-right: 2px;
        }
        #bestiary-panel .bestiary-tabs button {
            padding: 4px 9px; background: #15151a; border: 1px solid #333; border-radius: 5px;
            color: #aaa; font-size: 11px; cursor: pointer; white-space: nowrap;
        }
        #bestiary-panel .bestiary-tabs button.on { background: #3a2f14; border-color: var(--text-gold); color: #ffd700; font-weight: 700; }
        #bestiary-panel .bestiary-tabs button:hover:not(.on) { border-color: #666; color: #ddd; }
        #bestiary-panel .bestiary-list {
            flex: 1; overflow-y: auto; border: 1px solid #2a2a30; border-radius: 6px; padding: 6px;
            min-height: 0;   /* 允许 flex item 收缩，避免滚动被父容器卡住 */
        }
        #bestiary-panel .bestiary-group { margin-bottom: 10px; }
        #bestiary-panel .bestiary-group-title {
            font-size: 12px; font-weight: 700; color: var(--text-gold); border-bottom: 1px solid #333;
            padding: 6px 4px; margin-bottom: 4px; position: sticky; top: 0; background: #17171c; z-index: 1;
        }
        #bestiary-panel .bestiary-mob {
            display: flex; flex-direction: row; align-items: flex-start; gap: 8px; padding: 6px 4px;
            border-bottom: 1px dashed #26262c; cursor: pointer; transition: background .12s;
        }
        #bestiary-panel .bestiary-mob:hover { background: rgba(255, 215, 0, 0.08); }
        #bestiary-panel .bestiary-mob-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
        .b-mob-preview { width: 48px; height: 48px; flex-shrink: 0; object-fit: contain; image-rendering: pixelated; background: rgba(0,0,0,.32); border-radius: 4px; padding: 2px; align-self: center; }
        .mob-thumb { width: 32px; height: 32px; flex: 0 0 32px; align-self: center; background-repeat: no-repeat; background-size: auto; background-color: #151515; border: 1px solid #3a3a3a; border-radius: 4px; box-shadow: 0 0 0 1px #000 inset; }
        .mob-thumb.empty { display: flex; align-items: center; justify-content: center; background: #1c1c1c; }
        .mob-thumb.empty::after { content: '?'; color: #555; font-size: 13px; }
        #bestiary-panel .bestiary-mob-hd { display: flex; align-items: center; gap: 8px; font-size: 12px; }
        #bestiary-panel .bestiary-mob-hd b { color: #e8e8e8; }
        #bestiary-panel .bestiary-mob-hd span { color: #8a8a8a; font-size: 11px; }
        #bestiary-panel .bestiary-mob-hd .rate-sum {
            margin-left: auto; font-size: 10px; color: #7dd3fc; background: rgba(77, 148, 255, 0.15);
            border-radius: 8px; padding: 1px 6px;
        }
        #bestiary-panel .bestiary-drops { display: flex; flex-wrap: wrap; gap: 4px; margin-left: 4px; }
        #bestiary-panel .bestiary-drop {
            font-size: 11px; color: #b9b9b9; background: rgba(255, 255, 255, 0.05);
            border-radius: 4px; padding: 2px 6px; white-space: nowrap;
        }
        #bestiary-panel .bestiary-drop.rare { background: rgba(250, 204, 21, 0.14); color: #fde68a; }
        #bestiary-panel .bestiary-drop.card { background: rgba(139, 92, 246, 0.18); color: #d8b4fe; }
        #bestiary-panel .bestiary-empty { color: #8a8a8a; text-align: center; padding: 40px 10px; font-size: 12px; }
        /* 图鉴掉落真图 + 角标（第一梯队优化） */
        .b-drop-icon { display: inline-block; width: 20px; height: 20px; background-size: contain; background-position: center; background-repeat: no-repeat; vertical-align: middle; margin-right: 3px; }
        .mob-badge { display: inline-block; font-size: 10px; line-height: 1; padding: 2px 5px; border-radius: 8px; margin-left: 4px; font-weight: 700; vertical-align: middle; }
        .mob-badge.card { background: rgba(139, 92, 246, 0.22); color: #d8b4fe; }
        .mob-badge.mvp { background: rgba(250, 204, 21, 0.18); color: #fde68a; }
        .mobdrop-item {
            display: flex; justify-content: space-between; align-items: center;
            padding: 5px 2px; border-bottom: 1px dashed #26262c; font-size: 13px; color: #ddd;
        }
        .mobdrop-item .rate { color: #7dd3fc; font-size: 11px; }
        /* 图鉴多维筛选栏 + 掉落物详情弹窗（第二梯队优化） */
        .bestiary-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
        .bestiary-filters select { background: #1a1a22; color: #ddd; border: 1px solid #444; border-radius: 5px; padding: 4px 6px; font-size: 12px; }
        .bestiary-filters select:focus { border-color: var(--text-gold); }
        .ii-icon { display: inline-block; width: 40px; height: 40px; background-size: contain; background-position: center; background-repeat: no-repeat; flex: 0 0 auto; }
        .ii-type { display: inline-block; font-size: 10px; padding: 2px 6px; border-radius: 8px; margin-top: 4px; font-weight: 700; }
        .ii-type.card { background: rgba(139, 92, 246, 0.22); color: #d8b4fe; }
        .ii-type.equip { background: rgba(96, 165, 250, 0.20); color: #bfdbfe; }
        .ii-type.mat { background: rgba(52, 211, 153, 0.18); color: #6ee7b7; }
        .ii-type.other { background: rgba(148, 163, 184, 0.20); color: #cbd5e1; }
        .ii-detail { border-top: 1px solid #2a2a30; padding-top: 8px; }
        .ii-row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px dashed #26262c; }
        .ii-k { color: #99a; font-size: 12px; }
        .ii-v { color: #e8e8e8; font-size: 12px; text-align: right; }
        /* 可装备职业 chips（当前职业绿色高亮 ✔） */
        .ii-jobs { display: inline-flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
        .ii-job {
            font-size: 11px; padding: 2px 8px; border-radius: 8px; white-space: nowrap;
            background: rgba(148, 163, 184, 0.12); color: #cbd5e1; border: 1px solid #3a3a44;
        }
        .ii-job.cur { background: rgba(52, 211, 153, 0.16); color: #6ee7b7; border-color: #1a7a5c; font-weight: 700; }
        /* 掉落出处反查 */
        .ii-sources { border-top: 1px solid #2a2a30; padding-top: 8px; margin-top: 8px; }
        .ii-sources-title { color: #e8c67a; font-size: 12px; font-weight: 700; margin-bottom: 4px; }
        .ii-src-row {
            display: flex; justify-content: space-between; align-items: center; gap: 8px;
            padding: 4px 2px; border-bottom: 1px dashed #26262c; cursor: pointer; font-size: 12px; color: #ddd;
        }
        .ii-src-row:hover { color: #ffd700; background: rgba(255, 215, 0, 0.05); }
        .ii-src-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .ii-src-rate { color: #7dd3fc; font-size: 11px; flex-shrink: 0; }
        .ii-src-more { color: #888; font-size: 11px; padding: 4px 2px; }

        /* ========== 图鉴地图速查区（等级段 → 地区折叠 → 地图列表；第三梯队优化） ========== */
        /* 顶部栏：等级段 tab + 地图搜索（一行） */
        #bestiary-panel .bestiary-topbar {
            display: flex; align-items: center; gap: 6px; margin-bottom: 6px;
        }
        #bestiary-panel .bestiary-topbar .bestiary-lv-tabs { flex: 0 0 auto; margin: 0; }
        #bestiary-panel .bestiary-topbar .bestiary-mmap-search { flex: 1; min-width: 0; margin: 0; }
        /* 左右分栏容器 */
        #bestiary-panel .bestiary-body {
            display: flex; gap: 8px; flex: 1; min-height: 0;   /* flex:1 撑满 panel 剩余高度 */
        }
        #bestiary-panel .bestiary-lcol {
            flex: 1 1 0; min-width: 0; min-height: 0;
            border: 1px solid #2a2a30; border-radius: 6px; padding: 6px;
            background: rgba(10, 10, 14, 0.4); overflow-y: auto;
        }
        #bestiary-panel .bestiary-rcol {
            flex: 1 1 0; min-width: 0; min-height: 0; display: flex; flex-direction: column;
        }
        #bestiary-panel .bestiary-lv-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }
        #bestiary-panel .bestiary-lv-tabs button {
            flex: 1 1 auto; min-width: 42px; padding: 4px 6px; font-size: 11px;
            background: #1a1a22; color: #bbb; border: 1px solid #333; border-radius: 4px; cursor: pointer;
        }
        #bestiary-panel .bestiary-lv-tabs button.on { background: #3a2f14; border-color: var(--text-gold); color: #ffd700; font-weight: 700; }
        #bestiary-panel .bestiary-lv-tabs button:hover:not(.on) { border-color: #666; color: #ddd; }
        #bestiary-panel .bestiary-mmap-search { margin-bottom: 6px; }
        #bestiary-panel .bestiary-mmap-search input {
            width: 100%; padding: 6px 10px; background: #0d0d11; border: 1px solid #333;
            border-radius: 5px; color: #ddd; font-size: 12px; outline: none;
        }
        #bestiary-panel .bestiary-mmap-search input:focus { border-color: var(--text-gold); }
        #bestiary-panel .bestiary-recent, #bestiary-panel .bestiary-favbar {
            display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-bottom: 6px;
        }
        .bs-recent-label, .bs-fav-label { font-size: 11px; color: #7dd3fc; margin-right: 2px; }
        .bs-recent-chip, .bs-fav-chip {
            padding: 2px 8px; font-size: 11px; background: #1c2430; color: #a8c8ee;
            border: 1px solid #2c4058; border-radius: 10px; cursor: pointer; max-width: 130px;
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
        }
        .bs-recent-chip:hover, .bs-fav-chip:hover { border-color: #4a6a90; color: #d5e6ff; }
        #bestiary-panel .bestiary-mapgroups .bg-group { margin-bottom: 2px; }
        #bestiary-panel .bg-group-title {
            display: flex; align-items: center; gap: 6px; padding: 5px 6px; cursor: pointer;
            border-radius: 4px; font-size: 12px; color: #e8e8e8; background: #14141a;
        }
        #bestiary-panel .bg-group-title:hover { background: #1c1c24; }
        .bg-arrow { color: #777; font-size: 10px; width: 14px; text-align: center; }
        .bg-name { font-weight: 700; color: #e8c67a; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .bg-count { font-size: 10px; color: #888; background: rgba(255, 215, 0, 0.08); border-radius: 8px; padding: 1px 7px; }
        #bestiary-panel .bg-maps { padding: 2px 0 4px 8px; }
        #bestiary-panel .bg-hint { padding: 6px 8px; margin-bottom: 4px; font-size: 11px; color: #99a; background: rgba(125, 211, 252, 0.06); border-radius: 4px; line-height: 1.5; }
        #bestiary-panel .bg-hint b { color: #ffd700; }
        #bestiary-panel .bg-expandall { padding: 5px 8px; margin-bottom: 6px; font-size: 11px; color: #7dd3fc; cursor: pointer; border-radius: 4px; background: rgba(125, 211, 252, 0.08); text-align: center; }
        #bestiary-panel .bg-expandall:hover { background: rgba(125, 211, 252, 0.16); color: #bce3ff; }
        #bestiary-panel .bg-map-row {
            display: flex; align-items: center; gap: 6px; padding: 4px 6px; cursor: pointer;
            border-radius: 4px; font-size: 12px; color: #ccc;
        }
        #bestiary-panel .bg-map-row:hover { background: rgba(255, 215, 0, 0.07); }
        #bestiary-panel .bg-map-row.on { background: rgba(255, 215, 0, 0.14); border-left: 2px solid var(--text-gold); }
        .bg-fav { cursor: pointer; font-size: 13px; color: #555; width: 16px; text-align: center; flex-shrink: 0; }
        .bg-fav:hover { color: #fde68a; }
        .bg-fav.on { color: #fbbf24; }
        .bg-map-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #ddd; }
        .bg-cur { font-size: 10px; color: #6ee7b7; background: rgba(52, 211, 153, 0.12); border-radius: 8px; padding: 1px 6px; flex-shrink: 0; }
        .bg-map-meta { font-size: 10px; color: #8a8a8a; flex-shrink: 0; }
        /* 图鉴范围指示条（替代原地图 tab 行） */
        #bestiary-panel .bestiary-scope {
            display: flex; align-items: center; gap: 8px; margin: 0 0 6px; padding: 4px 6px;
            border-radius: 4px; font-size: 12px; background: rgba(125, 211, 252, 0.07);
        }
        .bs-scope-cur { color: #9ec5ff; }
        .bs-scope-btn {
            padding: 3px 10px; font-size: 11px; background: #1a2a3a; color: #7dd3fc;
            border: 1px solid #2c4058; border-radius: 4px; cursor: pointer;
        }
        .bs-scope-btn:hover { border-color: #4a6a90; color: #bce3ff; }

        /* ========== 天赋商店系统样式 ========== */
        #talent-shop-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.85);
            display: none;
            justify-content: center;
            align-items: center;
            z-index: 1000;
            pointer-events: auto;
        }

        #talent-shop-overlay.active {
            display: flex;
            animation: fadeIn 0.3s ease;
        }

        #talent-shop {
            background: linear-gradient(135deg, rgba(20, 20, 25, 0.98) 0%, rgba(10, 10, 15, 0.98) 100%);
            border: 2px solid #4a3b2a;
            border-radius: 8px;
            padding: 15px 18px;
            min-width: 340px;
            max-width: 380px;
            box-shadow: 0 0 30px rgba(0, 0, 0, 0.9);
        }

        .talent-shop-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 8px;
            padding-bottom: 6px;
            border-bottom: 1px solid #4a3b2a;
        }

        .talent-shop-title {
            font-size: 15px;
            color: #c7b377;
            font-weight: bold;
        }

        .talent-shop-floor {
            font-size: 11px;
            color: #888;
        }

        .talent-shop-gold {
            text-align: center;
            font-size: 13px;
            color: gold;
            margin-bottom: 10px;
        }

        .talent-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 8px;
            margin-bottom: 10px;
        }

        .talent-card {
            background: rgba(30, 30, 35, 0.9);
            border: 2px solid #444;
            border-radius: 5px;
            padding: 8px 6px;
            text-align: center;
            cursor: pointer;
            transition: all 0.2s ease;
            position: relative;
            min-height: 90px;
        }

        .talent-card:hover {
            transform: translateY(-3px);
            border-color: #c7b377;
            box-shadow: 0 5px 20px rgba(199, 179, 119, 0.2);
        }

        .talent-card.owned {
            opacity: 0.5;
            cursor: not-allowed;
            border-color: #333;
        }

        .talent-card.owned::after {
            content: '已拥有';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) rotate(-15deg);
            font-size: 14px;
            color: #888;
            background: rgba(0, 0, 0, 0.8);
            padding: 5px 15px;
            border-radius: 3px;
        }

        .talent-card.cant-afford {
            opacity: 0.6;
        }

        .talent-card.cant-afford .talent-price {
            color: #ff4444;
        }

        .talent-card-icon {
            font-size: 24px;
            margin-bottom: 4px;
        }

        .talent-card-name {
            font-size: 11px;
            font-weight: bold;
            margin-bottom: 3px;
        }

        .talent-card-desc {
            font-size: 9px;
            color: #aaa;
            margin-bottom: 6px;
            line-height: 1.3;
        }

        .talent-price {
            font-size: 11px;
            color: gold;
            font-weight: bold;
        }

        /* 天赋稀有度边框 */
        .talent-card.tier-normal {
            border-color: #555;
        }

        .talent-card.tier-rare {
            border-color: #4850b8;
        }

        .talent-card.tier-epic {
            border-color: #a335ee;
            box-shadow: inset 0 0 20px rgba(163, 53, 238, 0.1);
        }

        .talent-card.tier-legendary {
            border-color: #ff8000;
            box-shadow: inset 0 0 20px rgba(255, 128, 0, 0.15);
            animation: legendaryPulse 2s ease-in-out infinite;
        }

        @keyframes legendaryPulse {

            0%,
            100% {
                box-shadow: inset 0 0 20px rgba(255, 128, 0, 0.15);
            }

            50% {
                box-shadow: inset 0 0 30px rgba(255, 128, 0, 0.3);
            }
        }

        .talent-shop-actions {
            display: flex;
            justify-content: center;
            gap: 10px;
        }

        .talent-btn {
            padding: 5px 12px;
            font-family: 'Cinzel', serif;
            font-size: 11px;
            border: 1px solid #555;
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .talent-btn-refresh {
            background: #2a2a30;
            color: #aaa;
        }

        .talent-btn-refresh:hover {
            background: #3a3a40;
            border-color: #c7b377;
            color: #c7b377;
        }

        .talent-btn-skip {
            background: #1a1a20;
            color: #888;
        }

        .talent-btn-skip:hover {
            background: #2a2a30;
            color: #ccc;
        }

        .refresh-cost {
            font-size: 11px;
            color: gold;
            margin-left: 5px;
        }

        /* 天赋HUD（显示已拥有的天赋） */
        #talent-hud {
            position: absolute;
            top: 60px;
            right: 180px;
            display: flex;
            gap: 5px;
            z-index: 50;
            pointer-events: auto;
        }

        .talent-hud-icon {
            width: 32px;
            height: 32px;
            background: rgba(20, 20, 25, 0.9);
            border: 2px solid #444;
            border-radius: 5px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .talent-hud-icon:hover {
            transform: scale(1.1);
            border-color: #c7b377;
        }

        .talent-hud-icon.tier-normal {
            border-color: #555;
        }

        .talent-hud-icon.tier-rare {
            border-color: #4850b8;
        }

        .talent-hud-icon.tier-epic {
            border-color: #a335ee;
        }

        .talent-hud-icon.tier-legendary {
            border-color: #ff8000;
            animation: legendaryPulse 2s ease-in-out infinite;
        }

        /* Checkbox Styles (Global) */
        .checkbox-label {
            position: relative;
            display: inline-block;
            width: 20px;
            height: 20px;
            vertical-align: middle;
        }

        .checkbox-label input {
            opacity: 0;
            width: 0;
            height: 0;
        }

        .checkmark {
            position: absolute;
            top: 0;
            left: 0;
            height: 20px;
            width: 20px;
            background-color: #222;
            border: 1px solid #555;
            transition: all 0.2s;
        }

        .checkbox-label:hover input~.checkmark {
            background-color: #333;
        }

        .checkbox-label input:checked~.checkmark {
            background-color: #4850b8;
            border-color: #6a74e8;
            box-shadow: 0 0 5px #4850b8;
        }

        .checkmark:after {
            content: "";
            position: absolute;
            display: none;
        }

        .checkbox-label input:checked~.checkmark:after {
            display: block;
        }

        .checkbox-label .checkmark:after {
            left: 7px;
            top: 3px;
            width: 5px;
            height: 10px;
            border: solid white;
            border-width: 0 2px 2px 0;
            transform: rotate(45deg);
        }
/* ============ 联机端追加（照搬单机体系之上新增：大厅/队伍/排行榜/加点按钮等） ============ */
#lobby { position: fixed; inset: 0; background: #050505; display: flex; align-items: center; justify-content: center; z-index: 300; }
#lobby.hidden { display: none; }
.lobby-box { width: 330px; padding: 28px; background: rgba(10,10,12,.97); border: 2px solid var(--ui-border); border-radius: 8px; text-align: center; box-shadow: 0 0 20px rgba(0,0,0,.9), 0 8px 32px rgba(0,0,0,.7); }
.lobby-box h2 { margin: 0 0 4px; color: var(--text-gold); font-size: 22px; font-family: 'Cinzel', serif; }
.lobby-sub { margin: 0 0 16px; color: #888; font-size: 12px; }
.lobby-box input { width: 100%; box-sizing: border-box; margin: 6px 0; padding: 8px 10px; background: #0a0a0c; color: #ccc; border: 1px solid #4a3b2a; border-radius: 4px; font-size: 14px; }
.lobby-box button { width: 100%; box-sizing: border-box; margin: 6px 0; padding: 9px; font-size: 14px; border-radius: 4px; cursor: pointer; border: 1px solid var(--ui-border); background: #14120d; color: var(--text-gold); font-family: 'Cinzel', serif; }
.lobby-box button:hover { background: #2a241a; }
#btn-login, #btn-create { background: #0d1a12; border-color: #2a5a3a; color: #8fcaa0; }
#btn-login:hover, #btn-create:hover { background: #123322; }
#btn-join { background: #1a120d; border-color: #5a3a2a; color: #caa08f; }
#btn-join:hover { background: #332212; }
.lobby-err { min-height: 18px; margin-top: 8px; color: #ff5555; font-size: 12px; }
.remember-row { display: flex; align-items: center; gap: 6px; margin: 6px 0; color: #888; font-size: 12px; cursor: pointer; user-select: none; }
.remember-row input { width: auto; margin: 0; accent-color: #c7b377; }
.stage { display: none; }
.stage.active { display: block; }
.stage-tip { font-size: 11px; color: #888; margin: 8px 0; }
/* 大厅：活跃队伍列表（修复文字被压成纵向） */
#world-list-wrap { width: 100%; box-sizing: border-box; }
#world-list { max-height: 210px; overflow-y: auto; }
.wl-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 6px; border-bottom: 1px solid #2a2a30; }
.wl-info { flex: 1 1 auto; min-width: 160px; overflow: hidden; text-align: left; }
.wl-leader { color: #ffd479; font-weight: bold; font-size: 13px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-meta { color: #9fb3c8; font-size: 12px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#world-list-wrap .wl-join { flex: 0 0 auto; width: auto; padding: 6px 14px; background: #3a5; color: #fff; border: none; border-radius: 5px; cursor: pointer; font-size: 13px; }
#world-list-wrap .wl-join:hover { background: #4a6; }
#world-list-wrap .wl-full { flex: 0 0 auto; color: #a55; font-size: 12px; font-weight: bold; padding: 6px 8px; }
/* 注册流程：初心者立绘预览 */
.reg-portrait-wrap { display: flex; flex-direction: column; align-items: center; margin: 6px 0 10px; }
.reg-portrait { width: 84px; height: 75px; object-fit: contain; image-rendering: pixelated; background: rgba(255,255,255,.04); border: 1px solid #3a3a42; border-radius: 6px; }
.reg-portrait-label { margin-top: 4px; font-size: 12px; color: var(--text-gold); font-family: 'Cinzel', serif; }
/* 注册：性别选择 */
.reg-gender-row { display: flex; gap: 8px; justify-content: center; margin-bottom: 6px; }
.reg-gender-btn { padding: 5px 16px; border: 1px solid #4a4a52; border-radius: 6px; background: #1e1e26; color: #b0b0b8; cursor: pointer; font-size: 13px; font-family: inherit; transition: all .15s; }
.reg-gender-btn:hover { background: #2a2a35; color: #d0d0d8; }
.reg-gender-btn.active { background: #2a3a4a; border-color: #4a8aba; color: #7ec8ff; }
/* 职业立绘：属性面板 / HUD / 队伍列表（2026-08-15） */
.job-portrait-sm { width: 40px; height: 36px; object-fit: contain; image-rendering: pixelated; background: rgba(255,255,255,.04); border: 1px solid #3a3a42; border-radius: 5px; }
.party-portrait { width: 26px; height: 23px; object-fit: contain; image-rendering: pixelated; background: rgba(255,255,255,.04); border: 1px solid #3a3a42; border-radius: 4px; flex: 0 0 auto; }
.party-row { display: flex; align-items: center; }
.job-btn { display: block; width: 100%; margin: 4px 0; padding: 6px; background: #14120d; color: var(--text-gold); border: 1px solid var(--ui-border); border-radius: 4px; cursor: pointer; font-size: 13px; }
.job-btn:hover { background: #2a241a; }
.job-btn.locked { opacity: .5; cursor: not-allowed; }
#party-share-btns { display: none; }
#lb-body .stat-row span:first-child { color: var(--text-gold); }
.lb-clickable { cursor: pointer; transition: background .15s; }
.lb-clickable:hover { background: rgba(255,215,0,.08) !important; }
#panel-leaderboard { width: 380px; }
#panel-party { width: 320px; }
#lb-body { max-height: 58vh; overflow-y: auto; }
#panel-inventory, #panel-skills { width: 440px; }
#quest-panel, #achievements-panel, #map-panel, #stash-panel, #auto-battle-panel, #stats2-panel { width: 320px; }
        #stats-panel {
            width: 340px;
            max-height: 85vh;               /* 限制高度，防止小屏幕溢出 */
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }
        #stats-panel .panel-body {
            flex: 1;
            overflow-y: auto;
            overflow-x: hidden;
            padding-right: 6px;
            margin-top: 4px;
        }
        #stats-panel .panel-body::-webkit-scrollbar { width: 6px; }
        #stats-panel .panel-body::-webkit-scrollbar-track { background: rgba(0,0,0,0.25); border-radius: 3px; }
        #stats-panel .panel-body::-webkit-scrollbar-thumb { background: #555; border-radius: 3px; }
        #stats-panel .panel-body::-webkit-scrollbar-thumb:hover { background: #777; }
#shop-panel { width: 480px; }
#bestiary-panel {
            width: 760px; max-width: 96vw;
            max-height: 86vh;          /* 两栏独立滚动 → 限制面板总高度 */
            flex-direction: column;    /* display 由 togglePanel 用 data-open-display="flex" 控制 */
            overflow: hidden;          /* body 撑满剩余，超出滚动由子容器承担 */
        }   /* 图鉴：左右分栏（地图速查 320 | 怪物列表 400）需要更宽 */

/* ============ 联机追加：仓库格子（stash-slot，风格对齐 bag-slot） ============ */
.stash-slot { height: 40px; background: #0a0a0c; border: 1px solid #3a3a3a; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 10px; color: #ddd; cursor: pointer; text-align: center; padding: 2px; }
.stash-slot:hover { border-color: var(--text-gold); }

/* ============ 联机追加：主 HUD 金币显示（hud-zeny） ============ */

/* ============ 米德加尔特世界地图（worldmap modal） ============ */
.wm-node { position:absolute; box-sizing:border-box; border:1px solid rgba(255,255,255,.25); border-radius:3px; cursor:pointer; overflow:hidden; display:flex; align-items:center; justify-content:center; font-size:9px; color:#fff; text-shadow:0 0 2px #000; transition:transform .08s, border-color .08s; }
.wm-node.jump:hover { border-color:#ffd700; transform:scale(1.15); z-index:5; }
.wm-node.nojump { background:rgba(40,40,40,.55); color:#bbb; cursor:default; border-color:rgba(120,120,120,.4); font-size:8px; }
.wm-node.current { border:2px solid #ffd700; box-shadow:0 0 8px #ffd700; z-index:6; }
.wm-node.has-badge { overflow:visible; z-index:7; }
/* dvg worldmap 同款红底白字显名（bg-danger 红盒） */
.bg-danger { background-color:#dc3545 !important; }
/* 主世界图：副本组父入口红底白字常显组名盒（照 dvg worldmap 红盒显名） */
.wm-group-badge { position:absolute; top:-7px; right:-7px; max-width:104px; padding:2px 6px; font-size:10px; line-height:1.25; font-weight:bold; border-radius:4px; background:#dc3545; border:1px solid #ffd700; color:#fff; cursor:pointer; z-index:8; box-shadow:0 0 4px #000; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.wm-group-badge:hover { transform:scale(1.06); border-color:#fff; }
.wm-dungeon { position:absolute; box-sizing:border-box; display:flex; align-items:center; gap:2px; padding:1px 5px; font-size:10px; line-height:1.1; color:#fff; text-shadow:0 0 2px #000; cursor:pointer; white-space:nowrap; z-index:7; background:rgba(70,20,20,.55); border:1px solid rgba(220,53,69,.75); border-radius:3px; transition:transform .08s, border-color .08s; }
.wm-dungeon:hover { border-color:#ffd700; transform:scale(1.06); z-index:9; }
.wm-dg-arrow { color:#ff4d4d; font-weight:bold; font-size:11px; }
.wm-dg-name { color:#ffe; }
/* 世界地图 tab 切换 */
.wm-tab { background:#2a2117; color:#cbb; border:1px solid #5a4a2a; border-radius:5px 5px 0 0; padding:6px 16px; font-size:13px; cursor:pointer; }
.wm-tab.active { background:#5a4a2a; color:#ffd700; border-bottom:2px solid #ffd700; font-weight:bold; }
/* 大陆切换标签（worldmap-modal：米德加尔特/异世界/次元裂缝/本地化01/本地化02） */
.wm-region-tab { background:#221a12; color:#b9a888; border:1px solid #4a3a22; border-radius:14px; padding:4px 14px; font-size:12px; cursor:pointer; transition:all .1s; }
.wm-region-tab:hover { border-color:#7a5a2a; color:#e0c890; }
.wm-region-tab.active { background:#7a5a2a; color:#fff; border-color:#ffd700; font-weight:bold; box-shadow:0 0 6px rgba(255,215,0,.4); }
/* 副本组网格卡片（dvg 截图风格：红底白字常显组名 + 子副本缩略图群） */
.dg-card { position:relative; background:rgba(40,32,20,.92); border:1px solid #5a4a2a; border-radius:6px; overflow:hidden; cursor:default; transition:transform .08s, border-color .08s; }
.dg-card:hover { border-color:#ffd700; transform:translateY(-2px); box-shadow:0 2px 10px #000; }
.dg-card .dg-head { display:flex; align-items:center; justify-content:space-between; gap:6px; padding:5px 8px; cursor:pointer; }
.dg-card .dg-head.bg-danger { background:#dc3545; color:#fff; }
.dg-card .dg-head.bg-danger:hover { background:#c82333; }
.dg-card .dg-head-name { font-size:12px; font-weight:bold; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dg-card .dg-head-sub { font-size:10px; opacity:.92; flex:0 0 auto; }
.dg-card .dg-thumbs { display:grid; grid-template-columns:repeat(3,1fr); gap:4px; padding:6px; }
.dg-card .dg-thumb { position:relative; background:rgba(0,0,0,.35); border:1px solid #4a3b2a; border-radius:4px; cursor:pointer; overflow:hidden; transition:border-color .08s; }
.dg-card .dg-thumb:hover { border-color:#ffd700; }
.dg-card .dg-thumb.cur { border-color:#ffd700; box-shadow:0 0 6px #ffd700; }
.dg-card .dg-thumb img { width:100%; height:46px; object-fit:contain; display:block; background:rgba(0,0,0,.25); }
.dg-card .dg-thumb-name { display:block; font-size:9px; color:#eee; line-height:1.15; padding:1px 2px 0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dg-card .dg-thumb-lv { display:block; font-size:8px; color:#caa; padding:0 2px 2px; }
.dg-card .dg-thumb.more { display:flex; align-items:center; justify-content:center; background:rgba(60,48,30,.6); }
.dg-card .dg-more { font-size:20px; color:#ffd700; font-weight:bold; }
/* 地图悬停 tooltip（dvg 风格：ID+中文名 + 怪物名/Lv） */
#map-tip .mt-title { font-size:13px; font-weight:bold; margin-bottom:4px; border-bottom:1px solid rgba(255,215,0,.3); padding-bottom:3px; }
#map-tip .mt-name { color:#ffd700; }
#map-tip .mt-sub { color:#cbb; font-size:11px; margin:3px 0 2px; }
#map-tip .mt-mobs { display:flex; flex-direction:column; gap:1px; }
#map-tip .mt-mob { display:flex; align-items:center; justify-content:space-between; gap:10px; }
#map-tip .mt-mob-name { color:#fff; }
#map-tip .mt-mob-lv { color:#9fd; font-size:11px; flex:0 0 auto; }
#map-tip .mt-mob-w { color:#ffd700; font-size:11px; flex:0 0 auto; cursor:default; }
#map-tip .mt-mob.boss .mt-mob-name { color:#ff8a5c; }
#map-tip .mt-mob.boss .mt-mob-lv { color:#ff8a5c; }
#map-tip .mt-empty { color:#888; font-size:11px; }
/* 仿 dvg 副本组弹框内子地图列表 */
.dg-modal-title { color:#ffd700; font-size:15px; font-weight:bold; padding:14px 16px 6px; }
.dg-modal-id { color:#caa; font-size:12px; font-weight:normal; }
.dg-modal-list { padding:0 12px 14px; }
.dg-modal-item { display:flex; align-items:center; gap:10px; padding:9px 10px; margin-top:6px; background:rgba(60,48,30,.7); border:1px solid #5a4a2a; border-radius:5px; cursor:pointer; transition:background .08s; }
.dg-modal-item:hover { background:rgba(110,85,45,.8); }
.dg-modal-item.dg-cur { border-color:#ffd700; }
.dg-modal-idx { width:22px; height:22px; line-height:22px; text-align:center; background:#5a4a2a; color:#ffd700; border-radius:50%; font-size:11px; flex:0 0 auto; }
.dg-modal-name { flex:1; color:#fff; font-size:13px; }
.dg-modal-lv { color:#caa; font-size:11px; }
.dg-modal-go { color:#ffd700; font-size:12px; }
.hud-zeny { color: #ffd700; font-size: 13px; font-weight: bold; text-shadow: 1px 1px 2px #000; margin: 0 auto 2px; text-align: center; }

/* ============ 状态图标栏（buff-bar，2026-08-15：技能图标 + 右上秒数 + 最后3秒闪烁） ============ */
.buff-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 250px; height: 0; width: 0; pointer-events: auto; z-index: 50; }
.buff-row { position: absolute; left: 50%; transform: translateX(-50%); display: flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
[data-buff-role="buff"] { bottom: 26px; }
[data-buff-role="debuff"] { bottom: 100px; z-index: 2; }
.buff-item { position: relative; width: 26px; height: 26px; border-radius: 4px; overflow: visible; background: rgba(0,0,0,.6); box-shadow: 0 0 0 1.5px rgba(0,0,0,.8); }
.buff-item.buff { border: 1.5px solid #34d399; }
.buff-item.debuff { border: 1.5px solid #f87171; }
.buff-item .buff-icon { width: 100%; height: 100%; background-size: contain; background-position: center; background-repeat: no-repeat; border-radius: 3px; }
.buff-item .buff-sec { position: absolute; bottom: -7px; right: -4px; min-width: 14px; padding: 0 2px; height: 11px; line-height: 11px; font-size: 8px; font-weight: bold; color: #fff; text-align: center; background: rgba(0,0,0,.75); border: 1px solid #555; border-radius: 6px; }
.buff-item.buff .buff-sec { color: #6ee7b7; border-color: #34d399; }
.buff-item.debuff .buff-sec { color: #fca5a5; border-color: #f87171; }
.buff-flash { animation: buffFlash 0.5s ease-in-out infinite; }
@keyframes buffFlash { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }

/* 缺 buff 标记（P3b，2026-08-15）：buff 技能未生效时黄色虚线呼吸 */
.skill-btn.buff-missing { outline: 2px dashed rgba(251,191,36,.85); animation: buffMissing 0.9s ease-in-out infinite; }
@keyframes buffMissing { 0%,100% { outline-color: rgba(251,191,36,.85); } 50% { outline-color: rgba(251,191,36,.25); } }

/* ============ 公告：版本列表卡片 ============ */
#notice-list { display: flex; flex-direction: column; gap: 6px; }
.notice-card {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; cursor: pointer;
    background: linear-gradient(180deg, rgba(40,33,20,.85), rgba(22,18,10,.85));
    border: 1px solid var(--ui-border);
    border-radius: 6px;
    transition: background .15s, border-color .15s;
    pointer-events: auto; touch-action: manipulation;
    user-select: none;
}
.notice-card:hover {
    background: linear-gradient(180deg, rgba(70,56,30,.95), rgba(40,30,14,.95));
    border-color: #8a6f3a;
}
.notice-ver {
    flex: 0 0 auto; min-width: 46px; text-align: center;
    font-size: 13px; font-weight: bold; color: #ffd86b;
    background: rgba(0,0,0,.35); border: 1px solid #5a4a2a; border-radius: 4px;
    padding: 4px 4px;
}
.notice-info { flex: 1; min-width: 0; }
.notice-ctitle {
    font-size: 13px; color: #ece3c8; font-weight: bold;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notice-cmeta { font-size: 11px; color: #8b8266; margin-top: 2px; }
.notice-go { flex: 0 0 auto; color: #ffd86b; font-size: 18px; line-height: 1; }

/* ============ 公告版本详情弹窗 ============ */
.modal-overlay {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,.6);
    display: none; align-items: center; justify-content: center;
}
.modal-box {
    position: relative;
    width: 440px; max-width: 92vw; max-height: 82vh; overflow-y: auto;
    background: rgba(12,10,8,.97);
    border: 2px solid var(--ui-border);
    border-radius: 8px;
    box-shadow: 0 0 28px rgba(0,0,0,.9), inset 0 1px 0 rgba(255,255,255,.05), inset 0 0 60px rgba(0,0,0,.5);
    padding: 18px 20px 22px;
    color: var(--text-gold);
}
.notice-modal-box { padding-top: 30px; position: relative; }
.notice-modal-box .panel-close {
    z-index: 10; pointer-events: auto; cursor: pointer;
}
.modal-close-btn {
    position: absolute; top: 10px; right: 12px; z-index: 999;
    width: 28px; height: 28px; border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #ff6666, #cc2222 50%, #880000);
    border: 2px solid #4a3b2a;
    color: #fff; font-size: 13px; font-weight: bold;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; pointer-events: auto;
    box-shadow: 0 0 6px rgba(0,0,0,.8), inset 0 1px 0 rgba(255,255,255,.25);
    transition: transform .12s, box-shadow .12s;
    line-height: 1; text-shadow: 0 1px 2px rgba(0,0,0,.8);
}
.modal-close-btn:hover { transform: scale(1.15); box-shadow: 0 0 12px rgba(255,0,0,.5); }
.modal-close-btn:active { transform: scale(0.92); }
.modal-title {
    font-size: 17px; font-weight: bold; color: #ffd86b;
    margin-bottom: 6px; padding-right: 24px;
}
.modal-meta { font-size: 11px; color: #8b8266; margin-bottom: 12px; }
.modal-body {
    font-size: 13px; color: #cfc6ff; line-height: 1.75;
    white-space: pre-wrap; word-break: break-word;
    border-top: 1px solid var(--ui-border); padding-top: 12px;
}
