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

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 头部导航 */
header {
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo a {
    font-size: 1.5rem;
    font-weight: bold;
    color: #007bff;
    text-decoration: none;
}

nav ul {
    list-style: none;
    display: flex;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: #333;
    text-decoration: none;
}

nav ul li a:hover {
    color: #007bff;
}

/* 英雄区域 */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 80px 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.hero .subtitle {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* 搜索表单 */
.search-form {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
}

.search-form input {
    flex: 1;
    padding: 15px 20px;
    font-size: 16px;
    border: none;
    border-radius: 50px 0 0 50px;
    outline: none;
}

.search-form button {
    padding: 15px 30px;
    font-size: 16px;
    background: #28a745;
    color: #fff;
    border: none;
    border-radius: 0 50px 50px 0;
    cursor: pointer;
    transition: background 0.3s;
}

.search-form button:hover {
    background: #218838;
}

/* 资源网格 */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.resource-item {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.resource-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.resource-item h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.resource-item h3 a {
    color: #333;
    text-decoration: none;
}

.resource-item h3 a:hover {
    color: #007bff;
}

.resource-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #666;
}

.resource-meta span {
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 3px;
}

.description {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
}

.resource-actions {
    display: flex;
    gap: 10px;
}

.btn-detail, .btn-save {
    padding: 8px 15px;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.btn-detail {
    background: #007bff;
    color: #fff;
}

.btn-detail:hover {
    background: #0056b3;
}

.btn-save {
    background: #28a745;
    color: #fff;
}

.btn-save:hover {
    background: #218838;
}

/* 详情页 */
.resource-detail {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.resource-detail h1 {
    font-size: 2rem;
    margin-bottom: 20px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.detail-meta span {
    color: #666;
}

.detail-description {
    margin-bottom: 30px;
}

.detail-description h3 {
    margin-bottom: 15px;
    color: #333;
}

.download-info {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.download-info h3 {
    margin-bottom: 20px;
}

.download-url, .extract-code, .password {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.download-url input {
    flex: 1;
    min-width: 200px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

.code {
    background: #fff;
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: monospace;
}

.copy-btn {
    padding: 5px 15px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.copy-btn:hover {
    background: #0056b3;
}

.btn-save-large {
    display: inline-block;
    padding: 15px 40px;
    background: #28a745;
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: bold;
    transition: background 0.3s;
}

.btn-save-large:hover {
    background: #218838;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.pagination a, .pagination span {
    padding: 8px 15px;
    background: #fff;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #333;
    border-radius: 4px;
}

.pagination a:hover {
    background: #f0f0f0;
}

.pagination .current {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

/* 后台管理 */
.admin-login {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.login-box input {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.login-box button {
    width: 100%;
    padding: 12px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
}

.login-box button:hover {
    background: #0056b3;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
}

.admin-header {
    background: #343a40;
    color: #fff;
    padding: 15px 0;
    margin-bottom: 30px;
}

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

.admin-header h1 {
    font-size: 1.5rem;
}

.admin-header nav a {
    color: #fff;
    text-decoration: none;
    margin-left: 20px;
}

.admin-header nav a:hover {
    color: #007bff;
}

.admin-table {
    width: 100%;
    background: #fff;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.admin-table th {
    background: #007bff;
    color: #fff;
    padding: 12px;
    text-align: left;
}

.admin-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.admin-table tr:hover {
    background: #f8f9fa;
}

.admin-table a {
    color: #007bff;
    text-decoration: none;
    margin-right: 10px;
}

.admin-table a:hover {
    text-decoration: underline;
}

.admin-form {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-group textarea {
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.btn-submit {
    padding: 12px 30px;
    background: #28a745;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
}

.btn-submit:hover {
    background: #218838;
}

/* 页脚 */
footer {
    background: #333;
    color: #fff;
    padding: 20px 0;
    text-align: center;
    margin-top: 50px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero .subtitle {
        font-size: 1rem;
    }
    
    .search-form {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-form input,
    .search-form button {
        border-radius: 50px;
    }
    
    .resource-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-meta {
        flex-direction: column;
        gap: 10px;
    }
    
    .download-url, .extract-code, .password {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .download-url input {
        width: 100%;
    }
    
    .admin-header .container {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .admin-table {
        display: block;
        overflow-x: auto;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}




/* 添加分类标签样式 */
.resource-meta .category {
    background: #4CAF50;
    color: white;
}

.resource-meta .type {
    background: #2196F3;
    color: white;
}

.detail-meta .category {
    background: #4CAF50;
    color: white;
    padding: 3px 10px;
    border-radius: 15px;
}

/* 自动分类提示样式 */
.auto-badge {
    display: inline-block;
    background: #e8f5e9;
    color: #2e7d32;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    margin-left: 10px;
}


/* 网盘标签样式 */
.resource-meta .disk {
    background: #FF9800;
    color: white;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.9rem;
}

.resource-meta .category {
    background: #4CAF50;
    color: white;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.9rem;
}

.resource-meta .views {
    background: #2196F3;
    color: white;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.9rem;
}

.detail-meta .disk {
    background: #FF9800;
    color: white;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 1rem;
}

/* 添加网盘图标样式（可选） */
.disk.quark::before {
    content: "⚡";
    margin-right: 3px;
}

.disk.baidu::before {
    content: "🌐";
    margin-right: 3px;
}

.disk.aliyun::before {
    content: "☁️";
    margin-right: 3px;
}

.disk.xunlei::before {
    content: "⚡";
    margin-right: 3px;
}