/* ===== Reset & Variables ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #0a0a14;
    --bg-alt: #12122a;
    --surface: #1a1a3e;
    --surface-hover: #222255;
    --primary: #7c3aed;
    --primary-light: #a78bfa;
    --accent: #06d6a0;
    --accent-glow: rgba(6, 214, 160, 0.3);
    --danger: #ef4444;
    --text: #f0f0ff;
    --text-muted: #9090c0;
    --border: rgba(255,255,255,0.08);
    --border-light: rgba(255,255,255,0.14);
    --radius: 14px;
    --radius-lg: 20px;
    --shadow: 0 8px 40px rgba(0,0,0,0.5);
    --shadow-card: 0 4px 20px rgba(0,0,0,0.3);
    --transition: 0.3s cubic-bezier(0.4,0,0.2,1);
    --max-width: 1280px;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; }

/* ===== Navbar ===== */
.navbar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    background: rgba(10,10,20,0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}
.nav-container {
    max-width: var(--max-width);
    margin: 0 auto; padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between;
    height: 68px;
}
.nav-logo {
    display: flex; align-items: center; gap: 10px;
    font-size: 1.25rem; font-weight: 700;
    color: var(--text);
}
.logo-icon { font-size: 1.5rem; }

.btn-upload {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary), #6d28d9);
    color: #fff; border-radius: 50px;
    font-size: 0.9rem; font-weight: 600;
    transition: var(--transition);
}
.btn-upload:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(124,58,237,0.4);
}

/* ===== Hero ===== */
.hero {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    text-align: center;
    padding: 100px 24px 60px;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 30% 50%, rgba(124,58,237,0.1) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 30%, rgba(6,214,160,0.08) 0%, transparent 60%),
        var(--bg);
}
.hero-bg { position: absolute; inset: 0; overflow: hidden; }
.hero-particle {
    position: absolute;
    width: 4px; height: 4px;
    background: var(--primary-light);
    border-radius: 50%;
    animation: particleFloat 6s ease-in-out infinite;
    opacity: 0.3;
}
.hero-particle:nth-child(1) { left: 10%; top: 20%; animation-delay: 0s; }
.hero-particle:nth-child(2) { left: 80%; top: 30%; animation-delay: 1.5s; }
.hero-particle:nth-child(3) { left: 50%; top: 60%; animation-delay: 3s; }
.hero-particle:nth-child(4) { left: 25%; top: 70%; animation-delay: 4.5s; }
.hero-particle:nth-child(5) { left: 70%; top: 15%; animation-delay: 2s; }

@keyframes particleFloat {
    0%, 100% { transform: translateY(0) scale(1); opacity: 0.3; }
    50% { transform: translateY(-40px) scale(2); opacity: 0.8; }
}

.hero-content {
    position: relative; z-index: 1;
    max-width: 720px;
    animation: fadeInUp 0.8s ease-out;
}
.hero-title {
    font-size: 3rem; font-weight: 700;
    line-height: 1.25; margin-bottom: 20px;
    letter-spacing: -1px;
}
.highlight {
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-subtitle {
    font-size: 1.1rem; color: var(--text-muted);
    margin-bottom: 40px; line-height: 1.9;
}
.hero-buttons {
    display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;
}

.btn {
    padding: 13px 28px; border-radius: 50px;
    font-size: 0.95rem; font-weight: 600;
    display: inline-flex; align-items: center; gap: 8px;
    transition: var(--transition);
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), #6d28d9);
    color: #fff;
    box-shadow: 0 4px 20px rgba(124,58,237,0.35);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(124,58,237,0.5);
}
.btn-outline {
    background: transparent; color: var(--text);
    border: 1.5px solid var(--border-light);
}
.btn-outline:hover {
    border-color: var(--primary-light);
    color: var(--primary-light);
    background: rgba(124,58,237,0.06);
}
.btn-full { width: 100%; justify-content: center; }

.scroll-indicator {
    position: absolute; bottom: 40px; left: 50%;
    transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    color: var(--text-muted); font-size: 0.85rem;
    animation: fadeIn 1.5s ease-out;
}
.scroll-arrow {
    width: 24px; height: 24px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg);
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: rotate(45deg) translate(0,0); opacity: 0.3; }
    50% { transform: rotate(45deg) translate(8px,8px); opacity: 1; }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; } to { opacity: 1; }
}

