:root {
  color-scheme: light;
  --bg: #f3f0e8;
  --surface: #fbfaf6;
  --surface-raised: #ffffff;
  --text: #25241f;
  --muted: #77746c;
  --line: #d9d5cb;
  --accent: #31578a;
  --accent-soft: #dfe8f3;
  --shadow: rgba(46, 42, 33, 0.12);
  --glow: rgba(49, 87, 138, 0.14);
  /* 浅色调：暖白薄雾，让插画蒙上一层柔和的暖调 */
  --bg-haze: rgba(243, 240, 232, 0.38);
  --bg-img-brightness: 0.95;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #181a1f;
  --surface: #22252b;
  --surface-raised: #292d34;
  --text: #eeeae1;
  --muted: #aaa8a1;
  --line: #3a3e46;
  --accent: #8fb3df;
  --accent-soft: #2f435b;
  --shadow: rgba(0, 0, 0, 0.32);
  --glow: rgba(143, 179, 223, 0.13);
  /* 深色调：冷暗薄雾，压暗背景以突出前景文字 */
  --bg-haze: rgba(16, 18, 24, 0.42);
  --bg-img-brightness: 0.72;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  font-family: "Noto Sans SC", Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  transition: color 240ms ease;
}

/* 主页背景：循环视频 + 虚化 + 主题色薄雾（视频本身已动态，无需额外动画） */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: blur(3px) brightness(var(--bg-img-brightness)) contrast(1.05);
  transform: scale(1.08);
}

/* 主题色薄雾覆盖层：浅/深色模式呈现不同朦胧色调 */
.bg-haze {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 50% 44%, var(--glow), transparent 28rem),
    var(--bg-haze);
  pointer-events: none;
}

/* 所有内容浮在背景之上 */
header,
main {
  position: relative;
  z-index: 1;
}

/* 单页切换：未激活的 section 隐藏 */
[data-section]:not(.is-active) {
  display: none;
}

/* section 切换时的淡入位移过渡（仅首次进入激活态时触发） */
[data-section].is-active {
  animation: section-in 380ms cubic-bezier(0, 0, 0.2, 1) both;
}

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

