/* =========================================================
   站点级小修补(在主题样式之后加载)
   ========================================================= */

/* ---------- 顶部导航 ----------
   法语的栏目标题词比较长,允许它们撑开会把按钮挤出可视区域。
   这里禁止换行,并给法语单独收紧一点间距。 */
.top-navbar .navbar-nav {
  flex-wrap: nowrap;
}

.top-navbar .nav-link {
  white-space: nowrap;
}

html[lang="fr"] .top-navbar .nav-link {
  padding-left: 0.45rem;
  padding-right: 0.45rem;
  font-size: 0.95rem;
}

html[lang="fr"] .top-navbar .navbar-brand {
  font-size: 1.02rem;
}

/* 屏幕刚好到 xl 断点(1200px 出头)时最挤,再收一点间距 */
@media (max-width: 1299px) {
  html[lang="fr"] .top-navbar .nav-link {
    padding-left: 0.3rem;
    padding-right: 0.3rem;
    font-size: 0.9rem;
  }
}

/* ---------- 没有配图的文章 ----------
   主题会把正文上移 4.5rem 压在大图上;没有大图时改成正常流。
   选择器要和主题里那条保持同样权重,否则压不过去。 */
body.kind-page .wrapper .content-section .content .read-area.no-hero .page-content {
  top: 0;
  margin-top: 3rem;
}

/* 没有配图的文章卡片:图片区不占位 */
.post-card.no-image .card-body {
  padding-top: 1.5rem !important;
}

/* 首页背景:主题默认 blur(3px) + scale(1.1),换成实景照片后显得糊 */
#homePageBackgroundImageDivStyled {
  filter: none !important;
  transform: none !important;
}

/* 首页背景遮罩:不模糊,只用半透明色压一层;随日夜模式变化 */
:root {
  --home-overlay: rgba(250, 247, 242, 0.74);
  --home-text: #1f1b16;
  --home-text-muted: #4a443c;
}

html[data-theme="dark"] {
  --home-overlay: rgba(9, 9, 12, 0.62);
  --home-text: #f4efe6;
  --home-text-muted: #cfc7ba;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --home-overlay: rgba(9, 9, 12, 0.62);
    --home-text: #f4efe6;
    --home-text-muted: #cfc7ba;
  }
}

/* 底图遮罩:Bing 每日图加载前也压同一层色,避免开头一秒文字与底图不搭。
   遮罩统一由 ::before 提供,Bing JS 只换 background-image,不再自带渐变。 */
#homePageBackgroundImageDivStyled {
  position: relative;
}

#homePageBackgroundImageDivStyled::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: var(--home-overlay);
  pointer-events: none;
}

/* 首页文字:白天用深色,避免和浅色遮罩糊在一起 */
#home .greeting,
#home .greeting-subtitle,
#home .typing-carousel,
#home .arrow,
#home .content {
  color: var(--home-text) !important;
}

#home .greeting-subtitle,
#home .typing-carousel {
  color: var(--home-text-muted) !important;
}

/* 首页容器作为背景来源标注的定位父级 */
#home {
  position: relative;
}

/* 导航栏文字跟随首页深浅色,避免和浅色遮罩糊在一起 */
.top-navbar .navbar-brand,
.top-navbar li a {
  color: var(--home-text) !important;
}

/* 首页顶部是透明导航:主题会换成白色 logo 和白色主题图标。
   浅色模式下背景偏亮,把它们反相成深色,避免看不清。 */
html[data-theme="light"] .top-navbar.transparent-navbar #logo {
  filter: invert(1);
}

html[data-theme="light"] .top-navbar.transparent-navbar #navbar-theme-icon-svg {
  filter: none !important;
}

html[data-theme="light"] .top-navbar.transparent-navbar .navbar-toggler.navbar-dark {
  color: var(--home-text) !important;
}

/* 上海大学 logo 是纯白版,浅色模式下反相成深色 */
img[src$="/shu.svg"] {
  filter: invert(1);
}

html[data-theme="dark"] img[src$="/shu.svg"] {
  filter: none;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) img[src$="/shu.svg"] {
    filter: none;
  }
}

/* 代码块:顶部工具栏 + 语言标签 + 复制按钮 */
.highlight {
  position: relative;
  margin: 1.4em 0;
  background: #0f1419;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 32px -26px rgba(0, 0, 0, 0.85);
}

.highlight pre {
  margin: 0 !important;
  padding: 2.5rem 1.1rem 1rem !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0;
  overflow-x: auto;
  font-size: 0.84rem;
  line-height: 1.7;
}

.highlight pre code {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Consolas, "Courier New", monospace;
  font-size: 1em;
}

.highlight pre::-webkit-scrollbar {
  height: 8px;
}

.highlight pre::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 4px;
}

.code-toolbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.42rem 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.code-lang {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
}

.copy-code-btn {
  padding: 2px 9px;
  font-family: inherit;
  font-size: 0.7rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.6);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 5px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.copy-code-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.06);
}

.copy-code-btn.copied {
  color: #7ee787;
  border-color: rgba(126, 231, 135, 0.45);
}

/* ---------- 本科档案 ---------- */
.school-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
  margin-top: 2rem;
}