/* ===== Category Bar ===== */
.category-bar {
    padding: 20px 24px;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 68px; z-index: 90;
}
.category-container {
    max-width: var(--max-width); margin: 0 auto;
    display: flex; gap: 10px; overflow-x: auto;
    scrollbar-width: none;
}
.category-container::-webkit-scrollbar { display: none; }
.category-btn {
    padding: 8px 20px; border-radius: 50px;
    font-size: 0.9rem; font-weight: 500;
    color: var(--text-muted);
    background: var(--surface);
    border: 1px solid var(--border);
    white-space: nowrap; transition: var(--transition);
}
.category-btn:hover {
    border-color: var(--primary-light);
    color: var(--text);
}
.category-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ===== Video Wall ===== */
.video-wall {
    padding: 50px 24px 80px;
}
.video-wall-container {
    max-width: var(--max-width); margin: 0 auto;
}
.video-wall-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 36px;
}
.video-wall-header h2 {
    font-size: 1.6rem; font-weight: 700;
}
.video-sort { display: flex; gap: 6px; }
.sort-btn {
    padding: 8px 16px; border-radius: 8px;
    font-size: 0.85rem; font-weight: 500;
    color: var(--text-muted);
    background: var(--surface);
    transition: var(--transition);
}
.sort-btn.active {
    background: rgba(124,58,237,0.2);
    color: var(--primary-light);
}
.sort-btn:hover { color: var(--text); }

/* ===== Video Grid ===== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}
.video-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: var(--transition);
    cursor: pointer;
}
.video-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow);
    border-color: rgba(124,58,237,0.3);
}
.video-thumb {
    position: relative;
    aspect-ratio: 16/9;
    background: var(--bg-alt);
    overflow: hidden;
}
.video-thumb-img {
    width: 100%; height: 100%; object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.4s ease, opacity 0.3s ease;
    /* 确保图片始终填充容器，不拉伸不变形 */
    image-rendering: auto;
}
.video-card:hover .video-thumb-img {
    transform: scale(1.05);
}
.video-thumb .play-icon {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.3);
    opacity: 0; transition: var(--transition);
}
.video-card:hover .play-icon { opacity: 1; }
.play-icon svg {
    width: 56px; height: 56px;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
    transition: var(--transition);
}
.video-card:hover .play-icon svg {
    transform: scale(1.1);
}
.video-duration {
    position: absolute; bottom: 10px; right: 10px;
    background: rgba(0,0,0,0.75); color: #fff;
    padding: 3px 8px; border-radius: 6px;
    font-size: 0.75rem; font-weight: 500;
}
.video-body { padding: 18px 20px; }
.video-body h3 {
    font-size: 1.05rem; font-weight: 600;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.video-body p {
    font-size: 0.85rem; color: var(--text-muted);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.video-meta {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 0.8rem; color: var(--text-muted);
}
.video-meta-left { display: flex; align-items: center; gap: 12px; }
.video-tag {
    padding: 3px 10px; border-radius: 20px;
    background: rgba(124,58,237,0.15);
    color: var(--primary-light);
    font-size: 0.75rem; font-weight: 500;
}
.video-tool {
    padding: 3px 10px; border-radius: 20px;
    background: rgba(6,214,160,0.12);
    color: var(--accent);
    font-size: 0.75rem; font-weight: 500;
}

.load-more { text-align: center; margin-top: 48px; }

/* ===== Empty State ===== */
.empty-state {
    grid-column: 1 / -1;
    text-align: center; padding: 80px 20px;
}
.empty-state svg { opacity: 0.4; margin-bottom: 20px; }
.empty-state h3 { font-size: 1.3rem; margin-bottom: 8px; color: var(--text-muted); }
.empty-state p { color: var(--text-muted); font-size: 0.95rem; }

/* ===== Player Overlay ===== */
.player-overlay {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,0.92);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity 0.35s ease;
}
.player-overlay.active {
    opacity: 1; pointer-events: auto;
}
.player-modal {
    width: 95%; max-width: 900px;
    max-height: 95vh; overflow-y: auto;
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    position: relative;
}
.player-close {
    position: absolute; top: 12px; right: 16px;
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(0,0,0,0.6); color: #fff;
    font-size: 1.5rem; display: flex; align-items: center; justify-content: center;
    z-index: 10; transition: var(--transition);
}
.player-close:hover { background: rgba(255,255,255,0.2); }
.player-container {
    width: 100%;
    background: #000;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    overflow: hidden;
}
.player-container video {
    width: 100%; display: block;
    max-height: 60vh;
}
.player-info { padding: 24px; }
.player-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 8px; }
.player-desc { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 16px; line-height: 1.7; }
.player-meta {
    display: flex; gap: 16px; flex-wrap: wrap;
    font-size: 0.85rem; color: var(--text-muted);
    margin-bottom: 20px; padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.player-category {
    padding: 2px 12px; border-radius: 20px;
    background: rgba(124,58,237,0.15);
    color: var(--primary-light);
}
.player-actions {
    display: flex; gap: 12px;
}
.action-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 10px 20px; border-radius: 50px;
    background: var(--bg-alt); color: var(--text-muted);
    border: 1px solid var(--border);
    font-size: 0.9rem; transition: var(--transition);
}
.action-btn:hover {
    background: var(--surface-hover);
    color: var(--text);
    border-color: var(--border-light);
}
.action-btn.liked {
    color: var(--danger);
    border-color: var(--danger);
    background: rgba(239,68,68,0.1);
}

