/* 基础重置和变量 */
:root {
    --primary-color: #ff9900;
    --primary-dark: #e68a00;
    --primary-light: #ffb84d;
    --secondary-color: #333333;
    --secondary-light: #444444;
    --background-color: #0f0f0f;
    --surface-color: #1a1a1a;
    --surface-light: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-disabled: #666666;
    --border-color: #333333;
    --success-color: #4caf50;
    --error-color: #f44336;
    --warning-color: #ff9800;
    --info-color: #2196f3;
    
    --header-height: 60px;
    --bottom-nav-height: 60px;
    --sidebar-width: 280px;
    --border-radius: 12px;
    --card-radius: 16px;
    --transition-speed: 0.3s;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.5);
}

/* 浅色主题 */
[data-theme="light"] {
    --background-color: #f5f5f5;
    --surface-color: #ffffff;
    --surface-light: #f0f0f0;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-disabled: #999999;
    --border-color: #e0e0e0;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    height: 100%;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    padding-bottom: var(--bottom-nav-height);
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface-color);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* 头部样式 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-speed);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 16px;
    max-width: 1200px;
    margin: 0 auto;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color var(--transition-speed);
}

.menu-toggle:hover {
    background-color: var(--surface-light);
}

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

.logo i {
    font-size: 1.5rem;
}

.header-center {
    flex: 1;
    max-width: 500px;
    margin: 0 16px;
}

.search-container {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 12px 48px 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    background-color: var(--surface-light);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all var(--transition-speed);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(255, 153, 0, 0.2);
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all var(--transition-speed);
}

.search-btn:hover {
    color: var(--primary-color);
    background-color: var(--surface-color);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color var(--transition-speed);
}

.header-btn:hover {
    background-color: var(--surface-light);
}

/* 侧边栏样式 */
.sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--surface-color);
    border-right: 1px solid var(--border-color);
    z-index: 1100;
    transition: left var(--transition-speed);
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.sidebar.open {
    left: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 16px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.close-sidebar {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color var(--transition-speed);
}

.close-sidebar:hover {
    background-color: var(--surface-light);
}

.sidebar-content {
    padding: 16px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background-color: var(--surface-light);
    border-radius: var(--border-radius);
    margin-bottom: 24px;
}

.user-avatar {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.user-details h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.user-details p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.sidebar-menu {
    list-style: none;
    margin-bottom: 24px;
}

.menu-item {
    margin-bottom: 4px;
}

.menu-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: all var(--transition-speed);
}

.menu-item a:hover {
    background-color: var(--surface-light);
}

.menu-item.active a {
    background-color: var(--primary-color);
    color: #000;
    font-weight: 500;
}

.menu-item i {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.proxy-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.proxy-status i {
    color: var(--success-color);
}

.app-version {
    text-align: center;
    font-size: 0.75rem;
    opacity: 0.7;
}

/* 主内容区域 */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: calc(var(--header-height) + 20px) 16px 80px;
    min-height: calc(100vh - var(--header-height) - var(--bottom-nav-height));
}

.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.content-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
}

.content-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-dropdown {
    position: relative;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.filter-btn:hover {
    background-color: var(--surface-light);
}

.filter-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    min-width: 120px;
    z-index: 100;
    display: none;
}

.filter-menu.show {
    display: block;
}

.filter-option {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color var(--transition-speed);
    border-bottom: 1px solid var(--border-color);
}

.filter-option:last-child {
    border-bottom: none;
}

.filter-option:hover {
    background-color: var(--surface-light);
}

.view-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 10px;
    border-radius: var(--border-radius);
    transition: background-color var(--transition-speed);
}

.view-toggle:hover {
    background-color: var(--surface-light);
}

/* 视频网格 */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.video-card {
    background-color: var(--surface-color);
    border-radius: var(--card-radius);
    overflow: hidden;
    transition: all var(--transition-speed);
    cursor: pointer;
    border: 1px solid var(--border-color);
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 比例 */
    background-color: var(--surface-light);
    overflow: hidden;
}

.video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-speed);
}

.video-card:hover .video-thumbnail img {
    transform: scale(1.05);
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.video-info {
    padding: 16px;
}

.video-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    height: 2.8em;
}

.video-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.video-views {
    display: flex;
    align-items: center;
    gap: 4px;
}

