/* 自定义样式 - MkDocs Material 主题增强 */

/* ========== 全局样式优化 ========== */
:root {
  /* 自定义颜色变量 */
  /* 全局配色调整 - 复古纸质风格 */
  --md-primary-fg-color: #5D4037;
  /* 深棕色 */
  --md-primary-fg-color--light: #8D6E63;
  --md-primary-fg-color--dark: #3E2723;
  --md-accent-fg-color: #D84315;
  /* 砖红色 */

  /* 背景透明度调整，透出纹理 */
  --md-default-bg-color: rgba(255, 255, 255, 0.65);
  /* 卡片半透明白 */
  --md-code-bg-color: rgba(0, 0, 0, 0.03);
  /* 代码块微透 */

  /* 文字颜色柔和化 */
  --md-typeset-color: #3e2723;
  /* 深棕灰色 */
  --md-typeset-a-color: #5D4037;

  /* 阴影调整 */
  --md-shadow-z1: 0 4px 6px rgba(93, 64, 55, 0.1);
  --md-shadow-z2: 0 4px 10px rgba(93, 64, 55, 0.15);
}

/* ========== 全局固定背景图片 ========== */
/* 层1: 背景图片 */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  background-image: url("../assets/images/paper_bg.png");
  background-size: auto;
  background-position: top left;
  background-repeat: repeat;
}

