/* ========================================
   AI 图像生成器 - 样式表
   阶段一：基础框架与布局结构
   阶段二：主题系统与优雅玻璃效果
   ======================================== */

/* ========================================
   CSS 变量 - 主题系统
   ======================================== */

/* 浅色主题 - 天空蓝（默认） */
:root,
[data-theme="light"][data-skin="blue"] {
    --primary-color: #4a90d9;
    --primary-hover: #357abd;
    --primary-light: rgba(74, 144, 217, 0.15);
    --bg-color: #f0f4f8;
    --text-color: #1a2a3a;
    --text-secondary: #5a6a7a;
    --border-color: rgba(255, 255, 255, 0.6);
    --input-border: rgba(74, 144, 217, 0.3);
    --shadow-color: rgba(74, 144, 217, 0.2);
    --hover-bg: rgba(74, 144, 217, 0.1);

    /* 优雅玻璃效果 - 轻透明 */
    --glass-bg: rgba(255, 255, 255, 0.45);
    --glass-bg-solid: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.7);
    --glass-shadow: 0 8px 32px rgba(100, 120, 140, 0.12);
    --glass-inner-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
    --glass-highlight: rgba(255, 255, 255, 0.9);
    --glass-blur: 20px;
    --input-glass: rgba(255, 255, 255, 0.6);

    /* 柔和背景光球 */
    --orb-1: radial-gradient(circle, rgba(99, 179, 237, 0.4) 0%, rgba(99, 179, 237, 0) 70%);
    --orb-2: radial-gradient(circle, rgba(159, 122, 234, 0.35) 0%, rgba(159, 122, 234, 0) 70%);
    --orb-3: radial-gradient(circle, rgba(72, 187, 120, 0.3) 0%, rgba(72, 187, 120, 0) 70%);
    --orb-4: radial-gradient(circle, rgba(237, 137, 180, 0.25) 0%, rgba(237, 137, 180, 0) 70%);

    /* 柔和渐变背景 */
    --bg-base: linear-gradient(135deg, #e8f4fc 0%, #f5e6f0 25%, #e6f0f5 50%, #f0e8f5 75%, #e8f4fc 100%);
}

