.floating-batch-btn {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1001;
    background: var(--accent-gold);
    color: white;
    padding: 8px 15px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s;
    opacity: 0.9;
}
.floating-batch-btn:hover {
    transform: translateY(-2px);
    opacity: 1;
}
.floating-batch-btn.hidden {
    display: none;
}

:root {
    /* --- 纸墨底色 --- */
    --bg-base: #f4f1e8;            /* 宣纸陈色 */
    --panel-bg: rgba(255, 253, 249, 0.95); /* 凝脂白 */
    
    /* --- 五色观 --- */
    --text-main: #2b3330;          /* 浓墨 */
    --text-light: #66706d;         /* 淡墨 */
    
    --primary-color: #4a7062;      /* 竹青 - 主色 */
    --primary-dark: #2d453b;       /* 深竹 - 标题 */
    --primary-light: #8cae9e;      /* 浅竹 - 装饰 */
    
    --accent-gold: #cba768;        /* 鎏金 - 高亮 */
    --danger-color: #a65555;       /* 丹砂 - 警告/关闭 */
    
    --border-color: #d6d2c4;       /* 纸浆痕 */
    
    /* --- 渐变体系 --- */
    --gradient-main: linear-gradient(135deg, #4a7062 0%, #355749 100%);
    --gradient-gold: linear-gradient(to bottom, #fcf9f0, #f3eace);
    
    /* --- 阴影与光效 --- */
    --shadow-soft: 0 4px 15px rgba(45, 69, 59, 0.08); 
    --shadow-float: 0 15px 40px rgba(30, 40, 35, 0.25);
    --glow-gold: 0 0 15px rgba(203, 167, 104, 0.3);
    
    /* --- 层级 --- */
    --z-window: 1600;
    --z-nav: 900;
    --z-modal: 1700;
    --z-tooltip: 2000;

    /* --- 资源颜色 --- */
    --res-insight: #cca352;     
    --res-lingshi: #6b8e9e;     
    --res-yinliang: #9daeb3;  
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    font-family: "KaiTi", "STKaiti", "SimSun", serif; /* 强制楷体/衬线 */
    background-color: var(--bg-base);
    /* 宣纸纹理背景 */
    background-image: 
        url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E"),
        radial-gradient(circle at 50% 50%, rgba(255,255,255,0.8) 0%, rgba(244, 241, 232, 0) 100%);
    background-attachment: fixed;
    margin: 0; padding: 0;
    color: var(--text-main);
    line-height: 1.6;
    font-size: 16px;
    letter-spacing: 0.05em;
    overflow-x: hidden;
}

/* 滚动条美化 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,0.02); }
::-webkit-scrollbar-thumb { background: #c0bcae; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-color); }

/* =========================================
   2. 头部与导航 (Header)
   ========================================= */
header {
    position: sticky; top: 0; /* 桌面端吸顶 */
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    padding: 12px 25px; 
    background: rgba(244, 241, 232, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(203, 167, 104, 0.15); /* 淡金色分隔线 */
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    z-index: 50;
    transition: all 0.3s;
    gap: 15px;
}

.header-brand,
#header-char-info { 
    font-size: 1.5rem; font-weight: 900; 
    color: var(--primary-dark); letter-spacing: 4px;
    text-shadow: 1px 1px 0px rgba(255,255,255,0.8);
    background: linear-gradient(to right, #2d453b, #4a7062);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
    grid-column: 1;
}

header > button {
    grid-column: 3;
    white-space: nowrap;
}

header .resource-group {
    grid-column: 2;
}

h1, h2, h3, h4, h5 { margin-top: 0; color: var(--primary-dark); font-weight: bold; letter-spacing: 1px; }
ul { list-style: none; padding: 0; margin: 0; }

/* === 按钮体系 (带流光动画) === */
button {
    cursor: pointer; background: var(--gradient-main); color: #fff;
    border: none; padding: 5px 15px; border-radius: 4px; 
    font-size: 13px; font-family: inherit; font-weight: bold;
    box-shadow: 0 2px 4px rgba(61, 110, 90, 0.3); 
    transition: all 0.3s ease; letter-spacing: 1px;
    position: relative; overflow: hidden;
}
/* 流光特效 */
button::after {
    content: ""; position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.3) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg); transition: none;
}
button:hover::after { left: 150%; transition: left 0.7s ease-in-out; }
button:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(61, 110, 90, 0.4); filter: brightness(1.1); }
button:active { transform: translateY(1px); box-shadow: none; }

.btn-danger { background: linear-gradient(135deg, #a65555 0%, #8a4141 100%); box-shadow: 0 2px 6px rgba(166, 85, 85, 0.3); }
.btn-success { background: linear-gradient(135deg, #4a7062 0%, #355749 100%); }

/* === 输入框 === */
input, select, textarea {
    padding: 8px 5px; border: none; border-bottom: 2px solid var(--border-color);
    border-radius: 0; font-size: 15px; width: 100%; margin-bottom: 10px; 
    background-color: transparent; font-family: inherit; color: var(--text-main); transition: border-color 0.3s;
}
textarea { border: 1px solid var(--border-color); border-radius: 4px; }
input:focus, select:focus, textarea:focus { outline: none; border-bottom-color: var(--primary-color); background: rgba(255,255,255,0.4); }

/* =========================================
   3. 布局与容器 (PC端三列布局)
   ========================================= */
.screen { min-height: 100vh; display: flex; flex-direction: column; }
.hidden { display: none !important; }
.container { width: 100%; max-width: 1800px; margin: 0 auto; padding: 20px; flex: 1; }

.panel, .sub-panel {
    background: var(--panel-bg); 
    border: 1px solid var(--border-color);
    /* 双线边框装饰 */
    outline: 3px double transparent; 
    border-radius: 4px; padding: 25px; 
    box-shadow: var(--shadow-soft); margin-bottom: 25px; position: relative;
    /* 面板载入动画 */
    animation: slideUpFade 0.5s ease-out both;
}
/* 面板内边框装饰 */
.sub-panel::before {
    content: ""; position: absolute; top: 6px; left: 6px; right: 6px; bottom: 6px;
    border: 1px dashed rgba(214, 210, 196, 0.7); pointer-events: none; border-radius: 2px;
}

/* 手机端禁用面板虚线装饰 */
@media (max-width: 768px) {
    .sub-panel::before {
        display: none !important;
    }
}

/* 核心布局：PC端三列显示（物品面板移到底部抽屉） */
.char-dashboard { 
    display: grid; 
    grid-template-columns: 1fr 1fr 1fr; 
    gap: 20px; align-items: start; 
}

/* === PC端物品抽屉样式 === */
@media (min-width: 769px) {
    .inventory-drawer {
        position: fixed !important;
        bottom: 0 !important;
        left: 50% !important;
        transform: translateX(-50%) translateY(calc(100% - 45px)) !important;
        width: 95% !important;
        max-width: 1700px !important;
        height: 55vh !important;
        z-index: 1500 !important;
        margin: 0 !important;
        border-radius: 15px 15px 0 0 !important;
        box-shadow: 0 -10px 40px rgba(0,0,0,0.3) !important;
        background: var(--panel-bg) !important;
        transition: transform 0.4s ease-out !important;
        border: 2px solid var(--accent-gold) !important;
        border-bottom: none !important;
        display: block !important; /* PC端始终显示拉手 */
        animation: none !important; /* 禁用 sub-panel 的默认进入动画，防止 transform 冲突 */
        padding: 0 25px 25px 25px !important; /* 顶部留给拉手,其他保持面板padding */
        overflow: hidden !important; /* 防止内容穿透到拉手上方 */
    }

    .inventory-drawer.open {
        transform: translateX(-50%) translateY(0) !important;
    }

    .drawer-handle {
        display: flex !important;
    }
    
    /* PC端抽屉内容区域样式 - 防止内容穿透拉手 */
    #tab-inventory {
        overflow-y: auto !important;
        max-height: calc(55vh - 45px) !important; /* 抽屉高度减去拉手高度 */
        padding-top: 10px !important;
        margin-top: 0 !important; /* 防止上边距造成的漏出 */
    }
    
    /* PC端抽屉内的网格调整为多列 */
    #tab-inventory .inventory-grid { 
        display: grid !important;
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)) !important; /* 自适应列数 */
        gap: 10px !important;
        max-height: 28vh !important; /* 抽屉内部滚动区域 */
    }
}