/* 层2: 渐变遮罩 - 中间白色淡化，两侧渐变透明 */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  /* 水平渐变：两侧透明 -> 中间白色 */
  background: linear-gradient(to right,
      rgba(255, 255, 255, 0) 0%,
      rgba(255, 255, 255, 0.85) 15%,
      rgba(255, 255, 255, 0.95) 30%,
      rgba(255, 255, 255, 0.95) 70%,
      rgba(255, 255, 255, 0.85) 85%,
      rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

/* ========== 代码块美化 ========== */
.highlight code {
  border-radius: 8px;
}

/* 代码块阴影效果 */
.md-typeset pre {
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 行内代码样式 */
.md-typeset code:not(pre code) {
  background-color: rgba(92, 107, 192, 0.1);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  font-size: 0.9em;
}

/* ========== 卡片效果 ========== */
.md-typeset .admonition,
.md-typeset details {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

/* ========== 表格美化 (自动居中) ========== */

/* 1. 表格滚动容器：适应内容宽度并居中 */
.md-typeset__table {
  margin-left: auto !important;
  margin-right: auto !important;
  width: fit-content !important;
  max-width: 100%;
  display: block;
  /* 确保长表格仍可滚动 */
  overflow-x: auto;
}

/* 2. 表格本体：圆角与阴影 */
.md-typeset table:not([class]) {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);

  /* 双重保险：表格自身居中 */
  margin-left: auto !important;
  margin-right: auto !important;
  width: auto !important;
  /* 防止表格被拉伸到 100% */
  display: table !important;
}

/* 3. 表头：背景色与居中 */
.md-typeset table:not([class]) th {
  background-color: var(--md-primary-fg-color);
  color: white;
  font-weight: 600;
  text-align: center !important;
  min-width: 80px;
  /* 防止表头过窄 */
}

/* 4. 单元格：内容居中 */
.md-typeset table:not([class]) td {
  text-align: center !important;
}

/* ========== 侧边栏优化 ========== */
.md-nav__link {
  border-radius: 4px;
  transition: all 0.2s ease;
}

.md-nav__link:hover {
  background-color: rgba(92, 107, 192, 0.1);
}

/* 当前活跃链接 */
.md-nav__link--active {
  font-weight: 600;
}

/* ========== 顶部导航栏 ========== */
.md-header {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ========== 搜索框美化 ========== */
.md-search__input {
  border-radius: 20px;
}

/* ========== 内容区域优化 ========== */
.md-content {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* ========== 链接样式 ========== */
.md-typeset a:not(.md-button) {
  text-decoration: none;
  border-bottom: 1px dashed var(--md-accent-fg-color);
  transition: all 0.2s ease;
}

.md-typeset a:not(.md-button):hover {
  border-bottom-style: solid;
  color: var(--md-accent-fg-color);
}

/* ========== 标题样式 ========== */
.md-typeset h1,
.md-typeset h2,
.md-typeset h3 {
  font-weight: 700;
}

.md-typeset h2 {
  border-bottom: 2px solid var(--md-primary-fg-color--light);
  padding-bottom: 0.3em;
}

/* ========== 滚动条美化 ========== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(92, 107, 192, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(92, 107, 192, 0.5);
}


/* ========== 图片样式 ========== */
.md-typeset img {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.md-typeset img:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* ========== 页脚优化 ========== */
.md-footer {
  margin-top: 2rem;
}

/* ========== 任务列表美化 ========== */
.md-typeset .task-list-item input[type="checkbox"] {
  accent-color: var(--md-primary-fg-color);
}

/* ========== 标签页样式 ========== */
.md-typeset .tabbed-labels>label {
  border-radius: 8px 8px 0 0;
  transition: all 0.2s ease;
}

/* ========== 响应式优化 ========== */
@media screen and (max-width: 76.1875em) {
  .md-nav__link:hover {
    transform: none;
  }
}

/* 项目卡片标签 */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.8rem;
}

.card-tags img {
  box-shadow: none !important;
  border-radius: 3px !important;
  transition: none !important;
}

.card-tags img:hover {
  transform: none !important;
  box-shadow: none !important;
}

/* 重点项目卡片 */
.card--featured {
  border: 2px solid var(--md-primary-fg-color);
  background: linear-gradient(135deg, rgba(93, 64, 55, 0.03) 0%, rgba(216, 67, 21, 0.03) 100%);
}

.card--featured::before {
  height: 6px;
}


/* ========== 卡片网格布局 ========== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.card {
  background: var(--md-default-bg-color);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--md-primary-fg-color), var(--md-accent-fg-color));
}

.card:hover {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.card-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
}

.card p {
  color: var(--md-typeset-color);
  opacity: 0.8;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.card a {
  display: inline-flex;
  align-items: center;
  color: var(--md-primary-fg-color);
  font-weight: 600;
  text-decoration: none;
  border-bottom: none !important;
}

.card a:hover {
  color: var(--md-accent-fg-color);
}

.card a::after {
  content: " \2192";
  transition: transform 0.2s ease;
}


/* ========== 时间线样式 ========== */
.timeline {
  position: relative;
  padding-left: 2rem;
  margin: 2rem 0;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--md-primary-fg-color), var(--md-accent-fg-color));
  border-radius: 3px;
}

.timeline-item {
  position: relative;
  padding-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -2rem;
  top: 0.3rem;
  width: 12px;
  height: 12px;
  background: var(--md-primary-fg-color);
  border-radius: 50%;
  border: 3px solid var(--md-default-bg-color);
  box-shadow: 0 0 0 3px var(--md-primary-fg-color);
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-date {
  font-size: 0.85rem;
  color: var(--md-primary-fg-color);
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.timeline-content {
  background: var(--md-default-bg-color);
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  border-left: 3px solid var(--md-primary-fg-color);
}

.timeline-content p {
  margin: 0;
}

/* ========== 公告栏样式 ========== */
.md-banner {
  background: linear-gradient(90deg, var(--md-primary-fg-color), var(--md-accent-fg-color));
  color: white;
  padding: 0.5rem 0;
  text-align: center;
  font-size: 0.9rem;
}

.md-banner__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.md-banner__button {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0.25rem;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.md-banner__button:hover {
  opacity: 1;
}

.md-banner__button svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}


/* ========== Collapsible TOC Styles ========== */
/* Hide all sub-level TOC lists by default */
.md-sidebar--secondary .md-nav--secondary .md-nav__item--nested>.md-nav {
  display: none;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.2s ease;
}

/* Show sub-lists when parent is expanded */
.md-sidebar--secondary .md-nav--secondary .md-nav__item--nested.toc-expanded>.md-nav {
  display: block;
  max-height: 1000px;
  opacity: 1;
}

/* Add visual indicator for expandable items */
.md-sidebar--secondary .md-nav--secondary .md-nav__item--nested>.md-nav__link::after {
  content: "\25B6";
  margin-left: auto;
  padding-left: 0.5rem;
  font-size: 0.7rem;
  transition: transform 0.2s ease;
}

/* Rotate indicator when expanded */
.md-sidebar--secondary .md-nav--secondary .md-nav__item--nested.toc-expanded>.md-nav__link::after {
  transform: rotate(90deg);
}

/* Ensure the link takes full width for the indicator to align */
.md-sidebar--secondary .md-nav--secondary .md-nav__item--nested>.md-nav__link {
  display: flex;
  align-items: center;
}

/* ========== 紧凑型 Hero 布局 (首页顶部) ========== */
.hero-compact {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
  padding: 2rem 1.5rem;
  margin: 2rem auto;
  max-width: 960px;
  /* 纸质风格背景板 — !important 防止被 Material 主题变量覆盖 */
  background: #fdfbf7 !important;
  background-color: #fdfbf7 !important;
  border-radius: 6px;
  box-shadow:
    0 10px 20px rgba(0, 0, 0, 0.08),
    0 2px 4px rgba(0, 0, 0, 0.05),
    inset 0 0 60px rgba(93, 64, 55, 0.05);
  border: 1px solid rgba(93, 64, 55, 0.15) !important;
  position: relative;
  overflow: hidden;
}

/* 顶部装饰线（虚线内框）*/
.hero-compact::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  bottom: 10px;
  border: 2px dashed rgba(93, 64, 55, 0.1);
  border-radius: 4px;
  pointer-events: none;
}

.hero-profile {
  display: flex;
  gap: 3rem;
  align-items: center;
  /* 移除内部背景，直接使用外层 */
  width: 100%;
  box-sizing: border-box;
  background: rgba(247, 243, 238, 0.88) !important;
  padding: 2rem 2.75rem 1.6rem;
  border: 1px solid rgba(93, 64, 55, 0.12);
  border-radius: 18px;
  box-shadow:
    0 8px 18px rgba(93, 64, 55, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.78);
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.hero-profile::before {
  content: "";
  position: absolute;
  top: 0;
  left: 1.2rem;
  right: 1.2rem;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--md-primary-fg-color) 0%, #e28a12 100%);
}

.hero-profile::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  pointer-events: none;
}

.hero-avatar {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  background: #fff;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.hero-avatar:hover {
  transform: scale(1.05);
  z-index: 2;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.hero-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.hero-info {
  text-align: left;
  flex: 1;
}

.hero-info p {
  margin: 0.85rem 0 1rem;
  font-size: 1.1rem;
  line-height: 1.65;
  color: var(--kb-text-body);
}

.hero-info h1 {
  margin: 0;
  border-bottom: none;
  /* 复古手写标题 */
  font-family: "Segoe Script", "Brush Script MT", "STXingkai", "华文行楷", serif;
  font-size: 2.8rem;
  color: var(--md-primary-fg-color);
  text-shadow: 2px 2px 0px rgba(93, 64, 55, 0.1);
  line-height: 1.2;
}

/* 角色标签（专业/职能）*/
/* 角色标签 / 专业职能标签（.profile-role 与 .hero-role 共用）*/
.hero-role,
.profile-role {
  font-size: 0.9rem;
  color: var(--md-primary-fg-color);
  font-weight: 600;
  background: rgba(93, 64, 55, 0.08);
  padding: 0.2rem 0.8rem;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 0.5rem;
}

/* 技能徽章条（shields.io 图片行）*/
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.hero-badges img {
  box-shadow: none !important;
  border-radius: 3px !important;
  transition: none !important;
}

.hero-badges img:hover {
  transform: none !important;
  box-shadow: none !important;
}

/* 链接按钮组（横排 flex）*/
.hero-links {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.md-typeset .hero-links .md-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 7.8rem;
  border-radius: 20px;
  padding: 0.55rem 1.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: none;
  transition: all 0.2s ease;
  border: 1.5px solid rgba(93, 64, 55, 0.24) !important;
  background: rgba(255, 255, 255, 0.72) !important;
  color: var(--md-primary-fg-color) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  text-decoration: none !important;
}

.md-typeset .hero-links .md-button--primary {
  background: var(--md-primary-fg-color) !important;
  color: white !important;
  border-color: var(--md-primary-fg-color) !important;
  box-shadow: none;
}

.md-typeset .hero-links .md-button:hover,
.md-typeset .hero-links .md-button--primary:hover {
  background: var(--md-primary-fg-color) !important;
  border-color: var(--md-primary-fg-color) !important;
  color: white !important;
  box-shadow: 0 4px 12px rgba(93, 64, 55, 0.2);
  transform: translateY(-1px);
}

/* 个人简介文字区 */
.hero-bio {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--md-typeset-color);
  opacity: 0.9;
  max-width: 700px;
  margin-bottom: 1.5rem;
}

.hero-bio p {
  margin: 0 0 0.5rem 0;
}

.hero-bio p:last-child {
  margin-bottom: 0;
}

/* 联系方式按钮 */
.hero-contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  background: var(--md-primary-fg-color);
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.hero-contact-btn:hover {
  background: var(--md-accent-fg-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.hero-contact-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* 技能徽章区域 */
.hero-skills-section {
  margin-top: 2rem;
  width: 100%;
  max-width: 800px;
}

.hero-skills-title {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--md-typeset-color);
  opacity: 0.6;
  margin-bottom: 0.8rem;
  display: block;
}

.hero-skills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
}

.hero-skill-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  background: var(--md-default-bg-color);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.hero-skill-badge:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
  border-color: var(--md-primary-fg-color);
  color: var(--md-primary-fg-color);
}

.hero-skill-badge i {
  font-size: 1.1em;
}

@media screen and (max-width: 820px) {
  .hero-profile {
    gap: 1.75rem;
    padding: 1.75rem 1.5rem 1.35rem;
  }

  .hero-avatar {
    width: 180px;
    height: 180px;
  }

  .hero-info h1 {
    font-size: 2.35rem;
  }

  .hero-links {
    flex-wrap: wrap;
  }
}

@media screen and (max-width: 600px) {
  .hero-compact {
    padding: 1.25rem 0.75rem;
  }

  .hero-profile {
    flex-direction: column;
    text-align: center;
    gap: 1.25rem;
    padding: 1.35rem 1rem 1.1rem;
  }

  .hero-profile::before {
    left: 1rem;
    right: 1rem;
  }

  .hero-avatar {
    width: 160px;
    height: 160px;
  }

  .hero-info {
    text-align: center;
  }

  .hero-info h1 {
    font-size: 2rem;
  }

  .hero-badges,
  .hero-links {
    justify-content: center;
  }

  .hero-links {
    flex-wrap: wrap;
  }

  .hero-links .md-button {
    min-width: 0;
  }
}

/* ========== 2026-02-15 22:30 配色优化 V2 (复古轻量化) ========== */

/* 1. 顶栏 (Header) 透明化 */
.md-header {
  background-color: rgba(255, 255, 255, 0.4) !important;
  /* 半透明浅色 */
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: none !important;
  border-bottom: 1px solid rgba(93, 64, 55, 0.1);
  /* 极细分隔线 */
  transition: background-color 0.3s ease;
}

/* 顶栏文字与图标颜色适配 */
.md-header .md-header__title,
.md-header .md-header__button,
.md-header .md-icon,
.md-tabs__link {
  color: var(--md-primary-fg-color) !important;
  /* 深棕色 */
  text-shadow: none !important;
}

/* 搜索框适配 - 半透明复古风 */
.md-search__input {
  background-color: rgba(255, 255, 255, 0.6) !important;
  border: 1px solid rgba(93, 64, 55, 0.2);
  color: var(--md-typeset-color) !important;
}

/* 搜索框占位符颜色 */
.md-search__input::placeholder {
  color: rgba(62, 39, 35, 0.6);
}


/* 侧边栏 & 目录 (Sidebar & TOC) 轻量化 */
.md-sidebar__scrollwrap,
.md-sidebar__inner {
  background: transparent !important;
  /* 移除可能存在的背景色 */
  box-shadow: none !important;
}

/* 右侧目录 (TOC) - 书签式风格 */
.md-nav--secondary .md-nav__title {
  background: transparent !important;
  box-shadow: none !important;
  color: var(--md-primary-fg-color) !important;
  border-bottom: 2px solid rgba(93, 64, 55, 0.1);
}

.md-nav--secondary .md-nav__list {
  background: transparent !important;
  box-shadow: none !important;
}

.md-nav--secondary .md-nav__item {
  border: none !important;
}

.md-nav--secondary .md-nav__link {
  color: var(--md-typeset-color);
  padding-left: 0.8rem;
  border-left: 2px solid transparent;
  /* 默认透明边框 */
  transition: all 0.2s;
}

.md-nav--secondary .md-nav__link:hover {
  color: var(--md-accent-fg-color);
  border-left-color: rgba(216, 67, 21, 0.3);
}

.md-nav--secondary .md-nav__link--active {
  color: var(--md-accent-fg-color);
  font-weight: 700;
  border-left-color: var(--md-accent-fg-color);
  /* 激活时显示左边框 */
  background: linear-gradient(to right, rgba(216, 67, 21, 0.05), transparent);
}

/* ========== 左侧导航栏(Primary Sidebar) 深度优化 ========== */
.md-nav--primary .md-nav__title {
  background: transparent !important;
  color: var(--md-primary-fg-color) !important;
  box-shadow: none !important;
  font-weight: 800;
  letter-spacing: 0.05em;
  border-bottom: 2px solid rgba(93, 64, 55, 0.1);
  margin-bottom: 0.5rem;
}

.md-nav--primary .md-nav__list {
  background: transparent !important;
}

/* 一级菜单项 (Home, Python, SQL...) */
.md-nav--primary>.md-nav__list>.md-nav__item {
  border-bottom: 1px dashed rgba(93, 64, 55, 0.1);
  /* 虚线分隔 */
  margin-bottom: 0.2rem;
}

.md-nav--primary>.md-nav__list>.md-nav__item>.md-nav__link {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--md-primary-fg-color);
  padding: 0.6rem 0.2rem;
}