.school-card {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 1.4rem 1.5rem;
  border: 1px solid rgba(128, 128, 128, 0.25);
  border-radius: 0.6rem;
  color: inherit;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.school-card-logo {
  flex: 0 0 auto;
  width: auto;
  height: 46px;
  max-width: 120px;
  object-fit: contain;
}

.school-card-text {
  flex: 1 1 auto;
  min-width: 0;
}

.school-card:hover {
  border-color: #248aaa;
  transform: translateY(-2px);
  text-decoration: none;
  color: inherit;
}

.school-card h2 {
  margin: 0 0 0.3rem;
  font-size: 1.2rem;
}

.school-card-program {
  margin: 0;
  font-size: 0.92rem;
}

.school-card-meta {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: rgba(128, 128, 128, 0.9);
}

.school-card-stats {
  margin: 0.6rem 0 0;
  font-size: 0.82rem;
  color: #248aaa;
}

.school-tabs {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid rgba(128, 128, 128, 0.2);
}

.school-tabs a {
  padding: 0.5rem 1rem;
  margin-bottom: -1px;
  font-size: 0.9rem;
  color: rgba(128, 128, 128, 0.95);
  border-bottom: 2px solid transparent;
}

.school-tabs a.on {
  color: #248aaa;
  border-bottom-color: #248aaa;
}

.school-tabs a:hover {
  color: #248aaa;
  text-decoration: none;
}

.course-note {
  display: block;
  margin-top: 0.15em;
  font-size: 0.8em;
  line-height: 1.6;
  color: rgba(128, 128, 128, 0.9);
}

.course-competition {
  display: inline-block;
  margin-top: 0.2em;
  font-size: 0.76em;
  line-height: 1.5;
  color: #248aaa;
}

.course-competition:hover {
  text-decoration: underline;
}

.course-project {
  display: inline-block;
  margin-left: 0.55em;
  font-size: 0.78em;
  color: #248aaa;
}

.course-project:hover {
  text-decoration: underline;
}

.undergrad-school {
  margin-top: 3rem;
}

.school-head {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #248aaa;
  margin-bottom: 1.5rem;
}

.school-logo {
  flex: 0 0 auto;
  width: auto;
  height: 52px;
  max-width: 140px;
  object-fit: contain;
}

.school-head-text {
  flex: 1 1 auto;
  min-width: 0;
}

.school-head h2 {
  margin: 0 0 0.3rem;
  font-size: 1.4rem;
}

.school-meta {
  margin: 0;
  color: rgba(128, 128, 128, 0.95);
  font-size: 0.92rem;
}

.school-note {
  margin: 0.4rem 0 0;
  color: rgba(128, 128, 128, 0.85);
  font-size: 0.85rem;
}

.school-stats {
  margin: 0.4rem 0 0;
  font-size: 0.82rem;
  color: #248aaa;
}

.term {
  margin-top: 2rem;
}

.term h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgba(128, 128, 128, 0.95);
}

.course-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.course-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.5rem 0.2rem;
  border-bottom: 1px dashed rgba(128, 128, 128, 0.18);
  font-size: 0.93rem;
  scroll-margin-top: 80px;
}

.course-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 6.5rem 3.5rem 3.5rem;
  gap: 1rem;
  padding: 0.3rem 0.2rem;
  border-bottom: 1px solid rgba(128, 128, 128, 0.22);
  font-size: 0.72rem;
  color: rgba(128, 128, 128, 0.85);
}

.course-head span:not(:first-child) {
  text-align: right;
}

.course-row:last-child {
  border-bottom: 0;
}

.course-name {
  flex: 1 1 auto;
  overflow-wrap: anywhere;
  min-width: 0;
}

.course-code {
  display: inline-block;
  margin-right: 0.6em;
  font-family: ui-monospace, Consolas, "Courier New", monospace;
  font-size: 0.78em;
  letter-spacing: 0.02em;
  color: rgba(128, 128, 128, 0.75);
}

.course-name a {
  color: inherit;
  border-bottom: 1px solid rgba(36, 138, 170, 0.4);
}

.course-name a:hover {
  color: #248aaa;
  text-decoration: none;
}

.course-name a i {
  margin-left: 0.4em;
  font-size: 0.65em;
  color: #248aaa;
}

