/* Obsidian主题与样式配置 */

/* ===== 全局样式 ===== */
:root {
    /* 主题颜色 */
    --background-primary: #ffffff;
    --background-secondary: #f5f5f5;
    --text-normal: #333333;
    --text-muted: #666666;
    --text-faint: #999999;
    
    /* 强调色 */
    --interactive-accent: #3b82f6;
    --interactive-accent-hover: #2563eb;
    
    /* 代码块 */
    --code-background: #f8f8f8;
    --code-text: #333333;
    
    /* 链接 */
    --link-color: #3b82f6;
    --link-color-hover: #2563eb;
    
    /* 边框 */
    --border-color: #e5e5e5;
    
    /* 阴影 */
    --shadow-s: 0 1px 2px rgba(0, 0, 0, 0.1);
    --shadow-m: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-l: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* ===== 暗色主题 ===== */
.theme-dark {
    --background-primary: #1e1e1e;
    --background-secondary: #252525;
    --text-normal: #d4d4d4;
    --text-muted: #858585;
    --text-faint: #5a5a5a;
    
    --code-background: #2d2d2d;
    --code-text: #d4d4d4;
    
    --border-color: #3a3a3a;
}

/* ===== 标题样式 ===== */
.markdown-preview-view h1 {
    font-size: 2em;
    font-weight: bold;
    color: var(--text-normal);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.3em;
    margin-top: 1em;
    margin-bottom: 0.5em;
}

.markdown-preview-view h2 {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--text-normal);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.3em;
    margin-top: 0.8em;
    margin-bottom: 0.5em;
}

.markdown-preview-view h3 {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--text-normal);
    margin-top: 0.6em;
    margin-bottom: 0.4em;
}

/* ===== 代码块样式 ===== */
.markdown-preview-view code {
    background-color: var(--code-background);
    color: var(--code-text);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
}

.markdown-preview-view pre {
    background-color: var(--code-background);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 1em;
    overflow-x: auto;
}

.markdown-preview-view pre code {
    background-color: transparent;
    padding: 0;
}

/* ===== 链接样式 ===== */
.markdown-preview-view a {
    color: var(--link-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
}

.markdown-preview-view a:hover {
    color: var(--link-color-hover);
    border-bottom-color: var(--link-color-hover);
}

/* ===== 表格样式 ===== */
.markdown-preview-view table {
    border-collapse: collapse;
    width: 100%;
    margin: 1em 0;
}

.markdown-preview-view table th {
    background-color: var(--background-secondary);
    font-weight: bold;
    padding: 0.5em;
    text-align: left;
    border: 1px solid var(--border-color);
}

.markdown-preview-view table td {
    padding: 0.5em;
    border: 1px solid var(--border-color);
}

.markdown-preview-view table tr:nth-child(even) {
    background-color: var(--background-secondary);
}

/* ===== 引用样式 ===== */
.markdown-preview-view blockquote {
    border-left: 4px solid var(--interactive-accent);
    padding-left: 1em;
    margin: 1em 0;
    color: var(--text-muted);
    background-color: var(--background-secondary);
    padding: 0.5em 1em;
    border-radius: 4px;
}

/* ===== 列表样式 ===== */
.markdown-preview-view ul,
.markdown-preview-view ol {
    margin: 0.5em 0;
    padding-left: 2em;
}

.markdown-preview-view li {
    margin: 0.3em 0;
    line-height: 1.6;
}

/* ===== 任务列表样式 ===== */
.markdown-preview-view input[type="checkbox"] {
    margin-right: 0.5em;
    cursor: pointer;
}

.markdown-preview-view input[type="checkbox"]:checked + span {
    text-decoration: line-through;
    color: var(--text-muted);
}

/* ===== 标签样式 ===== */
.markdown-preview-view .tag {
    background-color: var(--interactive-accent);
    color: white;
    padding: 0.2em 0.5em;
    border-radius: 3px;
    font-size: 0.9em;
    margin: 0 0.2em;
}

/* ===== 高亮样式 ===== */
.markdown-preview-view mark {
    background-color: #ffeb3b;
    color: #000;
    padding: 0.1em 0.2em;
    border-radius: 2px;
}

/* ===== 分隔线样式 ===== */
.markdown-preview-view hr {
    border: none;
    border-top: 2px solid var(--border-color);
    margin: 2em 0;
}

/* ===== 图片样式 ===== */
.markdown-preview-view img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: var(--shadow-m);
    margin: 1em 0;
}

/* ===== 自定义类 ===== */
.callout {
    padding: 1em;
    margin: 1em 0;
    border-radius: 4px;
    border-left: 4px solid var(--interactive-accent);
    background-color: var(--background-secondary);
}

.callout-info {
    border-left-color: #3b82f6;
    background-color: #eff6ff;
}

.callout-warning {
    border-left-color: #f59e0b;
    background-color: #fffbeb;
}

.callout-error {
    border-left-color: #ef4444;
    background-color: #fef2f2;
}

.callout-success {
    border-left-color: #10b981;
    background-color: #f0fdf4;
}

/* ===== 打印样式 ===== */
@media print {
    .markdown-preview-view {
        background: white;
        color: black;
    }
    
    .markdown-preview-view a {
        color: black;
        text-decoration: underline;
    }
    
    .markdown-preview-view code {
        background: #f5f5f5;
    }
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    .markdown-preview-view {
        font-size: 0.9em;
    }
    
    .markdown-preview-view h1 {
        font-size: 1.5em;
    }
    
    .markdown-preview-view h2 {
        font-size: 1.3em;
    }
    
    .markdown-preview-view table {
        font-size: 0.9em;
    }
}
