/* ===== 基础重置和变量 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 主色调 - 科技感渐变 */
    --primary-color: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --accent-color: #06b6d4;
    
    /* 背景色 - 深邃太空感 */
    --bg-dark: #020617;
    --bg-card: #0f172a;
    --bg-hover: #1e293b;
    --bg-elevated: #334155;
    
    /* 文字色 */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* 边框与分割 */
    --border-color: rgba(148, 163, 184, 0.1);
    --border-light: rgba(148, 163, 184, 0.05);
    
    /* 功能色 */
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;
    
    /* 尺寸 */
    --header-height: 64px;
    --bottom-nav-height: 64px;
    --filter-bar-height: 48px;
    
    /* 动画 */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
}

/* ===== 媒体网格 ===== */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 16px;
    width: 100%;
}

.media-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-card);
    aspect-ratio: 1;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    pointer-events: auto;
}

.media-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.media-card:active {
    transform: scale(0.98);
}

.media-card .media-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    z-index: 1;
    transition: opacity 0.3s ease;
}

.media-card .media-video-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    pointer-events: none;
}

.media-card .media-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    opacity: 0;
    pointer-events: none !important;
    visibility: hidden;
    transition: all var(--transition-fast);
}

.media-card:hover .media-actions {
    opacity: 1;
    visibility: visible;
    pointer-events: auto !important;
}

/* 底部操作栏按钮样式 */
.media-card .media-actions button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast);
}

.media-card .media-actions button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.media-card .media-actions button.favorite-active {
    background: rgba(245, 158, 11, 0.8);
}

.media-card .skeleton {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-elevated) 50%, var(--bg-hover) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    pointer-events: none;
}

/* 移动端骨架屏优化 */
@media (max-width: 768px) {
    .media-card .skeleton {
        animation-duration: 1s; /* 加快动画速度 */
    }
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }

}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

/* ===== 页面加载提示 ===== */
.page-loading {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    gap: 16px;
    backdrop-filter: blur(8px);
    transition: opacity 0.3s ease;
}
.page-loading p {
    color: var(--text-primary);
    font-size: 14px;
    margin-top: 12px;
    animation: loading-pulse 1.5s ease-in-out infinite;
}
@keyframes loading-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}
.page-loading .loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-right-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    position: relative;
}
.page-loading .loading-spinner::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    border: 2px solid transparent;
    border-bottom-color: var(--primary-light);
    border-radius: 50%;
    animation: spin 1.2s linear infinite reverse;
}

.loading-users {
    padding: 24px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}
.loading-users.error {
    color: #ef4444;
}

/* ===== 登录页面 ===== */
.login-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at top, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(6, 182, 212, 0.1) 0%, transparent 50%),
        linear-gradient(135deg, var(--bg-dark) 0%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* 粒子背景 */
.login-page::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(6, 182, 212, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 60% 20%, rgba(6, 182, 212, 0.1) 0%, transparent 50%);
    animation: particleFloat 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes particleFloat {
    0%, 100% { 
        transform: translate(0, 0) scale(1);
        opacity: 0.5;
    }
    25% { 
        transform: translate(30px, -30px) scale(1.1);
        opacity: 0.7;
    }
    50% { 
        transform: translate(-20px, 20px) scale(0.9);
        opacity: 0.6;
    }
    75% { 
        transform: translate(20px, 30px) scale(1.05);
        opacity: 0.8;
    }
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 80% 20%, rgba(6, 182, 212, 0.1) 0%, transparent 40%);
    animation: gradientRotate 20s linear infinite;
}

@keyframes gradientRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.login-container {
    text-align: center;
    padding: 48px;
    max-width: 420px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: 
        var(--shadow-lg), 
        var(--shadow-glow),
        0 0 80px rgba(99, 102, 241, 0.15);
    position: relative;
    z-index: 1;
    animation: containerFloat 6s ease-in-out infinite;
}

@keyframes containerFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    animation: logoFloat 3s ease-in-out infinite, logoGlow 2s ease-in-out infinite alternate;
    filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.5));
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

@keyframes logoGlow {
    from { filter: drop-shadow(0 0 20px rgba(99, 102, 241, 0.5)); }
    to { filter: drop-shadow(0 0 30px rgba(99, 102, 241, 0.8)); }
}

.login-container h1 {
    font-size: 32px;
    margin-bottom: 8px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent-color) 50%, var(--primary-light) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    animation: titleShimmer 3s ease-in-out infinite;
}

@keyframes titleShimmer {
    0%, 100% { 
        background-position: 0% 50%;
        filter: brightness(1);
    }
    50% { 
        background-position: 100% 50%;
        filter: brightness(1.2);
    }
}

.login-subtitle {
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-size: 15px;
    letter-spacing: 0.5px;
    animation: subtitleFadeIn 1s ease-out;
}

@keyframes subtitleFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-selector {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

/* 3D立体轮播容器 */
.user-carousel {
    position: relative;
    width: 100%;
    height: 300px;
    perspective: 2000px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
}

/* 科技感背景网格 */
.user-carousel::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 400px;
    background-image: 
        linear-gradient(rgba(99, 102, 241, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 8s linear infinite;
    pointer-events: none;
    mask-image: radial-gradient(ellipse 70% 50% at 50% 50%, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 70% 50% at 50% 50%, black 20%, transparent 70%);
}

@keyframes gridMove {
    0% { transform: translate(-50%, -50%) rotateX(60deg) translateY(0); }
    100% { transform: translate(-50%, -50%) rotateX(60deg) translateY(50px); }
}

.carousel-container {
    position: relative;
    width: 300px;
    height: 260px;
    transform-style: preserve-3d;
}

.carousel-item {
    position: absolute;
    width: 260px;
    left: 50%;
    top: 50%;
    transform-origin: center center;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
}

/* 中间激活状态 - 最大最清晰，带发光 */
.carousel-item-active {
    transform: translate(-50%, -50%) translateZ(120px) scale(1.2);
    z-index: 10;
    opacity: 1;
    filter: brightness(1.1);
}

/* 前一个 - 左侧缩小倾斜 */
.carousel-item-prev {
    transform: translate(-140%, -50%) translateZ(-150px) rotateY(40deg) scale(0.75);
    z-index: 5;
    opacity: 0.5;
    filter: brightness(0.7) saturate(0.8);
}

/* 后一个 - 右侧缩小倾斜 */
.carousel-item-next {
    transform: translate(40%, -50%) translateZ(-150px) rotateY(-40deg) scale(0.75);
    z-index: 5;
    opacity: 0.5;
    filter: brightness(0.7) saturate(0.8);
}

/* 更远的左侧 */
.carousel-item-far-left {
    transform: translate(-210%, -50%) translateZ(-300px) rotateY(55deg) scale(0.55);
    z-index: 1;
    opacity: 0.15;
    filter: brightness(0.5) saturate(0.5);
    pointer-events: none;
}

/* 更远的右侧 */
.carousel-item-far-right {
    transform: translate(110%, -50%) translateZ(-300px) rotateY(-55deg) scale(0.55);
    z-index: 1;
    opacity: 0.15;
    filter: brightness(0.5) saturate(0.5);
    pointer-events: none;
}

/* 隐藏状态 */
.carousel-item-hidden {
    transform: translate(-50%, -50%) translateZ(-400px) scale(0.4);
    z-index: 0;
    opacity: 0;
    pointer-events: none;
}

/* 选中状态高亮 - 霓虹发光 + 全息边框 */
.carousel-item.selected .user-card-3d {
    border-color: transparent;
    background: rgba(99, 102, 241, 0.25);
    box-shadow: 
        0 0 20px rgba(99, 102, 241, 0.6),
        0 0 40px rgba(99, 102, 241, 0.4),
        0 0 60px rgba(99, 102, 241, 0.2),
        inset 0 0 20px rgba(99, 102, 241, 0.1);
    animation: neonPulse 2s ease-in-out infinite;
    background-image: 
        linear-gradient(rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.9)),
        linear-gradient(90deg, 
            rgba(99, 102, 241, 0.8), 
            rgba(6, 182, 212, 0.8), 
            rgba(99, 102, 241, 0.8)
        );
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

@keyframes neonPulse {
    0%, 100% { 
        box-shadow: 
            0 0 20px rgba(99, 102, 241, 0.6),
            0 0 40px rgba(99, 102, 241, 0.4),
            0 0 60px rgba(99, 102, 241, 0.2),
            inset 0 0 20px rgba(99, 102, 241, 0.1);
    }
    50% { 
        box-shadow: 
            0 0 30px rgba(99, 102, 241, 0.8),
            0 0 60px rgba(99, 102, 241, 0.5),
            0 0 90px rgba(99, 102, 241, 0.3),
            inset 0 0 30px rgba(99, 102, 241, 0.2);
    }
}

/* 3D用户卡片 */
.user-card-3d {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 32px 28px;
    background: rgba(15, 23, 42, 0.9);
    border: 2px solid rgba(99, 102, 241, 0.3);
    border-radius: 24px;
    backdrop-filter: blur(16px);
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 2px 8px rgba(99, 102, 241, 0.1);
    position: relative;
    overflow: hidden;
}

/* 全息扫描线效果 */
.user-card-3d::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(99, 102, 241, 0.1) 45%,
        rgba(99, 102, 241, 0.3) 50%,
        rgba(99, 102, 241, 0.1) 55%,
        transparent 100%
    );
    animation: hologramScan 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes hologramScan {
    0% { top: -100%; }
    100% { top: 100%; }
}

/* 卡片顶部光条 */
.user-card-3d::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.8), rgba(6, 182, 212, 0.8), transparent);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    50% { left: 100%; }
    100% { left: 100%; }
}

.user-card-3d:hover {
    background: rgba(15, 23, 42, 0.95);
    border-color: rgba(99, 102, 241, 0.6);
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(99, 102, 241, 0.3);
}

/* 激活卡片的浮动动画 */
.carousel-item-active .user-card-3d {
    animation: floatCard 3s ease-in-out infinite;
}

@keyframes floatCard {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.user-card-3d .avatar {
    font-size: 56px;
    line-height: 1;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
    animation: avatarGlow 2s ease-in-out infinite alternate;
    position: relative;
}

/* 头像光环效果 */
.user-card-3d .avatar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80px;
    height: 80px;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(99, 102, 241, 0.4);
    border-radius: 50%;
    animation: avatarRing 3s ease-in-out infinite;
    pointer-events: none;
}

.user-card-3d .avatar::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    transform: translate(-50%, -50%);
    border: 1px dashed rgba(6, 182, 212, 0.3);
    border-radius: 50%;
    animation: avatarRingReverse 4s linear infinite;
    pointer-events: none;
}

