/* AI长文生成器 - 前端样式 */

.ai-article-generator-frontend {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* 标题区域 */
.generator-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.generator-header h3 {
    color: #333;
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: 600;
}

.generator-header p {
    color: #666;
    font-size: 16px;
    margin: 0;
}

/* 表单样式 */
.generator-form {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    border: 1px solid #e0e0e0;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    line-height: 1.5;
}

.form-group small {
    display: block;
    color: #666;
    font-size: 12px;
    margin-top: 5px;
    line-height: 1.4;
}

/* 表单行布局 */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
}

.form-group.half {
    flex: 1;
    margin-bottom: 0;
}

/* 生成按钮 */
.generate-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #0073aa 0%, #005177 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.generate-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #005177 0%, #003f5c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 115, 170, 0.3);
}

.generate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.generate-btn.loading {
    color: transparent;
}

.btn-loading {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
}

.generate-btn.loading .btn-loading {
    display: block;
}

/* 生成状态 */
.generation-status {
    background: #fff;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.status-header h4 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.progress-percentage {
    font-size: 18px;
    font-weight: 600;
    color: #0073aa;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0073aa 0%, #00a0d2 100%);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 4px;
}

.status-text {
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

/* 生成结果 */
.generated-result {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.result-header h4 {
    margin: 0;
    color: #333;
    font-size: 20px;
}

.result-stats {
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

/* 文章内容显示 */
.article-content {
    background: #fafafa;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid #e0e0e0;
    max-height: 500px;
    overflow-y: auto;
}

.article-content h3 {
    color: #333;
    font-size: 24px;
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0073aa;
}

.article-content h4 {
    color: #333;
    font-size: 18px;
    margin-top: 25px;
    margin-bottom: 12px;
    font-weight: 600;
}

.article-content p {
    color: #444;
    line-height: 1.7;
    margin-bottom: 16px;
    font-size: 14px;
}

/* 结果操作按钮 */
.result-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 12px 20px;
    border: 2px solid #ddd;
    background: #fff;
    color: #333;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.action-btn:hover {
    background: #f8f9fa;
    border-color: #bbb;
    transform: translateY(-1px);
}

.action-btn.primary {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

.action-btn.primary:hover {
    background: #005177;
    border-color: #005177;
}

/* 消息提示 */
.ai-message {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    animation: slideDown 0.3s ease;
}

.ai-message-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.ai-message-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.ai-message-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.message-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    margin-left: 10px;
    opacity: 0.7;
}

.message-close:hover {
    opacity: 1;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .ai-article-generator-frontend {
        padding: 15px;
    }
    
    .generator-form,
    .generation-status,
    .generated-result {
        padding: 20px;
    }
    
    .generator-header h3 {
        font-size: 24px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-group.half {
        margin-bottom: 25px;
    }
    
    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
    }
    
    .article-content {
        padding: 20px;
        max-height: 400px;
    }
}

@media (max-width: 480px) {
    .ai-article-generator-frontend {
        padding: 10px;
    }
    
    .generator-form,
    .generation-status,
    .generated-result {
        padding: 15px;
    }
    
    .generator-header h3 {
        font-size: 20px;
    }
    
    .article-content h3 {
        font-size: 20px;
    }
    
    .article-content h4 {
        font-size: 16px;
    }
}
