/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.header p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 700px;
    margin: 0 auto;
}

/* 应用容器 */
.app-container {
    padding: 30px;
}

/* 步骤指示器 */
.steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
}

.steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 10%;
    width: 80%;
    height: 3px;
    background-color: #e0e0e0;
    z-index: 1;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    flex: 1;
}

.step.active .step-number {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(106, 17, 203, 0.3);
}

.step.active .step-text {
    color: #6a11cb;
    font-weight: 600;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e0e0e0;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.step-text {
    font-size: 0.9rem;
    color: #888;
    text-align: center;
    transition: all 0.3s ease;
}

/* 区域样式 */
.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

.section-header {
    margin-bottom: 25px;
    text-align: center;
}

.section-header h3 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.section-header p {
    color: #666;
    font-size: 1rem;
}

/* 上传区域 */
.upload-area {
    border: 3px dashed #6a11cb;
    border-radius: 12px;
    padding: 60px 30px;
    text-align: center;
    background-color: #f9f7ff;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 30px;
}

.upload-area:hover {
    background-color: #f0ebff;
    border-color: #2575fc;
}

.upload-area.drag-over {
    background-color: #e8e2ff;
    border-color: #2575fc;
    transform: scale(1.01);
}

.upload-icon {
    font-size: 4rem;
    color: #6a11cb;
    margin-bottom: 20px;
}

.upload-area h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
}

.upload-area p {
    color: #666;
    margin-bottom: 20px;
}

.upload-area input[type="file"] {
    display: none;
}

.file-info {
    margin-top: 20px;
    padding: 15px;
    background-color: #f0f0f0;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #555;
}

/* 进度条 */
.upload-progress {
    margin-top: 30px;
}

.progress-bar {
    height: 20px;
    background-color: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6a11cb 0%, #2575fc 100%);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    color: #666;
    font-weight: 500;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

.btn.primary {
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
}

.btn.primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(106, 17, 203, 0.3);
}

.btn.secondary {
    background-color: #f0f0f0;
    color: #333;
}

.btn.secondary:hover:not(:disabled) {
    background-color: #e0e0e0;
}

.btn.success {
    background: linear-gradient(135deg, #2ecc71 0%, #1abc9c 100%);
    color: white;
}

.btn.success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.3);
}

.controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

/* 图片网格 */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.image-item {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    background-color: white;
    transition: all 0.3s ease;
    cursor: pointer;
}

.image-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: #6a11cb;
}

.image-item.selected {
    border-color: #2575fc;
    box-shadow: 0 5px 15px rgba(37, 117, 252, 0.2);
}

.image-preview {
    width: 100%;
    height: 120px;
    object-fit: cover;
    background-color: #f5f5f5;
}

.image-info {
    padding: 15px;
}

.image-name {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-size {
    font-size: 0.8rem;
    color: #777;
}

.image-checkbox {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    accent-color: #2575fc;
}

/* 替换表单 */
.replace-item {
    background-color: #f9f9f9;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.replace-thumb {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    background-color: #f0f0f0;
}

.replace-details {
    flex: 1;
}

.replace-filename {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.replace-info {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
}

.replace-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.9rem;
}

/* 下载区域 */
.download-info {
    display: flex;
    justify-content: center;
    margin: 40px 0;
}

.file-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px;
    background-color: #f9f7ff;
    border-radius: 12px;
    border: 2px solid #6a11cb;
    max-width: 500px;
}

.file-icon {
    font-size: 3rem;
    color: #6a11cb;
}

.file-details h4 {
    font-size: 1.3rem;
    margin-bottom: 5px;
    color: #333;
}

.file-size {
    color: #666;
    margin-bottom: 5px;
}

.file-meta {
    color: #888;
    font-size: 0.9rem;
}

/* 状态消息 */
.status-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    display: none;
}

.status-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.status-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.status-message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    display: block;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    color: #333;
    cursor: pointer;
    z-index: 10;
}

.close-modal:hover {
    color: #6a11cb;
}

.modal-body {
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 添加在CSS文件末尾 */

/* 图片操作按钮 */
.image-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

.btn.small {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 5px;
}

.btn.replace-btn {
    background: linear-gradient(135deg, #ff7e5f 0%, #feb47b 100%);
    color: white;
}

.btn.replace-btn:hover {
    background: linear-gradient(135deg, #ff6b4a 0%, #fea05e 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(255, 126, 95, 0.3);
}

/* 单个替换区域 */
.replace-single-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.replace-single-header h4 {
    color: #6a11cb;
    font-size: 1.2rem;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .image-actions {
        flex-direction: column;
    }
    
    .btn.small {
        width: 100%;
    }
}

/* 主题标签页样式 */
.theme-tabs {
    display: flex;
    background: #f5f5f5;
    border-radius: 10px;
    padding: 5px;
    margin-bottom: 25px;
    overflow: hidden;
}

.theme-tab {
    flex: 1;
    padding: 15px 20px;
    text-align: center;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    color: #666;
}

.theme-tab.active {
    background: white;
    color: #333;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.theme-tab[data-theme="light"].active {
    color: #ff9800;
}

.theme-tab[data-theme="dark"].active {
    color: #673ab7;
}

.theme-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.5);
}

.file-count {
    background: #e0e0e0;
    color: #666;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: normal;
}

.theme-tab.active .file-count {
    background: rgba(0, 0, 0, 0.1);
}

/* 主题内容区域 */
.theme-content {
    position: relative;
    min-height: 300px;
}

.theme-pane {
    display: none;
    animation: fadeIn 0.3s ease;
}

.theme-pane.active {
    display: block;
}

.pane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.pane-header h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #333;
}