.course-grade {
  flex: 0 0 6.5rem;
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.course-credits {
  flex: 0 0 3.5rem;
  text-align: right;
  color: rgba(128, 128, 128, 0.9);
  font-variant-numeric: tabular-nums;
}

.course-gpa {
  flex: 0 0 3.5rem;
  text-align: right;
  color: rgba(128, 128, 128, 0.9);
  font-variant-numeric: tabular-nums;
}

.grade-high { color: #2e963d; }
.grade-mid { color: #248aaa; }
.grade-low { color: #b8860b; }
.grade-warn { color: #b5533c; }
.grade-plain {
  color: rgba(128, 128, 128, 0.85);
  font-weight: 400;
}

html[data-theme="dark"] .grade-high { color: #6fcf7f; }
html[data-theme="dark"] .grade-mid { color: #6cc4e0; }
html[data-theme="dark"] .grade-low { color: #e0c060; }
html[data-theme="dark"] .grade-warn { color: #e08a72; }

@media (max-width: 575.98px) {
  .course-row {
    gap: 0.6rem;
    font-size: 0.86rem;
  }

  .course-grade {
    flex-basis: 5.6rem;
  }

  .course-gpa {
    flex-basis: 2.4rem;
  }

  .course-credits {
    flex-basis: 2.8rem;
  }

  .course-head {
    grid-template-columns: minmax(0, 1fr) 5.6rem 2.4rem 2.8rem;
    gap: 0.6rem;
  }

  .course-row.with-gpa {
    grid-template-columns: minmax(0, 1fr) 5.6rem 2.4rem 2.8rem;
  }

  .course-head {
    grid-template-columns: 1fr 5.6rem 2.4rem 2.8rem;
    gap: 0.6rem;
  }

  .school-head h2 {
    font-size: 1.2rem;
  }
}

/* ---------- 研究兴趣 ---------- */
.research-card-head {
  display: flex;
  align-items: center;
  padding: 1.35rem 1.5rem 0;
}

.research-card .card-body {
  padding: 0.85rem 1.5rem 1.35rem;
}

.research-card .card-text {
  margin-bottom: 0;
}

/* ---------- 竞赛 ---------- */
.comp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.4rem;
  margin: 2rem 0 0;
}

.comp-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(128, 128, 128, 0.25);
  border-radius: 0.8rem;
  background: rgba(128, 128, 128, 0.03);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.comp-card:hover {
  border-color: #248aaa;
  color: inherit;
  text-decoration: none;
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.comp-card-media {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0b1220;
}

.comp-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.comp-card-body {
  display: block;
  padding: 1.15rem 1.3rem 1.25rem;
}

.comp-card-title {
  display: block;
  margin: 0 0 0.25rem;
  font-size: 1.22rem;
  font-weight: 600;
}

.comp-card-sub {
  display: block;
  margin: 0 0 0.55rem;
  font-size: 0.84rem;
  color: rgba(128, 128, 128, 0.95);
}

.comp-card-result {
  display: inline-block;
  margin-bottom: 0.55rem;
  padding: 0.1rem 0.55rem;
  font-size: 0.78rem;
  color: #248aaa;
  border: 1px solid rgba(36, 138, 170, 0.35);
  border-radius: 999px;
}

.comp-card-summary {
  display: block;
  margin: 0 0 0.8rem;
  font-size: 0.92rem;
}

.comp-card-more {
  display: block;
  font-size: 0.84rem;
  color: #248aaa;
}

/* 详情页正文不跟着屏幕撑开:窄屏铺满,宽屏居中定宽。
   主题在 <=ultra-large 时给 .content-section .container 加了 max-width:100%,
   所以这里要用更高权重才压得住。
   同时铺一层和博文一样的抬起底(页面底色深、正文底浅),把文字区和边栏分开。 */
#content-section .comp-detail,
#content-section .project-detail,
#content-section .detail-surface {
  width: 100%;
  margin-inline: auto;
  padding: 2.1rem 2.5rem 2.7rem;
  border-radius: 1.1rem;
  background: #f8fafc;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 22px 48px rgba(15, 23, 42, 0.08);
}

html[data-theme="dark"] #content-section .comp-detail,
html[data-theme="dark"] #content-section .project-detail,
html[data-theme="dark"] #content-section .detail-surface {
  background: #1f2937;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 26px 60px rgba(0, 0, 0, 0.38);
}

#content-section .comp-detail {
  max-width: 980px;
}

#content-section .detail-surface {
  max-width: 1240px;
}

@media (max-width: 767.98px) {
  #content-section .comp-detail,
  #content-section .project-detail,
  #content-section .detail-surface {
    padding: 1.35rem 1.15rem 1.8rem;
    border-radius: 0.9rem;
  }
}

/* 列表页:标题左对齐,和详情页的 hero 一个语气 */
.list-head {
  margin-bottom: 1.8rem;
}

.list-head h1 {
  margin: 0 0 0.5rem;
  font-size: 2rem;
  text-align: left;
}

.list-intro {
  max-width: 62ch;
  font-size: 0.98rem;
  line-height: 1.7;
  color: rgba(128, 128, 128, 0.95);
}

.list-intro p {
  margin: 0;
}

/* 列表页里的卡片:在半透明底上再抬一层,悬停一起亮 */
#content-section .detail-surface .card {
  height: calc(100% - 1rem);
  margin-bottom: 1rem;
  border: 1px solid var(--hairline);
  background: var(--surface-1);
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out),
    border-color var(--dur-fast), background-color var(--dur-fast);
}

#content-section .detail-surface .card:hover {
  border-color: var(--accent-line);
  background: var(--surface-2);
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.12);
}

/* 卡片内部的排版:标题在上、摘要撑开、标签与“详情”压在底边,
   详情按钮始终落在右下角 */
#content-section .detail-surface .card,
#content-section .detail-surface .card > .card {
  display: flex;
  flex-direction: column;
}

#content-section .detail-surface .card > .card {
  height: 100%;
}

#content-section .detail-surface .card-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
}

#content-section .detail-surface .card-body > p {
  flex: 1 1 auto;
  margin-bottom: 0.8rem;
}

/* 标签在左、“详情”压在右下角 */
#content-section .detail-surface .project-card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.8rem;
  margin-top: auto;
}

#content-section .detail-surface .project-tags-holder {
  display: flex;
  flex-wrap: wrap;
  flex: 1 1 auto;
  gap: 0.28rem;
  min-width: 0;
}

#content-section .detail-surface .project-btn-holder {
  flex: 0 0 auto;
  width: auto;
  margin-left: auto;
}




/* 左上返回列表、右上返回简历 */
.detail-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.detail-nav--end {
  justify-content: flex-end;
}


.detail-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--nav-pill-fg);
  text-decoration: none;
  border: 1px solid var(--nav-pill-border);
  border-radius: 999px;
  background: var(--nav-pill-bg);
  transition: color var(--dur-fast) var(--ease-soft), border-color var(--dur-fast),
    background-color var(--dur-fast), transform var(--dur) var(--ease-out),
    box-shadow var(--dur) var(--ease-out);
}


.detail-nav a:hover,
.detail-nav a:focus-visible {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(36, 138, 170, 0.16);
}

.detail-nav i {
  font-size: 0.72rem;
  transition: transform var(--dur) var(--ease-out);
}

.detail-nav-back:hover i {
  transform: translateX(3px);
}

.detail-nav-resume:hover i {
  transform: translateX(-3px);
}





.comp-back {
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.comp-hero {
  margin: 0 0 1.8rem;
}

.comp-hero img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 460px;
  object-fit: cover;
  border-radius: 0.8rem;
}

.comp-hero figcaption {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: rgba(128, 128, 128, 0.9);
}

.comp-head h1 {
  margin: 0 0 0.35rem;
  font-size: 2rem;
}

.comp-sub {
  margin: 0 0 0.9rem;
  font-size: 1rem;
  color: rgba(128, 128, 128, 0.95);
}

.comp-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  margin-bottom: 1.8rem;
  padding: 0.9rem 0;
  border-top: 1px solid rgba(128, 128, 128, 0.2);
  border-bottom: 1px solid rgba(128, 128, 128, 0.2);
  font-size: 0.88rem;
}

.comp-meta strong {
  display: block;
  margin-bottom: 0.1rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(128, 128, 128, 0.85);
}

.comp-repo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
  margin: -1rem 0 1.8rem;
}

