:root {
            --primary-color: #3498db;
            --bg-color: #f8f9fa;
            --editor-bg: #ffffff;
            --border-color: #e0e0e0;
            --text-color: #333;
            --line-number-color: #6c757d;
            --secondary-bg: #f5f5f5;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', 'Segoe MDL2 Assets', Tahoma, Geneva, Verdana, sans-serif;
        }

        body {
            background-color: var(--bg-color);
            color: var(--text-color);
            height: 100vh;
            overflow: hidden;
        }

        .container {
            display: flex;
            flex-direction: column;
            height: 100vh;
        }

        /* 工具栏样式 */

        .toolbar {
            display: flex;
            padding: 10px 20px;
            background-color: var(--editor-bg);
            border-bottom: 1px solid var(--border-color);
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
            align-items: center;
            justify-content: center;
        }

        .toolbar-left {
            display: flex;
            align-items: center;
        }

        .toolbar-title {
            font-size: 1.2rem;
            font-weight: 600;
            margin-right: 20px;
            font-family: "Segoe UI Light";
        }

        .view-toggle {
            display: flex;
            background-color: #f1f1f1;
            border-radius: 4px;
            overflow: hidden;
            transition: .2s;
        }
        
        .view-toggle:hover {
            transition: .2s;
            box-shadow: 0px 0px 5px var(--primary-color);
        }

        .view-toggle button {
            padding: 6px 12px;
            border: none;
            background: none;
            cursor: pointer;
            transition: all 0.2s;
            font-size: 0.9rem;
            color: var(--primary-color);
        }

        .view-toggle button.active {
            background-color: var(--primary-color);
            color: white;
        }

        /* 编辑区 */

        .editor-container {
            display: flex;
            flex: 1;
            overflow: hidden;
        }

        .editor-panel {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            border-right: 1px solid var(--border-color);
        }

        /* 预览区 */

        .preview-panel {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }

        .panel-header {
            padding: 8px 15px;
            background-color: var(--secondary-bg);
            border-bottom: 1px solid var(--border-color);
            font-size: 0.9rem;
            font-weight: 500;
        }

        .editor-wrapper {
            position: relative;
            flex: 1;
            overflow: hidden;
        }

        .line-numbers {
            position: absolute;
            left: 0;
            top: 0;
            width: 50px;
            height: 100%;
            background-color: var(--secondary-bg);
            border-right: 1px solid var(--border-color);
            overflow: hidden;
            text-align: right;
            padding: 10px 5px;
            font-family: consolas;
            font-size: 18px;
            line-height: 1.5;
            color: var(--line-number-color);
            user-select: none;
        }

        textarea {
            width: 100%;
            height: 100%;
            border: none;
            resize: none;
            padding: 10px 10px 10px 60px;
            font-family: consolas;
            font-size: 18px;
            line-height: 1.5;
            background-color: var(--editor-bg);
            color: var(--text-color);
            outline: none;
            tab-size: 4;
        }

        .preview {
            flex: 1;
            padding: 15px;
            overflow-y: auto;
            background-color: var(--editor-bg);
        }

        .preview h1, .preview h2, .preview h3 {
            margin-top: 1.2em;
            margin-bottom: 0.6em;
        }

        .preview h1 {
            border-bottom: 1px solid var(--border-color);
            padding-bottom: 0.3em;
        }

        .preview p {
            margin-bottom: 1em;
            line-height: 1.6;
        }

        .preview blockquote {
            border-left: 4px solid var(--primary-color);
            padding-left: 1em;
            margin: 1em 0;
            color: #6a737d;
        }

        .preview code {
            background-color: #f6f8fa;
            padding: 2px 4px;
            border-radius: 3px;
            font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
            font-size: 0.9em;
        }

        .preview pre {
            background-color: #f6f8fa;
            padding: 16px;
            border-radius: 6px;
            overflow-x: auto;
            margin-bottom: 1em;
            font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
            font-size: 0.9em;
            line-height: 1.45;
        }

        .preview pre code {
            background: none;
            padding: 0;
            font-family: inherit;
        }

        .preview pre code *,
        .preview pre code span {
            font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
        }

        .preview ul, .preview ol {
            margin-bottom: 1em;
            padding-left: 2em;
        }

        .preview table {
            border-collapse: collapse;
            width: 100%;
            margin-bottom: 1em;
        }

        .preview table th, .preview table td {
            border: 1px solid var(--border-color);
            padding: 6px 13px;
        }

        .preview table th {
            background-color: #f6f8fa;
        }

        .preview img {
            max-width: 100%;
        }

        .preview a {
            color: var(--primary-color);
            text-decoration: none;
        }

        .preview a:hover {
            text-decoration: underline;
        }

        .preview hr {
            border: none;
            border-top: 2px solid var(--border-color);
            margin: 1.5em 0;
        }

        .preview del {
            text-decoration: line-through;
            color: #6a737d;
        }

        .preview table td.merge-up,
        .preview table td.merge-left {
            background-color: #f6f8fa;
            color: #999;
            font-size: 0.8em;
            text-align: center;
        }

        .preview .task-list-item {
            list-style: none;
        }

        .preview .task-list-item input[type="checkbox"] {
            margin-right: 0.5em;
            cursor: not-allowed;
        }

        .hidden {
            display: none !important;
        }

        .full-width {
            width: 100% !important;
        }

        @media (max-width: 768px) {
            .editor-container {
                flex-direction: column;
            }
            
            .editor-panel, .preview-panel {
                height: 50%;
            }
            
            .view-toggle button {
                padding: 4px 8px;
                font-size: 0.8rem;
            }
        }

