/* ========================================
   MCResource - Minecraft资源站样式
   ======================================== */

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --success: #48bb78;
    --warning: #ed8936;
    --danger: #f56565;
    --dark: #1a202c;
    --gray: #718096;
    --gray-light: #e2e8f0;
    --gray-lighter: #f7fafc;
    --white: #ffffff;
    
    --mods-color: #e53e3e;
    --plugins-color: #3182ce;
    --datapacks-color: #38a169;
    --maps-color: #d69e2e;
    --others-color: #805ad5;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --shadow-xl: 0 20px 25px rgba(0,0,0,0.15);
    
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: var(--gray-lighter);
}

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

a {
    text-decoration: none;
    color: inherit;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

/* 导航栏 */
.navbar {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.logo i {
    font-size: 28px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-links a {
    color: var(--gray);
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

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

.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    position: relative;
    padding: 5px 10px;
    border-radius: var(--radius);
    transition: background 0.3s;
}

.user-menu:hover {
    background: var(--gray-lighter);
}

.user-menu .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.user-menu .dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s;
    overflow: hidden;
}

.user-menu:hover .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu .dropdown a {
    display: block;
    padding: 12px 16px;
    color: var(--dark);
    transition: background 0.3s;
}

.user-menu .dropdown a:hover {
    background: var(--gray-lighter);
    color: var(--primary);
}

/* Hero区域 */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    padding: 80px 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 48px;
    margin-bottom: 16px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.hero-content p {
    font-size: 20px;
    opacity: 0.9;
    margin-bottom: 40px;
}

.search-box {
    max-width: 600px;
    margin: 0 auto 30px;
}

.search-box form {
    display: flex;
    background: var(--white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}

.search-box i {
    padding: 0 20px;
    color: var(--gray);
    display: flex;
    align-items: center;
}

.search-box input {
    flex: 1;
    padding: 18px 0;
    border: none;
    font-size: 16px;
    outline: none;
}

.search-box button {
    border-radius: 0;
    padding: 18px 30px;
}

.server-notice {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.2);
    padding: 12px 24px;
    border-radius: var(--radius);
    backdrop-filter: blur(10px);
}

.server-notice i {
    font-size: 20px;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-top: 50px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 36px;
    font-weight: 700;
}

.stat-label {
    font-size: 14px;
    opacity: 0.8;
}

/* 分类区域 */
.categories {
    padding: 80px 0;
}

.section-title {
    font-size: 28px;
    margin-bottom: 30px;
    text-align: center;
}

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

.category-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 30px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.category-icon {
    width: 70px;
    height: 70px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 32px;
    color: var(--white);
}

.category-icon.mods { background: var(--mods-color); }
.category-icon.plugins { background: var(--plugins-color); }
.category-icon.datapacks { background: var(--datapacks-color); }
.category-icon.maps { background: var(--maps-color); }
.category-icon.others { background: var(--others-color); }

.category-card h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.category-card p {
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 12px;
}

.category-card .count {
    display: inline-block;
    background: var(--gray-lighter);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--gray);
}

/* 资源区域 */
.resources-section {
    padding: 60px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-header .section-title {
    margin-bottom: 0;
    text-align: left;
}

.view-all {
    color: var(--primary);
    font-weight: 500;
}

.view-all:hover {
    text-decoration: underline;
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.resource-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
}

.resource-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.resource-thumb {
    position: relative;
    height: 160px;
    overflow: hidden;
}

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

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

.category-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--white);
}

.category-badge.mods { background: var(--mods-color); }
.category-badge.plugins { background: var(--plugins-color); }
.category-badge.datapacks { background: var(--datapacks-color); }
.category-badge.maps { background: var(--maps-color); }
.category-badge.others { background: var(--others-color); }

.resource-info {
    padding: 20px;
}

.resource-info h4 {
    font-size: 16px;
    margin-bottom: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.resource-meta {
    display: flex;
    gap: 16px;
    color: var(--gray);
    font-size: 13px;
}

.resource-meta i {
    margin-right: 4px;
}

.resource-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

/* API区域 */
.api-section {
    padding: 80px 0;
    background: var(--dark);
    color: var(--white);
}

.api-content {
    text-align: center;
}

.api-content h2 {
    font-size: 32px;
    margin-bottom: 16px;
}

.api-content p {
    color: var(--gray);
    max-width: 600px;
    margin: 0 auto 40px;
}

.api-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.api-link {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.1);
    padding: 16px 24px;
    border-radius: var(--radius);
    transition: all 0.3s;
}

.api-link:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

.api-link i {
    font-size: 24px;
}

/* 页脚 */
.footer {
    background: var(--dark);
    color: var(--white);
    padding: 60px 0 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand h3 {
    font-size: 24px;
    margin-bottom: 12px;
    color: var(--primary);
}

.footer-brand p {
    color: var(--gray);
}

.footer-links h4 {
    font-size: 16px;
    margin-bottom: 20px;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--gray);
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: var(--gray);
    font-size: 14px;
}

