/* 页面容器 */
.page-container {
    padding: 120px 5% 80px;
    max-width: 1400px;
    margin: 0 auto;
}

/* ========================================
   筛选和搜索区域（核心优化）
======================================== */
.filter-container {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* 搜索框容器 */
.search-box, .search-column form {
    display: flex;
    height: 40px;
    width: 100%;
    box-sizing: border-box;
}

/* 搜索输入框 */
.search-input {
    flex: 1;
    min-width: 0;
    padding: 8px 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px 0 0 10px;
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: var(--transition);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 搜索按钮 */
.search-button {
    background: linear-gradient(45deg, var(--primary-accent), var(--secondary-accent));
    color: var(--primary-dark);
    border: none;
    padding: 0;
    border-radius: 0 !important;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    width: 60px;
}

/* 重置按钮 */
.reset-button {
    background: var(--card-bg);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0;
    border-radius: 0 10px 10px 0;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    margin-left: 1px;
    white-space: nowrap;
    width: 60px;
}

/* 标签容器外层（修复按钮位移） */
.filter-tags-wrap {
    position: relative;
    margin-top: 5px;
    padding-right: 50px;
    height: auto;
}

/* 标签滚动容器 */
.filter-tags-scroll {
    position: relative;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 4px;
}

.filter-tags-scroll::-webkit-scrollbar {
    display: none;
}

/* 标签内层容器 */
.filter-tags-inner {
    display: flex;
    gap: 8px;
    white-space: nowrap;
}

/* 标签按钮 */
.filter-tag {
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.85rem;
    white-space: nowrap;
}

/* 标签展开/收起按钮（固定位置） */
.toggle-tags-btn {
    display: none;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    padding: 3px 12px;
    border-radius: 20px;
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-size: 0.8rem;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
}

.toggle-tags-btn i {
    font-size: 0.7rem;
    margin-left: 3px;
    transition: transform 0.3s;
}

/* ========================================
   排序控件样式（同步工作流页面）
======================================== */
/* 桌面端排序 */
.sort-container {
    display: flex;
    align-items: center;
}

.sort-options {
    display: flex;
    gap: 12px;
}

.sort-option {
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    display: flex;
    align-items: center;
}

.sort-arrow {
    display: inline-block;
    padding: 2px 4px;
    border-radius: 3px;
    margin-left: 5px;
    font-size: 0.7rem;
}

/* 手机端排序按钮 */
.mobile-sort-toggle {
    display: none;
    padding: 0;
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    width: 40px;
    text-align: center;
}

/* 手机端排序菜单 */
.mobile-sort-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 160px;
    margin-top: 5px;
    background: var(--card-bg);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 100;
    padding: 8px 0;
}

.mobile-sort-item {
    display: block;
    padding: 10px 15px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.mobile-sort-group {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 8px;
    padding-top: 8px;
}

.mobile-sort-group .mobile-sort-item {
    padding-left: 25px;
}

/* ========================================
   插件列表样式（优化整合）
======================================== */
.plugins-slim-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 10px 0;
}

/* 精简插件卡片 */
.plugin-slim-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: calc(16.666% - 17px);
    padding: 15px;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    text-align: center;
    position: relative;
    box-sizing: border-box;
}

.plugin-slim-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 208, 255, 0.2);
}

/* 插件图标容器 */
.plugin-slim-icon {
    margin-bottom: 10px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(0, 208, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.plugin-slim-icon img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    display: block;
}

/* 插件信息容器 */
.plugin-slim-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

/* 名称和VIP标识行 */
.plugin-slim-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
}

.plugin-slim-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    flex: 1;
}

.plugin-slim-vip {
    color: #ffd700;
    font-size: 0.8rem;
    background: rgba(255, 215, 0, 0.1);
    padding: 1px 6px;
    border-radius: 4px;
}

/* 星级样式 */
.plugin-slim-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 16px;
}