@keyframes avatarRing {
    0%, 100% { 
        width: 80px; 
        height: 80px;
        opacity: 0.4;
        border-color: rgba(99, 102, 241, 0.4);
    }
    50% { 
        width: 90px; 
        height: 90px;
        opacity: 0.8;
        border-color: rgba(6, 182, 212, 0.6);
    }
}

@keyframes avatarRingReverse {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes avatarGlow {
    from { filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4)); }
    to { filter: drop-shadow(0 4px 20px rgba(99, 102, 241, 0.5)); }
}

.user-card-3d .name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* 导航按钮 - 赛博朋克风格 */
.carousel-nav {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.8);
    border: 2px solid rgba(99, 102, 241, 0.4);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    backdrop-filter: blur(10px);
    z-index: 20;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.3),
        inset 0 0 20px rgba(99, 102, 241, 0.1);
    position: relative;
    overflow: hidden;
}

/* 按钮角落装饰 */
.carousel-nav::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 8px;
    height: 8px;
    border-top: 2px solid rgba(99, 102, 241, 0.6);
    border-left: 2px solid rgba(99, 102, 241, 0.6);
    transition: all 0.3s ease;
}

.carousel-nav::after {
    content: '';
    position: absolute;
    bottom: 3px;
    right: 3px;
    width: 8px;
    height: 8px;
    border-bottom: 2px solid rgba(99, 102, 241, 0.6);
    border-right: 2px solid rgba(99, 102, 241, 0.6);
    transition: all 0.3s ease;
}

.carousel-nav:hover {
    background: rgba(99, 102, 241, 0.3);
    border-color: var(--primary-color);
    transform: scale(1.15);
    box-shadow: 
        0 0 20px rgba(99, 102, 241, 0.5),
        0 0 40px rgba(99, 102, 241, 0.3),
        inset 0 0 30px rgba(99, 102, 241, 0.2);
}

.carousel-nav:hover::before,
.carousel-nav:hover::after {
    width: 12px;
    height: 12px;
    border-color: rgba(6, 182, 212, 0.8);
}

.carousel-nav:active {
    transform: scale(0.95);
}

/* 指示器 - 发光效果 + 科技风格 */
.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
    position: relative;
}

/* 指示器背景线 */
.carousel-indicators::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.3), transparent);
    transform: translateY(-50%);
    pointer-events: none;
}

.indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: rgba(148, 163, 184, 0.2);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(148, 163, 184, 0.1);
    position: relative;
}

.indicator-dot:hover {
    background: rgba(148, 163, 184, 0.5);
    transform: scale(1.4);
    border-color: rgba(99, 102, 241, 0.4);
}

.indicator-dot.active {
    background: linear-gradient(135deg, var(--primary-color), rgba(6, 182, 212, 0.9));
    width: 32px;
    border-radius: 4px;
    box-shadow: 
        0 0 10px rgba(99, 102, 241, 0.8),
        0 0 20px rgba(99, 102, 241, 0.4);
    animation: indicatorPulse 2s ease-in-out infinite;
    border-color: transparent;
    position: relative;
}

/* 激活指示器光效 */
.indicator-dot.active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    animation: dotCore 2s ease-in-out infinite;
}

@keyframes indicatorPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(99, 102, 241, 0.8), 0 0 20px rgba(99, 102, 241, 0.4); }
    50% { box-shadow: 0 0 15px rgba(99, 102, 241, 1), 0 0 30px rgba(99, 102, 241, 0.6); }
}

@keyframes dotCore {
    0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
}

/* 用户分组 */
.user-group {
    margin-bottom: 8px;
}

.user-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    margin-bottom: 12px;
}

.group-icon {
    font-size: 16px;
}

.user-group-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

/* 角色徽章 */
.role-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    margin-top: 4px;
}

.role-badge.admin {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
}

.role-badge.child {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.role-badge.member {
    background: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
}

.role-badge.guest {
    background: rgba(251, 146, 60, 0.2);
    color: #fb923c;
}

.password-input {
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: slideUp 0.3s ease;
}

.password-input input {
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 18px;
    text-align: center;
    letter-spacing: 8px;
    outline: none;
}

.password-input input:focus {
    border-color: var(--primary-color);
}

.btn-login {
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.btn-login::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;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-login:hover::before {
    left: 100%;
}

.login-hint {
    margin-top: 32px;
    color: var(--text-muted);
    font-size: 12px;
    letter-spacing: 0.5px;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 应用容器 ===== */
.app-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* ===== 顶部导航栏 ===== */
.header {
    height: var(--header-height);
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    position: relative;
}

.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.3), transparent);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.current-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-card);
    border-radius: 20px;
}

.current-user .user-avatar {
    font-size: 24px;
}

.current-user .user-name {
    font-size: 14px;
    font-weight: 500;
}

.space-switcher {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    padding: 4px;
    border-radius: 20px;
}

.space-btn {
    padding: 6px 14px;
    background: transparent;
    border: none;
    border-radius: 16px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.space-btn.active {
    background: var(--primary-color);
    color: white;
}

.header-actions {
    display: flex;
    gap: 8px;
}

.btn-upload {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 24px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-upload:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-upload:active {
    transform: translateY(0) scale(0.98);
}

.btn-upload:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-upload svg {
    width: 18px;
    height: 18px;
}

.btn-switch-user {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-switch-user:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.btn-switch-user svg {
    width: 20px;
    height: 20px;
}

/* 移动端汉堡菜单按钮 - 桌面端隐藏 */
.btn-mobile-menu {
    display: none;
}

/* 移动端功能下拉菜单 - 桌面端隐藏 */
.mobile-menu-dropdown {
    display: none;
}

/* ===== 拖拽上传区域 ===== */
.drop-zone {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(2, 6, 23, 0.95);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    border: 3px dashed rgba(99, 102, 241, 0.3);
    transition: all var(--transition-normal);
}

.drop-zone.active {
    display: flex;
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.drop-zone-content {
    text-align: center;
    color: var(--text-primary);
}

.drop-zone-content svg {
    width: 80px;
    height: 80px;
    margin-bottom: 24px;
    color: var(--primary-color);
    animation: bounce 2s ease-in-out infinite;
}

.drop-zone-content p {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.drop-zone-content span {
    font-size: 14px;
    color: var(--text-secondary);
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ===== 自动上传面板 ===== */
.auto-upload-panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 420px;
    height: 100%;
    background: rgba(15, 23, 42, 0.98);
    z-index: 2000;
    transition: right var(--transition-normal);
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-color);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
}

.auto-upload-panel.show {
    right: 0;
}

.auto-upload-status {
    margin-top: 24px;
    padding: 16px;
    background: rgba(30, 41, 59, 0.5);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.auto-upload-status p {
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
}

.auto-upload-status.active p {
    color: var(--success-color);
}

.auto-upload-status.active::before {
    content: '● ';
    color: var(--success-color);
    animation: pulse 2s ease-in-out infinite;
}

/* select 样式 */
select {
    padding: 8px 16px;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    outline: none;
}

select:focus {
    border-color: var(--primary-color);
}

/* ===== 上传提示 ===== */
.upload-tips {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 12px 16px;
    background: rgba(99, 102, 241, 0.05);
    border-bottom: 1px solid var(--border-color);
}

.upload-tip-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.upload-tip-item svg {
    width: 14px;
    height: 14px;
}

.upload-tip-divider {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--text-muted);
}

@media (max-width: 480px) {
    .upload-tips {
        gap: 8px;
        padding: 10px 12px;
    }
    
    .upload-tip-item span {
        display: none;
    }
}

/* ===== 搜索栏 ===== */
.search-bar {
    padding: 12px 16px;
    background: rgba(2, 6, 23, 0.6);
    border-bottom: 1px solid var(--border-color);
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-bar input {
    width: 100%;
    padding: 12px 40px 12px 42px;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all var(--transition-normal);
}

.search-bar input:focus {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.search-clear {
    position: absolute;
    right: 12px;
    width: 20px;
    height: 20px;
    padding: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast);
}

.search-clear:hover {
    color: var(--text-primary);
}

/* ===== 筛选标签栏 ===== */
.filter-bar {
    height: var(--filter-bar-height);
    background: rgba(2, 6, 23, 0.6);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid var(--border-color);
}

.filter-bar::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    flex-shrink: 0;
    padding: 8px 16px;
    background: rgba(30, 41, 59, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.filter-btn:hover:not(.active) {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
}

/* 排序下拉菜单 */
.sort-dropdown {
    position: relative;
    margin-left: auto;
}

.sort-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(30, 41, 59, 0.3);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sort-btn:hover {
    background: rgba(30, 41, 59, 0.6);
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.sort-btn svg {
    width: 18px;
    height: 18px;
}

.sort-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 0;
    min-width: 120px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    z-index: 100;
}

.sort-dropdown:hover .sort-menu,
.sort-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sort-item {
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sort-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
}

/* ===== 主内容区域 ===== */
.main-content {
    flex: 1;
    overflow-y: auto; /* 允许垂直滚动 */
    overflow-x: hidden; /* 禁止水平滚动 */
    position: relative;
    min-height: 0; /* 关键：允许 flex 子项缩小 */
}

/* ===== 抖音式滑动容器 ===== */
.swiper {
    width: 100%;
    height: 100%;
}

.swiper-wrapper {
    height: 100%;
}

.swiper-slide {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    overflow: hidden;
}

/* 媒体内容 */
.media-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-container img,
.media-container video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.5) 0%, rgba(15, 23, 42, 0.5) 100%);
}

/* 懒加载占位 */
.lazy-media {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lazy-media.loaded {
    opacity: 1 !important;
}

.lazy-media.error {
    opacity: 0.3;
}

/* 骨架屏占位符 */
.skeleton-placeholder {
    background: linear-gradient(
        90deg,
        rgba(30, 41, 59, 0.3) 25%,
        rgba(51, 65, 85, 0.3) 50%,
        rgba(30, 41, 59, 0.3) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.media-container video {
    background: #000;
}

/* 视频容器 */
.video-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-container video {
    max-width: 100%;
    max-height: 100%;
}

/* 视频控制条 */
.video-controls {
    position: absolute;
    bottom: 80px;
    left: 16px;
    right: 80px;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.video-controls.show {
    opacity: 1;
    pointer-events: auto;
}

.swiper-slide-active .video-controls {
    opacity: 1;
    pointer-events: auto;
}

.video-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    cursor: pointer;
    margin-bottom: 8px;
    position: relative;
}

.video-progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 2px;
    transition: width 0.1s linear;
    width: 0%;
}

.video-time {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
}

/* 视频播放按钮覆盖层 */
.video-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.video-play-overlay.playing {
    opacity: 0;
}

.video-play-overlay:hover {
    background: rgba(0, 0, 0, 0.8);
}

.video-play-overlay svg {
    width: 40px;
    height: 40px;
    fill: white;
}

.video-play-overlay.playing svg {
    display: none;
}

/* 动态图标识 */
.media-container .gif-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 8px;
    background: rgba(0,0,0,0.7);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

/* 媒体信息覆盖层 */
.media-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 60px 16px 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    pointer-events: none;
}

.media-info {
    pointer-events: auto;
}

.media-date {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.media-location {
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}

.media-location svg {
    width: 14px;
    height: 14px;
}

.media-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.tag {
    padding: 4px 10px;
    background: rgba(255,255,255,0.15);
    border-radius: 12px;
    font-size: 12px;
    color: var(--text-primary);
}

.tag.person {
    background: var(--primary-color);
}

.tag.shared {
    background: var(--success-color);
}

.media-meta {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* 操作按钮 - 通用样式（用于Swiper查看器等） */
.media-viewer-actions {
    position: absolute;
    right: 16px;
    bottom: 100px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-normal);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.action-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
    transform: scale(1.1);
    box-shadow: var(--shadow-glow);
}

.action-btn:hover::before {
    opacity: 1;
}

.action-btn svg {
    width: 20px;
    height: 20px;
}

.action-btn.active {
    background: var(--success-color);
    border-color: var(--success-color);
}

/* ===== 空状态 ===== */
.empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--text-secondary);
    display: none;
}

.empty-state.show {
    display: block;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 8px;
}

.empty-sub {
    font-size: 13px;
    opacity: 0.7;
}

/* ===== 底部导航 ===== */
.bottom-nav {
    height: var(--bottom-nav-height);
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid var(--border-color);
    z-index: 1000;
    position: relative;
}

.bottom-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.2), transparent);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

.nav-item span {
    font-size: 11px;
}

.nav-item.active {
    color: var(--primary-light);
}

.nav-item.active svg {
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.5));
}