@media (prefers-reduced-motion: reduce) {
  [data-section].is-active {
    animation: none;
  }
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.taskbar {
  position: fixed;
  z-index: 10;
  top: 0;
  right: 0;
  left: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  height: 80px;
  padding: 0 clamp(18px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: 0 8px 26px color-mix(in srgb, var(--shadow) 45%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: background-color 240ms ease, border-color 240ms ease;
}

.theme-control {
  display: flex;
  align-self: center;
  justify-content: flex-start;
  gap: 12px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.theme-toggle__track {
  position: relative;
  display: block;
  width: 50px;
  height: 28px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--accent-soft);
  transition: background-color 240ms ease, border-color 240ms ease;
}

.theme-toggle__thumb {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-raised);
  box-shadow: 0 2px 7px var(--shadow);
  color: var(--accent);
  transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

[data-theme="dark"] .theme-toggle__thumb {
  transform: translateX(22px);
}

.icon {
  position: absolute;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  transition: opacity 180ms ease, transform 240ms ease;
}

.icon--moon,
[data-theme="dark"] .icon--sun {
  opacity: 0;
  transform: scale(0.5) rotate(30deg);
}

[data-theme="dark"] .icon--moon {
  opacity: 1;
  transform: scale(1) rotate(0);
}

.theme-toggle:focus-visible,
.folder-tab:focus-visible,
.music-toggle:focus-visible,
.music-next:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.folder-tabs {
  display: flex;
  align-items: end;
  gap: 5px;
  height: 100%;
}

.folder-tab {
  position: relative;
  display: grid;
  min-width: 92px;
  height: 48px;
  padding: 0 22px;
  place-items: center;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 11px 11px 0 0;
  background: color-mix(in srgb, var(--bg) 70%, var(--surface));
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-decoration: none;
  user-select: none;
  transform: translateY(1px);
  transition: height 180ms ease, color 180ms ease, background-color 180ms ease;
}

.folder-tab::before {
  position: absolute;
  top: -7px;
  left: 13px;
  width: 30px;
  height: 7px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  background: inherit;
  content: "";
}

.folder-tab.is-active {
  height: 56px;
  background: var(--bg);
  color: var(--text);
  font-weight: 650;
}

.folder-tab.is-active::after {
  position: absolute;
  right: 22px;
  bottom: 8px;
  left: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  content: "";
}

.folder-tab[aria-disabled="true"] {
  cursor: default;
}

.taskbar-spacer {
  min-width: 1px;
}

/* 音乐播放按钮：旋转唱片 + 中心红音符 + 关闭态斜杠 */
.music-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.music-toggle {
  position: relative;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  flex: none;
}

.vinyl {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.12) 0 30%, transparent 31%),
    repeating-radial-gradient(circle, #16171c 0 1.5px, #1f2128 1.5px 3px);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 2px 6px var(--shadow);
  animation: spin 4s linear infinite;
}

.music-toggle[data-state="off"] .vinyl {
  animation-play-state: paused;
}

.vinyl-note {
  width: 13px;
  height: 13px;
  color: #e64545;
  transition: color 180ms ease;
}

.music-toggle[data-state="off"] .vinyl-note {
  color: var(--muted);
}

.vinyl-slash {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 2px;
  border-radius: 2px;
  background: var(--muted);
  transform: translate(-50%, -50%) rotate(45deg);
  opacity: 0;
  transition: opacity 180ms ease;
}

.music-toggle[data-state="off"] .vinyl-slash {
  opacity: 1;
}

/* 手动切歌按钮：扁平双箭头「》」 */
.music-next {
  display: grid;
  place-items: center;
  width: 28px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  flex: none;
  transition: color 180ms ease;
}

.next-icon {
  width: 20px;
  height: 13px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.home {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100svh;
  padding: 116px 28px 36px;
  perspective: 1200px;
}

.portrait-wrap {
  position: relative;
  display: grid;
  place-items: center;
  animation: appear 700ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.portrait-wrap::before {
  position: absolute;
  width: min(44vw, 320px);
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--accent) 14%, transparent);
  border-radius: 50%;
  content: "";
}

.portrait-wrap::after {
  position: absolute;
  z-index: -1;
  width: min(52vw, 375px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, var(--glow), transparent 68%);
  content: "";
  filter: blur(8px);
}

.portrait-ring {
  width: clamp(160px, 20vw, 250px);
  aspect-ratio: 1;
  padding: 8px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  border-radius: 50%;
  background: var(--surface-raised);
  box-shadow:
    0 24px 60px var(--shadow),
    0 0 0 10px color-mix(in srgb, var(--surface) 74%, transparent);
  transition: background-color 240ms ease, border-color 240ms ease;
}

.portrait {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 38%;
}

/* 进场动画：淡入 + 去模糊 + 上移 + 放大 + 轻微 3D 倾斜（借鉴 awaioi.com） */
@keyframes reveal-in {
  from {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(42px) scale(0.965) rotateX(8deg);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: none;
  }
}

.reveal {
  animation: reveal-in 700ms cubic-bezier(0, 0, 0.2, 1) both;
  will-change: opacity, filter, transform;
}

/* 依次弹出：头像(0) → 格言 → 称呼 → 家乡 → 大学 → 邮箱 → GitHub */
.motto.reveal {
  animation-delay: 100ms;
}

.profile-item.reveal:nth-child(1) {
  animation-delay: 220ms;
}

.profile-item.reveal:nth-child(2) {
  animation-delay: 320ms;
}

.profile-item.reveal:nth-child(3) {
  animation-delay: 420ms;
}

.profile-item.reveal:nth-child(4) {
  animation-delay: 520ms;
}

.profile-item.reveal:nth-child(5) {
  animation-delay: 620ms;
}

/* 格言 */
.motto {
  margin: 32px 0 0;
  font-family: "Noto Serif SC", "Noto Sans SC", serif;
  font-size: clamp(1.05rem, 2.4vw, 1.4rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: center;
  color: var(--text);
}

/* 个人资料卡片 */
.profile {
  width: 100%;
  max-width: 460px;
  margin: 40px 0 0;
}

.profile-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.profile-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  align-items: baseline;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 8px 24px var(--shadow);
}

.profile-key {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.profile-val {
  font-size: 15px;
  color: var(--text);
  word-break: break-all;
  text-decoration: none;
}

a.profile-val:hover {
  color: var(--accent);
}

@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (hover: hover) {
  .folder-tab:not(.is-active):hover {
    height: 52px;
    color: var(--text);
  }

  .theme-toggle:hover {
    color: var(--text);
  }

  .music-next:hover {
    color: var(--text);
  }
}

@media (max-width: 680px) {
  .taskbar {
    grid-template-columns: auto 1fr;
    height: 72px;
    padding: 0 14px;
  }

  .theme-toggle__label,
  .taskbar-spacer {
    display: none;
  }

  .folder-tabs {
    justify-content: flex-end;
    gap: 3px;
  }

  .folder-tab {
    min-width: 64px;
    height: 43px;
    padding: 0 12px;
    font-size: 13px;
  }

  .folder-tab.is-active {
    height: 50px;
  }

  .home {
    padding-top: 100px;
    justify-content: flex-start;
  }

  .portrait-ring {
    width: min(54vw, 210px);
  }

  .music-controls {
    gap: 4px;
  }

  .music-toggle {
    width: 28px;
    height: 28px;
  }

  .vinyl-note {
    width: 11px;
    height: 11px;
  }

  .vinyl-slash {
    width: 21px;
  }

  .music-next {
    width: 24px;
    height: 30px;
  }

  .next-icon {
    width: 17px;
    height: 11px;
  }

  .bg-layer {
    filter: blur(2px) brightness(var(--bg-img-brightness));
  }

  .credit {
    font-size: 10px;
    right: 10px;
    bottom: 8px;
  }

  .achievements {
    top: 72px;
    padding: 24px 28px 48px 14px;
  }

  .timeline {
    max-width: 100%;
  }

  .tl-item {
    padding: 14px 18px;
    margin-left: 36px;
  }

  .tl-item::after {
    left: -30px;
    width: 10px;
    height: 10px;
  }

  .tl-title {
    font-size: 14px;
  }
}

/* 插画出处标注 */
.credit {
  position: fixed;
  right: 14px;
  bottom: 10px;
  z-index: 5;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
  opacity: 0.7;
  pointer-events: none;
}

/* ==================== 作品页 · 全屏 scroll-snap ==================== */
.works {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  position: fixed;
  top: 80px;
  left: 0;
  right: 0;
  bottom: 0;
}

.work-panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: start;
  scroll-snap-stop: proximity;
  height: calc(100vh - 80px);
  padding: 40px 24px;
}

/* 圆边矩形作品卡片 */
.work-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  max-width: 560px;
  padding: 40px 36px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 20px 60px var(--shadow);
  text-align: center;
  /* 入场动画：与成就页一致 */
  opacity: 0;
  filter: blur(8px);
  transform: translateY(36px) scale(0.96) rotateX(6deg);
}

/* 有背景图的卡片：背景图 + 轻遮罩，背景可见且文字清晰 */
.work-card[data-bg] {
  background: transparent;
}

.work-card[data-bg]::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--card-bg, none);
  background-size: cover;
  background-position: center;
  filter: blur(1.5px) brightness(0.72) saturate(0.95);
  transform: scale(1.05);
  z-index: 0;
}

