/* public/css/style.css - Modern Clean SaaS Theme (Merged & Unified) */

:root {
    /* 核心色板 (Tech Blue) */
    --primary-color: #2563eb;       /* 亮蓝 */
    --primary-hover: #1d4ed8;       /* 深蓝 */
    --primary-light: #eff6ff;       /* 极浅蓝背景 */
    
    /* 语义色 */
    --success-color: #10b981;       /* 翠绿 */
    --danger-color: #ef4444;        /* 赤红 */
    --warning-color: #f59e0b;       /* 琥珀 */
    --info-color: #64748b;          /* 蓝灰 */

    /* 中性色 */
    --bg-body: #f8fafc;             /* 页面背景（冷灰） */
    --bg-card: #ffffff;             /* 卡片背景 */
    --text-main: #1e293b;           /* 主要文字 */
    --text-secondary: #64748b;      /* 次要文字 */
    --border-color: #e2e8f0;        /* 边框色 */
    
    /* 尺寸与阴影 */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --header-height: 64px;
}

/* 深色模式变量 */
[data-theme="dark"] {
    --primary-color: #3b82f6;
    --primary-hover: #60a5fa;
    --primary-light: rgba(59, 130, 246, 0.15);
    
    --success-color: #22c55e;
    --danger-color: #f87171;
    --warning-color: #fbbf24;
    --info-color: #94a3b8;
    
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

/* --- 1. 全局重置 --- */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    padding-top: calc(var(--header-height) + 30px); /* 留出头部空间 */
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h2, h3, h4, h1 { margin: 0 0 1rem 0; color: var(--text-main); font-weight: 700; }
a { text-decoration: none; color: inherit; transition: color 0.2s; }
ul { list-style: none; padding: 0; margin: 0; }

/* --- 2. 布局容器 --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    box-sizing: border-box;
}

/* 新增：通用主容器 (用于 Edit/Upload 等单页应用场景) */
.main-container {
    max-width: 1200px;
    margin: 0 auto; /* 移除顶部 margin，由 body padding 控制 */
    padding: 0 20px;
}

.flex-between { display: flex; justify-content: space-between; align-items: center; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-secondary); font-size: 0.9em; }
.mt-3 { margin-top: 1rem; }
.mb-3 { margin-bottom: 1rem; }

/* 新增：通用页面标题头 */
.page-header {
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
}

/* --- 3. 导航栏 (Glassmorphism 风格) --- */
.app-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

/* 深色模式下的导航栏 */
[data-theme="dark"] .app-header {
    background: rgba(30, 41, 59, 0.95);
    border-bottom-color: var(--border-color);
}

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

.header-brand span { font-weight: 800; letter-spacing: -0.5px; color: var(--primary-color); font-size: 1.3rem; }

/* 旧版导航兼容 */
.header-nav { display: flex; gap: 20px; align-items: center; }
.nav-link { 
    font-weight: 500; color: var(--text-secondary); padding: 8px 12px; border-radius: var(--radius-sm); 
    font-size: 0.95rem; 
}
.nav-link:hover, .nav-link.active { color: var(--primary-color); background: var(--primary-light); }
.nav-divider { width: 1px; height: 24px; background: var(--border-color); margin: 0 10px; }