.nav-item:hover:not(.active) {
    color: var(--text-primary);
}

/* ===== 面板样式 ===== */
.panel {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 420px;
    height: 100%;
    background: rgba(15, 23, 42, 0.98);
    z-index: 2000;
    transition: right var(--transition-normal);
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-color);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    visibility: hidden; /* 默认隐藏 */
}

.panel.show {
    right: 0;
    visibility: visible; /* 显示时可见 */
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.panel-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.btn-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-close:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* 人物列表 */
.person-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.person-item:hover {
    background: rgba(255,255,255,0.1);
}

.person-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
}

.person-info {
    flex: 1;
}

.person-name {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 2px;
}

.person-count {
    font-size: 13px;
    color: var(--text-secondary);
}

/* 相册列表 */
.album-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    cursor: pointer;
    aspect-ratio: 16/10;
}

.album-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.album-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}

.album-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.album-meta {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ===== 设置项 ===== */
.setting-group {
    margin-bottom: 24px;
}

.setting-group h4 {
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
}

.setting-item span {
    font-size: 15px;
}

/* 开关 */
.switch {
    position: relative;
    width: 50px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--border-color);
    border-radius: 28px;
    transition: 0.3s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

input:checked + .slider {
    background: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

/* 按钮 */
.btn-primary {
    padding: 12px 24px;
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    padding: 12px 24px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.1);
}

.btn-secondary:active {
    transform: scale(0.98);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-danger {
    padding: 8px 16px;
    background: var(--danger-color);
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    opacity: 0.9;
}

.btn-danger:active {
    transform: scale(0.98);
}

.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 统计信息 */
.stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    background: rgba(255,255,255,0.05);
    border-radius: 12px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== 弹窗 ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    padding: 16px;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideUp var(--transition-normal);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
}

@keyframes modalSlideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 17px;
    font-weight: 600;
}

.modal-body {
    padding: 16px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.modal-footer button {
    flex: 1;
}

/* 文件数量 */
.file-count {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* 上传预览 */
.upload-preview {
    max-height: 240px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding: 12px;
    background: rgba(30, 41, 59, 0.3);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.upload-preview:empty {
    display: none;
}

.upload-preview::-webkit-scrollbar {
    width: 4px;
}

.upload-preview::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 2px;
}

.upload-preview-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 8px;
    margin-bottom: 8px;
    background: rgba(30, 41, 59, 0.5);
}

.upload-preview-item:last-child {
    margin-bottom: 0;
}

.upload-preview-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--bg-hover);
}

.upload-preview-info {
    flex: 1;
    min-width: 0;
}

.upload-preview-name {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-preview-size {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 上传选项 */
.upload-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.upload-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 24px;
    background: rgba(255,255,255,0.05);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-option:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--primary-color);
}

.option-icon {
    font-size: 32px;
}

.option-title {
    font-size: 16px;
    font-weight: 600;
}

.option-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

/* 表单 */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.person-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.file-info-display {
    padding: 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== 加载遮罩 ===== */
.loading-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(2, 6, 23, 0.95);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 5000;
    backdrop-filter: blur(10px);
}

.loading-mask.show {
    display: flex;
}

.loading-spinner {
    width: 56px;
    height: 56px;
    border: 3px solid transparent;
    border-top-color: var(--primary-color);
    border-right-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: relative;
}

.loading-spinner::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 2px solid transparent;
    border-bottom-color: var(--primary-light);
    border-radius: 50%;
    animation: spin 1.5s linear infinite reverse;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-mask p {
    margin-top: 16px;
    color: var(--text-secondary);
    font-size: 14px;
}

.progress-bar {
    width: 280px;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    margin-top: 16px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: progress-shimmer 1.5s infinite;
}

@keyframes progress-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ===== Toast 提示 ===== */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 14px 28px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border-color);
    border-radius: 28px;
    font-size: 14px;
    color: var(--text-primary);
    opacity: 0;
    transition: all var(--transition-normal);
    z-index: 6000;
    pointer-events: none;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-lg);
}

.toast.success {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.1);
}

.toast.error {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.1);
}

.toast.warning {
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.1);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ===== 日期分组视图 ===== */
.date-group {
    margin-bottom: 24px;
}

.date-header {
    font-size: 14px;
    color: var(--text-secondary);
    padding: 8px 16px;
    background: rgba(255,255,255,0.05);
    margin-bottom: 8px;
    border-radius: 8px;
}

.date-items {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.grid-item {
    aspect-ratio: 1;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    cursor: pointer;
}

.grid-item img,
.grid-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.grid-item.video::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 0 8px 14px;
    border-color: transparent transparent transparent white;
}

/* ===== 响应式适配 ===== */
@media (min-width: 768px) {
    .media-container {
        max-width: 600px;
        margin: 0 auto;
    }
    
    .date-items {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1024px) {
    .date-items {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ===== 滚动条样式 ===== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.5);
}

/* 移动端隐藏滚动条（更简洁） */
@media (max-width: 768px) {
    ::-webkit-scrollbar {
        width: 0;
        height: 0;
    }
    
    * {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
}

/* ===== 选中效果 ===== */
::selection {
    background: rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
}

/* ===== 聚焦效果 ===== */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===== 图片加载动画 ===== */
.lazy-media {
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.lazy-media.loaded {
    opacity: 1;
}

/* ===== 批量选择模式 ===== */
.select-mode .swiper-slide {
    cursor: pointer;
}

.swiper-slide.selected {
    position: relative;
}

.swiper-slide.selected::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 3px solid var(--primary-color);
    pointer-events: none;
    z-index: 10;
}

.select-checkbox {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 28px;
    height: 28px;
    border: 2px solid rgba(255,255,255,0.5);
    border-radius: 50%;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    font-weight: bold;
    z-index: 20;
    transition: all var(--transition-fast);
}

.select-checkbox.checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* 批量操作栏 */
.batch-operations-bar {
    position: fixed;
    bottom: var(--bottom-nav-height);
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1500;
    transform: translateY(100%);
    transition: transform var(--transition-normal);
}

.batch-operations-bar.show {
    transform: translateY(0);
}

.batch-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.batch-info span {
    font-size: 15px;
    font-weight: 500;
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary-light);
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all var(--transition-fast);
}

.btn-text:hover {
    background: rgba(99, 102, 241, 0.1);
}

.batch-actions {
    display: flex;
    gap: 8px;
}

.batch-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 56px;
}

.batch-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--primary-color);
}

.batch-btn svg {
    width: 20px;
    height: 20px;
}

.batch-btn-danger {
    color: var(--danger-color);
}

.batch-btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger-color);
}

.batch-btn-close {
    color: var(--text-secondary);
}

@media (max-width: 480px) {
    .batch-operations-bar {
        flex-direction: column;
        gap: 12px;
        padding: 12px;
    }
    
    .batch-info {
        width: 100%;
        justify-content: space-between;
    }
    
    .batch-actions {
        width: 100%;
        justify-content: space-around;
    }
}

/* ===== 脉冲动画 ===== */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* ===== 加载指示器 ===== */
.loading-indicator {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    padding: 10px 20px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.loading-indicator.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.loading-spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-indicator span {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ===== 闪光效果 ===== */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.shimmer {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* ===== 图片查看器 ===== */
.image-viewer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
}

.image-viewer.show {
    display: block;
}

.image-viewer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
}

.image-viewer-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.image-viewer-img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    transition: transform 0.1s ease;
    cursor: grab;
}

.image-viewer-img:active {
    cursor: grabbing;
}

.image-viewer-controls {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: rgba(15, 23, 42, 0.9);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.viewer-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.viewer-btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: var(--primary-color);
}

.viewer-btn-close {
    margin-left: 8px;
    background: var(--danger-color);
    border-color: var(--danger-color);
}

.viewer-btn-close:hover {
    background: #dc2626;
}

.zoom-level {
    font-size: 14px;
    color: var(--text-secondary);
    min-width: 50px;
    text-align: center;
}

/* ===== 新增功能样式 ===== */

/* 面板按钮 */
.btn-panel {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-panel:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--primary-color);
}

.btn-panel svg {
    width: 18px;
    height: 18px;
}

/* ===== 下拉菜单样式 ===== */

.dropdown {
    position: relative;
}

.dropdown-toggle {
    position: relative;
}

.dropdown-arrow {
    width: 16px !important;
    height: 16px !important;
    margin-left: 4px;
    transition: transform 0.2s;
}

.dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 1000;
    overflow: hidden;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 更多功能下拉菜单 */
.header-more-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.header-more-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--primary-color);
}

.header-more-btn svg {
    width: 18px;
    height: 18px;
}

.more-dropdown-menu {
    min-width: 220px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 8px 0;
}

.menu-section-title {
    padding: 8px 16px 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
}

.dropdown-item svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

.dropdown-item:hover {
    background: var(--bg-hover);
}

