/* ========== 1. 容器与布局 ========== */
.plaza-container {
    padding: 15px;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
}

/* ========== 2. 搜索栏 (颜色适配深灰蓝) ========== */
.search-section {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}
.search-bar {
    display: flex;
    align-items: center;
    background-color: #1a1a20;
    border: 1px solid #2f2f3d;
    border-radius: 50px;
    padding: 4px 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 600px; 
}
.search-icon { color: #888; margin-right: 10px; font-size: 14px; }
.search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    color: #e0e0e0;
    font-size: 14px;
    padding: 8px 0;
    outline: none;
    min-width: 0;
}
.btn-search {
    background-color: #6c5ce7;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 6px 18px;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
    transition: 0.3s;
    white-space: nowrap; 
    flex-shrink: 0;      
}
.btn-search:hover { background-color: #5649c0; }



/* ========== 3. 筛选区 (颜色适配) ========== */
.filter-section {
    margin-bottom: 25px;
    padding: 0 5px;
}

/* 行容器 */
.filter-row {
    display: flex;
    align-items: flex-start; /* 顶部对齐，确保多行标签时左侧标题不动 */
    margin-bottom: 10px;
}
/* [新增] 为高级筛选区内的行增加列间距 */
#advancedFilterArea .filter-row {
    gap: 20px;
}

/* 左侧标题 (榜单、活动、分类) */
.filter-label {
    width: 70px; 
    color: #b0bec5;
    font-size: 14px;
    font-weight: bold;
    flex-shrink: 0; 
    margin-top: 5px; /* 与右侧标签视觉对齐 */
}
/* [新增] 仅针对高级筛选区的标题，强制不换行 */
#advancedFilterArea .filter-label {
    white-space: nowrap;
}

/* 右侧标签容器 */
.filter-options {
    flex: 1;
    display: flex;
    flex-wrap: wrap; 
    gap: 8px; 
}

/* 标签通用样式 */
.tag {
    padding: 4px 12px;
    border-radius: 20px;
    background-color: #23232a;
    color: #a0a0a0;
    font-size: 12px;
    cursor: pointer;
    transition: 0.2s;
    border: 1px solid #373740;
    white-space: nowrap; 
    flex-shrink: 0; 
}
.tag:hover { background-color: #373740; color: white; }
.tag.active {
    background-color: #6c5ce7; 
    color: white;
    border-color: #6c5ce7;
}


/* ========== 中间分割线与开关 ========== */
.filter-divider {
    display: flex;
    align-items: center;
    margin: 15px 0;
    gap: 10px;
}
.filter-divider span {
    font-size: 12px;
    color: #666;
    font-weight: bold;
}
.divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, #2f2f3d, transparent);
}
.btn-toggle-expand {
    background: transparent;
    border: 1px solid #373740;
    color: #888;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.btn-toggle-expand:hover {
    border-color: #6c5ce7;
    color: #6c5ce7;
}

/* ========== 排序工具栏 ========== */
.sort-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    background: #1a1a20;
    padding: 8px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #2f2f3d;
}
/* [新增] 强制排序工具栏内所有子项不换行 */
.sort-label,
.sort-item,
.sort-order-btn {
    white-space: nowrap;
}