.plugin-slim-rating .star-group {
    display: flex;
    gap: 1px;
}

.plugin-slim-rating .filled-star {
    color: #ffd700 !important;
    text-shadow: 0 0 2px rgba(255, 215, 0, 0.3);
    font-size: 0.85rem !important;
}

.plugin-slim-rating .empty-star {
    color: #ccc !important;
    font-size: 0.85rem !important;
}

.plugin-slim-rating .rating-text {
    color: var(--text-secondary);
    font-size: 0.8rem;
    margin-left: 2px;
}

/* 价格样式 */
.plugin-slim-price {
    margin-top: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.price-value {
    color: var(--primary-accent);
}

.price-free {
    color: #00c853;
}

/* ========================================
   响应式适配（合并去重）
======================================== */
/* 大屏设备（≥1200px）：6列布局 */
@media (min-width: 1200px) {
    .plugin-slim-card {
        width: calc(16.666% - 17px);
    }
}

/* 中等屏幕（992px-1199px）：5列布局 */
@media (min-width: 992px) and (max-width: 1199px) {
    .plugin-slim-card {
        width: calc(20% - 16px);
    }
}

/* 平板（768px-991px）：4列布局 */
@media (min-width: 768px) and (max-width: 991px) {
    .plugin-slim-card {
        width: calc(25% - 15px);
    }
    .filter-tags-wrap {
        padding-right: 0;
    }
    .filter-tags-scroll {
        overflow: visible;
    }
    .filter-tags-inner {
        flex-wrap: wrap;
        white-space: normal;
    }
    .filter-top-row {
        flex-wrap: nowrap !important;
    }
    .mobile-sort-toggle, .mobile-sort-menu {
        display: none !important;
    }
}

/* 手机端（≤767px）：核心适配 */
@media (max-width: 767px) {
    /* 页面容器 */
    .page-container {
        padding-top: 80px !important;
    }

    /* 筛选容器 */
    .filter-container {
        padding: 15px 12px !important;
        margin-bottom: 20px !important;
    }
    .filter-top-row {
        flex-direction: column !important;
        gap: 12px !important;
        margin-bottom: 12px !important;
    }
    .search-column, .sort-column {
        width: 100% !important;
        min-width: auto !important;
        margin-left: 0 !important;
    }
    .sort-column {
        display: none !important; /* 隐藏桌面端排序 */
    }

    /* 搜索栏 */
    .search-box {
        height: 44px !important;
    }
    .search-input {
        padding: 0 14px !important;
        font-size: 0.95rem !important;
        border-right: none !important;
    }
    .search-button, .reset-button {
        padding: 0 !important;
        font-size: 0.85rem !important;
    }
    .mobile-sort-toggle {
        display: block !important;
    }

    /* 标签筛选 */
    .toggle-tags-btn {
        display: block;
    }
    .filter-tags {
        gap: 10px !important;
        margin-top: 8px !important;
        padding-bottom: 5px !important;
    }
    .filter-tag {
        padding: 7px 15px !important;
        font-size: 0.9rem !important;
        border-radius: 22px !important;
    }
    .filter-tags a {
        white-space: nowrap !important;
    }
    .filter-tags-wrap.expanded {
        padding-right: 0;
    }
    .filter-tags-wrap.expanded .filter-tags-scroll {
        overflow-x: hidden;
        overflow-y: auto;
        max-height: 120px;
    }
    .filter-tags-wrap.expanded .filter-tags-inner {
        white-space: normal;
        flex-wrap: wrap;
    }
    .toggle-tags-btn.expanded i {
        transform: rotate(180deg);
    }

    /* 插件列表 */
    .plugin-slim-card {
        width: calc(33.333% - 14px);
    }
}

/* 小屏手机（≤576px）：2列布局 */
@media (max-width: 576px) {
    .plugin-slim-card {
        width: calc(50% - 10px);
    }
}

/* ========================================
   亮色主题适配（合并去重）
======================================== */
.light-theme .search-input {
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.7);
    color: var(--text-primary);
}

