/* 首页渐变标题 */
.home-hero {
  text-align: center;
  padding: 60px 0 20px;
}
.home-hero h1 {
  font-size: 2.8em;
  font-weight: 800;
  background: linear-gradient(135deg, #3949ab, #00897b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.home-hero .subtitle {
  font-size: 1.1em;
  color: var(--md-default-fg-color--light);
  margin-top: 8px;
}

/* Material 原生 grid cards 美化 */
.md-typeset .grid.cards > ul > li {
  border-radius: 12px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.md-typeset .grid.cards > ul > li:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
}
.md-typeset .grid.cards > ul > li > p:last-child {
  text-align: right;
}

/* 文章区域 */
.md-main__inner {
  padding: 8px 24px;
}

/* 代码块美化 */
.md-typeset code {
  border-radius: 6px;
  padding: 2px 8px;
}

/* 表格圆角 */
.md-typeset table:not([class]) {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  display: block;
  overflow-x: auto;
  white-space: nowrap;
  width: 100%;
}
.md-typeset table:not([class]) th {
  white-space: nowrap;
}
.md-typeset table:not([class]) td {
  white-space: nowrap;
}

/* 标题装饰 */
.md-typeset h1 {
  font-weight: 700;
  letter-spacing: -0.02em;
}
.md-typeset h2 {
  font-weight: 600;
  border-bottom: 2px solid var(--md-primary-fg-color);
  padding-bottom: 8px;
  margin-top: 32px;
}

/* 右对齐 */
.right-align {
  text-align: right;
}

/* 删除线 */
del {
  text-decoration: line-through;
  color: #999;
}

/* 隐藏仓库按钮 */
.md-source {
  display: none;
}
.md-header__source {
  display: none;
}

/* 加粗字体修复 */
strong {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
  font-weight: bold !important;
}

/* 段落间距 */
.md-typeset p {
  line-height: 1.7;
}

/* 自定义主题色 #3F337B */
:root {
  --md-primary-fg-color: #3F337B;
  --md-primary-fg-color--dark: #2D2560;
  --md-primary-fg-color--light: #6B5F9E;
  --md-primary-bg-color: #FFFFFF;
  --md-primary-bg-color--light: #FFFFFF;
}
[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #3F337B;
  --md-primary-fg-color--dark: #2D2560;
  --md-primary-fg-color--light: #6B5F9E;
}

/* 页眉季节选择器 */
.season-picker {
  position: relative;
  margin-right: 0.2rem;
}
.season-picker__toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  height: 2.4rem;
  padding: 0 0.55rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: var(--md-primary-bg-color);
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s, background 0.2s;
}
.season-picker__toggle:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.12);
}
.season-picker__icon {
  display: inline-block;
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
}
.season-picker__caret {
  font-size: 0.7rem;
  line-height: 1;
  opacity: 0.8;
}
.season-picker__menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 30;
  min-width: 6.5rem;
  margin: 0;
  padding: 0.3rem;
  list-style: none;
  background: var(--md-default-bg-color);
  color: var(--md-default-fg-color);
  border-radius: 0.5rem;
  box-shadow: var(--md-shadow-z2);
}
.season-picker.open .season-picker__menu {
  display: block;
}
.season-picker__item {
  padding: 0.4rem 0.8rem;
  border-radius: 0.35rem;
  cursor: pointer;
  white-space: nowrap;
}
.season-picker__item:hover {
  background: var(--md-default-fg-color--lightest);
}
.season-picker__item.active {
  background: var(--md-accent-fg-color--transparent);
  font-weight: 700;
}

/* 小屏设备：季节按钮收起为仅图标，避免挤压页眉 */
@media screen and (max-width: 720px) {
  .season-picker__toggle {
    padding: 0 0.4rem;
  }
  .season-picker__label,
  .season-picker__caret {
    display: none;
  }
}

