/* ==========================================================================
   个人主页 style.css
   纯原生 CSS，不依赖任何框架；所有 CSS 变量、动画时长集中在 :root 统一管理
   --------------------------------------------------------------------------
   目录（按顺序排列）：
     01 主题变量     02 基础重置     03 通用布局与标题区
     04 导航栏       05 自我介绍区   06 通用卡片组件
     07 课程板块     08 项目板块     09 自我评价板块
     10 页脚         11 返回顶部     12 动画
     13 响应式（桌面 / 平板 / 手机） 14 无障碍降级
   ========================================================================== */


/* ==========================================================================
   01 主题变量
   ========================================================================== */
:root {
  /* —— 品牌色与强调色 —— */
  --color-primary: #4F46E5;        /* 主色：靛蓝 */
  --color-primary-soft: #6366F1;   /* 主色浅调，用于 hover 与渐变起点 */
  --color-accent: #06B6D4;         /* 强调色：青色 */
  --gradient-brand: linear-gradient(135deg, #4F46E5 0%, #6366F1 50%, #06B6D4 100%);

  /* —— 中性背景与文字三级灰度 —— */
  --bg: #FFFFFF;
  --bg-soft: #F8FAFC;
  --bg-mute: #F1F5F9;
  --text: #0F172A;
  --text-sub: #475569;
  --text-mute: #94A3B8;
  --border: #E6EAF2;

  /* —— 功能色：成功 / 警告 / 危险 —— */
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;

  /* —— 圆角尺寸：由大到小 —— */
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  /* —— 阴影层级 —— */
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 18px 40px rgba(79, 70, 229, 0.16);

  /* —— 间距与布局 —— */
  --container: 1140px;             /* 内容区最大宽度 */
  --nav-h: 68px;                   /* 导航栏高度（锚点滚动偏移要用） */
  --section-gap: 96px;             /* 板块上下留白 */

  /* —— 动画统一节奏 —— */
  --dur: 0.25s;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}


/* ==========================================================================
   02 基础重置
   ========================================================================== */

/* 统一盒模型：padding 与 border 计入元素宽高，布局更好算 */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  /* 平滑滚动：点击锚点链接时由浏览器原生实现缓动滚动 */
  scroll-behavior: smooth;
  /* 锚点定位时预留导航栏高度，防止标题被固定导航遮住 */
  scroll-padding-top: var(--nav-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB",
               system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  /* 关闭 JS 或未加载字体时的横向抖动 */
  overflow-x: hidden;
}

/* 标题与段落统一去掉默认外边距，由容器统一控制间距 */
h1, h2, h3, h4, p, ul, li, figure { margin: 0; padding: 0; }
ul { list-style: none; }

/* 图片自适应容器宽度 */
img { max-width: 100%; height: auto; display: block; }

/* 链接继承父级颜色，去掉默认下划线 */
a { color: inherit; text-decoration: none; }

/* 按钮继承字体族并去掉默认描边 */
button {
  font: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  color: inherit;
}

/* 键盘 Tab 聚焦时的可见轮廓，保证可访问性 */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}


/* ==========================================================================
   03 通用布局与标题区
   ========================================================================== */

/* 内容容器：居中并限制最大宽度，两侧留安全边距 */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* 板块通用容器：上下大留白，形成呼吸感 */
.section {
  padding: var(--section-gap) 0;
  position: relative;
}

/* 需要浅底色的板块（课程、自我评价），用交替背景区分层次 */
.section--soft {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* —— 板块标题区 —— */
.section__head {
  max-width: 620px;
  margin-bottom: 48px;
}

/* 眉标题：小块英文标签，提升现代感 */
.section__eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 8px;
}

/* 主标题：使用 clamp 实现随视口弹性缩放 */
.section__title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

/* 主标题下方的渐变短线条装饰 */
.section__title::after {
  content: "";
  display: block;
  width: 56px;
  height: 4px;
  margin-top: 14px;
  border-radius: var(--radius-pill);
  background: var(--gradient-brand);
}

.section__subtitle {
  margin-top: 16px;
  color: var(--text-sub);
  font-size: 16px;
}

/* —— 通用网格 —— */
.grid {
  display: grid;
  gap: 24px;
}

/* 三列网格：auto-fit + minmax，无需媒体查询也能自然换行 */
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(288px, 1fr)); }

/* 两列网格：右侧略宽，适合「文字 + 可视化」的排版 */
.grid--2 {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 40px;
  align-items: start;
}

/* —— 通用按钮 —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 26px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 15px;
  /* 统一过渡：位移 + 阴影 + 颜色 */
  transition: transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              background-color var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}