.sort-label {
    font-size: 12px;
    color: #666;
    margin-right: 10px;
}
.sort-options {
    display: flex;
    gap: 5px;
}
.sort-item {
    font-size: 13px;
    color: #888;
    cursor: pointer;
    transition: 0.2s;
    font-weight: 500;
}
.sort-item:hover { color: #ccc; }
.sort-item.active { color: #6c5ce7; font-weight: bold; }

.sort-separator {
    width: 1px;
    height: 14px;
    background: #373740;
    margin: 0 15px;
}
.sort-order-btn {
    font-size: 12px;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}
.sort-order-btn:hover { color: #fff; }

/* ========== 高级筛选区动画 ========== */
#advancedFilterArea {
    animation: fadeIn 0.3s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- 多选标签样式 (修复图标与新增反选) --- */

/* 1. 基础样式 */
.multi-select .tag {
    position: relative;
    transition: all 0.3s ease; /* 增加平滑过渡效果 */
}

/* 2. 默认选中状态 (包含/Include) - 蓝色 + 勾号 */
.multi-select .tag.active {
    background-color: #6c5ce7;
    border-color: #6c5ce7;
    color: white;
    padding-left: 22px; /* 留出左侧图标位置 */
}

/* 伪元素生成图标：默认是勾号 */
.multi-select .tag.active::before {
    content: '\f00c'; /* FontAwesome Checkmark (勾) */
    font-family: "Font Awesome 6 Free", "FontAwesome"; /* 兼容 FontAwesome 5/6 */
    font-weight: 900; /* 必须加粗，否则 Solid 图标可能不显示 */
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: white;
    /* 确保图标变化时立即生效，不需要过渡 */
    transition: none;
}

/* 3. 反选模式选中状态 (排除/Exclude) - 红色 + 叉号 */
/* 这里的 !important 确保它能覆盖上面的蓝色背景 */
.multi-select .tag.active.exclude-visual {
    background-color: #ff4757 !important; 
    border-color: #ff4757 !important;
}

/* 覆盖图标为 X */
.multi-select .tag.active.exclude-visual::before {
    content: '\f00d'; /* FontAwesome X Mark (叉) */
}


/* --- [新增] 反向筛选开关样式 --- */
.filter-mode-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}
.switch-track {
    width: 36px;
    height: 20px;
    background-color: #2f2f3d;
    border-radius: 20px;
    position: relative;
    transition: 0.3s;
    border: 1px solid #3f3f5f;
}
.switch-knob {
    width: 14px;
    height: 14px;
    background-color: #888;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3); /* 增加一点立体感 */
}
.switch-label {
    font-size: 12px;
    color: #888;
    transition: 0.3s;
}

/* 开关激活状态 */
.filter-mode-switch.active .switch-track {
    background-color: #ff4757; /* 红色代表排斥模式 */
    border-color: #ff4757;
}
.filter-mode-switch.active .switch-knob {
    background-color: white;
    transform: translateX(16px);
}
.filter-mode-switch.active .switch-label {
    color: #ff4757;
    font-weight: bold;
}


/* --- 分类行专用样式 --- */
#categoryRow {
    /* 关键：增加上边距，实现“往下挪一点”的效果 */
    margin-top: 15px; 
    /* 增加一个淡入动画，让出现更自然 */
    animation: slideDown 0.3s ease-out;
}

/* 简单的下拉动画 */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 分类行显示时的标签容器 */
.category-wrap-mode {
    flex-wrap: wrap !important;
    overflow: visible !important;
    height: auto !important;
}

/* --- 手机端适配 --- */
@media (max-width: 768px) {
    /* 常规行保持横向滚动 */
    .filter-options {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none; 
        padding-bottom: 5px; 
    }
    .filter-options::-webkit-scrollbar { display: none; }

    /* [新增] 针对高级筛选区，覆盖上面的规则，使其恢复换行 */
    #advancedFilterArea .filter-options {
        flex-wrap: wrap;
        overflow-x: visible;
    }

    /* 分类行强制换行 */
    .category-wrap-mode {
        flex-wrap: wrap !important;
        overflow-x: visible !important;
        white-space: normal !important;
    }
}



/* ========== 4. 卡片网格区 ========== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); 
    gap: 5px;
}

.bot-card {
    background-color: #1e1e24;
    border: 1px solid #2f2f3d;
    border-radius: 12px;
    overflow: hidden;
    cursor: default;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}
.card-cover, .card-body {
    cursor: pointer;
}
.bot-card:hover { 
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    border-color: #6c5ce7;
}

.card-cover {
    height: 180px; 
    width: 100%;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 8px;
}
.card-cover img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.5s;
}
.bot-card:hover .card-cover img { transform: scale(1.05); }

/* 收藏 */
.card-likes {
    position: absolute;
    top: 8px; right: 8px; 
    background: rgba(0,0,0,0.6);
    color: #45aaf2; 
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    backdrop-filter: blur(2px);
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    z-index: 5;
}

