@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

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

/* 🌙 夜晚模式（默认） */
:root {
    --bg-primary: #0a0a0b;
    --bg-secondary: #1a1a1d;
    --bg-tertiary: #252528;
    --accent-primary: #f97316;
    --accent-secondary: #10b981;
    --text-primary: #f5f5f7;
    --text-secondary: #86868b;
    --border-color: rgba(255, 255, 255, 0.08);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);
}

/* ☀️ 白天模式 */
[data-theme="light"] {
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f3f5;
    --accent-primary: #f97316;
    --accent-secondary: #10b981;
    --text-primary: #1a1a1d;
    --text-secondary: #6c757d;
    --border-color: rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.12);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background 0.3s ease, color 0.3s ease;
    position: relative;
}

/* 🎨 夜晚模式背景装饰 */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(249, 115, 22, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(16, 185, 129, 0.06) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(251, 191, 36, 0.04) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
    animation: breathe 8s ease-in-out infinite;
}

/* 🎨 夜晚模式细腻网格 */
body::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(249, 115, 22, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(249, 115, 22, 0.02) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.6;
}

@keyframes breathe {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

/* 🎨 边角装饰元素 */
body {
    --corner-size: 100px;
}

/* 左上角 */
header::before {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    width: var(--corner-size);
    height: var(--corner-size);
    background: radial-gradient(circle, rgba(249, 115, 22, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(20px);
    pointer-events: none;
    z-index: -1;
    animation: float 6s ease-in-out infinite;
}

/* 右上角 */
header::after {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: var(--corner-size);
    height: var(--corner-size);
    background: radial-gradient(circle, rgba(251, 191, 36, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(20px);
    pointer-events: none;
    z-index: -1;
    animation: float 7s ease-in-out infinite reverse;
}

/* 左下角装饰 */
.main-container::before {
    content: '';
    position: absolute;
    bottom: -60px;
    left: -60px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(25px);
    pointer-events: none;
    z-index: -1;
    animation: float 8s ease-in-out infinite;
}

/* 右下角装饰 */
.main-container::after {
    content: '';
    position: absolute;
    bottom: -60px;
    right: -60px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.10) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(25px);
    pointer-events: none;
    z-index: -1;
    animation: float 9s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(10px, -10px) scale(1.1); }
}

/* ☀️ 白天模式背景装饰 */
[data-theme="light"] body {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

[data-theme="light"] body::before {
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(249, 115, 22, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(16, 185, 129, 0.10) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(251, 191, 36, 0.08) 0%, transparent 60%);
}

[data-theme="light"] body::after {
    background-image: 
        linear-gradient(rgba(249, 115, 22, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(249, 115, 22, 0.04) 1px, transparent 1px);
    opacity: 0.5;
}

[data-theme="light"] header::before {
    background: radial-gradient(circle, rgba(249, 115, 22, 0.20) 0%, transparent 70%);
}

[data-theme="light"] header::after {
    background: radial-gradient(circle, rgba(251, 191, 36, 0.18) 0%, transparent 70%);
}

[data-theme="light"] .main-container::before {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.18) 0%, transparent 70%);
}

[data-theme="light"] .main-container::after {
    background: radial-gradient(circle, rgba(239, 68, 68, 0.15) 0%, transparent 70%);
}

header {
    width: 100%;
    max-width: 1400px;
    margin-bottom: 1rem;
    text-align: center;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fbbf24 0%, #f97316 50%, #ef4444 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.02em;
}

/* 🌓 主题切换按钮 */
.theme-toggle {
    position: absolute;
    top: 0;
    right: 1rem;
    width: 48px;
    height: 48px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
    z-index: 100;
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(20deg);
    border-color: var(--accent-primary);
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.3);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-icon {
    font-size: 1.5rem;
    transition: transform 0.4s ease;
}

.theme-toggle:hover .theme-icon {
    transform: rotate(-20deg);
}

/* 🌓 主题特定样式优化 */

/* 白天模式光晕效果 */
[data-theme="light"] .controls-container::before {
    background: radial-gradient(circle at top, rgba(249, 115, 22, 0.08) 0%, transparent 70%);
}

/* 白天模式上传区域悬停 */
[data-theme="light"] .upload-area:hover {
    background: rgba(249, 115, 22, 0.08);
}

/* 白天模式输入框焦点 */
[data-theme="light"] input:focus,
[data-theme="light"] textarea:focus {
    background: rgba(249, 115, 22, 0.03);
}

/* 白天模式进度条阴影优化 */
[data-theme="light"] .progress-fill {
    box-shadow: 0 0 8px rgba(249, 115, 22, 0.4);
}

/* 白天模式下载按钮悬停 */
[data-theme="light"] .download-btn:hover {
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.25);
}

/* 白天模式主题切换按钮 */
[data-theme="light"] .theme-toggle {
    background: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .theme-toggle:hover {
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.2);
}

.main-container {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 1rem;
    width: 100%;
    max-width: 1400px;
    flex: 1;
    min-height: 600px;
    overflow: visible;
    position: relative;
    z-index: 10;
}

/* 左侧控制面板 */
.controls-container {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    overflow-y: auto;
    overflow-x: hidden;
    backdrop-filter: blur(20px);
    position: relative;
    height: 100%;
    scrollbar-width: thin;
}

.controls-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: radial-gradient(circle at top, rgba(249, 115, 22, 0.1) 0%, transparent 70%);
    border-radius: 16px 16px 0 0;
    pointer-events: none;
}

/* 右侧结果面板 */
.result-container {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    backdrop-filter: blur(20px);
    height: 100%;
    scrollbar-width: thin;
}

/* 区域间距 */
.api-key-section,
.model-section,
.input-method-section,
.prompt-section,
.dimensions-section {
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

/* 标题样式 */
h2 {
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
    text-transform: uppercase;
    opacity: 0.9;
}

/* 输入框样式 */
input[type="password"],
input[type="text"],
textarea {
    width: 100%;
    padding: 0.65rem 0.875rem;
    background: var(--bg-tertiary);
    border: 1.5px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    resize: none;
}

input[type="password"]:focus,
input[type="text"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(249, 115, 22, 0.05);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-secondary);
}

#prompt-input {
    min-height: 70px;
    max-height: 70px;
}

