/* =========================================================================
   洪永淼《高级计量经济学》导读 —— 全局自定义样式
   作用：美化数学排版、callout、代码块、导航，统一中英混排观感
   ========================================================================= */

/* ---- 字体与基础排版 ---- */
html {
  font-size: 17px;
}

body {
  font-family: "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC",
               "PingFang SC", "Microsoft YaHei", Georgia, serif;
  line-height: 1.75;
  text-rendering: optimizeLegibility;
}

/* 英文与公式使用衬线无衬线搭配，提升可读性 */
p, li {
  font-feature-settings: "kern" 1, "liga" 1;
}

/* 标题层级：中文加粗、英文衬线 */
h1, h2, h3, h4 {
  font-family: "PingFang SC", "Microsoft YaHei", "Source Han Sans SC",
               "Helvetica Neue", Arial, sans-serif;
  font-weight: 600;
  line-height: 1.3;
}

h1 { border-bottom: 2px solid #0B5394; padding-bottom: 0.3em; }
h2 { border-bottom: 1px solid #c9d6e3; padding-bottom: 0.2em; margin-top: 1.8em; }

/* ---- 数学排版优化 ---- */
/* 行内公式与正文基线对齐，略微抬升 */
.math.inline {
  vertical-align: baseline;
}

/* 块级公式居中、上下留白 */
.math.display {
  display: block;
  text-align: center;
  margin: 1.2em 0;
}

/* 公式编号右对齐（Quarto 默认支持 \tag） */
mjx-container[display="true"] {
  margin: 1.3em 0 !important;
}

/* ---- Callout 自定义（核心教学法载体）----
   通过 Quarto callout 的 appearance/icon 控制，这里加细微修饰 */
.callout {
  border-radius: 8px;
  border-left-width: 4px;
  margin: 1.4em 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* 本科衔接铺垫（note / 绿） */
.callout-note {
  border-left-color: #2E7D32;
}
.callout-note .callout-header {
  background-color: #E8F5E9;
  color: #1B5E20;
  font-weight: 600;
}

/* 技术准备（tip / 蓝） */
.callout-tip {
  border-left-color: #0277BD;
}
.callout-tip .callout-header {
  background-color: #E1F5FE;
  color: #01579B;
  font-weight: 600;
}

/* 易混点/常见误区（warning / 红） */
.callout-warning {
  border-left-color: #C62828;
}
.callout-warning .callout-header {
  background-color: #FFEBEE;
  color: #B71C1C;
  font-weight: 600;
}

/* 本科生技术补丁（important / 紫） */
.callout-important {
  border-left-color: #6A1B9A;
}
.callout-important .callout-header {
  background-color: #F3E5F5;
  color: #4A148C;
  font-weight: 600;
}

/* 例子框（用 callout-note 配自定义标题） */
.callout-example, .callout-caution {
  border-left-color: #EF6C00;
}
.callout-caution .callout-header {
  background-color: #FFF3E0;
  color: #E65100;
  font-weight: 600;
}

/* ---- 代码块 ---- */
pre, code {
  font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
  font-size: 0.92em;
}

div.sourceCode {
  border-radius: 6px;
  border: 1px solid #e3e8ef;
}

/* ---- 表格 ---- */
table {
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.95em;
}
th, td {
  border: 1px solid #d0d7de;
  padding: 0.55em 0.85em;
  text-align: left;
}
th {
  background-color: #f1f5f9;
  font-weight: 600;
}
tbody tr:nth-child(even) {
  background-color: #fafbfc;
}

/* ---- 引用与术语 ---- */
blockquote {
  border-left: 4px solid #94a3b8;
  color: #475569;
  margin: 1.2em 0;
  padding: 0.2em 1em;
  background: #f8fafc;
}

/* 英文术语首次出现（中英并列）的样式 */
.term-en {
  color: #64748b;
  font-style: italic;
  font-size: 0.92em;
}

/* 页码引用（与教材对照） */
.ref-page {
  font-family: monospace;
  font-size: 0.85em;
  background: #eef2ff;
  color: #3730a3;
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
}

/* 公式卡 / 关键公式盒 */
.formula-card {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 1em 1.2em;
  margin: 1.2em 0;
}
.formula-card .card-title {
  font-weight: 600;
  color: #0B5394;
  margin-bottom: 0.5em;
  font-size: 0.95em;
}

/* 导航栏微调 */
.navbar {
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
