/* =========================================
   TDoG Skin Texture Tags - Dark Mode Optimized
   ========================================= */

/* 1. 基础布局 */
.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    min-height: 30px; /* 防止没有标签时高度塌陷 */
}

/* 2. 标签通用样式 (胶囊状) */
.texture-tag, 
#available-tag-list .badge {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1.2;
    
    padding: 6px 12px !important;
    border-radius: 50px !important;
    border: 1px solid; /* 边框颜色由 JS 动态控制 */
    
    background-color: transparent; /* 默认透明背景 */
    
    transition: all 0.2s ease;
    cursor: pointer;
    user-select: none;
    text-decoration: none !important;
}

/* 链接文字颜色继承 */
.texture-tag a {
    color: inherit !important;
    text-decoration: none !important;
}

/* 3. 删除按钮 (X) 样式优化 */
.texture-tag .remove-btn {
    display: inline-block;
    width: 0;
    overflow: hidden;
    opacity: 0;
    margin-left: 0;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
    color: #ff6b6b; /* 亮红色，暗色模式下更清晰 */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 编辑模式下显示删除按钮 */
.tag-container.editing .texture-tag {
    padding-right: 10px !important; /* 调整右边距 */
    background-color: rgba(255, 255, 255, 0.05); /* 微弱背景 */
}

.tag-container.editing .texture-tag .remove-btn {
    width: 14px; /* 给足够的宽度 */
    margin-left: 6px;
    opacity: 1;
}

.texture-tag .remove-btn:hover {
    color: #ff0000;
    transform: scale(1.2);
}

/* 4. 底部“添加标签”区域 */
#available-tags-area {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px dashed #dee2e6;
}

#available-tag-list .badge {
    opacity: 0.85;
    border: 1px solid transparent; /* 默认无边框 */
    color: #fff !important; /* 预设标签强制白字，背景由 JS 控制 */
}

#available-tag-list .badge:hover {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* 5. 编辑按钮 */
.tag-edit-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}
.tag-edit-btn:hover {
    background-color: rgba(0,0,0,0.05);
}

/* =========================================
   暗色模式适配 (Dark Mode)
   Blessing Skin 6 通常给 body 加 .dark-mode 类
   ========================================= */

.dark-mode #available-tags-area {
    border-top-color: #4b545c;
}

.dark-mode .tag-edit-btn:hover {
    background-color: rgba(255,255,255,0.1);
}

/* 强制覆盖暗色模式下的标签文字颜色增强 */
.dark-mode .texture-tag {
    /* 增加一点文字阴影，防止浅色文字在浅色背景上看不清 */
    text-shadow: 0 1px 2px rgba(0,0,0,0.3); 
}

/* 编辑模式下的标签背景 (暗色) */
.dark-mode .tag-container.editing .texture-tag {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2) !important; /* 编辑时统一边框颜色，避免太乱 */
}