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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    min-height: 100vh;
}

/* 页头样式 */
.page-header {
    text-align: center;
    padding: 20px;
    background: #fff;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.page-header h1 {
    font-size: 24px;
    color: #2196f3;
    margin-bottom: 10px;
}

.description {
    color: #666;
    font-size: 14px;
}

/* 主容器样式 */
.container {
    display: flex;
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
    gap: 20px;
    height: calc(100vh - 150px);
    min-height: 600px;
}

/* 面板通用样式 */
.file-panel, .editor-panel, .preview-panel {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

.panel-header {
    padding: 15px;
    font-weight: 500;
    color: #2196f3;
    border-bottom: 1px solid #eee;
}

/* 左侧面板 */
.file-panel {
    flex: 1;
    min-width: 250px;
    max-width: 300px;
}

.file-controls {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

#current-file {
    margin-bottom: 15px;
    font-size: 14px;
    color: #666;
}

.button-group {
    display: flex;
    gap: 10px;
}

.button {
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid #2196f3;
    background: #fff;
    color: #2196f3;
    flex: 1;
    display: inline-block;
    text-decoration: none;
}

.button:hover {
    background: #e3f2fd;
}

.button.primary {
    background: #2196f3;
    color: #fff;
}

.button.primary:hover {
    background: #1976d2;
}

.file-sections {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

/* 中间编辑区 */
.editor-panel {
    flex: 2;
    min-width: 400px;
}

#editor {
    flex: 1;
    width: 100%;
    padding: 15px;
    border: none;
    resize: none;
    font-size: 14px;
    line-height: 1.6;
    background: #fafafa;
}

/* 右侧预览区 */
.preview-panel {
    flex: 2;
    min-width: 400px;
}

.progress-container {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.progress-bar {
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
}

.progress-inner {
    height: 100%;
    background: #2196f3;
    width: 0;
    transition: width 0.3s ease;
}

.preview-content {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* 预览区域的段落样式 */
.preview-content p {
    margin-bottom: 1em;
    text-indent: 2em;
}

#preview {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-wrap;
    word-wrap: break-word;
    background-color: #fafafa;
    border-radius: 4px;
}

/* 分段列表样式 */
.section-item {
    padding: 10px;
    margin: 5px 0;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-left: 3px solid transparent;
}

.section-item:hover {
    background-color: #f5f5f5;
}

.section-item.selected {
    background-color: #e3f2fd;
    border-left-color: #2196F3;
}

.section-item.completed {
    border-left-color: #4CAF50;
}

.section-item.processing {
    border-left-color: #FFC107;
}

.section-item.failed {
    border-left-color: #f44336;
}

.section-info {
    display: flex;
    flex-direction: column;
}

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

.section-title {
    font-weight: 500;
    flex-shrink: 0;
}

.section-stats {
    color: #666;
    font-size: 0.9em;
    margin-left: 8px;
}

.status {
    font-size: 0.85em;
    padding: 2px 8px;
    border-radius: 10px;
    color: #fff;
    margin-left: auto;
}

.status.completed {
    background-color: #4CAF50;
}

.status.processing {
    background-color: #FFC107;
    color: #000;
}

.status.failed {
    background-color: #f44336;
}

.section-actions {
    display: flex;
    gap: 4px;
    margin-left: 8px;
}

.icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1em;
    padding: 4px;
    color: #666;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: #000;
}

.icon.retry:hover {
    color: #2196F3;
}

.icon.proofread:hover {
    color: #4CAF50;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

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

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