/* 强制禁止移动端缩放 */
html, body {
  touch-action: manipulation !important;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-text-size-adjust: 100% !important;
  -ms-text-size-adjust: 100% !important;
}

/* 禁止双击缩放和手势缩放 */
* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* 允许文本选择（仅在需要的地方） */
p, span, div, h1, h2, h3, h4, h5, h6, li, td, th, textarea, input[type="text"], input[type="email"], input[type="password"] {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
}

/* 防止iOS Safari双击缩放 */
@media screen and (max-width: 767px) {
  html {
    -webkit-text-size-adjust: none;
    -ms-text-size-adjust: none;
    text-size-adjust: none;
  }
  
  /* 强制禁用缩放手势 */
  body {
    touch-action: pan-x pan-y !important;
    -ms-touch-action: pan-x pan-y !important;
  }
}

/* 标准主题切换系统 */
/* 使用 data-theme 属性和 prefers-color-scheme 媒体查询 */

/* 浅色主题 - 默认 */
:root,
html[data-theme="light"] {
  color-scheme: light;
}

/* 深色主题 */
html[data-theme="dark"] {
  color-scheme: dark;
}

/* 自动跟随系统 */
html[data-theme="auto"] {
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    color-scheme: dark;
  }
}

/* 兼容现有的 data-color-mode 选择器，但使用标准方式 */
html[data-theme="light"] {
  /* 相当于原来的 data-color-mode="light" */
}

html[data-theme="dark"] {
  /* 相当于原来的 data-color-mode="dark" */
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    /* 系统深色模式下的自动样式 */
  }
}

/* 桌面端文章页面优化 - 居中布局和合适宽度 */
@media (min-width: 768px) {
  /* 文章页面容器居中并限制最大宽度 */
  main.container-xl:has(article.markdown-body) {
    max-width: 800px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 3rem !important;
    padding-right: 3rem !important;
  }
  
  /* 如果浏览器不支持:has()，直接针对文章容器 */
  article.markdown-body {
    max-width: 720px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 2rem !important;
    padding-right: 2rem !important;
  }
}