/* 浅色主题 - 薄荷绿 */
[data-theme="light"][data-skin="green"] {
    --primary-color: #38a169;
    --primary-hover: #2f855a;
    --primary-light: rgba(56, 161, 105, 0.15);
    --text-color: #1a3a2a;
    --text-secondary: #3d6a4d;
    --input-border: rgba(56, 161, 105, 0.3);
    --shadow-color: rgba(56, 161, 105, 0.2);
    --hover-bg: rgba(56, 161, 105, 0.1);
    --orb-1: radial-gradient(circle, rgba(72, 187, 120, 0.4) 0%, rgba(72, 187, 120, 0) 70%);
    --orb-2: radial-gradient(circle, rgba(56, 178, 172, 0.35) 0%, rgba(56, 178, 172, 0) 70%);
    --orb-3: radial-gradient(circle, rgba(99, 179, 237, 0.3) 0%, rgba(99, 179, 237, 0) 70%);
    --orb-4: radial-gradient(circle, rgba(129, 230, 217, 0.25) 0%, rgba(129, 230, 217, 0) 70%);
    --bg-base: linear-gradient(135deg, #e6f7ed 0%, #e0f5f3 25%, #e6f7ed 50%, #e8faf5 75%, #e6f7ed 100%);
}

/* 浅色主题 - 淡雅紫 */
[data-theme="light"][data-skin="purple"] {
    --primary-color: #805ad5;
    --primary-hover: #6b46c1;
    --primary-light: rgba(128, 90, 213, 0.15);
    --text-color: #2d1f47;
    --text-secondary: #5a4a6a;
    --input-border: rgba(128, 90, 213, 0.3);
    --shadow-color: rgba(128, 90, 213, 0.2);
    --hover-bg: rgba(128, 90, 213, 0.1);
    --orb-1: radial-gradient(circle, rgba(159, 122, 234, 0.4) 0%, rgba(159, 122, 234, 0) 70%);
    --orb-2: radial-gradient(circle, rgba(237, 137, 180, 0.35) 0%, rgba(237, 137, 180, 0) 70%);
    --orb-3: radial-gradient(circle, rgba(99, 179, 237, 0.3) 0%, rgba(99, 179, 237, 0) 70%);
    --orb-4: radial-gradient(circle, rgba(183, 148, 244, 0.25) 0%, rgba(183, 148, 244, 0) 70%);
    --bg-base: linear-gradient(135deg, #f5f0fa 0%, #f0e8f8 25%, #f5f0fa 50%, #efe6f8 75%, #f5f0fa 100%);
}

/* 浅色主题 - 暖阳橙 */
[data-theme="light"][data-skin="orange"] {
    --primary-color: #dd6b20;
    --primary-hover: #c05621;
    --primary-light: rgba(221, 107, 32, 0.15);
    --text-color: #3d2914;
    --text-secondary: #6a5040;
    --input-border: rgba(221, 107, 32, 0.3);
    --shadow-color: rgba(221, 107, 32, 0.2);
    --hover-bg: rgba(221, 107, 32, 0.1);
    --orb-1: radial-gradient(circle, rgba(246, 173, 85, 0.4) 0%, rgba(246, 173, 85, 0) 70%);
    --orb-2: radial-gradient(circle, rgba(237, 137, 180, 0.35) 0%, rgba(237, 137, 180, 0) 70%);
    --orb-3: radial-gradient(circle, rgba(252, 211, 77, 0.3) 0%, rgba(252, 211, 77, 0) 70%);
    --orb-4: radial-gradient(circle, rgba(251, 182, 140, 0.25) 0%, rgba(251, 182, 140, 0) 70%);
    --bg-base: linear-gradient(135deg, #fef6e8 0%, #fef0e0 25%, #fef6e8 50%, #fff5ea 75%, #fef6e8 100%);
}

/* 浅色主题 - 樱花粉 */
[data-theme="light"][data-skin="pink"] {
    --primary-color: #d53f8c;
    --primary-hover: #b83280;
    --primary-light: rgba(213, 63, 140, 0.15);
    --text-color: #3d1f2d;
    --text-secondary: #7a5065;
    --input-border: rgba(213, 63, 140, 0.3);
    --shadow-color: rgba(213, 63, 140, 0.2);
    --hover-bg: rgba(213, 63, 140, 0.1);
    --orb-1: radial-gradient(circle, rgba(237, 137, 180, 0.4) 0%, rgba(237, 137, 180, 0) 70%);
    --orb-2: radial-gradient(circle, rgba(159, 122, 234, 0.35) 0%, rgba(159, 122, 234, 0) 70%);
    --orb-3: radial-gradient(circle, rgba(251, 182, 206, 0.3) 0%, rgba(251, 182, 206, 0) 70%);
    --orb-4: radial-gradient(circle, rgba(254, 198, 198, 0.25) 0%, rgba(254, 198, 198, 0) 70%);
    --bg-base: linear-gradient(135deg, #fef0f5 0%, #fce8f0 25%, #fef0f5 50%, #fdf0f8 75%, #fef0f5 100%);
}

/* 浅色主题 - 简约灰 */
[data-theme="light"][data-skin="gray"] {
    --primary-color: #4a5568;
    --primary-hover: #2d3748;
    --primary-light: rgba(74, 85, 104, 0.15);
    --text-color: #1a202c;
    --text-secondary: #4a5568;
    --input-border: rgba(74, 85, 104, 0.3);
    --shadow-color: rgba(74, 85, 104, 0.2);
    --hover-bg: rgba(74, 85, 104, 0.1);
    --orb-1: radial-gradient(circle, rgba(160, 174, 192, 0.4) 0%, rgba(160, 174, 192, 0) 70%);
    --orb-2: radial-gradient(circle, rgba(203, 213, 224, 0.35) 0%, rgba(203, 213, 224, 0) 70%);
    --orb-3: radial-gradient(circle, rgba(99, 179, 237, 0.25) 0%, rgba(99, 179, 237, 0) 70%);
    --orb-4: radial-gradient(circle, rgba(226, 232, 240, 0.3) 0%, rgba(226, 232, 240, 0) 70%);
    --bg-base: linear-gradient(135deg, #f7fafc 0%, #edf2f7 25%, #f7fafc 50%, #f0f5fa 75%, #f7fafc 100%);
}

/* 浅色主题 - 青碧色 */
[data-theme="light"][data-skin="teal"] {
    --primary-color: #319795;
    --primary-hover: #2c7a7b;
    --primary-light: rgba(49, 151, 149, 0.15);
    --text-color: #1a3535;
    --text-secondary: #3d6060;
    --input-border: rgba(49, 151, 149, 0.3);
    --shadow-color: rgba(49, 151, 149, 0.2);
    --hover-bg: rgba(49, 151, 149, 0.1);
    --orb-1: radial-gradient(circle, rgba(56, 178, 172, 0.4) 0%, rgba(56, 178, 172, 0) 70%);
    --orb-2: radial-gradient(circle, rgba(72, 187, 120, 0.35) 0%, rgba(72, 187, 120, 0) 70%);
    --orb-3: radial-gradient(circle, rgba(99, 179, 237, 0.3) 0%, rgba(99, 179, 237, 0) 70%);
    --orb-4: radial-gradient(circle, rgba(129, 230, 217, 0.25) 0%, rgba(129, 230, 217, 0) 70%);
    --bg-base: linear-gradient(135deg, #e6f7f7 0%, #e0f5f5 25%, #e6f7f7 50%, #e8fafa 75%, #e6f7f7 100%);
}

/* 深色主题 */
[data-theme="dark"] {
    --primary-color: #63b3ed;
    --primary-hover: #4299e1;
    --primary-light: rgba(99, 179, 237, 0.2);
    --bg-color: #1a202c;
    --text-color: #f7fafc;
    --text-secondary: #a0aec0;
    --border-color: rgba(255, 255, 255, 0.1);
    --input-border: rgba(99, 179, 237, 0.3);
    --shadow-color: rgba(0, 0, 0, 0.3);
    --hover-bg: rgba(99, 179, 237, 0.15);
    --glass-bg: rgba(30, 40, 55, 0.7);
    --glass-bg-solid: rgba(30, 40, 55, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    --glass-inner-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    --glass-highlight: rgba(255, 255, 255, 0.1);
    --input-glass: rgba(0, 0, 0, 0.3);
    --orb-1: radial-gradient(circle, rgba(99, 179, 237, 0.2) 0%, rgba(99, 179, 237, 0) 70%);
    --orb-2: radial-gradient(circle, rgba(159, 122, 234, 0.15) 0%, rgba(159, 122, 234, 0) 70%);
    --orb-3: radial-gradient(circle, rgba(72, 187, 120, 0.12) 0%, rgba(72, 187, 120, 0) 70%);
    --orb-4: radial-gradient(circle, rgba(237, 137, 180, 0.1) 0%, rgba(237, 137, 180, 0) 70%);
    --bg-base: linear-gradient(135deg, #1a202c 0%, #2d3748 25%, #1a202c 50%, #2d3748 75%, #1a202c 100%);
}

/* ========================================
   全局重置
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "微软雅黑", sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-color);
    background: var(--bg-base);
    background-size: 200% 200%;
    animation: gentleShift 20s ease infinite;
    position: relative;
}

@keyframes gentleShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ========================================
   动态背景装饰 - 柔和光球
   ======================================== */
.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    animation: floatOrb 25s ease-in-out infinite;
}

.bg-orb-1 {
    width: 500px;
    height: 500px;
    background: var(--orb-1);
    top: -150px;
    left: -100px;
    animation-delay: 0s;
}

.bg-orb-2 {
    width: 450px;
    height: 450px;
    background: var(--orb-2);
    top: 50%;
    right: -150px;
    animation-delay: -5s;
    animation-duration: 30s;
}

.bg-orb-3 {
    width: 400px;
    height: 400px;
    background: var(--orb-3);
    bottom: -100px;
    left: 30%;
    animation-delay: -10s;
    animation-duration: 28s;
}

.bg-orb-4 {
    width: 350px;
    height: 350px;
    background: var(--orb-4);
    top: 30%;
    left: 50%;
    animation-delay: -15s;
    animation-duration: 32s;
}

/* 隐藏多余的光球 */
.bg-orb-5,
.bg-orb-6 {
    display: none;
}

@keyframes floatOrb {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(30px, -20px) scale(1.05);
    }
    50% {
        transform: translate(-20px, 30px) scale(0.95);
    }
    75% {
        transform: translate(20px, 15px) scale(1.02);
    }
}

/* ========================================
   噪点纹理层 - 极轻微
   ======================================== */
.noise-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.015;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ========================================
   主容器
   ======================================== */
.app-container {
    display: flex;
    height: 100vh;
    width: 100%;
    padding: 24px;
    gap: 24px;
    position: relative;
    z-index: 2;
}

/* ========================================
   玻璃面板效果 - 优雅透明
   ======================================== */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(120%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(120%);
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    box-shadow:
        var(--glass-shadow),
        var(--glass-inner-shadow);
    position: relative;
    overflow: hidden;
}

/* 顶部边缘高光 */
.glass-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    right: 20px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-highlight), transparent);
    z-index: 10;
}

/* ========================================
   左侧控制面板
   ======================================== */
.control-panel {
    width: 400px;
    min-width: 340px;
    max-width: 440px;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.control-panel:hover {
    box-shadow:
        var(--glass-shadow),
        var(--glass-inner-shadow),
        0 0 40px rgba(255, 255, 255, 0.05);
}

/* ========================================
   API 配置区
   ======================================== */
.api-config {
    padding: 12px 16px;
    background: var(--glass-bg-solid);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    position: relative;
    z-index: 5;
}

.api-config-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.api-config-row:last-child {
    margin-bottom: 0;
}

.api-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-color);
    min-width: 55px;
    white-space: nowrap;
}

.api-input {
    flex: 1;
    padding: 6px 10px;
    font-size: 12px;
    color: var(--text-color);
    background: var(--input-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.api-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.api-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.api-key-group {
    flex: 1;
    display: flex;
    gap: 6px;
}

.api-key-input {
    flex: 1;
}

.api-key-toggle {
    padding: 6px 8px;
    font-size: 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}

.api-key-toggle:hover {
    background: var(--hover-bg);
}

.api-save-btn {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: var(--primary-color);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.api-save-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

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

/* ========================================
   主题控制栏
   ======================================== */
.theme-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--glass-bg-solid);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    gap: 16px;
    position: relative;
    z-index: 5;
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
}

/* 开关样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.1);
    transition: 0.3s ease;
    border-radius: 28px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 2px;
    background: #ffffff;
    transition: 0.3s ease;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

input:checked + .slider {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(24px);
}

/* 皮肤选择器 */
.skin-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.skin-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
}

.skin-options {
    display: flex;
    gap: 6px;
}

.skin-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.skin-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.skin-btn.active {
    transform: scale(1.1);
    border-color: #ffffff;
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.2),
        0 0 0 3px rgba(255, 255, 255, 0.4);
}

/* 皮肤颜色 */
.skin-btn[data-skin="blue"] {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
}
.skin-btn[data-skin="green"] {
    background: linear-gradient(135deg, #6ee7b7, #34d399);
}
.skin-btn[data-skin="purple"] {
    background: linear-gradient(135deg, #c4b5fd, #a78bfa);
}
.skin-btn[data-skin="orange"] {
    background: linear-gradient(135deg, #fdba74, #fb923c);
}
.skin-btn[data-skin="pink"] {
    background: linear-gradient(135deg, #f9a8d4, #f472b6);
}
.skin-btn[data-skin="gray"] {
    background: linear-gradient(135deg, #d1d5db, #9ca3af);
}
.skin-btn[data-skin="teal"] {
    background: linear-gradient(135deg, #5eead4, #2dd4bf);
}

/* 深色模式禁用皮肤选择器 */
[data-theme="dark"] .skin-selector {
    opacity: 0.4;
    pointer-events: none;
}

/* ========================================
   模式切换标签
   ======================================== */
.mode-tabs {
    display: flex;
    padding: 16px 20px;
    gap: 12px;
    background: var(--glass-bg-solid);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    position: relative;
    z-index: 5;
}

.mode-tab {
    flex: 1;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.mode-tab:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: translateY(-1px);
}

.mode-tab.active {
    background: var(--primary-color);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 16px var(--shadow-color);
}

[data-theme="dark"] .mode-tab {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .mode-tab:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* ========================================
   模式内容区
   ======================================== */
.mode-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--glass-bg);
    position: relative;
    z-index: 3;
}

.mode-content.hidden {
    display: none;
}

.panel-section {
    background: transparent;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

/* ========================================
   表单组
   ======================================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-color);
    background: var(--input-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.8);
    box-shadow:
        inset 0 1px 3px rgba(0, 0, 0, 0.05),
        0 0 0 3px var(--primary-light);
}

[data-theme="dark"] .form-input:focus {
    background: rgba(0, 0, 0, 0.4);
}

/* 大型文本框 */
.prompt-textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-color);
    background: var(--input-glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    resize: vertical;
    min-height: 120px;
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.prompt-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.8);
    box-shadow:
        inset 0 1px 3px rgba(0, 0, 0, 0.05),
        0 0 0 3px var(--primary-light);
}

[data-theme="dark"] .prompt-textarea:focus {
    background: rgba(0, 0, 0, 0.4);
}

.prompt-textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

/* 尺寸输入组 */
.size-inputs {
    display: flex;
    align-items: center;
    gap: 12px;
}

.size-input {
    width: 100px;
    text-align: center;
}

.size-separator {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* ========================================
   下拉选择框
   ======================================== */
.form-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: var(--input-glass);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235a6a7a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 12px;
    padding-right: 36px;
    cursor: pointer;
}

.form-select:focus {
    background-color: rgba(255, 255, 255, 0.8);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234a90d9' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 12px;
}

[data-theme="dark"] .form-select:focus {
    background-color: rgba(0, 0, 0, 0.4);
}

/* 下拉选项样式 */
.form-select option {
    background-color: #ffffff;
    background-image: none;
    color: #1a2a3a;
    padding: 8px 12px;
}

[data-theme="dark"] .form-select option {
    background-color: #2d3748;
    background-image: none;
    color: #f7fafc;
}

/* ========================================
   提示词统计信息
   ======================================== */
.prompt-stats {
    display: flex;
    gap: 20px;
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--glass-bg);
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}

.stat-item {
    font-size: 12px;
    color: var(--text-secondary);
}

.stat-item strong {
    color: var(--primary-color);
    font-weight: 700;
}

/* ========================================
   标签提示文本
   ======================================== */
.label-hint {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-secondary);
    opacity: 0.8;
}

/* ========================================
   小型文本框
   ======================================== */
.small-textarea {
    min-height: 60px;
}

/* ========================================
   范围滑块输入组
   ======================================== */
.range-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-range {
    flex: 1;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--glass-bg-solid);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px var(--shadow-color);
    transition: all 0.2s ease;
}

.form-range::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 10px var(--shadow-color);
}

.form-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px var(--shadow-color);
}