/* 主按钮：品牌渐变 + 悬停上浮 */
.btn--primary {
  color: #FFFFFF;
  background: var(--gradient-brand);
  box-shadow: var(--shadow-md);
}
.btn--primary:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* 次按钮：描边风格，悬停填充背景 */
.btn--ghost {
  color: var(--text);
  border: 1px solid var(--border);
  background: var(--bg);
}
.btn--ghost:hover {
  transform: translateY(-3px);
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}

/* —— 标签 —— */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--bg-mute);
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: transform var(--dur) var(--ease),
              background-color var(--dur) var(--ease),
              color var(--dur) var(--ease);
}

/* 强调版标签：浅色主调背景 */
.tag--accent {
  background: rgba(79, 70, 229, 0.10);
  color: var(--color-primary);
}

/* 小号标签（项目技术栈） */
.tag--sm {
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
}

/* 卡片 hover 时，其内部的标签同步高亮，形成联动反馈 */
.course-card:hover .tag,
.project-card:hover .tag--sm {
  color: var(--color-primary);
  border-color: rgba(79, 70, 229, 0.35);
}


/* ==========================================================================
   04 导航栏
   ========================================================================== */
.navbar {
  position: fixed;              /* 固定置顶 */
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  /* 毛玻璃效果：-webkit-backdrop-filter 兼容 Safari */
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: box-shadow var(--dur) var(--ease),
              background-color var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}

/* 滚动后加深边框与阴影（.is-scrolled 由 JS 添加） */
.navbar.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* 站点标识 */
.navbar__brand {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.navbar__brand-dot { color: var(--color-primary); }

/* 导航链接区 */
.navbar__menu {
  display: flex;
  align-items: center;
  gap: 4px;
}

.navbar__link {
  position: relative;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-sub);
  transition: color var(--dur) var(--ease),
              background-color var(--dur) var(--ease);
}

/* 悬停：文字变色 + 浅底色胶囊 */
.navbar__link:hover {
  color: var(--color-primary);
  background: rgba(79, 70, 229, 0.08);
}

/* 当前板块高亮（.is-active 由 JS 的滚动监听切换） */
.navbar__link.is-active {
  color: var(--color-primary);
  background: rgba(79, 70, 229, 0.10);
}

/* 汉堡按钮：默认隐藏，移动端（<768px）由媒体查询显示 */
.navbar__toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  padding: 10px;
  flex-direction: column;
  justify-content: space-between;
}

.navbar__toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform var(--dur) var(--ease),
              opacity var(--dur) var(--ease);
}

/* 菜单展开时三根横线变「叉」 */
.navbar__toggle.is-open .navbar__toggle-bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.navbar__toggle.is-open .navbar__toggle-bar:nth-child(2) {
  opacity: 0;
}
.navbar__toggle.is-open .navbar__toggle-bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* 移动端菜单遮罩 */
.nav-overlay {
  position: fixed;
  inset: var(--nav-h) 0 0 0;
  z-index: 90;
  background: rgba(15, 23, 42, 0.35);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.nav-overlay.is-visible { opacity: 1; }


/* ==========================================================================
   05 自我介绍区（Hero）
   ========================================================================== */
.hero {
  /* 顶部预留导航栏高度，避免首屏文字被遮住 */
  padding-top: calc(var(--nav-h) + 72px);
  padding-bottom: 88px;
  overflow: hidden;
}

/* 背景装饰光斑：两个柔和径向渐变，营造现代感且不抢内容 */
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(0px);
  pointer-events: none;          /* 不拦截鼠标事件 */
  z-index: 0;
}
.hero::before {
  width: 460px; height: 460px;
  top: -120px; right: -80px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.16) 0%, rgba(99, 102, 241, 0) 68%);
}
.hero::after {
  width: 420px; height: 420px;
  bottom: -160px; left: -120px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.14) 0%, rgba(6, 182, 212, 0) 70%);
}

/* Hero 主体：左文字 + 右侧视觉，两列自适应 */
.hero__inner {
  position: relative;
  z-index: 1;                     /* 盖在背景光斑之上 */
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 56px;
  align-items: center;
}

.hero__greet {
  color: var(--color-primary);
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 15px;
}

.hero__name {
  font-size: clamp(38px, 6vw, 62px);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 6px 0 10px;
}

.hero__role {
  font-size: clamp(16px, 2vw, 19px);
  font-weight: 600;
  color: var(--text-sub);
}

.hero__desc {
  margin-top: 18px;
  color: var(--text-sub);
  max-width: 46em;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

/* 联系方式列表 */
.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px dashed var(--border);
  font-size: 14px;
  color: var(--text-sub);
}
.hero__meta-key {
  display: inline-block;
  min-width: 44px;
  margin-right: 8px;
  font-weight: 700;
  color: var(--text);
}

/* —— 右侧：头像 + 技能标签云 —— */
.hero__visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

