        @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;
        }

        /* 死亡滤镜 - 全屏灰度效果 */
        .dead-filter {
            filter: grayscale(80%) brightness(0.7) !important;
            transition: filter 0.3s ease;
        }

        #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: 50px;
            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;
        }

        .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: 32px;
            height: 32px;
            background: #080808;
            border: 1px solid #444;
            display: flex;
            justify-content: center;
            align-items: center;
            position: relative;
            cursor: pointer;
            font-size: 18px;
            box-shadow: inset 0 0 5px #000;
        }

        .belt-slot:hover {
            border-color: var(--text-gold);
        }

        .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.2s;
        }

        .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;
        }

        .skill-bar {
            display: flex;
            gap: 5px;
            margin-top: 2px;
            margin-bottom: 5px;
            background: #000;
            padding: 5px;
            border: 1px solid #333;
            border-radius: 4px;
        }

        .skill-btn {
            width: 50px;
            height: 50px;
            background: #1a1a1a;
            border: 2px solid #444;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 12px;
            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::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);
            /* 立体光影：外阴影 + 内阴影 + 边缘高光 */
            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;
            justify-content: space-between;
            margin-bottom: 8px;
            font-size: 0.9em;
        }

        .stat-btn {
            background: #333;
            border: 1px solid #666;
            width: 20px;
            height: 20px;
            line-height: 18px;
            text-align: center;
            cursor: pointer;
            color: #fff;
        }

        .stat-btn:hover {
            background: #555;
        }

        #inventory-panel {
            top: 10%;
            right: 20px;
            width: 320px;
        }

        .equipment-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 8px;
            margin-bottom: 20px;
            justify-items: center;
        }

        .equip-slot {
            width: 60px;
            height: 60px;
            border: 1px solid #444;
            background: #080808;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            cursor: pointer;
        }

        .bag-grid {
            display: grid;
            grid-template-columns: repeat(6, 1fr);
            gap: 4px;
        }

        .stash-grid {
            display: grid;
            grid-template-columns: repeat(6, 1fr);
            gap: 4px;
        }

        .stash-expand-btn {
            margin-top: 10px;
            padding: 8px 12px;
            background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
            border: 1px solid #444;
            border-radius: 4px;
            color: #ddd;
            font-size: 12px;
            cursor: pointer;
            text-align: center;
            transition: all 0.2s;
        }

        .stash-expand-btn:hover {
            background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 100%);
            border-color: #666;
        }

        .stash-expand-btn.disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }

        .stash-expand-btn.disabled:hover {
            background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
            border-color: #444;
        }

        .bag-slot {
            width: 48px;
            height: 48px;
            border: 1px solid #333;
            background: #080808;
            position: relative;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .item-count {
            position: absolute;
            bottom: 2px;
            right: 2px;
            color: #fff;
            font-size: 10px;
            font-weight: bold;
            text-shadow: 1px 1px 0 #000;
        }

        .enhance-level {
            position: absolute;
            top: 1px;
            right: 2px;
            color: #0f0;
            font-size: 10px;
            font-weight: bold;
            text-shadow: 1px 1px 0 #000, -1px -1px 0 #000;
        }

        #skills-panel {
            top: 15%;
            left: 340px;
            width: 280px;
        }

        .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('items.png');
            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;
            gap: 10px;
            justify-content: flex-end;
            flex-wrap: wrap;
        }

        /* 当包含层数列表时，改为纵向布局 */
        .dialog-options:has(.portal-floor-list) {
            flex-direction: column;
            align-items: stretch;
        }

        .dialog-options:has(.portal-floor-list) > .dialog-btn {
            align-self: flex-end;
        }

        .dialog-btn {
            background: #333;
            border: 1px solid #555;
            color: #fff;
            padding: 5px 15px;
            cursor: pointer;
            font-family: 'Cinzel', serif;
        }

        .dialog-btn:hover {
            border-color: var(--text-gold);
            color: var(--text-gold);
        }

        /* 传送门层数列表 */
        .portal-floor-list {
            max-height: 200px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 5px;
            margin-bottom: 10px;
            padding-right: 5px;
        }

        /* 包含层数列表时调整对话框宽度 */
        #dialog-box:has(.portal-floor-list) {
            width: 300px;
        }

        .portal-floor-list::-webkit-scrollbar {
            width: 6px;
        }

        .portal-floor-list::-webkit-scrollbar-track {
            background: rgba(0, 0, 0, 0.3);
            border-radius: 3px;
        }

        .portal-floor-list::-webkit-scrollbar-thumb {
            background: #555;
            border-radius: 3px;
        }

        .portal-floor-btn {
            width: 100%;
            text-align: left;
            padding: 8px 12px;
        }

        .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: absolute;
            background: rgba(5, 5, 8, 0.95);
            border: 1px solid var(--text-gold);
            padding: 10px;
            pointer-events: none;
            z-index: 1000;
            display: none;
            max-width: 250px;
            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;
        }

        #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: 50px;  /* 原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: 90px;  /* 原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: 210px;
            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;
        }

        /* ========== 排行榜样式 ========== */
        .leaderboard-tabs {
            display: flex;
            justify-content: center;
            gap: 5px;
            margin: 10px 0;
            padding: 0 10px;
        }

        .lb-tab {
            padding: 6px 16px;
            background: rgba(40, 35, 30, 0.8);
            border: 1px solid #3a3530;
            color: #888;
            cursor: pointer;
            font-size: 12px;
            border-radius: 3px;
            transition: all 0.2s;
        }

        .lb-tab:hover {
            background: rgba(60, 55, 50, 0.9);
            color: #aaa;
        }

        .lb-tab.active {
            background: rgba(80, 70, 50, 0.9);
            border-color: #c7b377;
            color: #c7b377;
        }

        .personal-best {
            background: rgba(30, 28, 25, 0.9);
            border: 1px solid #3a3530;
            border-radius: 5px;
            margin: 10px;
            padding: 10px;
        }

        .pb-title {
            color: #c7b377;
            font-size: 13px;
            text-align: center;
            margin-bottom: 8px;
            border-bottom: 1px solid #3a3530;
            padding-bottom: 5px;
        }

        .pb-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
        }

        .pb-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 5px;
            background: rgba(20, 18, 15, 0.6);
            border-radius: 3px;
        }

        .pb-label {
            font-size: 10px;
            color: #666;
        }

        .pb-value {
            font-size: 14px;
            color: #ddd;
            font-weight: bold;
        }

        /* ========== 稀有度光效 - 暗金/套装物品呼吸光晕 ========== */

        /* 暗金物品光效 (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;
            }
        }

        /* ========== 天赋商店系统样式 ========== */
        #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;
        }

        /* ========== 天神赐福系统样式 ========== */
        .sys-btn.db-btn {
            border-color: #ffd700;
            color: #ffd700;
            animation: blessingPulse 2s ease-in-out infinite;
        }

        .sys-btn.db-btn:hover {
            border-color: #ffec80;
            color: #ffec80;
        }

        .db-count-badge {
            margin-left: 5px;
            background: #ffd700;
            color: #000;
            padding: 1px 6px;
            border-radius: 10px;
            font-size: 11px;
            font-weight: bold;
        }

        @keyframes blessingPulse {

            0%,
            100% {
                box-shadow: 0 0 5px rgba(255, 215, 0, 0.4);
            }

            50% {
                box-shadow: 0 0 12px rgba(255, 215, 0, 0.8);
            }
        }

        .db-card {
            width: 140px;
            padding: 15px 12px;
            background: rgba(20, 20, 25, 0.9);
            border: 2px solid #555;
            border-radius: 5px;
            cursor: pointer;
            transition: all 0.2s;
            text-align: center;
        }

        .db-card:hover {
            border-color: var(--text-gold);
            box-shadow: 0 0 10px rgba(199, 179, 119, 0.5);
        }

        .db-card.normal {
            border-color: #666;
        }

        .db-card.rare {
            border-color: var(--item-magic);
        }

        .db-card-icon {
            font-size: 28px;
            margin-bottom: 6px;
        }

        .db-card-name {
            font-size: 14px;
            font-weight: bold;
            margin-bottom: 8px;
        }

        .db-card.normal .db-card-name {
            color: #fff;
        }

        .db-card.rare .db-card-name {
            color: var(--item-magic);
        }

        .db-card-effect {
            color: #88ff88;
            font-size: 12px;
            line-height: 1.4;
        }

        /* 赐福按钮状态 */
        .sys-btn.db-btn {
            border-color: #666;
            color: #999;
            animation: none;
        }

        .sys-btn.db-btn.has-pending {
            border-color: #ffd700;
            color: #ffd700;
            animation: blessingPulse 2s ease-in-out infinite;
        }

        .sys-btn.db-btn:not(.has-pending) .db-count-badge {
            background: #666;
            color: #ccc;
        }

        /* 已获得赐福列表样式 */
        .db-list-item {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px;
            border-bottom: 1px solid #333;
        }

        .db-list-item:last-child {
            border-bottom: none;
        }

        .db-list-item.rare {
            background: rgba(106, 136, 255, 0.1);
        }

        .db-list-icon {
            font-size: 18px;
            width: 24px;
            text-align: center;
        }

        .db-list-name {
            font-size: 13px;
            font-weight: bold;
            min-width: 70px;
        }

        .db-list-item.normal .db-list-name {
            color: #fff;
        }

        .db-list-item.rare .db-list-name {
            color: var(--item-magic);
        }

        .db-list-effect {
            flex: 1;
            font-size: 11px;
            color: #88ff88;
        }

        .db-list-level {
            font-size: 10px;
            color: #888;
        }

        /* 赐福列表滚动条 */
        #divine-blessing-list::-webkit-scrollbar {
            width: 6px;
        }

        #divine-blessing-list::-webkit-scrollbar-track {
            background: rgba(0, 0, 0, 0.3);
            border-radius: 3px;
        }

        #divine-blessing-list::-webkit-scrollbar-thumb {
            background: #555;
            border-radius: 3px;
        }

        #divine-blessing-list::-webkit-scrollbar-thumb:hover {
            background: #777;
        }

        #divine-blessing-list {
            scrollbar-width: thin;
            scrollbar-color: #555 rgba(0, 0, 0, 0.3);
        }

        /* ========== 每日登录奖励样式 ========== */
        .daily-reward-card {
            width: 52px;
            padding: 8px 4px;
            background: rgba(30, 30, 35, 0.95);
            border: 2px solid #444;
            border-radius: 6px;
            text-align: center;
            position: relative;
            transition: all 0.2s;
        }

        .daily-reward-card.current {
            border-color: #ffd700;
            box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
            animation: dailyPulse 1.5s ease-in-out infinite;
        }

        .daily-reward-card.claimed {
            border-color: #555;
            opacity: 0.6;
        }

        .daily-reward-card.locked {
            border-color: #333;
            opacity: 0.4;
        }

        .daily-reward-card.day7 {
            border-color: #ff8c00;
            background: linear-gradient(135deg, rgba(50, 40, 20, 0.95), rgba(80, 60, 20, 0.95));
        }

        .daily-reward-card.day7:not(.claimed) {
            animation: day7Glow 2s ease-in-out infinite;
        }

        @keyframes day7Glow {

            0%,
            100% {
                box-shadow: 0 0 8px rgba(255, 140, 0, 0.4);
            }

            50% {
                box-shadow: 0 0 20px rgba(255, 215, 0, 0.8), 0 0 30px rgba(255, 140, 0, 0.4);
            }
        }

        .daily-reward-card.day7 .daily-reward-day {
            color: #ffd700;
        }

        .daily-reward-card.day7 .daily-reward-name {
            color: #ffd700;
        }

        @keyframes dailyPulse {

            0%,
            100% {
                box-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
            }

            50% {
                box-shadow: 0 0 15px rgba(255, 215, 0, 0.7);
            }
        }

        .daily-reward-day {
            font-size: 10px;
            color: #888;
            margin-bottom: 4px;
        }

        .daily-reward-card.current .daily-reward-day {
            color: #ffd700;
        }

        .daily-reward-icon {
            font-size: 22px;
            margin-bottom: 4px;
        }

        .daily-reward-name {
            font-size: 9px;
            color: #aaa;
            line-height: 1.2;
        }

        .daily-reward-check {
            position: absolute;
            top: -5px;
            right: -5px;
            width: 18px;
            height: 18px;
            background: #4a4;
            border-radius: 50%;
            font-size: 12px;
            line-height: 18px;
            color: #fff;
        }

        #btn-claim-daily:disabled {
            background: #333;
            color: #666;
            cursor: not-allowed;
        }

        /* ========== 新手引导样式 ========== */
        /* 顶部战斗引导提示 */
        #tutorial-tip {
            position: fixed;
            top: 60px;
            left: 50%;
            transform: translateX(-50%);
            display: none;
            align-items: center;
            gap: 12px;
            padding: 12px 24px;
            background: rgba(0, 0, 0, 0.85);
            border: 2px solid var(--text-gold);
            border-radius: 8px;
            box-shadow: 0 0 20px rgba(199, 179, 119, 0.3);
            z-index: 1000;
            opacity: 0;
            transition: opacity 0.3s ease;
            animation: tutorial-pulse 2s ease-in-out infinite;
        }

        @keyframes tutorial-pulse {
            0%, 100% { box-shadow: 0 0 20px rgba(199, 179, 119, 0.3); }
            50% { box-shadow: 0 0 30px rgba(199, 179, 119, 0.6); }
        }

        .tutorial-text {
            color: #fff;
            font-size: 16px;
            font-family: 'Roboto', sans-serif;
        }

        .tutorial-key {
            display: inline-block;
            padding: 4px 10px;
            background: var(--text-gold);
            color: #000;
            font-size: 14px;
            font-weight: bold;
            border-radius: 4px;
            font-family: 'Roboto', sans-serif;
        }

        /* 城镇气泡引导 */
        #tutorial-bubble {
            position: absolute;
            display: none;
            transform: translateX(-50%);
            padding: 10px 16px;
            background: rgba(0, 0, 0, 0.92);
            border: 2px solid var(--text-gold);
            border-radius: 8px;
            white-space: nowrap;
            z-index: 500;
            text-align: center;
            pointer-events: auto;
        }

        .bubble-text {
            display: block;
            color: #fff;
            font-size: 14px;
            font-family: 'Roboto', sans-serif;
            margin-bottom: 8px;
        }

        .bubble-btn {
            background: var(--text-gold);
            color: #000;
            border: none;
            padding: 4px 16px;
            border-radius: 4px;
            font-size: 12px;
            font-weight: bold;
            cursor: pointer;
            font-family: 'Roboto', sans-serif;
        }

        .bubble-btn:hover {
            background: #e0c987;
        }

        .bubble-arrow {
            position: absolute;
            bottom: -10px;
            left: 50%;
            transform: translateX(-50%);
            width: 0;
            height: 0;
            border-left: 8px solid transparent;
            border-right: 8px solid transparent;
            border-top: 10px solid var(--text-gold);
        }

        .bubble-arrow::after {
            content: '';
            position: absolute;
            top: -12px;
            left: -6px;
            width: 0;
            height: 0;
            border-left: 6px solid transparent;
            border-right: 6px solid transparent;
            border-top: 8px solid rgba(0, 0, 0, 0.92);
        }

        /* 箭头朝右（指向右侧UI按钮） */
        #tutorial-bubble.arrow-right {
            transform: translateX(-100%) translateY(-50%);
        }

        #tutorial-bubble.arrow-right .bubble-arrow {
            bottom: auto;
            top: 50%;
            left: 100%;
            transform: translateY(-50%);
            border-top: 8px solid transparent;
            border-bottom: 8px solid transparent;
            border-left: 10px solid var(--text-gold);
            border-right: none;
        }

        #tutorial-bubble.arrow-right .bubble-arrow::after {
            top: -6px;
            left: -12px;
            border-top: 6px solid transparent;
            border-bottom: 6px solid transparent;
            border-left: 8px solid rgba(0, 0, 0, 0.92);
            border-right: none;
        }

        /* 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);
        }

        /* Blacksmith Panel Styles */
        .forge-container {
            display: flex;
            flex-direction: column;
            gap: 15px;
            padding-top: 10px;
        }

        .forge-slots-area {
            position: relative;
            height: 180px;
            background: rgba(0, 0, 0, 0.3);
            border-radius: 4px;
            border: 1px solid #333;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }

        /* Triangle Layout Connection Lines */
        .forge-slots-area::before {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            width: 120px;
            height: 60px;
            border-left: 2px dashed #444;
            border-right: 2px dashed #444;
            transform: translate(-50%, -10px);
            z-index: 0;
            opacity: 0.5;
            /* Create V shape lines */
            border-bottom: none;
            border-top: none;
            background: linear-gradient(to bottom, transparent 0%, transparent 100%);
        }

        .forge-slots-area::after {
            content: '';
            position: absolute;
            top: 60px;
            left: 50%;
            width: 140px;
            height: 2px;
            background: transparent;
            display: none;
            /* Removed complex line drawing for simplicity, using CSS borders on elements if needed */
        }

        .forge-main-slot-container {
            position: absolute;
            top: 15px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            flex-direction: column;
            align-items: center;
            z-index: 10;
        }

        .forge-sacrifices-container {
            position: absolute;
            bottom: 20px;
            width: 100%;
            display: flex;
            justify-content: center;
            gap: 80px;
            z-index: 10;
        }

        .sacrifice-wrapper {
            position: relative;
        }

        .forge-slot {
            width: 64px;
            height: 64px;
            background: #111;
            border: 2px solid #555;
            display: flex;
            justify-content: center;
            align-items: center;
            cursor: pointer;
            box-shadow: inset 0 0 10px #000;
            transition: all 0.2s;
            position: relative;
        }

        .forge-slot.main-slot {
            width: 80px;
            height: 80px;
            border-color: var(--text-gold);
            box-shadow: 0 0 15px rgba(199, 179, 119, 0.2), inset 0 0 10px #000;
        }

        .forge-slot:hover {
            border-color: #fff;
            filter: brightness(1.2);
        }

        .forge-slot.has-item {
            background-size: 80%;
            /* Smaller item icon */
        }

        .slot-placeholder {
            color: #444;
            font-size: 12px;
            pointer-events: none;
        }

        .slot-label {
            margin-top: 5px;
            font-size: 12px;
            color: #888;
        }

        .forge-info-area {
            text-align: center;
            min-height: 40px;
            background: rgba(0, 0, 0, 0.5);
            padding: 10px;
            border-radius: 4px;
            border: 1px solid #333;
        }

        .forge-preview {
            color: #aaa;
            font-size: 13px;
            line-height: 1.4;
        }

        .forge-cost {
            color: var(--text-gold);
            font-weight: bold;
            font-size: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 5px;
        }

        .forge-actions {
            display: flex;
            gap: 10px;
            justify-content: center;
            margin-top: 15px;
            /* Add some space */
        }

        .forge-tools {
            margin-top: 8px;
            margin-bottom: 5px;
        }

        .sys-btn.small-btn {
            font-size: 11px;
            padding: 4px 10px;
            min-width: auto;
            width: auto;
            border-color: #666;
            background: linear-gradient(to bottom, #444, #222);
        }

        .sys-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            filter: grayscale(100%);
            border-color: #444;
            color: #888;
            background: #222;
            box-shadow: none;
        }

        .forge-rules {
            font-size: 11px;
            color: #666;
            background: rgba(0, 0, 0, 0.2);
            padding: 8px;
            border-radius: 4px;
        }

        .forge-rules p {
            margin: 2px 0;
            padding-left: 10px;
        }

        /* Animation for successful forge */
        @keyframes forgeSuccess {
            0% {
                box-shadow: 0 0 0 rgba(255, 215, 0, 0);
                border-color: var(--text-gold);
            }

            50% {
                box-shadow: 0 0 50px rgba(255, 215, 0, 0.8);
                border-color: #fff;
                background-color: rgba(255, 215, 0, 0.3);
            }

            100% {
                box-shadow: 0 0 0 rgba(255, 215, 0, 0);
                border-color: var(--text-gold);
            }
        }

        /* Animation for failed forge */
        @keyframes forgeFail {
            0% {
                box-shadow: 0 0 0 rgba(255, 0, 0, 0);
                border-color: #555;
            }

            50% {
                box-shadow: 0 0 50px rgba(255, 0, 0, 0.8);
                border-color: #ff0000;
                background-color: rgba(255, 0, 0, 0.3);
            }

            100% {
                box-shadow: 0 0 0 rgba(255, 0, 0, 0);
                border-color: #555;
            }
        }

        .forge-success-anim {
            animation: forgeSuccess 1s ease-out;
        }

        .forge-fail-anim {
            animation: forgeFail 1s ease-out;
        }

        /* ========== 更新公告面板样式 ========== */
        .changelog-panel {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 420px;
            max-height: 70vh;
            background: rgba(10, 10, 12, 0.98);
            border: 2px solid var(--ui-border);
            border-radius: 8px;
            z-index: 250;
            pointer-events: auto;
            display: flex;
            flex-direction: column;
            box-shadow:
                0 0 30px rgba(0, 0, 0, 0.9),
                0 10px 50px rgba(0, 0, 0, 0.8),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
            animation: fadeIn 0.3s ease;
        }

        .changelog-header {
            padding: 15px 20px;
            text-align: center;
            font-size: 18px;
            color: var(--text-gold);
            border-bottom: 1px solid var(--ui-border);
            font-weight: bold;
        }

        .changelog-content {
            flex: 1;
            overflow-y: auto;
            padding: 15px 20px;
            max-height: 45vh;
        }

        /* 复用滚动条样式 */
        .changelog-content::-webkit-scrollbar {
            width: 8px;
        }

        .changelog-content::-webkit-scrollbar-track {
            background: rgba(0, 0, 0, 0.3);
            border-radius: 4px;
        }

        .changelog-content::-webkit-scrollbar-thumb {
            background: #444;
            border-radius: 4px;
            border: 1px solid #666;
        }

        .changelog-content::-webkit-scrollbar-thumb:hover {
            background: #555;
        }

        .changelog-content {
            scrollbar-width: thin;
            scrollbar-color: #444 rgba(0, 0, 0, 0.3);
        }

        .changelog-item {
            margin-bottom: 15px;
            padding-bottom: 15px;
            border-bottom: 1px solid #333;
        }

        .changelog-item:last-child {
            border-bottom: none;
            margin-bottom: 0;
            padding-bottom: 0;
        }

        .changelog-version {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 8px;
        }

        .changelog-version-num {
            background: linear-gradient(135deg, #4a3b2a, #6a5b4a);
            color: var(--text-gold);
            padding: 3px 10px;
            border-radius: 4px;
            font-size: 13px;
            font-weight: bold;
        }

        .changelog-version-title {
            color: #fff;
            font-size: 14px;
            font-weight: bold;
        }

        .changelog-highlights {
            margin: 0;
            padding-left: 20px;
            color: #aaa;
            font-size: 12px;
            line-height: 1.6;
        }

        .changelog-highlights li {
            margin-bottom: 3px;
        }

        .changelog-footer {
            padding: 15px 20px;
            border-top: 1px solid var(--ui-border);
            display: flex;
            justify-content: center;
            gap: 15px;
        }

        .changelog-confirm-btn {
            background: linear-gradient(135deg, #4a3b2a, #6a5b4a);
            border: 1px solid var(--text-gold);
            color: var(--text-gold);
            padding: 8px 30px;
            font-family: 'Cinzel', serif;
            font-size: 13px;
            cursor: pointer;
            border-radius: 4px;
            transition: all 0.2s;
        }

        .changelog-confirm-btn:hover {
            background: linear-gradient(135deg, #5a4b3a, #7a6b5a);
            box-shadow: 0 0 10px rgba(199, 179, 119, 0.3);
        }

        /* ========== 每日奖励领取闪光动画 ========== */
        @keyframes dailyFlash {
            0% {
                opacity: 1;
                transform: scale(1);
            }
            40% {
                opacity: 0.9;
            }
            100% {
                opacity: 0;
                transform: scale(1.2);
            }
        }

        /* ========== 存档选择面板样式 ========== */
        .slot-selection-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: 300;
            pointer-events: auto;
        }

        .slot-selection-overlay.active {
            display: flex;
            animation: fadeIn 0.3s ease;
        }

        .slot-selection-panel {
            position: relative;
            background: rgba(10, 10, 12, 0.95);
            border: 2px solid var(--ui-border);
            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);
            padding: 15px 20px;
        }

        .slot-selection-header {
            text-align: center;
            font-size: 16px;
            color: var(--text-gold);
            padding-bottom: 12px;
            margin-bottom: 12px;
            border-bottom: 1px solid rgba(78, 66, 46, 0.5);
        }

        .slot-selection-grid {
            display: flex;
            gap: 12px;
            justify-content: center;
            margin-bottom: 12px;
        }

        .slot-card {
            width: 130px;
            min-height: 140px;
            background: rgba(20, 20, 25, 0.95);
            border: 1px solid #444;
            border-radius: 6px;
            padding: 10px 12px;
            cursor: pointer;
            transition: all 0.2s ease;
            position: relative;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .slot-card:hover {
            border-color: var(--text-gold);
            transform: translateY(-3px);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5), 0 0 10px rgba(199, 179, 119, 0.15);
        }

        .slot-card.empty {
            justify-content: center;
            border-style: dashed;
            border-color: #555;
        }

        .slot-card.empty:hover {
            border-color: #88cc88;
            border-style: solid;
        }

        .slot-card-number {
            position: absolute;
            top: 6px;
            left: 8px;
            font-size: 11px;
            color: #555;
        }

        .slot-card-delete {
            position: absolute;
            top: 4px;
            right: 4px;
            width: 18px;
            height: 18px;
            background: rgba(180, 50, 50, 0.8);
            border: 1px solid #ff4444;
            border-radius: 50%;
            color: #fff;
            font-size: 10px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            transition: all 0.2s;
        }

        .slot-card:hover .slot-card-delete {
            opacity: 1;
        }

        .slot-card-delete:hover {
            background: #ff4444;
            transform: scale(1.1);
        }

        .slot-empty-icon {
            font-size: 32px;
            color: #555;
            margin-bottom: 6px;
        }

        .slot-empty-text {
            color: #777;
            font-size: 12px;
        }

        .slot-card.empty:hover .slot-empty-icon {
            color: #88cc88;
        }

        .slot-card.empty:hover .slot-empty-text {
            color: #88cc88;
        }

        .slot-level {
            font-size: 18px;
            color: var(--text-gold);
            font-weight: bold;
            margin-top: 10px;
            margin-bottom: 8px;
        }

        .slot-info {
            font-size: 11px;
            color: #aaa;
            text-align: center;
            line-height: 1.5;
            width: 100%;
        }

        .slot-info-row {
            display: flex;
            justify-content: space-between;
            width: 100%;
            padding: 1px 0;
        }

        .slot-info-label {
            color: #666;
        }

        .slot-info-value {
            color: #bbb;
        }

        .slot-last-played {
            font-size: 10px;
            color: #555;
            margin-top: 6px;
        }

        /* 删除存档确认对话框 */
        .delete-slot-confirm-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: 400;
        }

        .delete-slot-confirm-overlay.active {
            display: flex;
            animation: fadeIn 0.2s ease;
        }

        .delete-slot-confirm-dialog {
            background: rgba(20, 15, 15, 0.98);
            border: 2px solid #882222;
            border-radius: 8px;
            padding: 25px 30px;
            min-width: 320px;
            text-align: center;
            box-shadow: 0 0 30px rgba(136, 34, 34, 0.3);
        }

        .delete-confirm-title {
            font-size: 18px;
            color: #ff6666;
            margin-bottom: 15px;
            font-weight: bold;
        }

        .delete-confirm-text {
            color: #ccc;
            font-size: 14px;
            margin-bottom: 20px;
            line-height: 1.6;
        }

        .delete-confirm-input {
            margin-bottom: 20px;
        }

        .delete-confirm-input span {
            display: block;
            color: #888;
            font-size: 12px;
            margin-bottom: 8px;
        }

        .delete-confirm-input input {
            width: 120px;
            padding: 8px 12px;
            background: #111;
            border: 1px solid #444;
            border-radius: 4px;
            color: #fff;
            font-size: 14px;
            text-align: center;
        }

        .delete-confirm-input input:focus {
            outline: none;
            border-color: #882222;
        }

        .delete-confirm-actions {
            display: flex;
            gap: 15px;
            justify-content: center;
        }

        .delete-cancel-btn {
            background: #333;
            border: 1px solid #555;
            color: #aaa;
            padding: 8px 20px;
            font-family: 'Cinzel', serif;
            cursor: pointer;
            border-radius: 4px;
            transition: all 0.2s;
        }

        .delete-cancel-btn:hover {
            background: #444;
            color: #fff;
        }

        .delete-confirm-btn {
            background: #661111;
            border: 1px solid #882222;
            color: #ff6666;
            padding: 8px 20px;
            font-family: 'Cinzel', serif;
            cursor: pointer;
            border-radius: 4px;
            transition: all 0.2s;
        }

        .delete-confirm-btn:hover:not(:disabled) {
            background: #882222;
            color: #fff;
        }

        .delete-confirm-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }/* 传送门覆盖层 */