.comp-figure {
  margin: 1.6rem 0;
  text-align: center;
}

.comp-figure img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  margin: 0 auto;
  border-radius: 0.6rem;
}

.comp-figure.is-portrait img {
  max-width: 420px;
}


.comp-figure figcaption {
  margin-top: 0.55rem;
  font-size: 0.78rem;
  line-height: 1.6;
  color: rgba(128, 128, 128, 0.95);
}

.comp-articles {
  margin-top: 2.8rem;
}


.comp-body {
  font-size: 1rem;
  line-height: 1.75;
}

.comp-body h2 {
  margin: 1.8rem 0 0.7rem;
  font-size: 1.3rem;
}

.comp-body p {
  margin: 0 0 1rem;
}

.comp-certs {
  margin-top: 2.6rem;
}

.comp-certs h2 {
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.2rem;
}

.cert-card {
  margin: 0;
  padding: 0.6rem;
  border: 1px solid rgba(128, 128, 128, 0.22);
  border-radius: 0.6rem;
  background: rgba(128, 128, 128, 0.03);
}

.cert-card a {
  display: block;
}

.cert-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.35rem;
  cursor: zoom-in;
}

/* ---------- 证书灯箱 ---------- */
body.cert-lb-open {
  overflow: hidden;
}

/* Toha gives the navbar/footer very high z-index values; hide them so they
   cannot paint over the modal, regardless of stacking order. */
body.cert-lb-open .top-navbar,
body.cert-lb-open .footer {
  visibility: hidden;
}

.cert-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(5, 10, 15, 0.93);
}

.cert-lightbox.open {
  display: flex;
}

.cert-lb-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: min(1400px, 96vw);
  margin: 0;
}

.cert-lb-figure img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 74vh;
  object-fit: contain;
  background: #fff;
  border-radius: 0.3rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}

.cert-lb-caption {
  display: block;
  margin-top: 1rem;
  color: #f4f7fa;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
}

.cert-lb-text {
  display: block;
  max-width: 820px;
  margin-top: 0.35rem;
  color: rgba(230, 238, 245, 0.82);
  font-size: 0.86rem;
  line-height: 1.65;
  text-align: center;
}

.cert-lb-counter {
  display: block;
  margin-top: 0.5rem;
  color: rgba(230, 238, 245, 0.55);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
}

.cert-lb-close,
.cert-lb-prev,
.cert-lb-next {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: #f4f7fa;
  font-size: 1.5rem;
  line-height: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.cert-lb-close:hover,
.cert-lb-prev:hover,
.cert-lb-next:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.45);
}

.cert-lb-close {
  top: 1rem;
  right: 1.2rem;
  font-size: 1.7rem;
}

.cert-lb-prev {
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.cert-lb-next {
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

@media (max-width: 575.98px) {
  .cert-lightbox {
    padding: 0.75rem;
  }

  .cert-lb-figure img {
    max-height: 66vh;
  }

  .cert-lb-prev {
    left: 0.35rem;
  }

  .cert-lb-next {
    right: 0.35rem;
  }

  .cert-lb-close {
    top: 0.5rem;
    right: 0.5rem;
  }
}

.cert-card figcaption {
  margin-top: 0.55rem;
  font-size: 0.8rem;
  line-height: 1.5;
  color: rgba(128, 128, 128, 0.95);
}

@media (max-width: 575.98px) {
  .comp-grid {
    grid-template-columns: 1fr;
  }

  .comp-head h1 {
    font-size: 1.6rem;
  }

  .comp-hero img {
    max-height: 260px;
  }

  .cert-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- 项目详情 ---------- */
#content-section .project-detail {
  max-width: 1180px;
}



.project-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1.2rem;
  font-size: 0.85rem;
}

.project-hero {
  position: relative;
  padding: 1.7rem 1.9rem;
  overflow: hidden;
  border: 1px solid rgba(128, 128, 128, 0.22);
  border-radius: 1rem;
  background:
    radial-gradient(circle at 100% 0%, rgba(36, 138, 170, 0.16), transparent 55%),
    linear-gradient(135deg, rgba(36, 138, 170, 0.07), transparent 60%);
}

.project-eyebrow {
  margin: 0 0 0.55rem;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #248aaa;
}

.project-hero h1 {
  margin: 0 0 0.55rem;
  font-size: 2.15rem;
  line-height: 1.2;
}

.project-sub {
  margin: 0 0 0.9rem;
  font-size: 0.98rem;
  color: rgba(128, 128, 128, 0.95);
}

.project-lead {
  max-width: 68ch;
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.75;
}

.project-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 2.4rem;
  align-items: start;
  margin-top: 2.2rem;
}

.project-side {
  position: sticky;
  top: 92px;
}

.project-side-card {
  padding: 1.2rem 1.3rem;
  border: 1px solid rgba(128, 128, 128, 0.22);
  border-radius: 0.9rem;
  background: rgba(128, 128, 128, 0.045);
}

.project-side-title {
  margin: 0 0 0.9rem;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(128, 128, 128, 0.95);
}

.project-facts {
  margin: 0;
}

.project-facts > div {
  display: grid;
  grid-template-columns: 4.6rem minmax(0, 1fr);
  gap: 0.5rem;
  padding: 0.55rem 0;
  border-bottom: 1px dashed rgba(128, 128, 128, 0.2);
}

.project-facts > div:last-child {
  border-bottom: 0;
}

.project-facts dt {
  font-size: 0.76rem;
  font-weight: 500;
  color: rgba(128, 128, 128, 0.95);
}

.project-facts dd {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.project-facts a {
  color: #248aaa;
}

.project-side-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.1rem;
}

.project-repo-list {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}

.project-repo-list .project-repo-btn {
  text-align: left;
}

.project-side-star {
  display: inline-flex;
  min-height: 20px;
}

.project-body {
  font-size: 1rem;
  line-height: 1.8;
}