/* 表单样式 */
.form-section {
    min-height: calc(100vh - 70px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.form-container {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 40px;
    width: 100%;
    max-width: 450px;
}

.form-container h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--dark);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group .hint {
    font-size: 12px;
    color: var(--gray);
    margin-top: 4px;
}

.form-group .error {
    color: var(--danger);
    font-size: 13px;
    margin-top: 4px;
}

.form-actions {
    margin-top: 30px;
}

.form-actions .btn {
    width: 100%;
}

.form-footer {
    text-align: center;
    margin-top: 20px;
    color: var(--gray);
}

.form-footer a {
    color: var(--primary);
}

/* 资源列表页 */
.page-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: var(--white);
    padding: 60px 0;
}

.page-header h1 {
    font-size: 36px;
    margin-bottom: 8px;
}

.page-header p {
    opacity: 0.9;
}

.filter-bar {
    background: var(--white);
    padding: 20px 0;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.filter-bar .container {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-bar select,
.filter-bar input {
    padding: 10px 16px;
    border: 2px solid var(--gray-light);
    border-radius: var(--radius);
    font-size: 14px;
    min-width: 150px;
}

.filter-bar select:focus,
.filter-bar input:focus {
    outline: none;
    border-color: var(--primary);
}

.filter-bar .btn {
    margin-left: auto;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: var(--white);
    color: var(--dark);
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.pagination a:hover {
    background: var(--primary);
    color: var(--white);
}

.pagination .current {
    background: var(--primary);
    color: var(--white);
}

/* 资源详情页 */
.detail-section {
    padding: 40px 0;
}

.detail-header {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.detail-thumb {
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.detail-thumb img {
    width: 100%;
    height: auto;
}

.detail-info h1 {
    font-size: 32px;
    margin-bottom: 16px;
}

.detail-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.detail-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--gray);
}

.detail-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.tag {
    background: var(--gray-lighter);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--gray);
}

.detail-actions {
    display: flex;
    gap: 12px;
}

.detail-content {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow);
}

.detail-content h3 {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gray-light);
}

.detail-content p {
    line-height: 1.8;
    color: var(--gray);
}

.detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
}

.sidebar-card h4 {
    margin-bottom: 16px;
    font-size: 16px;
}

.sidebar-card ul {
    list-style: none;
}

.sidebar-card li {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-light);
}

.sidebar-card li:last-child {
    border-bottom: none;
}

/* 上传页面 */
.upload-section {
    padding: 40px 0;
}

.upload-form {
    max-width: 800px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow);
}

.upload-form h2 {
    margin-bottom: 30px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.file-upload {
    border: 2px dashed var(--gray-light);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.file-upload:hover {
    border-color: var(--primary);
    background: var(--gray-lighter);
}

.file-upload i {
    font-size: 48px;
    color: var(--gray);
    margin-bottom: 16px;
}

.file-upload p {
    color: var(--gray);
}

/* 后台管理 */
.admin-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: calc(100vh - 70px);
}

.admin-sidebar {
    background: var(--dark);
    color: var(--white);
    padding: 30px 0;
}

.admin-sidebar .menu {
    list-style: none;
}

.admin-sidebar .menu li {
    margin-bottom: 5px;
}

.admin-sidebar .menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--gray);
    transition: all 0.3s;
}

.admin-sidebar .menu a:hover,
.admin-sidebar .menu a.active {
    background: rgba(255,255,255,0.1);
    color: var(--white);
}

.admin-content {
    padding: 30px;
    background: var(--gray-lighter);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.admin-header h2 {
    font-size: 24px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
}

.stat-card h4 {
    color: var(--gray);
    font-size: 14px;
    margin-bottom: 12px;
}

.stat-card .number {
    font-size: 32px;
    font-weight: 700;
    color: var(--dark);
}

.data-table {
    width: 100%;
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.data-table table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 16px;
    text-align: left;
}

.data-table th {
    background: var(--gray-lighter);
    font-weight: 600;
    color: var(--gray);
    font-size: 13px;
    text-transform: uppercase;
}

.data-table tr {
    border-bottom: 1px solid var(--gray-light);
}

.data-table tr:last-child {
    border-bottom: none;
}

.data-table td {
    font-size: 14px;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.pending {
    background: #fef3c7;
    color: #d97706;
}

.status-badge.approved {
    background: #d1fae5;
    color: #059669;
}

.status-badge.rejected {
    background: #fee2e2;
    color: #dc2626;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar .container {
        flex-wrap: wrap;
        height: auto;
        padding: 15px 20px;
    }
    
    .nav-links {
        display: none;
    }
    
    .hero-content h1 {
        font-size: 32px;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 30px;
    }
    
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .resource-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .detail-header {
        grid-template-columns: 1fr;
    }
    
    .admin-layout {
        grid-template-columns: 1fr;
    }
    
    .admin-sidebar {
        display: none;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}