/* 活跃的一级菜单 */
.md-nav--primary>.md-nav__list>.md-nav__item--active>.md-nav__link {
  color: var(--md-accent-fg-color);
}

/* 二级及以下菜单 - 书签风格 */
.md-nav--primary .md-nav__item .md-nav__list {
  margin-left: 0.5rem;
  border-left: 2px solid rgba(93, 64, 55, 0.1);
  /* 贯穿线 */
}

.md-nav--primary .md-nav__item .md-nav__item {
  border: none !important;
}

.md-nav--primary .md-nav__item .md-nav__link {
  padding-left: 0.8rem;
  font-size: 0.95rem;
  color: var(--md-typeset-color);
  opacity: 0.9;
  transition: all 0.2s;
}

.md-nav--primary .md-nav__item .md-nav__link:hover {
  color: var(--md-accent-fg-color);
  opacity: 1;
}

.md-nav--primary .md-nav__item .md-nav__link--active {
  color: var(--md-accent-fg-color);
  font-weight: 700;
  background: linear-gradient(to right, rgba(216, 67, 21, 0.05), transparent);
  border-radius: 4px;
}

/* ========== 2026-02-15 23:00 视觉微调 (字体 & 底部) ========== */


body,
.md-typeset {
  /* 使用系统默认无衬线字体，通常在屏幕上最清晰 */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  text-shadow: none !important;
}

