/* ==================== 现代白色简约设计系统 ==================== */
:root {
    /* 主色调 - 优雅蓝 */
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --primary-subtle: #dbeafe;
    --primary-hover: #1d4ed8;
    
    /* 背景色 - 白色主题 */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-elevated: #ffffff;
    --bg-overlay: rgba(15, 23, 42, 0.05);
    
    /* 文字颜色 */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-light: #cbd5e1;
    
    /* 边框 */
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --border-focus: var(--primary);
    --border-hover: #cbd5e1;
    
    /* 状态颜色 */
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #0ea5e9;
    
    /* 阴影 - 柔和细腻 */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
    
    /* 圆角 */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* 过渡 */
    --transition-fast: all 0.15s ease;
    --transition: all 0.2s ease;
    --transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Noto Sans SC', sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* 禁止文字选择和复制 */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.hidden { display: none !important; }

/* ==================== 登录页面 ==================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.login-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    text-align: center;
    box-shadow: var(--shadow-xl);
}

.login-header {
    margin-bottom: 36px;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.loading-config {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px;
    color: var(--text-muted);
}

.loading-config p {
    font-size: 14px;
    color: var(--text-secondary);
}

.spinner-small {
    width: 32px;
    height: 32px;
    position: relative;
    display: inline-block;
}

.spinner-small::before {
    content: '';
    position: absolute;
    width: 32px;
    height: 32px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.password-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}

.password-section input {
    padding: 16px 18px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: var(--transition);
}

.password-section input:focus {
    border-color: var(--primary);
    background: var(--bg-primary);
    box-shadow: 0 0 0 3px var(--primary-subtle);
}

.password-section input::placeholder {
    color: var(--text-muted);
}

.btn-primary {
    padding: 16px 28px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-xs);
}

.error-message {
    margin-top: 16px;
    padding: 14px 18px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius-md);
    color: var(--error);
    font-size: 14px;
    text-align: left;
}

/* ==================== 主页面 ==================== */
.main-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部导航 - 现代简约 */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 32px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    padding: 10px 18px;
    border-radius: var(--radius-lg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.brand::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary-subtle) 0%, rgba(59, 130, 246, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: var(--radius-lg);
}

.brand:hover::before {
    opacity: 1;
}

.brand:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.brand-text {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 1;
}

.brand-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-md);
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
    position: relative;
    z-index: 1;
}

.brand-icon svg {
    width: 22px;
    height: 22px;
}

/* 主内容区 */
.main-content {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 32px;
    width: 100%;
}

/* ==================== 文件夹网格布局（首页）==================== */
.folders-section {
    margin-bottom: 32px;
    width: 100%;
}

.folders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    width: 100%;
}

/* 文件夹卡片 - 长方形设计 */
.folder-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    position: relative;
}

.folder-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1), 0 4px 8px rgba(0, 0, 0, 0.06);
}

.folder-cover {
    position: relative;
    aspect-ratio: 16 / 9;
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    overflow: hidden;
}

.folder-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    display: block;
    opacity: 0;
}

.folder-cover img.loaded {
    opacity: 1;
}

.folder-card:hover .folder-cover img {
    transform: scale(1.05);
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.folder-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-light);
}

.folder-placeholder svg {
    width: 32px;
    height: 32px;
    opacity: 0.2;
}

/* 项目数量标签 - 左上角 */
.folder-count {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 11px;
    color: white;
    font-weight: 600;
    white-space: nowrap;
    padding: 4px 10px;
    background: rgba(37, 99, 235, 0.9);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-full);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 3;
    pointer-events: none;
}

/* 用户名 - 右上角绿色背景 */
.folder-name {
    position: absolute;
    top: 8px;
    right: 8px;
    font-weight: 600;
    font-size: 11px;
    color: white;
    padding: 3px 8px;
    background: rgba(34, 197, 94, 0.9);
    backdrop-filter: blur(8px);
    border-radius: var(--radius-md);
    z-index: 3;
    max-width: calc(50% - 15px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

.folder-meta {
    padding: 10px 12px;
    background: var(--bg-card);
}

.folder-signature {
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.5;
}

/* ==================== 媒体网格布局（详情页）==================== */
.media-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    width: 100%;
}

.media-grid.detail-view {
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    width: 80%;
    max-width: 1120px;
}

/* 媒体项卡片 */
.media-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
    position: relative;
}

