* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

a {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}

img {
    max-width: 100%;
    display: block;
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 24px;
}

.nav-inner {
    max-width: var(--max-width);
    width: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-search {
    flex: 1;
    max-width: 400px;
    position: relative;
    display: flex;
    align-items: center;
}

.nav-search svg {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    pointer-events: none;
}

.nav-search input {
    width: 100%;
    padding: 8px 16px 8px 36px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.nav-search input:focus {
    border-color: var(--accent);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg-card); color: var(--text-secondary); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-active { background: var(--accent); color: #fff; border: 1px solid var(--accent); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 10px 24px; font-size: 15px; }
.btn-block { width: 100%; justify-content: center; }

.nav-user {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}

.avatar-lg {
    width: 64px;
    height: 64px;
    font-size: 28px;
}

.nav-username {
    font-size: 14px;
    color: var(--text-secondary);
}

.user-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 160px;
    box-shadow: var(--shadow);
    overflow: hidden;
    z-index: 100;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown a {
    display: block;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.user-dropdown a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.main-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: calc(var(--nav-height) + 24px) 24px 48px;
    min-height: 100vh;
}

.section {
    margin-bottom: 32px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 700;
}

.see-all {
    font-size: 13px;
    color: var(--accent);
    cursor: pointer;
    transition: var(--transition);
}

.see-all:hover {
    color: var(--accent-hover);
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.video-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid var(--border-light);
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--border);
}

.video-thumb {
    position: relative;
    aspect-ratio: 16 / 10;
    background: var(--bg-secondary);
    overflow: hidden;
}

.video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--accent);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.video-rating {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #fdcb6e;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.video-info {
    padding: 12px;
}

.video-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.hero-banner {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 1;
    min-height: 200px;
    max-height: 400px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: 32px;
    cursor: pointer;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-secondary);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(transparent 30%, rgba(0, 0, 0, 0.85));
}

.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px;
}

.hero-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.hero-meta {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
}

.hero-desc {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 16px;
    max-width: 500px;
}

.hero-actions {
    display: flex;
    gap: 12px;
}

.category-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.tab-btn:hover,
.tab-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state p {
    font-size: 14px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.page-btn {
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.page-btn:hover,
.page-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-dots {
    padding: 6px 4px;
    color: var(--text-muted);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px;
    width: 90%;
    max-width: 420px;
    box-shadow: var(--shadow);
    position: relative;
}

.modal-card h2 {
    font-size: 20px;
    margin-bottom: 20px;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-switch {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.modal-switch a {
    color: var(--accent);
    cursor: pointer;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent);
}

.form-error {
    color: var(--accent);
    font-size: 13px;
    margin-bottom: 12px;
}

.result-count {
    font-size: 13px;
    color: var(--text-muted);
}

#toast-container {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 2000;
}

.toast {
    padding: 12px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 14px;
    box-shadow: var(--shadow);
    transform: translateX(120%);
    transition: transform 0.3s ease;
    margin-bottom: 8px;
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    border-left: 3px solid var(--success);
}

.toast-error {
    border-left: 3px solid var(--accent);
}

.toast-info {
    border-left: 3px solid #4285f4;
}