.range-value {
    min-width: 36px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color);
    background: var(--glass-bg-solid);
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--glass-border);
}

/* ========================================
   高级参数折叠区
   ======================================== */
.advanced-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    transition: color 0.2s ease;
    user-select: none;
}

.advanced-toggle:hover {
    color: var(--primary-color);
}

.toggle-icon {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.advanced-toggle.active .toggle-icon {
    transform: rotate(90deg);
}

.advanced-params {
    padding: 12px 0;
    border-top: 1px solid var(--glass-border);
    margin-top: 4px;
}

.advanced-params.hidden {
    display: none;
}

/* ========================================
   Kling模型专属参数
   ======================================== */
.kling-only {
    display: none;
}

.kling-only.visible {
    display: block;
}

/* 当选择非Kling模型时隐藏尺寸组 */
#t2i-size-group.hidden {
    display: none;
}

/* ========================================
   生成按钮
   ======================================== */
.generate-btn {
    width: 100%;
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 12px;
    box-shadow: 0 4px 16px var(--shadow-color);
}

.generate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px var(--shadow-color);
}

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

.generate-btn:disabled {
    background: linear-gradient(135deg, #9ca3af, #6b7280);
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ========================================
   图片拖拽区域
   ======================================== */
.image-drop-zone {
    position: relative;
    width: 100%;
    height: 180px;
    border: 2px dashed var(--input-border);
    border-radius: 16px;
    background: var(--input-glass);
    backdrop-filter: blur(10px);
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s ease;
}

.image-drop-zone:hover {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.5);
}

.image-drop-zone.drag-over {
    border-color: var(--primary-color);
    border-style: solid;
    background: var(--primary-light);
    transform: scale(1.01);
}

.drop-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--text-secondary);
}

