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

/* MathJax SVG 样式优化 */
.MathJax {
    outline: 0;
    text-align: center;
    display: inline-block !important;
    vertical-align: middle;
}

.MathJax_SVG {
    display: inline-block;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

.MathJax_SVG_Display {
    margin: 1em 0;
    text-align: center;
    overflow-x: auto;
    overflow-y: hidden;
    max-width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.header p {
    opacity: 0.9;
    font-size: 1.1rem;
}

/* 头部区域链接：白色文字，保留默认下划线 */
.header a,
.header a:visited {
    color: #fff;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    height: calc(100vh - 180px);
    min-height: 600px;
}

.panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    background: #f8fafc;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.channel-reminder {
    display: none;
    margin: 0 1.5rem;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    color: #92400e;
    font-size: 0.85rem;
    line-height: 1.4;
}

.channel-reminder.show {
    display: block;
}

.panel-title {
    font-weight: 600;
    color: #334155;
    font-size: 1.1rem;
}

.btn {
    background: #7E3AF2;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn:hover {
    background: #6d28d9;
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn.success {
    background: #10b981;
}

.panel-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#markdownInput {
    flex: 1;
    border: none;
    padding: 1.5rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.6;
    resize: none;
    outline: none;
    background: #fafafa;
    overflow-y: auto;
    scroll-behavior: smooth;
}

#markdownInput::-webkit-scrollbar {
    width: 8px;
}

#markdownInput::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#markdownInput::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

#markdownInput::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

#htmlOutput {
    flex: 1;
    border: none;
    padding: 1.5rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    line-height: 1.4;
    resize: none;
    outline: none;
    background: #f8f9fa;
    color: #495057;
    overflow-y: auto;
    max-height: calc(100vh - 400px);
    min-height: 400px;
    scroll-behavior: smooth;
}

#htmlOutput::-webkit-scrollbar {
    width: 8px;
}

#htmlOutput::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#htmlOutput::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

#htmlOutput::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

#preview {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    background: white;
    max-height: calc(100vh - 400px);
    min-height: 400px;
    scroll-behavior: smooth;
}

/* KaTeX 字体大小调整 */
.katex { font-size: 1.1em; }

#preview::-webkit-scrollbar {
    width: 8px;
}

#preview::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#preview::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

#preview::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.tabs {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    color: #64748b;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.tab.active {
    color: #7E3AF2;
    border-bottom-color: #7E3AF2;
    background: white;
}

.tab-content {
    display: none;
    flex: 1;
    flex-direction: column;
}

.tab-content.active {
    display: flex;
}

@media (max-width: 768px) {
    .container {
        grid-template-columns: 1fr;
        height: auto;
        gap: 1rem;
        padding: 1rem;
        min-height: auto;
    }
    
    .panel {
        height: 500px;
        min-height: 500px;
    }
    
    #preview, #htmlOutput {
        max-height: 350px;
        min-height: 350px;
    }
    
    #markdownInput {
        min-height: 350px;
    }
}

/* 微信公众号样式预览 */
.wechat-preview {
    font-family: "PingFang SC", system-ui, -apple-system, "Helvetica Neue", "Microsoft YaHei", Arial, sans-serif;
    color: rgba(0, 0, 0, 0.9);
    line-height: 1.5em;
}

/* 通用 Markdown 预览样式（用于 GitHub 渠道） */
.markdown-preview {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans', 'Helvetica Neue', Arial, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    color: #111827;
    line-height: 1.7;
}
.markdown-preview p { margin: 12px 0; }
.markdown-preview h1 { font-size: 1.8rem; margin: 1.2em 0 0.6em; }
.markdown-preview h2 { font-size: 1.5rem; margin: 1.1em 0 0.6em; }
.markdown-preview h3 { font-size: 1.25rem; margin: 1em 0 0.5em; }
.markdown-preview code { background: #f3f4f6; padding: 2px 4px; border-radius: 4px; }
.markdown-preview pre { background: #f8fafc; padding: 14px; border-radius: 6px; overflow-x: auto; }
.markdown-preview a { color: #2563eb; text-decoration: none; border-bottom: 1px solid #93c5fd; }
.markdown-preview table { border-collapse: collapse; width: 100%; margin: 16px 0; }
.markdown-preview th, .markdown-preview td { border: 1px solid #e5e7eb; padding: 8px 10px; text-align: left; }
.markdown-preview th { background: #f9fafb; }

/* Markdown list styles (restore indentation and nesting) */
.markdown-preview ul,
.markdown-preview ol {
    margin: 0.8em 0;
    padding-left: 1.5em; /* re-add indent removed by global reset */
}
.markdown-preview li { margin: 0.25em 0; }
.markdown-preview ul { list-style: disc outside; }
.markdown-preview ul ul { list-style: circle outside; }
.markdown-preview ul ul ul { list-style: square outside; }
.markdown-preview ol { list-style: decimal outside; }
.markdown-preview ol ol { list-style: lower-alpha outside; }
.markdown-preview ol ol ol { list-style: lower-roman outside; }
.markdown-preview ul ul,
.markdown-preview ol ol {
    margin-top: 0.2em;
    margin-bottom: 0.2em;
}

.demo-section {
    margin: 2rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #7E3AF2;
}

.demo-title {
    font-weight: 600;
    color: #7E3AF2;
    margin-bottom: 1rem;
}

table {
    border-collapse: collapse;
    margin: 15px 0;
    width: 100%;
    border: 1px solid #e2e8f0;
}

th, td {
    border: 1px solid #e2e8f0;
    padding: 10px 12px;
    text-align: left;
}

th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #334155;
}

tr:nth-child(even) {
    background-color: #f8fafc;
}

/* 主题选择器样式 */
.theme-selector {
    position: relative;
    display: inline-block;
}

.theme-btn {
    font-size: 16px;
    min-width: 40px;
    padding: 5px 8px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.theme-panel {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 1000;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 280px;
    margin-top: 4px;
    animation: fadeInDown 0.2s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.theme-panel-header {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.theme-options {
    padding: 8px;
}

.theme-option {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.theme-option:last-child {
    margin-bottom: 0;
}

.theme-option:hover {
    background: #f8f9fa;
}

.theme-option.active {
    background: #e8f4fd;
    border: 1px solid #bfdbfe;
}

.theme-color {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    margin-right: 12px;
    border: 2px solid white;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.theme-info {
    flex: 1;
}

.theme-name {
    font-weight: 600;
    color: #333;
    font-size: 13px;
    margin-bottom: 2px;
}

.theme-desc {
    font-size: 12px;
    color: #666;
}

.theme-divider {
    border: none;
    border-top: 1px solid #eee;
    margin: 8px 0 8px 0;
}

.custom-color-option {
    margin-top: 6px;
    padding: 8px 0 0 0;
}

.custom-color-input {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
}
.custom-color-input:focus {
    border-color: #7E3AF2;
}

.custom-color-preview {
    display: inline-block;
    vertical-align: middle;
    background: #fff;
    border: 1px solid #ddd;
    transition: background 0.2s, border-color 0.2s;
}

.custom-color-btn {
    padding: 4px 12px;
    font-size: 13px;
    background: #7E3AF2;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}
.custom-color-btn:hover {
    background: #6d28d9;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .theme-panel {
        right: -50px;
        min-width: 260px;
    }
    
    .theme-option {
        padding: 12px;
    }
    
    .theme-color {
        width: 28px;
        height: 28px;
    }
    
    .theme-name {
        font-size: 14px;
    }
    
    .theme-desc {
        font-size: 13px;
    }
} 
