/* ========== 全局样式 ========== */
:root {
    /* 颜色系统 */
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    /* 中性色 */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* 背景和文字 */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border: #e5e7eb;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --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);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* 圆角 */
    --radius-sm: 0.375rem;
    --radius: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    
    /* 过渡 */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 暗色主题 */
[data-theme="dark"] {
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --border: #374151;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ========== 背景装饰 ========== */
.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.bg-gradient {
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
    animation: float 20s ease-in-out infinite;
}

.bg-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(118, 75, 162, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(102, 126, 234, 0.05) 0%, transparent 50%);
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

/* ========== 容器 ========== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* ========== 头部 ========== */
.header {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
    animation: slideDown 0.5s ease-out;
}

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

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo i {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* ========== 搜索框 ========== */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 1rem;
    color: var(--text-secondary);
    pointer-events: none;
}

.search-box input {
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.95rem;
    width: 300px;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ========== 按钮 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: var(--shadow-md);
}

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

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    background: var(--gray-100);
    border-color: var(--primary);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-icon {
    padding: 0.75rem;
    aspect-ratio: 1;
    border-radius: var(--radius);
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    color: var(--text-primary);
}

.btn-icon:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn:active {
    transform: scale(0.98);
}

/* ========== 工具栏 ========== */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    animation: slideUp 0.5s ease-out 0.1s both;
}

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

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.batch-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-left: 1rem;
    border-left: 2px solid var(--border);
    animation: fadeIn 0.3s ease-out;
}

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

.sort-options {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sort-options label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.sort-options select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.sort-options select:focus {
    outline: none;
    border-color: var(--primary);
}

/* ========== 面包屑 ========== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    animation: slideUp 0.5s ease-out 0.2s both;
}

.breadcrumb a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius);
    transition: var(--transition);
}

.breadcrumb a:hover {
    background: var(--bg-secondary);
    color: var(--primary);
}

.breadcrumb a:last-child {
    color: var(--primary);
    font-weight: 600;
}

.breadcrumb a:not(:last-child)::after {
    content: '/';
    margin-left: 0.75rem;
    color: var(--text-secondary);
}

/* ========== 主内容 ========== */
.main-content {
    animation: slideUp 0.5s ease-out 0.3s both;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.section-title .count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.75rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 600;
}

/* ========== 文件夹网格 ========== */
.folders-section {
    margin-bottom: 3rem;
}

.folders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.folder-card {
    position: relative;
    padding: 1.5rem;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
    animation: scaleIn 0.3s ease-out;
}

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

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

.folder-card.selected {
    border-color: var(--primary);
    background: rgba(102, 126, 234, 0.05);
}

.folder-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.folder-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.folder-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.folder-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transition: var(--transition);
}

.folder-card:hover .folder-actions {
    opacity: 1;
}

.folder-actions button {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.folder-actions button:hover {
    background: var(--primary);
    color: white;
}

/* ========== 图片网格 ========== */
.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.image-card {
    position: relative;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    animation: scaleIn 0.3s ease-out;
}

.image-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.image-card.selected {
    outline: 3px solid var(--primary);
    outline-offset: -3px;
}

.image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 75%;
    background: var(--gray-100);
    overflow: hidden;
}

.image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.image-card:hover .image-wrapper img {
    transform: scale(1.05);
}

.image-checkbox {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    width: 1.5rem;
    height: 1.5rem;
    z-index: 2;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
}

.image-card:hover .image-checkbox,
.image-card.selected .image-checkbox {
    opacity: 1;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
    opacity: 0;
    transition: var(--transition);
    display: flex;
    align-items: flex-end;
    padding: 1rem;
}

.image-card:hover .image-overlay {
    opacity: 1;
}

.image-actions {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

.image-actions button {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.image-actions button:hover {
    background: white;
    transform: translateY(-2px);
}

.image-info {
    padding: 1rem;
}

.image-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    animation: fadeIn 0.5s ease-out;
}

.empty-state i {
    font-size: 5rem;
    color: var(--gray-300);
    margin-bottom: 1.5rem;
}

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

.empty-state p {
    color: var(--text-secondary);
}

/* ========== 加载动画 ========== */
.loading {
    text-align: center;
    padding: 3rem;
}

.spinner {
    width: 3rem;
    height: 3rem;
    border: 4px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* ========== 拖拽区域 ========== */
.drop-zone {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(102, 126, 234, 0.95);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease-out;
}

.drop-zone-content {
    text-align: center;
    color: white;
}

.drop-zone-content i {
    font-size: 5rem;
    margin-bottom: 1rem;
    animation: bounce 1s ease-in-out infinite;
}

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

.drop-zone-content h3 {
    font-size: 2rem;
}

/* ========== 模态框 ========== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    animation: fadeIn 0.2s ease-out;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    animation: scaleIn 0.3s ease-out;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: rotate(90deg);
}

/* ========== 图片预览 ========== */
.image-preview {
    width: 90vw;
    max-width: 1200px;
}

.image-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 2px solid var(--border);
}

.image-preview-body {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    min-height: 400px;
}

.image-container {
    position: relative;
    max-width: 100%;
    max-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-container img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    transition: var(--transition);
}

.image-tools {
    position: absolute;
    bottom: -3rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.8);
    border-radius: var(--radius-lg);
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    cursor: pointer;
    transition: var(--transition);
}

