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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    height: 100vh;
    overflow: hidden;
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-selector label {
    font-size: 0.9rem;
}

.file-selector select {
    padding: 0.5rem;
    border: none;
    border-radius: 4px;
    background-color: white;
    color: #333;
    font-size: 0.9rem;
    min-width: 200px;
}

.save-btn {
    background-color: #27ae60;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.save-btn:hover {
    background-color: #219a52;
}

.save-btn:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.editor-panel {
    width: 20%;
    display: flex;
    flex-direction: column;
    border-right: 2px solid #bdc3c7;
}

.preview-panel {
    width: 80%;
    display: flex;
    flex-direction: column;
}

.panel-header {
    background-color: #34495e;
    color: white;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #2c3e50;
}

.panel-header h3 {
    font-size: 1rem;
    font-weight: 500;
}

#htmlEditor {
    flex: 1;
    border: none;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    outline: none;
    background-color: #2c3e50;
    color: #ecf0f1;
    tab-size: 2;
}

#htmlEditor:focus {
    background-color: #34495e;
}

#previewFrame {
    flex: 1;
    border: none;
    background-color: white;
    width: 100%;
    height: 100%;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #27ae60;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: all 0.3s ease;
}

.notification.hidden {
    opacity: 0;
    transform: translateX(100%);
    pointer-events: none;
}

.notification.error {
    background-color: #e74c3c;
}

.notification.warning {
    background-color: #f39c12;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .main-content {
        flex-direction: column;
    }
    
    .editor-panel {
        width: 100%;
        height: 40%;
        border-right: none;
        border-bottom: 2px solid #bdc3c7;
    }
    
    .preview-panel {
        width: 100%;
        height: 60%;
    }
}

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

#htmlEditor::-webkit-scrollbar-track {
    background: #2c3e50;
}

#htmlEditor::-webkit-scrollbar-thumb {
    background: #7f8c8d;
    border-radius: 4px;
}

#htmlEditor::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