.project-body h2 {
  position: relative;
  padding-left: 0.75rem;
}

.project-body h2::before {
  content: "";
  position: absolute;
  top: 0.28em;
  bottom: 0.28em;
  left: 0;
  width: 3px;
  border-radius: 2px;
  background: #248aaa;
}

.project-articles {
  margin-top: 3rem;
}

.project-articles h2 {
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.project-article-list {
  display: grid;
  gap: 0.9rem;
}

.project-article {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.05rem 1.2rem;
  border: 1px solid rgba(128, 128, 128, 0.25);
  border-radius: 0.7rem;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.project-article:hover {
  border-color: #248aaa;
  color: inherit;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.project-article-index {
  padding-top: 0.15rem;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: #248aaa;
}

.project-article-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.project-article-title {
  display: block;
  font-weight: 600;
}

.project-article-desc {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.88rem;
  line-height: 1.6;
  color: rgba(128, 128, 128, 0.95);
}

.project-article-arrow {
  padding-top: 0.1rem;
  color: #248aaa;
  opacity: 0.65;
  transition: transform 0.2s ease;
}

.project-article:hover .project-article-arrow {
  transform: translateX(3px);
}

@media (max-width: 991.98px) {
  .project-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.6rem;
  }

  .project-side {
    position: static;
    order: -1;
  }
}

/* 长串(文件名、代码、连写英文)不许把正文撑出卡片 */
.project-main,
.comp-body,
.project-body,
.post-content {
  min-width: 0;
  overflow-wrap: break-word;
}

.comp-body code,
.project-body code,
.post-content code {
  word-break: break-word;
}


@media (max-width: 575.98px) {
  .project-hero {
    padding: 1.3rem 1.2rem;
  }

  .project-hero h1 {
    font-size: 1.6rem;
  }
}

.project-card-heading {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: default;
}

@media (prefers-reduced-motion: reduce) {
  #typing-carousel-data {
    display: block;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  #typing-carousel-data li:not(:first-child) {
    display: none;
  }

  .typing-carousel #typed,
  .typing-carousel .ityped-cursor {
    display: none !important;
  }

  .arrow.bounce {
    animation: none !important;
  }
}

.back-sep { margin: 0 .5rem; opacity: .45; }

.project-star-row { display: flex; justify-content: flex-end; align-items: center; min-height: 20px; margin: 1.2rem 0 .4rem; }

.education-actions { margin-top: .85rem; }

/* ---------- 文章分享 ---------- */
.post-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  margin-top: 1.6rem;
  padding: 1.1rem 0 0.5rem;
  border-top: 1px solid rgba(128, 128, 128, 0.2);
}

.post-share-label {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(128, 128, 128, 0.95);
}

.post-share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.34rem 0.72rem;
  border: 1px solid rgba(128, 128, 128, 0.28);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font-size: 0.82rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.share-btn i {
  font-size: 0.95rem;
  line-height: 1;
}

.share-btn:hover {
  color: #fff;
  border-color: transparent;
  transform: translateY(-1px);
}

.share-x:hover { background: #111; }
.share-linkedin:hover { background: #0a66c2; }
.share-facebook:hover { background: #1877f2; }
.share-telegram:hover { background: #229ed9; }
.share-whatsapp:hover { background: #25d366; }
.share-weibo:hover { background: #e6162d; }
.share-reddit:hover { background: #ff4500; }
.share-email:hover { background: #555; }
.share-copy.copied { background: #2e7d32; border-color: transparent; color: #fff; }

@media (max-width: 575.98px) {
  .share-btn span { display: none; }
  .share-btn { padding: 0.5rem 0.6rem; }
  .post-share { gap: 0.55rem; }
}

.share-markdown:hover { background: #333; }

/* ==========================================================================
   细节与动效
   设计原则:所有动效只碰 opacity / transform,时长 160–620ms,
   统一用 ease-out 曲线;系统开了"减少动态效果"就全部退化成静态。
   ========================================================================== */

:root {
  --accent: #248aaa;
  --accent-light: #58c4e6;
  --accent-deep: #1b6d88;
  --accent-soft: rgba(36, 138, 170, 0.1);
  --accent-line: rgba(36, 138, 170, 0.34);
  --surface-1: rgba(120, 128, 140, 0.06);
  --surface-2: rgba(120, 128, 140, 0.12);
  --hairline: rgba(120, 128, 140, 0.18);
  --fab-bg: rgba(255, 255, 255, 0.88);
  --nav-pill-fg: #475569;
  --nav-pill-border: rgba(100, 116, 139, 0.3);
  --nav-pill-bg: rgba(255, 255, 255, 0.65);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 160ms;
  --dur: 260ms;
  --dur-slow: 600ms;
}

html[data-theme="dark"] {
  --accent-soft: rgba(88, 196, 230, 0.12);
  --accent-line: rgba(88, 196, 230, 0.38);
  --surface-1: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.075);
  --hairline: rgba(255, 255, 255, 0.11);
  --fab-bg: rgba(26, 31, 41, 0.82);
  --nav-pill-fg: #cbd5e1;
  --nav-pill-border: rgba(148, 163, 184, 0.3);
  --nav-pill-bg: rgba(255, 255, 255, 0.04);
}


::selection {
  background: rgba(36, 138, 170, 0.26);
}

/* ---------- 阅读进度条 ---------- */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1035;
  height: 3px;
  pointer-events: none;
}

.read-progress > span {
  display: block;
  height: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent) 45%, var(--accent-light));
  box-shadow: 0 0 12px rgba(36, 138, 170, 0.5);
  transition: transform 80ms linear;
}

/* ---------- 回到顶部 ---------- */
/* 主题自带一个 #scroll-to-top,统一换成下面这颗玻璃圆钮。 */
#scroll-to-top {
  display: none !important;
}

.to-top {
  position: fixed;
  right: 22px;
  bottom: 24px;
  z-index: 1030;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  background: var(--fab-bg);
  color: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  opacity: 0;
  transform: translateY(14px) scale(0.92);
  pointer-events: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.16);
  transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out),
    background-color var(--dur-fast) var(--ease-soft), border-color var(--dur-fast),
    color var(--dur-fast);
}

.to-top.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.to-top:hover,
.to-top:focus-visible {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
  transform: translateY(-2px);
}

/* ---------- 滚动入场 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.reveal.is-in {
  opacity: 1;
  transform: none;
  will-change: auto;
}

/* ---------- 详情页:顶部的淡色晕染 + 入场 ---------- */
#content-section .comp-detail,
#content-section .project-detail {
  position: relative;
}

#content-section .comp-detail::before,
#content-section .project-detail::before,
#content-section .detail-surface::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: 0;
  height: 220px;
  border-radius: 1.1rem 1.1rem 0 0;
  background: linear-gradient(180deg, rgba(36, 138, 170, 0.09), transparent 78%);
  pointer-events: none;
}


html[data-theme="dark"] #content-section .comp-detail::before,
html[data-theme="dark"] #content-section .project-detail::before,
html[data-theme="dark"] #content-section .detail-surface::before {
  background: linear-gradient(180deg, rgba(88, 196, 230, 0.1), transparent 78%);
}


