* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #ffffff;
    min-height: 100vh;
    overflow: hidden;
}

.editor-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background-color: #ffffff;
}

.toolbar-wrapper {
    display: flex;
    justify-content: center;
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
    background-color: #ffffff;
    position: relative;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 1400px;
}

.toolbar-main {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    overflow: hidden;
    flex: 1;
}

.toolbar-more {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.toolbar-divider {
    width: 1px;
    height: 28px;
    background-color: #e0e0e0;
    margin: 0 4px;
    flex-shrink: 0;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    color: #333333;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.15s ease;
    padding: 0;
    flex-shrink: 0;
}

.toolbar-btn:hover {
    background-color: #f0f0f0;
}

.toolbar-btn:active {
    background-color: #e0e0e0;
}

.toolbar-btn.active {
    background-color: #e8e8e8;
}

.toolbar-btn svg {
    pointer-events: none;
    width: 20px;
    height: 20px;
}

.color-a {
    font-weight: bold;
    text-decoration: underline;
    text-decoration-thickness: 3px;
    font-size: 18px;
}

.toolbar-select {
    height: 36px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    padding: 0 12px;
    font-size: 14px;
    color: #333333;
    background-color: #ffffff;
    cursor: pointer;
    outline: none;
    flex-shrink: 0;
}

.toolbar-select:hover {
    border-color: #b0b0b0;
}

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

.font-select {
    min-width: 150px;
}

.size-select {
    min-width: 90px;
}

.code-btn svg {
    width: 20px;
    height: 20px;
}

.more-btn svg {
    width: 20px;
    height: 20px;
}

.fullscreen-btn svg {
    width: 18px;
    height: 18px;
}

.process-btn {
    background-color: #e3f2fd;
    color: #1976d2;
}

.process-btn:hover {
    background-color: #bbdefb;
}

.process-btn svg {
    width: 20px;
    height: 20px;
}

.more-popup {
    position: absolute;
    top: calc(100% + 8px);
    right: 16px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    padding: 12px;
    display: none;
    z-index: 1000;
    min-width: 300px;
}

.more-popup.show {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.more-popup .toolbar-group {
    display: flex;
    gap: 4px;
}

.more-popup .toolbar-divider {
    height: 28px;
}

.editor-wrapper {
    flex: 1;
    overflow: auto;
    padding: 20px 40px;
    background-color: #ffffff;
}

.editor {
    min-height: calc(100vh - 100px);
    outline: none;
    font-size: 16px;
    line-height: 1.6;
    color: #333333;
}

.editor:empty:before {
    content: attr(data-placeholder);
    color: #999999;
    pointer-events: none;
}

.editor p {
    margin-bottom: 12px;
}

.editor h1, .editor h2, .editor h3 {
    margin-bottom: 16px;
    font-weight: bold;
}

.editor h1 {
    font-size: 28px;
}

.editor h2 {
    font-size: 24px;
}

.editor h3 {
    font-size: 20px;
}

.editor ul, .editor ol {
    margin-bottom: 12px;
    padding-left: 24px;
}

.editor li {
    margin-bottom: 4px;
}

.editor blockquote {
    border-left: 3px solid #e0e0e0;
    padding-left: 16px;
    margin: 12px 0;
    color: #666666;
}

.editor pre {
    background-color: #f5f5f5;
    padding: 12px;
    border-radius: 4px;
    overflow-x: auto;
    margin-bottom: 12px;
}

.editor code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
}

.editor a {
    color: #1976d2;
    text-decoration: underline;
}

.editor img {
    max-width: 100%;
    height: auto;
}

.editor table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 12px;
}

.editor th, .editor td {
    border: 1px solid #e0e0e0;
    padding: 8px;
    text-align: left;
}

.editor th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.editor.readonly {
    background-color: #fafafa;
    cursor: not-allowed;
}

.editor.processing {
    opacity: 0.6;
}

.chat-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background-color: #1976d2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    z-index: 1000;
}

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

.chat-icon svg {
    color: #ffffff;
}

.processing-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    border-left: 4px solid #1976d2;
    padding: 16px;
    max-width: 400px;
    min-width: 300px;
    z-index: 2000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.processing-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.notification-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background-color: #e3f2fd;
    border-radius: 50%;
    color: #1976d2;
    font-weight: bold;
    font-size: 16px;
}

.notification-title {
    flex: 1;
    font-weight: 600;
    font-size: 16px;
    color: #333333;
}

.notification-close {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    color: #666666;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease;
}

.notification-close:hover {
    background-color: #f0f0f0;
}

.notification-body p {
    margin-bottom: 8px;
    color: #666666;
    font-size: 14px;
}

.document-list {
    margin-top: 8px;
    max-height: 200px;
    overflow-y: auto;
}

.document-item {
    padding: 6px 8px;
    background-color: #f5f5f5;
    border-radius: 4px;
    margin-bottom: 4px;
    font-size: 13px;
    color: #444444;
    word-break: break-word;
}

@media (max-width: 1200px) {
    .toolbar-more {
        display: none;
    }
    
    .more-btn {
        display: flex !important;
    }
}

@media (max-width: 768px) {
    .toolbar-wrapper {
        padding: 10px 12px;
    }
    
    .toolbar-btn {
        width: 32px;
        height: 32px;
    }
    
    .toolbar-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .font-select,
    .size-select {
        display: none;
    }
    
    .editor-wrapper {
        padding: 16px 20px;
    }
    
    .chat-icon {
        width: 44px;
        height: 44px;
        bottom: 16px;
        right: 16px;
    }
}