.dropdown-item:hover svg {
    color: var(--primary-color);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

/* 筛选指示器 */
.filter-indicator {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--primary-color);
    border-radius: 20px;
    font-size: 13px;
    color: white;
    margin-top: 8px;
    box-shadow: var(--shadow-md);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.filter-back-btn {
    padding: 4px 10px;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: background var(--transition-fast);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.filter-back-btn:hover {
    background: rgba(255,255,255,0.3);
}

.filter-back-btn:active {
    background: rgba(255,255,255,0.4);
    transform: scale(0.95);
}

.filter-clear {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.filter-clear:hover {
    background: rgba(255,255,255,0.3);
}

/* 人物面板 */
.people-panel .modal-content {
    max-width: 600px;
    max-height: 80vh;
}

.people-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
    padding: 20px;
    overflow-y: auto;
}

.person-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.person-card:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.person-avatar {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    font-size: 28px;
    margin-bottom: 8px;
}

.person-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.person-count {
    font-size: 12px;
    color: var(--text-muted);
}

/* 相册面板 */
.album-panel .modal-content {
    max-width: 800px;
    max-height: 80vh;
}

.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    padding: 20px;
    overflow-y: auto;
}

.album-card {
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.album-card:hover {
    transform: translateY(-4px);
}

.album-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.album-count {
    position: absolute;
    bottom: 8px;
    right: 8px;
    padding: 4px 10px;
    background: rgba(0,0,0,0.7);
    border-radius: 12px;
    font-size: 12px;
    color: white;
    font-weight: 500;
}

.album-title {
    text-align: center;
    margin-top: 8px;
    font-size: 14px;
    color: var(--text-primary);
}

/* EXIF信息模态框 */
.exif-modal .modal-content {
    max-width: 400px;
}

.exif-content {
    padding: 20px;
}

.exif-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.exif-item:last-child {
    border-bottom: none;
}

.exif-label {
    font-size: 13px;
    color: var(--text-muted);
}

.exif-value {
    font-size: 13px;
    color: var(--text-primary);
    text-align: right;
    max-width: 60%;
    word-break: break-all;
}

/* 标签点击样式 */
.tag {
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tag:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

/* ===== 增强功能样式 ===== */

/* 搜索建议下拉 */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 4px;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.search-suggestion-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary);
    transition: background var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-suggestion-item:hover {
    background: var(--bg-hover);
}

/* 手势滑动提示 */
.swipe-hint {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    pointer-events: none;
    animation: swipeHintIn 0.2s ease;
}

.swipe-hint.swipe-right {
    right: 16px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
}

.swipe-hint.swipe-left {
    left: 16px;
    background: rgba(16, 185, 129, 0.9);
    color: white;
}

@keyframes swipeHintIn {
    from { opacity: 0; transform: translateY(-50%) scale(0.8); }
    to { opacity: 1; transform: translateY(-50%) scale(1); }
}

/* 统计面板 */
.stats-panel .modal-content {
    max-width: 600px;
}

/* 人物库操作按钮 */
.btn-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-hover);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 12px;
}

.btn-icon:hover {
    background: var(--bg-elevated);
    border-color: var(--primary-color);
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: opacity var(--transition-fast);
}