/* ========== 统计名单弹窗（ESI / 一流专业详情） ========== */
.stats-modal {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.stats-modal[hidden] {
  display: none;
}
.stats-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 8, 30, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: quickFade 0.25s ease;
}
.stats-modal__card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(560px, 94vw);
  max-height: 86vh;
  overflow-y: auto;
  padding: 30px 28px 24px;
  border-radius: 18px;
  background: #2a275f;
  border: 1px solid rgba(255, 217, 160, 0.45);
  color: #fff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  animation: quickUp 0.3s ease;
}
.stats-modal__close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.stats-modal__close:hover {
  background: rgba(255, 255, 255, 0.26);
  transform: rotate(90deg);
}
.stats-modal__icon {
  display: block;
  font-size: 2.4rem;
  line-height: 1;
  margin-bottom: 12px;
  text-align: center;
}
.stats-modal__title {
  margin: 0 0 6px;
  font-size: 1.45rem;
  font-weight: 800;
  text-align: center;
  background: linear-gradient(135deg, #ffd9a0, #fff6e6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stats-modal__sub {
  margin: 0 0 16px;
  font-size: 0.85rem;
  text-align: center;
  opacity: 0.85;
  letter-spacing: 0.04em;
}
.stats-modal__list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}
.stats-modal__list li {
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 0.9rem;
  text-align: center;
  line-height: 1.5;
}
.stats-modal__note {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.7;
  opacity: 0.75;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 14px;
}

@media screen and (max-width: 720px) {
  .stats-modal__list {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .stats-modal__list li {
    padding: 8px 6px;
    font-size: 0.82rem;
  }
  .stats-modal__card {
    padding: 26px 18px 20px;
  }
  .stats-modal__backdrop,
  .quick-pop__backdrop {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}


/* ========== 主页 Hero ========== */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
  width: calc(100% + 48px);
  margin: 4px -24px 8px;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: #241d4d; /* JS 未就绪/无图时兜底深紫，避免空白 */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  animation: hero-zoom 8s ease-out forwards;
}
@keyframes hero-zoom {
  from { transform: scale(1.08); }
  to   { transform: scale(1); }
}
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(20, 16, 48, 0.55) 0%, rgba(20, 16, 48, 0.25) 45%, rgba(20, 16, 48, 0.72) 100%),
    radial-gradient(ellipse at center, rgba(63, 51, 123, 0.25) 0%, transparent 70%);
}
.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  margin: auto 0;
  min-height: 0;
  overflow-y: auto;
  text-align: center;
  padding: 32px 24px;
  max-width: 900px;
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}
.hero-eyebrow {
  font-size: 0.85rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 10px;
  animation: hero-rise 0.7s 0.1s both;
}
.hero-title {
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  margin: 0 0 6px;
  line-height: 1.1;
  background: linear-gradient(135deg, #ffffff 20%, #e8d8ff 60%, #ffd9a0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: hero-rise 0.7s 0.2s both;
}
.hero-subtitle {
  font-size: clamp(1rem, 2.4vw, 1.4rem);
  letter-spacing: 0.5em;
  font-weight: 600;
  opacity: 0.95;
  margin: 0 0 14px;
  animation: hero-rise 0.7s 0.3s both;
}
.hero-type {
  min-height: 1.8em;
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  opacity: 0.9;
  margin: 0 0 28px;
  animation: hero-rise 0.7s 0.4s both;
}
.hero-type .cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  vertical-align: -0.15em;
  margin-left: 2px;
  border-radius: 1px;
  background: linear-gradient(180deg, #ffd9a0, rgba(255, 217, 160, 0.45));
  animation: blink 1.4s ease-in-out infinite;
  opacity: 1;
  transition: opacity 0.2s;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.15; }
}
@keyframes hero-rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 统计卡片 */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  width: 100%;
  max-width: 760px;
  gap: 14px;
  margin-bottom: 30px;
  animation: hero-rise 0.8s 0.55s both;
}
.stat {
  position: relative;
  min-width: 150px;
  padding: 16px 20px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.stat::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18%;
  right: 18%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
}
.stat:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 217, 160, 0.6);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.3);
}
.stat-num {
  display: block;
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1.1;
  background: linear-gradient(135deg, #ffd9a0, #ffffff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
}
.stat-label {
  display: block;
  margin-top: 6px;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  opacity: 0.9;
}

/* CTA 按钮 */
.hero-cta {
  display: inline-block;
  padding: 12px 34px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  color: #3F337B;
  background: linear-gradient(135deg, #ffd9a0, #ffffff);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  text-decoration: none;
  animation: hero-rise 0.8s 0.7s both;
  transition: transform 0.2s, box-shadow 0.2s;
}
.hero-cta:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
  text-decoration: none;
}

/* Hero 内访问统计（独立访客 / 累计访问）：左右两列毛玻璃卡片，每列自上而下 图标→数字→释义 */
.hero-visits {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 20px;
  animation: hero-rise 0.8s 0.85s both;
}
.hero-visits__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 132px;
  padding: 16px 20px 14px;
  border-radius: 16px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.hero-visits__item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18%;
  right: 18%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
}
.hero-visits__item:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 217, 160, 0.5);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}
.hero-visits__icon {
  font-size: 1.2rem;
  line-height: 1;
  opacity: 0.95;
}
.hero-visits__num {
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  color: #ffd9a0;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
}
.hero-visits__label {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  opacity: 0.85;
}