#content-section .comp-detail > *,
#content-section .project-detail > *,
#content-section .detail-surface > * {
  position: relative;
  z-index: 1;
}

.comp-hero img,
.project-hero {
  animation: detail-hero-in 900ms var(--ease-out) both;
}

/* 卡片本身也轻轻浮上来一次,让每个页面都有开场 */
#content-section .comp-detail,
#content-section .project-detail,
#content-section .detail-surface {
  animation: surface-in 540ms var(--ease-out) both;
}

@keyframes surface-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes detail-hero-in {
  from {
    opacity: 0;
    transform: scale(1.025) translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}


/* ---------- 标题:统一的小竖条 ---------- */
.comp-body h2,
.post-content h2 {
  position: relative;
  padding-left: 0.8rem;
  scroll-margin-top: 96px;
}

.comp-body h2::before,
.post-content h2::before,
.project-body h2::before {
  content: "";
  position: absolute;
  top: 0.3em;
  bottom: 0.3em;
  left: 0;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-light));
  transform: scaleY(0.25);
  transform-origin: 50% 0;
  transition: transform var(--dur-slow) var(--ease-out);
}

.comp-body h2.is-in::before,
.post-content h2.is-in::before,
.project-body h2.is-in::before {
  transform: none;
}


.project-body h2 {
  scroll-margin-top: 96px;
}

/* ---------- 正文链接:下划线从左侧长出来 ---------- */
.comp-body a:not(.btn):not(.project-article):not(.header-anchor),
.project-body a:not(.btn):not(.project-article):not(.header-anchor),
.post-content a:not(.btn):not(.post-card):not(.header-anchor) {
  color: var(--accent);
  text-decoration: none;
  background-image: linear-gradient(90deg, currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0% 1px;
  transition: background-size var(--dur) var(--ease-out), color var(--dur-fast);
}

.comp-body a:not(.btn):not(.project-article):not(.header-anchor):hover,
.project-body a:not(.btn):not(.project-article):not(.header-anchor):hover,
.post-content a:not(.btn):not(.post-card):not(.header-anchor):hover {
  background-size: 100% 1px;
}

/* 标题里的锚点链接:继承标题颜色,不要下划线动画 */
.comp-body .header-anchor,
.project-body .header-anchor,
.post-content .header-anchor {
  color: inherit;
  background-image: none;
  text-decoration: none;
}



/* ---------- 元信息 ---------- */
.comp-meta > span {
  transition: color var(--dur-fast) var(--ease-soft), border-color var(--dur-fast);
}

.comp-meta > span:hover {
  color: var(--accent);
}


/* ---------- 按钮 / 图 / 卡片 ---------- */
.project-repo-btn {
  position: relative;
  overflow: hidden;
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out),
    border-color var(--dur-fast), background-color var(--dur-fast);
}

.project-repo-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(36, 138, 170, 0.26);
}

.project-repo-btn::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.32), transparent);
  transform: skewX(-18deg);
  transition: left var(--dur-slow) var(--ease-out);
}

.project-repo-btn:hover::after {
  left: 120%;
}

/* 主题给 figure 加了细边框,插图本身自带底图时会出现一个空框,去掉。 */
#content-section .comp-figure {
  width: auto;
  border: 0;
  padding: 0;
  background: none;
}


.comp-figure img {
  transition: transform var(--dur-slow) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}


.comp-figure:hover img {
  transform: translateY(-2px) scale(1.008);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

.comp-figure:hover figcaption {
  color: var(--accent);
}

.comp-figure figcaption {
  transition: color var(--dur) var(--ease-soft);
}

.cert-card {
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out),
    border-color var(--dur-fast);
}

.cert-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-line);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.18);
}

.cert-card img {
  transition: transform var(--dur-slow) var(--ease-out);
}

.cert-card:hover img {
  transform: scale(1.03);
}

.cert-card a {
  overflow: hidden;
  border-radius: 0.35rem;
}

.project-article {
  background-image: linear-gradient(90deg, var(--accent-soft), transparent 62%);
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: 0% 100%;
  transition: background-size 460ms var(--ease-out), border-color var(--dur-fast),
    transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}

.project-article:hover {
  background-size: 100% 100%;
  border-color: var(--accent-line);
}

/* ---------- 表格 ---------- */
.comp-body table,
.project-body table,
.post-content table {
  width: 100%;
  margin: 1.5rem 0;
  border-collapse: collapse;
  font-size: 0.94rem;
  font-variant-numeric: tabular-nums;
}

.comp-body thead th,
.project-body thead th,
.post-content thead th {
  padding: 0.6rem 0.75rem;
  text-align: left;
  font-weight: 600;
  color: #fff;
  border-bottom: 1px solid var(--accent-line);
}