.btn-danger:hover {
    opacity: 0.9;
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

/* ===== 回收站样式 ===== */
.trash-panel .modal-content {
    max-width: 800px;
}

.trash-item {
    transition: all var(--transition-fast);
}

.trash-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.trash-item img {
    transition: transform 0.3s ease;
}

.trash-item:hover img {
    transform: scale(1.05);
}

/* ===== 视频倍速控制 ===== */
.video-speed-control {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: white;
    transition: background var(--transition-fast);
}

.video-speed-control:hover {
    background: rgba(255,255,255,0.3);
}

.speed-menu {
    animation: fadeIn 0.15s ease;
}

.speed-option {
    transition: background var(--transition-fast);
}

.speed-option:hover {
    background: var(--bg-hover) !important;
}

.speed-option.active {
    font-weight: 600;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== 移动端优化 ===== */
@media (hover: none) and (pointer: coarse) {
    /* 触摸反馈 */
    .media-card:active {
        transform: scale(0.97);
        transition: transform 0.1s ease;
    }

    .btn-upload:active,
    .btn-panel:active,
    .batch-btn:active,
    .filter-btn:active,
    .nav-item:active,
    .space-btn:active {
        transform: scale(0.92);
        opacity: 0.85;
        transition: all 0.1s ease;
    }

    /* 增大触摸区域 */
    .viewer-btn {
        width: 48px;
        height: 48px;
    }

    /* 滑动手势优化 */
    .media-card {
        touch-action: pan-y;
        user-select: none;
        -webkit-user-select: none;
    }

    /* 登录页面移动端优化 - 3D轮播紧凑化 */
    .login-container {
        padding: 24px 16px;
        width: 95%;
        max-height: 95vh;
        animation: none; /* 移动端禁用容器浮动以提升性能 */
    }

    .user-carousel {
        height: 240px;
        gap: 12px;
    }

    .carousel-container {
        width: 240px;
        height: 200px;
    }

    .carousel-item {
        width: 200px;
    }

    .user-card-3d {
        padding: 20px 18px;
        gap: 8px;
        border-radius: 18px;
    }

    .user-card-3d .avatar {
        font-size: 42px;
    }

    .user-card-3d .name {
        font-size: 15px;
    }

    .role-badge {
        font-size: 10px;
        padding: 1px 6px;
    }

    .carousel-nav {
        width: 40px;
        height: 40px;
    }

    .carousel-nav svg {
        width: 20px;
        height: 20px;
    }

    /* 移动端禁用部分动画以提升性能 */
    .carousel-item-active .user-card-3d {
        animation: none;
    }

    .user-card-3d .avatar {
        animation: none;
    }

    .user-card-3d::before {
        animation: none;
    }

    .login-container h1 {
        font-size: 26px;
        margin-bottom: 6px;
    }

    .login-subtitle {
        margin-bottom: 20px;
        font-size: 13px;
    }

    .password-input {
        gap: 10px;
    }

    .password-input input {
        padding: 12px;
        font-size: 16px;
    }

    .btn-login {
        padding: 12px 24px;
        font-size: 14px;
    }

    .login-hint {
        font-size: 12px;
    }

    .logo {
        width: 60px;
        height: 60px;
        margin-bottom: 16px;
    }

    /* 移动端底部导航栏优化 */
    .bottom-nav {
        display: flex;
        height: 70px;
        padding: 8px 0 calc(8px + env(safe-area-inset-bottom)) 0;
        background: rgba(30, 30, 30, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid rgba(255,255,255,0.1);
        box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
    }

    .nav-item {
        flex-direction: column;
        gap: 4px;
        padding: 8px 0;
        min-width: 60px;
    }

    .nav-item svg {
        width: 26px;
        height: 26px;
    }

    .nav-item span {
        font-size: 11px;
        font-weight: 500;
        letter-spacing: 0.5px;
    }

    .nav-item.active {
        color: #8b5cf6;
    }

    .nav-item.active svg {
        transform: scale(1.1);
    }

    /* 移动端顶部区域优化 - 精简布局 */
    .header {
        padding: 10px 12px;
        min-height: 56px;
    }

    .header-left {
        gap: 10px;
        flex: 1;
        min-width: 0;
    }

    /* 隐藏顶部的面板入口按钮（底部导航已有） */
    .header-actions .btn-panel {
        display: none;
    }

    /* 保留上传按钮，但精简为图标模式 */
    .header-actions {
        gap: 8px;
        flex-shrink: 0;
    }

    .btn-upload {
        width: 40px;
        height: 40px;
        padding: 0;
        border-radius: 50%;
        justify-content: center;
    }

    .btn-upload .btn-text {
        display: none;
    }

    .btn-upload svg {
        width: 20px;
        height: 20px;
        margin: 0;
    }

    .btn-switch-user {
        width: 36px;
        height: 36px;
    }

    .btn-switch-user svg {
        width: 18px;
        height: 18px;
    }

    /* 当前用户简化显示 */
    .current-user {
        padding: 4px 10px;
        gap: 6px;
    }

    .current-user .user-avatar {
        font-size: 20px;
    }

    .current-user .user-name {
        font-size: 13px;
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* 空间切换按钮紧凑化 */
    .space-switcher {
        padding: 3px;
        gap: 3px;
    }

    .space-btn {
        padding: 5px 10px;
        font-size: 12px;
        border-radius: 14px;
    }

    /* 移动端头部重构 - 极简设计 */
    .header {
        padding: 0 8px;
        height: 52px;
        gap: 6px;
    }

    .header-left {
        gap: 6px;
        flex: 1;
        min-width: 0; /* 允许收缩 */
        overflow: hidden; /* 防止内容溢出 */
    }

    /* 当前用户 - 只显示头像 */
    .current-user {
        padding: 0;
        background: transparent;
        border-radius: 50%;
        width: 36px;
        height: 36px;
        justify-content: center;
        align-items: center;
        flex-shrink: 0;
    }

    .current-user .user-avatar {
        font-size: 22px;
        margin: 0;
    }

    .current-user .user-name,
    .current-user .user-menu-arrow {
        display: none !important;
    }

    /* 上传按钮 - 圆形图标 */
    .btn-upload {
        padding: 0;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        justify-content: center;
        flex-shrink: 0;
    }

    .btn-upload svg {
        width: 18px;
        height: 18px;
        margin: 0;
    }

    .btn-upload span {
        display: none;
    }

    /* 移动端汉堡菜单按钮 - 更大更显眼 */
    .btn-mobile-menu {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 10px;
        color: var(--text-primary);
        cursor: pointer;
        transition: all var(--transition-fast);
        flex-shrink: 0;
    }

    .btn-mobile-menu svg {
        width: 24px;
        height: 24px;
    }

    .btn-mobile-menu:active {
        transform: scale(0.95);
        background: var(--bg-hover);
    }

    /* 隐藏桌面端功能按钮 */
    .desktop-only,
    .header-action-btn,
    .header-more-btn {
        display: none !important;
    }

    /* 切换用户按钮 */
    .btn-switch-user {
        display: none; /* 移动端隐藏，通过用户菜单操作 */
    }

    /* 移动端搜索栏优化 - 隐藏搜索栏，通过汉堡菜单访问搜索功能 */
    .search-bar {
        display: none;
    }

    /* 移动端网格优化 */
    .media-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        padding: 8px;
    }

    .main-content {
        touch-action: pan-y; /* 允许垂直滑动 */
        -webkit-overflow-scrolling: touch; /* iOS 平滑滚动 */
    }

    .media-card {
        border-radius: 8px;
    }

    .date-items {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        padding: 8px;
    }

    .date-header {
        font-size: 13px;
        padding: 6px 12px;
        margin: 4px 8px;
    }

    /* 超小屏幕优化 (iPhone SE等) */
    @media (max-width: 375px) {
        .header {
            height: 48px;
            padding: 0 6px;
        }

        .current-user {
            width: 32px;
            height: 32px;
        }

        .current-user .user-avatar {
            font-size: 20px;
        }

        .space-btn {
            padding: 5px 8px;
            font-size: 10px;
        }

        .btn-upload {
            width: 32px;
            height: 32px;
        }

        .btn-upload svg {
            width: 16px;
            height: 16px;
        }

        .media-grid {
            grid-template-columns: repeat(2, 1fr);
            gap: 6px;
            padding: 6px;
        }

        .date-items {
            grid-template-columns: repeat(2, 1fr);
            gap: 4px;
        }

        .nav-item span {
            font-size: 10px;
        }

        .filter-btn {
            padding: 6px 12px;
            font-size: 12px;
        }
    }

    /* 移动端弹窗优化 - 底部弹出风格 */
    .modal.show {
        align-items: flex-end;
        padding: 0;
    }

    .modal-content {
        margin: 0;
        width: 100%;
        max-width: 100%;
        max-height: 92vh;
        border-radius: 20px 20px 0 0;
        animation: modalSlideUpMobile 0.3s ease;
    }

    @keyframes modalSlideUpMobile {
        from {
            transform: translateY(100%);
            opacity: 0.8;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    .modal-header {
        padding: 16px 20px;
    }

    .modal-header h3 {
        font-size: 18px;
    }

    .modal-body {
        padding: 16px 20px;
        max-height: 65vh;
    }

    .modal-footer {
        padding: 12px 20px  calc(12px + env(safe-area-inset-bottom)) 20px;
    }

    /* 移动端面板全宽 */
    .panel {
        max-width: 100%;
        border-left: none;
        right: -100%;
    }

    .panel.show {
        right: 0;
    }

    .panel-header {
        padding: 16px 20px;
    }

    .panel-content {
        padding: 16px 20px calc(16px + env(safe-area-inset-bottom)) 20px;
    }

    /* 移动端按钮优化 */
    .btn-primary,
    .btn-secondary {
        min-height: 48px;
        padding: 0 24px;
        font-size: 15px;
        border-radius: 12px;
    }

    .btn-close {
        width: 40px;
        height: 40px;
    }

    /* 移动端输入框优化 */
    input, textarea, select {
        font-size: 16px; /* 防止iOS缩放 */
        min-height: 48px;
        border-radius: 10px;
        padding: 12px 16px;
    }

    /* 搜索栏移动端优化 */
    .search-bar {
        padding: 10px 12px;
    }

    .search-bar input {
        padding: 12px 40px 12px 44px;
        font-size: 16px;
        border-radius: 12px;
    }

    .search-icon {
        left: 16px;
        width: 20px;
        height: 20px;
    }

    .search-suggestions {
        left: 12px;
        right: 12px;
        border-radius: 12px;
        max-height: 280px;
        overflow-y: auto;
    }

    /* 上传提示移动端 */
    .upload-tips {
        padding: 10px 12px;
        gap: 8px;
    }

    .upload-tip-item svg {
        width: 18px;
        height: 18px;
    }

    /* Toast位置调整 */
    .toast {
        bottom: calc(80px + env(safe-area-inset-bottom));
        padding: 12px 24px;
        font-size: 15px;
        border-radius: 24px;
        max-width: 90vw;
        text-align: center;
    }

    /* 移动端底部导航优化 */
    .bottom-nav {
        height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
    }

    .nav-item {
        padding: 6px 12px;
        gap: 3px;
    }

    .nav-item svg {
        width: 22px;
        height: 22px;
    }

    .nav-item span {
        font-size: 10px;
    }

    /* 批量操作栏移动端 */
    .batch-operations-bar {
        bottom: var(--bottom-nav-height);
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom)) 16px;
    }

    /* 媒体覆盖层信息优化 */
    .media-overlay {
        padding: 40px 16px 16px;
    }

    .media-actions {
        right: 12px;
        bottom: 90px;
        gap: 10px;
    }

    .action-btn {
        width: 44px;
        height: 44px;
    }

    .action-btn svg {
        width: 20px;
        height: 20px;
    }

    /* 视频控制移动端 */
    .video-controls {
        left: 12px;
        right: 68px;
        bottom: 76px;
        padding: 10px 12px;
    }

    .video-play-overlay {
        width: 64px;
        height: 64px;
    }

    .video-play-overlay svg {
        width: 32px;
        height: 32px;
    }

    /* 空状态移动端 */
    .empty-state svg {
        width: 64px;
        height: 64px;
    }

    .empty-state p {
        font-size: 15px;
    }

    /* 图片查看器移动端 */
    .image-viewer-controls {
        bottom: calc(16px + env(safe-area-inset-bottom));
        padding: 10px 16px;
        gap: 10px;
    }

    .viewer-btn {
        width: 44px;
        height: 44px;
        font-size: 16px;
    }

    /* 人物卡片网格移动端 */
    .people-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        padding: 12px;
    }

    .person-card {
        padding: 12px 8px;
    }

    .person-avatar {
        width: 52px;
        height: 52px;
        font-size: 24px;
    }

    /* 相册网格移动端 */
    .album-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 12px;
    }

    /* 设置面板移动端 */
    .setting-item {
        padding: 14px 0;
    }

    .setting-item span {
        font-size: 15px;
    }

    /* 自动上传面板移动端 */
    .auto-upload-panel {
        max-width: 100%;
        right: -100%;
    }

    /* 加载遮罩 */
    .loading-mask p {
        font-size: 15px;
    }

    .progress-bar {
        width: 240px;
    }
}

/* ===== 小屏幕手机专用优化 ===== */
@media (max-width: 390px) {
    .space-btn {
        padding: 4px 8px;
        font-size: 11px;
    }

    .nav-item span {
        font-size: 10px;
    }

    .nav-item svg {
        width: 22px;
        height: 22px;
    }

    .filter-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .date-items {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
    }

    .people-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== 小平板/大手机优化 ===== */
@media (min-width: 391px) and (max-width: 768px) {
    .date-items {
        grid-template-columns: repeat(4, 1fr);
    }

    .media-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ===== 桌面端默认隐藏底部导航 ===== */
.bottom-nav {
    display: none;
}

/* 桌面端批量操作栏不需要为底部导航留空间 */
.batch-operations-bar {
    bottom: 0;
}

/* ===== 电子图书馆 ===== */
.library-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
}

.library-toolbar .btn-primary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.library-toolbar .btn-primary:hover {
    opacity: 0.9;
}

.library-filter {
    display: flex;
    gap: 6px;
}

.library-filter .filter-btn {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.library-filter .filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.library-search {
    margin-bottom: 16px;
}

.library-search input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 14px;
}

.library-search input::placeholder {
    color: var(--text-muted);
}

.bookshelf {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.book-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.book-cover {
    position: relative;
    aspect-ratio: 3/4;
    background: linear-gradient(135deg, #1e293b, #334155);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-cover-placeholder {
    font-size: 48px;
    opacity: 0.5;
}

.book-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.book-badge.public {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.book-info {
    padding: 12px;
}

.book-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-author {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-muted);
}

.book-uploader {
    display: flex;
    align-items: center;
    gap: 4px;
}

.book-progress {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

.book-actions {
    display: flex;
    gap: 4px;
    padding: 0 12px 12px;
}

.book-actions button {
    flex: 1;
    padding: 6px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-hover);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.book-actions button:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 阅读器 */
.reader-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.reader-header h3 {
    font-size: 16px;
    font-weight: 500;
    flex: 1;
    text-align: center;
    margin: 0 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reader-progress {
    font-size: 13px;
    color: var(--text-secondary);
}

.reader-controls {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 12px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
}

.reader-controls button {
    padding: 10px 24px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-hover);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.reader-controls button:hover {
    background: var(--primary-color);
    color: white;
}

.reader-font-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.reader-font-controls button {
    padding: 8px 14px;
    font-size: 16px;
    font-weight: 600;
    min-width: 44px;
}

/* 移动端图书馆优化 */
@media (max-width: 768px) {
    .bookshelf {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .library-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .reader-header h3 {
        font-size: 14px;
    }

    .reader-controls button {
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* ===== 安全区域适配（iPhone X+ 等） ===== */
@supports (padding-top: env(safe-area-inset-top)) {
    @media (hover: none) and (pointer: coarse) {
        .header {
            padding-top: calc(10px + env(safe-area-inset-top));
            min-height: calc(56px + env(safe-area-inset-top));
        }
    }
}

/* 横屏适配 */
@media (orientation: landscape) and (max-height: 500px) {
    .header {
        padding: 8px 16px;
    }
    
    .header-title {
        font-size: 16px;
    }
    
    .header-actions button span {
        display: none;
    }
    
    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 8px;
        padding: 8px;
    }
    
    .batch-operations-bar {
        padding: 8px 16px;
    }
    
    .image-viewer-container {
        padding: 40px 20px;
    }
    
    .bottom-nav {
        height: 50px;
    }
    
    .nav-item span {
        font-size: 10px;
    }
}

/* 移动端文件类型图标优化 */
@media (max-width: 768px) {
    .file-icon-symbol {
        font-size: 36px; /* 减小图标大小 */
    }
    
    .file-icon-label {
        font-size: 10px;
        max-width: 90%;
    }
}

/* ===== 文件类型图标与权限徽章 ===== */
.media-card .media-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    background: var(--bg-card);
    pointer-events: none;
}

.file-icon {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 12px 12px 0 0;
    pointer-events: none;
}

.file-icon-symbol {
    font-size: 48px;
    line-height: 1;
    pointer-events: none;
}

.file-ext {
    font-size: 11px;
    font-weight: 600;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 1px;
    pointer-events: none;
}

.media-audio-indicator {
    position: absolute;
    bottom: 10px;
    left: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.9);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    pointer-events: none;
}

.visibility-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    pointer-events: none;
}

.visibility-private {
    background: rgba(100, 116, 139, 0.8);
    color: white;
}

.visibility-shared {
    background: rgba(99, 102, 241, 0.8);
    color: white;
}

.visibility-public {
    background: rgba(16, 185, 129, 0.8);
    color: white;
}

/* Live Photo 标识 */
.live-photo-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(4px);
    pointer-events: none;
    animation: livePhotoPulse 2s ease-in-out infinite;
}

@keyframes livePhotoPulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

.live-photo-badge::before {
    content: '◎';
    font-size: 14px;
}

.media-info {
    padding: 10px 12px;
    background: var(--bg-card);
    border-radius: 0 0 12px 12px;
    pointer-events: none;
}

.media-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
    pointer-events: none;
}

.media-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-muted);
    pointer-events: none;
}

.media-category {
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(148, 163, 184, 0.1);
    font-size: 10px;
    pointer-events: none;
}

.media-card .media-actions {
    position: absolute;
    top: 8px;
    left: 8px;
    display: none;
    gap: 4px;
    transition: all 0.2s;
}

.media-card:hover .media-actions {
    display: flex;
}

.media-actions button {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.media-actions button:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* 回收站样式 */
.trash-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.trash-info {
    font-size: 13px;
    color: var(--text-secondary);
}

.trash-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.trash-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255,255,255,0.03);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.trash-item:hover {
    background: rgba(255,255,255,0.06);
}

.trash-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.trash-info {
    flex: 1;
    min-width: 0;
}

.trash-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trash-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.trash-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.btn-restore {
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-restore:hover {
    background: rgba(34, 197, 94, 0.25);
}

.btn-delete-permanent {
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-delete-permanent:hover {
    background: rgba(239, 68, 68, 0.25);
}

/* 统计面板样式 */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px 16px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-2px);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 12px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.stats-bars {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stats-bar-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stats-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-secondary);
}

.stats-bar-track {
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
}

.stats-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* 相册面板样式 */
.album-group {
    margin-bottom: 24px;
}

.album-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.album-count {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.06);
    padding: 2px 10px;
    border-radius: 10px;
}