/* 校区卡片 */
.campus .md-typeset__table, .campus ul {
  margin: 0;
}
.md-typeset .grid.cards.campus > ul > li {
  background: linear-gradient(160deg, var(--md-default-bg-color), var(--md-default-bg-color--light));
}
.md-typeset .grid.cards.campus > ul > li > p:last-child {
  text-align: left;
  color: var(--md-default-fg-color--light);
}

/* 小屏适配 */
@media screen and (max-width: 720px) {
  /* 压缩访问统计卡片，让 Hero 第一页在多数手机上单屏完整显示 */
  .hero-visits {
    gap: 8px;
    margin-top: 6px;
  }
  .hero-visits__item {
    min-width: 104px;
    gap: 2px;
    padding: 7px 6px 6px;
    border-radius: 10px;
  }
  .hero-visits__icon {
    font-size: 0.8rem;
  }
  .hero-visits__num {
    font-size: 1.1rem;
  }
  .hero-visits__label {
    font-size: 0.6rem;
    letter-spacing: 0.04em;
  }
  .hero {
    min-height: 68vh;
    border-radius: 12px;
    width: calc(100% + 32px);
    margin: 4px -16px 8px;
  }
  .stat {
    min-width: 0;
    padding: 12px 14px;
  }
  .stat-num {
    font-size: 1.6rem;
  }
  /* 移动端：背景图避免 transform 缩放动画（低端机掉帧），改为纯淡入 */
  .hero-bg {
    animation: hero-fade 0.9s ease-out forwards;
  }
}
@keyframes hero-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ========== 主页 Hero 手册翻页 ========== */
.hero-book {
  position: relative;
  z-index: 2;
  width: 100%;
  flex: none;
  height: clamp(520px, 78vh, 720px);
  min-height: 0;
  display: flex;
  overflow: hidden;
}
.hero-book__page {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateX(100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s ease;
}
.hero-book__page.active {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  opacity: 1;
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}
.hero-book__page.prev {
  transform: translateX(-100%);
  opacity: 0;
}

/* 第 2、3 页通用内层 */
.hero-page-inner {
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  padding: 40px 28px;
  text-align: center;
  color: #fff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.4);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 217, 160, 0.45) transparent;
}
.hero-page-inner::-webkit-scrollbar {
  width: 6px;
}
.hero-page-inner::-webkit-scrollbar-thumb {
  background: rgba(255, 217, 160, 0.45);
  border-radius: 3px;
}
.hero-page-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  margin: 0 0 26px;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, #ffffff 20%, #e8d8ff 60%, #ffd9a0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 快速入口网格 */
.hero-quick {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  max-width: 720px;
  margin: 0 auto;
}
.hero-quick__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 8px;
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(59, 49, 128, 0.5), rgba(26, 21, 62, 0.5));
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 0.98rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  transition: transform 0.22s, box-shadow 0.22s, border-color 0.22s;
}
.hero-quick__item > span:last-child {
  background: linear-gradient(135deg, #ffd9a0, #fff6e6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-quick__item:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 217, 160, 0.65);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.3);
  text-decoration: none;
}
.hero-quick__item .hero-quick__preview {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  width: 210px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #1f1c4a;
  border: 1px solid rgba(255, 217, 160, 0.5);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.55;
  text-align: left;
  white-space: normal;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
  z-index: 6;
}
.hero-quick__item .hero-quick__preview::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: rgba(255, 217, 160, 0.45);
}
.hero-quick__item:hover .hero-quick__preview {
  display: block;
}
.hero-quick__item {
  position: relative;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.hero-quick__icon {
  font-size: 1.9rem;
  line-height: 1;
}

/* 冷知识列表 */
.hero-fun {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 760px;
  text-align: left;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.hero-fun li {
  padding: 12px 16px;
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(59, 49, 128, 0.5), rgba(26, 21, 62, 0.5));
  border: 1px solid rgba(255, 255, 255, 0.18);
  line-height: 1.6;
  font-size: 0.95rem;
}
.hero-fun li strong {
  color: #ffd9a0;
  font-weight: 800;
}

/* 第四页：一站式导航站（QDU-Nav） */
.hero-navhub {
  max-width: 520px;
  margin: 0 auto;
  padding: 30px 26px;
  border-radius: 20px;
  text-align: center;
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(99, 84, 180, 0.4), transparent 62%),
    linear-gradient(160deg, rgba(63, 51, 123, 0.55), rgba(26, 21, 62, 0.6));
  border: 1px solid rgba(255, 217, 160, 0.28);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.hero-navhub__desc {
  margin: 0 0 22px;
  font-size: 0.98rem;
  line-height: 1.75;
  opacity: 0.92;
}
.hero-navhub__go {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 17px 22px;
  border-radius: 16px;
  text-decoration: none;
  color: #fff;
  text-align: left;
  background: linear-gradient(135deg, #5a4ec0, #32276e);
  border: 1px solid rgba(255, 217, 160, 0.4);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.hero-navhub__go:hover {
  transform: translateY(-3px) scale(1.02);
  border-color: rgba(255, 217, 160, 0.7);
  box-shadow: 0 16px 40px rgba(255, 183, 107, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  text-decoration: none;
}
.hero-navhub__go-icon {
  font-size: 1.9rem;
  line-height: 1;
}
.hero-navhub__go-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.hero-navhub__go-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #ffe3b3, #ffd9a0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-navhub__go-sub {
  font-size: 0.78rem;
  opacity: 0.75;
  letter-spacing: 0.05em;
}
.hero-navhub__go-arrow {
  font-size: 1.4rem;
  color: #ffd9a0;
  transition: transform 0.25s;
}
.hero-navhub__go:hover .hero-navhub__go-arrow {
  transform: translateX(6px);
}

/* 手册导航（箭头 + 圆点） */
.hero-book__nav {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 18px 0 22px;
}
.hero-book__prev,
.hero-book__next {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--md-primary-fg-color);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, opacity 0.2s, background 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}
.hero-book__prev:hover,
.hero-book__next:hover {
  transform: scale(1.08);
  background: var(--md-primary-fg-color--dark);
}
.hero-book__prev:disabled,
.hero-book__next:disabled {
  opacity: 0.35;
  cursor: default;
  transform: none;
}
.hero-book__dots {
  display: flex;
  gap: 8px;
}
.hero-book__dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: width 0.25s, background 0.25s;
}
.hero-book__dot.active {
  width: 26px;
  background: #ffd9a0;
}

/* 快速入口弹窗 */
body.pop-open {
  overflow: hidden;
}
.quick-pop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.quick-pop[hidden] {
  display: none;
}
.quick-pop__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 8, 30, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: quickFade 0.25s ease;
}
@keyframes quickFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.quick-pop__card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: min(480px, 92vw);
  max-height: 84vh;
  overflow-y: auto;
  padding: 30px 28px 26px;
  border-radius: 18px;
  background: #2a275f;
  border: 1px solid rgba(255, 217, 160, 0.45);
  color: #fff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  animation: quickUp 0.3s ease;
}
@keyframes quickUp {
  from { transform: translateY(18px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.quick-pop__close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.quick-pop__close:hover {
  background: rgba(255, 255, 255, 0.26);
  transform: rotate(90deg);
}
.quick-pop__icon {
  display: block;
  font-size: 2.6rem;
  line-height: 1;
  margin-bottom: 14px;
}
.quick-pop__title {
  margin: 0 0 10px;
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffd9a0, #fff6e6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.quick-pop__desc {
  margin: 0 0 24px;
  font-size: 1rem;
  line-height: 1.85;
  color: #ffffff;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}
.quick-pop__go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 12px 26px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd9a0, #ffb36b);
  color: #2b1a4a;
  font-weight: 800;
  font-size: 0.98rem;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}
.quick-pop__go:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 183, 107, 0.4);
}
.quick-pop__go::after {
  content: "↓";
  font-size: 1.1rem;
  line-height: 1;
  transition: transform 0.2s;
}
.quick-pop__go:hover::after {
  transform: translateY(2px);
}

/* 移动端：入口网格 2 列，冷知识紧凑 */
@media screen and (max-width: 720px) {
  .hero-book {
    height: clamp(480px, 78vh, 620px);
  }
  /* 统计卡片 2 列网格，避免 flex 在窄屏退化成 1 列导致内容超高被裁切 */
  .hero-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 420px;
    margin-bottom: 12px;
  }
  .stat {
    width: auto;
    padding: 10px 12px;
  }
  .stat-num {
    font-size: 1.35rem;
  }
  .stat-label {
    font-size: 0.72rem;
    margin-top: 4px;
  }
  /* 三张统计卡片中，第 3 张居中跨整行，避免 2 列网格下落在左列而显得不对称 */
  .stat:last-child {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc(50% - 5px);
  }
  .hero-inner {
    padding: 14px 16px;
  }
  .hero-eyebrow {
    margin-bottom: 6px;
    font-size: 0.72rem;
  }
  .hero-title {
    margin-bottom: 6px;
    font-size: clamp(1.8rem, 9vw, 2.4rem);
  }
  .hero-subtitle {
    letter-spacing: 0.3em;
    margin-bottom: 6px;
    font-size: 0.9rem;
  }
  .hero-type {
    margin-bottom: 10px;
  }
  .hero-cta {
    padding: 10px 26px;
    font-size: 0.95rem;
  }
  .hero-quick {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .hero-quick__item {
    padding: 14px 6px;
    font-size: 0.9rem;
  }
  .hero-quick__icon {
    font-size: 1.5rem;
  }
  .hero-page-inner {
    padding: 18px 14px;
  }
  .hero-page-title {
    margin-bottom: 16px;
  }
  .hero-fun {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-width: 400px;
  }
  .hero-fun li {
    padding: 8px 10px;
    font-size: 0.8rem;
    line-height: 1.45;
  }
  .hero-navhub {
    padding: 20px 16px;
  }
  .hero-navhub__desc {
    font-size: 0.86rem;
    margin-bottom: 16px;
  }
  .hero-navhub__go {
    padding: 13px 16px;
  }
  .hero-navhub__go-icon {
    font-size: 1.5rem;
  }
  .hero-navhub__go-title {
    font-size: 1rem;
  }
}

/* 超小屏（≤360px）：进一步压缩，确保首屏标题与底部 CTA 不被裁切 */
@media screen and (max-width: 360px) {
  .hero-inner {
    padding: 12px 12px;
  }
  .hero-eyebrow {
    font-size: 0.65rem;
    margin-bottom: 4px;
  }
  .hero-title {
    font-size: clamp(1.6rem, 8.5vw, 2rem);
    margin-bottom: 4px;
  }
  .hero-subtitle {
    font-size: 0.82rem;
    letter-spacing: 0.25em;
    margin-bottom: 6px;
  }
  .hero-type {
    font-size: 0.85rem;
    margin-bottom: 10px;
    min-height: 1.5em;
  }
  .hero-stats {
    gap: 8px;
    margin-bottom: 12px;
  }
  .stat {
    padding: 8px 10px;
  }
  .stat-num {
    font-size: 1.2rem;
  }
  .stat-label {
    font-size: 0.68rem;
  }
  .stat:last-child {
    width: calc(50% - 4px);
  }
  .hero-cta {
    padding: 9px 22px;
    font-size: 0.9rem;
  }
}

/* ========== 青大智答（全站悬浮智能问答） ========== */
.chat-launcher {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 110;
  width: 54px;
  height: 54px;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(150deg, #5549b8, #33286e 55%, #241d4d);
  border: 1px solid rgba(255, 217, 160, 0.35);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.22s, box-shadow 0.22s;
}
.chat-launcher::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 217, 160, 0.25), transparent 70%);
  animation: chat-halo 2.6s ease-in-out infinite;
}
.chat-launcher:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
@keyframes chat-halo {
  0%, 100% { opacity: 0.5; transform: scale(0.96); }
  50%      { opacity: 1; transform: scale(1.06); }
}