/* 输入方式切换 */
.input-method-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.tab-btn {
    padding: 0.6rem;
    background: var(--bg-tertiary);
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
    transform: translateY(-1px);
    background: rgba(249, 115, 22, 0.05);
}

/* 🎨 标签激活状态 - 美化版 */
.tab-btn.active {
    background: linear-gradient(135deg, #f97316 0%, #fb923c 50%, #fbbf24 100%);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.4), 0 0 12px rgba(251, 146, 60, 0.2);
}

/* 白天模式标签激活 */
[data-theme="light"] .tab-btn.active {
    box-shadow: 0 4px 18px rgba(249, 115, 22, 0.3), 0 2px 8px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .tab-btn:hover {
    background: rgba(249, 115, 22, 0.08);
}

.input-method-content {
    display: none;
}

.input-method-content.active {
    display: block;
}

/* 上传区域 */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 1.25rem 1rem;
    text-align: center;
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    z-index: 10;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(249, 115, 22, 0.1);
    transition: all 0.5s ease;
}

.upload-area:hover::before {
    width: 200%;
    height: 200%;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--accent-primary);
    background: rgba(249, 115, 22, 0.05);
    transform: scale(1.01);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.upload-area.drag-over {
    border-style: solid;
    background: rgba(249, 115, 22, 0.1);
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.15), 0 4px 20px rgba(249, 115, 22, 0.2);
}

.upload-area.drag-over::before {
    width: 250%;
    height: 250%;
}

.upload-area label {
    cursor: pointer;
    display: block;
    position: relative;
    z-index: 10;
}

.upload-area p {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    position: relative;
    z-index: 10;
}

.upload-area span {
    color: var(--text-secondary);
    font-size: 0.8rem;
    position: relative;
    z-index: 10;
}

/* 白天模式上传区域拖拽 */
[data-theme="light"] .upload-area.drag-over {
    background: rgba(249, 115, 22, 0.12);
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.2), 0 4px 20px rgba(249, 115, 22, 0.25);
}

input[type="file"] {
    display: none;
}

/* 缩略图 */
#thumbnails-container,
#url-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 0.5rem;
    margin-top: 0.5rem;
    max-height: 85px;
    overflow-y: auto;
    position: relative;
    z-index: 10;
}

.thumbnail-wrapper,
.url-preview-wrapper {
    position: relative;
    padding-top: 100%;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    z-index: 10;
}

.thumbnail-wrapper:hover,
.url-preview-wrapper:hover {
    border-color: var(--accent-primary);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.2);
}

.thumbnail-wrapper img,
.url-preview-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 20;
}

.thumbnail-wrapper:hover .remove-btn,
.url-preview-wrapper:hover .remove-btn {
    opacity: 1;
}

.remove-btn:hover {
    background: #ef4444;
    transform: scale(1.1);
}

/* 尺寸显示 */
.dimensions-display {
    background: var(--bg-tertiary);
    border-radius: 10px;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
}

.dimension-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
}

.dimension-item:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.dimension-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

.dimension-value {
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 0.9rem;
}

/* 🎨 生成按钮 - 美化版 */
#generate-btn {
    background: linear-gradient(135deg, #f97316 0%, #fb923c 50%, #fbbf24 100%);
    color: white;
    padding: 0.875rem;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.35), 0 0 0 0 rgba(249, 115, 22, 0);
    position: relative;
    overflow: hidden;
}