.album-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
}

.album-photo-item {
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background: var(--bg-card);
    transition: transform 0.2s ease;
}

.album-photo-item:hover {
    transform: scale(1.05);
}

.album-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 人物面板样式 */
.person-group {
    margin-bottom: 24px;
}

.person-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.person-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 600;
    flex-shrink: 0;
}

.person-count {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-secondary);
    margin-left: auto;
    background: rgba(255,255,255,0.06);
    padding: 2px 10px;
    border-radius: 10px;
}

.person-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
}

.person-photo-item {
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background: var(--bg-card);
    transition: transform 0.2s ease;
}

.person-photo-item:hover {
    transform: scale(1.05);
}

.person-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.empty-state .empty-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* 批量操作样式 */
.batch-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 16px;
}

.batch-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    font-size: 14px;
}

.batch-actions {
    display: flex;
    gap: 8px;
}

.batch-mode-btn.active {
    background: var(--primary-color);
    color: white;
}

.media-card.batch-mode {
    cursor: pointer;
}

.media-card.selected {
    box-shadow: 0 0 0 2px var(--primary-color);
}

.media-batch-check {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(0,0,0,0.4);
    align-items: center;
    justify-content: center;
    z-index: 5;
    cursor: pointer;
    pointer-events: none;
}

.batch-checkbox {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid white;
    background: transparent;
    transition: all 0.2s ease;
}

.batch-checkbox.checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.batch-checkbox.checked::after {
    content: '';
    display: block;
    width: 4px;
    height: 7px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin: 2px 0 0 4px;
}

/* ===== 抖音式滑动浏览 ===== */
#mediaSwiper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background: #000;
    display: none;
    overflow: hidden;
    touch-action: none;
}

#mediaSwiper.show {
    display: block;
}

#mediaSwiper .swiper-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    will-change: transform;
}

#mediaSwiper .swiper-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: #000;
}

#mediaSwiper .swiper-slide-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#mediaSwiper .swiper-slide-content img,
#mediaSwiper .swiper-slide-content video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

#mediaSwiper .swiper-slide-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: rgba(255,255,255,0.6);
}

#mediaSwiper .swiper-slide-loading .loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

#mediaSwiper .swiper-slide-loading p {
    font-size: 14px;
    margin: 0;
}

/* 滑动浏览信息覆盖层 */
#mediaSwiper .swiper-slide-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 60px 20px 24px;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
    color: white;
    pointer-events: none;
    z-index: 10;
}

#mediaSwiper .swiper-slide-name {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#mediaSwiper .swiper-slide-meta {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
}

/* 滑动浏览导航按钮 */
#mediaSwiper .swiper-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
    pointer-events: auto;
}

#mediaSwiper .swiper-nav-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-50%) scale(1.1);
}

#mediaSwiper .swiper-nav-btn.prev {
    left: 16px;
}

#mediaSwiper .swiper-nav-btn.next {
    right: 16px;
}

#mediaSwiper .swiper-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* 滑动浏览关闭按钮 */
#mediaSwiper .swiper-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: white;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
    pointer-events: auto;
}

#mediaSwiper .swiper-close-btn:hover {
    background: rgba(255,255,255,0.25);
}

/* 滑动浏览计数器 */
#mediaSwiper .swiper-counter {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 16px;
    background: rgba(0,0,0,0.5);
    border-radius: 20px;
    color: rgba(255,255,255,0.8);
    font-size: 13px;
    z-index: 20;
    pointer-events: none;
    backdrop-filter: blur(4px);
}

/* 滑动浏览操作按钮 */
#mediaSwiper .swiper-actions {
    position: absolute;
    right: 16px;
    bottom: 100px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 20;
    pointer-events: auto;
}

#mediaSwiper .swiper-action-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

#mediaSwiper .swiper-action-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

#mediaSwiper .swiper-action-btn.active {
    color: #fbbf24;
}

/* 滑动浏览提示箭头 */
#mediaSwiper .swiper-hint {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 36px;
    color: rgba(255,255,255,0.2);
    z-index: 5;
    pointer-events: none;
    animation: swiperHintPulse 2s ease-in-out infinite;
}

#mediaSwiper .swiper-hint.prev-hint {
    left: 8px;
}

#mediaSwiper .swiper-hint.next-hint {
    right: 8px;
}

@keyframes swiperHintPulse {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.5; }
}

/* 移动端滑动浏览优化 */
@media (max-width: 768px) {
    #mediaSwiper .swiper-nav-btn {
        display: none;
    }

    #mediaSwiper .swiper-actions {
        right: 12px;
        bottom: 80px;
        gap: 12px;
    }

    #mediaSwiper .swiper-action-btn {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    #mediaSwiper .swiper-slide-info {
        padding: 40px 16px 16px;
    }

    #mediaSwiper .swiper-slide-name {
        font-size: 14px;
    }

    #mediaSwiper .swiper-slide-meta {
        font-size: 11px;
    }
}

/* ===== 高级文件管理器样式 ===== */

/* 面包屑导航 */
.file-manager-breadcrumb {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    gap: 8px;
    flex-wrap: wrap;
}

.breadcrumb-item {
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 4px 8px;
    border-radius: 4px;
}

.breadcrumb-item:hover {
    color: var(--primary-light);
    background: var(--bg-hover);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 600;
    cursor: default;
}

.breadcrumb-separator {
    color: var(--text-muted);
    user-select: none;
}

/* 批量操作栏 */
.batch-action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--primary-dark), var(--accent-color));
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.batch-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.batch-info input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.batch-actions {
    display: flex;
    gap: 8px;
}

.batch-actions .btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.batch-actions .btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.batch-actions .btn.btn-danger {
    background: rgba(239, 68, 68, 0.8);
    border-color: rgba(239, 68, 68, 1);
}

.batch-actions .btn.btn-danger:hover {
    background: rgba(239, 68, 68, 1);
}

/* 文件夹列表 */
.folder-list {
    max-height: 400px;
    overflow-y: auto;
}

.folder-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
    border-radius: 8px;
    margin-bottom: 4px;
}

.folder-item:hover {
    background: var(--bg-hover);
    transform: translateX(4px);
}

.folder-icon {
    font-size: 24px;
}

.folder-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

/* 最近访问面板 */
.recent-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid var(--border-color);
}

.recent-item:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
    transform: translateX(4px);
}

.recent-icon {
    font-size: 28px;
}

.recent-info {
    flex: 1;
    min-width: 0;
}

.recent-name {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.recent-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

/* 存储统计面板 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.stat-card.warning {
    border-color: var(--warning-color);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05));
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-light);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.type-breakdown {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
}

.type-breakdown h4 {
    margin-bottom: 16px;
    color: var(--text-primary);
}

.type-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.type-item:last-child {
    border-bottom: none;
}

.type-name {
    font-weight: 500;
    color: var(--text-primary);
}

.type-size {
    color: var(--accent-color);
    font-weight: 600;
}

.type-count {
    color: var(--text-muted);
    font-size: 12px;
}

/* 视图切换按钮 */
.view-mode-toggle {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    padding: 4px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.view-mode-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 6px;
    transition: all var(--transition-fast);
    font-size: 16px;
}

.view-mode-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.view-mode-btn.active {
    background: var(--primary-color);
    color: white;
}

/* 排序下拉菜单 */
.sort-dropdown {
    position: relative;
}

.sort-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    z-index: 1000;
    display: none;
}

.sort-menu.show {
    display: block;
    animation: fadeIn 0.2s ease;
}

