/* ========== 文章工作台布局 ========== */

.workflow-container {
    display: flex;
    gap: 20px;
    min-height: calc(100vh - 120px);
    align-items: flex-start;
}

.workflow-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
}

.input-panel {
    flex: 0 0 480px;
    min-width: 420px;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

.output-panel {
    flex: 1;
    min-width: 0;
}

/* ========== 面板头部 ========== */

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e8eaed;
    background: #fafbfc;
}

.panel-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: #202124;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ========== 文章类型切换 ========== */

.article-style-toggle {
    display: flex;
    background: #f1f3f4;
    border-radius: 6px;
    padding: 2px;
    margin-right: 8px;
}

.article-style-toggle .style-btn {
    padding: 5px 12px;
    border: none;
    background: transparent;
    font-size: 12px;
    font-weight: 500;
    color: #5f6368;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.article-style-toggle .style-btn:hover {
    color: var(--business-color, #5B7FFF);
}

.article-style-toggle .style-btn.active {
    background: white;
    color: var(--business-color, #5B7FFF);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ========== 面板内容 ========== */

.panel-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ========== 表单组 ========== */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: #5f6368;
}

.form-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.label-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.hint {
    font-size: 11px;
    color: #9aa0a6;
    font-weight: normal;
}

/* ========== 输入框 ========== */

.input-with-btn {
    display: flex;
    gap: 10px;
}

.input-with-btn input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #dadce0;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.input-with-btn input:focus {
    outline: none;
    border-color: var(--business-color, #5B7FFF);
    box-shadow: 0 0 0 3px rgba(91, 127, 255, 0.1);
}

/* ========== Prompt 区域 ========== */

.prompt-group {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.prompt-content {
    flex: 1;
    padding: 14px;
    background: #f8f9fa;
    border: 1px solid #e8eaed;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.6;
    color: #3c4043;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
    min-height: 120px;
}

.prompt-content:empty::before {
    content: 'Prompt 将显示在这里...';
    color: #9aa0a6;
}

/* ========== 生成文章按钮 ========== */

.generate-btn-row {
    padding-top: 8px;
}

.btn-lg {
    height: 44px;
    padding: 0 28px;
    font-size: 15px;
    width: 100%;
}

/* ========== Markdown 编辑区 ========== */

.markdown-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.markdown-group textarea {
    width: 100%;
    min-height: 180px;
    padding: 14px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.2s ease;
}

.markdown-group textarea:focus {
    outline: none;
    border-color: var(--business-color, #5B7FFF);
    box-shadow: 0 0 0 3px rgba(91, 127, 255, 0.1);
}

.form-actions {
    display: flex;
    gap: 10px;
}

/* ========== 排版结果区域 ========== */

.result-group {
    display: flex;
    flex-direction: column;
}

.result-content {
    min-height: 150px;
}

.richtext-preview {
    padding: 20px;
    background: white;
    border: 1px solid #e8eaed;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.8;
    color: #3c4043;
    min-height: 150px;
}

.richtext-preview:empty::before {
    content: '排版结果将显示在这里...';
    color: #9aa0a6;
}

.richtext-preview h1,
.richtext-preview h2,
.richtext-preview h3,
.richtext-preview h4 {
    margin: 20px 0 12px;
    color: #202124;
}

.richtext-preview h1 { font-size: 24px; }
.richtext-preview h2 { font-size: 20px; }
.richtext-preview h3 { font-size: 17px; }

.richtext-preview p {
    margin: 12px 0;
}

.richtext-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 12px 0;
}

.richtext-preview ul,
.richtext-preview ol {
    margin: 12px 0;
    padding-left: 24px;
}

.richtext-preview li {
    margin: 6px 0;
}

.html-output {
    padding: 14px;
    background: #f8f9fa;
    border: 1px solid #e8eaed;
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    line-height: 1.5;
    color: #3c4043;
    white-space: pre-wrap;
    word-break: break-all;
    min-height: 150px;
}

/* ========== 视图切换 ========== */

.view-toggle {
    display: flex;
    background: #f1f3f4;
    border-radius: 6px;
    padding: 2px;
}

.toggle-btn {
    padding: 5px 12px;
    border: none;
    background: transparent;
    font-size: 12px;
    font-weight: 500;
    color: #5f6368;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.toggle-btn:hover {
    color: var(--business-color, #5B7FFF);
}

.toggle-btn.active {
    background: white;
    color: var(--business-color, #5B7FFF);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ========== 加载状态 ========== */

.article-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #5f6368;
}

.article-loading .spinner {
    margin-bottom: 12px;
}

.article-loading p {
    font-size: 14px;
}

/* ========== 文章大纲导航 ========== */

.article-outline {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    z-index: 100;
    min-width: 130px;
    overflow: hidden;
}

.outline-header {
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #5f6368;
    background: #f8f9fa;
    border-bottom: 1px solid #e8eaed;
}

.outline-items {
    padding: 8px 0;
}

.outline-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 13px;
    color: #3c4043;
}

.outline-item:hover {
    background: #f1f3f4;
    color: var(--business-color, #5B7FFF);
}

.outline-item.active {
    background: rgba(91, 127, 255, 0.1);
    color: var(--business-color, #5B7FFF);
}

.outline-icon {
    font-size: 12px;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.outline-text {
    white-space: nowrap;
}

.outline-item.outline-img {
    padding-left: 22px;
    font-size: 12px;
    color: #5f6368;
}

.outline-item.outline-img:hover {
    color: var(--business-color, #5B7FFF);
}

/* ========== 响应式设计 ========== */

@media (max-width: 1200px) {
    .article-outline {
        right: 10px;
        min-width: 110px;
    }

    .outline-item {
        padding: 6px 10px;
        font-size: 12px;
    }
}

@media (max-width: 1000px) {
    .workflow-container {
        flex-direction: column;
        height: auto;
    }

    .input-panel {
        flex: none;
        min-width: 0;
    }

    .output-panel {
        min-height: 500px;
    }

    .article-outline {
        display: none !important;
    }
}