#generate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

#generate-btn:hover::before {
    left: 100%;
}

#generate-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(249, 115, 22, 0.5), 0 0 20px rgba(251, 191, 36, 0.3);
    background: linear-gradient(135deg, #fb923c 0%, #fbbf24 50%, #fde047 100%);
}

#generate-btn:not(:disabled):active {
    transform: translateY(0);
}

#generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(0.3);
}

/* 白天模式生成按钮 */
[data-theme="light"] #generate-btn {
    box-shadow: 0 4px 20px rgba(249, 115, 22, 0.25), 0 2px 8px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] #generate-btn:not(:disabled):hover {
    box-shadow: 0 8px 32px rgba(249, 115, 22, 0.4), 0 4px 16px rgba(0, 0, 0, 0.15);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* 结果头部 */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.result-header h2 {
    margin: 0;
    font-size: 1.1rem;
    text-transform: none;
}

.result-controls {
    display: flex;
    gap: 0.75rem;
}

/* 🎨 历史记录按钮 - 美化版 */
.history-btn,
.clear-history-btn {
    padding: 0.5rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.history-btn::before,
.clear-history-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.history-btn:hover {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: transparent;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.history-btn:hover::before {
    opacity: 1;
}

.clear-history-btn:hover {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: transparent;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.clear-history-btn:hover::before {
    opacity: 1;
}

/* 白天模式历史按钮 */
[data-theme="light"] .history-btn:hover {
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25), 0 2px 6px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .clear-history-btn:hover {
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.25), 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* 进度显示 */
.progress-container {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.progress-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

#progress-status {
    color: var(--accent-primary);
    font-size: 0.9rem;
    font-weight: 500;
}

.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

/* 🎨 进度条填充 - 美化版 */
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #f97316 0%, #fb923c 50%, #fbbf24 100%);
    border-radius: 10px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 12px rgba(249, 115, 22, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), transparent);
    border-radius: 10px 10px 0 0;
}

/* 白天模式进度条 */
[data-theme="light"] .progress-fill {
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

#progress-text {
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 0.95rem;
    min-width: 50px;
    text-align: right;
}

.progress-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.75rem 0.5rem;
    border-radius: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

/* 🎨 进度步骤激活 - 美化版 */
.step.active {
    background: linear-gradient(135deg, #f97316 0%, #fb923c 50%, #fbbf24 100%);
    border-color: transparent;
    transform: scale(1.05);
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.4), 0 0 12px rgba(251, 146, 60, 0.25);
}

.step.active .step-icon,
.step.active .step-text {
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 🎨 进度步骤完成 - 美化版 */
.step.completed {
    background: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%);
    border-color: transparent;
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3), 0 0 8px rgba(16, 185, 129, 0.2);
}

.step.completed .step-icon,
.step.completed .step-text {
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 白天模式进度步骤 */
[data-theme="light"] .step.active {
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.3), 0 2px 8px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .step.completed {
    box-shadow: 0 3px 12px rgba(16, 185, 129, 0.25), 0 2px 6px rgba(0, 0, 0, 0.08);
}

.step-icon {
    font-size: 1.25rem;
}

.step-text {
    font-size: 0.75rem;
    font-weight: 500;
    text-align: center;
    color: var(--text-secondary);
}

/* 结果图片容器 */
#result-image-container {
    flex: 1;
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    overflow: auto;
    min-height: 300px;
    position: relative;
    z-index: 10;
}

#result-image-container img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease;
}

#result-image-container img:hover {
    transform: scale(1.02);
}

/* 🎨 空白状态美化 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
    animation: floatSlow 4s ease-in-out infinite;
}

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

.empty-text {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.empty-hint {
    color: var(--text-secondary);
    font-size: 0.9rem;
    opacity: 0.8;
}

/* 字符计数器 */
.char-counter {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.3s ease;
}

/* 🎨 图片加载动画 */
.image-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.image-loading p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

