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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

header {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header h1 {
    color: #667eea;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

header p {
    color: #666;
    font-size: 1.1rem;
}

main {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.editor-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.editor-panel, .preview-panel {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.editor-panel h2, .preview-panel h2 {
    color: #667eea;
    margin-bottom: 1rem;
}

#markdown-input {
    width: 100%;
    min-height: 400px;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    resize: vertical;
    transition: border-color 0.3s;
}

#markdown-input:focus {
    outline: none;
    border-color: #667eea;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

#preview-output {
    padding: 1rem;
    background: #f9f9f9;
    border-radius: 5px;
    min-height: 400px;
    overflow-x: auto;
}

#preview-output h1 { font-size: 2rem; margin: 1rem 0; }
#preview-output h2 { font-size: 1.5rem; margin: 0.8rem 0; }
#preview-output h3 { font-size: 1.2rem; margin: 0.6rem 0; }
#preview-output p { margin: 0.5rem 0; line-height: 1.6; }
#preview-output ul, #preview-output ol { margin-left: 2rem; }
#preview-output code { 
    background: #e0e0e0; 
    padding: 0.2rem 0.4rem; 
    border-radius: 3px;
    font-size: 0.9em;
}
#preview-output pre { 
    background: #2d2d2d; 
    color: #fff;
    padding: 1rem; 
    border-radius: 5px;
    overflow-x: auto;
    margin: 1rem 0;
}
#preview-output pre code { 
    background: none; 
    padding: 0;
}

.html-output {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    position: relative;
}

.html-output h3 {
    color: #667eea;
    margin-bottom: 1rem;
}

.html-output pre {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 1rem;
    overflow-x: auto;
    font-size: 14px;
}

.copy-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.copy-btn:hover {
    background: #764ba2;
    transform: translateY(-2px);
}

.copy-btn.copied {
    background: #4caf50;
}

#copy-raw-html {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
}

.features {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.features h3 {
    color: #667eea;
    margin-bottom: 1rem;
}

.features ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.features li {
    padding: 0.5rem;
    color: #555;
}

footer {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    text-align: center;
    margin-top: 3rem;
}

.ad-area {
    background: #f0f0f0;
    padding: 2rem;
    margin-bottom: 1rem;
    border-radius: 5px;
    border: 2px dashed #ccc;
}

@media (max-width: 768px) {
    .editor-container {
        grid-template-columns: 1fr;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .features ul {
        grid-template-columns: 1fr;
    }
}