.chat-panel {
  position: fixed;
  right: 20px;
  bottom: 84px;
  z-index: 120;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 620px;
  max-height: calc(100vh - 106px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 18px;
  color: #fff;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(99, 84, 180, 0.55), transparent 60%),
    linear-gradient(165deg, #33297a, #241d4d 70%);
  border: 1px solid rgba(255, 217, 160, 0.3);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: chat-in 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.chat-panel[hidden] { display: none; }
.chat-panel::after {
  content: "";
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 1px;
  z-index: 1;
  background: linear-gradient(90deg, transparent, rgba(255, 217, 160, 0.6), transparent);
}
@keyframes chat-in {
  from { transform: translateY(18px) scale(0.96); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

.chat-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px 11px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
}
.chat-panel__titles { min-width: 0; }
.chat-panel__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: linear-gradient(135deg, #ffe3b3, #ffd9a0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.chat-panel__title::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
  animation: chat-pulse 2s infinite;
}
@keyframes chat-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55); }
  70%  { box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}
.chat-panel__sub {
  margin-top: 3px;
  font-size: 0.68rem;
  opacity: 0.62;
  letter-spacing: 0.05em;
}
.chat-panel__close {
  flex: none;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, color 0.2s;
}
.chat-panel__close:hover {
  background: rgba(255, 217, 160, 0.18);
  color: #ffd9a0;
  transform: rotate(90deg);
}
.chat-panel__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.chat-clear {
  flex: none;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.chat-clear:hover {
  background: rgba(255, 217, 160, 0.18);
  color: #ffd9a0;
  transform: rotate(-90deg);
}

.chat-panel__body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 13px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 217, 160, 0.35) transparent;
}
.chat-panel__body::-webkit-scrollbar { width: 5px; }
.chat-panel__body::-webkit-scrollbar-thumb {
  background: rgba(255, 217, 160, 0.35);
  border-radius: 3px;
}

.chat-panel__foot {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 13px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
}
.chat-input {
  flex: 1;
  min-width: 0;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.chat-input::placeholder { color: rgba(255, 255, 255, 0.42); }
.chat-input:focus {
  border-color: rgba(255, 217, 160, 0.55);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 3px rgba(255, 217, 160, 0.12);
}
.chat-send {
  flex: none;
  padding: 8px 16px;
  border: none;
  border-radius: 999px;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #2b1a4a;
  background: linear-gradient(135deg, #ffe0ae, #ffb36b);
  box-shadow: 0 4px 14px rgba(255, 183, 107, 0.25);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}
.chat-send:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(255, 183, 107, 0.35);
  filter: brightness(1.04);
}
.chat-send:active { transform: translateY(0) scale(0.97); }

/* 消息 */
.chat-msg {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  animation: chat-msg-in 0.28s ease both;
}
.chat-msg--user { flex-direction: row-reverse; }
.chat-msg--bot { flex-direction: row; }
.chat-avatar {
  flex: none;
  width: 30px;
  height: 30px;
  margin-top: 2px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  line-height: 1;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(255, 217, 160, 0.28);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.chat-msg--user .chat-avatar {
  background: linear-gradient(135deg, rgba(255, 217, 160, 0.32), rgba(255, 217, 160, 0.12));
}
.chat-msg__content {
  min-width: 0;
  max-width: 86%;
  display: flex;
  flex-direction: column;
}
@keyframes chat-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.chat-bubble {
  max-width: 100%;
  padding: 8px 13px;
  border-radius: 15px;
  font-size: 0.88rem;
  line-height: 1.62;
  word-break: break-word;
  letter-spacing: 0.01em;
}
.chat-bubble--user {
  background: linear-gradient(135deg, #ffe0ae, #ffb36b);
  color: #3a2340;
  font-weight: 600;
  border-bottom-right-radius: 5px;
  box-shadow: 0 4px 14px rgba(255, 183, 107, 0.22);
}
.chat-welcome {
  max-width: 100%;
  padding: 9px 13px;
  border-radius: 15px;
  border-bottom-left-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.86rem;
  line-height: 1.62;
}

/* chips */
.chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  max-width: 100%;
}
.chat-chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 217, 160, 0.38);
  background: rgba(255, 217, 160, 0.05);
  color: #ffe9c7;
  font-size: 0.78rem;
  font-family: inherit;
  letter-spacing: 0.02em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.chat-chip:hover {
  background: rgba(255, 217, 160, 0.16);
  border-color: rgba(255, 217, 160, 0.6);
  transform: translateY(-1px);
}

/* 加载动画 */
.chat-typing {
  display: inline-flex;
  gap: 5px;
  padding: 11px 15px;
  border-radius: 15px;
  border-bottom-left-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.chat-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 217, 160, 0.9);
  animation: chat-blink 1.2s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes chat-blink {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30%           { opacity: 1; transform: translateY(-3px); }
}

/* 无结果 */
.chat-empty {
  max-width: 100%;
  padding: 10px 13px;
  border-radius: 15px;
  border-bottom-left-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px dashed rgba(255, 217, 160, 0.3);
  font-size: 0.84rem;
  line-height: 1.6;
  opacity: 0.9;
}

/* 答案区 */
.chat-answer {
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-answer__head {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  opacity: 0.6;
}
.chat-result {
  position: relative;
  display: block;
  padding: 11px 13px 11px 15px;
  border-radius: 13px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  text-decoration: none;
  transition: transform 0.22s, border-color 0.22s, background 0.22s, box-shadow 0.22s;
}
.chat-result::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: linear-gradient(180deg, #ffd9a0, rgba(255, 217, 160, 0.15));
  opacity: 0.7;
}
.chat-result:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 217, 160, 0.5);
  background: rgba(255, 217, 160, 0.07);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  text-decoration: none;
}
.chat-result__title {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.4;
  color: #ffe9c7;
}
.chat-result__crumb {
  margin-top: 3px;
  font-size: 0.68rem;
  opacity: 0.62;
  letter-spacing: 0.04em;
}
.chat-result__snip {
  margin: 6px 0 0;
  font-size: 0.82rem;
  line-height: 1.6;
  opacity: 0.92;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.chat-result__go {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 7px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #ffd9a0;
  transition: gap 0.2s;
}
.chat-result:hover .chat-result__go { gap: 7px; }
.chat-answer__note {
  font-size: 0.7rem;
  opacity: 0.55;
  line-height: 1.5;
}

/* 手机端：全屏底部抽屉 */
@media screen and (max-width: 720px) {
  .chat-launcher {
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    width: 50px;
    height: 50px;
  }
  .chat-panel {
    right: 0;
    bottom: 0;
    left: 0;
    top: 0;
    width: auto;
    max-width: none;
    height: 100%;
    max-height: none;
    border-radius: 0;
    border: none;
  }
  .chat-panel__body { padding-bottom: 10px; }
  .chat-panel__foot { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
}

/* 触屏设备（手机/平板）：关闭 hover 上浮与重阴影，避免滚动时掉帧卡顿 */
@media (hover: none) and (pointer: coarse) {
  .hero-quick__item:hover,
  .hero-quick__item:active {
    transform: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  }
  .stat:hover,
  .stat:active {
    transform: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  }
  .hero-visits__item:hover {
    transform: none;
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  }
  .md-typeset .grid.cards > ul > li:hover {
    transform: none;
    box-shadow: none;
  }
  .hero-book__prev:hover,
  .hero-book__next:hover,
  .stats-modal__close:hover,
  .quick-pop__close:hover,
  .quick-pop__go:hover {
    transform: none;
  }
}

/* 友情链接板块样式 */
.friend-section {
  margin: 32px 0;
}
.friend-section h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--md-primary-fg-color);
}
/* 聊天消息风格友链卡片 */
.friend-cards {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin: 24px 0;
}
.friend-card {
  position: relative;
  display: flex;
  gap: 16px;
  padding: 20px;
  border-radius: 16px;
  background: var(--md-default-bg-color);
  border: 1px solid var(--md-default-fg-color--lighter);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
  text-decoration: none;
  color: inherit;
}
.friend-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(63, 51, 123, 0.15);
  border-color: rgba(63, 51, 123, 0.3);
  text-decoration: none;
  color: inherit;
}
/* 左侧：圆形头像（圆形与底色由容器承担，logo 微放大裁掉原图白边） */
.friend-card__avatar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(145deg, #f2effa, #e6e0f5);
  box-shadow: inset 0 0 0 1px rgba(63, 51, 123, 0.14), 0 2px 8px rgba(63, 51, 123, 0.10);
  transition: box-shadow 0.25s, transform 0.25s;
}
.friend-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.14);
}
.friend-card:hover .friend-card__avatar {
  box-shadow: inset 0 0 0 1px rgba(63, 51, 123, 0.35), 0 4px 14px rgba(63, 51, 123, 0.22);
  transform: scale(1.04);
}
/* 右侧：消息气泡内容 */
.friend-card__content {
  position: relative;
  flex: 1;
  min-width: 0;
}
.friend-card__link-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
}
.friend-card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin-bottom: 8px;
}
/* 提升特异性以覆盖 Material 的 .md-typeset h3/p 默认外边距 */
.md-typeset .friend-card__name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--md-primary-fg-color);
  margin: 0;
}
.friend-card__link {
  font-size: 0.78rem;
  color: var(--md-default-fg-color--light);
  opacity: 0.8;
}
.md-typeset .friend-card__desc {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--md-default-fg-color);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* 站点截图：默认矮预览条，展开为完整比例大图 */
.friend-card__screenshot {
  position: relative;
  z-index: 6;
  margin-top: 14px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--md-default-fg-color--lightest, rgba(0, 0, 0, 0.08));
  max-height: 68px;
  cursor: pointer;
  transition: max-height 0.5s ease;
}
.friend-card__screenshot.is-open {
  max-height: 500px;
}
/* 桌面端：负 margin 横跨 content 全宽 + hover 展开 */
@media (hover: hover) and (pointer: fine) {
  .friend-card__screenshot {
    margin: 14px -20px 0;
  }
  .friend-card:hover .friend-card__screenshot {
    max-height: 500px;
  }
}
.friend-card__screenshot img {
  width: 100%;
  height: auto;
  display: block;
}
/* 防御 MkDocs md_in_html 在结构内插入的幽灵 <p>，消除多余间距 */
.friend-card__header p,
.friend-card__screenshot p {
  margin: 0;
  line-height: 0;
}
/* 卡片左侧紫色装饰条 */
.friend-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 20px;
  bottom: 20px;
  width: 3px;
  background: linear-gradient(180deg, var(--md-primary-fg-color), rgba(63, 51, 123, 0.3));
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.25s;
}
.friend-card:hover::before {
  opacity: 1;
}

