:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #7c3aed;
    --dark-color: #111827;
    --light-color: #f9fafb;
    --gray-color: #6b7280;
    --light-gray: #e5e7eb;
    --lighter-gray: #f3f4f6;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --border-radius: 12px;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --box-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.2s ease-in-out;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--lighter-gray);
    color: var(--dark-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* 顶部导航 */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark-color);
    text-decoration: none;
}

.logo-icon {
    color: var(--primary-color);
    margin-right: 0.5rem;
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--gray-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 0;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.nav-link:hover::after {
    width: 100%;
}

/* 主内容区 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

/* 左侧表单面板 */
.form-panel {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--box-shadow);
    height: fit-content;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* 右侧结果面板 */
.result-panel {
    background-color: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--box-shadow);
    border: 1px solid rgba(0, 0, 0, 0.05);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.result-panel .panel-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--light-gray);
}

.result-panel .panel-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #4F46E5;
}
.result-panel .panel-subtitle {
    color: var(--gray-color);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* 结果容器 */
.result-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 600px;
}

/* 结果占位符 */
.result-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    color: var(--gray-color);
    padding: 3rem;
    border: 2px dashed var(--light-gray);
    border-radius: var(--border-radius);
}

.result-placeholder i {
    font-size: 5rem;
    color: var(--light-gray);
    margin-bottom: 1.5rem;
}

.result-placeholder h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.panel-header {
    margin-bottom: 1.5rem;
}

.panel-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #4F46E5;
}

.panel-subtitle {
    color: var(--gray-color);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--dark-color);
}

.required {
    color: var(--error-color);
}

/* API密钥输入框容器 */
.api-key-wrapper {
    position: relative;
    width: 100%;
}

/* 清除按钮样式 */
.clear-api-key-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    font-size: 1.1rem;
    transition: var(--transition);
    opacity: 0.7;
    z-index: 2;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-api-key-btn:hover {
    color: var(--error-color);
    opacity: 1;
}

/* 默认隐藏清除按钮 */
.clear-api-key-btn {
    display: none;
}

/* 输入框有内容时显示按钮 */
.clear-api-key-btn.show {
    display: flex;
}

/* 显示/隐藏密码按钮样式 */
.toggle-visibility-btn {
    position: absolute;
    right: 42px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    font-size: 1.1rem;
    transition: var(--transition);
    opacity: 0.7;
    z-index: 2;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-visibility-btn:hover {
    color: var(--primary-color);
    opacity: 1;
}

/* 调整输入框内边距以容纳两个按钮 */
#api_key {
    padding-right: 70px !important;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
    background-color: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
}

/* 文件上传区域 */
.file-upload-area {
    border: 2px dashed var(--light-gray);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background-color: white;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background-color: rgba(79, 70, 229, 0.02);
}

.file-upload-icon {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.file-upload-text {
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark-color);
}

.file-upload-hint {
    color: var(--gray-color);
    font-size: 0.8rem;
}

/* 粘贴提示样式 */
.file-upload-area.paste-hint::after {
    content: '\f0ea  Ctrl+V 粘贴图片'; /* fa-paste */
    font-family: 'Font Awesome 5 Free', 'FontAwesome', Arial, sans-serif;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 6px;
    position: absolute;
    top: 12px;
    right: 12px;
    left: auto;
    transform: none;
    background: #4F46E5;
    color: #fff;
    padding: 4px 12px 4px 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(79,70,229,0.08);
    transition: opacity 0.3s;
    height: 28px;
    line-height: 1;
}
.file-upload-area.paste-hint:hover::after {
    opacity: 1;
}

/* 键盘快捷键样式 */
kbd {
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 0.8rem;
    font-family: 'Courier New', monospace;
    color: #374151;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 图片预览 */
.image-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.preview-item {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    background-color: #f8f9fa; /* 添加背景色 */
    display: flex; /* 使用flex布局 */
    align-items: center; /* 垂直居中 */
    justify-content: center; /* 水平居中 */
    aspect-ratio: 1/1; /* 保持正方形比例，可根据需要调整 */
    min-height: 120px; /* 最小高度 */
}

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

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* 完整显示图片 */
    padding: 5px; /* 添加内边距 */
    max-height: 100%; /* 限制最大高度 */
}

.preview-remove {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 1.5rem;
    height: 1.5rem;
    background-color: var(--error-color);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.7; /* 默认显示但半透明 */
    transition: var(--transition);
    z-index: 10; /* 确保在图片上方 */
}

.preview-item:hover .preview-remove {
    opacity: 1; /* 悬停时完全显示 */
}

/* 清除按钮样式 */
.clear-preview-btn {
    margin-top: 1rem;
    width: 100%;
    background-color: var(--primary-color) !important;
    color: #fff !important;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3), 0 2px 4px -1px rgba(79, 70, 229, 0.1) !important;
    border: none !important;
}

