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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    /* 主题：紫色到白色的渐变 */
    background: linear-gradient(135deg, #D1C4E9 0%, #FFFFFF 100%);
    min-height: 100vh;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

h1 {
    color: #2c3e50;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    color: #7f8c8d;
    font-size: 1.2em;
}

/* 步骤区域 */
.step {
    background: white;
    margin-bottom: 30px;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.step-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.step-number {
    /* 颜色更新：蓝色 -> 主题紫 */
    background: #7E57C2; /* Deep Purple 400 */
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-weight: bold;
}

.step-header h2 {
    color: #2c3e50;
    font-size: 1.5em;
}

.help-icon {
    background: #ecf0f1;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    cursor: help;
    font-weight: bold;
    color: #7f8c8d;
}

/* 上传区域 */
.upload-area {
    text-align: center;
}

.upload-btn {
    display: inline-block;
    padding: 30px 60px;
    background: #ecf0f1;
    border: 3px dashed #bdc3c7;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-btn:hover {
    /* 颜色更新：蓝色 -> 主题紫 */
    background: #7E57C2;
    border-color: #673AB7; /* Deep Purple 500 */
    color: white;
}

.upload-icon {
    font-size: 3em;
    display: block;
    margin-bottom: 10px;
}

.upload-text {
    font-size: 1.1em;
    font-weight: bold;
}

.file-info {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: left;
}

.file-info .file-name {
    font-weight: bold;
    color: #2c3e50;
}

.file-info .file-size {
    color: #7f8c8d;
    margin-top: 5px;
}

.file-info .reupload-btn {
    margin-top: 10px;
    padding: 5px 15px;
    /* 颜色更新：蓝色 -> 主题紫 */
    background: #7E57C2;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.progress-container {
    margin-top: 20px;
    height: 10px;
    background: #ecf0f1;
    border-radius: 5px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    /* 保留：绿色用于进度/成功 */
    background: #2ecc71;
    width: 0%;
    transition: width 0.3s ease;
}

.upload-hint {
    margin-top: 10px;
    color: #7f8c8d;
    font-size: 0.9em;
}

/* 上传区域的隐私提示样式 */
.privacy-note-upload {
    margin-top: 12px;
    padding: 8px 15px;
    background: #e8f5e9;
    border-radius: 6px;
    color: #2e7d32;
    font-size: 0.9em;
    font-weight: 500;
    display: inline-block;
}

/* 输入区域 */
.input-area {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.template-select {
    padding: 12px;
    border: 2px solid #bdc3c7;
    border-radius: 8px;
    font-size: 1em;
    background: white;
    cursor: pointer;
}

#formatRequirements {
    padding: 15px;
    border: 2px solid #bdc3c7;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    min-height: 150px;
    resize: vertical;
}

#formatRequirements:focus {
    outline: none;
    /* 颜色更新：蓝色 -> 主题紫 */
    border-color: #7E57C2;
}

.examples {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.examples h4 {
    margin-bottom: 10px;
    color: #2c3e50;
}

.bad-example {
    /* 保留：红色用于失败/错误 */
    color: #e74c3c;
    margin-bottom: 5px;
}

.good-example {
    /* 保留：绿色用于成功 */
    color: #2ecc71;
}

/* 处理区域 */
.process-area {
    text-align: center;
}

.process-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.process-btn {
    /* 颜色更新：绿色 -> 主题紫渐变 */
    background: linear-gradient(135deg, #7E57C2, #673AB7);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 30px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    /* 阴影颜色更新 */
    box-shadow: 0 4px 6px rgba(126, 87, 194, 0.3);
    flex: 1;
}

.process-btn:hover:not(:disabled) {
    /* 颜色更新： */
    background: linear-gradient(135deg, #673AB7, #7E57C2);
    transform: translateY(-2px);
    /* 阴影颜色更新 */
    box-shadow: 0 6px 12px rgba(126, 87, 194, 0.4);
}

.process-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.test-doc-btn {
    /* 样式更新：蓝色 -> 紫色轮廓按钮 */
    background: white;
    color: #7E57C2;
    border: 2px solid #7E57C2;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: none;
}

.test-doc-btn:hover {
    /* 样式更新： */
    background: #F3E5F5; /* very light purple */
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(126, 87, 194, 0.2);
}

.status-display {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.status-step {
    margin-bottom: 10px;
    padding: 10px;
    background: white;
    border-radius: 5px;
    /* 颜色更新：蓝色 -> 主题紫 */
    border-left: 4px solid #7E57C2;
}

.status-step.active {
    /* 颜色更新：淡蓝色 -> 淡紫色 */
    background: #F3E5F5;
}

.status-step.completed {
    /* 保留：绿色用于成功 */
    border-left-color: #2ecc71;
}

.status-step.completed::before {
    content: "✓ ";
    /* 保留：绿色用于成功 */
    color: #2ecc71;
    font-weight: bold;
}

/* 新增：错误消息样式 */
.error-message {
    color: #e74c3c;
    background: #fbe9e7; /* 淡红色背景 */
    border: 1px solid #e74c3c;
    padding: 10px;
    border-radius: 5px;
    font-weight: bold;
}


/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
}

.modal-content h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

#clarificationInput {
    width: 100%;
    padding: 10px;
    margin: 15px 0;
    border: 2px solid #bdc3c7;
    border-radius: 5px;
}

#clarificationInput:focus {
    outline: none;
    border-color: #7E57C2;
}

.modal-buttons {
    text-align: right;
}

#clarificationSubmit {
    padding: 8px 20px;
    /* 颜色更新：蓝色 -> 主题紫 */
    background: #7E57C2;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

/* 结果区域 */
.result-area {
    margin-top: 30px;
    padding: 30px;
    /* 保留：淡绿色用于成功 */
    background: #e8f5e9;
    border-radius: 10px;
}

.success-icon {
    font-size: 3em;
    /* 保留：绿色用于成功 */
    color: #2ecc71;
    margin-bottom: 15px;
}

.result-area h3 {
    /* 保留：绿色用于成功 */
    color: #27ae60;
    margin-bottom: 20px;
}

.download-btn {
    display: inline-block;
    padding: 15px 30px;
    /* 保留：绿色用于成功 */
    background: #2ecc71;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    transition: background 0.3s ease;
}

.download-btn:hover {
    /* 保留：绿色用于成功 */
    background: #27ae60;
}

/* ============================================================ */
/* 【改进】格式调整对比 - 分类展示样式 */
/* ============================================================ */

.comparison-result {
    margin-top: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    text-align: left;
}

.comparison-result h4 {
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.1em;
    padding-bottom: 10px;
    border-bottom: 2px solid #7E57C2;
}

/* 分类容器 */
.comparison-category {
    margin-bottom: 16px;
    background: #fafafa;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e8e8e8;
}

/* 分类标题 */
.comparison-category-title {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: linear-gradient(135deg, #f5f0ff 0%, #f8f9fa 100%);
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95em;
    border-bottom: 1px solid #e8e8e8;
}

.comparison-category-title .category-icon {
    margin-right: 8px;
    font-size: 1.1em;
}

.comparison-category-title .item-count {
    margin-left: auto;
    font-size: 0.85em;
    color: #7f8c8d;
    font-weight: normal;
}

/* 分类内容 */
.comparison-category-content {
    padding: 12px 15px;
}

/* 单项显示 */
.comparison-item.single {
    color: #34495e;
    font-size: 0.9em;
    line-height: 1.5;
}

/* 多项列表 */
.comparison-items-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.comparison-items-list li {
    position: relative;
    padding: 6px 0 6px 20px;
    color: #34495e;
    font-size: 0.9em;
    line-height: 1.5;
    border-bottom: 1px dashed #eee;
}

.comparison-items-list li:last-child {
    border-bottom: none;
}

.comparison-items-list li::before {
    content: "•";
    position: absolute;
    left: 6px;
    color: #7E57C2;
    font-weight: bold;
}

/* 空状态 */
.comparison-empty {
    color: #7f8c8d;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* 错误状态 */
.comparison-error {
    color: #e74c3c;
    background: #fbe9e7;
    border: 1px solid #e74c3c;
    padding: 12px 15px;
    border-radius: 5px;
    font-weight: bold;
}

/* 响应式：小屏幕优化 */
@media (max-width: 768px) {
    .comparison-category-title {
        padding: 8px 12px;
        font-size: 0.9em;
    }
    
    .comparison-category-content {
        padding: 10px 12px;
    }
    
    .comparison-items-list li {
        padding: 5px 0 5px 18px;
        font-size: 0.85em;
    }
}

/* ============================================================ */
/* 结束：格式调整对比样式 */
/* ============================================================ */


/* 页脚 */
footer {
    text-align: center;
    margin-top: 50px;
    padding: 20px;
    color: #7f8c8d;
}

.privacy-note {
    font-weight: bold;
    margin-bottom: 10px;
    color: #2c3e50;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .step {
        padding: 20px;
    }
    
    .upload-btn {
        padding: 20px 40px;
    }
    
    .upload-icon {
        font-size: 2em;
    }

    .process-buttons {
        flex-direction: column;
    }
}

/* 辅助类 */
.hidden {
    display: none;
}

/* --- 新增：大纲列表样式 (树状结构) --- */
#outlineList {
    list-style-type: none;
    max-height: 250px; 
    overflow-y: auto;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
    border: 1px solid #e0e0e0;
    
    /* 为伪元素定位 */
    position: relative; 
}

/* 所有列表项的通用样式 */
#outlineList li {
    padding: 4px 8px;
    margin-bottom: 3px;
    border-radius: 4px;
    transition: background-color 0.2s;
    line-height: 1.4;
    
    /* 为伪元素定位 */
    position: relative; 
    
    /* 为 "├──" 符号腾出空间 */
    padding-left: 25px; 
}

/* 为所有列表项添加 "├──" 符号
   (这是一个简化的树状图，它总是显示 ├──)
*/
#outlineList li::before {
    content: "├──";
    position: absolute;
    top: 4px;
    color: #adb5bd; /* 符号颜色 */
    font-family: monospace; /* 确保符号对齐 */
}

