/* AI图片生成样式 - 微信风格 */

/* 图片生成模态框 */
.image-gen-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    box-sizing: border-box;
}

.image-gen-modal {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease-out;
}

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

/* 模态框头部 */
.image-gen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 0 20px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 20px;
}

.image-gen-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #f5f5f5;
    color: #666;
}

/* 模态框内容 */
.image-gen-content {
    padding: 0 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #07c160;
    box-shadow: 0 0 0 2px rgba(7, 193, 96, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* 字符计数 */
.char-count {
    text-align: right;
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* 表单行布局 */
.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

/* 滑块样式 */
input[type="range"] {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #07c160;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #07c160;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* 模态框底部 */
.image-gen-footer {
    display: flex;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid #f0f0f0;
    margin-top: 20px;
}

.image-gen-footer button {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel {
    background: #f5f5f5;
    color: #666;
}

.btn-cancel:hover {
    background: #e8e8e8;
}

.btn-generate {
    background: #07c160;
    color: white;
}

.btn-generate:hover {
    background: #06a552;
}

.btn-generate:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 生成状态显示 */
.generating-status {
    margin: 10px 0;
}

.generating-message {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border: 1px solid #e1e8ff;
    border-radius: 12px;
    padding: 15px;
    position: relative;
}

.generating-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.generating-indicator {
    font-size: 14px;
    font-weight: 500;
    color: #4a90e2;
}

.generating-prompt {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
    line-height: 1.4;
}

.generating-prompt strong {
    color: #333;
}

/* 进度条 */
.generating-progress {
    margin-top: 10px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #e0e8ff;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4a90e2, #07c160);
    border-radius: 2px;
    animation: progressAnimation 2s ease-in-out infinite;
}

@keyframes progressAnimation {
    0% {
        width: 0%;
        opacity: 0.8;
    }
    50% {
        width: 70%;
        opacity: 1;
    }
    100% {
        width: 100%;
        opacity: 0.8;
    }
}

/* 响应式设计 */
@media (max-width: 480px) {
    .image-gen-modal-overlay {
        padding: 10px;
    }
    
    .image-gen-modal {
        max-height: 95vh;
    }
    
    .image-gen-header,
    .image-gen-content,
    .image-gen-footer {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .image-gen-footer {
        flex-direction: column;
    }
    
    .image-gen-footer button {
        width: 100%;
    }
}

/* 功能菜单中的图片生成按钮样式 */
.function-item[data-action="imageGen"] {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
}

.function-item[data-action="imageGen"]:hover {
    background: linear-gradient(135deg, #ff5252 0%, #ff7979 100%);
    transform: translateY(-2px);
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .image-gen-modal {
        background: #2c2c2c;
        color: #fff;
    }
    
    .image-gen-header {
        border-bottom-color: #404040;
    }
    
    .image-gen-header h3 {
        color: #fff;
    }
    
    .close-btn {
        color: #ccc;
    }
    
    .close-btn:hover {
        background: #404040;
        color: #fff;
    }
    
    .form-group label {
        color: #fff;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        background: #404040;
        border-color: #555;
        color: #fff;
    }
    
    .form-group input:focus,
    .form-group textarea:focus,
    .form-group select:focus {
        border-color: #07c160;
        box-shadow: 0 0 0 2px rgba(7, 193, 96, 0.2);
    }
    
    .image-gen-footer {
        border-top-color: #404040;
    }
    
    .btn-cancel {
        background: #404040;
        color: #ccc;
    }
    
    .btn-cancel:hover {
        background: #555;
    }
}
