/* Skills模块样式 */

/* 内容容器布局 - 与MCP页面保持一致 */
.content-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
    display: flex;
    position: relative;
    min-height: calc(100vh - 300px);
    transition: opacity 0.2s ease;
    justify-content: center;
}

.categories-sidebar-floating {
    position: sticky;
    top: 100px;
    width: 220px;
    height: calc(100vh - 120px);
    margin-right: 40px;
    flex-shrink: 0;
}

.categories-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    box-shadow: var(--card-shadow, 0 4px 15px rgba(0,0,0,0.08));
    height: 100%;
    overflow-y: auto;
    max-height: 90vh;
    overscroll-behavior: contain;
}

.categories-card h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0 0 15px 0;
    padding: 0 5px 15px 5px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.categories-card h2:before {
    content: '\f03a';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-right: 10px;
    font-size: 16px;
}

.servers-content {
    flex: 1;
    min-width: 0;
    max-width: 1180px;
    padding-top: 0;
    padding-bottom: 40px;
    display: flex;
    flex-direction: column;
}

/* Skills网格 */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

/* Skill卡片 */
.skill-card {
    background: var(--card-bg, white);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.skill-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(74, 123, 255, 0.15);
    border-color: rgba(74, 123, 255, 0.3);
}

.skill-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.skill-logo {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.skill-info {
    flex: 1;
    min-width: 0;
}

.skill-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #1a1a2e);
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.skill-owner {
    font-size: 12px;
    color: var(--light-text, #999);
}

.skill-owner i {
    margin-right: 4px;
}

.skill-desc {
    font-size: 13px;
    color: var(--text-secondary, #666);
    line-height: 1.5;
    margin: 0 0 16px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 60px;
}

.skill-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border-color, #eee);
}

.skill-stats {
    display: flex;
    gap: 12px;
    font-size: 13px;
    color: var(--light-text, #999);
}

.skill-stars i {
    color: #f59e0b;
    margin-right: 4px;
}

.skill-date {
    font-size: 12px;
    color: var(--light-text, #999);
}

.skill-date i {
    margin-right: 4px;
    color: var(--light-text, #999);
}

/* 收藏按钮 */
.skill-favorite-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--light-text, #999);
}

.skill-favorite-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.skill-favorite-btn i {
    font-size: 16px;
}

.skill-favorite-btn.active i,
.skill-favorite-btn i.fas {
    color: #ef4444;
}

/* Toast 消息动画 */
@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    10% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    90% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

/* 分类项样式 - 与MCP页面保持一致 */
.category-list {
    list-style: none;
    padding: 5px 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.category-item {
    padding: 10px 15px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    background-color: transparent;
    color: var(--text-secondary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    font-size: 15px;
    font-weight: 400;
    text-decoration: none;
    user-select: none;
    overflow: hidden;
    box-sizing: border-box;
    margin: 0 5px 5px 5px;
    position: relative;
}

.category-item:hover {
    background-color: var(--tool-item-bg);
}

.category-item:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background-color: transparent;
}

.category-item.active:before {
    background-color: #4e73f8;
}

.category-item.active {
    background-color: var(--tag-bg);
    color: var(--primary-color);
}

.category-item i {
    margin-right: 12px;
    font-size: 16px;
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
    flex-shrink: 0;
    display: inline-block;
    transition: color 0.3s ease;
}

.category-item.active i {
    color: var(--primary-color);
}

.category-header {
    display: flex;
    align-items: center;
    width: 100%;
    white-space: nowrap;
}

.category-header span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.category-item.active .category-header span {
    font-weight: 500;
}

/* 分类计数标签 */
.category-count {
    font-size: 12px;
    color: var(--light-text, #999);
    background: var(--bg-secondary, rgba(74, 123, 255, 0.08));
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: auto;
    font-weight: 500;
    display: none;
}

.category-item.active .category-count {
    background: rgba(74, 123, 255, 0.15);
    color: var(--primary-color, #4a7bff);
    display: inline-flex !important;
}

/* 分类图标颜色 - 与MCP页面保持一致 */
.category-item[data-category="all"] i {
    color: #6366f1 !important;
}

.category-item[data-category="全部"] i {
    color: #6366f1 !important;
}

.category-item[data-category="featured"] i {
    color: #f59e0b !important;
}

.category-item[data-category="精选"] i {
    color: #f59e0b !important;
}

.category-item[data-category="推荐"] i {
    color: #f59e0b !important;
}

/* 分类分割线 */
.category-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 10px 15px;
    list-style: none;
}

.category-item[data-category="automation"] i,
.category-item[data-category="自动化"] i {
    color: #8b5cf6 !important;
}

.category-item[data-category="code"] i,
.category-item[data-category="代码"] i {
    color: #8854d0 !important;
}

.category-item[data-category="data"] i,
.category-item[data-category="数据"] i {
    color: #3867d6 !important;
}

.category-item[data-category="document"] i,
.category-item[data-category="文档"] i {
    color: #4b6584 !important;
}

.category-item[data-category="tool"] i,
.category-item[data-category="工具"] i {
    color: #778ca3 !important;
}

.category-item[data-category="api"] i,
.category-item[data-category="API"] i {
    color: #2d98da !important;
}

.category-item[data-category="creation"] i,
.category-item[data-category="creative"] i,
.category-item[data-category="创作"] i {
    color: #fa8231 !important;
}

.category-item[data-category="search"] i,
.category-item[data-category="搜索"] i {
    color: #eb3b5a !important;
}

.category-item[data-category="other"] i,
.category-item[data-category="其他"] i {
    color: #95a5a6 !important;
}

/* 分页 */
.page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border-color, #ddd);
    background: var(--card-bg, white);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.page-btn:hover {
    border-color: var(--primary-color, #4a7bff);
    color: var(--primary-color, #4a7bff);
}

.page-btn.active {
    background: var(--primary-color, #4a7bff);
    color: white;
    border-color: var(--primary-color, #4a7bff);
}

.page-dots {
    display: flex;
    align-items: center;
    padding: 0 8px;
    color: var(--light-text, #999);
}

/* 加载占位 */
.loading-placeholder {
    color: var(--light-text, #666);
}

.loading-placeholder i {
    margin-right: 8px;
}

/* 加载更多指示器 */
.loading-more {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    gap: 10px;
    color: var(--light-text, #666);
}

.loading-more .loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color, #e5e7eb);
    border-top-color: var(--primary-color, #4a7bff);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 没有更多数据提示 */
.no-more-data {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    color: var(--light-text, #999);
    font-size: 14px;
}

/* 响应式 */
@media (max-width: 1024px) {
    .skills-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .categories-sidebar-floating {
        display: none;
    }
    
    .content-container {
        margin: 0 auto;
        padding: 0;
        width: 100%;
        display: flex;
        justify-content: center;
        min-height: auto;
    }
    
    .servers-content {
        width: 100%;
        padding: 0 0 40px 0;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* 暗黑模式 */
@media (prefers-color-scheme: dark) {
    .skill-card {
        background: var(--card-bg, #1e1e1e);
    }
    
    .skill-card:hover {
        box-shadow: 0 8px 24px rgba(74, 123, 255, 0.25);
    }
    
    .page-btn {
        background: var(--card-bg, #1e1e1e);
        border-color: var(--border-color, #333);
    }
}

/* 暗黑模式 - data-theme 属性 */
[data-theme="dark"] .skill-card {
    background: var(--card-bg);
}

[data-theme="dark"] .skill-card:hover {
    box-shadow: 0 8px 24px rgba(74, 123, 255, 0.25);
}

[data-theme="dark"] .page-btn {
    background: var(--card-bg);
    border-color: var(--border-color);
}