.sort-option {
    padding: 10px 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sort-option:hover {
    background: var(--bg-hover);
}

.sort-option.active {
    color: var(--primary-light);
    font-weight: 600;
}

.sort-option.active::after {
    content: '✓';
}

/* 筛选器面板 */
.filter-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.filter-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.filter-group {
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 8px 12px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 14px;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.empty-state.show {
    display: flex;
}

.empty-state-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: empty-state-fade-in 0.4s ease;
}

@keyframes empty-state-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.empty-state-icon {
    font-size: 72px;
    margin-bottom: 16px;
    opacity: 0.6;
    animation: empty-state-bounce 2s ease-in-out infinite;
}

@keyframes empty-state-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.empty-state-text {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state-hint {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.empty-action-btn {
    padding: 10px 24px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.empty-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

/* 骨架屏 */
.skeleton-card {
    pointer-events: none;
}

.skeleton-thumb {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-elevated) 50%, var(--bg-hover) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

.skeleton-line {
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-elevated) 50%, var(--bg-hover) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .batch-action-bar {
        flex-direction: column;
        gap: 12px;
        padding: 10px;
    }
    
    .batch-actions {
        width: 100%;
        justify-content: space-around;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .filter-row {
        flex-direction: column;
    }
    
    .filter-group {
        width: 100%;
    }
}

/* ===== 用户中心样式 ===== */

/* 用户中心标签页 */
.user-center-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
}

.tab-btn {
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    border-radius: 8px 8px 0 0;
    transition: all var(--transition-fast);
    position: relative;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

.tab-btn.active {
    color: var(--primary-light);
    background: var(--bg-card);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 个人资料头部 */
.profile-header {
    background: linear-gradient(135deg, var(--primary-dark), var(--accent-color));
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    color: white;
}

.profile-avatar-section {
    display: flex;
    align-items: center;
    gap: 20px;
}

.profile-avatar-large {
    font-size: 64px;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    backdrop-filter: blur(10px);
}

.profile-name-section h2 {
    margin: 0 0 4px 0;
    font-size: 24px;
    font-weight: 700;
}

.profile-username {
    margin: 0 0 8px 0;
    opacity: 0.8;
    font-size: 14px;
}

.role-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.role-badge.admin {
    background: rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

.role-badge.member {
    background: rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.role-badge.child {
    background: rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

/* 个人资料表单 */
.profile-form,
.password-form {
    max-width: 600px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 12px;
}

.avatar-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.avatar-option {
    width: 50px;
    height: 50px;
    font-size: 28px;
    background: var(--bg-hover);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-option:hover {
    background: var(--bg-elevated);
    transform: scale(1.1);
}

.avatar-option.selected {
    border-color: var(--primary-color);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
}

/* 安全设置 */
.security-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.security-section h4 {
    margin: 0 0 16px 0;
    color: var(--text-primary);
}

.security-info {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
}

.security-info h4 {
    margin: 0 0 16px 0;
    color: var(--text-primary);
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    color: var(--text-secondary);
}

.info-value {
    color: var(--text-primary);
    font-weight: 500;
}

/* 家人关系 */
.relations-header {
    margin-bottom: 20px;
}

.relations-header h4 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
}

.relations-hint {
    margin: 0 0 12px 0;
    color: var(--text-muted);
    font-size: 14px;
}

.relations-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.relation-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all var(--transition-fast);
}

.relation-item:hover {
    border-color: var(--primary-color);
    transform: translateX(4px);
}

.relation-avatar {
    font-size: 36px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    border-radius: 50%;
}

.relation-info {
    flex: 1;
}

.relation-name {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.original-name {
    font-weight: 600;
    color: var(--text-primary);
}

.alias-badge {
    padding: 2px 8px;
    background: var(--primary-color);
    color: white;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.relation-meta {
    display: flex;
    gap: 8px;
    font-size: 13px;
}

.role-tag,
.relationship-tag {
    padding: 2px 8px;
    background: var(--bg-hover);
    border-radius: 4px;
    color: var(--text-secondary);
}

.relationship-tag {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
}

/* 移动端优化 */
@media (max-width: 768px) {
    .user-center-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .tab-btn {
        white-space: nowrap;
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .profile-avatar-section {
        flex-direction: column;
        text-align: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .avatar-selector {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .relation-item {
        flex-wrap: wrap;
    }
}

/* ===== 5大创新功能样式 ===== */

/* AI标签云 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px;
    justify-content: center;
}

.tag-item {
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--primary-color);
    font-weight: 600;
}

.tag-item:hover {
    transform: scale(1.2);
    text-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.ai-search-box {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding: 0 20px;
}

.ai-search-box input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
}

.ai-search-box button {
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

/* 人物相册网格 */
.person-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    padding: 20px;
}

.person-card {
    text-align: center;
    padding: 20px;
    background: var(--bg-card);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.person-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2);
}

.person-avatar {
    font-size: 48px;
    margin-bottom: 12px;
}

.person-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.person-count {
    font-size: 13px;
    color: var(--text-secondary);
}

/* 时间线视图 */
.year-selector {
    display: flex;
    gap: 12px;
    padding: 20px;
    overflow-x: auto;
    border-bottom: 2px solid var(--border-color);
}

.year-btn {
    padding: 10px 20px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.year-btn:hover {
    border-color: var(--primary-color);
}

.year-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ===== 时间线视图样式 ===== */

.timeline-modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
}

/* 桌面端模态框优化 */
@media (min-width: 769px) {
    .timeline-modal .modal-content {
        max-width: 90%;
        width: 1200px;
        height: 85vh;
        border-radius: 16px;
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    }
    
    .timeline-header h3 {
        font-size: 22px;
    }
    
    .sticky-year-nav {
        padding: 16px 24px;
    }
    
    .year-btn {
        padding: 12px 24px;
        font-size: 15px;
    }
    
    .timeline-container {
        padding: 24px;
    }
    
    .timeline-month h4 {
        font-size: 20px;
        margin-bottom: 20px;
    }
    
    /* 桌面端使用瀑布流布局 */
    .timeline-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 16px;
    }
    
    .timeline-item {
        aspect-ratio: auto;
        border-radius: 12px;
    }
    
    .timeline-item:hover {
        transform: scale(1.08);
        z-index: 10;
    }
    
    .timeline-item-name {
        font-size: 13px;
        padding: 10px;
    }
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.timeline-header h3 {
    font-size: 18px;
    margin: 0;
}

.sticky-year-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-primary);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.timeline-container {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.timeline-month {
    margin-bottom: 32px;
}

.timeline-month h4 {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-left: 8px;
    border-left: 4px solid var(--primary-color);
}

.timeline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.timeline-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.timeline-item:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.timeline-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.timeline-item .file-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: var(--bg-card);
}

.timeline-item-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 视频指示器 */
.video-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    backdrop-filter: blur(4px);
}

/* 用户下拉菜单 */
.current-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.current-user:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
}

.user-menu-arrow {
    transition: transform var(--transition-fast);
}

.current-user.active .user-menu-arrow {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 240px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: none;
    animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-dropdown-menu.show {
    display: block;
}

/* 移动端功能下拉菜单 - 全屏覆盖 */
.mobile-menu-dropdown {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(2, 6, 23, 0.95);
    backdrop-filter: blur(20px);
    z-index: 999;
    display: none;
    overflow-y: auto;
    padding: 64px 16px 24px;
    -webkit-overflow-scrolling: touch;
}

.mobile-menu-dropdown.show {
    display: block;
    animation: slideInFromRight 0.3s ease;
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.mobile-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
}

.mobile-menu-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.mobile-menu-item:hover,
.mobile-menu-item:active {
    background: var(--bg-hover);
}

.mobile-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

.mobile-menu-section {
    padding: 8px 0;
}

.mobile-menu-section-title {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* 移动端菜单关闭按钮 */
.mobile-menu-close {
    position: fixed;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all var(--transition-fast);
}

.mobile-menu-close:hover,
.mobile-menu-close:active {
    background: var(--bg-hover);
    transform: scale(0.95);
}

.mobile-menu-close svg {
    width: 20px;
    height: 20px;
}

.user-menu-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-dark), var(--accent-color));
    border-radius: 12px 12px 0 0;
    color: white;
}

.user-menu-avatar {
    font-size: 32px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

.user-menu-info {
    flex: 1;
}

.user-menu-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px;
}

.user-menu-role {
    font-size: 12px;
    opacity: 0.8;
}

.user-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
    font-size: 14px;
}

.user-menu-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.user-menu-item:hover {
    background: var(--bg-hover);
}

/* ===== 即时通讯系统样式 ===== */

.chat-panel .panel-content {
    padding: 0;
    display: flex;
    height: 100%;
}

.chat-container {
    display: flex;
    width: 100%;
    height: 100%;
}

/* 左侧会话列表 */
.chat-sidebar {
    width: 280px;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
}

.chat-sidebar-header {
    padding: 12px;
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
}

.chat-conversation-list {
    flex: 1;
    overflow-y: auto;
}

.chat-conversation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    cursor: pointer;
    transition: background var(--transition-fast);
    border-bottom: 1px solid var(--border-color);
}

.chat-conversation-item:hover {
    background: var(--bg-hover);
}

.chat-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.chat-info {
    flex: 1;
    min-width: 0;
}

.chat-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-last-message {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-unread-badge {
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}

/* 右侧聊天窗口 */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-dark);
}

/* 聊天头部 */
.chat-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
}

.chat-header-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-title {
    font-weight: 600;
    font-size: 16px;
}

.chat-status {
    font-size: 12px;
    color: var(--primary-color);
}

.chat-header-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background var(--transition-fast);
}

.btn-icon:hover {
    background: var(--bg-hover);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    display: flex;
    gap: 8px;
    max-width: 70%;
}

.chat-message.sent {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-message.received {
    align-self: flex-start;
}

.chat-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.chat-message-content {
    background: var(--bg-card);
    padding: 10px 14px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chat-message.sent .chat-message-content {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.chat-message-sender {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    opacity: 0.8;
}

.chat-message-text {
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-message-time {
    font-size: 11px;
    margin-top: 4px;
    opacity: 0.6;
}

/* 文件卡片 */
.chat-file-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: background var(--transition-fast);
    min-width: 200px;
}

.chat-file-card:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-file-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.chat-file-info {
    flex: 1;
    min-width: 0;
}

.chat-file-name {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.chat-file-size {
    font-size: 12px;
    opacity: 0.7;
}

/* ===== WebRTC 音视频通话样式 ===== */

.webrtc-panel .panel-content {
    padding: 0;
    display: flex;
    height: calc(100vh - 60px);
}

.webrtc-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #000;
}

.webrtc-video-area {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#remoteVideo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #1a1a1a;
}

#localVideo {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 200px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    background: #2a2a2a;
}

.webrtc-controls {
    padding: 20px;
    display: flex;
    justify-content: center;
    gap: 20px;
    background: rgba(0, 0, 0, 0.8);
}

.btn-icon-lg {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 28px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-lg:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.btn-icon-lg.danger {
    background: #ef4444;
}

.btn-icon-lg.danger:hover {
    background: #dc2626;
}

/* ===== 照片地图和时间线样式 ===== */

.timeline-container {
    padding: 20px;
}

.timeline-year {
    margin-bottom: 40px;
}

.timeline-year-title {
    font-size: 28px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-left: 15px;
    border-left: 4px solid var(--primary-color);
}

.timeline-months {
    padding-left: 30px;
}

.timeline-month {
    margin-bottom: 30px;
}

.timeline-month-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.timeline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.timeline-item {
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.timeline-item:hover {
    transform: scale(1.05);
}

.timeline-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== 重复文件检测样式 ===== */

.duplicates-list {
    max-height: 60vh;
    overflow-y: auto;
}

.duplicate-group {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-hover);
    border-radius: 8px;
}

.duplicate-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 600;
}

.duplicate-files {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.duplicate-file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    background: var(--bg-card);
    border-radius: 6px;
}

.duplicate-file-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.duplicate-file-info {
    flex: 1;
}

/* ===== 创新功能样式 ===== */

/* 时光胶囊 - 优化版 */

.capsule-intro-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--bg-hover);
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.capsule-intro-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.capsule-intro-icon {
    font-size: 32px;
    line-height: 1;
}

.capsule-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 0;
}

/* 时光胶囊卡片 */
.capsule-card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    cursor: pointer;
}

.capsule-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.15);
}

.capsule-card-visual {
    position: relative;
    height: 180px;
    overflow: hidden;
    background: var(--bg-hover);
}

.capsule-card-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.capsule-card:hover .capsule-card-visual img {
    transform: scale(1.08);
}

.capsule-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    font-size: 60px;
}

.capsule-card-placeholder span::before {
    content: "📦";
}

.capsule-card-status {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(4px);
}

.capsule-card-status.opened {
    background: rgba(108, 117, 125, 0.9);
}

.capsule-card-status.ready {
    background: rgba(40, 167, 69, 0.9);
}

.capsule-card-status.locked {
    background: rgba(255, 193, 7, 0.9);
    color: #000;
}

.capsule-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to top, rgba(0,0,0,0.4), transparent);
    pointer-events: none;
}