.drop-icon {
    display: block;
    font-size: 40px;
    line-height: 1;
    margin-bottom: 12px;
    color: var(--primary-color);
}

.drop-text {
    font-size: 14px;
    line-height: 1.5;
    font-weight: 500;
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.1);
}

.preview-image.hidden {
    display: none;
}

.file-input {
    display: none;
}

/* 多图预览容器 */
.multi-preview-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    padding: 6px;
    box-sizing: border-box;
}

.multi-preview-container.hidden {
    display: none;
}

.multi-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
}

.multi-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.multi-preview-item .remove-image-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(220, 53, 69, 0.9);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.multi-preview-item:hover .remove-image-btn {
    opacity: 1;
}

.multi-preview-item .remove-image-btn:hover {
    background: rgba(220, 53, 69, 1);
}

.multi-preview-item .image-index {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
}

/* 添加更多图片按钮 */
.add-more-images {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    border-radius: 8px;
    border: 2px dashed var(--input-border);
    background: var(--input-glass);
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.add-more-images:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.add-more-images .add-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.add-more-images .add-text {
    font-size: 11px;
}

/* 图片信息条 */
.image-info-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--glass-bg);
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    font-size: 12px;
    color: var(--text-secondary);
}

.image-info-bar.hidden {
    display: none;
}