/* 轻遮罩：仅在文字密集的顶部加深，底部完全透出背景 */
.work-card[data-bg]::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--surface) 55%, transparent) 0%,
      color-mix(in srgb, var(--surface) 30%, transparent) 40%,
      color-mix(in srgb, var(--surface) 20%, transparent) 100%);
  border-radius: inherit;
  z-index: 0;
}

/* 所有文字内容在遮罩之上 */
.work-card[data-bg] > * {
  position: relative;
  z-index: 1;
}

/* 文字对比度强化：用阴影保证在任何背景上都清晰 */
.work-card[data-bg] .work-name {
  color: var(--text);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.work-card[data-bg] .work-desc,
.work-card[data-bg] .work-extract {
  color: var(--text);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.work-card[data-bg] .work-link {
  color: var(--accent);
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.work-card[data-bg] .work-notice {
  color: var(--text);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.work-card.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: none;
  transition:
    opacity 650ms cubic-bezier(0, 0, 0.2, 1),
    filter 650ms cubic-bezier(0, 0, 0.2, 1),
    transform 650ms cubic-bezier(0, 0, 0.2, 1);
}

.work-icon {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  object-fit: cover;
  margin: 0 auto 20px;
  display: block;
  box-shadow: 0 8px 24px var(--shadow);
}

/* 圆形头像：和基础页 portrait 一致 */
.work-icon--circle {
  border-radius: 50%;
  object-position: 50% 38%;
  border: 3px solid var(--surface-raised);
}

/* 第二个作品：和基础页一样的布局，头像在顶部原尺寸 */
.work-panel--home {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  perspective: 1200px;
}

.work-panel--home .work-card {
  max-width: 460px;
}

/* 作品页顶部头像区（苿钰头像，固定在最顶上，不参与 scroll-snap） */
.works-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 30px 24px 10px;
  scroll-snap-align: start;
  flex: none;
}

.work-icon--placeholder {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent-soft), var(--surface-raised));
  color: var(--accent);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.work-name {
  margin: 0 0 14px;
  font-family: "Noto Serif SC", "Noto Sans SC", serif;
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text);
}