#portal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  transition: opacity 0.5s ease-in-out;
}

/* 施法条容器 */
#cast-bar-container {
  position: absolute;
  bottom: 120px;
  /* 位于HUD上方 */
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 20px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid #666;
  border-radius: 4px;
  display: none;
  /* 默认隐藏 */
  z-index: 1000;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* 施法条进度 */
#cast-bar-progress {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #4d94ff, #0056b3);
  border-radius: 3px;
  transition: width 0.1s linear;
}

/* 施法条文字 */
#cast-bar-text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  text-align: center;
  line-height: 20px;
  font-size: 12px;
  color: white;
  text-shadow: 1px 1px 1px black;
}

/* ========== 全服公告栏 ========== */
#announcement-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 28px;
  background: linear-gradient(180deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.6) 100%);
  border-bottom: 1px solid rgba(200, 150, 50, 0.3);
  overflow: hidden;
  z-index: 100;
  pointer-events: none;
}

#announcement-content {
  position: absolute;
  white-space: nowrap;
  line-height: 28px;
  font-size: 14px;
  font-family: 'Cinzel', serif;
  text-shadow: 0 0 8px currentColor, 1px 1px 2px black;
  padding: 0 20px;
}

/* Boss击杀公告 - 金色 */
.boss-announcement {
  color: #ffd700;
}