.media-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.06) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.media-item:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.12), 0 4px 8px rgba(0, 0, 0, 0.06);
}

.media-item:hover::before {
    opacity: 1;
}

.media-thumb {
    position: relative;
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    overflow: hidden;
}

.media-thumb img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.media-thumb img.loaded {
    opacity: 1;
}

.media-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 120px;
    color: var(--text-light);
    background: var(--bg-tertiary);
}

.media-placeholder svg {
    width: 52px;
    height: 52px;
    opacity: 0.3;
}

/* 视频占位符样式 */
.video-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 120px;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #94a3b8;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-placeholder.loaded {
    opacity: 1;
}

.video-placeholder svg {
    width: 48px;
    height: 48px;
    opacity: 0.6;
}

/* 音频占位符样式 */
.audio-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 120px;
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.audio-placeholder.loaded {
    opacity: 1;
}

.audio-placeholder svg {
    width: 48px;
    height: 48px;
    opacity: 0.8;
}

/* 文件夹中的视频占位符 */
.folder-cover .video-placeholder {
    min-height: 100%;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.folder-cover .video-placeholder svg {
    width: 36px;
    height: 36px;
}

/* 视频播放图标覆盖层 */
.video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease, background 0.2s ease;
}

.video-play-icon svg {
    width: 18px;
    height: 18px;
    margin-left: 2px;
}

.media-item:hover .video-play-icon,
.folder-card:hover .video-play-icon {
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(37, 99, 235, 0.9);
}

/* 视频缩略图样式 */
.folder-cover video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.media-thumb video {
    display: block;
    width: 100%;
    height: auto;
    min-height: 120px;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.media-thumb video.loaded,
.folder-cover video.loaded {
    opacity: 1;
}

.media-type {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 5px 12px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.95) 0%, rgba(59, 130, 246, 0.95) 100%);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ==================== 加载状态 ==================== */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 20px;
    color: var(--text-muted);
    gap: 16px;
    width: 100%;
}

.spinner {
    width: 48px;
    height: 48px;
    position: relative;
    display: inline-block;
}

.spinner::before,
.spinner::after {
    content: '';
    position: absolute;
    border-radius: 50%;
}

.spinner::before {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    animation: spin 0.8s linear infinite;
}