/* ===== Share Overlay ===== */
.share-overlay {
    position: fixed; inset: 0; z-index: 300;
    background: rgba(0,0,0,0.7);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
}
.share-overlay.active { opacity: 1; pointer-events: auto; }
.share-modal {
    width: 90%; max-width: 460px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 32px;
    border: 1px solid var(--border-light);
    position: relative;
}
.share-close {
    position: absolute; top: 12px; right: 16px;
    font-size: 1.5rem; color: var(--text-muted);
}
.share-close:hover { color: var(--text); }
.share-modal h3 {
    font-size: 1.3rem; font-weight: 700; margin-bottom: 20px;
    text-align: center;
}
.share-input-group {
    display: flex; gap: 8px; margin-bottom: 24px;
}
.share-input-group input {
    flex: 1; padding: 12px 16px;
    border-radius: 10px; border: 1px solid var(--border);
    background: var(--bg-alt); color: var(--text);
    font-size: 0.9rem;
}
.share-input-group input:focus { outline: none; border-color: var(--primary); }
.share-input-group .btn { white-space: nowrap; }
.share-social {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.share-btn {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 16px 8px; border-radius: 12px;
    background: var(--bg-alt); color: var(--text-muted);
    border: 1px solid var(--border);
    font-size: 0.8rem; transition: var(--transition);
}
.share-btn:hover {
    background: var(--surface-hover);
    color: var(--text);
    transform: translateY(-2px);
}

/* ===== Upload Overlay ===== */
.upload-overlay {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,0.7);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s ease;
    overflow-y: auto; padding: 20px;
}
.upload-overlay.active { opacity: 1; pointer-events: auto; }
.upload-modal {
    width: 95%; max-width: 560px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 32px;
    border: 1px solid var(--border-light);
    position: relative;
    max-height: 90vh; overflow-y: auto;
}
.upload-close {
    position: absolute; top: 12px; right: 16px;
    font-size: 1.5rem; color: var(--text-muted);
}
.upload-close:hover { color: var(--text); }
.upload-modal h3 {
    font-size: 1.3rem; font-weight: 700; margin-bottom: 24px;
    text-align: center;
}

.upload-dropzone {
    border: 2px dashed var(--border-light);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    margin-bottom: 24px;
}
.upload-dropzone:hover,
.upload-dropzone.drag-over {
    border-color: var(--primary-light);
    background: rgba(124,58,237,0.06);
}
.dropzone-content { color: var(--text-muted); }
.dropzone-content svg { margin-bottom: 12px; opacity: 0.6; }
.dropzone-text { font-size: 0.95rem; margin-bottom: 6px; }
.dropzone-link { color: var(--primary-light); text-decoration: underline; }
.dropzone-hint { font-size: 0.8rem; opacity: 0.6; }

.preview-container { position: relative; }
.preview-container video {
    width: 100%; max-height: 260px; border-radius: 8px;
    background: #000;
}
.preview-remove {
    margin-top: 10px; padding: 8px 16px;
    border-radius: 8px; background: rgba(239,68,68,0.15);
    color: var(--danger); font-size: 0.85rem;
    transition: var(--transition);
}
.preview-remove:hover { background: rgba(239,68,68,0.25); }

.upload-fields { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
    font-size: 0.9rem; font-weight: 500; color: var(--text-muted);
}
.form-group input,
.form-group textarea,
.form-group select {
    padding: 12px 16px; border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-alt); color: var(--text);
    font-size: 0.9rem; transition: var(--transition);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none; border-color: var(--primary);
}
.form-group textarea { resize: vertical; }
.form-group select { cursor: pointer; }
.form-group select option {
    background: var(--surface); color: var(--text);
}

.upload-progress {
    margin-bottom: 16px;
    text-align: center;
}
.progress-bar {
    width: 100%; height: 6px;
    background: var(--bg-alt); border-radius: 10px;
    overflow: hidden; margin-bottom: 8px;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 10px;
    width: 0%; transition: width 0.3s ease;
}
.progress-text { font-size: 0.85rem; color: var(--text-muted); }

/* ===== Toast ===== */
.toast {
    position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(100px);
    background: var(--surface-hover); color: var(--text);
    padding: 14px 28px; border-radius: 50px;
    font-size: 0.9rem; font-weight: 500;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
    z-index: 999;
    transition: transform 0.35s ease, opacity 0.35s ease;
    opacity: 0; pointer-events: none;
}
.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.toast.success { border-color: var(--accent); }
.toast.error { border-color: var(--danger); }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .hero-title { font-size: 2rem; }
    .hero-subtitle { font-size: 0.95rem; }
    .hero-buttons { flex-direction: column; align-items: center; }
    .hero-buttons .btn { width: 100%; justify-content: center; }

    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 16px;
    }
    .video-wall-header { flex-direction: column; gap: 16px; align-items: flex-start; }
    .share-social { grid-template-columns: repeat(2, 1fr); }
    .player-actions { flex-wrap: wrap; }
    .upload-modal { padding: 24px; }
}

@media (max-width: 480px) {
    .hero-title { font-size: 1.6rem; }
    .btn-upload span { display: none; }
    .video-grid { grid-template-columns: 1fr; }
}