/* 2. 底部导航栏精简 */
.md-footer__nav {
  display: none !important;
  /* 隐藏“上一页 下一页”大黑条 */
}

/* 3. 页脚版权栏美化 */
.md-footer {
  background: transparent !important;
  margin-top: 4rem;
  /* 增加底部留白 */
}

.md-footer__meta {
  background-color: transparent !important;
  /* 或者半透明浅色 background-color: rgba(255, 255, 255, 0.3) !important; */
  border-top: 1px solid rgba(93, 64, 55, 0.1);
}

.md-footer__link {
  color: var(--md-primary-fg-color) !important;
}

.md-copyright {
  color: var(--md-typeset-color);
  opacity: 0.7;
  font-size: 0.85rem;
}

/* ========== 2026-02-15 23:25 细节打磨 (滚动条/链接/搜索框) ========== */

/* 1. 滚动条配色修正(深棕色) */
::-webkit-scrollbar-thumb {
  background: rgba(93, 64, 55, 0.3) !important;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(93, 64, 55, 0.6) !important;
}

/* 2. 链接“高亮笔”特效 */
.md-typeset a:not(.md-button):hover {
  background: linear-gradient(to top, rgba(255, 235, 59, 0.4) 0%, rgba(255, 235, 59, 0.4) 40%, transparent 40%);
  color: inherit !important;
  border-bottom: none;
  text-decoration: none;
}

