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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f7fa;
    overflow: hidden;
    color: #333;
}

/* 编辑器容器 */
.editor-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
}

/* 顶部导航栏 */
.top-navbar {
    background-color: #fff;
    border-bottom: 1px solid #e0e6ed;
    padding: 0 20px;
    display: flex;
    align-items: center;
    height: 60px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.navbar-brand {
    font-size: 18px;
    font-weight: 600;
    color: #1890ff;
    margin-right: 40px;
}

.navbar-actions {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

/* 主要内容区域 */
.main-content {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* 左侧工具栏 */
.left-sidebar {
    width: 240px;
    background-color: #fff;
    border-right: 1px solid #e0e6ed;
    padding: 20px;
    overflow-y: auto;
}

/* 编辑器主体 */
.editor-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 格式工具栏 */
.format-toolbar {
    background-color: #fff;
    border-bottom: 1px solid #e0e6ed;
    padding: 10px 20px;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* 编辑区域 */
.editor-area {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* 编辑内容区域 */
.content-editing {
    flex: 1;
    background-color: #fff;
    margin: 20px;
    padding: 40px;
    overflow-y: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    max-width: 800px;
    min-width: 600px;
    margin-left: auto;
    margin-right: auto;
    height: calc(100vh - 220px);
}

/* 右侧属性面板 */
.right-sidebar {
    width: 280px;
    background-color: #fff;
    border-left: 1px solid #e0e6ed;
    padding: 20px;
    overflow-y: auto;
}

/* 工具栏按钮 */
.toolbar-btn {
    width: 36px;
    height: 36px;
    border: 1px solid #d9d9d9;
    background-color: #fff;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.toolbar-btn:hover {
    border-color: #1890ff;
    color: #1890ff;
}

.toolbar-btn.active {
    background-color: #e6f7ff;
    border-color: #1890ff;
    color: #1890ff;
}

/* 下拉选择器 */
.toolbar-select {
    height: 36px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    padding: 0 10px;
    background-color: #fff;
    font-size: 14px;
    outline: none;
}

.toolbar-select:focus {
    border-color: #1890ff;
}

/* 颜色选择器 */
.color-picker {
    width: 36px;
    height: 36px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    cursor: pointer;
    padding: 2px;
    overflow: hidden;
}

.color-picker input {
    width: 100%;
    height: 100%;
    border: none;
    cursor: pointer;
    background: none;
    outline: none;
}

/* 编辑器内容样式 */
#editor {
    min-height: 100%;
    outline: none;
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}

#editor h1 {
    font-size: 28px;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 24px;
}

#editor h2 {
    font-size: 24px;
    font-weight: 600;
    margin-top: 32px;
    margin-bottom: 16px;
}

#editor h3 {
    font-size: 20px;
    font-weight: 600;
    margin-top: 28px;
    margin-bottom: 14px;
}

#editor h4 {
    font-size: 18px;
    font-weight: 600;
    margin-top: 24px;
    margin-bottom: 12px;
}

#editor p {
    margin: 16px 0;
    text-indent: 2em;
}

#editor img {
    max-width: 100%;
    height: auto;
    margin: 16px 0;
    border-radius: 4px;
    display: block;
}

#editor ul, #editor ol {
    margin: 16px 0;
    padding-left: 2em;
}

#editor li {
    margin: 8px 0;
}

#editor blockquote {
    border-left: 4px solid #1890ff;
    padding-left: 16px;
    margin: 16px 0;
    color: #666;
    font-style: italic;
}

#editor table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

#editor table th, #editor table td {
    border: 1px solid #e8e8e8;
    padding: 8px 12px;
}

#editor table th {
    background-color: #fafafa;
    font-weight: 600;
}

#editor a {
    color: #1890ff;
    text-decoration: none;
}

#editor a:hover {
    text-decoration: underline;
}

#editor hr {
    border: none;
    border-top: 1px solid #e8e8e8;
    margin: 20px 0;
}

/* 工具栏分组 */
.toolbar-group {
    display: flex;
    gap: 4px;
    margin-right: 16px;
    padding: 4px;
    border-radius: 4px;
    background-color: #fafafa;
}

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

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

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

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

/* 模板列表样式 */
.template-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.template-item {
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
}

.template-item:hover {
    border-color: #1890ff;
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.15);
}

.template-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
}

.template-name {
    padding: 8px;
    text-align: center;
    font-size: 12px;
    color: #666;
}

/* 图片库样式 */
.image-library {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.image-item {
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
}

.image-item:hover {
    border-color: #1890ff;
    transform: scale(1.02);
}

.image-item img {
    width: 100%;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.image-item img:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border-color: #1890ff;
}

/* 样式库样式 */
.style-library {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.style-item {
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.style-item:hover {
    border-color: #1890ff;
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.15);
}

.style-preview {
    height: 40px;
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    padding: 0 10px;
}

.style-name {
    font-size: 12px;
    color: #666;
    text-align: center;
}

/* 文档信息样式 */
.document-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

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

.info-value {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .right-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .left-sidebar {
        display: none;
    }
    
    .content-editing {
        margin: 10px;
        padding: 20px;
        min-width: auto;
        height: calc(100vh - 180px);
    }
    
    .top-navbar {
        padding: 0 10px;
    }
    
    .navbar-brand {
        margin-right: 20px;
        font-size: 16px;
    }
    
    .format-toolbar {
        padding: 8px 10px;
        gap: 8px;
    }
    
    .toolbar-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .toolbar-select {
        height: 32px;
        font-size: 12px;
        padding: 0 8px;
    }
    
    .color-picker {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 480px) {
    .navbar-actions {
        flex-direction: column;
        gap: 5px;
    }
    
    .navbar-actions .el-button {
        padding: 4px 10px;
        font-size: 12px;
    }
    
    .toolbar-group {
        margin-right: 8px;
    }
}