:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #0056b3;
    --bg-color: #f4f6f9;
    --text-color: #333333;
    --border-color: #e0e6ed;
}

* {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Serif SC', 'Songti SC', 'STSong', serif; /* 学术/社论风格字体 */
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.7;
    margin: 0;
    padding: 20px 0;
}

.container {
    max-width: 210mm; /* A4宽度标准 */
    margin: 0 auto;
    padding: 30mm 20mm; /* 模拟A4纸边距 */
    background-color: #ffffff;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

/* 打印及导出PDF时的A4优化 */
@page {
    size: A4;
    margin: 20mm;
}
@media print {
    body {
        background-color: transparent;
        padding: 0;
    }
    .container {
        box-shadow: none;
        padding: 0;
        margin: 0;
        max-width: 100%;
        width: 100%;
    }
    .qa-section,
    .summary-text,
    .callout {
        page-break-inside: auto;
        break-inside: auto;
    }
    p, li {
        orphans: 2;
        widows: 2;
    }
}

/* 主标题 */
.main-title {
    text-align: center;
    font-size: 2.2em;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 15px;
    margin-bottom: 20px;
    font-weight: bold;
    letter-spacing: 2px;
}

/* 学生信息区 */
.student-info {
    display: flex;
    justify-content: center;
    gap: 30px;
    background-color: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 40px;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: #555;
    border: 1px solid #eaeaea;
    flex-wrap: wrap;
}

.student-info p {
    margin: 0;
    font-size: 1.05em;
    font-weight: 500;
}

/* 章节大标题 */
.section-title {
    color: var(--primary-color);
    font-size: 1.5em;
    border-left: 6px solid var(--accent-color);
    padding-left: 15px;
    margin-top: 30px;
    margin-bottom: 20px;
    background-color: #f0f4f8;
    padding: 10px 10px 10px 15px;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* 列表区 */
.question-list {
    background-color: #fafafa;
    padding: 20px 20px 20px 40px;
    border-radius: 8px;
    border-left: 3px solid #ccc;
    margin-bottom: 30px;
}

.question-list li {
    margin-bottom: 12px;
    font-size: 1.1em;
}

/* 关键词气泡 */
.keyword-bubbles {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 30px;
    padding: 15px 0;
}

.keyword {
    background-color: var(--accent-color);
    color: white;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 1.05em;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    transition: transform 0.2s;
    display: inline-block;
}

.keyword:hover {
    transform: translateY(-2px);
}

/* Q&A 问答区 */
.qa-section {
    margin-bottom: 40px;
    padding-top: 25px;
    border-top: 1px solid var(--border-color);
}

.qa-title {
    font-size: 1.4em;
    color: var(--primary-color);
    margin-bottom: 20px;
    font-weight: bold;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* 子版块 (学习内容/出处/实际应用) */
.sub-section {
    margin-bottom: 20px;
}

.sub-title {
    font-size: 1.15em;
    color: var(--accent-color);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

.sub-title::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 18px;
    background-color: var(--accent-color);
    margin-right: 10px;
    border-radius: 3px;
}

/* 文本与链接 */
p {
    margin-bottom: 15px;
    text-align: justify;
}

ul, ol {
    margin-bottom: 20px;
    padding-left: 25px;
}

li {
    margin-bottom: 8px;
}

strong {
    color: #1a252f;
    font-weight: bold;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px dotted var(--accent-color);
}

a:hover {
    text-decoration: none;
    background-color: #f0f4f8;
}

/* 正文数字引用：用论文式上标呈现，并保留点击跳转能力 */
.citation {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 0.78em;
    line-height: 0;
    vertical-align: super;
    margin-left: 1px;
}

.citation a {
    border-bottom: none;
    color: var(--accent-color);
    padding: 0 1px;
}

.citation a:hover {
    background-color: #eaf2fb;
    border-radius: 2px;
}

/* 出处列表：每题独立编号，作为正文上标引用的跳转目标 */
.reference-list {
    padding-left: 30px;
}

.reference-list li {
    scroll-margin-top: 20px;
}

.reference-list li:target {
    background-color: #fff6d8;
    outline: 2px solid #f4c542;
    border-radius: 4px;
    padding: 4px 6px;
}

/* 分隔线 */
hr {
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0));
    margin: 40px 0;
}

/* 引用提示框 */
.callout {
    font-weight: bold;
    background-color: #fff9e6;
    padding: 20px;
    border-left: 6px solid #ffc107;
    border-radius: 4px;
    color: #5c4600;
    margin-top: 20px;
}

/* 第二幕新增结构：问题前导说明 */
.lead-section {
    margin-bottom: 28px;
}

.lead-text {
    background-color: #f8fbff;
    border-left: 4px solid #b5cbe1;
    border-radius: 4px;
    padding: 14px 18px;
}

.summary-text {
    margin-top: 20px;
}

.lead-text p:last-child,
.question-intro p:last-child,
.summary-text p:last-child,
.callout p:last-child,
.callout ul:last-child,
.callout ol:last-child {
    margin-bottom: 0;
}

.question-intro {
    margin-bottom: 18px;
}

/* 第二幕新增结构：四级小标题 */
.mini-title {
    font-size: 1.08em;
    color: var(--secondary-color);
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: bold;
}

/* 行内代码兜底样式 */
code {
    background-color: #f4f6f9;
    border-radius: 4px;
    padding: 2px 6px;
    font-family: 'Consolas', 'Menlo', monospace;
    font-size: 0.95em;
}

blockquote.callout {
    margin-left: 0;
    margin-right: 0;
}

/* Markdown 表格：用于第二幕监测指标、肌钙蛋白亚基对照和指标总表 */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    margin: 18px 0 22px;
}

.md-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--border-color);
    background-color: #ffffff;
    font-size: 0.98em;
}

.md-table thead {
    background-color: #eef4fb;
}

.md-table th,
.md-table td {
    border: 1px solid var(--border-color);
    padding: 10px 12px;
    vertical-align: top;
}

.md-table th {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: var(--primary-color);
    font-weight: 700;
}

.md-table tbody tr:nth-child(even) {
    background-color: #fafcff;
}

.md-table .align-left {
    text-align: left;
}

.md-table .align-center {
    text-align: center;
}

.md-table .align-right {
    text-align: right;
}

@media print {
    .table-wrap {
        overflow: visible;
    }

    .md-table {
        font-size: 0.92em;
    }

    .md-table tr,
    .md-table td,
    .md-table th {
        break-inside: avoid;
    }
}