.spinner::after {
    width: 48px;
    height: 48px;
    border: 3px solid transparent;
    border-radius: 50%;
    border-top-color: var(--primary-light);
    animation: spin 1.2s linear infinite;
    opacity: 0.5;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading p {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 100px 20px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    width: 96px;
    height: 96px;
    margin: 0 auto 24px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state .empty-icon svg {
    width: 40px;
    height: 40px;
    color: var(--text-light);
}

.empty-state h3 {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 10px;
    font-weight: 600;
}

.empty-state p {
    font-size: 15px;
    color: var(--text-muted);
}

/* 加载更多 */
.load-more {
    text-align: center;
    padding: 48px 20px;
}

.btn-secondary {
    padding: 14px 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.btn-secondary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, var(--primary-subtle) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-secondary:hover {
    background: var(--bg-card);
    border-color: var(--primary);
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.15);
    transform: translateY(-2px);
    color: var(--primary);
}

.btn-secondary:hover::before {
    opacity: 1;
}

.btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* ==================== 模态框 ==================== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    animation: scaleIn 0.2s ease;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-close {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 1002;
    width: 44px;
    height: 44px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    line-height: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.9);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.modal-body {
    max-width: 80vw;
    max-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
}

.modal-body img, .modal-body video {
    max-width: 100%;
    max-height: 70vh;
    display: block;
}

.modal-info {
    padding: 24px 28px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
}

.modal-info h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.modal-info .meta {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

.modal-info .actions {
    display: flex;
    gap: 12px;
}

.modal-info .btn-primary {
    width: auto;
    padding: 12px 24px;
    font-size: 15px;
}

/* ==================== 图片查看器 ==================== */
.modal-viewer {
    position: fixed;
    inset: 0;
    z-index: 1001;
    display: flex;
    flex-direction: column;
}

.viewer-container {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 只为图片启用抓手光标 */
.viewer-container.image-viewer {
    cursor: grab;
}

.viewer-container.image-viewer.dragging {
    cursor: grabbing;
}

.viewer-canvas {
    position: relative;
    transition: transform 0.2s ease;
    transform-origin: center center;
}

.viewer-canvas img {
    display: block;
    max-width: none;
    height: auto;
    user-select: none;
    pointer-events: none;
}

.viewer-canvas video {
    display: block;
    max-width: 90vw;
    max-height: 80vh;
}
/* DPlayer 容器样式 */
#dplayer {
    width: 80vw;
    height: 80vh;
    max-width: 1200px;
    background: #000;
    box-shadow: var(--shadow-xl);
    border-radius: var(--radius-md);
}

@media (max-width: 768px) {
    #dplayer {
        width: 80vw;
        height: 45vw; /* 16:9 aspect ratio for 80vw */
        max-height: 80vh;
        border-radius: var(--radius-md);
    }
    
    /* 隐藏页面全屏按钮（移动设备上不需要） */
    .dplayer-full-in-icon {
        display: none !important;
    }
}

/* 左右切换按钮 */
.viewer-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1002;
    width: 56px;
    height: 56px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.viewer-nav-left {
    left: 32px;
}

.viewer-nav-right {
    right: 32px;
}

.viewer-nav svg {
    width: 28px;
    height: 28px;
}

.viewer-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.viewer-nav:active {
    transform: translateY(-50%) scale(0.95);
}

/* 全屏按钮 */
.viewer-fullscreen {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 1002;
    width: 52px;
    height: 52px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    color: white;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.viewer-fullscreen svg {
    width: 22px;
    height: 22px;
}

.viewer-fullscreen:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.viewer-fullscreen:active {
    transform: scale(0.95);
}

/* ==================== 通知 ==================== */
.notification {
    position: fixed;
    bottom: 28px;
    right: 28px;
    padding: 18px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.12), 0 4px 8px rgba(0, 0, 0, 0.08);
    z-index: 2000;
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 15px;
    color: var(--text-primary);
    min-width: 320px;
    font-weight: 500;
    backdrop-filter: blur(12px);
}

.notification.success {
    border-left: 4px solid var(--success);
    background: linear-gradient(to right, #f0fdf4 0%, var(--bg-card) 100%);
}

.notification.error {
    border-left: 4px solid var(--error);
    background: linear-gradient(to right, #fef2f2 0%, var(--bg-card) 100%);
}

@keyframes slideIn {
    from {
        transform: translateX(calc(100% + 28px));
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==================== 响应式设计 ==================== */

/* 大屏幕 (>1400px) */
@media (min-width: 1400px) {
    .folders-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 24px;
    }
    
    .media-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 24px;
    }
    
    .media-grid.detail-view {
        grid-template-columns: repeat(5, 1fr);
        gap: 24px;
        width: 80%;
        max-width: 1120px;
    }
}

/* 平板设备 (768px - 1024px) */
@media (max-width: 1024px) {
    .main-content {
        padding: 40px 24px;
        max-width: 100%;
    }
    
    .header-content {
        padding: 0 24px;
    }
    
    .folders-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 16px;
    }
    
    .media-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }
    
    .media-grid.detail-view {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
        width: 90%;
    }
}

/* 移动设备 (< 768px) - 2列布局 */
@media (max-width: 768px) {
    .login-container {
        padding: 36px 28px;
        max-width: 100%;
    }
    
    .login-header h1 {
        font-size: 24px;
    }
    
    .header-content {
        padding: 0 20px;
        height: 64px;
    }
    
    .brand-text {
        font-size: 18px;
    }
    
    .main-content {
        padding: 24px 16px;
    }
    
    /* 首页文件夹 - 2列 */
    .folders-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .folder-meta {
        padding: 10px 12px;
    }
    
    .folder-name {
        font-size: 11px;
        top: 8px;
        right: 8px;
        padding: 3px 8px;
        max-width: calc(50% - 10px);
    }
    
    .folder-signature {
        font-size: 12px;
    }
    
    .folder-count {
        font-size: 11px;
        padding: 4px 10px;
        top: 8px;
        left: 8px;
    }
    
    /* 详情页 - 3列，移动设备使用100%宽度 */
    .media-grid,
    .media-grid.detail-view {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        width: 100%;
    }
    
    .media-type {
        padding: 4px 8px;
        font-size: 9px;
        top: 8px;
        left: 8px;
    }
    
    .modal-content {
        max-width: 95vw;
        max-height: 95vh;
        border-radius: var(--radius-lg);
    }
    
    .modal-body {
        max-width: 95vw;
        max-height: 60vh;
    }
    
    .modal-close {
        top: 16px;
        right: 16px;
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
    
    .modal-info {
        padding: 20px 24px;
    }
    
    .notification {
        left: 20px;
        right: 20px;
        bottom: 20px;
        min-width: auto;
    }
}

/* 小屏幕手机 (< 480px) - 2列布局 */
@media (max-width: 480px) {
    .login-container {
        padding: 32px 24px;
    }
    
    .header-content {
        padding: 0 16px;
        height: 60px;
    }
    
    .brand-text {
        font-size: 16px;
    }
    
    .main-content {
        padding: 20px 12px;
    }
    
    /* 首页文件夹 - 2列 */
    .folders-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .folder-meta {
        padding: 8px 10px;
    }
    
    .folder-name {
        font-size: 10px;
        top: 6px;
        right: 6px;
        padding: 2px 6px;
        max-width: calc(50% - 8px);
    }
    
    .folder-signature {
        font-size: 11px;
    }
    
    .folder-count {
        font-size: 10px;
        padding: 3px 8px;
        top: 6px;
        left: 6px;
    }
    
    .folder-placeholder svg {
        width: 40px;
        height: 40px;
    }
    
    /* 详情页 - 2列，移动设备使用100%宽度 */
    .media-grid,
    .media-grid.detail-view {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        width: 100%;
    }
    
    .media-type {
        padding: 3px 6px;
        font-size: 8px;
        top: 6px;
        left: 6px;
    }
    
    .media-placeholder svg {
        width: 32px;
        height: 32px;
    }
}

/* 滚动条美化 - 现代风格 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: var(--radius-full);
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
    background-clip: content-box;
}

/* 禁止选中文本 - 移除选中样式 */
::selection {
    background: transparent;
    color: inherit;
}

::-moz-selection {
    background: transparent;
    color: inherit;
}

/* 焦点样式 */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* 平滑滚动 */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}
/* ==================== DPlayer 自定义样式 ==================== */
/* 视频画质微调 - 略微增加对比度和饱和度 */
.dplayer-video-wrap video {
    filter: contrast(1.02) saturate(1.05);
}

/* ==================== 视频播放器性能优化 ==================== */
/* 启用硬件加速和GPU渲染 */
#dplayer,
#dplayer video,
.dplayer-video-wrap,
.dplayer-video {
    /* 启用硬件加速 */
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    
    /* 强制GPU渲染 */
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-perspective: 1000px;
    perspective: 1000px;
    
    /* 优化合成层 */
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
}

/* 进度条拖拽优化 */
.dplayer-controller .dplayer-bar-wrap {
    /* 提升拖拽流畅度 */
    will-change: transform, width;
    contain: layout style paint;
}

.dplayer-controller .dplayer-bar-wrap .dplayer-bar {
    /* 确保进度条更新流畅 */
    transition: none;
}

/* 控制栏性能优化 */
.dplayer-controller {
    /* 减少重绘 */
    will-change: opacity, transform;
    contain: layout style;
}

/* 视频容器优化 */
.dplayer-video-wrap {
    /* 隔离渲染层 */
    isolation: isolate;
    contain: strict;
}

/* 优化seeking时的性能 */
.dplayer-video-wrap video[seeking] {
    /* seeking时使用更快的渲染 */
    image-rendering: optimizeSpeed;
    image-rendering: -webkit-optimize-contrast;
}

/* 弹幕层性能优化(如果启用弹幕) */
.dplayer-danmaku {
    will-change: transform;
    contain: layout style paint;
}

/* 减少不必要的渲染 */
.dplayer-mask,
.dplayer-video-wrap .dplayer-video-current,
.dplayer-bezel {
    pointer-events: none;
}