/* AI描述生成功能样式 */

/* AI生成按钮 */
.ai-generate-btn {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #1565c0;
    border: 1px solid #90caf9;
    padding: 0 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    vertical-align: middle;
}

.ai-generate-btn:hover {
    background: linear-gradient(135deg, #bbdefb, #90caf9);
    color: #0d47a1;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(144, 202, 249, 0.3);
}

.ai-generate-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(144, 202, 249, 0.2);
}

.ai-generate-btn .ai-text {
    font-size: 10px;
    vertical-align: super;
    margin-left: 2px;
}

/* AI描述生成弹窗 */
.ai-description-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.ai-description-modal-content {
    background-color: #fff;
    margin: 2% auto;
    padding: 0;
    border-radius: 12px;
    width: 95%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.2);
    animation: aiModalSlideIn 0.4s ease-out;
}

@keyframes aiModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-40px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ai-description-modal-header {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    padding: 20px 24px;
    border-radius: 12px 12px 0 0;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-description-modal-header h3 {
    margin: 0;
    color: #1565c0;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-description-close {
    color: #1565c0;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.ai-description-close:hover {
    background-color: rgba(21, 101, 192, 0.1);
    transform: scale(1.1);
}

.ai-description-modal-body {
    padding: 24px;
}

/* 输入表单 */
.ai-input-form {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.ai-form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

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

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

.ai-form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.ai-form-group input:focus {
    outline: none;
    border-color: #90caf9;
    box-shadow: 0 0 0 3px rgba(144, 202, 249, 0.1);
}

.ai-generate-action {
    text-align: center;
    margin-top: 16px;
}

.ai-generate-submit-btn {
    background: linear-gradient(135deg, #1976d2, #1565c0);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.ai-generate-submit-btn:hover {
    background: linear-gradient(135deg, #1565c0, #0d47a1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
}

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

.ai-generate-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.ai-generate-submit-btn .ai-superscript {
    font-size: 10px;
    vertical-align: super;
}

.ai-clear-btn {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ai-clear-btn:hover {
    background: #e0e0e0;
    color: #333;
}

.ai-clear-btn:active {
    transform: translateY(1px);
}

/* 生成结果区域 */
.ai-results-container {
    display: none;
}

.ai-results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.ai-result-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    background: #fff;
    transition: all 0.3s ease;
    position: relative;
}

.ai-result-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.ai-result-card.generating {
    border-color: #90caf9;
    background: linear-gradient(135deg, #f3f8ff, #e8f4fd);
}

.ai-result-card.completed {
    border-color: #4caf50;
    background: linear-gradient(135deg, #f1f8e9, #e8f5e8);
}

.ai-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.ai-result-title {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.ai-result-status {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.ai-result-status.generating {
    background: #e3f2fd;
    color: #1565c0;
}

.ai-result-status.completed {
    background: #e8f5e8;
    color: #2e7d32;
}

.ai-result-content {
    margin-bottom: 12px;
}

.ai-result-section {
    margin-bottom: 12px;
}

.ai-result-section h5 {
    margin: 0 0 6px 0;
    color: #555;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-result-text {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 10px;
    font-size: 13px;
    line-height: 1.5;
    color: #333;
    min-height: 60px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.ai-result-text.generating {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.ai-copy-btn {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

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

.ai-copy-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ai-copy-btn.copied {
    background: #4caf50;
    color: white;
    border-color: #4caf50;
}

/* 底部操作按钮 */
.ai-bottom-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.ai-close-btn {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ai-close-btn:hover {
    background: #e0e0e0;
    color: #333;
}

.ai-regenerate-btn {
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ai-regenerate-btn:hover {
    background: linear-gradient(135deg, #f57c00, #ef6c00);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

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

.ai-regenerate-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 加载动画 */
.ai-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #1565c0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .ai-results-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .ai-description-modal-content {
        width: 98%;
        margin: 1% auto;
        max-height: 95vh;
    }
    
    .ai-description-modal-header {
        padding: 16px 20px;
    }
    
    .ai-description-modal-body {
        padding: 20px;
    }
    
    .ai-form-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .ai-bottom-actions {
        flex-direction: column;
    }
    
    .ai-close-btn,
    .ai-regenerate-btn {
        width: 100%;
        padding: 12px;
    }
}

/* 错误和成功消息 */
.ai-message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
}

.ai-message.error {
    background: #ffebee;
    border: 1px solid #ffcdd2;
    color: #d32f2f;
}

.ai-message.success {
    background: #e8f5e8;
    border: 1px solid #c8e6c9;
    color: #2e7d32;
}

.ai-message.info {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    color: #1565c0;
}