.comp-body tbody td,
.project-body tbody td,
.post-content tbody td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--hairline);
}

.comp-body tbody tr,
.project-body tbody tr,
.post-content tbody tr {
  transition: background-color var(--dur-fast) var(--ease-soft);
}

.comp-body tbody tr:nth-child(even),
.project-body tbody tr:nth-child(even),
.post-content tbody tr:nth-child(even) {
  background: var(--surface-1);
}

.comp-body tbody tr:hover,
.project-body tbody tr:hover,
.post-content tbody tr:hover {
  background: var(--surface-2);
}

/* ---------- 代码块 ---------- */
.highlight {
  transition: box-shadow var(--dur) var(--ease-out), border-color var(--dur-fast);
}

.highlight:hover {
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

.copy-code-btn {
  transition: color var(--dur-fast), border-color var(--dur-fast), background-color var(--dur-fast),
    transform var(--dur-fast) var(--ease-out);
}

.copy-code-btn:hover {
  transform: translateY(-1px);
}

.copy-code-btn.copied {
  color: #3ddc84;
  border-color: rgba(61, 220, 132, 0.5);
}

/* ---------- 键盘可达 ---------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- 尊重系统设置 ---------- */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .comp-hero img,
  .project-hero,
  #content-section .comp-detail,
  #content-section .project-detail,
  #content-section .detail-surface {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    transition: none !important;
  }


  .comp-body h2::before,
  .post-content h2::before,
  .project-body h2::before {
    transform: none !important;
  }

  .to-top,
  .read-progress > span {
    transition: none !important;
  }
}

@media (max-width: 575.98px) {
  .to-top {
    right: 14px;
    bottom: 16px;
    width: 40px;
    height: 40px;
  }

  .comp-figure:hover img,
  .cert-card:hover img {
    transform: none;
  }
}

/* ---------- 顶部导航:下划线从左边长出来 ---------- */
.top-navbar .nav-link:not(.dropdown-toggle) {
  position: relative;
}

.top-navbar .nav-link:not(.dropdown-toggle)::after {
  content: "";
  position: absolute;
  left: 0.55rem;
  right: 0.55rem;
  bottom: 0.15rem;
  height: 1.5px;
  border-radius: 1px;
  background: currentColor;
  opacity: 0.75;
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform var(--dur) var(--ease-out);
}

.top-navbar .nav-link:not(.dropdown-toggle):hover::after,
.top-navbar .nav-link:not(.dropdown-toggle):focus-visible::after {
  transform: none;
}

/* ---------- 列表页卡片 ---------- */
.comp-card-media img {
  transition: transform var(--dur-slow) var(--ease-out);
}

.comp-card:hover .comp-card-media img {
  transform: scale(1.04);
}

.comp-card-title {
  transition: color var(--dur-fast) var(--ease-soft);
}

.comp-card:hover .comp-card-title {
  color: var(--accent);
}

.post-card {
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out),
    border-color var(--dur-fast);
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.16);
}

.post-card .card-title {
  transition: color var(--dur-fast) var(--ease-soft);
}

.post-card:hover .card-title {
  color: var(--accent);
}

@media (prefers-reduced-motion: reduce) {
  .post-card:hover,
  .comp-card:hover .comp-card-media img {
    transform: none;
  }
}

/* ---------- 页脚 ---------- */
#footer a {
  transition: color var(--dur-fast) var(--ease-soft), opacity var(--dur-fast);
}

#footer ul li a:hover,
#footer a:hover {
  color: var(--accent);
}

/* ---------- 博文列表:一行一篇 ---------- */
.post-list {
  display: grid;
  margin: 0.2rem 0 0.4rem;
}

.post-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.4rem 1.6rem;
  padding: 1.15rem 1.1rem 1.15rem 1.35rem;
  color: inherit;
  text-decoration: none;
  border-radius: 0.7rem;
  background-image: linear-gradient(90deg, var(--accent-soft), transparent 62%);
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: 0% 100%;
  transition: background-size 420ms var(--ease-out), transform var(--dur) var(--ease-out),
    box-shadow var(--dur) var(--ease-out);
}

.post-row + .post-row::after {
  content: "";
  position: absolute;
  left: 1.35rem;
  right: 1.1rem;
  top: 0;
  border-top: 1px solid var(--hairline);
}

.post-row::before {
  content: "";
  position: absolute;
  left: 0.4rem;
  top: 1rem;
  bottom: 1rem;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-light));
  transform: scaleY(0);
  transition: transform var(--dur) var(--ease-out);
}

.post-row:hover,
.post-row:focus-visible {
  background-size: 100% 100%;
  transform: translateY(-1px);
}

.post-row:hover::before,
.post-row:focus-visible::before {
  transform: none;
}

.post-row-main {
  min-width: 0;
}

.post-row-title {
  display: block;
  font-size: 1.06rem;
  font-weight: 600;
  line-height: 1.45;
  transition: color var(--dur-fast) var(--ease-soft);
}

.post-row:hover .post-row-title {
  color: var(--accent);
}

.post-row-summary {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 0.32rem;
  font-size: 0.89rem;
  line-height: 1.65;
  color: rgba(128, 128, 128, 0.95);
}

.post-row-side {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding-top: 0.15rem;
  font-size: 0.76rem;
  color: rgba(128, 128, 128, 0.9);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.post-row-date::after {
  content: "·";
  margin-left: 0.85rem;
  opacity: 0.5;
}

.post-row-arrow {
  color: var(--accent);
  font-size: 0.95rem;
  transition: transform var(--dur) var(--ease-out);
}

.post-row:hover .post-row-arrow {
  transform: translateX(4px);
}

.paginator {
  margin-top: 1.3rem;
}

@media (max-width: 767.98px) {
  .post-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
    padding: 1rem 0.9rem 1rem 1.1rem;
  }

  .post-row-side {
    gap: 0.6rem;
    padding-top: 0;
  }

  .post-row-summary {
    -webkit-line-clamp: 3;
  }
}