.video-views i {
    font-size: 0.75rem;
}

.video-uploader {
    display: flex;
    align-items: center;
    gap: 4px;
}

.video-uploader i {
    font-size: 0.75rem;
}

/* 加载指示器 */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.loading-spinner {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-container p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* 空状态和错误状态 */
.empty-state,
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-state i,
.error-state i {
    font-size: 4rem;
    color: var(--text-disabled);
    margin-bottom: 20px;
}

.error-state i {
    color: var(--error-color);
}

.empty-state h3,
.error-state h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.empty-state p,
.error-state p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    max-width: 300px;
}

.retry-btn {
    padding: 12px 24px;
    background-color: var(--primary-color);
    color: #000;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.retry-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

/* 分页控件 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 32px;
    padding: 20px 0;
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.pagination-btn:hover:not(:disabled) {
    background-color: var(--surface-light);
    border-color: var(--primary-color);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    font-size: 1rem;
    color: var(--text-secondary);
    min-width: 80px;
    text-align: center;
}

/* 底部导航栏 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-speed);
    flex: 1;
    height: 100%;
}

.nav-item i {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.nav-item span {
    font-size: 0.75rem;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item:hover:not(.active) {
    color: var(--text-primary);
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-speed);
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--surface-color);
    border-radius: var(--card-radius);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background-color var(--transition-speed);
}

.close-modal:hover {
    background-color: var(--surface-light);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(90vh - 80px);
}

/* 搜索模态框 */
.search-modal {
    max-width: 400px;
}

.search-modal-input {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.search-modal-input input {
    flex: 1;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--surface-light);
    color: var(--text-primary);
    font-size: 1rem;
}

.search-modal-input input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-modal-btn {
    padding: 14px 24px;
    background-color: var(--primary-color);
    color: #000;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.search-modal-btn:hover {
    background-color: var(--primary-dark);
}

.search-history h4 {
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 通知 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px 24px;
    box-shadow: var(--shadow-lg);
    z-index: 3000;
    transform: translateX(100%);
    opacity: 0;
    transition: all var(--transition-speed);
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-center {
        display: none;
    }
    
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }
    
    .content-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .content-actions {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .video-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .header-container {
        padding: 0 12px;
    }
    
    .main-content {
        padding: calc(var(--header-height) + 16px) 12px 80px;
    }
    
    .modal-content {
        width: 95%;
    }
}

/* 暗色主题覆盖 */
body.dark {
    color-scheme: dark;
}

/* 打印样式 */
@media print {
    .header,
    .sidebar,
    .bottom-nav,
    .modal,
    .notification {
        display: none !important;
    }
    
    .main-content {
        padding: 20px !important;
    }
    
    body {
        background-color: white !important;
        color: black !important;
    }
}

/* 辅助类 */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 8px;
}

.gap-4 {
    gap: 16px;
}

.mt-4 {
    margin-top: 16px;
}

.mb-4 {
    margin-bottom: 16px;
}

.p-4 {
    padding: 16px;
}

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

.text-sm {
    font-size: 0.875rem;
}

.text-lg {
    font-size: 1.125rem;
}

.font-bold {
    font-weight: 700;
}

.rounded {
    border-radius: var(--border-radius);
}

.shadow {
    box-shadow: var(--shadow-md);
}

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

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

/* 视频详情样式 */
.video-detail {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.video-player {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background-color: #000;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.video-player-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.video-detail-info h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    line-height: 1.4;
}

.video-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.video-detail-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.video-detail-meta i {
    font-size: 0.875rem;
}

.video-detail-description {
    margin-bottom: 20px;
    line-height: 1.6;
}

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

.tag {
    padding: 6px 12px;
    background-color: var(--surface-light);
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.video-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.action-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.action-btn.primary {
    background-color: var(--primary-color);
    color: #000;
}

.action-btn.secondary {
    background-color: var(--surface-light);
    color: var(--text-primary);
}

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

/* 相关视频 */
.related-videos {
    margin-top: 30px;
}

.related-videos h4 {
    font-size: 1.25rem;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.related-videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.related-video-card {
    background-color: var(--surface-light);
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.related-video-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.related-video-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    overflow: hidden;
}

.related-video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-video-title {
    padding: 12px;
    font-size: 0.95rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}