/* 头像容器：圆形渐变描边 + 柔和投影 */
.avatar {
  position: relative;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  padding: 8px;                   /* 留出渐变描边的宽度 */
  background: var(--gradient-brand);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.4s var(--ease);
}
/* 头像整体轻微缩放的 hover 反馈 */
.avatar:hover { transform: scale(1.04) rotate(-2deg); }

.avatar__img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #FFFFFF;
}

/* 图片加载失败后显示的文字头像（被 img 覆盖，失败后才可见） */
.avatar__fallback {
  position: absolute;
  inset: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #FFFFFF;
  font-size: 72px;
  font-weight: 800;
  color: var(--color-primary);
}

/* 技能标签云 */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
/* 标签 hover：上浮并高亮 */
.tag-cloud .tag:hover {
  transform: translateY(-4px);
  background: var(--gradient-brand);
  color: #FFFFFF;
}


/* ==========================================================================
   06 通用卡片组件
   ========================================================================== */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  /* 统一的 hover 过渡：只改变 transform / box-shadow / border 三个合成层属性，性能更好 */
  transition: transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease),
              border-color var(--dur) var(--ease);
}

/* 卡片 hover：轻微上浮 + 阴影加深 + 边框主色化 */
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: rgba(79, 70, 229, 0.35);
}

.card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

/* 序号：等宽字体的灰色数字 */
.card__index {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-mute);
  font-variant-numeric: tabular-nums;
}

.card__title {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.45;
}

.card__desc {
  margin-top: 10px;
  color: var(--text-sub);
  font-size: 15px;
}

/* 卡片底部元信息（学分 / 学时） */
.card__meta {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-mute);
}
.card__meta li { position: relative; }
/* 用竖线分隔相邻元信息 */
.card__meta li + li::before {
  content: "|";
  margin-right: 8px;
  color: var(--border);
}

/* —— 状态徽章 —— */
.badge {
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
}
.badge--done   { background: rgba(16, 185, 129, 0.12); color: var(--success); }
.badge--doing  { background: rgba(245, 158, 11, 0.14); color: var(--warning); }
.badge--new    { background: rgba(79, 70, 229, 0.12);  color: var(--color-primary); }


/* ==========================================================================
   07 课程板块
   ========================================================================== */
/* 课程卡顶部加一条渐变高亮线，hover 时变长，形成细节动效 */
.course-card {
  position: relative;
  overflow: hidden;
}
.course-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--gradient-brand);
  transition: width 0.35s var(--ease);
}
.course-card:hover::before { width: 100%; }

/* 课程卡 hover 时序号变为品牌色 */
.course-card:hover .card__index { color: var(--color-primary); }


/* ==========================================================================
   08 项目板块
   ========================================================================== */
.project-card {
  display: flex;
  flex-direction: column;
  padding: 0;                     /* 让缩略图铺满卡片顶部 */
  overflow: hidden;
}

