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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

.editor-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    height: calc(100vh - 180px);
}

.editor-panel,
.preview-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.panel-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
}

.toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

#editor {
    flex: 1;
    padding: 20px;
    border: none;
    outline: none;
    resize: none;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
    font-size: 14px;
    line-height: 1.6;
}

.preview-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    line-height: 1.8;
}

.preview-content h1,
.preview-content h2,
.preview-content h3,
.preview-content h4,
.preview-content h5,
.preview-content h6 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.25;
}

.preview-content h1 {
    font-size: 2em;
    border-bottom: 1px solid #eaecef;
    padding-bottom: 0.3em;
}

.preview-content h2 {
    font-size: 1.5em;
    border-bottom: 1px solid #eaecef;
    padding-bottom: 0.3em;
}

.preview-content h3 {
    font-size: 1.25em;
}

.preview-content p {
    margin-bottom: 16px;
}

.preview-content code {
    background: #f6f8fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 0.9em;
}

.preview-content pre {
    background: #f6f8fa;
    padding: 16px;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 16px;
}

.preview-content pre code {
    background: none;
    padding: 0;
}

.preview-content ul,
.preview-content ol {
    margin-bottom: 16px;
    padding-left: 2em;
}

.preview-content li {
    margin-bottom: 8px;
}

.preview-content blockquote {
    border-left: 4px solid #dfe2e5;
    padding-left: 16px;
    margin-bottom: 16px;
    color: #6a737d;
}

.preview-content a {
    color: #667eea;
    text-decoration: none;
}

.preview-content a:hover {
    text-decoration: underline;
}

.preview-content strong {
    font-weight: 600;
}

.preview-content em {
    font-style: italic;
}

.preview-content hr {
    height: 2px;
    background: #eaecef;
    border: none;
    margin: 24px 0;
}

@media (max-width: 768px) {
    .editor-container {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr;
    }

    header h1 {
        font-size: 1.8rem;
    }
}