#outlineList li:hover {
    background-color: #e9ecef;
}
/* --- 新增：大纲列表样式 (最终简约版) --- */
#outlineList {
    list-style-type: none;
    max-height: 250px; 
    overflow-y: auto;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
    border: 1px solid #e0e0e0;
    text-align: left; /* 强制左对齐 */
}

/* 所有列表项的通用样式 */
#outlineList li {
    padding: 4px 8px;
    margin-bottom: 3px;
    border-radius: 4px;
    transition: background-color 0.2s;
    line-height: 1.4;
    position: relative; 
}

#outlineList li:hover {
    background-color: #e9ecef;
}

/* 不同级别的标题样式 (简约缩进) */
.outline-l1 {
    font-weight: bold;
    color: #2c3e50;
    font-size: 1.05em;
    padding-left: 8px; /* L1 基础缩进 */
}

.outline-l2 {
    color: #34495e;
    padding-left: 25px; /* L2 缩进 */
}

.outline-l3 {
    color: #7f8c8d;
    font-size: 0.95em;
    padding-left: 45px; /* L3 缩进 */
}

.outline-l4 {
    color: #95a5a6;
    font-size: 0.9em;
    padding-left: 65px; /* L4 缩进 */
}

/* * --- 强制清除残留的树状图线 ---
 * (使用 !important 确保覆盖旧规则)
 */
