:root {
    --primary-color: #6c5ce7;
    --secondary-color: #a29bfe;
    --dark-color: #2d3436;
    --light-color: #f5f6fa;
    --success-color: #00b894;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--light-color);
    color: var(--dark-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.container {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    height: calc(100vh - 120px);
}

.editor-wrapper {
    display: flex;
    gap: 1rem;
    height: 100%;
}

.code-editor {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    min-width: 300px;
}

.editor-header {
    background-color: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.editor-title {
    font-size: 0.9rem;
    font-weight: 500;
}

.editor-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.line-numbers {
    background-color: #f8f9fa;
    color: #6c757d;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.5;
    padding: 1rem 0.5rem;
    text-align: right;
    overflow-y: hidden;
    border-right: 1px solid #dee2e6;
    user-select: none;
}

.code-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

textarea {
    flex: 1;
    padding: 1rem;
    border: none;
    resize: none;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.5;
    background-color: #f8f9fa;
    color: var(--dark-color);
    min-height: 200px;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
}

textarea:focus {
    outline: none;
}

.button-group {
    display: flex;
    gap: 0.5rem;
}

button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.run-btn {
    background-color: var(--success-color);
    color: white;
}

.run-btn:hover {
    background-color: #00a884;
}

.preview-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    min-width: 300px;
    position: relative;
}

.preview-header {
    background-color: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

iframe {
    flex: 1;
    border: none;
    background-color: white;
    min-height: 200px;
}

footer {
    background-color: var(--dark-color);
    color: white;
    padding: 1rem 2rem;
    text-align: center;
    font-size: 0.9rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

a {
    color: var(--secondary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* 响应式布局 */
@media (max-width: 768px) {
    .editor-wrapper {
        flex-direction: column;
    }
    
    .container {
        height: auto;
        min-height: calc(100vh - 120px);
    }
}

/* 全屏样式 */
.preview-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    background-color: white;
    border-radius: 0;
}

.preview-fullscreen iframe {
    height: 100%;
}

.fullscreen-btn {
    background-color: var(--secondary-color);
    color: white;
}

.fullscreen-btn:hover {
    background-color: #9189fe;
}

.fullscreen-btn.fullscreen-active {
    background-color: #ff7675;
}

.fullscreen-btn.fullscreen-active:hover {
    background-color: #e84343;
}