/* 卡片顶部缩略图：用渐变块代替图片，避免外部资源依赖 */
.project-card__thumb {
  height: 132px;
  display: flex;
  align-items: flex-end;
  padding: 18px 22px;
  position: relative;
}
.project-card__thumb--a { background: linear-gradient(135deg, #4F46E5, #6366F1); }
.project-card__thumb--b { background: linear-gradient(135deg, #6366F1, #06B6D4); }
.project-card__thumb--c { background: linear-gradient(135deg, #06B6D4, #10B981); }

.project-card__no {
  color: #FFFFFF;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.08em;
  opacity: 0.92;
}

.project-card__body {
  padding: 22px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;                        /* 撑满剩余高度，让按钮对齐 */
}

/* 技术栈标签组 */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* 「查看详情」文字按钮 */
.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  margin-top: auto;               /* 推到卡片底部 */
  padding: 6px 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary);
  transition: gap var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.link-btn:hover { opacity: 0.75; }

/* 箭头图标：展开时旋转 90° */
.link-btn__arrow {
  display: inline-block;
  transition: transform var(--dur) var(--ease);
}
.link-btn[aria-expanded="true"] .link-btn__arrow {
  transform: rotate(90deg);
}

/* 展开后的详情区 */
.project-card__detail {
  margin-top: 8px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  border: 1px dashed var(--border);
  font-size: 14px;
  color: var(--text-sub);
  animation: fadeSlideIn 0.3s var(--ease);   /* 展开时播放淡入上滑 */
}
.project-card__detail h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.project-card__detail h4 + p { margin-bottom: 12px; }
.project-card__detail ul { padding-left: 18px; list-style: disc; }
.project-card__detail li { margin-bottom: 2px; }


/* ==========================================================================
   09 自我评价板块
   ========================================================================== */
.eval-text { display: flex; flex-direction: column; gap: 18px; }

.eval-item {
  display: flex;
  gap: 16px;
  padding: 22px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}
.eval-item:hover {
  transform: translateX(6px);      /* 横向微移，区别于卡片的纵向微移 */
  box-shadow: var(--shadow-sm);
}

/* 圆形序号图标 */
.eval-item__icon {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-weight: 800;
  font-size: 18px;
}
.eval-item__icon--success { background: var(--success); }
.eval-item__icon--warning { background: var(--warning); }
.eval-item__icon--primary { background: var(--gradient-brand); }

.eval-item__title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 4px;
}
.eval-item p { color: var(--text-sub); font-size: 15px; }

/* —— 右栏：能力进度条 —— */
.eval-skill {
  padding: 28px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.eval-skill__title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
}

.skill-list { display: flex; flex-direction: column; gap: 18px; }

.skill__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}
.skill__value {
  color: var(--text-mute);
  font-variant-numeric: tabular-nums;   /* 数字等宽对齐 */
}

/* 进度条底槽 */
.skill__bar {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-mute);
  overflow: hidden;
}

/* 进度条填充：宽度由行内样式 --pct 决定，初始缩放为 0，
   进入视口后由 .is-visible 父级触发 0.9s 的填充动画 */
.skill__fill {
  display: block;
  width: var(--pct);
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--gradient-brand);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.9s var(--ease);
}
.is-visible .skill__fill { transform: scaleX(1); }


/* ==========================================================================
   10 页脚
   ========================================================================== */
.footer {
  background: #0F172A;
  color: #CBD5E1;
  padding: 56px 0 40px;
  text-align: center;
}
.footer__title {
  font-size: 18px;
  font-weight: 600;
  color: #FFFFFF;
}
.footer__meta { margin-top: 8px; font-size: 14px; color: #94A3B8; }
.footer__copy { margin-top: 18px; font-size: 13px; color: #64748B; }


/* ==========================================================================
   11 返回顶部按钮
   ========================================================================== */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #FFFFFF;
  background: var(--gradient-brand);
  box-shadow: var(--shadow-md);
  /* 默认隐藏：不可点击 + 透明 + 下移 10px */
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity var(--dur) var(--ease),
              transform var(--dur) var(--ease),
              visibility var(--dur) var(--ease);
}
/* JS 添加 .is-show 后淡入上滑 */
.back-to-top.is-show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}


/* ==========================================================================
   12 动画
   ========================================================================== */

/* 滚动渐显元素的初始状态：不可见 + 下移 24px */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
/* IntersectionObserver 触发后由 JS 添加 .is-visible，回到正常位置 */
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* 详情区展开时的淡入上滑动画 */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}


/* ==========================================================================
   13 响应式布局
   桌面 ≥1024px（默认） / 平板 768–1023px / 手机 <768px
   ========================================================================== */

/* —— 平板：≤1024px —— */
@media (max-width: 1024px) {
  :root { --section-gap: 76px; }     /* 缩小板块留白，提升信息密度 */

  .hero__inner {
    grid-template-columns: 1fr;       /* 单列：文字在上、头像在下 */
    gap: 40px;
  }
  .hero__visual { align-items: flex-start; }

  /* 自我评价区改为上下堆叠 */
  .grid--2 { grid-template-columns: 1fr; gap: 28px; }
}

/* —— 手机：≤767px —— */
@media (max-width: 767px) {
  :root {
    --section-gap: 56px;
    --nav-h: 60px;
  }

  .container { padding: 0 18px; }

  /* 显示汉堡按钮，隐藏横向导航链接 */
  .navbar__toggle { display: flex; }

  /* 移动端菜单：从导航栏下方展开的白色面板 */
  .navbar__menu {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px 18px 20px;
    background: #FFFFFF;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    /* 收起状态：向上隐藏，不可点击 */
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: transform var(--dur) var(--ease),
                opacity var(--dur) var(--ease),
                visibility var(--dur) var(--ease);
  }
  /* 展开状态（由 JS 切换） */
  .navbar__menu.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  .navbar__link {
    padding: 12px 14px;
    font-size: 16px;
    border-radius: var(--radius-sm);
  }

  .hero {
    padding-top: calc(var(--nav-h) + 48px);
    padding-bottom: 64px;
  }
  .avatar { width: 168px; height: 168px; }
  .avatar__fallback { font-size: 56px; }

  /* 手机上卡片内边距略减，避免内容被挤 */
  .card { padding: 22px; }
  .project-card__body { padding: 20px; }

  .hero__actions .btn { flex: 1 1 auto; }   /* 按钮均分宽度，方便单手点击 */

  .back-to-top { right: 16px; bottom: 16px; }
}


/* ==========================================================================
   14 无障碍降级
   系统开启「减少动态效果」时，关闭所有过渡与动画
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }            /* 关闭平滑滚动 */
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  /* 直接显示所有渐显元素，避免内容停留在透明状态 */
  .reveal { opacity: 1 !important; transform: none !important; }
  .skill__fill { transform: scaleX(1) !important; }
}