.work-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
  text-align: left;
}

/* 链接区 */
.work-links {
  margin: 20px 0 6px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.work-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-color 180ms ease;
}

.work-link:hover {
  border-bottom-color: var(--accent);
}

/* 应援群按钮：视觉上和链接一致 */
.work-link--btn {
  background: none;
  border: none;
  border-bottom: 1px solid transparent;
  font: inherit;
  cursor: pointer;
  padding: 0;
}

.work-link--btn:hover {
  border-bottom-color: var(--accent);
}

.work-link-sep {
  color: var(--muted);
  opacity: 0.5;
}

.work-extract {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.work-notice {
  margin: 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  opacity: 0.7;
  text-align: center;
}

@media (max-width: 680px) {
  .works {
    top: 72px;
  }

  .work-panel {
    height: calc(100vh - 72px);
    padding: 24px 16px;
  }

  .work-card {
    padding: 30px 22px;
    border-radius: 20px;
  }

  .work-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
  }

  .work-panel--home {
    gap: 20px;
  }

  .work-panel--home .work-card {
    max-width: 100%;
  }

  .works-header {
    padding: 20px 16px 8px;
  }
}

/* ==================== 成就页 · 时间线 ==================== */
.achievements {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 40px 80px 24px;
  overflow-y: auto;
  scroll-snap-type: y proximity;
  -webkit-overflow-scrolling: touch;
  position: fixed;
  top: 80px;
  left: 0;
  right: 0;
  bottom: 0;
}

.achievements .portrait-wrap {
  margin-bottom: 8px;
  animation: appear 700ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.achievements-hint {
  margin: 0 0 36px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
  opacity: 0.75;
}

/* 时间线：左侧竖线 + 节点 */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  width: 100%;
  max-width: 560px;
}

/* 竖线 */
.timeline::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--line) 8%,
    var(--line) 92%,
    transparent
  );
}

.tl-item {
  position: relative;
  margin: 0 0 20px 40px;
  padding: 18px 22px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 10px 30px var(--shadow);
  overflow: hidden;
  scroll-snap-align: center;
  /* 初始隐藏态：awaioi 同款 composite 入场 */
  opacity: 0;
  filter: blur(8px);
  transform: translateY(36px) scale(0.96) rotateX(6deg);
}

/* 时间节点圆点 */
.tl-item::after {
  content: "";
  position: absolute;
  left: -33px;
  top: 24px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--line);
  z-index: 2;
}