/* 友链卡片暗黑模式适配 */
[data-md-color-scheme="slate"] .friend-card {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}
[data-md-color-scheme="slate"] .friend-card__avatar {
  background: linear-gradient(145deg, #3a3160, #2c2450);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), 0 2px 8px rgba(0, 0, 0, 0.3);
}
[data-md-color-scheme="slate"] .friend-card:hover .friend-card__avatar {
  box-shadow: inset 0 0 0 1px rgba(255, 217, 160, 0.5), 0 4px 14px rgba(0, 0, 0, 0.4);
}
[data-md-color-scheme="slate"] .friend-card:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}
[data-md-color-scheme="slate"] .friend-card__screenshot {
  border-color: rgba(255, 255, 255, 0.12);
}

/* 友链卡片小屏适配 */
@media screen and (max-width: 720px) {
  .friend-card {
    padding: 14px;
    gap: 12px;
    border-radius: 14px;
  }
  .friend-card__avatar {
    width: 56px;
    height: 56px;
  }
  /* 名称与域名上下排列，避免窄屏挤压错位 */
  .friend-card__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    margin-bottom: 6px;
  }
  .md-typeset .friend-card__name {
    font-size: 1rem;
  }
  .friend-card__link {
    font-size: 0.72rem;
  }
  .md-typeset .friend-card__desc {
    font-size: 0.85rem;
    line-height: 1.55;
    -webkit-line-clamp: unset;
  }
  .friend-card__screenshot {
    /* 手机端不需要负 margin，截图在 content 内即可 */
    margin-top: 12px;
    border-radius: 10px;
    max-height: 50px;
  }
  .friend-card__screenshot.is-open {
    max-height: 260px;
  }
}