.clear-image-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.clear-image-btn:hover {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

/* 图片信息条 */
.image-info-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--glass-bg);
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    font-size: 12px;
    color: var(--text-secondary);
}

.image-info-bar.hidden {
    display: none;
}

.clear-image-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.clear-image-btn:hover {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

/* ========================================
   右侧图片展示区
   ======================================== */
.image-display {
    flex: 1;
    min-width: 50%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 20px;
    transition: all 0.3s ease;
}

.image-display:hover {
    box-shadow:
        var(--glass-shadow),
        var(--glass-inner-shadow),
        0 0 40px rgba(255, 255, 255, 0.05);
}

.display-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 16px;
    padding: 0 8px;
    position: relative;
    z-index: 5;
}

.display-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-color);
}

.header-hints {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    text-align: right;
}

.generation-hint {
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 600;
    margin: 0;
}

.download-hint {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
    margin: 0;
}

.status-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--glass-bg-solid);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

/* ========================================
   生成状态显示（紧凑水平布局）
   ======================================== */
.generation-status {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 20px;
    margin-bottom: 12px;
    background: var(--glass-bg-solid);
    backdrop-filter: blur(15px);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    position: relative;
    z-index: 10;
}

.generation-status.hidden {
    display: none;
}

.status-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* 加载动画 - 旋转圆环 */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--glass-border);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 生成中状态 - 脉冲动画 */
.generation-status.generating {
    animation: pulse-bg 2s ease-in-out infinite;
}