.tl-item.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: none;
  transition:
    opacity 650ms cubic-bezier(0, 0, 0.2, 1),
    filter 650ms cubic-bezier(0, 0, 0.2, 1),
    transform 650ms cubic-bezier(0, 0, 0.2, 1);
}

/* 卡片背景图 */
.tl-item[data-img]:not([data-img="placeholder"])::before {
  position: absolute;
  inset: 0;
  background-image: var(--tl-bg, none);
  background-size: cover;
  background-position: center;
  opacity: 0.22;
  filter: blur(2px) brightness(0.9);
  content: "";
  z-index: 0;
  transition: opacity 300ms ease;
}

.tl-item[data-img]:not([data-img="placeholder"]):hover::before {
  opacity: 0.34;
}

.tl-date {
  position: relative;
  z-index: 1;
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 4px;
}

.tl-event {
  position: relative;
  z-index: 1;
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.tl-title {
  position: relative;
  z-index: 1;
  margin: 0 0 6px;
  font-family: "Noto Serif SC", "Noto Sans SC", serif;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: var(--text);
}

.tl-desc {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.tl-desc small {
  font-size: 11px;
  opacity: 0.8;
}

/* 电脑端：双列交替时间线（zigzag），合理利用宽屏 */
@media (min-width: 880px) {
  .achievements {
    padding: 30px 40px 80px;
  }

  .timeline {
    max-width: 820px;
  }

  /* 竖线居中 */
  .timeline::before {
    left: 50%;
    margin-left: -1px;
  }

  .tl-item {
    width: 46%;
    margin: 0 0 24px 0;
  }

  /* 奇数项靠左 */
  .tl-item:nth-child(odd) {
    margin-right: auto;
  }

  /* 偶数项靠右 */
  .tl-item:nth-child(even) {
    margin-left: auto;
  }

  /* 左侧节点的圆点指向中线 */
  .tl-item:nth-child(odd)::after {
    left: auto;
    right: -33px;
  }

  .tl-item:nth-child(even)::after {
    left: -33px;
  }
}

/* QQ 群二维码弹窗 */
.qr-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
}

.qr-modal[aria-hidden="false"] {
  display: flex;
}

.qr-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.qr-modal__box {
  position: relative;
  z-index: 1;
  padding: 24px 24px 20px;
  border-radius: 18px;
  background: var(--surface-raised);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
  text-align: center;
  animation: appear 300ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.qr-modal__close {
  position: absolute;
  top: 8px;
  right: 12px;
  border: 0;
  background: none;
  font-size: 24px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  transition: color 180ms ease;
}

.qr-modal__close:hover {
  color: var(--text);
}

.qr-modal__img {
  display: block;
  width: min(70vw, 280px);
  height: auto;
  border-radius: 10px;
}

.qr-modal__hint {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--muted);
}

/* ==================== 微交互增强 ==================== */
@media (hover: hover) {
  /* 卡片 hover 轻微抬升（仅在动画完成后生效） */
  .work-card.is-visible:hover,
  .tl-item.is-visible:hover {
    transform: translateY(-4px);
    box-shadow: 0 26px 60px var(--shadow);
    transition:
      transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
      box-shadow 220ms ease;
  }

  /* 链接下划线动画 */
  .work-link {
    position: relative;
  }

  .work-link::after {
    position: absolute;
    right: 0;
    bottom: -2px;
    left: 0;
    height: 1px;
    background: currentColor;
    content: "";
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .work-link:hover::after {
    transform: scaleX(1);
    transform-origin: left;
  }
}

/* 自定义选区颜色 */
::selection {
  background: color-mix(in srgb, var(--accent) 28%, transparent);
  color: var(--text);
}

/* 自定义滚动条（仅在支持细滚动条的桌面环境生效，不影响触屏） */
@media (hover: hover) and (pointer: fine) {
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
  }

  *::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }

  *::-webkit-scrollbar-thumb {
    border-radius: 8px;
    background: var(--line);
  }

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
}