.capsule-card-body {
    padding: 16px;
}

.capsule-card-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.capsule-card-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0 0 12px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
    min-height: 42px;
}

/* 进度条 */
.capsule-progress {
    width: 100%;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    margin-bottom: 12px;
    overflow: hidden;
}

.capsule-progress-bar {
    height: 100%;
    background: var(--primary-color);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.capsule-card-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.capsule-card-actions {
    display: flex;
    gap: 8px;
}

.capsule-card-actions .btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 8px;
}

/* 空状态 */
.capsule-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}

.capsule-empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.capsule-empty h4 {
    font-size: 20px;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.capsule-empty p {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

/* 详情页 */
.capsule-detail-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.capsule-detail-header.opened {
    background: rgba(40, 167, 69, 0.05);
}

.capsule-detail-header.ready {
    background: rgba(255, 193, 7, 0.05);
}

.capsule-detail-header.locked {
    background: rgba(108, 117, 125, 0.05);
}

.capsule-detail-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
}

.capsule-detail-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.capsule-detail-info-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.capsule-detail-info-label {
    font-size: 12px;
    color: var(--text-muted);
}

.capsule-detail-info-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.capsule-detail-desc {
    padding: 16px 24px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    border-bottom: 1px solid var(--border-color);
    min-height: 60px;
}

.capsule-detail-photos-section {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.capsule-detail-photos-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.capsule-detail-photos-header h4 {
    margin: 0;
    font-size: 16px;
    color: var(--text-primary);
}

.capsule-detail-photos-header span {
    font-size: 13px;
    color: var(--text-muted);
}

.capsule-detail-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.capsule-detail-photo-item {
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background: var(--bg-hover);
}

.capsule-detail-photo-item:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.capsule-detail-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.capsule-detail-empty-photos {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.capsule-detail-empty-photos span {
    font-size: 48px;
    display: block;
    margin-bottom: 8px;
}

.capsule-detail-empty-photos p {
    margin: 0;
    font-size: 14px;
}

.capsule-detail-add-photos {
    padding: 20px 24px;
}

.capsule-detail-add-photos h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: var(--text-primary);
}

.capsule-detail-add-photos p {
    margin: 0 0 16px 0;
    font-size: 13px;
    color: var(--text-muted);
}

/* 移动端时光胶囊适配 */
@media (max-width: 768px) {
    .capsule-list {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 16px;
    }
    
    .capsule-intro-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 14px 16px;
    }
    
    .capsule-card-visual {
        height: 160px;
    }
    
    .capsule-card-title {
        font-size: 16px;
    }
    
    .capsule-detail-info {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    
    .capsule-detail-photos {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .capsule-list {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .capsule-card-visual {
        height: 200px;
    }
    
    .capsule-intro-bar {
        padding: 12px;
    }
    
    .capsule-intro-icon {
        font-size: 24px;
    }
    
    .capsule-intro-info h4 {
        font-size: 14px !important;
    }
    
    .capsule-intro-info p {
        font-size: 12px !important;
    }
    
    .capsule-card-body {
        padding: 14px;
    }
    
    .capsule-card-actions .btn {
        padding: 6px 8px;
        font-size: 12px;
    }
    
    .capsule-detail-info {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .capsule-detail-info-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .capsule-detail-photos {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    
    .capsule-detail-photo-item {
        border-radius: 8px;
    }
}

/* 设备列表 - 保持原有样式 */
.device-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
}

.device-item {
    padding: 15px;
    background: var(--bg-hover);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.device-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.device-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.device-status.active {
    background: #28a745;
    color: white;
}

.device-status.inactive {
    background: #dc3545;
    color: white;
}

.device-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.restore-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.restore-option {
    padding: 20px;
    background: var(--bg-card);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 15px;
}

.restore-option:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.restore-icon {
    font-size: 36px;
}

.restore-info h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
}

.restore-info p {
    margin: 0;
    font-size: 13px;
    color: #666;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #00ff88);
    transition: width 0.3s;
}

/* 输入区域 */
.chat-input-area {
    padding: 12px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg-card);
}

.chat-input-toolbar {
    display: flex;
    gap: 4px;
}

.btn-icon-sm {
    background: transparent;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: background var(--transition-fast);
}

.btn-icon-sm:hover {
    background: var(--bg-hover);
}

.chat-input-actions {
    display: flex;
    justify-content: flex-end;
}

.chat-input-area textarea {
    flex: 1;
    resize: none;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 14px;
    font-family: inherit;
    background: var(--bg-dark);
    color: var(--text-primary);
}

.chat-input-area textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.empty-chat-list {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .chat-sidebar {
        width: 100%;
        position: absolute;
        z-index: 10;
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
    }
    
    .chat-sidebar.show {
        transform: translateX(0);
    }
    
    .chat-main {
        width: 100%;
    }
    
    .chat-message {
        max-width: 85%;
    }
}

.user-menu-item.danger {
    color: var(--danger-color);
}

.user-menu-item.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ===== 聊天选择器对话框 ===== */
.chat-selector-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 4000;
    padding: 16px;
}

.chat-selector-modal.show {
    display: flex;
}

.chat-selector-content {
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    width: 100%;
    max-width: 450px;
    max-height: 80vh;
    overflow: hidden;
    animation: modalSlideUp var(--transition-normal);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
}

.chat-selector-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.chat-selector-header h3 {
    font-size: 17px;
    font-weight: 600;
    margin: 0;
}

.chat-selector-body {
    padding: 12px;
    max-height: 60vh;
    overflow-y: auto;
    flex: 1;
}

.chat-selector-footer {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.chat-selector-footer button {
    flex: 1;
}

/* 用户选择项 */
.chat-user-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: background var(--transition-fast);
    border: 2px solid transparent;
}

.chat-user-item:hover {
    background: rgba(59, 130, 246, 0.1);
}

.chat-user-item.selected {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.15);
}

.chat-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.chat-user-info {
    flex: 1;
    min-width: 0;
}

.chat-user-name {
    font-weight: 500;
    color: var(--text-primary);
}

.chat-user-role {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 文件选择项 */
.chat-file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background var(--transition-fast);
    border: 2px solid transparent;
}

.chat-file-item:hover {
    background: rgba(59, 130, 246, 0.1);
}

.chat-file-item.selected {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.15);
}

.chat-file-thumb {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: rgba(30, 41, 59, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    overflow: hidden;
}

.chat-file-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-file-info {
    flex: 1;
    min-width: 0;
}

.chat-file-name {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-file-meta {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 图片网格 */
.chat-image-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 8px;
}

.chat-image-item {
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: border-color var(--transition-fast);
    position: relative;
}

.chat-image-item:hover {
    border-color: var(--primary-color);
}

.chat-image-item.selected {
    border-color: var(--primary-color);
}

.chat-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-image-item .selected-check {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* 空状态 */
.chat-selector-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.chat-selector-empty .icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* ===== 移动端头部精简 - 强制隐藏搜索栏和筛选栏 ===== */
@media (max-width: 768px) {
    /* 隐藏搜索栏 */
    .search-bar {
        display: none !important;
    }

    /* 确保空间切换器在移动端显示 */
    .space-switcher {
        display: flex !important;
    }
    
    /* 时间线视图移动端全屏优化 */
    .timeline-modal .modal-content {
        max-width: 100%;
        height: 100vh;
        border-radius: 0;
    }
    
    .sticky-year-nav {
        padding: 8px 12px;
    }
    
    .year-btn {
        padding: 8px 14px;
        font-size: 14px;
    }
    
    .timeline-container {
        padding: 12px;
    }
    
    .timeline-month {
        margin-bottom: 24px;
    }
    
    .timeline-month h4 {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .timeline-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }
    
    .timeline-item-name {
        font-size: 11px;
        padding: 6px;
    }
}

/* 智能相册 */
.smart-album-content {
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.smart-album-header {
    flex-shrink: 0;
}

.smart-album-tabs {
    display: flex;
    gap: 8px;
    padding: 12px 20px 0;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    flex-shrink: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* iOS 平滑滚动 */
    scrollbar-width: none; /* Firefox */
}

.smart-album-tabs::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.smart-album-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent; /* 移除移动端点击高亮 */
}

.smart-album-tab:hover {
    color: var(--primary-color);
}

.smart-album-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 500;
}

.smart-album-tab span {
    font-size: 16px;
}

.smart-album-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    min-height: 300px;
    -webkit-overflow-scrolling: touch; /* iOS 平滑滚动 */
}

.smart-album-loading {
    text-align: center;
    padding: 60px;
    color: var(--text-muted);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.smart-album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.smart-album-card {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-secondary);
    will-change: transform; /* 性能优化 */
}

.smart-album-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.smart-album-card:active {
    transform: scale(0.98); /* 移动端点击反馈 */
}

.smart-album-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.smart-album-count {
    position: absolute;
    bottom: 8px;
    right: 8px;
    padding: 4px 10px;
    background: rgba(0,0,0,0.7);
    border-radius: 12px;
    font-size: 12px;
    color: white;
    font-weight: 500;
}

.smart-album-title {
    text-align: center;
    margin-top: 8px;
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* AI标签云 */
.ai-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    padding: 20px;
}

.ai-tag-item {
    cursor: pointer;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border-radius: 20px;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
}

.ai-tag-item:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.ai-search-box {
    display: flex;
    gap: 8px;
    padding: 0 20px 20px;
    justify-content: center;
}

.ai-search-box input {
    flex: 1;
    max-width: 300px;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
}

.ai-search-box button {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

/* 人物卡片 */
.people-grid .smart-album-card {
    text-align: center;
}

.person-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 8px;
}

.person-photo-count {
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* 收藏徽章 */
.favorite-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 20px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* 移动端适配 */
@media (max-width: 768px) {
    .smart-album-content {
        max-width: 100vw;
        max-height: 92vh;
        margin: 0;
        border-radius: 0;
    }

    .modal-content {
        border-radius: 12px 12px 0 0; /* 顶部圆角 */
    }

    .smart-album-tabs {
        padding: 8px 10px 0;
        gap: 6px;
    }

    .smart-album-tab {
        padding: 8px 14px;
        font-size: 13px;
        border-radius: 16px;
    }

    .smart-album-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 10px;
    }

    .smart-album-body {
        padding: 10px;
    }

    .smart-album-cover {
        aspect-ratio: 1;
    }

    .smart-album-title {
        font-size: 12px;
        padding: 6px 8px;
    }

    .smart-album-count {
        font-size: 11px;
        padding: 3px 8px;
    }

    /* AI标签云优化 */
    .ai-tag-cloud {
        gap: 8px;
    }

    .ai-tag-item {
        padding: 6px 12px;
        font-size: 12px;
    }

    /* 人物卡片优化 */
    .person-avatar-large {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }

    .person-photo-count {
        font-size: 11px;
    }
}