/* 3. 搜索框复古化 (底部边框风格) */
.md-search__input {
  background-color: transparent !important;
  border: none !important;
  border-bottom: 2px solid rgba(93, 64, 55, 0.3) !important;
  border-radius: 0 !important;
  padding-left: 2rem !important;
  /* 留出图标位置 */
}


/* ========== 2026-02-15 23:40 布局紧凑化 & 艺术字体 ========== */

/* 1. 宽屏布局 (Compact Layout) */
.md-grid {
  max-width: 1600px !important;
  /* 原为 1220px，增大以利用宽屏空间 */
  padding-left: 1rem !important;
  padding-right: 1rem !important;
}

/* 2. 左侧导航 (Primary Sidebar) 艺术字体 */
.md-nav--primary {
  /* 中文：华文行楷，楷体；英文：手写体/衬线体 */
  /* 华文行楷 (STXingkai) 更具连笔手写感，与英文 Script 更搭 */
  font-family: "Segoe Script", "Brush Script MT", "STXingkai", "华文行楷", "KaiTi", "楷体", "FangSong", "仿宋", "Georgia", serif !important;
}

.md-nav--primary .md-nav__title {
  font-size: 1.2rem !important;
  font-weight: bold !important;
}

.md-nav--primary>.md-nav__list>.md-nav__item>.md-nav__link {
  font-size: 1.25rem !important;
  /* 回调至 1.25rem，消除喧宾夺主感 */
  line-height: 1.5 !important;
  font-weight: 600 !important;
  /* 保持字重 */
  text-shadow: 1px 1px 2px rgba(93, 64, 55, 0.1);
  /* 保持微阴影 */
}