#outlineList li::before {
    content: none !important; 
}

/* --- 提示信息样式 --- */
.outline-info {
    font-style: italic;
    color: #7f8c8d;
    font-size: 0.9em;
    text-align: left; /* 确保提示也左对齐 */
    padding: 10px;
}
/* --- 结束：新增样式 --- */
/* --- 新增：大纲警告框样式 --- */
.outline-warning {
    margin-top: 20px;
    padding: 15px;
    background: #fffbe6; /* 淡黄色警告背景 */
    border: 1px solid #ffe58f;
    border-radius: 8px;
}
.outline-warning p {
    margin: 5px 0 0 0;
}
/* --- 结束：新增样式 --- */
/* --- 新增：页脚反馈链接样式 --- */
.feedback-link {
    margin: 10px 0; /* 增加一点上下间距 */
    font-size: 0.95em;
}

.feedback-link a {
    color: #7E57C2; /* 使用主题紫色 */
    text-decoration: none; /* 移除下划线 */
    font-weight: 500; /* 稍微软的加粗 */
}

.feedback-link a:hover {
    text-decoration: underline; /* 鼠标悬停时显示下划线 */
    color: #673AB7; /* 悬停时颜色加深 */
}
/* --- 结束：新增样式 --- */


/* --- 新增：支持功能区域样式 --- */
.features-section {
    background: linear-gradient(135deg, #f3e5f5 0%, #ffffff 100%); /* 淡紫色渐变 */
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.feature-category {
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    border-left: 4px solid #7E57C2;
}

.feature-category h3 {
    display: flex;
    align-items: center;
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.2em;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.feature-category h3 .icon {
    margin-right: 10px;
    font-size: 1.3em;
}

.feature-category ul {
    list-style-type: none;
    padding-left: 5px;
}

.feature-item {
    color: #34495e;
    margin-bottom: 8px;
    position: relative;
    padding-left: 20px;
    font-size: 0.95em;
}

.feature-item::before {
    content: "✓";
    color: #2ecc71; /* 绿色勾 */
    font-weight: bold;
    position: absolute;
    left: 0;
    top: 0;
}

/* 新增功能标签样式 */
.feature-item.new-feature::after {
    content: "NEW";
    background: linear-gradient(135deg, #7E57C2, #673AB7);
    color: white;
    font-size: 0.65em;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 8px;
    font-weight: bold;
    vertical-align: middle;
}
/* --- 结束：新增样式 --- */