.pane-header h4 i {
    font-size: 1.2rem;
}

.pane-header .controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 文件夹结构显示 */
.folder-structure {
    margin-top: 15px;
    text-align: left;
}

.folder-structure pre {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 15px;
    font-size: 0.85rem;
    overflow-x: auto;
    margin: 10px 0;
    color: #495057;
}

/* 主题信息标签 */
.theme-info {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-right: 20px;
    font-size: 0.9rem;
    color: #666;
}

.theme-info i {
    font-size: 1rem;
}

.theme-info:first-child i {
    color: #ff9800;
}

.theme-info:last-child i {
    color: #673ab7;
}

/* 图片项主题标识 */
.image-item[data-theme="light"] {
    border-left: 4px solid #ff9800;
}

.image-item[data-theme="dark"] {
    border-left: 4px solid #673ab7;
}

.image-theme {
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
    margin-top: 5px;
    display: inline-block;
}

.image-theme.light {
    background: #fff3e0;
    color: #ff9800;
}

.image-theme.dark {
    background: #f3e5f5;
    color: #673ab7;
}

/* 模态框主题信息 */
#preview-theme {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

#preview-theme i {
    margin-right: 5px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .theme-tabs {
        flex-direction: column;
    }
    
    .theme-tab {
        padding: 12px;
    }
    
    .pane-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .pane-header .controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .theme-info {
        display: block;
        margin-right: 0;
        margin-bottom: 5px;
    }
}
/* 子文件夹信息样式 */
.image-subfolder {
    font-size: 0.75rem;
    color: #666;
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-subfolder i {
    color: #ff9800;
    font-size: 0.7rem;
}

/* 文件夹结构显示优化 */
.folder-structure {
    margin-top: 15px;
    text-align: left;
}

.folder-structure pre {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 15px;
    font-size: 0.85rem;
    overflow-x: auto;
    margin: 10px 0;
    color: #495057;
    line-height: 1.4;
}

/* 图片预览模态框中的子文件夹信息 */
#preview-theme {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
}

#preview-theme i {
    margin-right: 5px;
}
/* 添加替换操作的反馈样式 */
.replacing {
    opacity: 0.7;
    position: relative;
}

.replacing::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 123, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #007bff;
    font-weight: bold;
    font-size: 0.9rem;
}

/* 替换状态样式 */
.image-item.replacing {
    opacity: 0.7;
    background: linear-gradient(45deg, transparent 25%, rgba(0,123,255,0.1) 25%, rgba(0,123,255,0.1) 50%, transparent 50%, transparent 75%, rgba(0,123,255,0.1) 75%);
    background-size: 20px 20px;
    animation: replaceShine 1s infinite linear;
}

@keyframes replaceShine {
    0% { background-position: 0 0; }
    100% { background-position: 20px 20px; }
}

/* 替换成功标记 */
.image-name span {
    margin-left: 5px;
    font-weight: normal;
}

/* 强制图片重新加载 */
.image-preview {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

/* 调试信息样式 */
.debug-info {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    padding: 10px;
    margin: 10px 0;
    font-size: 0.9rem;
    color: #495057;
}

.debug-info pre {
    background: #e9ecef;
    padding: 10px;
    border-radius: 3px;
    overflow: auto;
    max-height: 200px;
}


/* 简化后的按钮样式 */
.btn.small {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 5px;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn.small:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(106, 17, 203, 0.3);
}

.btn.small:active {
    transform: translateY(0);
}

/* 移除不需要的选择相关样式 */
.select-all-theme,
.deselect-all-theme,
.image-checkbox {
    display: none;
}
#preview-image {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    margin-bottom: 20px;
    border-radius: 8px;
    background-color: #f5f5f5;
}

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

/* 页脚 */
.footer {
    padding: 20px 30px;
    background-color: #f9f9f9;
    text-align: center;
    color: #666;
    border-top: 1px solid #eee;
}

.footer p {
    margin-bottom: 5px;
}

.hint {
    font-size: 0.9rem;
    color: #888;
    font-style: italic;
}
.hint-text {
    font-size: 0.9rem;
    color: #666;
    margin: 5px 0;
}

.hint-list {
    text-align: left;
    margin: 10px auto;
    max-width: 400px;
    padding-left: 20px;
}

.hint-list li {
    margin: 5px 0;
    font-size: 0.9rem;
    color: #555;
}
/* 响应式设计 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .app-container {
        padding: 20px;
    }
    
    .steps {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .steps::before {
        display: none;
    }
    
    .step {
        flex-direction: row;
        gap: 15px;
        width: 100%;
    }
    
    .step-text {
        text-align: left;
    }
    
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .replace-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .replace-thumb {
        width: 100%;
        height: 150px;
    }
    
    .file-card {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}