/**
 * 主样式文件
 * 路径: /assets/css/style.css
 */

/* ========== 全局样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fb;
    color: #333;
    line-height: 1.5;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== 头部样式 ========== */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
}

.logo h1 a {
    color: white;
    text-decoration: none;
}

.nav {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.nav a, .nav span {
    color: white;
    text-decoration: none;
    font-size: 14px;
    transition: opacity 0.3s;
}

.nav a:hover {
    opacity: 0.8;
}

.vip-badge {
    background: #ffd700;
    color: #333;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.admin-link {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 14px;
    border-radius: 20px;
}

.admin-link:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ========== 分类导航 ========== */
.category-nav {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 70px;
    z-index: 99;
}

.category-nav ul {
    display: flex;
    list-style: none;
    justify-content: center;
    flex-wrap: wrap;
}

.category-nav li a {
    display: block;
    padding: 15px 30px;
    text-decoration: none;
    color: #666;
    font-weight: 500;
    transition: all 0.3s;
}

.category-nav li a:hover {
    color: #667eea;
}

.category-nav li.active a {
    color: #667eea;
    border-bottom: 3px solid #667eea;
}

/* ========== 资源网格 ========== */
.main {
    min-height: 60vh;
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin: 40px 0;
}

.resource-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
}

.resource-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.resource-card a {
    text-decoration: none;
    color: inherit;
}

.card-cover {
    height: 200px;
    overflow: hidden;
    background: #e0e0e0;
    position: relative;
}

.card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.resource-card:hover .card-cover img {
    transform: scale(1.05);
}

.no-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    font-size: 14px;
}

.card-info {
    padding: 15px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========== 分页样式 ========== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 40px 0 60px;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    display: inline-block;
    padding: 8px 15px;
    background: white;
    border-radius: 6px;
    text-decoration: none;
    color: #667eea;
    transition: all 0.3s;
    border: 1px solid #e0e0e0;
}

.pagination a:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination .active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.pagination .page-input {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 4px 12px;
    border-radius: 30px;
    border: 1px solid #e0e0e0;
}

.pagination .page-input input {
    width: 60px;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}

.pagination .page-input button {
    padding: 6px 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.pagination .page-input button:hover {
    background: #5a67d8;
}

/* ========== 详情页样式 ========== */
.detail-container {
    max-width: 1000px;
    margin: 40px auto;
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.detail-category {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    margin-bottom: 15px;
}

.detail-title {
    font-size: 28px;
    margin-bottom: 20px;
    color: #333;
}

.detail-cover {
    text-align: center;
    margin-bottom: 30px;
}

.detail-cover img {
    max-width: 400px;
    max-height: 300px;
    border-radius: 12px;
    object-fit: cover;
}

.detail-section {
    margin-bottom: 25px;
}

.detail-section h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
    border-left: 4px solid #667eea;
    padding-left: 12px;
}

.detail-desc {
    line-height: 1.8;
    color: #666;
}

.download-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    margin-top: 20px;
}

.download-section h3 {
    margin-bottom: 15px;
    border-left: none;
    padding-left: 0;
}

.download-btn, .vip-btn {
    display: inline-block;
    padding: 14px 50px;
    border-radius: 40px;
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s;
}

.download-btn {
    background: #28a745;
    color: white;
}

.download-btn:hover {
    background: #218838;
    transform: translateY(-2px);
}

.vip-btn {
    background: #ffc107;
    color: #333;
}

.vip-btn:hover {
    background: #e0a800;
    transform: translateY(-2px);
}

.vip-tip {
    margin-top: 15px;
    font-size: 13px;
    color: #999;
}

.back-link {
    display: inline-block;
    margin-top: 20px;
    color: #667eea;
    text-decoration: none;
}

.back-link:hover {
    text-decoration: underline;
}

/* ========== 底部样式 ========== */
.footer {
    background: #2d3748;
    color: #a0aec0;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}

/* ========== 空数据样式 ========== */
.no-data {
    text-align: center;
    padding: 80px 20px;
    font-size: 18px;
    color: #999;
}

/* ========== 响应式布局 ========== */
@media (max-width: 1200px) {
    .resource-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .resource-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .detail-title {
        font-size: 22px;
    }
    
    .download-btn, .vip-btn {
        padding: 12px 30px;
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .category-nav li a {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .detail-container {
        padding: 20px;
        margin: 20px;
    }
}

@media (max-width: 600px) {
    .resource-grid {
        grid-template-columns: 1fr;
    }
    
    .header .container {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav {
        justify-content: center;
    }
}