/* 全局变量 */
:root {
    --primary: #2d3748;
    --accent: #4299e1;
    --border: #e2e8f0;
    --bg-light: #f8fafc;
    --danger: #e53e3e;
    --success: #48bb78;
}

/* 站点外壳保护：阻止预览主题（concise/md2html-typora）的 body 级规则破坏 header/main/footer 布局 */
body {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 转换器工作区布局（替代原独立页面的 body 约束） */
.container {
    max-width: 1000px;
    margin: 0 auto;
}

/* 通用区块 */
.section {
    margin: 2rem 0;
}

h2 {
    margin-bottom: 1rem;
}

h3 {
    margin-bottom: 0.75rem;
    font-size: 16px;
}

/* 输入区样式 */
.input-area textarea {
    width: 100%;
    min-height: 250px;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Fira Code', monospace;
    resize: vertical;
}

.input-area textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

/* Typora选项样式 */
.typora-option {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 14px;
    color: var(--primary);
}

/* 按钮样式 */
.btn-group {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    flex-wrap: wrap;
    /* 适配小屏幕 */
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: var(--accent);
    color: white;
}

.btn-primary:hover {
    background-color: #3182ce;
}

.btn-primary:disabled {
    background-color: var(--border);
    cursor: not-allowed;
    opacity: 0.7;
}

/* 预览区样式 */
.preview-area {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1.5rem;
    background-color: var(--bg-light);
    min-height: 250px;
    line-height: 1.6;
}

/* 源码区样式 */
.source-area textarea {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    resize: vertical;
    white-space: pre-wrap;
}

/* 全选按钮样式 */
.select-all-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    background-color: #f8fafc;
    color: #4299e1;
    border: 1px solid #e2e8f0;
    margin-bottom: 0.5rem;
    transition: all 0.2s;
}

.select-all-btn:hover {
    background-color: #e2e8f0;
    color: #3182ce;
}

.content-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* 提示框样式 */
.error-alert {
    padding: 1rem;
    border-left: 4px solid var(--danger);
    color: var(--danger);
    background-color: rgba(229, 62, 62, 0.1);
    margin: 1rem 0;
    display: none;
    border-radius: 4px;
}

.error-alert.success {
    border-left-color: var(--success);
    color: var(--success);
    background-color: rgba(72, 187, 120, 0.1);
}

/* 辅助类 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* 页脚导航链接可读色（站点 styles.css 默认将 nav 链接设为白色，不适配浅色页脚） */
.site-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

    .site-nav ul li a {
        color: #2d3748;
        text-decoration: none;
    }

        .site-nav ul li a:hover {
            color: #007BFF;
            text-decoration: underline;
        }