/* 评分 */
.card-rating {
    position: absolute;
    top: 8px; 
    left: 8px;
    background: rgba(0,0,0,0.6);
    color: #f1c40f;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    backdrop-filter: blur(2px);
    cursor: pointer;
    z-index: 5;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.card-rating:hover {
    transform: scale(1.1);
    background: rgba(0,0,0,0.8);
}

.card-body { 
    padding: 0 2px 2px 2px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.card-title {
    font-size: 15px; 
    font-weight: bold;
    margin-bottom: 4px; 
    color: #f5f5f5;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-desc {
    font-size: 12px; color: #888;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; 
    line-height: 1.4; 
    height: 34px;
    margin-bottom: 6px;
}

.card-footer {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: auto; 
    padding-top: 4px;
    border-top: 1px solid #2f2f3d;
    padding-left: 8px;
    padding-right: 16px;
}
.author-info { display: flex; align-items: center; gap: 6px; }
.author-avatar { width: 26px; height: 26px; border-radius: 50%; border: 1px solid #444; }
.author-name { font-size: 13px; color: #ccc; margin-left: 4px; }
.card-stats { font-size: 13px; color: #45aaf2; }


/* ---作品卡片标签--- */
.card-tags {
    margin-top: auto; 
    padding: 1px 1px;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
}

.card-tag {
    background-color: #2c2c35;
    color: #aebbf0;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #3f3f5f;
    white-space: nowrap;
}

/* 字数显示样式*/
.card-word-count {
    margin-left: auto;
    font-size: 12px;
    color: #e3e3e3;    
    display: flex;
    align-items: center;
    gap: 5px;          
    background: rgba(255, 255, 255, 0.1); 
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 500;
}

/* 专门控制那个文件图标的颜色 */
.card-word-count i {
    color: #aebbf0; 
    font-size: 13px;
}

/* =========手机端适========== */
@media (max-width: 768px) {
    .plaza-container {
        padding: 35px 2px 2px 2px;
    }

    .cards-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 2px;
    }

    /* 3. 卡片：弹性结构 */
    .bot-card {
        width: auto;
        margin-bottom: 0;
        display: flex;
        flex-direction: column;
        height: 100%;
        border-radius: 8px;
    }

    /* 4. 封面图：高度压低 */
    .card-cover {
        height: 190px;
    }

    /* 5. 文本内容适配 */
    .card-title {
        font-size: 13px;
        margin-bottom: 3px;
    }
    
    .card-desc {
        height: auto; 
        -webkit-line-clamp: 5;
        flex-shrink: 0;
        margin-bottom: 8px;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        font-size: 11px;
        line-height: 1.4;
        color: #999;
        overflow: hidden;
        white-space: normal;
    }

    /* 6. 标签与字数 */
    .card-tags {
        padding: 0 0px 2px 0px;
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
        gap: 2px;
        margin-top: auto;
        overflow: hidden;
    }

    .card-tag {
        font-size: 9px;
        padding: 1px 4px;
        flex-shrink: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 60px;
    }
    .card-word-count {
        margin-left: auto;
        padding: 0px 5px;
        font-size: 9px;
        line-height: 16px;
        height: 18px;
        display: flex;
        align-items: center;
        flex-shrink: 0;
        border-radius: 4px;
    }
    
    /* 修正字数框里图标的大小 */
    .card-word-count i {
        font-size: 9px;
        margin-right: 3px;
        position: relative;
        top: 0px;
    }
    /* 7. 底部栏 */
    .card-footer {
        padding: 2px;
        border-top: 1px solid rgba(255,255,255,0.05);
    }
    .author-name {
        font-size: 10px;
        max-width: 70px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }
    .card-stats { font-size: 10px; }
    
    /* 搜索栏与筛选区适配 */
    .search-bar { height: 36px; }
    .filter-options { flex-wrap: nowrap; overflow-x: auto; }
    .filter-options::-webkit-scrollbar { display: none; }
    .filter-label {
        width: 50px; 
        font-size: 13px;
    }
}


/* 特殊通道按钮组 */
.special-channels {
    display: flex;
    gap: 12px;
    margin-left: 20px;
}
.btn-special {
    padding: 8px 20px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
    background-color: #1a1a20;
    color: #a0a0a0;
    border: 1px solid #2f2f3d;
}
/* 私人订制激活样式 - 亮绿色 */
.btn-special.private.active {
    background: #00f2ad; /* 参考图2的颜色 */
    color: #000;
    box-shadow: 0 0 15px rgba(0, 242, 173, 0.4);
    border-color: #00f2ad;
}
/* 追加设定激活样式 */
.btn-special.addition.active {
    background: #6c5ce7;
    color: #fff;
    border-color: #6c5ce7;
}
.btn-special:hover:not(.active) {
    border-color: #00f2ad;
    color: #fff;
}
@media (max-width: 768px) {
    .special-channels { margin-left: 0; margin-top: 10px; width: 100%; justify-content: center;}
    .search-section { flex-direction: column; }
}