.clear-preview-btn:hover {
    background-color: var(--primary-hover) !important;
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3), 0 4px 6px -2px rgba(79, 70, 229, 0.1) !important;
    transform: translateY(-1px);
}
/* 表单网格布局 */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-family: inherit;
    font-size: 0.95rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3), 0 2px 4px -1px rgba(79, 70, 229, 0.1);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.3), 0 4px 6px -2px rgba(79, 70, 229, 0.1);
    transform: translateY(-1px);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-icon {
    margin-right: 0.5rem;
}

/* 结果展示区域 */
.result-container {
    margin-top: 0rem;
}

/* 生成的图片网格 */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

/* 图片卡片容器样式 */
.image-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

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

/* 图片容器样式 - 修改为自适应 */
.image-container {
    width: 100%;
    height: auto; /* 改为自适应高度 */
    min-height: 200px; /* 设置最小高度 */
    max-height: 400px; /* 设置最大高度 */
    overflow: hidden;
    position: relative;
    display: flex; /* 使用flex布局 */
    align-items: center; /* 垂直居中 */
    justify-content: center; /* 水平居中 */
    background-color: #f8f9fa; /* 添加背景色 */
    padding: 10px; /* 添加内边距 */
}

.image-container {
    position: relative;
}

.image-container img {
    width: 100%;
    height: auto; /* 改为自适应高度 */
    max-height: 100%; /* 限制最大高度 */
    object-fit: contain; /* 完整显示图片 */
    display: block;
    cursor: pointer;
    transition: transform 0.3s ease;
}



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



/* 图片元信息样式 */
.image-meta {
    padding: 12px;
    background: white;
    border-top: 1px solid var(--light-gray);
}

.model-info, .mode-info {
    font-size: 0.85rem;
    color: var(--dark-color);
    margin: 4px 0;
}

.model-info {
    font-weight: 500;
    color: var(--primary-color);
}

.mode-info {
    color: var(--secondary-color);
}

/* 移除重复的.image-card img样式 */
/* 翻译信息样式 */
.translation-info {
    margin-top: 8px;
    padding: 8px;
    background: rgba(79, 70, 229, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(79, 70, 229, 0.1);
}

.translation-label {
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 4px;
}

.original-prompt, .translated-prompt {
    font-size: 0.75rem;
    color: var(--gray-color);
    margin: 2px 0;
    line-height: 1.3;
    cursor: help;
}

.original-prompt {
    color: var(--dark-color);
}

.translated-prompt {
    color: var(--secondary-color);
    font-style: italic;
}

/* 配置加载状态 */
.config-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
    margin-left: 5px;
    color: var(--gray-color);
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: var(--dark-color);
    color: white;
    text-align: center;
    border-radius: 4px;
    padding: 0.5rem;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.8rem;
    line-height: 1.4;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* 高级参数面板 */
.advanced-panel {
    background-color: rgba(79, 70, 229, 0.03);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(79, 70, 229, 0.1);
}

.advanced-panel .panel-header {
    margin-bottom: 1rem;
}

.advanced-panel .panel-title {
    font-size: 1.2rem;
    color: var(--primary-color);
}
/* 滑块样式 */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--light-gray);
    outline: none;
    padding: 0;
    margin: 10px 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: var(--primary-hover);
}

.range-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
}

.range-labels span {
    font-size: 0.8rem;
    color: var(--gray-color);
}

.range-value {
    font-weight: 500;
    color: var(--primary-color);
    text-align: center;
    margin-top: 0.5rem;
}

/* 复选框样式 */
.checkbox-container {
    display: flex;
    align-items: center;
    margin-top: 0.5rem;
}

.checkbox-container input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    margin-right: 0.5rem;
    cursor: pointer;
}

.checkbox-container label {
    cursor: pointer;
    user-select: none;
    color: var(--dark-color);
}

/* 翻译对比样式 */
.translation-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* 图像对比样式 */
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: center;
}

.before-section, .after-section {
    position: relative;
}

.comparison-section {
    margin-bottom: 30px;
}

.image-comparison {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    transition: var(--transition);
}

