        /* ============ 基础样式 ============ */
        body { font-family: 'Microsoft YaHei', sans-serif; background-color: #f0f2f5; margin: 0; padding: 20px; color: #333; }
        .container { max-width: 98%; margin: 0 auto; background: white; padding: 20px; border-radius: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
        
        /* 顶部控制栏 */
        .header { display: flex; flex-direction: column; gap: 15px; border-bottom: 2px solid #eee; padding-bottom: 20px; margin-bottom: 20px; }
        .header-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
        .user-panel select { padding: 5px; font-size: 14px; }
        
        /* 资源栏 */
        .resources { display: flex; gap: 20px; align-items: center; background: #f9f9f9; padding: 10px; border-radius: 8px; }
        .res-item { display: flex; align-items: center; gap: 5px; font-size: 14px; font-weight: bold; }
        .res-icon { font-size: 18px; }
        .btn-tiny { padding: 2px 6px; font-size: 12px; cursor: pointer; border: 1px solid #ccc; background: white; border-radius: 3px; margin-left: 2px; }
        .btn-tiny:hover { background: #eee; }

        /* 存档管理 */
        .data-controls { background-color: #fff7e6; padding: 8px; border-radius: 5px; border: 1px dashed #ffa940; display: flex; gap: 10px; align-items: center; font-size: 13px; }
        .btn-save, .btn-load { border: none; padding: 4px 10px; border-radius: 4px; cursor: pointer; color: white; font-size: 12px; }
        .btn-save { background-color: #fa8c16; }
        .btn-load { background-color: #52c41a; }

        /* ============ 导航标签 ============ */
        .nav-tabs { display: flex; border-bottom: 2px solid #1890ff; margin-bottom: 20px; }
        .nav-item { padding: 10px 25px; cursor: pointer; font-size: 15px; background: #f5f5f5; margin-right: 4px; border-top-left-radius: 6px; border-top-right-radius: 6px; }
        .nav-item.active { background: #1890ff; color: white; font-weight: bold; }
        .section-content { display: none; }
        .section-content.active { display: block; }

        /* ============ 抽卡 & 商店 ============ */
        .gacha-section, .shop-section { text-align: center; padding: 20px; background: #f9f9f9; border-radius: 8px; }
        .pool-tabs { display: flex; justify-content: center; margin-bottom: 15px; flex-wrap: wrap; }
        .pool-tab { padding: 6px 15px; cursor: pointer; background: #eee; margin: 4px; border-radius: 4px; font-size: 14px; }
        .pool-tab.active { background: #722ed1; color: white; }
        
        .btn { padding: 8px 20px; cursor: pointer; color: white; border: none; border-radius: 5px; transition: 0.3s; font-size: 14px; margin: 0 5px; }
        .btn-blue { background-color: #1890ff; }
        .btn-purple { background-color: #722ed1; }
        .btn-green { background-color: #52c41a; }
        .btn:hover { opacity: 0.8; }
        .btn:disabled, .btn-disabled { background-color: #ccc !important; cursor: not-allowed !important; opacity: 0.6; }

        /* 商店卡片 */
        .deck-container { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; }
        .deck-card { width: 220px; background: white; border: 1px solid #ddd; border-radius: 8px; padding: 15px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); text-align: left; position: relative; }
        .deck-title { font-weight: bold; font-size: 16px; margin-bottom: 5px; color: #1890ff; }
        .deck-limit { position: absolute; top: 10px; right: 10px; font-size: 12px; background: #fff0f6; color: #eb2f96; padding: 2px 5px; border-radius: 4px; border: 1px solid #ffadd2; }
        .deck-limit.full { background: #d9d9d9; color: #666; border-color: #ccc; }

        /* ============ 抽卡结果视觉升级 (核心部分) ============ */
        #result-area { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; margin-top: 20px; }
        
        .card-result { 
            width: 210px; 
            text-align: center; 
            border-radius: 8px; 
            padding: 5px; 
            background: white; 
            position: relative; 
            transition: transform 0.2s;
            box-sizing: border-box;
            border: 3px solid transparent; /* 预留边框位置 */
        }
        .card-result:hover { transform: scale(1.1); z-index: 10; }
        .card-result img { 
            width: 100%; 
            height: auto; /* 让高度根据图片比例自动调整 */
            object-fit: contain; /* 保证图片完整显示 */
            border-radius: 4px; 
            display: block; /* 防止图片底部出现微小空隙 */
        }

        /* 稀有度标签 */
        .result-label {
            position: absolute;
            top: 0px;
            right: 0px;
            background: rgba(0,0,0,0.8);
            color: white;
            padding: 2px 6px;
            border-bottom-left-radius: 6px;
            font-size: 11px;
            font-weight: bold;
            z-index: 5;
        }

        /* 颜色定义 */
        /* N卡: 白色/银色 */
        .glow-N { border-color: #d9d9d9; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
        .glow-N .result-label { background: #999; }

        /* R卡: 绿色 */
        .glow-R { border-color: #52c41a; box-shadow: 0 0 10px rgba(82, 196, 26, 0.4); }
        .glow-R .result-label { background: #52c41a; }

        /* SR卡: 蓝色 */
        .glow-SR { border-color: #1890ff; box-shadow: 0 0 15px rgba(24, 144, 255, 0.5); }
        .glow-SR .result-label { background: #1890ff; }

        /* UR卡: 紫色 */
        .glow-UR { border-color: #722ed1; box-shadow: 0 0 20px rgba(114, 46, 209, 0.6); }
        .glow-UR .result-label { background: #722ed1; }

        /* 限定卡: 金色 (最高优先级) */
        @keyframes flashGold {
            0% { box-shadow: 0 0 10px #ffd700; border-color: #ffd700; }
            50% { box-shadow: 0 0 25px #ffec3d; border-color: #ffec3d; }
            100% { box-shadow: 0 0 10px #ffd700; border-color: #ffd700; }
        }
        .glow-Limited { 
            border-color: #ffd700; 
            animation: flashGold 2s infinite; 
        }
        .glow-Limited .result-label { 
            background: linear-gradient(45deg, #d48806, #ffd700); 
            color: #fff; text-shadow: 1px 1px 0 rgba(0,0,0,0.5); 
        }

        /* ============ 筛选器 ============ */
        .filter-bar { background: #e6f7ff; padding: 10px; border-radius: 8px; margin-bottom: 15px; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
        .filter-group { display: flex; flex-direction: column; gap: 3px; }
        .filter-group label { font-size: 11px; font-weight: bold; color: #555; }
        .filter-group select, .filter-group input { padding: 4px; border: 1px solid #ccc; border-radius: 3px; font-size: 12px; width: 85px; }
        .filter-wide { width: 120px !important; }

        /* ============ 表格布局 ============ */
        table { width: 100%; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
        th, td { border: 1px solid #eee; padding: 4px 6px; text-align: center; vertical-align: middle; overflow: hidden; }
        th { background-color: #fafafa; font-weight: bold; color: #444; }
        
        .col-id { width: 60px; }           
        .col-name { width: 120px; }   
        .col-type { width: 60px; } /* 新增：类型列 */
        .col-lvl { width: 35px; }     
        .col-loc { width: 40px; }     
        .col-attr { width: 70px; }    
        .col-stat { width: 90px; } /* 修改：加宽以显示 ATK/DEF/DAM */
        .col-eff { width: 70px; }     
        .col-source { width: 90px; }  
        .col-rare { width: 40px; }    
        .col-own { width: 40px; }     
        .col-print { width: 40px; }   
        .col-act { width: 60px; }    

        .card-name { color: #1890ff; cursor: help; text-decoration: underline; font-weight: bold; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .hover-img { display: none; position: fixed; top: 50%; left: 32%; transform: translate(-50%, -50%); z-index: 1000; border: 0px solid white; box-shadow: 0 0 50px rgba(0,0,0,0.5); pointer-events: none; max-height: 60vh; }
        .card-name:hover .hover-img { display: block; }

        .tag { padding: 1px 3px; border-radius: 2px; font-size: 10px; margin: 1px; color: white; display: inline-block; }
        .tag-effect { background: #fa8c16; }
        
        .source-cell { display: flex; flex-direction: column; gap: 2px; }
        .source-tag { font-size: 10px; padding: 2px; background: #e6f7ff; color: #1890ff; border-radius: 2px; display: block; width: 100%; box-sizing: border-box; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .source-deck { background: #fff0f6; color: #eb2f96; }
        .source-none { background: #f5f5f5; color: #999; }
        .limit-tag { background: #ff4d4f; color: white; font-size: 10px; padding: 0 2px; border-radius: 2px; margin-left: 2px; }

/* ============ 操作按钮 (高质感版) ============ */

        /* 鼠标悬停时的通用效果：稍微上浮，更亮 */
        .action-btn:hover:not(.btn-disabled) { 
            transform: translateY(-1px);
            box-shadow: 0 4px 8px rgba(0,0,0,0.2);
            filter: brightness(1.1);
        }
        /* 鼠标按下时的效果 */
        .action-btn:active:not(.btn-disabled) {
            transform: translateY(0px);
            box-shadow: 0 1px 2px rgba(0,0,0,0.2) inset;
        }

        .action-btn { 
            padding: 4px 0; 
            font-size: 11px; 
            cursor: pointer; 
            border-radius: 4px; /* 圆角稍微大一点点 */
            border: none; 
            color: white; 
            margin: 2px 0; 
            display: block; 
            width: 100%; 
            font-weight: 500; /* 字体稍微细一点，不那么重 */
            transition: background-color 0.2s; /* 颜色平滑过渡 */
        }

        /* 激活状态颜色 - 柔和色调 */
        .btn-dust { 
            background-color: #d97c7c; /* 柔和的砖红色/豆沙色 */
        } 
        /* 鼠标悬停稍微加深 */
        .btn-dust:hover { background-color: #c76868; }

        .btn-craft { 
            background-color: #85c47c; /* 柔和的草绿色/莫兰迪绿 */
        }
        /* 鼠标悬停稍微加深 */
        .btn-craft:hover { background-color: #72b069; }

        /* 禁用状态 (非常浅的灰色，视觉上后退，不抢眼) */
        .btn-disabled { 
            background-color: #f5f5f5 !important; /* 接近背景色 */
            color: #c0c0c0 !important; /* 浅灰色文字 */
            cursor: not-allowed !important;
            box-shadow: none;
        }

        .print-input { width: 100%; text-align: center; border: 1px solid #ddd; padding: 2px 0; border-radius: 3px; color: #666; }
        /* ============ 组卡器专属样式 (新加的) ============ */
        .deck-builder-layout { display: flex; gap: 15px; height: 750px; }

        /* 左侧：卡组列表 */
        .deck-list-panel { width: 200px; display: flex; flex-direction: column; gap: 10px; border-right: 1px solid #eee; padding-right: 10px; overflow-y: auto; }
        .deck-item { padding: 10px; border: 1px solid #ddd; border-radius: 5px; cursor: pointer; position: relative; transition: 0.2s; background: white; }
        .deck-item:hover { border-color: #1890ff; background: #e6f7ff; }
        .deck-item.active { background: #1890ff; color: white; border-color: #1890ff; }
        .deck-status-tag { position: absolute; top: 5px; right: 5px; font-size: 10px; padding: 1px 4px; border-radius: 3px; }
        .tag-valid { background: #52c41a; color: white; } /* 50张 */
        .tag-invalid { background: #ff4d4f; color: white; } /* 非50张 */
        .tag-missing { background: #fa8c16; color: white; border: 1px solid #fff; } /* 缺卡 */

        /* 中间：当前卡组详情 & 统计 */
        .deck-main-panel { flex: 1; display: flex; flex-direction: column; gap: 10px; background: #fff; padding: 10px; border-radius: 8px; border: 1px solid #eee; }
        .deck-info-bar { display: flex; gap: 10px; align-items: center; border-bottom: 1px solid #eee; padding-bottom: 10px; }
        .deck-stats-area { font-size: 12px; background: #f9f9f9; padding: 8px; border-radius: 5px; display: flex; flex-wrap: wrap; gap: 15px; }
        .stat-group { display: flex; gap: 5px; align-items: center; }
        .deck-content-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }

        .deck-card-row { display: flex; align-items: center; padding: 4px 8px; border-bottom: 1px dashed #eee; font-size: 13px; }
        .deck-card-row:hover { background-color: #fafafa; }
        .deck-card-row.missing-card { background-color: #fff1f0; } /* 缺卡高亮 */
        .dc-count { font-weight: bold; margin-right: 10px; width: 20px; text-align: center; }
        .dc-name { flex: 1; cursor: help; }
        .dc-controls { display: flex; gap: 2px; }
        .btn-mini { width: 20px; height: 20px; line-height: 18px; text-align: center; border: 1px solid #ccc; background: white; cursor: pointer; font-size: 12px; border-radius: 3px; padding: 0; }
        .btn-mini:hover { background: #eee; }

        /* 右侧：卡池选择器 */
        .deck-picker-panel { width: 280px; display: flex; flex-direction: column; gap: 10px; border-left: 1px solid #eee; padding-left: 10px; }
        .picker-list { flex: 1; overflow-y: auto; }
        .picker-item { display: flex; justify-content: space-between; align-items: center; padding: 5px; border-bottom: 1px solid #f0f0f0; font-size: 12px; cursor: pointer; }
        .picker-item:hover { background-color: #f0faff; }
        .picker-info { display: flex; flex-direction: column; }
        .picker-add-btn { color: #1890ff; font-weight: bold; cursor: pointer; }
        /* ============ 组卡器升级样式 (请复制添加到 <style> 最后) ============ */

/* 1. 右侧选择列表：添加缩略图和详细信息样式 */
.picker-item {
    align-items: flex-start; /* 让内容顶部对齐 */
    gap: 8px; /* 图片和文字的间距 */
}
.picker-img {
    width: 45px;    /* 缩略图宽度 */
    height: 63px;   /* 缩略图高度 */
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
    flex-shrink: 0; /* 防止图片被挤压 */
}
.picker-details {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
}
.picker-tag-row {
    display: flex; 
    gap: 5px; 
    margin-top: 2px;
}
.pt-tag {
    background: #f0f0f0; 
    padding: 0 4px; 
    border-radius: 3px; 
    font-size: 10px;
}

/* 2. 中间卡组列表：大图模式样式 */
.deck-card-row {
    height: auto; /* 高度自动，适应大图 */
    padding: 10px;
    border-bottom: 1px solid #eee;
    align-items: flex-start; /* 顶部对齐 */
    position: relative;
    background: #fff;
}
/* 模仿抽卡结果的大图尺寸 (按比例稍微缩小一点以便列表能放下，或者你可以调大) */
.deck-big-img {
    width: 100px;  /* 宽度 */
    height: 140px; /* 高度 */
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    margin-right: 15px;
    border: 2px solid #eee;
}
.deck-row-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.deck-row-title {
    font-size: 16px; 
    font-weight: bold; 
    color: #1890ff;
}
.deck-row-stats {
    font-size: 13px; 
    color: #555; 
    font-weight: bold;
}
.deck-row-tags {
    display: flex; 
    flex-wrap: wrap; 
    gap: 4px;
}
/* 调整数量显示的位置 */
.dc-count-badge {
    background: #1890ff;
    color: white;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    display: inline-block;
    margin-bottom: 5px;
    align-self: flex-start;
}
/* ============ 组卡器 v4.0 样式 (信息外置+独立按钮+属性等级合并) ============ */
.deck-content-list {
    flex-direction: row !important;
    flex-wrap: wrap;
    align-content: flex-start;
    
    /* 修改这里：原来是 gap: 12px; */
    /* 改成下面这样：5px是上下间距，12px是左右间距 */
    gap: 0px 5px; 
    
    padding: 10px;
    overflow-y: auto;
}

/* 1. 卡牌容器：高度自动，由内容撑开 */
.deck-grid-item {
    width: 130px;
    height: auto; 
    min-height: 286px; /* 预留空间防止跳动 */
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 0px;
    background: #fff;
    border-radius: 6px;
    transition: transform 0.1s;
}
.deck-grid-item:hover { transform: translateY(-2px); }

/* 2. 图片区域：只负责展示和悬停 */
.grid-img-wrapper {
    width: 130px;
    height: 182px;
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    background: #000;
    cursor: zoom-in; /* 鼠标变成放大镜，提示可以看大图 */
    flex-shrink: 0;
}
.grid-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 3. 等级 & 属性 (合并版) */
.ov-level-combined {
    position: absolute;
    top: 2px; left: 2px;
    width: 20px; height: 20px;
    line-height: 20px;
    text-align: center;
    border-radius: 50%;
    color: white;
    font-size: 11px;
    font-weight: bold;
    border: 1px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.5);
    z-index: 5;
    text-shadow: 0 0 2px rgba(0,0,0,0.5);
}

/* 4. 其他角标 */
.ov-loc {
    position: absolute;
    top: 0; right: 0; left: 0;
    text-align: center;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent);
    padding-top: 2px;
    font-size: 10px;
    color: #fff;
    pointer-events: none;
}
.ov-count-badge {
    position: absolute;
    bottom: 2px; right: 2px; /* 改到右下角 */
    background: rgba(0,0,0,0.7);
    color: #ffd700;
    font-size: 11px;
    padding: 0 4px;
    border-radius: 4px;
    font-weight: bold;
    border: 1px solid #ffd700;
}
.missing-badge {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 77, 79, 0.9);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    border: 1px solid white;
    pointer-events: none;
}

/* 5. 操作按钮行 (独立的一行) */
.grid-btn-row {
    display: flex;
    justify-content: space-between;
    gap: 2px;
}
.grid-btn {
    flex: 1;
    border: 1px solid #ddd;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
    border-radius: 3px;
    font-weight: bold;
    color: #555;
    transition: 0.2s;
}
.grid-btn:hover { background: #e6f7ff; color: #1890ff; border-color: #1890ff; }
.btn-add { color: #1890ff; }
.btn-del { color: #ff4d4f; }
.btn-del:hover { background: #fff1f0; color: #ff4d4f; border-color: #ff4d4f; }

/* 6. 底部信息区域 (外置) */
.grid-info-outside {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 2px;
}
.card-name-outside {
    font-size: 12px;
    font-weight: bold;
    color: #333;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.card-meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #666;
    border-bottom: 1px dashed #eee;
    padding-bottom: 2px;
    margin-bottom: 2px;
}
.card-tags-row {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}
.mini-tag {
    font-size: 10px;
    padding: 0 3px;
    border-radius: 2px;
    color: white;
    line-height: 14px;
}

/* === 卡池选择器列表样式调整 === */
.picker-btn-group {
    display: flex;
    gap: 5px;
    align-items: center;
}
.picker-btn {
    width: 24px; height: 24px;
    line-height: 22px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    background: white;
}
.p-btn-add { color: #1890ff; border-color: #91d5ff; }
.p-btn-del { color: #ff4d4f; border-color: #ffa39e; }
.p-btn-add:hover { background: #1890ff; color: white; }
.p-btn-del:hover { background: #ff4d4f; color: white; }

/* 悬停大图 (保持不变) */
#global-hover-preview {
    position: fixed; z-index: 10000; pointer-events: none; display: none;
    width: 500px; border-radius: 8px; box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    border: 3px solid white; background: #222;
}
.btn-red {
    background: #ff4d4f;
    color: white;
    border: 1px solid #ff4d4f;
    transition: all 0.3s;
}
.btn-red:hover {
    background: #ff7875;
    box-shadow: 0 4px 12px rgba(255, 77, 79, 0.4);
}
/* ============ 登录弹窗样式 ============ */
#login-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex; justify-content: center; align-items: center;
    z-index: 9999;
}
.login-box {
    background: white;
    padding: 30px;
    border-radius: 10px;
    width: 300px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    display: flex; flex-direction: column; gap: 15px;
}
.login-box .form-group label {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}
.login-box .form-group input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}
.login-box .form-group input:focus {
    border-color: #1890ff;
    outline: none;
}