#result-image-container p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* 结果信息 */
.result-info {
    margin-top: 0.75rem;
    padding: 0.875rem;
    background: var(--bg-tertiary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.info-item:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.info-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
}

.info-value {
    color: var(--accent-primary);
    font-weight: 600;
    font-size: 0.85rem;
}

/* 下载区域 */
.download-section {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.download-hint {
    color: var(--accent-secondary);
    font-size: 0.8rem;
    padding: 0.6rem 0.875rem;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 8px;
    border-left: 3px solid var(--accent-secondary);
    margin-bottom: 0.75rem;
    font-weight: 500;
}

/* 🎨 下载按钮 - 美化版 */
.download-btn {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35), 0 0 0 0 rgba(16, 185, 129, 0);
    position: relative;
    overflow: hidden;
}

.download-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.download-btn:hover::before {
    left: 100%;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(16, 185, 129, 0.5), 0 0 20px rgba(52, 211, 153, 0.3);
    background: linear-gradient(135deg, #34d399 0%, #10b981 50%, #059669 100%);
}

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

.download-btn.downloading {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 50%, #374151 100%);
    cursor: not-allowed;
    filter: grayscale(0.5);
}

.download-btn.success {
    background: linear-gradient(135deg, #34d399 0%, #10b981 50%, #059669 100%);
    animation: successPulse 0.6s ease;
    box-shadow: 0 6px 24px rgba(16, 185, 129, 0.6), 0 0 30px rgba(52, 211, 153, 0.4);
}

/* 白天模式下载按钮 */
[data-theme="light"] .download-btn {
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.25), 0 2px 8px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .download-btn:hover {
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.35), 0 4px 16px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .download-btn.success {
    box-shadow: 0 6px 28px rgba(16, 185, 129, 0.4), 0 0 24px rgba(52, 211, 153, 0.3);
}

@keyframes successPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.download-icon svg {
    width: 20px;
    height: 20px;
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: var(--bg-secondary);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.modal-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.close-btn {
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #ef4444;
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

/* 历史记录 */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.history-item {
    background: var(--bg-tertiary);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.history-item:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.2);
}

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

.history-item-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.history-item-time {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.history-item-content {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1.5rem;
}

.history-item-image {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.history-item-image:hover {
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

.history-item-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* 🎨 历史记录操作按钮 - 美化版 */
.history-action-btn {
    padding: 0.6rem 1.25rem;
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.history-action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s ease;
}

.history-action-btn:hover::before {
    left: 100%;
}

.history-action-btn:hover {
    transform: translateY(-1px);
}

/* 下载按钮 */
.history-action-btn.download {
    background: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%);
    color: white;
    border: none;
}

.history-action-btn.download:hover {
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4), 0 0 12px rgba(16, 185, 129, 0.2);
    background: linear-gradient(135deg, #34d399 0%, #10b981 50%, #059669 100%);
}

/* 删除按钮 */
.history-action-btn.delete {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 50%, #b91c1c 100%);
    color: white;
    border: none;
}

.history-action-btn.delete:hover {
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4), 0 0 12px rgba(239, 68, 68, 0.2);
    background: linear-gradient(135deg, #f87171 0%, #ef4444 50%, #dc2626 100%);
}

/* 白天模式历史操作按钮 */
[data-theme="light"] .history-action-btn.download:hover {
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3), 0 2px 8px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .history-action-btn.delete:hover {
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3), 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 错误容器 */
.error-container {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-radius: 16px;
    padding: 2rem;
    color: white;
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3);
}

.error-container h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.error-solutions {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 1rem;
}

.error-solutions h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

/* 通用 */
.hidden {
    display: none !important;
}

/* 🎨 Toast通知系统 */
.toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 400px;
}

.toast {
    background: var(--bg-secondary);
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
    min-width: 300px;
}

.toast.success {
    border-left: 4px solid #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, var(--bg-secondary) 100%);
}

.toast.error {
    border-left: 4px solid #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, var(--bg-secondary) 100%);
}

.toast.warning {
    border-left: 4px solid #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, var(--bg-secondary) 100%);
}

.toast.info {
    border-left: 4px solid #3b82f6;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, var(--bg-secondary) 100%);
}

.toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
    color: var(--text-primary);
}

.toast-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.toast-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

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

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

.toast.removing {
    animation: slideOutRight 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* 白天模式Toast */
[data-theme="light"] .toast {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* 响应式 */
@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 1fr;
        height: auto;
        gap: 1.5rem;
    }
    
    .controls-container {
        height: auto;
    }
    
    #result-image-container {
        min-height: 500px;
    }
    
    /* 隐藏背景装饰（移动端性能优化） */
    body::before,
    body::after,
    header::before,
    header::after,
    .main-container::before,
    .main-container::after {
        display: none;
    }
    
    .toast-container {
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
    
    .toast {
        min-width: auto;
    }
}
    
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }
    
    .title {
        font-size: 2rem;
    }
    
    header {
        margin-bottom: 1.5rem;
    }
    
    .controls-container,
    .result-container {
        padding: 1.25rem;
        border-radius: 16px;
    }
    
    .progress-steps {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .modal-header,
    .modal-body {
        padding: 1.25rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0.75rem;
    }
    
    .title {
        font-size: 1.75rem;
    }
    
    .controls-container,
    .result-container {
        padding: 1rem;
    }
    
    .progress-steps {
        grid-template-columns: 1fr;
    }
    
    .history-item-content {
        grid-template-columns: 1fr;
    }
    
    .history-item-image {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
    }
}