.drawer-handle {
    height: 45px;
    display: none; /* 默认隐藏（移动端） */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: linear-gradient(to bottom, var(--panel-bg), rgba(255, 253, 249, 0.98));
    backdrop-filter: blur(8px); /* 毛玻璃效果 */
    color: var(--primary-dark);
    font-weight: bold;
    font-size: 1rem;
    letter-spacing: 2px;
    border-bottom: 1px solid var(--accent-gold);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.drawer-handle:hover {
    background: rgba(203, 167, 104, 0.15);
}

.handle-icon {
    margin-right: 10px;
    font-size: 1.2rem;
    transition: transform 0.3s;
}

.inventory-drawer.open .handle-icon {
    transform: rotate(180deg);
}

/* 隐藏移动端导航中的属性和行囊切换按钮在PC端不生效（因为PC端不是Tab切换） */

@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.panel h3, .sub-panel h4 { 
    margin: 0 0 20px 0; color: var(--primary-dark); 
    border-bottom: 1px solid rgba(74, 112, 98, 0.15); 
    padding-bottom: 10px; text-align: center; font-size: 1.2rem; position: relative;
}
.sub-panel h4 {
    border-left: 5px solid var(--primary-color); padding-left: 10px; text-align: left; border-bottom: none;
    background: linear-gradient(90deg, rgba(74, 112, 98, 0.08), transparent); 
    padding-top: 5px; padding-bottom: 5px;
}

.dual-column-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-row { display: flex; gap: 10px; align-items: center; margin-bottom: 15px; }

/* =========================================
   4. 面板内部组件美化 (Player 专用)
   ========================================= */

/* --- 资源徽章 --- */
.resource-group { 
    display: flex !important; 
    gap: 10px !important; 
    margin: 0 auto !important; 
    align-items: center; 
    font-size: 0.9rem;
    flex-wrap: wrap !important;
    justify-content: center !important; /* 电脑端居中对齐 */
    max-width: 1200px;
    padding: 0 20px !important;
}
.resource-badge {
    background: #fff; border: 1px solid var(--border-color); padding: 4px 12px; border-radius: 20px; 
    font-size: 0.95rem; display: flex; align-items: center; gap: 5px; box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    transition: transform 0.2s; white-space: nowrap; /* [修复] 防止数值和标签换行 */
}
.resource-badge:hover { transform: translateY(-1px); border-color: var(--accent-gold); }
.resource-badge b { color: var(--text-main); font-family: "Georgia", serif; }

/* --- 属性状态 (Stats) --- */
.stats-container ul { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0; margin: 0; }
.stats-container li {
    display: flex; justify-content: space-between; padding: 8px 10px;
    background: rgba(255,255,255,0.6); border-bottom: 1px dashed var(--border-color); 
    font-size: 0.9rem; border-radius: 2px; transition: all 0.2s;
}
.stats-container li:hover { background: #fff; transform: translateX(3px); }

/* --- 社交技能 (Social Skills) - 扁平化样式 --- */
.social-skill-item {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    padding: 6px 10px;
    background: rgba(255,255,255,0.6);
    border-bottom: 1px dashed var(--border-color);
    font-size: 0.9rem; 
    border-radius: 2px; 
    transition: all 0.2s;
    gap: 8px;
    line-height: 1.5;
}
.social-skill-item:hover { 
    background: #fff; 
    transform: translateX(3px); 
}
.social-skill-input {
    width: 60px;
    height: 22px;
    padding: 0 6px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 0.88rem;
    text-align: center;
    background: #fff;
    transition: all 0.2s;
    font-weight: 600;
    color: var(--primary-color);
    line-height: 20px;
    flex-shrink: 0;
    box-sizing: border-box;
    margin-top: 1px;
}
.social-skill-input:hover {
    border-color: #bbb;
}
.social-skill-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(45, 69, 59, 0.1);
}

/* 手机端优化 */
@media (max-width: 768px) {
    .social-skill-item {
        padding: 5px 8px;
        gap: 6px;
        font-size: 0.85rem;
        line-height: 1.5;
    }
    .social-skill-input {
        width: 50px;
        height: 20px;
        padding: 0 4px;
        font-size: 0.82rem;
        line-height: 18px;
        margin-top: 1px;
    }
}

/* --- 功力值 (Power) - 呼吸灯特效 --- */
.power-container {
    text-align: center; margin-bottom: 25px; padding: 20px 10px;
    background: radial-gradient(circle at center, rgba(203, 167, 104, 0.1) 0%, transparent 70%);
    border-top: 1px solid var(--accent-gold); border-bottom: 1px solid var(--accent-gold);
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.power-container::after, .power-container::before {
    content: "✦"; color: var(--accent-gold); position: absolute; top: 50%; transform: translateY(-50%); font-size: 1.2rem; opacity: 0.8;
}
.power-container::before { left: 15px; }
.power-container::after { right: 15px; }

.power-label { font-size: 0.9rem; color: var(--text-light); letter-spacing: 6px; margin-bottom: 5px; }
.power-value {
    font-size: 2.8rem; font-weight: bold;
    background: linear-gradient(135deg, #2d453b 20%, #cba768 50%, #2d453b 80%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: 'STKaiti', serif; line-height: 1.1;
    text-shadow: 0 2px 10px rgba(203, 167, 104, 0.15);
    /* 呼吸动画 */
    animation: breathe 3s infinite ease-in-out;
}
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: 0.9; } 50% { transform: scale(1.02); opacity: 1; } }

/* 
   === 通用卡片网格系统 (Player 专用) ===
   Admin 页面使用 .admin-grid-container，互不干扰
*/
.card-grid {
    display: grid;
    /* PC端自适应多列，最小卡片宽度120px */
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    padding: 12px;
    background: rgba(255,255,255,0.4);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow-y: auto;
    max-height: 400px;
}

/* 锻造列表专用，更宽的卡片 */
#forge-list {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
}

/* 商店列表专用，中等宽度的卡片 */
#shop-item-list, #shop-char-list {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
}

#shop-item-list .unified-card, #shop-char-list .unified-card {
    padding: 15px;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

#shop-char-list .unified-card.selected {
    border: 2px solid var(--accent-gold);
    background: #fdfbf5;
    box-shadow: 0 0 15px rgba(203, 167, 104, 0.3);
    transform: translateY(-2px);
}

/* 行囊资源条 - 简洁版 */
.inventory-resource-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 8px 15px;
    margin: 0 0 15px 0;
    background: rgba(250, 247, 240, 0.8);
    border-top: 1px solid rgba(203, 167, 104, 0.15);
    border-bottom: 1px solid rgba(203, 167, 104, 0.15);
}

.res-sync {
    cursor: pointer;
    font-size: 1.3rem;
    color: var(--primary-color);
    opacity: 0.6;
    transition: all 0.3s;
    user-select: none;
    flex-shrink: 0;
}

.res-sync:hover {
    opacity: 1;
    transform: rotate(180deg);
}

#user-resource-display {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.res-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-light);
    font-size: 0.9rem;
}

.res-item b {
    color: var(--primary-dark);
    font-family: 'Courier New', Courier, monospace;
    font-size: 1rem;
    font-weight: 600;
}

@media (max-width: 768px) {
    .inventory-resource-bar {
        padding: 6px 10px;
        gap: 10px;
    }
    
    .res-sync {
        font-size: 1.2rem;
    }
    
    #user-resource-display {
        gap: 12px;
    }
    
    .res-item {
        font-size: 0.85rem;
    }
    
    .res-item b {
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    #forge-list, #shop-item-list, #shop-char-list {
        grid-template-columns: 1fr !important;
        padding: 10px 5px !important;
    }
    
    #shop-item-list .unified-card, #shop-char-list .unified-card {
        padding: 12px;
        min-height: auto;
    }
    
    #forge-list .recipe-card {
        padding: 15px !important;
        min-height: auto !important;
        text-align: left !important; /* 手机端左对齐更易读 */
    }
    
    #forge-list .recipe-card h4 {
        font-size: 1rem !important;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    #forge-list .recipe-stats {
        margin: 8px 0 !important;
        justify-content: flex-start !important;
    }
    
    #forge-list .recipe-stats span {
        padding: 4px 10px !important;
        font-size: 0.85rem !important;
    }

    #forge-list .meta {
        margin: 5px 0 !important;
        display: block !important;
        width: fit-content;
    }

    #forge-list .recipe-stats div {
        font-size: 0.9rem !important; /* 调大地法宝效果描述 */
        line-height: 1.4 !important;
    }
}

.unified-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    transition: all 0.2s ease;
    min-height: 110px;
    position: relative;
}
.unified-card:hover { transform: translateY(-3px); border-color: var(--primary-color); box-shadow: 0 5px 15px rgba(61, 110, 90, 0.15); }

/* --- 物品类型染色优化版 --- */
/* 通用样式优化 */
.unified-card .meta {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-top: 4px;
    font-weight: bold;
    color: #888;
    border: none !important; /* 去除边框让界面更干净 */
}

.sub-panel .unified-card h4,
.unified-card h4 {
    font-size: 0.9rem;
    font-weight: bold;
    margin: 0 0 5px 0;
    color: var(--text-main);
    position: relative;
    padding: 4px 8px 4px 20px; /* 统一内边距 */
    border-bottom: none !important; /* 移除下划线 */
    border-left: none !important;
    
    /* 文字溢出隐藏 */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    
    /* 默认渐变背景 */
    background: linear-gradient(to right, rgba(203, 167, 104, 0.05), transparent);
    border-radius: 0 4px 4px 0;
}

/* 左侧装饰条 - 默认样式 */
.unified-card h4::before {
    content: "";
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 70%;
    background: var(--primary-color); /* 默认颜色 */
    border-radius: 2px;
    opacity: 1;
}

