/* ==========================================================================
   站点自定义样式
   由 _config.yml -> theme_config.custom_css 引入（/css/custom.css）

   1. 通用页面排版（About / Publications 共用）
   2. About 页
   3. Publications 页（图左文右卡片）
   ========================================================================== */

/* ---------- 1. 通用页面排版 ---------- */

/* 章节标题：左侧强调条，层次更清楚 */
.page-content h2 {
  position: relative;
  margin: 2.4em 0 0.9em;
  padding-left: 14px;
  font-size: 1.3em;
}

.page-content h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.3em;
  bottom: 0.3em;
  width: 4px;
  border-radius: 2px;
  background: #30a9de;
}

.page-content h2:first-child {
  margin-top: 0;
}

/* 正文段落节奏 */
.page-content p {
  margin-bottom: 0.95em;
}

/* 列表 */
.page-content ul {
  padding-left: 1.15em;
  margin-bottom: 1.2em;
}

.page-content ul li {
  margin-bottom: 0.4em;
}

/* 分隔线：浅一些，别抢视觉 */
.page-content hr {
  height: 0;
  margin: 2.2em 0;
  border: none;
  border-top: 1px solid #eef1f5;
  background: none;
}

/* 表格（教育经历等） */
.page-content table {
  width: 100%;
  margin: 1.1em 0 1.6em;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #e6eaef;
  border-radius: 8px;
  overflow: hidden;
  font-size: 0.95em;
}

.page-content table tr {
  border-top: none;
  background-color: transparent;
}

.page-content table th,
.page-content table td {
  padding: 11px 14px;
  border: none;
  border-bottom: 1px solid #eef1f5;
  vertical-align: top;
  text-align: left;
}

.page-content table th {
  background: #f4f6f9;
  font-weight: 600;
  white-space: nowrap;
}

.page-content table tr:last-child td {
  border-bottom: none;
}

.page-content table tbody tr:nth-child(even) td {
  background: #fafbfc;
}

/* ---------- 2. About 页 ---------- */

/* 正文收窄 + 行距放宽，与上方居中的头像区块同一条中轴 */
.about-content .markdown-body {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.85;
}

.about-content .markdown-body > p {
  margin-bottom: 1.15em;
}

/* 联系方式里的粗体标签弱化成次级色 */
.about-content .markdown-body li > strong:first-child {
  color: #718096;
  font-weight: 600;
}

/* ---------- 3. Publications 页 ---------- */

/* 每条论文一张卡片：左图右文，块与块之间靠卡片边界区分 */
.page-content .pub-item {
  display: flex;
  gap: 26px;
  align-items: flex-start;
  margin-bottom: 18px;
  padding: 20px 22px;
  border: 1px solid #e6eaef;
  border-radius: 10px;
  background: #fbfcfd;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.page-content .pub-item:hover {
  border-color: #cfe3ef;
  box-shadow: 0 2px 12px rgba(48, 169, 222, 0.08);
}

/* 左栏：固定宽度，图片按栏宽缩放 */
.page-content .pub-fig {
  flex: 0 0 230px;
  max-width: 230px;
}

.page-content .pub-fig img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

/* 右栏：文字 */
.page-content .pub-body {
  flex: 1 1 auto;
  min-width: 0;
}

.page-content .pub-title {
  margin: 0 0 8px;
  font-size: 1.02em;
  font-weight: 600;
  line-height: 1.55;
  color: #1a202c;
}

.page-content .pub-authors {
  margin: 0 0 4px;
  font-size: 0.94em;
  line-height: 1.65;
}

.page-content .pub-authors sup {
  color: #30a9de;
  font-weight: 600;
}

.page-content .pub-journal {
  margin: 0 0 10px;
  font-size: 0.92em;
  line-height: 1.6;
  color: #718096;
}

.page-content .pub-points {
  margin: 0;
  padding-left: 1.1em;
}

.page-content .pub-points li {
  margin-bottom: 4px;
  font-size: 0.94em;
  line-height: 1.65;
}

/* DOI 小胶囊 */
.page-content a[href*="doi.org"] {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 9px;
  border-radius: 999px;
  background: #eaf5fb;
  color: #1a7fb0;
  font-size: 0.85em;
  font-weight: 500;
  line-height: 1.7;
  text-decoration: none;
  vertical-align: 1px;
}

.page-content a[href*="doi.org"]:hover {
  background: #d8ecf8;
  color: #12628a;
}

/* ---------- 窄屏 ---------- */
@media (max-width: 768px) {
  .about-content .markdown-body {
    max-width: 100%;
    font-size: 15px;
  }

  .page-content table {
    font-size: 0.9em;
  }

  .page-content table th,
  .page-content table td {
    padding: 8px 10px;
  }

  /* 手机上改为上下堆叠，图片限高免得占满屏 */
  .page-content .pub-item {
    flex-direction: column;
    gap: 14px;
    padding: 16px;
  }

  .page-content .pub-fig {
    flex: none;
    max-width: 100%;
  }

  .page-content .pub-fig img {
    max-height: 190px;
    object-fit: contain;
  }
}

/* ---------- 暗色模式 ---------- */
html[data-user-color-scheme="dark"] .about-content .markdown-body li > strong:first-child {
  color: #a7a9ad;
}

html[data-user-color-scheme="dark"] .page-content .pub-item {
  background: #232c37;
  border-color: #3b4757;
}

html[data-user-color-scheme="dark"] .page-content .pub-item:hover {
  border-color: #4d6a83;
  box-shadow: none;
}

html[data-user-color-scheme="dark"] .page-content .pub-title {
  color: #e2e5ea;
}

html[data-user-color-scheme="dark"] .page-content .pub-journal {
  color: #a7a9ad;
}

html[data-user-color-scheme="dark"] .page-content hr {
  border-top-color: #3b4757;
}

html[data-user-color-scheme="dark"] .page-content table {
  border-color: #3b4757;
}

html[data-user-color-scheme="dark"] .page-content table th {
  background: #2d3746;
}

html[data-user-color-scheme="dark"] .page-content table th,
html[data-user-color-scheme="dark"] .page-content table td {
  border-bottom-color: #3b4757;
}

html[data-user-color-scheme="dark"] .page-content table tbody tr:nth-child(even) td {
  background: #222a35;
}

html[data-user-color-scheme="dark"] .page-content a[href*="doi.org"] {
  background: #24394a;
  color: #7fc4e6;
}

html[data-user-color-scheme="dark"] .page-content a[href*="doi.org"]:hover {
  background: #2d4b61;
  color: #a6d9f2;
}