.image-comparison:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .translation-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .comparison-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .image-comparison {
        padding: 15px;
    }

    .before-section, .after-section {
        margin-bottom: 10px;
    }

    .comparison-section .flex {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    .result-panel {
        margin-bottom: 2rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .navbar {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 1.5rem;
    }

    .nav-links {
        margin-top: 1rem;
        gap: 1rem;
        flex-wrap: wrap;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .image-grid {
        grid-template-columns: 1fr;
    }
}

/* 实用类 */
.hidden {
    display: none;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

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

.text-muted {
    color: var(--gray-color);
}

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

.flex {
    display: flex;
}

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

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

/* 美化弹窗样式 */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(30, 41, 59, 0.35);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s;
}

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

.custom-modal {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(60, 60, 120, 0.18), 0 1.5px 6px rgba(0,0,0,0.08);
    padding: 2.2rem 2.5rem 1.5rem 2.5rem;
    min-width: 320px;
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    animation: modalPop 0.25s cubic-bezier(.25,1.7,.5,1.25);
}

@keyframes modalPop {
    0% { transform: scale(0.85); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.custom-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.7rem;
    text-align: center;
}

.custom-modal-message {
    color: var(--dark-color);
    font-size: 1rem;
    margin-bottom: 1.2rem;
    text-align: center;
    word-break: break-all;
    white-space: pre-line;
}

.custom-modal-btn {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 0.6rem 2.2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.08);
    transition: background 0.2s, transform 0.2s;
    margin-top: 0.5rem;
}
.custom-modal-btn:hover {
    background: linear-gradient(90deg, var(--primary-hover), var(--secondary-color));
    transform: translateY(-2px) scale(1.04);
}

@media (max-width: 600px) {
    .custom-modal {
        min-width: 80vw;
        padding: 1.2rem 0.5rem 1rem 0.5rem;
    }
    .custom-modal-title {
        font-size: 1.1rem;
    }
    .custom-modal-message {
        font-size: 0.95rem;
    }
}

/* 动态等待动画（圆环加载） */
.result-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 380px;
    padding: 2.5rem 0;
}
.result-loading-spinner {
    width: 64px;
    height: 64px;
    border: 6px solid #e5e7eb;
    border-top: 6px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 18px;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.result-loading-dots {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
}
.result-loading-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary-color);
    opacity: 0.3;
    animation: dotBlink 1.2s infinite;
}
.result-loading-dot:nth-child(2) {
    animation-delay: 0.2s;
    opacity: 0.6;
}
.result-loading-dot:nth-child(3) {
    animation-delay: 0.4s;
    opacity: 1;
}
@keyframes dotBlink {
    0%, 80%, 100% { opacity: 0.3; }
    40% { opacity: 1; }
}
.result-loading-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.result-loading-desc {
    color: var(--gray-color);
    font-size: 1rem;
    margin-bottom: 1.2rem;
    text-align: center;
}

/* 历史记录样式 */
.current-generation-section {
    margin-bottom: 2rem;
}

.history-section {
    border-top: 1px solid #e5e7eb;
    padding-top: 1.5rem;
}

.history-section .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.history-controls {
    display: flex;
    gap: 0.5rem;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8rem;
}

.history-container {
    min-height: 200px;
    background: #f9fafb;
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #e5e7eb;
}

.history-content {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    min-height: 120px;
}

.history-item {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 80px;
    height: 80px;
}

.history-item:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.history-item-image {
    width: 100%;
    height: 100%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.history-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.history-item-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.history-item-placeholder {
    width: 80px;
    height: 80px;
    background: #f3f4f6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 0.75rem;
    text-align: center;
    padding: 0.5rem;
}

.history-item-placeholder i {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.history-item-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.25rem;
    font-size: 0.7rem;
    text-align: center;
    color: #374151;
}

.history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 0.9rem;
    text-align: center;
    padding: 2rem;
    width: 100%;
}

.history-empty i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

/* 图片预览模态框 */
.preview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.preview-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.preview-content {
    background: white;
    border-radius: 12px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    position: relative;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}



.preview-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #374151;
}

.preview-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.preview-close:hover {
    color: #374151;
}

.preview-body {
    padding: 1.5rem;
    text-align: center;
}

.preview-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
}

.preview-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    gap: 1rem;
}

.preview-nav-btn {
    background: #4f46e5;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 0.9rem;
}

.preview-nav-btn:hover {
    background: #4338ca;
}

.preview-nav-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.preview-dots {
    display: flex;
    gap: 0.5rem;
}

.preview-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d1d5db;
    cursor: pointer;
    transition: background 0.2s ease;
}

.preview-dot.active {
    background: #4f46e5;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .history-content {
        gap: 0.5rem;
    }
    
    .history-item {
        width: 60px;
        height: 60px;
    }
    
    .history-item-image,
    .history-item-placeholder {
        width: 100%;
        height: 100%;
    }
    
    .history-item-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .preview-content {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
    }
    
    .preview-header {
        padding: 0.75rem 1rem;
    }
    
    .preview-body {
        padding: 1rem;
    }
}

/* 彻底移除购买卡密按钮的下划线 */
a.recharge-btn::after, a.recharge-btn.active::after, .recharge-btn.shared-nav-link.active::after {
    display: none !important;
    content: none !important;
}

/* 强制统一导航按钮字体粗细 */
.shared-nav-link {
    font-weight: 600 !important;
}
.shared-nav-link.active {
    font-weight: 700 !important;
}