/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

/* 加载弹窗 */
.loading-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.loading-modal.active {
    display: flex;
}

.loading-modal-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    animation: modalSlideIn 0.3s ease-out;
}

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

.loading-header {
    margin-bottom: 30px;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f0f0f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loading-title {
    color: #333;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.loading-body {
    color: #666;
}

.loading-description {
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.5;
}

.loading-progress {
    margin-top: 20px;
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease;
    animation: progressPulse 2s ease-in-out infinite;
}

@keyframes progressPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

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

/* 主容器 */
.pipeline-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
}

/* 步骤指示器 */
.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
    padding: 20px 0;
    background: #f8f9fa;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 25px;
    border-radius: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.step-item.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.step-item.completed {
    background: #28a745;
    color: white;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 8px;
}

.step-label {
    font-weight: 600;
    font-size: 14px;
}

.step-connector {
    width: 60px;
    height: 2px;
    background: #ddd;
    margin: 0 10px;
}

.step-item.active .step-connector,
.step-item.completed .step-connector {
    background: #667eea;
}

/* 步骤视图 */
.step-view {
    display: none;
    animation: fadeIn 0.5s ease;
}

.step-view.active {
    display: block;
}

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

/* 视图头部 */
.view-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
}

.view-header h2 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 28px;
}

.view-header h2 i {
    margin-right: 10px;
    color: #667eea;
}

.view-description {
    color: #6c757d;
    font-size: 16px;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-large {
    padding: 16px 32px;
    font-size: 16px;
}

/* 步骤1: 大纲视图 */
.outline-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
}

/* 左侧大纲编辑器 */
.outline-editor {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-height: 600px;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.tab-buttons {
    display: flex;
    gap: 10px;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid #e9ecef;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    color: #495057;
}

.tab-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.tab-btn:hover {
    background: #f8f9fa;
}

.tab-btn.active:hover {
    background: #5a6fd8;
}

.tab-content {
    display: none;
    padding: 20px;
}

.tab-content.active {
    display: block;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.outline-prompt {
    margin-bottom: 20px;
}

.outline-prompt p {
    font-weight: 600;
    color: #495057;
    margin: 0;
}

.outline-structure {
    max-height: 500px;
    overflow-y: auto;
}

.outline-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 8px;
    background: white;
    transition: all 0.3s ease;
}

.outline-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.outline-item.h2 {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
}

.outline-item.h3 {
    margin-left: 20px;
    border-left: 4px solid #28a745;
}

.outline-item.h4 {
    margin-left: 40px;
    border-left: 4px solid #ffc107;
}

.outline-level {
    font-weight: 600;
    color: #495057;
    margin-right: 12px;
    min-width: 30px;
}

.outline-text {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    color: #495057;
    padding: 0;
}

.outline-text:focus {
    outline: none;
    background: #f8f9fa;
    border-radius: 4px;
    padding: 4px;
}

.outline-actions {
    display: flex;
    gap: 8px;
}

.outline-action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 4px;
    background: #f8f9fa;
    color: #6c757d;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.outline-action-btn:hover {
    background: #e9ecef;
    color: #495057;
}

.outline-action-btn.add {
    color: #28a745;
}

.outline-action-btn.delete {
    color: #dc3545;
}

/* 右侧预览 */
.outline-preview {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.preview-header {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.preview-header h3 {
    color: #495057;
    margin: 0 0 10px 0;
    font-size: 18px;
}

.preview-note {
    font-size: 12px;
    color: #6c757d;
    margin: 0 0 15px 0;
    line-height: 1.4;
}

/* 生成操作区域 */
.generate-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
}

.model-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.model-selector label {
    font-size: 14px;
    color: #495057;
    font-weight: 500;
    white-space: nowrap;
}

.model-select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: white;
    color: #495057;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 180px;
}

.model-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.model-select:hover {
    border-color: #adb5bd;
}

.preview-content {
    padding: 20px;
    min-height: 500px;
}

#preview-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.preview-outline {
    line-height: 1.8;
}

.preview-section {
    margin-bottom: 25px;
}