@media (max-width: 767.98px) {
  /* 手机端文章页面专用边距 - 只影响包含文章的页面 */
  main.container-xl:has(article.markdown-body) {
    padding-left: 2rem !important;
    padding-right: 2rem !important;
  }
  
  /* 如果浏览器不支持:has()，使用备用方案 */
  article.markdown-body {
    margin-left: 0.5rem !important;
    margin-right: 0.5rem !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  
  .site-footer .container-xl {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  .site-footer p {
    margin-bottom: 0.25rem !important;
    text-align: center !important;
    width: 100%;
  }
  .site-footer .social-row {
    justify-content: center !important;
    width: 100%;
  }
}
/* 修正主页卡片在手机端的宽度和排列，彻底覆盖 col-12/col-sm-6 的影响 */
@media (max-width: 767.98px) {
  /* 个人信息区和分隔线右侧留白 */
  .sidebar-divider {
    padding-right: 0rem !important;
  }
  .profile-info {
    padding-right: 1rem !important;
  }
  .profile-text {
    padding-right: 0rem !important;
  }
  /* 主页主内容区左右留白，防止卡片贴边 */
  .flex-grow-1 {
    padding-left: 0rem !important;
    padding-right: 1rem !important;
  }
  .home-card-row {
    display: flex !important;
    flex-wrap: wrap !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .home-card-row > .home-card-col {
    max-width: 100% !important;
    flex: 0 0 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}
@media (min-width: 577px) {
  .site-title-logo {
    transform: translateX(0.5rem);
  }
}
/* Desktop theme toggle button - 完全隐藏 */
.theme-toggle-btn {
  display: none !important;
}
.theme-toggle-btn:hover, .theme-toggle-btn:focus {
  background: rgba(0,0,0,0.06);
  color: inherit;
  box-shadow: none;
}
html[data-color-mode="dark"] .theme-toggle-btn:hover, html[data-color-mode="dark"] .theme-toggle-btn:focus {
  background: rgba(255,255,255,0.06);
  color: inherit;
  box-shadow: none;
}
/* Floating theme toggle button for mobile - 完全隐藏 */
.theme-fab {
  display: none !important; /* 强制隐藏主题按钮 */
  visibility: hidden !important;
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 9999;
  width: 48px;
  height: 48px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.2);
  color: #1f2328;
  border: 1px solid rgba(0, 0, 0, 0.2);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(0) scale(1);
  opacity: 1;
  backdrop-filter: blur(4px) saturate(130%) contrast(105%) brightness(102%);
  -webkit-backdrop-filter: blur(4px) saturate(130%) contrast(105%) brightness(102%);
  /* 减弱的渐变效果 */
  background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
}
.theme-fab.hidden {
  transform: translateY(80px) scale(0.8);
  opacity: 0;
  pointer-events: none;
}
html[data-color-mode="dark"] .theme-fab {
  background: rgba(0, 0, 0, 0.2);
  color: #d1d7dc;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
}
@media (min-width: 577px) {
  .theme-fab { display: none !important; }
}

/* 手机端悬浮毛玻璃导航栏 */
.mobile-float-nav {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  /* 毛玻璃效果，与主题按钮一致 */
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  backdrop-filter: blur(4px) saturate(130%) contrast(105%) brightness(102%);
  -webkit-backdrop-filter: blur(4px) saturate(130%) contrast(105%) brightness(102%);
  background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
  /* 页面加载时完全隐藏，无动画 */
  transform: translateX(-50%) translateY(-80px) scale(0.8);
  opacity: 0;
  pointer-events: none;
  /* 初始状态不设置 transition，避免页面加载时的动画 */
}

/* 启用动画 - 只有在JavaScript添加此类后才有动画效果 */
.mobile-float-nav.nav-ready {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 显示状态 - 当JavaScript移除.hidden类时触发 */
.mobile-float-nav.nav-ready:not(.hidden) {
  transform: translateX(-50%) translateY(0) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.mobile-float-nav.hidden {
  transform: translateX(-50%) translateY(-80px) scale(0.8);
  opacity: 0;
  pointer-events: none;
}

html[data-color-mode="dark"] .mobile-float-nav {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
}

.mobile-float-nav-content {
  display: flex;
  align-items: center;
  padding: 0.375rem 0.5rem;
  gap: 0.25rem;
}

.mobile-float-nav .nav-btn {
  padding: 0.375rem 0.625rem;
  border-radius: 14px;
  font-size: 0.75rem;
  font-weight: 500;
  color: inherit;
  text-decoration: none;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 55px;
}

.mobile-float-nav .nav-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  text-decoration: none;
}

.mobile-float-nav .nav-btn:active {
  transform: scale(0.85);
  background: rgba(0, 0, 0, 0.1);
}

html[data-color-mode="dark"] .mobile-float-nav .nav-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

html[data-color-mode="dark"] .mobile-float-nav .nav-btn:active {
  background: rgba(255, 255, 255, 0.1);
}

/* 桌面端隐藏 */
@media (min-width: 768px) {
  .mobile-float-nav { display: none !important; }
}

/* 防止手机端横向滚动 */
@media (max-width: 767.98px) {
  html, body {
    overflow-x: hidden;
    max-width: 100vw;
  }
  
  /* 确保所有容器不超出视口 */
  * {
    max-width: 100%;
    box-sizing: border-box;
  }
  
  /* 特别处理可能导致横向滚动的元素 */
  .container-xl,
  .container-lg,
  .container-md,
  .container,
  header,
  main,
  footer {
    max-width: 100vw;
    overflow-x: hidden;
  }
  
  /* 处理可能的内容溢出 */
  pre,
  code,
  .highlight {
    overflow-x: auto;
    max-width: 100%;
  }
  
  /* 确保图片和媒体元素响应式 */
  img,
  video,
  iframe,
  embed,
  object {
    max-width: 100%;
    height: auto;
  }
}

/* Home page: one card per row on mobile */
.home-card-col { max-width: 50%; }
@media (max-width: 767.98px) {
  .home-card-col { max-width: 100% !important; flex: 0 0 100% !important; }
  .profile-section {
    width: 100% !important;
    max-width: 100% !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
    margin-top: 1rem !important;
  }
  .gutter-lg-condensed, .gutter-md-condensed, .gutter-condensed {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .container-xl {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
    box-sizing: border-box;
    width: 100vw !important;
    max-width: 100vw !important;
  }
  /* 移除body,html的overflow限制，让Safari正确检测滚动 */
  .flex-md-row {
    flex-direction: column !important;
  }
}

/* Center theme button in mobile header */
.d-only-mobile .header-nav {
  justify-content: center !important;
}
.d-only-mobile .d-flex.flex-justify-between.flex-items-center {
  justify-content: center !important;
  gap: 1rem;
}
.d-only-mobile .btn[data-action="toggle-theme"] {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Responsive header: two rows on mobile, horizontal on desktop */
.site-header-responsive .header-row {
  width: 100%;
  box-sizing: border-box;
}
.site-header-responsive .header-row-top {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.25rem;
}
.site-header-responsive .header-title-row {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}
.site-header-responsive .header-row-nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  padding-top: 0;
  padding-bottom: 0.25rem;
}
@media (max-width: 576px) {
  .site-header-responsive .header-row-top {
    padding-bottom: 0.25rem;
  }
  .site-header-responsive .header-row-nav {
    padding-top: 0;
    padding-bottom: 0.25rem;
  }
  .site-header-responsive .header-title-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .site-header-responsive .header-nav {
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
    justify-content: flex-start;
    padding-left: 0;
    padding-right: 0;
  }
  .site-header-responsive .site-title {
    font-size: 1.1rem;
    margin-left: 0;
    margin-right: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Utility: show/hide for mobile/desktop header (统一断点为767.98px) */
.d-none-mobile { display: block; }
.d-only-mobile { display: none; }
@media (max-width: 767.98px) {
  .d-none-mobile { display: none !important; }
  .d-only-mobile { display: block !important; }
}
/* 基础布局 - 修复Safari滚动检测 */
html {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  /* 确保Safari能检测到正常滚动 */
  overflow-x: hidden;
  overflow-y: auto;
}

/* main区域和footer重新布局 */
main {
  min-height: calc(100vh - 140px); /* 为header和footer预留空间 */
}

.site-footer {
  margin-top: auto;
}

/* Footer样式 */
.site-footer {
  color: var(--border-light);
  font-size: 12px;
}

.site-footer a, 
.site-footer button {
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  padding: 0.3em 1.1em;
  text-decoration: none;
}

html[data-color-mode="dark"] .site-footer {
  color: rgb(145, 152, 161);
}
:root {
  --bg-default-light: #ffffff;
  --bg-muted-light: #f6f8fa;
  --border-light: #d1d9e0;
  --fg-default-light: #1f2328;
  --header-shadow: 0 2px 8px rgba(0,0,0,.08);

  --bg-default-dark: #0d1116;
  --bg-muted-dark: #020408;
  --border-dark: #363e46;
  --fg-default-dark: #d1d7dc;
}
html[data-color-mode="dark"] body { background-color: var(--bg-default-dark); color: var(--fg-default-dark); }
html[data-color-mode="light"] body { background-color: var(--bg-default-light); color: var(--fg-default-light); }

/* 移除.card-grid和.card-container相关的Grid布局，统一用主页的Flexbox+Bootstrap列系统 */

/* 卡片基础样式 */
.card-like { 
  border: 1px solid; 
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  position: relative;
  width: 100%;
}
html[data-color-mode="light"] .card-like { border-color: var(--border-light); background:#fff; }
html[data-color-mode="dark"] .card-like { border-color: var(--border-dark); background:#0f141a; }
.card-like.linked:hover { transform: translateY(-1px); transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, background-color .12s ease; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.card-title { 
  overflow: hidden; 
  text-overflow: ellipsis; 
  white-space: nowrap; 
  flex: 1; 
  min-width: 0;
  margin-right: 12px;
}
.card-desc { 
  display: -webkit-box; 
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical; 
  overflow: hidden;
  flex-grow: 1;
}
.card-tag {
  border: 1px solid var(--border-light);
  color: rgb(89, 99, 110);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 1.7em;
  line-height: 1.7em;
  padding: 0 .7em;
  font-size: 12px;
  border-radius: 999px;
  opacity: .9;
  background: transparent;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 60px;
  /* 让内容垂直居中 */
}
html[data-color-mode="dark"] .card-tag {
  border-color: var(--border-dark);
  color: rgb(145, 152, 161);
}
.meta-muted {
  margin-top: auto;
  flex-shrink: 0;
  /* 保证meta始终在卡片底部 */
}
.site-footer { 
  padding-top: 1rem; 
  padding-bottom: 1rem; 
  font-size: 12px;
  margin-top: auto;
  color: rgb(89, 99, 110);
  flex-shrink: 0;
}

.sidebar-divider { 
  border: none; 
  border-top: 1px solid var(--border-light); 
}

html[data-color-mode="dark"] .sidebar-divider { 
  border-top: 1px solid var(--border-dark); 
}

/* 响应式个人信息网格布局 */
.profile-info-grid {
  display: grid;
  gap: 0.75rem;
  /* 桌面端：单列布局 */
  grid-template-columns: 1fr;
}

/* 手机端：两列布局，充分利用空间 */
@media (max-width: 767.98px) {
  .profile-info-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding-right: 1rem; /* 右边增加边距 */
  }
}

.profile-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.625rem; /* 减少padding */
  height: 3rem; /* 降低固定高度 */
  overflow: hidden; /* 超出隐藏 */
  border-radius: 6px;
  border: 1px solid var(--border-light);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, background-color .12s ease;
  cursor: pointer;
}

/* 统一背景色 - 与其他卡片保持一致 */
html[data-color-mode="light"] .profile-item { 
  border-color: var(--border-light); 
  background: #fff; 
}

html[data-color-mode="dark"] .profile-item { 
  border-color: var(--border-dark); 
  background: #0f141a; 
}

.profile-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.profile-icon {
  font-size: 1rem;
  line-height: 1;
  margin-top: 0.125rem;
}

.profile-detail {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  flex: 1;
  min-width: 0; /* 防止文字溢出 */
}

.profile-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #656d76;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  line-height: 1;
}

.profile-value {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #24292f;
  line-height: 1.2;
  /* 单行省略号显示 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 个人信息弹窗样式 */
.profile-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.profile-modal-content {
  position: relative;
  max-width: 400px;
  width: 90%;
  max-height: 80vh;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.profile-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.profile-modal-titles {
  flex: 1;
}

.profile-modal-header h3 {
  margin: 0 0 0.25rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #24292f;
}

.profile-modal-subtitle {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: #656d76;
  opacity: 0.8;
}

.profile-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #656d76;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.profile-modal-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #24292f;
}

.profile-modal-body {
  padding: 1.25rem;
}

.profile-modal-body p {
  margin: 0;
  line-height: 1.5;
  color: #656d76;
}

/* 深色模式弹窗 */
html[data-color-mode="dark"] .profile-modal-content {
  background: rgba(13, 17, 23, 0.95);
  border-color: rgba(255, 255, 255, 0.1);
}

html[data-color-mode="dark"] .profile-modal-header {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

html[data-color-mode="dark"] .profile-modal-header h3 {
  color: #f0f6fc;
}

html[data-color-mode="dark"] .profile-modal-subtitle {
  color: #8b949e;
}

html[data-color-mode="dark"] .profile-modal-close {
  color: #8b949e;
}

html[data-color-mode="dark"] .profile-modal-close:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #f0f6fc;
}

html[data-color-mode="dark"] .profile-modal-body p {
  color: #8b949e;
}

html[data-color-mode="dark"] .profile-label {
  color: #8b949e;
}

html[data-color-mode="dark"] .profile-value {
  color: #f0f6fc;
}

.profile-list li { margin:.25rem 0; line-height:1.35; }
.inline-icon { vertical-align:text-bottom; }

header.width-full {
  background: rgba(246, 248, 250, 0.7);
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
  position: -webkit-sticky; /* Safari兼容 */
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(4px) saturate(130%) contrast(105%) brightness(102%);
  -webkit-backdrop-filter: blur(4px) saturate(130%) contrast(105%) brightness(102%);
  /* Header渐变效果 */
  background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
  /* 规避iOS Safari系统收缩 */
  -webkit-transform: translate3d(0,0,0);
  transform: translate3d(0,0,0);
  will-change: transform;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* 手机端Header不再sticky，跟着页面滚动，导航交给动态导航条 */
@media (max-width: 767.98px) {
  header.width-full.d-only-mobile {
    position: static !important;
    /* 移除所有固定定位相关属性 */
  }
  
  /* 不再需要为固定Header留出空间 */
  main {
    padding-top: 0;
  }
  
  /* 移除header隐藏时的padding调整 */
  .header-title-hidden main {
    padding-top: 0;
  }
}

/* 手机端Header简化为正常静态header，不使用毛玻璃 */
@media (max-width: 767.98px) {
  header.width-full.d-only-mobile .container-xl:first-child {
    background: var(--bg-muted-light);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background-image: none;
  }
  
  header.width-full.d-only-mobile .container-xl:last-child {
    background: transparent;
  }
}

.header-nav {
  gap: 1.5rem;
}
@media (min-width: 577px) {
  .header-nav {
    transform: translateX(-2rem);
  }
}

.theme-toggle-btn {
  margin-left: 0;
}

.header-nav a.Link--primary {
  padding: 4px 8px;
  border-radius: 6px;
  transition: background-color 0.2s;
}

.header-nav a.Link--primary:hover {
  background-color: rgba(0,0,0,0.06);
  text-decoration: none;
}

html[data-color-mode="dark"] .header-nav a.Link--primary:hover {
  background-color: rgba(255,255,255,0.06);
}

html[data-color-mode="dark"] header.width-full {
  background: rgba(13, 17, 22, 0.7);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
}

/* 暗色模式下手机端Header第一行不使用毛玻璃 */
@media (max-width: 767.98px) {
  html[data-color-mode="dark"] header.width-full.d-only-mobile .container-xl:first-child {
    background: var(--bg-muted-dark);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background-image: none;
    /* 滚动隐藏效果 */
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform: translateY(0);
    opacity: 1;
  }
}

/* 筛选器按钮样式 - 和header一样的hover效果 */
.UnderlineNav-item.project-tab {
  padding: 4px 8px !important;
  border-radius: 6px;
  transition: background-color 0.2s;
}

.UnderlineNav-item.project-tab:hover {
  background-color: rgba(0,0,0,0.06) !important;
  text-decoration: none !important;
}

html[data-color-mode="dark"] .UnderlineNav-item.project-tab:hover {
  background-color: rgba(255,255,255,0.06) !important;
}

/* 筛选器居中 */
.UnderlineNav .UnderlineNav-body {
  justify-content: center !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  width: 100% !important;
}

.UnderlineNav {
  display: flex !important;
  justify-content: center !important;
  width: 100% !important;
}

/* Project/Blog卡片Grid布局 - 只保留核心宽度控制 */
.fixed-grid-container {
  display: grid;
  gap: 1rem;
  width: 100%;
  margin: 0;
  padding: 0 1rem;
  grid-template-columns: 1fr;
  box-sizing: border-box;
}
@media (min-width: 576px) {
  .fixed-grid-container {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 1rem;
    width: 100%;
  }
}
@media (min-width: 992px) {
  .fixed-grid-container {
    grid-template-columns: repeat(3, 1fr);
    padding: 0 1rem;
    width: 100%;
  }
}
.fixed-grid-item {
  width: 100%;
  min-width: 0 !important;
  max-width: 100% !important;
  display: flex;
  flex-direction: column;
}
.fixed-grid-item .card-like {
  height: 133px !important;
  min-height: 133px !important;
  max-height: 133px !important;
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}
.fixed-grid-item .card-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}
.fixed-grid-item .card-title {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
.fixed-grid-item .card-desc {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  word-break: break-word !important;
  flex-shrink: 1 !important;
}
.fixed-grid-item .card-like > .meta-muted,
.fixed-grid-item .card-like > .card-meta-bottom {
  margin-top: auto !important;
  flex-shrink: 0;
}

/* 中等屏幕: 2列 */
@media (min-width: 576px) {
  .fixed-grid-container {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 1rem;
    width: 100%;
  }
}

/* 桌面端: 3列 */
@media (min-width: 992px) {
  .fixed-grid-container {
    grid-template-columns: repeat(3, 1fr);
    padding: 0 1rem;
    width: 100%;
  }
  
  /* 确保桌面端也是133px */
  .fixed-grid-item .card-like {
    height: 133px !important;
    min-height: 133px !important;
    max-height: 133px !important;
  }
}
/* 桌面端卡片固定高度 - 使用Bootstrap md断点 */
@media (min-width: 768px) {
  .card-like {
    height: 133px !important;
    min-height: 133px !important;
    max-height: 133px !important;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }
  .card-like > .d-flex.flex-justify-between.mb-2,
  .card-desc {
    flex-shrink: 0;
  }
  .card-like > .meta-muted,
  .card-like > .card-meta-bottom {
    margin-top: auto !important;
    flex-shrink: 0;
  }
}
.card-meta-bottom {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  width: calc(100% - 2rem);
  pointer-events: none;
}
/* 移动端卡片meta样式 - 使用Bootstrap md断点 */
@media (max-width: 767.98px) {
  .card-meta-bottom {
    position: static !important;
    width: 100% !important;
    left: auto !important;
    bottom: auto !important;
    pointer-events: auto !important;
    margin-top: 0.5rem;
  }
}
.profile-avatar {
  border: 2px solid var(--border-light);
  width: 294px;
  height: 294px;
  transition: width 0.3s ease, height 0.3s ease;
  max-width: 100%;
  max-height: 100%;
}
html[data-color-mode="dark"] .profile-avatar {
  border-color: var(--border-dark);
}

.profile-avatar-container {
  max-height: 294px;
  width: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 响应式头像和布局 - 使用Bootstrap断点系统 */
@media (max-width: 767.98px) {
  .profile-avatar {
    width: clamp(90px, calc(90px + (100vw - 526px) * 38 / 242), 128px) !important;
    height: clamp(90px, calc(90px + (100vw - 526px) * 38 / 242), 128px) !important;
  }

  .profile-section {
    width: 100% !important;
    max-width: 100% !important;
  }

  .profile-info {
    min-width: 0;
  }
  
  .profile-info .d-flex {
    flex-direction: row !important;
    align-items: flex-start;
  }

  .profile-text {
    flex: 1;
    min-width: 0;
    margin-left: 1rem;
  }

  .about-content {
    margin-top: 1rem;
  }

  .profile-avatar-container {
    flex-shrink: 0;
    max-height: 294px;
    width: auto;
  }
  
  .name-responsive {
    font-size: 1.3rem;
  }
}

@media (min-width: 768px) {
  .profile-avatar {
    margin-bottom: 2.2rem !important;
  }
  
  .profile-info .d-flex {
    flex-direction: column !important;
  }
  
  .profile-text {
    margin-top: 0 !important;
    margin-left: 0 !important;
  }
  
  .name-responsive {
    font-size: 1.1rem;
  }
  
  .site-footer {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
  }
  
  .main-card-section {
    max-height: 700px;
    overflow-y: auto;
  }
}

/* 覆盖主容器的margin设置 */
.my-4 {
  margin-top: 1.5rem !important;
  margin-bottom: 0 !important;
}

@media (min-width: 768px) {
  .my-md-6 {
    margin-top: 2rem !important;
    margin-bottom: 0 !important;
  }
}
