/* 全局样式 - 游戏风格主题 */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --danger-color: #ef4444;
    --background-dark: #0f172a;
    --background-light: #1e293b;
    --surface-color: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: #475569;
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-secondary: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-accent: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--background-dark);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* 头部样式 - 玻璃态设计 */
header {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 8px;
}

nav ul li a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

nav ul li a:hover {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.1);
}

nav ul li a.active {
    color: var(--text-primary);
    background: var(--gradient-primary);
}

/* 英雄区域 - 渐变背景 + 粒子效果 */
.hero {
    background: linear-gradient(135deg, 
        rgba(99, 102, 241, 0.2) 0%, 
        rgba(139, 92, 246, 0.2) 50%, 
        rgba(16, 185, 129, 0.2) 100%);
    padding: 6rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(16, 185, 129, 0.15) 0%, transparent 50%);
    pointer-events: none;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero h2 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #fff 0%, #c7d2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* 上传区域 - 卡片式设计 */
.upload-section {
    padding: 4rem 0;
}

.upload-section h3 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

#upload-form {
    max-width: 700px;
    margin: 0 auto;
    padding: 2.5rem;
    background: var(--background-light);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xl);
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: rgba(99, 102, 241, 0.05);
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    transform: scale(1.01);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.upload-text {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.upload-hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input[type="file"] {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-color);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.form-group input[type="file"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.file-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
}

#upload-button {
    width: 100%;
    padding: 1rem 2rem;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#upload-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

#upload-button:hover::before {
    left: 100%;
}

#upload-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

#upload-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 文件预览区域 */
.file-preview {
    margin-top: 1rem;
}

.preview-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--surface-color);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.preview-icon {
    font-size: 2.5rem;
}

.preview-details {
    flex: 1;
}

.preview-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    word-break: break-all;
}

.preview-size {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.remove-file {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-file:hover {
    background: var(--danger-color);
    color: white;
    transform: scale(1.1);
}

/* 上传状态 */
#upload-status {
    margin-top: 1.5rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
}

#upload-status.success {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

#upload-status.error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

#upload-status.info {
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

/* 画廊预览 */
.gallery-preview {
    padding: 4rem 0;
}

.gallery-preview h3 {
    text-align: center;
    margin-bottom: 2.5rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

/* 媒体卡片 - 悬停效果 */
.media-item {
    background: var(--background-light);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.media-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.media-item:hover {
    transform: translateY(-8px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.media-item:hover::before {
    opacity: 1;
}

.media-thumbnail {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: var(--surface-color);
}

.media-thumbnail img,
.media-thumbnail video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.media-item:hover .media-thumbnail img,
.media-item:hover .media-thumbnail video {
    transform: scale(1.1);
}

.media-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
}

.media-info {
    padding: 1.25rem;
}

.media-info h4 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.media-actions {
    display: flex;
    gap: 8px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger-color);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: var(--danger-color);
    color: white;
}

/* 画廊页面 */
.gallery-page {
    padding: 3rem 0;
}

.gallery-page h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.filter-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 10px 24px;
    border: 2px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.filter-btn.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
}

/* 媒体管理页面 */
.media-manager {
    padding: 3rem 0;
}

.media-manager h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.manager-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    gap: 1rem;
    background: var(--background-light);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.search-box {
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    width: 350px;
    font-size: 1rem;
    background: var(--surface-color);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.search-box:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.search-box::placeholder {
    color: var(--text-secondary);
}

.bulk-actions {
    display: flex;
    gap: 12px;
}

.bulk-actions .btn {
    padding: 12px 24px;
}

/* 加载状态 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4rem 2rem;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--surface-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 6rem 2rem;
    background: var(--background-light);
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.empty-state .empty-icon {
    font-size: 5rem;
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.5rem;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* 复选框样式 */
.media-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* 页脚样式 */
footer {
    background: var(--background-light);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0;
    text-align: center;
    margin-top: 4rem;
}

footer p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--background-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--surface-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-color);
}

/* 动画 - 入场效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.media-item {
    animation: fadeInUp 0.5s ease forwards;
}

.media-item:nth-child(1) { animation-delay: 0.1s; }
.media-item:nth-child(2) { animation-delay: 0.15s; }
.media-item:nth-child(3) { animation-delay: 0.2s; }
.media-item:nth-child(4) { animation-delay: 0.25s; }
.media-item:nth-child(5) { animation-delay: 0.3s; }
.media-item:nth-child(6) { animation-delay: 0.35s; }

/* 响应式设计 */
@media (max-width: 1024px) {
    .hero h2 {
        font-size: 2.5rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    nav ul {
        justify-content: center;
        flex-wrap: wrap;
    }

    nav ul li a {
        padding: 6px 12px;
        font-size: 0.9rem;
    }

    .hero {
        padding: 4rem 0;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    #upload-form {
        padding: 1.5rem;
    }

    .upload-area {
        padding: 2rem 1rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 16px;
    }

    .media-thumbnail {
        height: 180px;
    }

    .manager-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        width: 100%;
    }

    .bulk-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero h2 {
        font-size: 1.75rem;
    }

    .upload-section h3,
    .gallery-preview h3,
    .gallery-page h2,
    .media-manager h2 {
        font-size: 1.5rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .media-actions {
        flex-direction: column;
    }
}