/* 3. 顶部标题 (Header Title) 艺术化同步 */
.md-header__title {
  font-family: "Segoe Script", "Brush Script MT", "STXingkai", "华文行楷", "KaiTi", "楷体", serif !important;
  font-size: 1.5rem !important;
  font-weight: bold !important;
  letter-spacing: 0.05em;
}

/* ========== 导航与字体微调 ========== */

/* 隐藏左侧导航栏顶部的 Site Name (防止与 Top Header 重复) */
.md-nav--primary .md-nav__title {
  display: none !important;
}

/* 右侧 TOC 目录字体 (楷体) */
.md-nav--secondary {
  font-family: "KaiTi", "楷体", "FangSong", "仿宋", serif !important;
  font-size: 0.95rem !important;
}


/* ========== 教育背景 (Flat Compact Style) 2026-02-20 ========== */

.edu-book-container {
  max-width: 880px;
  margin: 1.8rem auto 2.2rem;
}

.edu-book-cover {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid rgba(55, 118, 171, 0.18);
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(22, 40, 60, 0.06);
  overflow: hidden;
}

.edu-book-cover::after {
  display: none;
}

.edu-page-left,
.edu-page-right {
  padding: 1.2rem 1.4rem;
}

.edu-page-left {
  border-right: none;
  border-bottom: 1px solid rgba(55, 118, 171, 0.14);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.edu-school-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.edu-school-logo {
  width: 2.6rem;
  height: 2.6rem;
  margin: 0;
  font-size: 1.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #f4f8fd;
  border: 1px solid rgba(55, 118, 171, 0.18);
  opacity: 1;
  flex-shrink: 0;
}

.edu-school-title {
  min-width: 0;
}

.edu-page-left h3 {
  margin: 0;
  border-bottom: none;
  color: var(--md-primary-fg-color);
  font-family: "KaiTi", "楷体", serif;
  font-size: 1.45rem;
  line-height: 1.2;
}

.edu-school-en {
  margin: 0.15rem 0 0;
  font-family: "Times New Roman", Times, serif;
  font-size: 0.84rem;
  color: var(--md-typeset-color);
  opacity: 0.72;
  letter-spacing: 0.02em;
  text-transform: none;
  line-height: 1.35;
}

.edu-major-info {
  margin: 0;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  border: 1px solid rgba(55, 118, 171, 0.2);
  background: #f8fbff;
}

.edu-major-info p {
  margin: 0;
  line-height: 1.5;
  font-size: 0.95rem;
}

.edu-major-info p+p {
  margin-top: 0.25rem;
}

.edu-page-right h4 {
  margin: 0 0 0.75rem;
  padding: 0;
  border: none;
  display: block;
  font-family: "KaiTi", "楷体", serif;
  font-size: 1.16rem;
  color: var(--md-primary-fg-color);
}

.edu-courses-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.edu-course-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.72rem;
  background: #f8fbff;
  border: 1px solid rgba(55, 118, 171, 0.28);
  border-radius: 999px;
  font-size: 0.88rem;
  color: var(--md-primary-fg-color);
  font-family: "KaiTi", "楷体", serif;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.4;
  transition: background-color 0.2s ease;
}

.edu-course-badge:hover {
  background: #edf4fd;
  color: var(--md-primary-fg-color);
  transform: none;
  box-shadow: none;
  border-color: rgba(55, 118, 171, 0.35);
}

.edu-footer-note {
  display: none;
}

/* 响应式适配 */
@media screen and (max-width: 768px) {
  .edu-book-container {
    margin: 1.4rem auto 1.8rem;
  }

  .edu-page-left,
  .edu-page-right {
    padding: 1rem;
  }

  .edu-school-logo {
    width: 2.3rem;
    height: 2.3rem;
    font-size: 1.5rem;
  }

  .edu-page-left h3 {
    font-size: 1.25rem;
  }

  .edu-school-en {
    font-size: 0.78rem;
  }

  .edu-course-badge {
    font-size: 0.82rem;
  }
}