/* ===== 主题下拉框定位 ===== */
.theme-select{
  margin-left: 12px;
  padding: 6px 8px;
  font-size: 0.9rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  background: var(--editor-bg);
  color: var(--text-color);
  cursor: pointer;
}

/* ===== 主题变量 ===== */
/* 1. Light（默认，已在:root里定义，无需重复） */

/* 2. Dark */
[data-theme="dark"]{
  --primary-color: #58a6ff;
  --bg-color: #0d1117;
  --editor-bg: #161b22;
  --border-color: #30363d;
  --text-color: #c9d1d9;
  --line-number-color: #6e7681;
  --secondary-bg: #161b22;
}

/* 3. One Dark Pro – 一体化去蓝 */
[data-theme="one-dark-pro"]{
  --primary-color: #98c379;          /* 柔和绿色 */
  --bg-color: #282c34;
  --editor-bg: #282c34;
  --border-color: #21252b;
  --text-color: #abb2bf;
  --line-number-color: #4b5263;
  --secondary-bg: #21252b;
}

/* 4. Solarized Light */
[data-theme="solarized-light"]{
  --primary-color: #268bd2;
  --bg-color: #fdf6e3;
  --editor-bg: #fbf1c7;
  --border-color: #eee8d5;
  --text-color: #657b83;
  --line-number-color: #93a1a1;
  --secondary-bg: #eee8d5;
}

/* 5. Solarized Dark */
[data-theme="solarized-dark"]{
  --primary-color: #268bd2;
  --bg-color: #002b36;
  --editor-bg: #073642;
  --border-color: #073642;
  --text-color: #839496;
  --line-number-color: #586e75;
  --secondary-bg: #073642;
}

/* 6. Dracula */
[data-theme="dracula"]{
  --primary-color: #bd93f9;
  --bg-color: #282a36;
  --editor-bg: #282a36;
  --border-color: #44475a;
  --text-color: #f8f8f2;
  --line-number-color: #6272a4;
  --secondary-bg: #44475a;
}

/* 7. Quiet Light */
[data-theme="quiet-light"]{
  --primary-color: #6c99bb;
  --bg-color: #f3f3f3;
  --editor-bg: #ffffff;
  --border-color: #e0e0e0;
  --text-color: #383a42;
  --line-number-color: #9d9d9f;
  --secondary-bg: #f3f3f3;
}

/* 8. Night Blue */
[data-theme="night-blue"]{
  --primary-color: #82aaff;
  --bg-color: #011627;
  --editor-bg: #011627;
  --border-color: #1d3b53;
  --text-color: #d6deeb;
  --line-number-color: #4b6479;
  --secondary-bg: #1d3b53;
}