.nav-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.nav-btn.prev {
    left: 1rem;
}

.nav-btn.next {
    right: 1rem;
}

/* ========== 上传进度 ========== */
.upload-progress {
    width: 500px;
    max-width: 90vw;
    padding: 2rem;
}

.upload-progress h3 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.upload-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.upload-item img {
    width: 3rem;
    height: 3rem;
    object-fit: cover;
    border-radius: var(--radius);
}

.upload-item-info {
    flex: 1;
}

.upload-item-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.upload-item-progress {
    height: 0.5rem;
    background: var(--gray-200);
    border-radius: 1rem;
    overflow: hidden;
}

.upload-item-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.3s ease-out;
}

.upload-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 2px solid var(--border);
    margin-top: 1rem;
}

/* ========== 通知 ========== */
.notifications {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.notification {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    min-width: 300px;
    animation: slideInRight 0.3s ease-out;
}

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

.notification.success {
    border-left: 4px solid var(--success);
}

.notification.error {
    border-left: 4px solid var(--danger);
}

.notification.info {
    border-left: 4px solid var(--info);
}

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

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

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

.notification.info i {
    color: var(--info);
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
    }

    .search-box input {
        width: 100%;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-left,
    .toolbar-right {
        width: 100%;
        justify-content: space-between;
    }

    .folders-grid,
    .images-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

    .modal-content {
        max-width: 95vw;
    }

    .notifications {
        left: 1rem;
        right: 1rem;
    }

    .notification {
        min-width: auto;
    }
}

/* ========== 滚动条 ========== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}
/* ========== 上传统计 ========== */
.upload-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
}

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

.stat-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-value.success {
    color: var(--success);
}

.stat-value.error {
    color: var(--danger);
}

/* 上传列表滚动 */
#uploadList {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

#uploadList::-webkit-scrollbar {
    width: 6px;
}

#uploadList::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 3px;
}

/* 上传项状态图标 */
.upload-item .status-icon {
    font-size: 1.25rem;
    min-width: 1.5rem;
}

.upload-item .status-icon.uploading {
    color: var(--primary);
}

.upload-item .status-icon.success {
    color: var(--success);
}

.upload-item .status-icon.error {
    color: var(--danger);
}

/* 文件路径显示 */
.upload-item-path {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .upload-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .toolbar-left {
        flex-wrap: wrap;
    }
    
    #uploadFolderBtn span {
        display: none;
    }
}
/* ========== 优化预览模态框样式 ========== */

/* 模态框头部优化 */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    gap: 2rem;
}

.modal-info {
    flex: 1;
    min-width: 0;
}

.modal-info h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-info p {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.modal-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.modal-actions .divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 0.25rem;
}

.modal-actions .btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-actions .btn-icon:hover {
    background: var(--hover-bg);
    transform: translateY(-2px);
}

.modal-actions .btn-icon.btn-danger:hover {
    background: var(--danger-color);
    color: white;
}

/* 模态框主体 */
.modal-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-secondary);
    overflow: hidden;
    position: relative;
}

.modal-body img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* 模态框底部 */
.modal-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem 2rem;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
}

.modal-footer .btn-icon {
    width: 48px;
    height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    transition: all 0.2s;
}

.modal-footer .btn-icon:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

.modal-footer .btn-icon i {
    font-size: 1.25rem;
}