/* 手机端:经历时间轴的圆形序号缩小,避免顶破右边界 */
@media (max-width: 575.98px) {
  .circle {
    width: 34px;
    height: 34px;
    font-size: 0.78rem;
  }
}


/* Experience: report / defence links under a position */
.position-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.35rem 0 1.1rem;
}

.position-links .btn {
  font-size: 0.78rem;
  padding: 0.28rem 0.65rem;
}

/* Experience + education: identical logo tiles and borders */
.logo-holder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 120px;
  height: 64px;
  padding: 6px 10px;
  margin-bottom: 1em;
  box-sizing: border-box;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  overflow: hidden;
}

html[data-theme="dark"] .logo-holder {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.logo-holder .company-logo {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

@media (max-width: 575.98px) {
  .logo-holder {
    width: 108px;
    height: 58px;
    padding: 5px 8px;
  }
}

/* Skills: compact icon + one-word tiles */
.skill-tile {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 58px;
  padding: 0.85rem 1rem;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--surface-1);
  color: inherit;
  text-decoration: none;
  transition: transform var(--dur) var(--ease-out), border-color var(--dur-fast) var(--ease-soft),
    background-color var(--dur-fast) var(--ease-soft), box-shadow var(--dur) var(--ease-out);
}

.skill-tile i,
.skill-tile-logo {
  flex: 0 0 auto;
  width: 1.5rem;
  max-height: 1.5rem;
  font-size: 1.25rem;
  line-height: 1;
  text-align: center;
  color: var(--accent);
  object-fit: contain;
}

.skill-tile-name {
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.skill-tile:hover {
  transform: translateY(-2px);
  border-color: var(--accent-line);
  background: var(--surface-2);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  color: inherit;
  text-decoration: none;
}

html[data-theme="dark"] .skill-tile:hover {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.34);
}

@media (max-width: 575.98px) {
  .skill-tile {
    min-height: 52px;
    padding: 0.7rem 0.8rem;
    gap: 0.55rem;
  }

  .skill-tile i,
  .skill-tile-logo {
    width: 1.2rem;
    font-size: 1.05rem;
  }

  .skill-tile-name {
    font-size: 0.86rem;
  }
}

/* Skills grid: four across on desktop, three on tablet, two on phones */
#skill-card-holder {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  height: auto !important;
  margin-left: 0 !important;
  position: relative !important;
}

#skill-card-holder .filtr-item {
  position: static !important;
  width: auto !important;
  max-width: none !important;
  padding: 0 !important;
  transform: none !important;
}

#skill-card-holder .filtr-item.is-hidden {
  display: none !important;
}

@media (max-width: 991.98px) {
  #skill-card-holder {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  #skill-card-holder {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
  }
}

/* ---------- 项目实践（initiatives） ---------- */
.init-links {
  margin-bottom: 1.2rem;
}

.init-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 0 0 1.8rem;
  padding: 0;
  list-style: none;
}

.init-stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--hairline);
  border-radius: 0.7rem;
  background: var(--surface-1);
}

.init-stat-value {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.init-stat-label {
  font-size: 0.76rem;
  line-height: 1.5;
  color: rgba(128, 128, 128, 0.95);
}

.init-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 1.4rem 0;
  overflow: hidden;
  border-radius: 0.7rem;
  background: #000;
}

.init-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.init-lang {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.05rem 0.4rem;
  border-radius: 0.35rem;
  border: 1px solid var(--accent-line);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  vertical-align: middle;
  color: var(--accent);
}

.init-episodes-note {
  margin: 1rem 0 0;
  text-align: right;
  font-size: 0.85rem;
}

.init-gallery {
  margin-top: 2.8rem;
}

.init-gallery .comp-figure {
  margin: 1rem 0;
}

@media (min-width: 768px) {
  .init-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 1.2rem;
    align-items: start;
  }

  .init-gallery > h2 {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767.98px) {
  .init-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .init-embed {
    aspect-ratio: 16 / 10;
  }
}

@media (max-width: 575.98px) {
  .init-stat {
    padding: 0.75rem 0.85rem;
  }

  .init-stat-value {
    font-size: 1.2rem;
  }
}

/* ---------- 详情页底部：相关技能 ---------- */
.project-skills {
  margin-top: 3rem;
}

.project-skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.project-skill {
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--surface-1);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.3;
  transition: border-color var(--dur-fast) var(--ease-soft), transform var(--dur) var(--ease-out);
}

.project-skill:hover {
  border-color: var(--accent-line);
  transform: translateY(-1px);
}

/* ---------- 页脚版权行 ---------- */
.footer-legal {
  row-gap: 0.35rem;
  align-items: center;
}

.footer-legal a {
  white-space: nowrap;
}

@media (max-width: 767.98px) {
  .footer-legal {
    justify-content: center;
    text-align: center;
    font-size: 0.82rem;
  }

  .footer-legal .footer-legal-item {
    flex: 0 0 100%;
    max-width: 100%;
    text-align: center !important;
  }

  .footer-legal .footer-legal-item + .footer-legal-item {
    margin-top: 0.15rem;
  }
}

/* Giscus 评论区 */
.giscus-wrap {
  margin-top: 2.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(128, 128, 128, 0.18);
}

.comments-section {
  padding-top: 1.2rem;
}

.comments-section .container {
  max-width: 900px;
}

.comments-section .giscus-wrap {
  max-width: 840px;
  margin: 1.6rem auto 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
}

/* Giscus 自带 #fff / #0d1117 底色；把首页包裹它的区块刷成同一色，
   避免评论区像一块贴上去的矩形。博客页没有这层 section-holder，不受影响。 */
.section-holder:has(> .comments-section) {
  background: #ffffff !important;
}

html[data-theme="dark"] .section-holder:has(> .comments-section) {
  background: #0d1117 !important;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .section-holder:has(> .comments-section) {
    background: #0d1117 !important;
  }
}