.light-theme .search-input:focus {
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.2);
}

.light-theme .filter-tag {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.light-theme .reset-button {
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.light-theme .reset-button:hover {
    background: rgba(0, 0, 0, 0.05);
}

.light-theme .plugin-slim-card:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 102, 204, 0.2);
}

.light-theme .mobile-sort-toggle {
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.light-theme .mobile-sort-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

.light-theme .mobile-sort-group {
    border-top-color: rgba(0, 0, 0, 0.1);
}

.light-theme .sort-option {
    border:     1px solid rgba(0, 0, 0, 0.1);
}

.light-theme .toggle-tags-btn {
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* ========================================
   交互状态样式（合并去重）
======================================== */
/* 搜索框焦点状态 */
.search-input:focus {
    outline: none;
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 3px rgba(0, 208, 255, 0.2);
}

/* 按钮hover状态 */
.search-button:hover {
    opacity: 0.9;
}

.reset-button:hover {
    background: rgba(0, 0, 0, 0.4);
    color: var(--text-primary);
}

.light-theme .reset-button:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* 标签交互 */
.filter-tag:hover, .filter-tag.active {
    background: linear-gradient(45deg, var(--primary-accent), var(--secondary-accent));
    color: var(--primary-dark);
    border-color: transparent;
}

/* 排序交互 */
.sort-option.active, .sort-option:hover {
    background: linear-gradient(45deg, var(--primary-accent), var(--secondary-accent));
    color: var(--primary-dark);
    border-color: transparent;
}

.sort-arrow.active {
    background: rgba(0, 0, 0, 0.3) !important;
    color: var(--primary-accent) !important;
}

.light-theme .sort-arrow.active {
    background: rgba(0, 0, 0, 0.05) !important;
}

/* 手机端排序交互 */
.mobile-sort-item:hover, .mobile-sort-item.active {
    background: rgba(0, 0, 0, 0.3);
    color: var(--primary-accent);
}

.light-theme .mobile-sort-item:hover, .light-theme .mobile-sort-item.active {
    background: rgba(0, 0, 0, 0.05);
}

.mobile-sort-group.active-group .mobile-sort-item.active {
    color: var(--primary-accent) !important;
    font-weight: 600 !important;
}

/* 折叠按钮交互 */
.toggle-tags-btn:hover {
    border-color: var(--primary-accent);
    color: var(--primary-accent);
}

/* 插件卡片hover */
.plugin-slim-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(0, 208, 255, 0.2);
}

.light-theme .plugin-slim-card:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 102, 204, 0.2);
}

/* ========================================
   分页样式适配
======================================== */
.pagination {
    margin-top: 40px;
    text-align: center;
}

.pagination .pagination {
    display: inline-flex;
    gap: 8px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.pagination .page-item {
    display: flex;
}

.pagination .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: var(--card-bg);
    color: var(--text-secondary);
    transition: var(--transition);
    font-size: 0.9rem;
}

.light-theme .pagination .page-link {
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(45deg, var(--primary-accent), var(--secondary-accent));
    color: var(--primary-dark);
    border-color: transparent;
}

.pagination .page-link:hover {
    border-color: var(--primary-accent);
    color: var(--primary-accent);
}

.pagination .page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination .page-item.disabled .page-link:hover {
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    background: var(--card-bg);
}