/* 大尺寸模态框 */
.modal-large {
    width: 90vw;
    height: 90vh;
    max-width: 1400px;
    max-height: 900px;
    display: flex;
    flex-direction: column;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .modal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem;
    }

    .modal-info h3 {
        font-size: 1rem;
    }

    .modal-actions {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .modal-actions .btn-icon {
        width: 36px;
        height: 36px;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-footer {
        padding: 1rem;
    }

    .modal-footer .btn-icon {
        width: 44px;
        height: 44px;
    }

    .modal-large {
        width: 100vw;
        height: 100vh;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }
}

/* 暗色主题适配 */
[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    background: var(--card-bg);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .modal-body {
    background: rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .modal-body img {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .modal-actions .divider {
    background: rgba(255, 255, 255, 0.1);
}

/* 动画优化 */
.modal-content {
    animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 按钮hover效果优化 */
.btn-icon {
    position: relative;
    overflow: hidden;
}

.btn-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.btn-icon:hover::before {
    width: 100%;
    height: 100%;
}

.btn-icon i {
    position: relative;
    z-index: 1;
}
/* ========== 优化预览模态框样式 ========== */

/* 模态框头部优化 */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    gap: 2rem;
}

.modal-info {
    flex: 1;
    min-width: 0;
}

.modal-info h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-info p {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.modal-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.modal-actions .divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 0.25rem;
}

.modal-actions .btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-actions .btn-icon:hover {
    background: var(--hover-bg);
    transform: translateY(-2px);
}

.modal-actions .btn-icon.btn-danger:hover {
    background: var(--danger-color);
    color: white;
}

/* 模态框主体 */
.modal-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-secondary);
    overflow: hidden;
    position: relative;
}

.modal-body img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* 模态框底部 */
.modal-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem 2rem;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
}

.modal-footer .btn-icon {
    width: 48px;
    height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    transition: all 0.2s;
}

.modal-footer .btn-icon:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

.modal-footer .btn-icon i {
    font-size: 1.25rem;
}

/* 大尺寸模态框 */
.modal-large {
    width: 90vw;
    height: 90vh;
    max-width: 1400px;
    max-height: 900px;
    display: flex;
    flex-direction: column;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .modal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem;
    }

    .modal-info h3 {
        font-size: 1rem;
    }

    .modal-actions {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .modal-actions .btn-icon {
        width: 36px;
        height: 36px;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-footer {
        padding: 1rem;
    }

    .modal-footer .btn-icon {
        width: 44px;
        height: 44px;
    }

    .modal-large {
        width: 100vw;
        height: 100vh;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }
}

/* 暗色主题适配 */
[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    background: var(--card-bg);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .modal-body {
    background: rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .modal-body img {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .modal-actions .divider {
    background: rgba(255, 255, 255, 0.1);
}

/* 动画优化 */
.modal-content {
    animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 按钮hover效果优化 */
.btn-icon {
    position: relative;
    overflow: hidden;
}

.btn-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.btn-icon:hover::before {
    width: 100%;
    height: 100%;
}

.btn-icon i {
    position: relative;
    z-index: 1;
}
/* ========== 优化预览模态框样式 ========== */

/* 模态框头部优化 */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    gap: 2rem;
}

.modal-info {
    flex: 1;
    min-width: 0;
}

.modal-info h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-info p {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.modal-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.modal-actions .divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 0.25rem;
}

.modal-actions .btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-actions .btn-icon:hover {
    background: var(--hover-bg);
    transform: translateY(-2px);
}

.modal-actions .btn-icon.btn-danger:hover {
    background: var(--danger-color);
    color: white;
}

/* 模态框主体 */
.modal-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-secondary);
    overflow: hidden;
    position: relative;
}

.modal-body img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* 模态框底部 */
.modal-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem 2rem;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
}

.modal-footer .btn-icon {
    width: 48px;
    height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    transition: all 0.2s;
}

.modal-footer .btn-icon:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

.modal-footer .btn-icon i {
    font-size: 1.25rem;
}

/* 大尺寸模态框 */
.modal-large {
    width: 90vw;
    height: 90vh;
    max-width: 1400px;
    max-height: 900px;
    display: flex;
    flex-direction: column;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .modal-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem;
    }

    .modal-info h3 {
        font-size: 1rem;
    }

    .modal-actions {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .modal-actions .btn-icon {
        width: 36px;
        height: 36px;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-footer {
        padding: 1rem;
    }

    .modal-footer .btn-icon {
        width: 44px;
        height: 44px;
    }

    .modal-large {
        width: 100vw;
        height: 100vh;
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }
}

/* 暗色主题适配 */
[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer {
    background: var(--card-bg);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .modal-body {
    background: rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .modal-body img {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .modal-actions .divider {
    background: rgba(255, 255, 255, 0.1);
}

/* 动画优化 */
.modal-content {
    animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 按钮hover效果优化 */
.btn-icon {
    position: relative;
    overflow: hidden;
}

.btn-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.btn-icon:hover::before {
    width: 100%;
    height: 100%;
}

.btn-icon i {
    position: relative;
    z-index: 1;
}