/* 1. 消耗品 (淡蓝) */
.item-type-消耗品 { border-left: none !important; }
.item-type-消耗品 h4 { 
    background: linear-gradient(to right, rgba(21, 101, 192, 0.05), transparent) !important;
    padding: 4px 8px 4px 20px !important;
    margin-left: 0 !important;
    border-radius: 0 4px 4px 0;
}
.item-type-消耗品 h4::before { background: #1565c0 !important; }

/* 2. 材料 (自然绿) */
.item-type-材料 { border-left: none !important; }
.item-type-材料 h4 { 
    background: linear-gradient(to right, rgba(46, 125, 50, 0.05), transparent) !important;
    padding: 4px 8px 4px 20px !important;
    margin-left: 0 !important;
    border-radius: 0 4px 4px 0;
}
.item-type-材料 h4::before { background: #2e7d32 !important; }

/* 3. 地契 (典雅红) */
.item-type-地契 { border-left: none !important; }
.item-type-地契 h4 { 
    background: linear-gradient(to right, rgba(198, 40, 40, 0.05), transparent) !important;
    padding: 4px 8px 4px 20px !important;
    margin-left: 0 !important;
    border-radius: 0 4px 4px 0;
}
.item-type-地契 h4::before { background: #c62828 !important; }

/* 4. 配方 (墨绿) */
.item-type-配方 { border-left: none !important; }
.item-type-配方 h4 { 
    background: linear-gradient(to right, rgba(0, 105, 92, 0.05), transparent) !important;
    padding: 4px 8px 4px 20px !important;
    margin-left: 0 !important;
    border-radius: 0 4px 4px 0;
}
.item-type-配方 h4::before { background: #00695c !important; }

/* 5. 贵重物品 (琥珀橙) */
.item-type-贵重物品 { border-left: none !important; }
.item-type-贵重物品 h4 { 
    background: linear-gradient(to right, rgba(239, 108, 0, 0.05), transparent) !important;
    padding: 4px 8px 4px 20px !important;
    margin-left: 0 !important;
    border-radius: 0 4px 4px 0;
}
.item-type-贵重物品 h4::before { background: #ef6c00 !important; }

/* 6. 装备 (青黛色) */
.item-type-装备 { border-left: none !important; }
.item-type-装备 h4 { 
    background: linear-gradient(to right, rgba(0, 131, 143, 0.05), transparent) !important;
    padding: 4px 8px 4px 20px !important;
    margin-left: 0 !important;
    border-radius: 0 4px 4px 0;
}
.item-type-装备 h4::before { background: #00838f !important; }

/* 7. 武器/防具 (暗金) */
.item-type-武器, .item-type-防具 { border-left: none !important; }
.item-type-武器 h4, .item-type-防具 h4 { 
    background: linear-gradient(to right, rgba(158, 157, 36, 0.05), transparent) !important;
    padding: 4px 8px 4px 20px !important;
    margin-left: 0 !important;
    border-radius: 0 4px 4px 0;
}
.item-type-武器 h4::before, .item-type-防具 h4::before { background: #9e9d24 !important; }

/* 8. 修炼 (灰紫) */
.item-type-修炼 { border-left: none !important; }
.item-type-修炼 h4 { 
    background: linear-gradient(to right, rgba(106, 27, 154, 0.05), transparent) !important;
    padding: 4px 8px 4px 20px !important;
    margin-left: 0 !important;
    border-radius: 0 4px 4px 0;
}
.item-type-修炼 h4::before { background: #6a1b9a !important; }

.unified-card .actions { display: flex; gap: 5px; margin-top: auto; flex-wrap: wrap; }
.unified-card .actions button { flex: 1; padding: 4px 0; font-size: 11px; white-space: nowrap; }

.empty-slot-card {
    border: 1px dashed #ccc; background: rgba(255,255,255,0.2); border-radius: 4px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: #aaa; min-height: 110px; transition: 0.2s;
}
.empty-slot-card:hover { border-color: var(--primary-color); background: #fff; }

/* 批量框 (旧版 Player 可能用，Admin用新版) */
.batch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    padding: 10px;
    background: rgba(255,255,255,0.4);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    max-height: 250px;
    overflow-y: auto;
}
.batch-card {
    display: block; background: #fff; border: 1px solid var(--border-color);
    border-radius: 4px; padding: 8px; cursor: pointer; transition: all 0.2s;
}
.batch-card:hover { border-color: var(--primary-color); transform: translateY(-1px); }
.batch-card:has(input:checked) { background-color: #f0fdf9; border-color: var(--primary-color); box-shadow: 0 0 0 1px var(--primary-color); }
.batch-card-header { display: flex; align-items: center; gap: 5px; border-bottom: 1px dashed #eee; padding-bottom: 5px; margin-bottom: 5px; font-size: 0.9rem; font-weight: bold; }
.batch-card-header input { width: auto; margin: 0; }
.batch-res-grid { display: flex; justify-content: space-between; font-size: 0.75rem; color: #666; }
.batch-res-item b { color: var(--text-main); margin-left: 2px; }

/* --- 装备与法宝 (Player页面专用Grid) --- */
.equip-grid-container { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.equip-grid-container .unified-card, .equip-grid-container .empty-slot-card { min-height: 100px; padding: 8px; }

.cultivation-grid-container { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 5px; }
.cultivation-item {
    display: flex; flex-direction: column; align-items: center; justify-content: space-between;
    background: #fff; border: 1px solid var(--border-color); padding: 10px 5px; border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03); transition: all 0.2s; min-height: 90px;
}
.cultivation-item.active { border-color: var(--accent-gold); background-color: #fdfbf5; box-shadow: 0 0 10px rgba(203, 167, 104, 0.2); }
.cultivation-name { font-weight: bold; color: var(--primary-dark); cursor: pointer; border-bottom: 1px dashed #ccc; }

/* --- 招式槽位 --- */
.skill-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.skill-slot { 
    height: 52px; padding: 0 5px; background-color: #fcfcfb;
    border: 1px solid var(--border-color); border-radius: 4px; 
    display: flex; justify-content: center; align-items: center; 
    font-size: 0.9rem; font-weight: bold; color: #555; 
    cursor: pointer; text-align: center; overflow: hidden;
    transition: all 0.2s; white-space: nowrap;
}
.skill-slot:not(.empty) { border-left: 3px solid var(--primary-color); }
.skill-slot:hover { border-color: var(--primary-color); background-color: #fff; box-shadow: 0 3px 8px rgba(74, 112, 98, 0.15); transform: translateY(-1px); }
.skill-slot.empty { border-style: dashed; color: #ccc; background-color: transparent; }

/* --- 技能列表 --- */
/* 功法分类标题样式 */
.skill-category-header {
    background: linear-gradient(90deg, rgba(74, 112, 98, 0.08), transparent);
    color: var(--primary-dark);
    padding: 8px 10px;
    margin-top: 15px; 
    margin-bottom: 8px;
    border-radius: 2px;
    font-weight: bold;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid var(--primary-color);
    transition: background 0.2s;
}
.skill-category-header:hover {
    background: linear-gradient(90deg, rgba(74, 112, 98, 0.15), transparent);
}

.skill-list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; padding: 8px 4px; }
.skill-mini-card {
    background: #fff; border: 1px solid var(--border-color); border-radius: 4px;
    padding: 8px 10px; display: flex; justify-content: space-between; align-items: center;
    font-size: 0.85rem; box-shadow: 0 1px 2px rgba(0,0,0,0.03); transition: all 0.2s;
    position: relative; overflow: hidden; padding-left: 20px;
}
.skill-mini-card:hover { border-color: var(--primary-color); transform: translateX(2px); box-shadow: 0 2px 8px rgba(74, 112, 98, 0.1); }

.skill-name-click {
    cursor: pointer; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; 
    font-weight: bold; color: var(--text-main); text-align: center;
}
.skill-name-click:hover { color: var(--primary-color); }

/* 左上角三角形角标 */
.rank-badge {
    position: absolute; top: 0; left: 0; width: 32px; height: 32px;
    color: #fff; font-size: 10px; font-weight: bold;
    font-family: "SimSun", "Songti SC", serif; text-shadow: 0 1px 1px rgba(0,0,0,0.3);
    clip-path: polygon(0 0, 100% 0, 0 100%);
    display: flex; align-items: flex-start; justify-content: flex-start;
    padding-top: 1px; padding-left: 2px; line-height: 1.2;
    z-index: 5; pointer-events: none;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

.skill-mini-card.rank-lv-1 { border-left: 2px solid #ccc; background-color: #ffffff; border-color: #dcd6c5; }
.skill-mini-card.rank-lv-1 .rank-badge { background-color: #7a8b85; }
.skill-mini-card.rank-lv-2 { border-left: 2px solid #8e44ad; background-color: #fbf7ff; border-color: #d7bde2; }
.skill-mini-card.rank-lv-2 .rank-badge { background-color: #9b59b6; }
.skill-mini-card.rank-lv-2:hover { background-color: #f4e6fc; border-color: #9b59b6; }
.skill-mini-card.rank-lv-2 .btn-mini-add { color: #8e44ad; border-color: #8e44ad; }
.skill-mini-card.rank-lv-2 .btn-mini-add:hover { background-color: #8e44ad; color: #fff; }
.skill-mini-card.rank-lv-3 { border-left: 2px solid #d35400; background-color: #fffbf0; border-color: #f9e79f; }
.skill-mini-card.rank-lv-3 .rank-badge { background-color: #d35400; }
.skill-mini-card.rank-lv-3:hover { background-color: #fef9e7; border-color: #f39c12; }
.skill-mini-card.rank-lv-3 .btn-mini-add { color: #d35400; border-color: #d35400; }
.skill-mini-card.rank-lv-3 .btn-mini-add:hover { background-color: #d35400; color: #fff; }

.btn-mini-add {
    background: transparent; color: var(--primary-color);
    border: 1px solid var(--primary-color); border-radius: 4px;
    width: 22px; height: 22px; line-height: 20px; padding: 0; flex-shrink: 0;
}
.btn-mini-add:hover { background: var(--primary-color); color: white; transform: scale(1.1); }

/* --- 运功心法 --- */
.xinfa-btn br { display: none; }
.xinfa-grid { display: flex; flex-direction: column; gap: 12px; }
.xinfa-btn { 
    width: 100%; box-sizing: border-box; 
    border: 1px solid var(--border-color); border-radius: 6px; padding: 18px; 
    text-align: left; background: #fff; cursor: pointer; transition: all 0.2s; 
    position: relative; overflow: hidden; box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.xinfa-btn::after { content: "心法"; position: absolute; right: 10px; bottom: -10px; font-size: 4rem; opacity: 0.05; font-family: "KaiTi"; pointer-events: none; }
.liupai-btn::after { content: "内功" !important; }
.xinfa-btn.filled { background-color: #f6f9f0; border: 1px solid #cbdccb; border-left: 5px solid var(--primary-color); }
.xinfa-btn:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); transform: translateY(-1px); }
.xinfa-btn b { font-size: 1.2rem !important; color: var(--primary-dark); display: block; margin-bottom: 2px; line-height: 1.2; }
.xinfa-btn span { font-size: 1rem !important; color: #555 !important; line-height: 1.3; display: block; margin-top: 0; opacity: 0.9; }

/* =========================================
   5. 登录与后台
   ========================================= */
#login-screen { 
    justify-content: center; align-items: center; 
    background: radial-gradient(circle at center, rgba(255,255,255,0.8) 0%, rgba(220, 215, 200, 0.8) 100%);
}

.login-card {
    background: rgba(255, 253, 249, 0.95);
    border: 1px solid var(--border-color); outline: 3px double transparent; 
    padding: 40px; border-radius: 6px; box-shadow: var(--shadow-float);
    width: 90%; max-width: 420px; text-align: center; position: relative;
    backdrop-filter: blur(5px); animation: floatUp 0.5s ease-out;
}
.login-card::before {
    content: ""; position: absolute; top: 8px; left: 8px; right: 8px; bottom: 8px;
    border: 1px dashed rgba(0,0,0,0.1); pointer-events: none; border-radius: 4px;
}

/* 角色选择树 */
.tree-user-block { margin-bottom: 10px; background: #fff; border: 1px solid var(--border-color); border-radius: 4px; overflow: hidden; text-align: left; }
.tree-user-header { 
    background-color: rgba(74, 112, 98, 0.05); padding: 8px 15px; border-bottom: 1px solid #eee; 
    font-weight: bold; color: var(--primary-color); font-size:0.95rem;
}
.tree-char-item { 
    padding: 10px 15px; border-bottom: 1px dashed #eee; cursor: pointer; 
    display: flex; justify-content: space-between; align-items: center; font-size:0.9rem;
    transition: 0.2s;
}
.tree-char-item:hover { background-color: rgba(74, 112, 98, 0.1); padding-left: 20px; }
.tree-char-item:last-child { border-bottom: none; }

/* =========================================
   6. 弹窗与悬浮窗
   ========================================= */
.modal-overlay { 
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(43, 51, 48, 0.6); backdrop-filter: blur(4px); 
    display: flex; justify-content: center; align-items: center; z-index: var(--z-modal);
    animation: fadeIn 0.3s;
}

.modal-content { 
    background-color: #fdfbf7; border: 1px solid var(--accent-gold); 
    box-shadow: var(--shadow-float); width: 90%; max-width: 520px;
    border-radius: 6px; display: flex; flex-direction: column; 
    max-height: 85vh; animation: floatUp 0.3s ease-out;
}
.modal-tabs {
    display: flex; justify-content: center; flex-shrink: 0; padding: 0;
    border-bottom: 2px solid var(--border-color); background: #fcf9f0;
}
.modal-tab {
    flex: 1; text-align: center; padding: 12px 10px; cursor: pointer; 
    font-weight: bold; color: var(--text-light); border-bottom: 3px solid transparent; transition: all 0.2s;
}
.modal-tab.active { background-color: #fff; color: var(--primary-dark); border-bottom-color: var(--primary-color); }
.modal-body { overflow-y: auto; padding: 5px; white-space: normal; }

/* 心法选择列表 */
.selection-list li { padding: 16px 20px; border-bottom: 1px dashed #dcd6c5; cursor: pointer; transition: all 0.2s; }
.selection-list li:hover { background: rgba(140, 174, 104, 0.15); padding-left: 25px; }
.selection-list li b { color: var(--primary-dark); font-size: 1.25rem; font-weight: bold; display: block; margin-bottom: 6px; }
.selection-list li small { color: #4a5a55; font-size: 1.05rem; line-height: 1.6; display: block; font-family: "KaiTi", serif; }

/* --- 悬浮窗 (Floating Window) --- */
.floating-window {
    position: fixed; width: 380px; min-height: 250px; max-height: 80vh; 
    background: #fffbf0; border: 1px solid #a89f89; 
    box-shadow: var(--shadow-float); border-radius: 4px; 
    display: flex; flex-direction: column; overflow: hidden; z-index: var(--z-window); 
}
.window-header {
    padding: 12px 15px; background: var(--gradient-gold); border-bottom: 1px solid #d4cfc0;
    display: flex; justify-content: space-between; align-items: center; font-weight: bold; color: #5d4037; cursor: move; user-select: none; 
}
.window-body { padding: 15px; flex: 1; overflow-y: auto; white-space: normal; }

/* --- 技能弹窗特定样式 --- */
.floating-window.skill-popup {
    padding-top: 0; cursor: move; overflow: visible;
    box-shadow: var(--shadow-float), inset 0 0 80px rgba(0,0,0,0.05);
    border: 1px solid var(--primary-light);
}
.floating-window.skill-popup .window-header { display: none; }
.floating-window.skill-popup .window-body { padding: 20px; }
.floating-window.skill-popup .window-footer { padding: 0 20px 20px 20px; }

/* --- 窗口关闭按钮 --- */
.window-close {
    background: transparent;
    border: none;
    font-size: 24px;
    font-weight: bold;
    color: #8b7355;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    line-height: 1;
}
.window-close:hover {
    background: rgba(139, 115, 85, 0.1);
    color: var(--danger-color);
    transform: scale(1.1);
}
.window-close:active {
    background: rgba(139, 115, 85, 0.2);
    transform: scale(0.95);
}

/* --- 独立关闭按钮 --- */
.window-close-standalone {
    position: absolute; top: 0; right: 0; transform: translate(50%, -50%);
    width: 32px; height: 32px;
    display: flex; justify-content: center; align-items: center;
    border: 2px solid #fff;     background-color: var(--danger-color); color: #fff;
    font-size: 18px; font-weight: bold; line-height: 1;
    border-radius: 50%; box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    cursor: pointer; transition: all 0.3s ease-out;
    z-index: 10;
}
.window-close-standalone:hover { background-color: #c0392b; transform: translate(50%, -50%) scale(1.15) rotate(90deg); }

/* Markdown 美化 */
.markdown-body { padding: 10px; line-height: 1.9; color: #2b3330; font-size: 1.1rem; font-weight: 500; }
.markdown-body strong, .markdown-body b { color: #b8860b; background: rgba(252, 244, 216, 0.6); padding: 0 4px; border-radius: 2px; }
.markdown-body h1, .markdown-body h2 { color: var(--primary-dark); border-bottom: 2px solid var(--border-color); font-family: "STKaiti", serif; margin-top: 15px; margin-bottom: 10px; font-size: 1.3rem; }
.markdown-body h3 { font-size: 1.2rem; color: #4a7062; margin-top: 12px; font-weight: bold; }
.markdown-body ul { list-style: none; padding-left: 1rem; margin: 10px 0; }
.markdown-body ul li { position: relative; margin-bottom: 6px; }
.markdown-body ul li::before { content: "•"; color: var(--accent-gold); position: absolute; left: -1rem; font-size: 1.2em; }

/* 新增：行内代码样式 */
.markdown-body code {
    font-family: Consolas, "Courier New", monospace;
    
    /* 字体：深翠绿，沉稳且清晰 */
    color: #1a5940;
    
    /* 背景：淡青玉色，带有一定的厚度感 */
    background-color: #e8f5ee;
    
    /* 边框：极细的青痕，像玉石的边缘 */
    border: 1px solid #cce8dd;
    
    /* 布局细节 */
    padding: 2px 6px;       /* 增加一点左右内边距，不拥挤 */
    border-radius: 4px;     /* 圆润一点 */
    margin: 0 4px;          /* 拉开一点和前后文字的距离 */
    font-size: 0.9em;       /* 稍微缩小，显精致 */
    font-weight: 600;       /* 稍微加粗，强调重点 */
    vertical-align: middle; /* 对齐修正 */
}

/* Tooltip */
.hover-tooltip {
    position: fixed; z-index: 2000; background-color: #fffbf0; border: 1px solid var(--accent-gold);
    border-radius: 4px; padding: 10px 15px; max-width: 320px; box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    pointer-events: none; display: none;
    transition: none !important; /* 移除跟随阻尼感 */
    max-height: 80vh;
    overflow-y: auto;
}
.hover-tooltip.active { display: block; animation: fadeIn 0.2s; }

/* =========================================
   7. 移动端适配
   ========================================= */
.mobile-bottom-nav {
    display: none; position: fixed; bottom: 0; left: 0; width: 100%; height: 55px;
    background: #fffbf0; border-top: 1px solid #d4cfc0; z-index: var(--z-nav);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05); justify-content: space-around; align-items: center;
}
.nav-item {
    flex: 1; text-align: center; color: #7a8b85; font-size: 0.9rem; font-weight: bold;
    padding: 10px 0; cursor: pointer; transition: all 0.2s; position: relative;
}
.nav-item.active { color: var(--primary-color); background: rgba(61, 110, 90, 0.05); }

@media (max-width: 1200px) {
    /* 平板尺寸：改为两列 */
    .char-dashboard { grid-template-columns: 1fr 1fr; }
    .char-dashboard > div:nth-child(3) { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
    body { padding-bottom: 60px; }
    .container { padding: 10px; }
    
    /* 恢复单列布局 */
    .char-dashboard { display: block; }
    
    /* 手机端禁用抽屉模式，恢复为标准Tab */
    .inventory-drawer {
        position: static !important;
        transform: none !important;
        width: 100% !important;
        height: auto !important;
        max-width: none !important;
        border-radius: 4px !important;
        box-shadow: var(--shadow-soft) !important;
        border: 1px solid var(--border-color) !important;
        display: none !important; /* 配合 tab-content.active */
    }
    .inventory-drawer.active {
        display: block !important;
    }
    .drawer-handle {
        display: none !important;
    }
    #tab-inventory h4 { display: block !important; }

    /* Tab切换逻辑保留 */
    .tab-content { display: none; }
    .tab-content.active { display: block; animation: fadeIn 0.3s ease; }
    
    .mobile-bottom-nav { display: flex; }
    
    header { 
        display: flex !important;
        flex-direction: column !important;
        padding: 0 !important;
        min-height: 80px !important; /* 增加最小高度，给货币区留出空间 */
        position: relative;
        gap: 0 !important;
    }
    
    /* 手机端隐藏装饰元素 */
    header::before,
    header::after {
        display: none !important;
    }
    
    /* 第一行：名字和按钮 */
    header::before {
        content: none !important;
    }
    
    .header-brand,
    #header-char-info { 
        position: absolute !important;
        top: 10px !important;
        left: 12px !important;
        font-size: 1rem !important;
        line-height: 1.3 !important;
        padding: 0 !important;
        margin: 0 !important;
        z-index: 2;
        max-width: 50% !important; /* 减小最大宽度，避免与按钮重叠 */
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    /* Workshop页面标题特殊处理 */
    header .header-brand {
        font-size: 0.95rem !important;
        max-width: 45% !important;
    }
    
    header > button { 
        position: absolute !important;
        top: 6px !important;
        right: 12px !important;
        padding: 6px 12px !important;
        font-size: 0.85rem !important;
        margin: 0 !important;
        z-index: 2;
        white-space: nowrap !important;
    }
    
    /* Workshop页面货币显示容器 - 强制换到第二行 */
    header > div:has(#user-resource-display),
    header > div:has(.res-sync) {
        position: relative !important;
        width: 100% !important;
        margin: 0 !important;
        margin-top: 40px !important; /* 给标题和按钮留出空间 */
        padding: 8px 12px !important;
        background: rgba(250, 247, 240, 0.95) !important;
        border-top: 1px solid rgba(203, 167, 104, 0.1) !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        flex-wrap: wrap !important;
        order: 999 !important; /* 确保在最后显示 */
    }
    
    header > div:has(#user-resource-display) .res-sync,
    header > div:has(.res-sync) .res-sync {
        font-size: 1rem !important;
        flex-shrink: 0 !important;
    }
    
    header > div:has(#user-resource-display) #user-resource-display,
    header > div:has(.res-sync) #user-resource-display {
        flex: 1 !important;
        min-width: 0 !important;
        gap: 8px !important;
        flex-wrap: wrap !important;
        display: flex !important;
    }
    
    header > div:has(#user-resource-display) .res-item,
    header > div:has(.res-sync) .res-item {
        font-size: 0.75rem !important;
        white-space: nowrap !important;
    }
    
    header > div:has(#user-resource-display) .res-item b,
    header > div:has(.res-sync) .res-item b {
        font-size: 0.8rem !important;
    }
    
    header .resource-group {
        width: 100% !important;
        margin: 42px 0 0 0 !important; /* 上边距给名字和按钮留空间 */
        padding: 6px 0 8px 0 !important;
        order: 999; /* 确保在最后 */
    }
    
    /* 手机端货币横向滑动条 */
    .resource-group { 
        display: flex !important; 
        gap: 8px; 
        overflow-x: auto !important;
        overflow-y: hidden !important;
        justify-content: flex-start !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none !important; /* 火狐隐藏滚动条 */
        flex-wrap: nowrap !important;
        background: rgba(244, 241, 232, 0.5);
        border-top: 1px solid rgba(203, 167, 104, 0.1);
        border-bottom: 1px solid rgba(203, 167, 104, 0.1);
        padding: 6px 8px 8px 8px !important; /* 上6px 左右8px 下8px */
    }
    
    /* Webkit浏览器隐藏滚动条 */
    .resource-group::-webkit-scrollbar {
        display: none !important;
    }
    
    /* 滑动条样式美化 */
    
    /* 确保货币徽章不会收缩 */
    .resource-badge {
        flex-shrink: 0 !important;
        flex-grow: 0 !important;
        font-size: 0.85rem;
        padding: 6px 12px !important;
        white-space: nowrap !important;
        min-width: fit-content;
        background: #fff !important;
        border: 1px solid rgba(203, 167, 104, 0.3) !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
    }
    
    .floating-window { 
        width: 90% !important; left: 5% !important; top: 50% !important; transform: translateY(-50%) !important;
        max-height: 80vh !important;
    }
    .cultivation-grid-container, .equip-grid-container { grid-template-columns: repeat(3, 1fr); }

    /* 手机端特定修复：缩小字体防止4字换行 */
    .skill-slot { font-size: 12px; padding: 0 2px; }
    
    /* 手机端行囊和杂物袋 2 列显示 */
    .inventory-grid,
    #inventory-list,
    #other-inventory-list,
    #misc-inventory-list,
    .card-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        overflow-x: hidden !important; /* 禁止横向滚动 */
        overflow-y: auto !important;
        scrollbar-width: none !important; /* Firefox 隐藏滚动条 */
        -ms-overflow-style: none !important; /* IE/Edge 隐藏滚动条 */
    }
    
    /* Webkit 隐藏滚动条 */
    .inventory-grid::-webkit-scrollbar,
    #inventory-list::-webkit-scrollbar,
    #other-inventory-list::-webkit-scrollbar,
    #misc-inventory-list::-webkit-scrollbar,
    .card-grid::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
    }
    
    /* 缩小卡片内容以适应多列 */
    .unified-card,
    .empty-slot-card {
        padding: 6px 5px !important;
        min-height: 75px !important;
        font-size: 0.85rem !important;
    }
    
    .unified-card h4 {
        font-size: 0.8rem !important;
        margin-bottom: 3px !important;
        padding: 3px 6px 3px 16px !important; /* 移动端更紧凑 */
        /* 超长文字自动省略，不限制固定宽度 */
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        display: block !important;
        width: 100% !important;
    }
    
    .unified-card .meta {
        font-size: 0.7rem !important;
    }
    
    .unified-card .actions button {
        font-size: 0.65rem !important;
        padding: 2px 4px !important;
    }
    
    /* 手机端弹窗优化 - 定位在底部bar上方 */
    .floating-window {
        width: 92% !important;
        max-width: 400px !important;
        max-height: 60vh !important; /* 最大60%视口高度 */
        top: auto !important;
        bottom: 70px !important; /* 底部导航栏上方 */
        left: 50% !important;
        transform: translateX(-50%) !important; /* 只水平居中 */
        overflow: hidden;
    }
    
    .floating-window .window-body {
        max-height: 50vh !important;
        overflow-y: auto !important;
    }
    
    /* 手机端 Markdown 内容字体缩小 */
    .floating-window .markdown-body {
        font-size: 0.9rem !important; /* PC端是1.1rem */
        line-height: 1.6 !important;
        padding: 8px !important;
    }
    
    .floating-window .markdown-body h1,
    .floating-window .markdown-body h2 {
        font-size: 1rem !important; /* PC端是1.3rem */
        margin-top: 10px !important;
        margin-bottom: 8px !important;
    }
    
    .floating-window .markdown-body h3 {
        font-size: 0.95rem !important; /* PC端是1.2rem */
        margin-top: 8px !important;
    }
    
    .floating-window .markdown-body code {
        font-size: 0.85em !important;
        padding: 1px 4px !important;
    }
    
    /* Modal弹窗优化 */
    .modal-overlay {
        padding-bottom: 60px !important; /* 给底部导航栏留空间 */
        align-items: flex-end !important; /* 内容靠底部对齐 */
        padding-top: 80px !important; /* 顶部留空间 */
    }
    
    .modal-content {
        width: 90% !important;
        max-width: 400px !important;
        max-height: 65vh !important;
        overflow: hidden;
        margin-bottom: 10px !important; /* 底部留一点空间 */
    }
    
    /* 手机端心法按钮字体缩小 */
    .xinfa-btn {
        padding: 10px 12px !important; /* PC端是18px */
    }
    
    .xinfa-btn b {
        font-size: 0.95rem !important; /* PC端是1.2rem */
        margin-bottom: 2px !important;
    }
    
    .xinfa-btn span {
        font-size: 0.8rem !important; /* PC端是1rem */
        line-height: 1.3 !important;
    }
    
    /* 手机端主功法内容字体缩小 */
    #kungfu-content.markdown-body {
        font-size: 0.85rem !important; /* PC端是1.05rem */
        line-height: 1.5 !important;
    }
    
    #kungfu-content.markdown-body h1,
    #kungfu-content.markdown-body h2 {
        font-size: 1rem !important;
        margin-top: 8px !important;
        margin-bottom: 6px !important;
    }
    
    #kungfu-content.markdown-body h3 {
        font-size: 0.9rem !important;
        margin-top: 6px !important;
    }
    
    #kungfu-content.markdown-body code {
        font-size: 0.8em !important;
        padding: 1px 3px !important;
    }
    
    /* 手机端心法选择列表字体缩小 */
    .selection-list li b {
        font-size: 1rem !important; /* PC端是1.25rem */
    }
    
    .selection-list li small {
        font-size: 0.85rem !important; /* PC端是1.05rem */
        line-height: 1.4 !important;
    }
    
    .modal-body {
        max-height: 50vh !important;
        overflow-y: auto !important;
    }
    
    /* 技能弹窗特殊处理 */
    .floating-window.skill-popup {
        max-height: 65vh !important;
    }
    
    .floating-window.skill-popup .window-body {
        max-height: 55vh !important;
    }
}

/* Switch 开关 */
.switch { position: relative; display: inline-block; width: 36px; height: 18px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 18px; }
.slider:before { position: absolute; content: ""; height: 14px; width: 14px; left: 2px; bottom: 2px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--primary-color); }
input:checked + .slider:before { transform: translateX(18px); }

/* 动画定义 */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes floatUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================
   8. [Admin 终极修复版 - 强制多列网格]
   ========================================= */

/* 1. 强制多列布局容器 */
.admin-grid-container {
    display: grid !important;
    /* 核心：最小宽度130px，自动填充列数。例如容器400px宽，会自动排3列 */
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important;
    /* 行高自动，紧凑排列 */
    grid-auto-rows: max-content; 
    gap: 10px !important;
    padding: 10px !important;
    background: rgba(255,255,255,0.4);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow-y: auto;
    /* 加上这个防止内容被拉伸填满高度 */
    align-content: start; 
}

/* 2. 紧凑型小卡片 (长方形) */
.admin-small-card {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* 固定最小高度，确保整齐，但不会太高 */
    min-height: 90px; 
    height: 100%; /* 撑满网格单元 */
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: all 0.2s;
    box-sizing: border-box;
}

.admin-small-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* 标题 */
.admin-small-card h4 {
    margin: 0 0 5px 0;
    font-size: 0.85rem;
    font-weight: bold;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom: 1px dashed #eee;
    padding-bottom: 3px;
}

/* 信息区 */
.admin-small-card .meta {
    font-size: 0.75rem;
    color: #666;
    line-height: 1.4;
    margin-bottom: 6px;
    flex-grow: 1;
}

/* 底部按钮区 */
.admin-small-card .actions {
    display: flex;
    gap: 3px;
    margin-top: auto;
}

.admin-small-card .actions button {
    flex: 1;
    padding: 2px 0;
    font-size: 11px;
    height: 22px;
    line-height: 20px;
    white-space: nowrap;
    border-radius: 2px;
}

.admin-small-card .actions input {
    width: 35px;
    height: 22px;
    font-size: 11px;
    text-align: center;
    padding: 0;
    margin: 0;
    border: 1px solid #ddd;
    border-radius: 2px;
}

/* 3. 批量操作列表专用样式 */
.admin-batch-grid {
    display: grid !important;
    /* 140px宽，自动填充 */
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)) !important;
    /* 行高自动适应内容 */
    grid-auto-rows: max-content;
    gap: 8px !important;
    padding: 10px !important;
    
    /* 核心修复：样式控制 */
    background: rgba(255,255,255,0.5); /* 半透明白底 */
    border: 1px solid var(--border-color);
    border-radius: 4px;
    
    /* 滚动条控制 */
    height: auto;
    max-height: 650px; /* 固定最大高度，超过出滚动条 */
    overflow-y: auto;
    
    /* 防止溢出 */
    box-sizing: border-box; 
    width: 100%;
    align-content: start;
}

.admin-batch-card {
    position: relative;
    background: #fff;
    border: 1px solid #dcd6c5;
    border-radius: 4px;
    padding: 6px 8px; /* 紧凑内边距 */
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 65px; /* 稍微给点高度 */
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.admin-batch-card:hover { 
    border-color: var(--primary-color); 
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.05);
    z-index: 1; /* 悬停时浮起 */
}

/* 选中高亮 */
.admin-batch-card:has(input:checked) { 
    background-color: #f4fcf7; /* 极淡的绿色背景 */
    border-color: var(--primary-color); 
    box-shadow: inset 0 0 0 1px var(--primary-color);
}

/* 头部 */
.admin-batch-header { 
    display: flex; 
    align-items: center; 
    gap: 6px; 
    margin-bottom: 5px; 
    border-bottom: 1px dashed #eee; 
    padding-bottom: 4px; 
}
.admin-batch-header input { margin: 0; width: 14px; height: 14px; cursor: pointer; }

/* 名字省略 */
.admin-batch-name {
    font-size: 0.85rem; font-weight: bold; color: var(--text-main);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1;
}
.admin-batch-sect { font-size: 0.7rem; color: #999; }

/* 底部三列数据 */
.admin-batch-stats { 
    display: grid;
    /* [按需] 下方数据固定两列显示，更清晰 */
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    background: #fafafa;
    border-radius: 4px;
    padding: 6px;
}
/* 仅影响天降甘霖下方卡片的统计格子，避免影响其它 .stat-box */
.admin-batch-stats .stat-box {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 6px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 4px;
}
.admin-batch-stats .stat-label { 
    font-size: 0.75rem; 
    color: #666; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    max-width: 100%;
    flex: 1;
    text-align: left;
}
.admin-batch-stats .stat-val { 
    font-size: 0.85rem; 
    font-weight: bold; 
    color: var(--primary-dark); 
    line-height: 1.05;
    flex-shrink: 0;
    text-align: right;
}

/* =========================================
   9. [Fix] 商店管理与弹窗修复优化
   ========================================= */

/* --- 修复弹窗按钮样式 (白字白底问题) --- */
/* 问题原因：全局 button 设置了 color: #fff，但 tab 是白底，导致看不清 */
.item-picker-tab { 
    color: #666 !important; /* 强制深色字体 */
    background: #fff !important;
    border: 1px solid #ccc !important;
    box-shadow: none !important;
}
.item-picker-tab:hover {
    background: #f0f0f0 !important;
    color: var(--primary-color) !important;
}
.item-picker-tab.active { 
    background: var(--primary-color) !important; 
    color: #fff !important; 
    border-color: var(--primary-dark) !important;
}

/* --- 商店管理专用网格 (更宽的卡片) --- */
.shop-grid {
    display: grid;
    /* 最小宽度调大到 280px，保证能放下那么多输入框 */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    padding: 10px;
    background: rgba(255,255,255,0.4);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    max-height: 600px;
    overflow-y: auto;
}

/* --- 商店卡片设计 --- */
.shop-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}
.shop-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}
/* 顶部装饰条 */
.shop-card::before {
    content: ""; position: absolute; top: 0; left: 0; width: 4px; height: 100%;
    background: var(--primary-light); opacity: 0.5;
}

/* 标题区 */
.shop-card-header {
    display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px dashed #eee; padding-bottom: 8px; margin-bottom: 2px;
}
.shop-card-header h4 { margin: 0; font-size: 1rem; color: #333; }
.shop-card-id { font-size: 0.75rem; color: #bbb; font-family: monospace; }

/* 行布局 (标签 + 输入框) */
.shop-row {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 0.85rem; color: #555;
}
.shop-row-group {
    display: flex; align-items: center; gap: 5px; width: 48%;
}

/* 输入框美化 */
.shop-input {
    flex: 1; /* 让输入框自动填充剩余空间，而不是强制100%宽度 */
    min-width: 0; /* 防止Flex子项溢出 */
    border: 1px solid #ddd;
    background: #fdfdfd;
    padding: 4px;
    border-radius: 3px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--primary-dark);
    font-weight: bold;
    transition: all 0.2s;
    margin: 0; 
}
.shop-input:focus { border-color: var(--primary-color); background: #fff; }

/* 下拉框微调 */
.shop-select {
    flex: 1; /* 同样应用于下拉框 */
    border: none; background: #f5f5f5; padding: 4px; border-radius: 3px; font-size: 0.8rem; cursor: pointer;
}

/* 底部按钮区 */
.shop-actions {
    display: flex; gap: 10px; margin-top: 5px; padding-top: 10px; border-top: 1px solid #f5f5f5;
}
.shop-actions button {
    flex: 1; padding: 6px 0; font-size: 0.85rem;
}

/* 3. 角色选择页头部布局 */
.char-screen-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 20px;
}

.char-nav-btns {
    display: flex;
    gap: 10px;
}
.char-nav-btns button {
    white-space: nowrap;
}

/* 4. 手机端响应式修复：当屏幕小于768px时 */
@media (max-width: 768px) {
    .char-screen-header {
        flex-direction: column; /* 垂直堆叠 */
        align-items: stretch;   /* 两端对齐，拉伸占满宽度 */
        gap: 15px;              /* 增加堆叠后的间距 */
    }

    .char-screen-header > div:first-child {
        text-align: center; /* 标题居中 */
    }
    
    .char-nav-btns {
        display: grid; /* 使用网格布局 */
        grid-template-columns: repeat(2, 1fr); /* 两列显示 */
        gap: 10px;
        width: 100%;
    }

    .char-nav-btns button {
        flex: none; 
        width: 100%;
        padding: 12px 5px; /* 稍微增加高度方便点击 */
        margin: 0 !important; /* 清除原有边距 */
        font-size: 0.85rem;
    }
    
    .char-nav-btns button:last-child {
        background: var(--danger-color);
    }
}

/* =========================================
   骰子浮窗样式
   ========================================= */

/* 浮窗按钮 */
.dice-float-button {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    font-size: 2em;
    border: 3px solid rgba(255,255,255,0.9);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    cursor: pointer;
    z-index: 999;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dice-float-button:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 6px 30px rgba(0,0,0,0.4);
}

.dice-float-button:active {
    transform: scale(0.95);
}

/* 骰子浮窗 */
.dice-float-window {
    position: fixed;
    bottom: 150px;
    right: 20px;
    width: 380px;
    max-height: 600px;
    background: rgba(255,253,249,0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    z-index: 998;
    overflow: hidden;
    transition: opacity 0.3s, transform 0.3s;
}

.dice-float-window.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.95);
}

.dice-float-header {
    padding: 12px 15px;
    background: linear-gradient(to right, var(--primary-color), var(--primary-dark));
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 1.1em;
}

.dice-close-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    font-size: 1.5em;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.dice-close-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

.dice-float-content {
    padding: 15px;
    max-height: 550px;
    overflow-y: auto;
}

.dice-control-panel {
    margin-bottom: 12px;
}

.dice-row {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.dice-weapon-btn {
    border-color: var(--accent-gold) !important;
    color: #a67c52;
}

.dice-weapon-btn.active {
    background: var(--accent-gold) !important;
    color: #fff !important;
    border-color: var(--accent-gold) !important;
}

.dice-weapon-btn:hover {
    border-color: var(--accent-gold) !important;
    background: #fef5e7 !important;
}

.dice-toggle-btn {
    padding: 6px 12px;
    border: 2px solid #ddd;
    background: #fff;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85em;
    font-weight: 500;
    color: #2d3436;
}

.dice-toggle-btn:hover {
    border-color: var(--primary-color);
    background: #f8f9fa;
}

.dice-toggle-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 2px 6px rgba(74, 106, 122, 0.3);
}

.dice-btn-extra {
    padding: 6px 12px;
    border: 2px solid var(--accent-gold);
    background: #fff;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85em;
    font-weight: 500;
    color: #2d3436;
}

.dice-btn-extra:hover {
    background: var(--accent-gold);
    color: #fff;
}

.dice-extra-badge {
    display: inline-block;
    min-width: 18px;
    padding: 1px 5px;
    background: var(--accent-gold);
    color: #fff;
    border-radius: 8px;
    font-size: 0.9em;
    margin-left: 3px;
}

.dice-btn-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
}

.dice-btn-roll {
    flex: 1;
    padding: 12px;
    font-size: 1.1em;
    font-weight: bold;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.dice-btn-roll:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.dice-btn-attack {
    flex: 1;
    padding: 12px;
    font-size: 1.1em;
    font-weight: bold;
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.dice-btn-attack:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.dice-attack-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px 10px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-left: auto;
}

.dice-attack-options label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.85em;
    white-space: nowrap;
}

.dice-attack-options input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.dice-results-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 10px 0;
}

/* 统一的结果框样式 - Player版本 */
.dice-sum-display,
.dice-attack-result {
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
    color: var(--accent-gold);
    padding: 12px;
    background: #fff;
    border: 2px solid var(--accent-gold);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    min-height: 75px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    word-wrap: break-word;
}

.dice-container {
    min-height: 120px;
    padding: 15px;
    background: rgba(255,255,255,0.5);
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
    border: 2px dashed var(--border-color);
}

.dice-die {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: bold;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    padding: 8px;
}

.dice-die:hover {
    transform: scale(1.1);
}

.dice-type-a {
    background: linear-gradient(135deg, #e8f4f8 0%, #b8d4e0 100%);
    color: #2d3436;
    border: 2px solid #8ab4c7;
}

.dice-type-b {
    background: linear-gradient(135deg, #fff9e6 0%, #ffe8a3 100%);
    color: #2d3436;
    border: 2px solid #e6c875;
}

.dice-mark-icon {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
}

.dice-icon-barren {
    fill: #d63031;
}

.dice-icon-jiuzhou {
    fill: #00b894;
}

.dice-num {
    font-size: 2em;
    font-weight: bold;
    line-height: 1;
}

.dice-roll-anim {
    animation: diceRoll 0.5s ease-out;
}

@keyframes diceRoll {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.2); }
    100% { transform: rotate(360deg) scale(1); }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .dice-float-window {
        width: calc(100vw - 40px);
        right: 20px;
        bottom: 80px;
    }
    
    .dice-float-button {
        bottom: 70px;
        right: 15px;
        width: 50px;
        height: 50px;
        font-size: 1.5em;
    }
    
    .dice-float-content {
        padding: 10px;
    }
    
    .dice-row {
        gap: 4px;
        margin-bottom: 8px;
    }
    
    .dice-toggle-btn,
    .dice-btn-extra {
        padding: 5px 8px;
        font-size: 0.75rem;
        border-radius: 12px;
    }
    
    .dice-extra-badge {
        font-size: 0.75em;
        padding: 1px 4px;
    }
    
    .dice-btn-row {
        gap: 6px;
        margin-top: 6px;
    }
    
    .dice-btn-roll,
    .dice-btn-attack {
        padding: 8px;
        font-size: 0.95em;
    }
    
    .dice-attack-options {
        padding: 5px 8px;
        gap: 5px;
    }
    
    .dice-attack-options label {
        font-size: 0.75em;
    }
    
    .dice-attack-options input[type="checkbox"] {
        width: 14px;
        height: 14px;
    }
    
    .dice-results-row {
        gap: 6px;
        margin: 10px 0;
    }
    
    .dice-sum-display,
    .dice-attack-result {
        font-size: 1em;
        padding: 8px;
        min-height: 60px;
    }
    
    .dice-container {
        min-height: 80px;
        padding: 10px 5px;
        gap: 6px;
        justify-content: center;
    }
    
    .dice-die {
        width: 50px;
        height: 50px;
        font-size: 1em;
        border-radius: 8px;
    }
    
    .dice-num {
        font-size: 1.5em;
    }
    
    .dice-icon-jiuzhou,
    .dice-icon-barren {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .dice-toggle-btn,
    .dice-btn-extra {
        padding: 4px 6px;
        font-size: 0.7rem;
    }
    
    .dice-sum-display,
    .dice-attack-result {
        font-size: 0.9em;
        padding: 6px;
        min-height: 50px;
    }
    
    .dice-container {
        padding: 8px 3px;
        gap: 4px;
    }
    
    .dice-die {
        width: 45px;
        height: 45px;
        font-size: 0.9em;
        border-radius: 6px;
    }
    
    .dice-num {
        font-size: 1.3em;
    }
    
    .dice-icon-jiuzhou,
    .dice-icon-barren {
        width: 16px;
        height: 16px;
    }
}

/* =========================================
   10. 【云墨丹青】中国风美化增强
   ========================================= */

/* --- 全局过渡优化 --- */
*, *::before, *::after {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- 页面整体装饰 --- */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        /* 角落祥云装饰 */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' opacity='0.03'%3E%3Cpath d='M20,50 Q30,30 50,40 T80,50 Q70,70 50,60 T20,50' fill='%234a7062'/%3E%3C/svg%3E") no-repeat top left,
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' opacity='0.03'%3E%3Cpath d='M20,50 Q30,30 50,40 T80,50 Q70,70 50,60 T20,50' fill='%234a7062'/%3E%3C/svg%3E") no-repeat bottom right;
    background-size: 300px 300px;
    pointer-events: none;
    z-index: -1;
}

/* --- 头部增强 --- */
header {
    background: linear-gradient(to bottom, rgba(255, 253, 249, 0.98), rgba(244, 241, 232, 0.95));
    border-bottom: none;
    position: relative;
}

header::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--accent-gold) 20%, 
        var(--primary-color) 50%, 
        var(--accent-gold) 80%, 
        transparent 100%
    );
}

header::after {
    content: "☰";
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8rem;
    color: var(--accent-gold);
    background: var(--bg-base);
    padding: 0 15px;
}

.header-brand {
    position: relative;
    font-size: 1.6rem;
    letter-spacing: 6px;
    animation: brandShimmer 3s ease-in-out infinite;
}

.header-brand::before,
.header-brand::after {
    content: "◈";
    color: var(--accent-gold);
    font-size: 0.8rem;
    opacity: 0.6;
    animation: sparkle 2s ease-in-out infinite;
}

.header-brand::before { margin-right: 10px; }
.header-brand::after { margin-left: 10px; animation-delay: 1s; }

@keyframes brandShimmer {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.1); }
}

@keyframes sparkle {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* --- 面板增强 --- */
.panel, .sub-panel {
    position: relative;
    background: linear-gradient(135deg, rgba(255, 253, 249, 0.98) 0%, rgba(252, 249, 240, 0.95) 100%);
    border: 1px solid var(--border-color);
    box-shadow: 
        0 4px 20px rgba(45, 69, 59, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    overflow: hidden;
}

.panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-gold), var(--primary-color));
    opacity: 0.8;
}

.panel::after {
    content: "";
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border: 1px solid rgba(203, 167, 104, 0.15);
    pointer-events: none;
    border-radius: 2px;
}

.panel h3 {
    position: relative;
    display: inline-block;
    width: 100%;
    text-align: center;
    color: var(--primary-dark);
    font-size: 1.25rem;
    letter-spacing: 3px;
}

.panel h3::before,
.panel h3::after {
    content: "━━━";
    color: var(--accent-gold);
    font-size: 0.8rem;
    opacity: 0.5;
    vertical-align: middle;
}

.panel h3::before { margin-right: 15px; }
.panel h3::after { margin-left: 15px; }

/* --- 按钮增强动画 --- */
button {
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease-out;
}

button::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:active::before {
    width: 300px;
    height: 300px;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 6px 20px rgba(61, 110, 90, 0.35),
        0 0 15px rgba(203, 167, 104, 0.2);
}

.btn-success:hover {
    box-shadow: 
        0 6px 20px rgba(61, 110, 90, 0.4),
        0 0 20px rgba(74, 112, 98, 0.3);
}

.btn-danger:hover {
    box-shadow: 
        0 6px 20px rgba(166, 85, 85, 0.4),
        0 0 20px rgba(166, 85, 85, 0.3);
}

/* --- 输入框增强 --- */
input, select, textarea {
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.6);
}

input:focus, select:focus, textarea:focus {
    background: rgba(255, 255, 255, 0.9);
    border-bottom-color: var(--accent-gold);
    box-shadow: 0 2px 10px rgba(203, 167, 104, 0.2);
}

/* --- Tab切换动画增强 --- */
.admin-tab-btn, .modal-tab, .shop-tab-btn {
    position: relative;
    overflow: hidden;
}

.admin-tab-btn::after, .modal-tab::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--accent-gold);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.admin-tab-btn.active::after, .modal-tab.active::after {
    width: 80%;
}

.admin-tab-btn:hover, .modal-tab:hover {
    background: rgba(74, 112, 98, 0.08);
}

/* --- 卡片悬停增强 --- */
.admin-small-card, .unified-card, .shop-card {
    transition: all 0.4s ease-out;
}

.admin-small-card:hover, .unified-card:hover, .shop-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.12),
        0 0 0 1px var(--primary-color);
}

/* --- 滚动条美化增强 --- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: linear-gradient(to bottom, #f0ebe0, #e8e3d8);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, var(--primary-light), var(--primary-color));
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, var(--primary-color), var(--primary-dark));
}

/* --- 弹窗增强 --- */
.modal-overlay {
    background: radial-gradient(ellipse at center, rgba(43, 51, 48, 0.5) 0%, rgba(43, 51, 48, 0.8) 100%);
    animation: modalFadeIn 0.4s ease;
}

.modal-content {
    animation: modalSlideIn 0.5s ease-out;
    border: 2px solid var(--accent-gold);
    box-shadow: 
        0 25px 60px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(203, 167, 104, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalSlideIn {
    from { 
        opacity: 0; 
        transform: translateY(-50px) scale(0.9); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

/* --- 悬浮窗增强 --- */
.floating-window {
    border: 2px solid var(--accent-gold);
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.25),
        0 0 30px rgba(203, 167, 104, 0.1);
    /* 使用简单的 transition，类似骰子窗口 */
    transition: opacity 0.3s ease, transform 0.3s ease !important;
}

/* 拖动状态：完全禁用过渡和变换 */
.floating-window.dragging,
.floating-window.dragging * {
    transition: none !important;
    animation: none !important;
}

.floating-window.dragging {
    transform: none !important;
}

.window-header {
    background: linear-gradient(135deg, #fcf9f0 0%, #f3eace 50%, #fcf9f0 100%);
    border-bottom: 2px solid var(--accent-gold);
    position: relative;
}

.window-header::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--primary-color);
}

/* --- 列表项动画 --- */
.selection-list li, .tree-char-item {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.selection-list li:hover, .tree-char-item:hover {
    background: linear-gradient(90deg, rgba(140, 174, 104, 0.15), transparent);
    padding-left: 25px;
    border-left: 3px solid var(--accent-gold);
}

/* --- 资源徽章动画 --- */
.resource-badge {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.resource-badge::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.resource-badge:hover::before {
    left: 100%;
}

.resource-badge:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 15px rgba(203, 167, 104, 0.3);
    border-color: var(--accent-gold);
}

/* --- 功力值增强 --- */
.power-container {
    background: 
        radial-gradient(circle at center, rgba(203, 167, 104, 0.15) 0%, transparent 60%),
        linear-gradient(to bottom, rgba(255,255,255,0.5), transparent);
    position: relative;
}

.power-value {
    animation: powerPulse 3s ease-in-out infinite, breathe 3s infinite ease-in-out;
}

@keyframes powerPulse {
    0%, 100% { 
        text-shadow: 0 0 20px rgba(203, 167, 104, 0.3);
    }
    50% { 
        text-shadow: 0 0 40px rgba(203, 167, 104, 0.6), 0 0 60px rgba(203, 167, 104, 0.3);
    }
}

/* --- 技能卡片增强 --- */
.skill-mini-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.skill-mini-card:hover {
    transform: translateX(5px) scale(1.02);
    box-shadow: 
        0 5px 20px rgba(74, 112, 98, 0.15),
        -3px 0 0 var(--accent-gold);
}

/* --- 心法按钮增强 --- */
.xinfa-btn {
    transition: all 0.4s ease-out;
    position: relative;
}

.xinfa-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(203, 167, 104, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.xinfa-btn:hover::before {
    opacity: 1;
}

.xinfa-btn:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.12),
        0 0 0 2px var(--accent-gold);
}

/* --- 登录卡片增强 --- */
.login-card {
    animation: loginCardIn 0.8s ease-out;
    background: linear-gradient(135deg, rgba(255, 253, 249, 0.98) 0%, rgba(252, 249, 240, 0.95) 100%);
}

@keyframes loginCardIn {
    0% {
        opacity: 0;
        transform: translateY(50px) rotateX(10deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}

.login-card::after {
    content: "九州录";
    position: absolute;
    bottom: 15px;
    right: 15px;
    font-size: 3rem;
    font-family: "STKaiti", "KaiTi", serif;
    color: var(--primary-color);
    opacity: 0.05;
    pointer-events: none;
    letter-spacing: 5px;
}

/* --- 页面切换动画 --- */
.admin-tab-content {
    animation: tabFadeIn 0.4s ease;
}

@keyframes tabFadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* --- 加载动画 --- */
@keyframes loadingDots {
    0%, 20% { content: "."; }
    40% { content: ".."; }
    60%, 100% { content: "..."; }
}

/* --- 印章装饰效果 --- */
.panel h3::before {
    content: "❖";
    margin-right: 12px;
    color: var(--danger-color);
    opacity: 0.6;
}

.panel h3::after {
    content: "❖";
    margin-left: 12px;
    color: var(--danger-color);
    opacity: 0.6;
}

/* --- 鼠标跟随光效 (高级效果) --- */
.panel:hover, .admin-small-card:hover, .shop-card:hover {
    --mouse-x: 50%;
    --mouse-y: 50%;
}

/* --- 渐入动画延迟类 --- */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* --- 金色边框闪烁效果 --- */
@keyframes goldBorderPulse {
    0%, 100% { 
        border-color: var(--accent-gold);
        box-shadow: 0 0 10px rgba(203, 167, 104, 0.3);
    }
    50% { 
        border-color: #d4b878;
        box-shadow: 0 0 20px rgba(203, 167, 104, 0.5);
    }
}

.modal-content, .floating-window {
    animation: goldBorderPulse 4s ease-in-out infinite;
}

/* --- 底部导航栏增强 --- */
.mobile-bottom-nav {
    background: linear-gradient(to top, rgba(255, 251, 240, 0.98), rgba(255, 253, 249, 0.95));
    border-top: 2px solid var(--accent-gold);
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.08);
}

.nav-item {
    transition: all 0.3s ease;
    position: relative;
}

.nav-item::after {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--accent-gold);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-item.active::after {
    width: 60%;
}

.nav-item.active {
    color: var(--primary-dark);
    background: linear-gradient(to bottom, rgba(203, 167, 104, 0.1), transparent);
}

/* --- 表格/列表斑马纹增强 --- */
.scroll-list > div:nth-child(even) {
    background: rgba(244, 241, 232, 0.5);
}

.scroll-list > div:nth-child(odd) {
    background: rgba(255, 255, 255, 0.8);
}

/* --- 中国风分隔线 --- */
.chinese-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
    color: var(--accent-gold);
    font-size: 0.9rem;
}

.chinese-divider::before,
.chinese-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

.chinese-divider::before { margin-right: 15px; }
.chinese-divider::after { margin-left: 15px; }

/* --- 加载状态动画 --- */
.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* --- 提示框增强 --- */
.hover-tooltip {
    background: linear-gradient(135deg, #fffbf0 0%, #fff8e8 100%);
    border: 2px solid var(--accent-gold);
}

@keyframes tooltipIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* --- 文字选中效果 --- */
::selection {
    background: rgba(203, 167, 104, 0.3);
    color: var(--primary-dark);
}

/* --- 焦点环效果 --- */
:focus-visible {
    outline: 2px solid var(--accent-gold);
    outline-offset: 2px;
}

/* --- 禁用状态美化 --- */
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(50%);
    transform: none !important;
    box-shadow: none !important;
}

/* --- 确保动画不影响其他过渡 --- */
.admin-tab-content.hidden {
    animation: none;
}

/* =========================================
   11. 洞天工坊设施卡片美化
   ========================================= */

/* --- 设施卡片网格容器 --- */
#facility-list,
#recipe-list,
#crafting-queue-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 15px;
    overflow: visible;
}

/* --- 设施卡片基础样式 --- */
.facility-card,
.recipe-card {
    background: linear-gradient(145deg, #fffdf8 0%, #faf8f3 100%);
    border: 2px solid rgba(203, 167, 104, 0.25);
    border-radius: 12px;
    padding: 20px 22px;
    box-shadow: 
        0 4px 15px rgba(139, 117, 84, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    text-align: center;
}

.facility-card::before,
.recipe-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        var(--accent-gold),
        rgba(203, 167, 104, 0.6),
        var(--accent-gold));
    opacity: 0.6;
    transition: opacity 0.3s;
}

.facility-card:hover,
.recipe-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent-gold);
    box-shadow: 
        0 12px 35px rgba(139, 117, 84, 0.15),
        0 4px 15px rgba(203, 167, 104, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 1);
}

.facility-card:hover::before,
.recipe-card:hover::before {
    opacity: 1;
}

/* --- 设施卡片标题 --- */
.facility-card h4,
.recipe-card h4 {
    font-size: 1.15rem;
    color: var(--primary-dark);
    margin: 0 0 8px 0;
    font-weight: 700;
    letter-spacing: 0.5px;
    position: relative;
}

/* --- 设施元信息 --- */
.facility-card .meta,
.recipe-card .meta {
    font-size: 0.9rem;
    color: #7a6f5c;
    padding: 8px 12px;
    background: rgba(203, 167, 104, 0.08);
    border-radius: 6px;
    margin: 4px auto;
    line-height: 1.5;
    display: inline-block;
}

/* --- 进度条美化 --- */
.progress-bar {
    width: 100%;
    height: 12px;
    background: linear-gradient(to bottom, #e8e4dc, #f0ece4);
    border-radius: 6px;
    margin-top: 12px;
    overflow: hidden;
    border: 1px solid rgba(139, 117, 84, 0.15);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.progress-bar-inner {
    height: 100%;
    background: linear-gradient(90deg, 
        var(--primary-color),
        #5a8a72,
        var(--primary-color));
    background-size: 200% 100%;
    animation: progressShimmer 2s ease-in-out infinite;
    border-radius: 6px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(74, 112, 98, 0.3);
}

@keyframes progressShimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* --- 配方材料列表 --- */
.recipe-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 8px 0;
    padding: 5px;
    background: rgba(0,0,0,0.03);
    border-radius: 4px;
}

.recipe-stats span {
    font-size: 0.75rem;
    color: #555;
    background: #fff;
    padding: 2px 6px;
    border: 1px solid #eee;
    border-radius: 3px;
    white-space: nowrap;
}

.recipe-stats div {
    width: 100%;
}

.recipe-materials {
    font-size: 0.9rem;
    color: #5a5248;
    padding: 10px 12px 10px 28px;
    list-style: none;
    background: rgba(244, 241, 232, 0.6);
    border-radius: 8px;
    margin: 12px 0;
    border: 1px dashed rgba(139, 117, 84, 0.2);
}

.recipe-materials li {
    padding: 4px 0;
    position: relative;
}

.recipe-materials li::before {
    content: "✧";
    position: absolute;
    left: -16px;
    color: var(--accent-gold);
}

.recipe-materials .sufficient {
    color: #2d7a4f;
    font-weight: 500;
}

.recipe-materials .insufficient {
    color: #b74a3d;
    text-decoration: line-through;
    opacity: 0.8;
}

/* --- 设施卡片按钮 --- */
.facility-card button,
.recipe-card button {
    padding: 10px 18px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.facility-card button:not(:disabled):hover,
.recipe-card button:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* --- 收取按钮闪烁动画 --- */
.facility-card button[style*="accent-gold"] {
    animation: collectPulse 1.5s ease-in-out infinite;
}

@keyframes collectPulse {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(203, 167, 104, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(203, 167, 104, 0.7);
    }
}

/* --- 工坊Tab样式增强 --- */
.workshop-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
    border-bottom: 2px solid rgba(203, 167, 104, 0.2);
    padding-bottom: 18px;
}

.workshop-tab-btn {
    padding: 12px 28px;
    font-size: 1.05rem;
    font-weight: 600;
    border: none;
    background: linear-gradient(to bottom, #f8f5ef, #f0ece4);
    border-radius: 10px 10px 0 0;
    cursor: pointer;
    color: #7a6f5c;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    position: relative;
}

.workshop-tab-btn::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--accent-gold);
    transition: all 0.3s;
    transform: translateX(-50%);
}

.workshop-tab-btn:hover {
    background: linear-gradient(to bottom, #fff, #faf8f3);
    color: var(--primary-dark);
}

.workshop-tab-btn:hover::after {
    width: 50%;
}

.workshop-tab-btn.active {
    background: linear-gradient(to bottom, #fff, #fffdf8);
    color: var(--primary-dark);
    border-bottom-color: transparent;
}

.workshop-tab-btn.active::after {
    width: 100%;
    background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
}

/* --- 工坊页面响应式 --- */
@media (max-width: 768px) {
    #facility-list,
    #recipe-list,
    #crafting-queue-list {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 10px;
    }
    
    .facility-card,
    .recipe-card {
        padding: 16px 18px;
        min-height: 160px;
    }
    
    .workshop-tabs {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .workshop-tab-btn {
        flex: 1;
        min-width: 120px;
        padding: 10px 15px;
        font-size: 0.95rem;
    }
}

/* =========================================
   12. 手机端功法列表两列布局
   ========================================= */
@media (max-width: 768px) {
    /* 功法列表网格 - 强制两列 */
    .skill-list-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        padding: 8px 4px !important;
    }
    
    /* 功法小卡片手机端优化 */
    .skill-mini-card {
        padding: 8px 6px 8px 18px;
        font-size: 0.8rem;
        min-height: 42px;
    }
    
    .skill-mini-card .skill-name-click {
        font-size: 0.8rem;
        text-align: left;
    }
    
    .skill-mini-card .rank-badge {
        width: 26px;
        height: 26px;
        font-size: 9px;
    }
    
    .skill-mini-card .btn-mini-add {
        width: 20px;
        height: 20px;
        font-size: 0.75rem;
        line-height: 18px;
    }
    
    /* 功法分类标题手机端 */
    .skill-category-header {
        font-size: 0.9rem;
        padding: 8px 10px;
        margin-top: 12px;
    }
    
    /* 搜索框适配 */
    .skill-filter-box input {
        font-size: 14px;
    }
}