/* ========== 竞赛与荣誉板块 ========== */
.achievements-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 2rem 0;
}

.achievement-card {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  background: #fdfbf7;
  border-radius: 12px;
  padding: 1.8rem 2rem;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.06),
    inset 0 0 40px rgba(93, 64, 55, 0.03);
  border: 1px solid rgba(93, 64, 55, 0.1);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.achievement-card:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* 左侧彩色装饰条 */
.achievement-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  border-radius: 12px 0 0 12px;
}

.achievement--gold::before {
  background: linear-gradient(180deg, #FFD700, #FFA000);
}

.achievement--purple::before {
  background: linear-gradient(180deg, #7B1FA2, #CE93D8);
}

.achievement--blue::before {
  background: linear-gradient(180deg, #1565C0, #64B5F6);
}

.achievement-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(93, 64, 55, 0.04);
}

.achievement--gold .achievement-icon {
  background: rgba(255, 215, 0, 0.1);
}

.achievement--purple .achievement-icon {
  background: rgba(123, 31, 162, 0.08);
}

.achievement--blue .achievement-icon {
  background: rgba(21, 101, 192, 0.08);
}

.achievement-body {
  flex: 1;
  min-width: 0;
}

.achievement-body h4 {
  margin: 0 0 0.4rem 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--md-typeset-color);
  border-bottom: none !important;
  padding-bottom: 0 !important;
}

.achievement-level {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.2rem 0.8rem;
  border-radius: 20px;
  margin-bottom: 0.6rem;
  letter-spacing: 0.02em;
}

.achievement--gold .achievement-level {
  background: linear-gradient(135deg, #FFF8E1, #FFECB3);
  color: #E65100;
  border: 1px solid rgba(255, 160, 0, 0.3);
}

.achievement--purple .achievement-level {
  background: linear-gradient(135deg, #F3E5F5, #E1BEE7);
  color: #6A1B9A;
  border: 1px solid rgba(123, 31, 162, 0.2);
}

.achievement--blue .achievement-level {
  background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
  color: #0D47A1;
  border: 1px solid rgba(21, 101, 192, 0.2);
}

.achievement-body p {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--md-typeset-color);
  opacity: 0.85;
  margin: 0.5rem 0 0.8rem 0;
}

.achievement-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.achievement-tags span {
  display: inline-block;
  font-size: 0.78rem;
  padding: 0.15rem 0.6rem;
  background: rgba(93, 64, 55, 0.06);
  color: var(--md-primary-fg-color);
  border-radius: 4px;
  border: 1px solid rgba(93, 64, 55, 0.1);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* 荣誉板块响应式 */
@media screen and (max-width: 600px) {
  .achievement-card {
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    text-align: center;
  }

  .achievement-icon {
    margin: 0 auto;
  }

  .achievement-body {
    text-align: center;
  }

  .achievement-tags {
    justify-content: center;
  }
}

/* ========== Toast Notification (Original) ========== */
.custom-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 0.9rem;
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 8px;
}

.custom-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========== 2026-02-19 Accessibility & Contrast Hardening ========== */

:root {
  --kb-surface-card: rgba(255, 255, 255, 0.94);
  --kb-surface-soft: rgba(250, 246, 239, 0.95);
  --kb-text-strong: #2f231d;
  --kb-text-body: #3f312a;
  --kb-text-muted: #5a4a42;
  --kb-link: #8a3f12;
  --kb-link-hover: #6d2f0a;
  --kb-focus-ring: #0d62c9;
  --kb-divider: rgba(93, 64, 55, 0.24);
}

.md-typeset,
.md-typeset p,
.md-typeset li,
.md-typeset td,
.md-typeset blockquote,
.md-typeset figcaption {
  color: var(--kb-text-body) !important;
}

.md-typeset strong,
.md-typeset h1,
.md-typeset h2,
.md-typeset h3,
.md-typeset h4,
.md-typeset h5,
.md-typeset h6 {
  color: var(--kb-text-strong) !important;
}

.md-nav--primary .md-nav__link,
.md-nav--secondary .md-nav__link,
.md-search__input,
.md-search__input::placeholder {
  color: var(--kb-text-muted) !important;
}

.md-search__input {
  background-color: rgba(255, 255, 255, 0.82) !important;
  border-bottom-color: rgba(93, 64, 55, 0.45) !important;
}

.md-typeset .grid.cards>ul>li,
.md-typeset .admonition,
.md-typeset details,
.card,
.timeline-content,
.achievement-card {
  background: var(--kb-surface-card) !important;
  border-color: var(--kb-divider) !important;
}

.md-typeset a:not(.md-button) {
  color: var(--kb-link) !important;
}

.md-typeset a:not(.md-button):hover {
  color: var(--kb-link-hover) !important;
}

.md-typeset .md-button {
  border: 1px solid rgba(93, 64, 55, 0.45) !important;
  background: var(--kb-surface-soft) !important;
  color: var(--kb-text-strong) !important;
}

.md-typeset .md-button--primary {
  background: #7a3b16 !important;
  border-color: #7a3b16 !important;
  color: #ffffff !important;
}

.md-typeset .md-button:hover,
.md-typeset .md-button--primary:hover {
  background: #5f2b0f !important;
  border-color: #5f2b0f !important;
  color: #ffffff !important;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
[role="button"]:focus-visible,
.md-nav__link:focus-visible,
.md-button:focus-visible {
  outline: 3px solid var(--kb-focus-ring) !important;
  outline-offset: 2px !important;
  border-radius: 6px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.diagram-figure {
  margin: 1rem 0 1.5rem;
}

.diagram-figure .mermaid {
  background: var(--kb-surface-card);
  border: 1px solid var(--kb-divider);
  border-radius: 10px;
  padding: 0.75rem;
}

.diagram-figure figcaption {
  margin-top: 0.65rem;
  font-size: 0.88rem;
  color: var(--kb-text-muted) !important;
}

.zoomable-media {
  cursor: zoom-in;
}

.zoomable-media:focus-visible {
  outline: 3px solid var(--kb-focus-ring) !important;
  outline-offset: 2px !important;
  border-radius: 8px;
}

.media-lightbox-open {
  overflow: hidden;
}

.media-lightbox {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: rgba(18, 14, 11, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.75rem, 2vw, 2rem);
}

.media-lightbox[hidden] {
  display: none !important;
}

.media-lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(24, 18, 14, 0.8);
  color: #ffffff;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.media-lightbox__content {
  max-width: min(96vw, 1680px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

.media-lightbox__image {
  max-width: 100%;
  max-height: 84vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

.media-lightbox__caption {
  margin: 0;
  color: rgba(255, 255, 255, 0.95) !important;
  font-size: 0.95rem;
  text-align: center;
}

/* ========== 2026-02-19 Content Alignment ========== */
/* Center uploaded article images without affecting badge/icon strips */
.md-typeset p>img,
.md-typeset li>img,
.md-typeset blockquote>img,
.md-typeset figure>img {
  display: block;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Center markdown tables and table text */
.md-typeset table:not([class]) {
  margin-left: auto !important;
  margin-right: auto !important;
}

.md-typeset table:not([class]) th,
.md-typeset table:not([class]) td {
  text-align: center !important;
  vertical-align: middle;
}

/* ========== 2026-04-01 Card Button Group ========== */
.card-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.25rem;
  width: 100%;
}

.md-typeset .card-btn-group .md-button,
.card-btn-group a {
  margin: 0 !important;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  flex: 1 1 calc(50% - 0.3rem);
  text-align: center;
  padding: 0.5rem 0.8rem;
  font-size: 0.85rem;
  text-decoration: none;
  border-bottom: none !important;
}

/* 只有一个按钮时，占满整行 */
.card-btn-group .md-button:only-child,
.card-btn-group a:only-child {
  flex: 1 1 100%;
}

/* 如果有三个按钮，第一个主按钮占满整行，剩下两个平分第二行 */
.card-btn-group .md-button:first-child:nth-last-child(3),
.card-btn-group a:first-child:nth-last-child(3) {
  flex: 1 1 100%;
}

/* 首页独有的小卡片链接，覆盖原卡片的 inline 样式 */
.card .card-btn-group a {
  border: 1px solid rgba(93, 64, 55, 0.45) !important;
  border-radius: 6px;
  background: var(--kb-surface-soft);
  color: var(--kb-text-strong) !important;
  transition: all 0.2s ease;
}

.card .card-btn-group a::after {
  display: none !important;
  /* 隐藏默认的箭头 */
}

.card .card-btn-group a:hover {
  background: #5f2b0f !important;
  border-color: #5f2b0f !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(93, 64, 55, 0.2);
}

.card .card-btn-group a.btn-primary {
  background: #7a3b16 !important;
  border-color: #7a3b16 !important;
  color: #ffffff !important;
}

.card .card-btn-group a.btn-primary:hover {
  background: #5f2b0f !important;
  border-color: #5f2b0f !important;
}