.preview-section h2 {
    font-size: 20px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 15px;
    padding: 10px 0;
    border-bottom: 1px solid #e9ecef;
}

.preview-section h3 {
    font-size: 16px;
    font-weight: 500;
    color: #6c757d;
    margin: 15px 0 10px 20px;
}

.preview-section h4 {
    font-size: 14px;
    font-weight: 400;
    color: #6c757d;
    margin: 10px 0 5px 40px;
}

.preview-content-placeholder {
    height: 20px;
    background: #f8f9fa;
    border-radius: 4px;
    margin: 10px 0;
    position: relative;
}

.preview-content-placeholder::after {
    content: "内容区域";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    color: #adb5bd;
}

/* 步骤2: 初稿视图 */
.draft-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.draft-content {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.draft-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.draft-header h3 {
    color: #495057;
    margin: 0;
}

.draft-display {
    padding: 30px;
    min-height: 500px;
    line-height: 1.8;
    color: #495057;
    font-size: 16px;
}

.draft-display h1, .draft-display h2, .draft-display h3, .draft-display h4 {
    color: #333;
    margin: 20px 0 15px 0;
}

.draft-display p {
    margin-bottom: 15px;
}

.draft-display ul, .draft-display ol {
    margin: 15px 0;
    padding-left: 30px;
}

.draft-display li {
    margin-bottom: 8px;
}

/* 创作思路卡片 */
.creative-brief-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    height: fit-content;
}

.card-header {
    padding: 20px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
}

.card-header h4 {
    margin: 0;
    font-size: 18px;
}

.card-header h4 i {
    margin-right: 8px;
}

.card-content {
    padding: 20px;
}

.card-content p {
    margin: 0;
    line-height: 1.6;
    color: #495057;
}

.draft-actions {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px 0;
}

/* 步骤3: 优化与编辑视图 */
.optimize-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
    position: relative;
}

/* 为批注面板预留空间 */
.optimize-container.has-annotations {
    margin-left: 320px;
}

.editor-section {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.editor-header h3 {
    color: #495057;
    margin: 0;
}

/* Quill 编辑器样式 */
.ql-container {
    border: none !important;
    border-radius: 0 !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

.ql-toolbar {
    background: #f8f9fa !important;
    border-bottom: 1px solid #e9ecef !important;
    border-top: 1px solid #e9ecef !important;
    border-left: 1px solid #e9ecef !important;
    border-right: 1px solid #e9ecef !important;
}

.ql-editor {
    min-height: 400px;
    padding: 20px;
}

.ql-editor p {
    margin-bottom: 1em;
}

.ql-editor h1, .ql-editor h2, .ql-editor h3 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

/* 侧边栏 */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.meta-titles-section,
.seo-score-section {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.meta-titles-section h4,
.seo-score-section h4 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 18px;
}

.meta-titles-section h4 i,
.seo-score-section h4 i {
    margin-right: 8px;
    color: #667eea;
}

/* Meta标题选择 */
.meta-titles-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.meta-title-option {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.meta-title-option:hover {
    border-color: #667eea;
    background: #f8f9fa;
}

.meta-title-option.selected {
    border-color: #667eea;
    background: #e3f2fd;
}

.meta-title-option input[type="radio"] {
    margin-right: 10px;
    accent-color: #667eea;
}

.meta-title-option label {
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
    color: #495057;
}

/* SEO评分显示 */
.seo-score-display {
    text-align: center;
    margin-bottom: 20px;
}

.score-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    margin: 0 auto 15px;
    font-weight: bold;
}

#seo-score-number {
    font-size: 24px;
    line-height: 1;
}

.score-label {
    font-size: 12px;
    opacity: 0.8;
}

.score-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b 0%, #ffd93d 50%, #6bcf7f 100%);
    transition: width 0.5s ease;
    width: 0%;
}

/* SEO建议 */
.seo-suggestions {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
}

.suggestions-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.suggestion-item {
    background: white;
    border-left: 3px solid #007bff;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.4;
    color: #495057;
}

.suggestion-item:last-child {
    margin-bottom: 0;
}