/* 套装掉落公告 - 绿色 */
.set-announcement {
  color: #20ff20;
}

/* 等级里程碑公告 - 紫色 */
.level-announcement {
  color: #ff66ff;
}

/* 强化成功公告 - 橙色 */
.enhance-announcement {
  color: #ff8800;
}

/* 公告滚动动画 */
@keyframes scrollAnnouncement {
  0% {
    transform: translateX(100vw);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* ========== 世界聊天框 ========== */
.chat-box {
  position: absolute;
  bottom: 190px;
  left: 20px;
  width: 260px;
  background: rgba(5, 5, 8, 0.85);
  border: 1px solid rgba(74, 59, 42, 0.6);
  border-radius: 6px;
  z-index: 80;
  pointer-events: auto;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.7);
  transition: all 0.3s ease;
}

.chat-box.collapsed {
  width: 120px;
}

.chat-box.collapsed .chat-body {
  display: none;
}

.chat-box.collapsed .chat-header {
  border-radius: 6px;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  background: linear-gradient(180deg, rgba(40, 35, 30, 0.95) 0%, rgba(25, 22, 18, 0.95) 100%);
  border-bottom: 1px solid rgba(74, 59, 42, 0.4);
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  user-select: none;
}

.chat-header:hover {
  background: linear-gradient(180deg, rgba(50, 45, 38, 0.95) 0%, rgba(35, 30, 25, 0.95) 100%);
}

.chat-title {
  color: var(--text-gold);
  font-size: 12px;
  font-weight: bold;
}

.chat-toggle {
  color: #888;
  font-size: 10px;
  transition: transform 0.3s ease;
}

.chat-box.collapsed .chat-toggle {
  transform: rotate(-90deg);
}

/* 未读消息计数 */
.chat-unread {
  color: #b8a060;
  font-size: 11px;
  margin-left: 4px;
  opacity: 0.9;
}

.chat-unread:empty {
  display: none;
}

.chat-body {
  display: flex;
  flex-direction: column;
}

.chat-messages {
  height: 120px;
  overflow-y: auto;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.5;
}

/* 聊天滚动条 */
.chat-messages::-webkit-scrollbar {
  width: 5px;
}

.chat-messages::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #444;
  border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.chat-messages {
  scrollbar-width: thin;
  scrollbar-color: #444 rgba(0, 0, 0, 0.3);
}

.chat-msg {
  margin-bottom: 4px;
  word-break: break-all;
}

.chat-msg-nickname {
  color: #88ccff;
  font-weight: bold;
}

.chat-msg-level {
  color: #888;
  font-size: 10px;
  margin-left: 2px;
}

.chat-msg-content {
  color: #ddd;
  margin-left: 4px;
}

/* 系统消息样式 */
.chat-msg.system {
  color: #ffd700;
  font-style: italic;
}

.chat-msg.system .chat-msg-nickname {
  color: #ffd700;
}

.chat-input-area {
  display: flex;
  gap: 5px;
  padding: 8px 10px;
  border-top: 1px solid rgba(74, 59, 42, 0.3);
  background: rgba(0, 0, 0, 0.3);
  border-radius: 0 0 6px 6px;
}

#chat-input {
  flex: 1;
  padding: 5px 8px;
  font-size: 12px;
  background: rgba(20, 20, 25, 0.9);
  border: 1px solid #444;
  border-radius: 3px;
  color: #fff;
  font-family: 'Roboto', sans-serif;
}

#chat-input:focus {
  outline: none;
  border-color: var(--text-gold);
}

#chat-input::placeholder {
  color: #666;
}

#chat-send-btn {
  padding: 5px 12px;
  font-size: 11px;
  background: linear-gradient(180deg, #4a3b2a 0%, #2a2520 100%);
  border: 1px solid #5a4b3a;
  border-radius: 3px;
  color: var(--text-gold);
  cursor: pointer;
  font-family: 'Cinzel', serif;
  transition: all 0.2s;
}

#chat-send-btn:hover {
  background: linear-gradient(180deg, #5a4b3a 0%, #3a3530 100%);
  border-color: var(--text-gold);
}

#chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 聊天冷却提示 */
.chat-cooldown {
  color: #ff6666;
  font-size: 10px;
  text-align: center;
  padding: 3px;
}