/* 手机端分页适配 */
@media (max-width: 767px) {
    .pagination {
        margin-top: 30px;
    }

    .pagination .page-link {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
}


/* 清除图标默认样式干扰 */
.plugin-slim-rating .fa-star {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
}

/* 防止标签文字溢出 */
.filter-tags-inner {
    width: 100%;
}

/* 修复搜索框在小屏溢出问题 */
@media (max-width: 375px) {
    .search-button, .reset-button {
        font-size: 0.8rem !important;
        width: 50px !important;
    }

    .mobile-sort-toggle {
        width: 36px !important;
    }
}


/* ========================================
   排序控件样式（完整优化版）
======================================== */
/* 桌面端排序（核心修改） */
.sort-options {
    display: flex;
    gap: 8px; /* 缩小按钮间距 */
}

.sort-option {
    color: var(--text-secondary);
    padding: 3px 8px; /* 缩小内边距 */
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    display: flex;
    align-items: center;
    font-size: 0.8rem; /* 缩小字体 */
    height: 26px; /* 固定按钮高度 */
}

.sort-arrow {
    display: inline-block;
    padding: 1px 3px; /* 缩小箭头内边距 */
    border-radius: 3px;
    margin-left: 4px; /* 缩小箭头间距 */
    font-size: 0.65rem; /* 缩小箭头大小 */
}

/* 手机端排序按钮（保持不变） */
.mobile-sort-toggle {
    display: none;
    padding: 0;
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    width: 40px;
    text-align: center;
}

/* 手机端排序菜单（保持不变） */
.mobile-sort-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 160px;
    margin-top: 5px;
    background: var(--card-bg);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 100;
    padding: 8px 0;
}

/* 交互状态（保持不变） */
.sort-option.active, .sort-option:hover {
    background: linear-gradient(45deg, var(--primary-accent), var(--secondary-accent));
    color: var(--primary-dark);
    border-color: transparent;
}

.sort-arrow.active {
    background: rgba(0, 0, 0, 0.3) !important;
    color: var(--primary-accent) !important;
}

.light-theme .sort-arrow.active {
    background: rgba(0, 0, 0, 0.05) !important;
}

/* 响应式适配（保持不变） */
@media (max-width: 767px) {
    .sort-option {
        padding: 6px 12px;
        font-size: 0.85rem;
        height: auto;
    }
    .sort-arrow {
        padding: 2px 4px;
        margin-left: 5px;
        font-size: 0.7rem;
    }
}




/* 新增：原HTML行内样式迁移 */
.filter-top-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    align-items: center;
}
.search-column {
    flex: 1;
    min-width: 280px;
    position: relative;
}
.sort-column {
    flex: 0 0 auto;
    min-width: 280px;
    margin-left: auto;
    display: flex;
}
.sort-container {
    display: flex;
    align-items: center;
    height: 40px;
    justify-content: flex-end;
}
.sort-label {
    color: var(--text-secondary);
    margin-right: 10px;
    font-size: 0.9rem;
}
.sort-option {
    position: relative;
    padding: 6px 12px;
    cursor: pointer;
}
.sort-arrow {
    margin-left: 5px;
    font-size: 0.7rem;
}
.sort-arrow + .sort-arrow {
    margin-left: 2px;
}
.mobile-sort-item i {
    font-size: 0.7rem;
    margin-left: 5px;
}
.mobile-sort-group .mobile-sort-item {
    padding-left: 25px;
}
.plugin-slim-icon-wrap {
    text-align: center;
    margin-bottom: 10px;
}
.plugin-slim-price .fa-bolt {
    color: #ffd700;
}
.plugin-slim-rating .fa-arrow-up,
.plugin-slim-rating .fa-arrow-down {
    font-size: 0.7rem;
}
/* 小屏适配补充 */
@media (max-width: 375px) {
    .search-button, .reset-button {
        width: 50px !important;
        font-size: 0.8rem !important;
    }
    .mobile-sort-toggle {
        width: 36px !important;
    }
}


/* 插件图标容器 - 强制居中 */
.plugin-slim-icon-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
}

/* 插件图标外层 - 固定尺寸+居中 */
.plugin-slim-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(0, 208, 255, 0.1);
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    overflow: hidden;
}

/* 插件图标本身 - 居中显示 */
.plugin-slim-icon img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    display: block;
    margin: 0 auto !important; /* 兜底居中 */
}