.suggestion-number {
    display: inline-block;
    background: #007bff;
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    text-align: center;
    line-height: 18px;
    font-size: 11px;
    font-weight: bold;
    margin-right: 8px;
}

.no-suggestions {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    margin: 10px 0;
}

.score-fill.excellent {
    background: linear-gradient(90deg, #28a745, #20c997);
}

.score-fill.good {
    background: linear-gradient(90deg, #ffc107, #fd7e14);
}

.score-fill.poor {
    background: linear-gradient(90deg, #dc3545, #e83e8c);
}

.seo-suggestion {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
    padding: 8px;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

.seo-suggestion:last-child {
    margin-bottom: 0;
}

.seo-suggestion i {
    color: #667eea;
    margin-right: 8px;
    margin-top: 2px;
    font-size: 12px;
}

.seo-suggestion span {
    font-size: 13px;
    color: #495057;
    line-height: 1.4;
}

.optimize-actions {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px 0;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    margin: 20px;
    padding: 0;
    border-radius: 15px;
    width: 500px;
    max-width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 20px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border-radius: 15px 15px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
}

.modal-header h3 i {
    margin-right: 8px;
}

.modal-body {
    padding: 20px;
    color: #495057;
    line-height: 1.6;
}

.modal-body p {
    margin-bottom: 15px;
}

.modal-body p:last-child {
    margin-bottom: 0;
}

.modal-footer {
    padding: 20px;
    text-align: right;
    border-top: 1px solid #e9ecef;
}

/* 批注样式 */
.annotation {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 2px 6px;
    margin: 0 2px;
    font-style: italic;
    color: #856404;
    font-size: 0.9em;
}

/* 响应式设计 */
@media (max-width: 900px) {
    .outline-container,
    .draft-container,
    .optimize-container {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        order: -1;
    }
}

@media (max-width: 768px) {
    .pipeline-container {
        padding: 10px;
    }
    
    .step-indicator {
        flex-direction: column;
        gap: 15px;
    }
    
    .step-connector {
        width: 2px;
        height: 30px;
    }
    
    .view-header h2 {
        font-size: 24px;
    }
    
    .btn-large {
        padding: 14px 24px;
        font-size: 14px;
    }
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
} 

/* 基本信息页面样式 */
.basic-info-container {
    display: flex;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.basic-info-form {
    flex: 1;
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.form-section {
    margin-bottom: 30px;
}

.form-section h3 {
    color: #333;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-section h3 i {
    color: #667eea;
}

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

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

.form-group label::after {
    content: " *";
    color: #e74c3c;
}

.form-group label:not([for*="required"])::after {
    content: "";
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #fff;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control:invalid {
    border-color: #e74c3c;
}

select.form-control {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
}

.form-actions {
    margin-top: 40px;
    text-align: center;
}

.btn-large {
    padding: 16px 32px;
    font-size: 18px;
    font-weight: 600;
}

.basic-info-preview {
    flex: 1;
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 400px;
}

.preview-header h3 {
    color: #333;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
}

.preview-note {
    color: #666;
    font-size: 14px;
    margin-bottom: 25px;
    line-height: 1.5;
}

.preview-content {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}

.preview-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.preview-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.preview-item strong {
    color: #495057;
    font-weight: 600;
    display: block;
    margin-bottom: 5px;
}

.preview-item span {
    color: #333;
    line-height: 1.5;
    word-break: break-word;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .basic-info-container {
        flex-direction: column;
        padding: 15px;
    }
    
    .basic-info-form,
    .basic-info-preview {
        max-width: none;
    }
    
    .basic-info-preview {
        order: -1;
    }
    
    .form-actions {
        margin-top: 30px;
    }
    
    .btn-large {
        width: 100%;
        padding: 14px 24px;
        font-size: 16px;
    }
}

/* 语言选择器特殊样式 */
#article-language,
#outline-article-language {
    font-weight: 500;
}

#article-language option,
#outline-article-language option {
    padding: 8px;
}

/* 表单验证样式 */
.form-control.error {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.error-message {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 5px;
    display: none;
}

.error-message.show {
    display: block;
}

/* 必填字段指示器 */
.required-field {
    position: relative;
}

.required-field::after {
    content: " *";
    color: #e74c3c;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* 关键词输入样式 */
.keywords-input-container {
    position: relative;
}

.keywords-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    min-height: 32px;
}

.keyword-tag {
    display: inline-flex;
    align-items: center;
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 0.875rem;
    border: 1px solid #bbdefb;
    transition: all 0.2s ease;
}

.keyword-tag:hover {
    background: #bbdefb;
    border-color: #90caf9;
}

.keyword-tag .remove-btn {
    margin-left: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #1976d2;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.keyword-tag .remove-btn:hover {
    opacity: 1;
    color: #d32f2f;
}

.keyword-tag .remove-btn::before {
    content: '×';
    font-weight: bold;
}

.keywords-input-container .form-control {
    margin-bottom: 0;
}

.keywords-input-container .form-text {
    margin-top: 8px;
    color: #6c757d;
    font-size: 0.875rem;
} 

/* 模式切换按钮容器 */
.mode-toggle-container {
    display: flex;
    justify-content: center;
    margin: 20px 0 30px 0;
}

.mode-toggle {
    display: flex;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.mode-btn {
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: #6c757d;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mode-btn.active {
    background: #667eea;
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.mode-btn:hover:not(.active) {
    background: #e9ecef;
    color: #495057;
}

/* 主要内容区域 */
.optimize-main-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 20px;
    margin-bottom: 20px;
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
}

/* 左侧内容区域 */
.optimize-content-area {
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-height: 600px;
}

/* 对比模式 */
.comparison-mode {
    display: none;
}

.comparison-mode.active {
    display: block;
}

.comparison-mode {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 600px;
}

.comparison-panel {
    padding: 20px;
    border-right: 1px solid #e9ecef;
}

.comparison-panel.optimized {
    border-right: none;
}

.comparison-panel h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
}

.comparison-content {
    height: 500px;
    overflow-y: auto;
    line-height: 1.6;
    color: #6c757d;
}

.comparison-stats {
    grid-column: 1 / -1;
    background: #f8f9fa;
    padding: 15px 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: center;
    gap: 30px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #6c757d;
}

.stat-item.added {
    color: #28a745;
}

.stat-item.removed {
    color: #dc3545;
}

.stat-item.modified {
    color: #ffc107;
}

/* 单栏编辑模式 */
.single-editor-mode {
    display: none;
    padding: 20px;
}

.single-editor-mode.active {
    display: block;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.editor-header h3 {
    margin: 0;
    color: #495057;
    font-size: 18px;
}

#quill-editor {
    height: 500px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

/* 右侧侧边栏 */
.optimize-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.comparison-panel {
    padding: 20px;
    border-right: 1px solid #e9ecef;
    max-height: 500px;
    overflow-y: auto;
}

.comparison-panel:last-child {
    border-right: none;
}

.comparison-panel h4 {
    margin: 0 0 15px 0;
    color: #495057;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comparison-panel.original h4::before {
    content: "📝";
}

.comparison-panel.optimized h4::before {
    content: "✨";
}

.comparison-content {
    font-size: 14px;
    line-height: 1.6;
    color: #495057;
}

/* 差异标记样式 */
.diff-added {
    background: #d4edda;
    color: #155724;
    padding: 2px 4px;
    border-radius: 3px;
    position: relative;
}

.diff-added::before {
    content: "+";
    color: #28a745;
    font-weight: bold;
    margin-right: 4px;
}

.diff-removed {
    background: #f8d7da;
    color: #721c24;
    padding: 2px 4px;
    border-radius: 3px;
    text-decoration: line-through;
    position: relative;
}

.diff-removed::before {
    content: "-";
    color: #dc3545;
    font-weight: bold;
    margin-right: 4px;
}

.diff-modified {
    background: #fff3cd;
    color: #856404;
    padding: 2px 4px;
    border-radius: 3px;
    position: relative;
}

.diff-modified::before {
    content: "~";
    color: #ffc107;
    font-weight: bold;
    margin-right: 4px;
}

/* 优化建议标记 */
.optimization-marker {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 12px;
    margin: 0 4px;
    cursor: help;
    position: relative;
}

.optimization-marker::before {
    content: "💡";
    margin-right: 4px;
}

.optimization-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.optimization-marker:hover .optimization-tooltip {
    opacity: 1;
    visibility: visible;
}

/* 对比模式切换 */
.comparison-mode {
    display: none;
}

.comparison-mode.active {
    display: block;
}

/* 单栏编辑模式 */
.single-editor-mode {
    display: none;
}

.single-editor-mode.active {
    display: block;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .comparison-container {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .comparison-panel {
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }
    
    .comparison-panel:last-child {
        border-bottom: none;
    }
}

/* 优化建议面板 */
.optimization-suggestions-panel {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.optimization-suggestions-panel h4 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.toggle-suggestions-btn {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    font-size: 14px;
    padding: 5px;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.toggle-suggestions-btn:hover {
    background: #f0f0f0;
}

.toggle-suggestions-btn.collapsed .fa-chevron-up {
    transform: rotate(180deg);
}

.suggestions-content {
    transition: all 0.3s ease;
    max-height: 500px;
    overflow: hidden;
}

.suggestions-content.collapsed {
    max-height: 0;
    overflow: hidden;
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.optimization-suggestions-panel h4::before {
    content: "💡";
}

.suggestion-item {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 0 6px 6px 0;
}

.suggestion-item h5 {
    margin: 0 0 5px 0;
    color: #495057;
    font-size: 14px;
}

.suggestion-item p {
    margin: 0;
    color: #6c757d;
    font-size: 13px;
}

.suggestion-type {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    margin-bottom: 5px;
}

/* 建议筛选器 */
.suggestions-filter {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.filter-btn {
    padding: 6px 12px;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.filter-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.filter-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.filter-btn i {
    font-size: 10px;
}

/* 建议项样式增强 */
.suggestion-item {
    position: relative;
    transition: all 0.2s ease;
}

.suggestion-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.suggestion-item.ai-actionable {
    border-left-color: #28a745;
}

.suggestion-item.manual-actionable {
    border-left-color: #ffc107;
}

.suggestion-item.ai-actionable .suggestion-type {
    background: #28a745;
}

.suggestion-item.manual-actionable .suggestion-type {
    background: #ffc107;
    color: #212529;
}

.suggestion-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.suggestion-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.suggestion-btn.apply {
    background: #28a745;
    color: white;
}

.suggestion-btn.apply:hover {
    background: #218838;
}

.suggestion-btn.complete {
    background: #6c757d;
    color: white;
}

.suggestion-btn.complete:hover {
    background: #5a6268;
}

.suggestion-btn.completed {
    background: #28a745;
    color: white;
    cursor: default;
}

.suggestion-btn.completed:hover {
    background: #28a745;
}

.suggestion-status {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    color: white;
}

.suggestion-status.pending {
    background: #ffc107;
    color: #212529;
}

.suggestion-status.completed {
    background: #28a745;
}

.suggestion-status.applied {
    background: #007bff;
}

/* 成功提示 */
.success-tip {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideInRight 0.3s ease;
}

.success-tip i {
    font-size: 16px;
}

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

/* 统计信息 */
.comparison-stats {
    display: flex;
    gap: 20px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    font-size: 14px;
    color: #6c757d;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-item.added {
    color: #28a745;
}

.stat-item.removed {
    color: #dc3545;
}

.stat-item.modified {
    color: #ffc107;
} 

/* 优化大屏幕下的编辑器大小 */
@media (min-width: 1600px) {
    /* 步骤2: 大纲编辑 */
    .outline-structure {
        min-height: 500px;
        max-height: none; /* 取消最大高度限制 */
        overflow: visible; /* 取消滚动 */
    }
    
    /* 步骤4: 优化与编辑视图 */
    .optimize-main-container {
        display: grid;
        grid-template-columns: 3fr 1fr; /* 增加内容区域比例 */
        gap: 30px;
        align-items: start; /* 确保顶部对齐 */
    }
    
    .comparison-panel {
        min-height: 600px;
        max-height: none; /* 取消最大高度限制 */
        overflow: visible; /* 取消滚动 */
    }
    
    #quill-editor {
        min-height: 700px;
        height: auto; /* 自动高度 */
        max-height: none; /* 取消最大高度限制 */
    }
    
    /* 大纲模块 */
    .outline-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 30px;
        align-items: start; /* 确保顶部对齐 */
    }
    
    /* 编辑器容器 */
    .editor-section {
        width: 100%;
        height: auto; /* 自动高度 */
        max-height: none; /* 取消最大高度限制 */
    }
    
    /* 优化建议侧边栏 */
    .optimize-sidebar {
        width: 100%;
        position: sticky; /* 使侧边栏固定 */
        top: 20px; /* 顶部距离 */
        max-height: calc(100vh - 40px); /* 设置最大高度为视口高度减去上下边距 */
        overflow-y: auto; /* 允许垂直滚动 */
    }
    
    /* 确保内容不超过预览和建议部分的高度 */
    .optimize-content {
        display: flex;
        flex-direction: column;
    }
    
    /* 确保大纲编辑区域不超过预览区域 */
    .outline-editor {
        height: auto;
        max-height: none;
        overflow: visible;
    }
}

/* 修复优化建议筛选器问题 */
.suggestions-filter {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #f8f9fa;
}

/* 隐藏/显示优化建议面板 */
.optimization-suggestions-panel.collapsed .suggestions-content {
    display: none;
}

.optimization-suggestions-panel.collapsed .toggle-suggestions-btn i {
    transform: rotate(180deg);
}

/* SEO评分区域始终可见 */
.seo-score-section {
    display: block !important;
}

/* 全局编辑器样式优化 */
.ql-container {
    height: auto !important;
    min-height: 500px;
    max-height: none !important;
}

/* 取消编辑区域的滚动限制 */
.outline-structure,
.comparison-panel,
#quill-editor,
.ql-editor {
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
}

/* 优化建议区域样式 */
.optimization-suggestions-panel {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 10px;
}

.suggestions-content {
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

.suggestion-item {
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

/* 确保最后一个建议项不被截断 */
.suggestion-item:last-child {
    margin-bottom: 30px;
} 
/* 品牌声调相关样式 */
#brand-tone-buttons {
    margin-top: 15px;
}

#no-brand-tone, #has-brand-tone {
    margin-bottom: 15px;
}

.brand-tone-card {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid #cbd5e0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.brand-tone-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.brand-tone-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.brand-tone-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    color: white;
    font-size: 18px;
}

.brand-tone-title {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.brand-tone-status {
    background: #48bb78;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    margin-left: auto;
}

.brand-tone-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}

.feature-item {
    background: white;
    padding: 12px;
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

.feature-label {
    font-size: 12px;
    color: #718096;
    font-weight: 500;
    margin-bottom: 4px;
}

.feature-value {
    font-size: 14px;
    color: #2d3748;
    font-weight: 500;
}

.brand-tone-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-brand-tone {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-brand-tone.apply {
    background: #667eea;
    color: white;
}

.btn-brand-tone.apply:hover {
    background: #5a67d8;
    color: white;
}

.btn-brand-tone.edit {
    background: #e2e8f0;
    color: #4a5568;
    border: 1px solid #cbd5e0;
}

.btn-brand-tone.edit:hover {
    background: #cbd5e0;
    color: #2d3748;
}

.manual-input-toggle {
    margin-top: 15px;
    text-align: center;
}

.btn-manual-input {
    background: none;
    border: 1px dashed #cbd5e0;
    color: #718096;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-manual-input:hover {
    border-color: #667eea;
    color: #667eea;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .brand-tone-features {
        grid-template-columns: 1fr;
    }
    
    .brand-tone-actions {
        flex-direction: column;
    }
    
    .btn-brand-tone {
        justify-content: center;
    }
}