@keyframes pulse-bg {
    0%, 100% {
        box-shadow: 0 0 0 0 var(--primary-light);
    }
    50% {
        box-shadow: 0 0 20px 10px var(--primary-light);
    }
}

/* 完成状态图标 */
.status-icon .check-icon {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #10b981, #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    animation: pop-in 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes pop-in {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* 错误状态图标 */
.status-icon .error-icon {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-3px); }
    40%, 80% { transform: translateX(3px); }
}

/* 等待状态图标 */
.status-icon .wait-icon {
    font-size: 22px;
    animation: float 2s ease-in-out infinite;
}

/* 状态文字 */
.status-text-large {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color);
    text-align: center;
    line-height: 1.4;
}

/* 生成中文字闪烁效果 */
.generation-status.generating .status-text-large {
    animation: text-pulse 1.5s ease-in-out infinite;
}

@keyframes text-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* 完成状态的绿色文字 */
.generation-status.completed .status-text-large {
    color: #10b981;
}

/* 错误状态的红色文字 */
.generation-status.error .status-text-large {
    color: #ef4444;
}

/* 停止生成按钮 */
.stop-generate-btn {
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.stop-generate-btn:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: scale(1.05);
}

.stop-generate-btn.hidden {
    display: none;
}

/* 清空图片按钮 */
.clear-gallery-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.clear-gallery-btn:hover {
    color: #ef4444;
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* ========================================
   图片画廊
   ======================================== */
.image-gallery {
    flex: 1;
    background: var(--glass-bg-solid);
    backdrop-filter: blur(15px);
    border-radius: 18px;
    padding: 20px;
    overflow-y: auto;
    border: 1px solid var(--glass-border);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 3;
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

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

.empty-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

.empty-hint {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ========================================
   图片列表
   ======================================== */
.image-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.image-item {
    width: 100%;
    background: var(--glass-bg-solid);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.image-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

/* 图片容器（包含下载按钮） */
.image-wrapper {
    position: relative;
    width: 100%;
}

.image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

/* 下载按钮 */
.download-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.2s ease;
    z-index: 10;
}

.image-wrapper:hover .download-btn {
    opacity: 1;
    transform: translateY(0);
}

.download-btn:hover {
    background: var(--primary-color);
    color: #ffffff;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.download-btn:active {
    transform: scale(0.95);
}

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

[data-theme="dark"] .download-btn {
    background: rgba(45, 55, 72, 0.9);
    color: var(--primary-color);
}

[data-theme="dark"] .download-btn:hover {
    background: var(--primary-color);
    color: #ffffff;
}

.image-item .image-info {
    padding: 14px 18px;
    font-size: 12px;
    color: var(--text-secondary);
    background: var(--glass-bg);
    border-top: 1px solid var(--glass-border);
}

/* ========================================
   分页控件
   ======================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 16px;
    padding: 14px 24px;
    background: var(--glass-bg-solid);
    backdrop-filter: blur(15px);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    position: relative;
    z-index: 5;
}

.pagination.hidden {
    display: none;
}

.page-btn {
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--primary-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: #ffffff;
    transform: translateY(-1px);
}

.page-btn:disabled {
    color: var(--text-secondary);
    border-color: var(--border-color);
    cursor: not-allowed;
    opacity: 0.5;
}

.page-info {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* ========================================
   响应式调整
   ======================================== */
@media (max-width: 900px) {
    .control-panel {
        width: 340px;
        min-width: 300px;
    }

    .theme-controls {
        flex-direction: column;
        gap: 12px;
    }

    .app-container {
        padding: 16px;
        gap: 16px;
    }
}

@media (max-width: 700px) {
    .app-container {
        flex-direction: column;
        padding: 12px;
        gap: 12px;
    }

    .control-panel {
        width: 100%;
        max-width: none;
        height: auto;
        max-height: 50vh;
        border-radius: 20px;
    }

    .image-display {
        min-width: auto;
        min-height: 50vh;
        border-radius: 20px;
    }

    .glass-panel {
        border-radius: 20px;
    }
}

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

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 5px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
    background-clip: padding-box;
}

/* ========================================
   过渡动画
   ======================================== */
* {
    transition-property: background-color, border-color, color, box-shadow, opacity;
    transition-duration: 0.2s;
    transition-timing-function: ease;
}

.slider:before,
.skin-btn,
input,
textarea,
button {
    transition: all 0.2s ease;
}

.bg-orb {
    transition: background 0.5s ease;
}

/* ========================================
   ICP备案信息
   ======================================== */
.icp-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 2px solid var(--primary-color);
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .icp-footer {
    background: rgba(30, 40, 55, 0.95);
}

.icp-footer a {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s ease;
    letter-spacing: 0.5px;
}

.icp-footer a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}