/* 新版简洁导航 */
.header-nav-compact {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links {
    display: flex;
    gap: 4px;
    align-items: center;
}

.nav-links a {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
}

.nav-links a:hover {
    color: var(--text-main);
    background: #f1f5f9;
}

[data-theme="dark"] .nav-links a:hover {
    background: #334155;
    color: var(--text-main);
}

.nav-links a.active {
    color: var(--primary-color);
    background: var(--primary-light);
}

/* 用户菜单 */
.user-menu {
    position: relative;
    margin-left: 8px;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 6px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s;
}

[data-theme="dark"] .user-menu-btn {
    background: #334155;
    border-color: var(--border-color);
}

.user-menu-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

[data-theme="dark"] .user-menu-btn:hover {
    background: #475569;
    border-color: #64748b;
}

.user-menu-btn.active {
    background: var(--primary-light);
    border-color: var(--primary-color);
}

.user-avatar-small {
    width: 28px;
    height: 28px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dropdown-arrow {
    font-size: 0.7rem;
    color: var(--text-secondary);
    transition: transform 0.2s;
}

.user-menu-btn.active .dropdown-arrow {
    transform: rotate(180deg);
}

/* 用户下拉菜单 */
.user-dropdown {
    position: absolute;
    top: 48px;
    right: 0;
    width: 200px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.2);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
}

/* 深色模式下拉菜单 */
[data-theme="dark"] .user-dropdown {
    background: #1e293b;
    border-color: var(--border-color);
    box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 0.9rem;
    color: var(--text-main);
    text-decoration: none;
    transition: all 0.15s;
    border: none;
    background: none;
    width: 100%;
    cursor: pointer;
}

/* 深色模式下拉菜单链接 */
[data-theme="dark"] .dropdown-link {
    color: var(--text-main);
}

.dropdown-link:hover {
    background: #f8fafc;
    color: var(--primary-color);
}

/* 深色模式下拉菜单悬停效果 */
[data-theme="dark"] .dropdown-link:hover {
    background: #334155;
    color: var(--primary-color);
}

.dropdown-link.danger {
    color: var(--danger-color);
}

[data-theme="dark"] .dropdown-link.danger {
    color: var(--danger-color);
}

.dropdown-link.danger:hover {
    background: #fef2f2;
}

[data-theme="dark"] .dropdown-link.danger:hover {
    background: rgba(248, 113, 113, 0.15);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

/* 登录按钮 */
.btn-login {
    padding: 8px 20px;
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-login:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* --- 4. 按钮体系 --- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    font-weight: 500; font-size: 0.95rem;
    cursor: pointer; border: 1px solid transparent;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary { background-color: var(--primary-color); color: white; border-color: transparent; }
.btn-primary:hover { background-color: var(--primary-hover); box-shadow: var(--shadow-md); }

.btn-secondary { background-color: #fff; color: var(--text-main); border-color: var(--border-color); }
.btn-secondary:hover { background-color: #f9fafb; border-color: #cbd5e1; }

.btn-danger { background-color: #fff; color: var(--danger-color); border-color: #fecaca; }
.btn-danger:hover { background-color: #fef2f2; border-color: var(--danger-color); }

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; }
.btn-lg { padding: 10px 24px; font-size: 1rem; }

/* 表格操作列按钮组 */
.action-buttons {
    display: flex; gap: 8px; align-items: center; justify-content: flex-start; flex-wrap: nowrap;
}
.action-buttons .btn-sm { white-space: nowrap; padding: 4px 10px; }

/* --- 5. 表单控件 (Modern Inputs) --- */
.form-group { margin-bottom: 20px; }
.form-label, .modern-label { display: block; font-weight: 600; margin-bottom: 8px; color: #475569; font-size: 0.9rem; }

.form-control, .form-input, .form-textarea, .modern-input, .modern-select, .modern-textarea {
    width: 100%;
    padding: 12px 14px;
    font-size: 0.95rem;
    color: var(--text-main);
    background-color: #f8fafc; /* 统一浅灰背景 */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
    font-family: inherit;
}

.modern-textarea { resize: vertical; line-height: 1.6; min-height: 100px; }

.form-control:focus, .modern-input:focus, .modern-select:focus, .modern-textarea:focus {
    border-color: var(--primary-color);
    background-color: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.required-star { color: #ef4444; margin-left: 4px; }

/* 新增：通用表单网格 */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
@media (max-width: 768px) { .form-grid-2 { grid-template-columns: 1fr; } }

/* --- 6. Checkbox Card (通用) --- */
.checkbox-card {
    display: flex; align-items: center;
    padding: 16px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.checkbox-card:hover { background-color: #f1f5f9; border-color: #cbd5e1; }
.checkbox-card input[type="checkbox"] { width: 20px; height: 20px; margin-right: 12px; accent-color: var(--primary-color); cursor: pointer; }
.checkbox-text { font-weight: 500; color: #334155; }
.checkbox-subtext { font-size: 0.85rem; color: #64748b; margin-left: 8px; font-weight: normal; }

/* --- 7. 表格 (Clean Table) --- */
.table-responsive {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}
table { width: 100%; border-collapse: collapse; }
th {
    background: #f8fafc;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}
td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 0.9rem;
    vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover { background-color: #f8fafc; }

/* --- 8. 卡片组件 --- */
/* 基础卡片样式 */
.upload-area, .config-card, .file-card, .meta-pane, .series-header, .comment-area, .edit-card, .content-card {
    background: var(--bg-card);
    border-radius: 16px; /* 统一圆角 */
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

/* 通用内容卡片 (Unified Card for Forms) */
.content-card {
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-bottom: 24px;
}
.card-header {
    padding: 20px 32px;
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-body { padding: 32px; background-color: #ffffff; }

/* 旧版配置标题 (保留兼容性) */
.config-title {
    font-size: 1.1rem; font-weight: 600; color: #333;
    margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}

/* --- 9. 拖拽上传 (Modern Dropzone) --- */
.modern-dropzone, .upload-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    background-color: #f8fafc;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    margin-bottom: 24px;
}
.modern-dropzone:hover, .modern-dropzone.drag-over, .upload-dropzone:hover {
    border-color: var(--primary-color);
    background: #eff6ff;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(37, 99, 235, 0.15);
}
.drop-icon, .dropzone-icon {
    font-size: 48px; color: #94a3b8; margin-bottom: 16px; display: inline-block;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}
.drop-btn {
    background: white; border: 1px solid #e2e8f0; padding: 8px 16px; border-radius: 6px;
    font-size: 0.9rem; font-weight: 500; color: var(--text-main); margin-top: 16px; display: inline-block;
    transition: all 0.2s;
}
.modern-dropzone:hover .drop-btn { border-color: var(--primary-color); color: var(--primary-color); }

/* --- 10. 文件列表卡片 (File Item Card - Upload Page) --- */
.file-card {
    display: flex; flex-direction: column; /* 确保是垂直布局 */
    padding: 20px; margin-bottom: 16px; transition: all 0.2s;
}
.file-card:hover { border-color: #e2e8f0; box-shadow: 0 8px 16px -4px rgba(0,0,0,0.08); transform: translateY(-2px); }

.file-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.file-meta { display: flex; align-items: center; gap: 16px; }
.file-thumb {
    width: 48px; height: 48px; background: #f1f5f9; border-radius: 8px;
    display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0;
}
.file-details h4 { margin: 0 0 4px 0; font-size: 1rem; font-weight: 600; color: var(--text-main); word-break: break-all; }
.file-details span, .file-size {
    font-size: 0.85rem; color: var(--text-secondary); background: #f8fafc; padding: 2px 8px; border-radius: 4px;
}
.btn-icon-delete {
    background: none; border: none; color: #ef4444; cursor: pointer; padding: 4px;
    border-radius: 50%; transition: background 0.2s; font-size: 1.1rem; line-height: 1;
}
.btn-icon-delete:hover { background-color: #fee2e2; }

/* --- 11. 进度条 (Modern) --- */
.modern-progress-bg, .upload-progress-track { height: 6px; background: #f1f5f9; border-radius: 10px; overflow: hidden; margin-top: 10px; }
.modern-progress-bar, .upload-progress-fill { height: 100%; background: var(--primary-color); width: 0%; border-radius: 10px; transition: width 0.3s ease; }

/* --- 12. 画廊网格 (Gallery) - 专业版 --- */
.gallery-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); 
    gap: 28px; 
    margin-top: 32px; 
    padding-bottom: 40px;
}

.gallery-item {
    background: #fff; 
    border: 1px solid var(--border-color); 
    border-radius: var(--radius-lg); 
    overflow: hidden;
    cursor: pointer; 
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    box-shadow: var(--shadow-sm);
    position: relative;
}

.gallery-item:hover { 
    transform: translateY(-8px); 
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.gallery-item:hover .thumb-box img { 
    transform: scale(1.08); 
}

.gallery-item:hover .item-overlay {
    opacity: 1;
}

.thumb-box { 
    height: 240px; 
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    overflow: hidden; 
    position: relative;
}

.thumb-box img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1); 
}

/* 文件类型图标 */
.file-type-icon {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
}

/* Hover 遮罩层 */
.item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.2) 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    pointer-events: none;
}

.item-overlay-content {
    color: white;
}

.item-overlay-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 8px;
    word-break: break-word;
}

.item-overlay-meta {
    font-size: 0.85rem;
    opacity: 0.9;
    display: flex;
    gap: 16px;
    align-items: center;
}

/* 隐私标签 */
.privacy-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(239, 68, 68, 0.9);
    backdrop-filter: blur(8px);
    color: white;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 4px;
}

.privacy-badge.public {
    background: rgba(16, 185, 129, 0.9);
}

.item-info { 
    padding: 20px; 
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 12px;
}

.item-name { 
    font-weight: 600; 
    font-size: 1.05rem; 
    color: var(--text-main); 
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.item-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    gap: 8px;
}

.item-date { 
    font-size: 0.85rem; 
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.item-size {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 500;
    background: var(--primary-light);
    padding: 4px 10px;
    border-radius: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

.item-meta-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.item-author {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}

.item-dot {
    color: var(--border-color);
    font-size: 0.7rem;
}

/* 标签展示 */
.item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.item-tag {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: #f1f5f9;
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

/* 骨架屏 */
.skeleton-card {
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.skeleton-thumb {
    height: 240px;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

.skeleton-info {
    padding: 20px;
}

.skeleton-line {
    height: 16px;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 10px;
}

.skeleton-line.short {
    width: 60%;
    height: 12px;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
}

.empty-state-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    align-items: center;
}

.filter-chip {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid var(--border-color);
    background: white;
    color: var(--text-secondary);
}

.filter-chip:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-chip.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* --- 13. 状态标签 (Badge) --- */
.status-badge, .tag-badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 99px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }
.status-success { background: #dcfce7; color: #166534; }
.status-pending { background: #f3f4f6; color: #4b5563; }
.status-error { background: #fee2e2; color: #991b1b; }
.tag-badge { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; margin-right: 5px; }

/* --- 14. 模态框 (Modal) --- */
.modal-overlay {
    background: rgba(15, 23, 42, 0.6); backdrop-filter: blur(4px);
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 2000;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden; transition: all 0.3s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-content {
    background: #fff; border-radius: var(--radius-lg); width: 600px; max-width: 90%; padding: 32px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    transform: scale(0.95); transition: transform 0.3s;
}
.modal-overlay.active .modal-content { transform: scale(1); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border-color); }
.modal-close { font-size: 1.5rem; color: var(--text-secondary); cursor: pointer; transition: color 0.2s; }
.modal-close:hover { color: var(--danger-color); }

/* --- 15. 批量操作栏 --- */
.batch-toolbar {
    background: var(--primary-light); border: 1px solid #dbeafe; color: var(--primary-hover);
    padding: 12px 20px; border-radius: var(--radius-md); margin-bottom: 20px;
    display: none; align-items: center; justify-content: space-between; animation: slideDown 0.3s ease;
}
.batch-toolbar.active { display: flex; }
@keyframes slideDown { from { transform: translateY(-10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* --- 16. 图片详情页导航按钮 --- */
.nav-arrow {
    position: absolute; top: 50%; transform: translateY(-50%); width: 50px; height: 50px;
    background: rgba(255, 255, 255, 0.8); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 1.5rem; color: #333;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1); transition: all 0.2s; user-select: none; z-index: 10; text-decoration: none;
}
.nav-arrow:hover { background: white; box-shadow: 0 6px 15px rgba(0,0,0,0.2); transform: translateY(-50%) scale(1.1); }
.nav-prev { left: 20px; } .nav-next { right: 20px; }
@media (max-width: 768px) { .nav-arrow { width: 40px; height: 40px; font-size: 1.2rem; } .nav-prev { left: 10px; } .nav-next { right: 10px; } }

/* --- 17. 编辑页面专用样式 (Series Edit) --- */
.edit-container { max-width: 800px; margin: 40px auto; padding: 0 20px; }
.edit-card {
    background: #ffffff; border-radius: 16px; box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
    border: 1px solid #eef2f6; overflow: hidden;
}
.edit-header {
    padding: 30px 40px; border-bottom: 1px solid #f1f5f9; background: #ffffff;
    display: flex; justify-content: space-between; align-items: center;
}
.edit-title { margin: 0; font-size: 1.5rem; color: #1e293b; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.edit-body { padding: 40px; background-color: #ffffff; }
.edit-footer, .bottom-actions {
    padding: 20px 40px; background-color: #f8fafc; border-top: 1px solid #e2e8f0;
    display: flex; justify-content: flex-end; gap: 12px;
}

/* --- 用户下拉菜单 (User Dropdown) --- */

.header-user-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

/* 头像样式 */
.user-avatar {
    width: 40px;
    height: 40px;
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    user-select: none;
}

.user-avatar:hover {
    background-color: #dbeafe;
    border-color: #bfdbfe;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* 下拉菜单容器 */
.dropdown-menu {
    position: absolute;
    top: 55px; /* 在头像下方 */
    right: 0;
    width: 220px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 8px 0;
    z-index: 1100;
    
    /* 默认隐藏 */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 激活状态：显示 */
.dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 菜单头部 (显示用户名) */
.dropdown-header-item {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 8px;
}

.dropdown-username {
    display: block;
    font-weight: 700;
    color: var(--text-main);
    font-size: 0.95rem;
}

.dropdown-role {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* 菜单项链接 */
.dropdown-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s;
    cursor: pointer;
}

.dropdown-item:hover {
    background-color: #f8fafc;
    color: var(--primary-color);
}

.dropdown-item.danger {
    color: var(--danger-color);
}

.dropdown-item.danger:hover {
    background-color: #fef2f2;
}

.dropdown-icon {
    margin-right: 10px;
    width: 16px;
    text-align: center;
    font-size: 1rem;
}

/* ========== 分页样式 ========== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
    padding: 20px 0;
}

.pagination-btn {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-main);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

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

.pagination-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

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

.pagination-ellipsis {
    color: var(--text-secondary);
    padding: 8px 4px;
    font-size: 14px;
}

/* ========== 系列页面文件卡片样式 ========== */
.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.files-grid .file-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    padding: 0;
}

.files-grid .file-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.files-grid .file-card.selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.files-grid .file-card-checkbox {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s;
}

.files-grid .file-card:hover .file-card-checkbox,
.files-grid.batch-mode .file-card-checkbox {
    opacity: 1;
}

/* 批量模式下始终显示复选框 */
.files-grid.batch-mode .file-card-checkbox {
    opacity: 1;
}

.files-grid .file-checkbox-input {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.files-grid .file-card-thumbnail {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.files-grid .file-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.files-grid .file-card:hover .file-card-thumbnail img {
    transform: scale(1.05);
}

.files-grid .file-icon {
    font-size: 4rem;
    opacity: 0.3;
}

.files-grid .file-card-name {
    padding: 12px 16px 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    word-break: break-word;
    line-height: 1.4;
}

.files-grid .file-card-meta {
    display: flex;
    gap: 8px;
    padding: 0 16px 12px;
    flex-wrap: wrap;
}

.files-grid .file-source,
.files-grid .file-privacy {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.files-grid .file-source.genai {
    background: #fef3c7;
    color: #92400e;
}

.files-grid .file-source.original {
    background: #dbeafe;
    color: #1e40af;
}

.files-grid .file-privacy.public {
    background: #dcfce7;
    color: #166534;
}

.files-grid .file-privacy.private {
    background: #fee2e2;
    color: #991b1b;
}

.files-grid .file-prompt {
    padding: 8px 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: #f8fafc;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    line-height: 1.5;
}

.files-grid .file-card-actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
}

.files-grid .file-btn {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--text-main);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.2s;
}

.files-grid .file-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.files-grid .file-btn-download {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.files-grid .file-btn-download:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* 用户主页链接样式 */
.uploader-name {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

.uploader-name:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* ============================================
   性能优化 - 懒加载、动画、缓存
   ============================================ */

/* --- 图片懒加载 --- */
img[data-src] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img.lazy-loading {
    opacity: 0.5;
    background: linear-gradient(90deg, var(--bg-body) 25%, var(--border-color) 50%, var(--bg-body) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

img.lazy-loaded {
    opacity: 1;
}

img.lazy-error {
    opacity: 1;
    filter: grayscale(100%);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* --- 内容可见性优化 --- */
.content-visibility-auto {
    content-visibility: auto;
    contain-intrinsic-size: 0 500px;
}

/* --- 滚动优化 --- */
.scroll-smooth {
    scroll-behavior: smooth;
}

/* --- 动画性能优化 --- */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

/* GPU 加速 */
.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* --- 缓存策略提示 --- */
.cache-asset {
    /* 静态资源缓存标记 */
}

/* --- 预加载提示 --- */
.preload-critical {
    /* 关键资源预加载 */
}

/* --- 图片容器稳定布局 --- */
.img-container {
    position: relative;
    overflow: hidden;
    background-color: var(--bg-body);
}

.img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.img-container:hover img {
    transform: scale(1.05);
}

/* --- 无限滚动加载状态 --- */
.infinite-scroll-loader {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.infinite-scroll-loader::after {
    content: '';
    width: 24px;
    height: 24px;
    margin-left: 12px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- 加载更多按钮 --- */
.load-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    margin: 2rem auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.load-more-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.load-more-btn .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* --- 页面加载进度条 --- */
.page-loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
    z-index: 9999;
    transition: width 0.3s ease;
}

.page-loading-bar.loading {
    width: 70%;
    animation: loading-progress 2s ease-in-out infinite;
}

.page-loading-bar.loaded {
    width: 100%;
    transition: width 0.3s ease;
}

@keyframes loading-progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* --- 图片响应式 --- */
.responsive-img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* WebP 格式回退 */
.webp-fallback {
    background-image: url('placeholder.jpg');
}

.webp .webp-fallback {
    background-image: url('placeholder.webp');
}

/* ============================================
   动画关键帧
   ============================================ */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateX(100%);
    }
    to { 
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from { 
        opacity: 1;
        transform: translateX(0);
    }
    to { 
        opacity: 0;
        transform: translateX(100%);
    }
}

@keyframes scaleIn {
    from { 
        opacity: 0;
        transform: scale(0.9);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes scaleOut {
    from { 
        opacity: 1;
        transform: scale(1);
    }
    to { 
        opacity: 0;
        transform: scale(0.9);
    }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

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

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(10px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* 动画工具类 */
.animate-fade-in { animation: fadeIn 0.3s ease; }
.animate-fade-out { animation: fadeOut 0.3s ease forwards; }
.animate-slide-in { animation: slideIn 0.3s ease; }
.animate-slide-out { animation: slideOut 0.3s ease forwards; }
.animate-scale-in { animation: scaleIn 0.2s ease; }
.animate-scale-out { animation: scaleOut 0.2s ease forwards; }
.animate-bounce { animation: bounce 0.6s ease; }
.animate-pulse { animation: pulse 2s ease infinite; }
.animate-shake { animation: shake 0.4s ease; }
.animate-slide-down { animation: slideDown 0.3s ease; }
.animate-slide-up { animation: slideUp 0.3s ease; }

/* 延迟动画 */
.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-500 { animation-delay: 500ms; }

/* ============================================
   会员系统样式
   ============================================ */

/* 会员徽章 */
.membership-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.membership-badge.free {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    color: #64748b;
}

.membership-badge.basic {
    background: linear-gradient(135deg, #dbeafe 0%, #93c5fd 100%);
    color: #1e40af;
}

.membership-badge.pro {
    background: linear-gradient(135deg, #fef3c7 0%, #fcd34d 100%);
    color: #92400e;
}

.membership-badge.enterprise {
    background: linear-gradient(135deg, #e0e7ff 0%, #a5b4fc 100%);
    color: #3730a3;
}

/* 用户菜单 */
.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-menu .username {
    font-weight: 500;
    color: var(--text-main);
}

/* ============================================
   广告系统样式
   ============================================ */

.ad-container {
    width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.ad-banner {
    position: relative;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: box-shadow 0.3s;
}

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

.ad-label {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 4px;
    z-index: 10;
}

.ad-content {
    display: flex;
    align-items: center;
    padding: 16px;
    gap: 16px;
    text-decoration: none;
    color: inherit;
}

.ad-content img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

.ad-text h4 {
    font-size: 1rem;
    margin: 0 0 4px 0;
    color: var(--text-main);
}

.ad-text p {
    font-size: 0.85rem;
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* 存储空间进度条 */
.storage-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.storage-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.storage-bar-fill.warning {
    background: linear-gradient(90deg, var(--warning-color), #f97316);
}

.storage-bar-fill.danger {
    background: linear-gradient(90deg, var(--danger-color), #dc2626);
}