/* ============================================================
   styles.css — 布局 / 组件 / 响应式
   PC 1440 为基准 1:1 还原；断点 1200 · 900 · 720 · 600。
   ============================================================ */

/* ---------------- reset ---------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-body);
  font-family: var(--font-cjk);
  overflow-x: clip;              /* 兜底裁掉意外横向溢出；用 clip 不创建滚动容器，不影响 window 纵向滚动/scroll-spy */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--text-display); outline-offset: 3px; border-radius: 2px; }

/* ---------------- 滚动条 ----------------
   文档(主页)滚动条隐藏 → 零占宽 + 满出血无 5px 偏差，改用 JS 悬浮自定义条；
   内部滚动面板(详情 Sheet / AI)仍保留细、克制的原生滚动条（占的是面板内的宽，不影响主页）。 */
html { scrollbar-width: none; }                              /* Firefox：隐藏文档条 */
html::-webkit-scrollbar { display: none; width: 0; }         /* WebKit：隐藏文档条（零占宽） */
.modal-sheet, .ai-scroll { scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb) transparent; }
.modal-sheet::-webkit-scrollbar, .ai-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.modal-sheet::-webkit-scrollbar-track, .ai-scroll::-webkit-scrollbar-track { background: transparent; }
.modal-sheet::-webkit-scrollbar-thumb, .ai-scroll::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box;
}
.modal-sheet::-webkit-scrollbar-thumb:hover, .ai-scroll::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); background-clip: padding-box; }

/* 主页悬浮滚动条（JS 注入；浮在内容上、零占宽；随 AI 挤推一起左移；仅鼠标设备） */
.oscroll {
  position: fixed; top: 0; right: var(--ai-w); width: 12px; height: 100vh; height: 100dvh;
  z-index: 90; pointer-events: none;
}
.oscroll-thumb {
  position: absolute; top: 0; right: 2px; width: 6px; min-height: 32px;
  border-radius: 999px; background: var(--scrollbar-thumb);
  pointer-events: auto; cursor: default; transition: background .2s ease;
}
.oscroll-thumb:hover, .oscroll.dragging .oscroll-thumb { background: var(--scrollbar-thumb-hover); }
@media (hover: none) { .oscroll { display: none; } }

/* ---------------- 整体骨架 ---------------- */
.layout { min-height: 100vh; }
/* AI 面板挤推：开时给 --ai-w 赋值，内容与轮播经 --vw 平滑让位（@property 动画驱动） */
html { transition: --ai-w .42s cubic-bezier(.22, .61, .36, 1); }
html.ai-open { --ai-w: var(--ai-panel-w); }

/* ---------------- 左侧栏（桌面固定 300，含品牌 / 导航 / 主题键） ---------------- */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-w); height: 100vh;
  padding: 80px 40px;
  display: flex; flex-direction: column; gap: 48px;
  z-index: 50;
  background: var(--glass-bg);                              /* 深色毛玻璃面板：满出血大图从底下滑过 */
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  backdrop-filter: blur(24px) saturate(1.4);
}
.brand { display: flex; flex-direction: column; gap: 6px; }
.brand-name {
  font-family: var(--font-cjk); font-weight: 500; font-size: var(--fs-name);
  line-height: 1.4; letter-spacing: .2px; color: var(--text-name);
}
.brand-sub {
  font-weight: 400; font-size: var(--fs-sub); line-height: 1.5;
  color: var(--text-subtle); white-space: nowrap;   /* 职位保持单行（侧栏 240 宽足够容下，落在右侧 padding 内不溢出） */
}
.nav { display: flex; flex-direction: column; gap: 8px; }
.nav-link {
  font-weight: 500; font-size: var(--fs-nav); line-height: 1.4;
  letter-spacing: .16px; color: var(--text-nav-dim);
  width: max-content; transition: color .2s ease;
}
.nav-link.active { color: var(--text-nav); }
.nav-link:hover { color: var(--text-nav); }

/* 主题切换图标（深色态显示太阳→点切浅色；浅色态显示月亮→点切深色） */
.toggle {
  background: none; border: 0; padding: 0; cursor: pointer; line-height: 0;
  color: var(--text-contact);
  display: inline-flex; align-items: center; justify-content: center;
  transition: color .2s ease;
}
.toggle:hover { color: var(--text-strong); }   /* 深色态悬停 = 纯白；浅色态 = 最深墨 */
.toggle svg { width: 20px; height: 20px; display: block; }
.toggle .icon-moon { display: none; }
[data-theme="light"] .toggle .icon-sun { display: none; }
[data-theme="light"] .toggle .icon-moon { display: block; }

/* ---------------- 主区 ---------------- */
.main {
  margin-left: var(--sidebar-w);
  margin-right: var(--ai-w);                 /* AI 开时右侧让位给面板（随 --ai-w 平滑） */
  padding: 80px var(--main-pad-x);
  display: flex; flex-direction: column; gap: var(--gap-section);
}
.section { width: 100%; max-width: var(--content-w); margin-inline: auto; }
/* 「简介 → Sider 项目」这一段单独收到 120（150−30）；其余区块仍 150。仅桌面，≤899 各区块间距已另行收窄 */
@media (min-width: 900px) {
  .featured { margin-top: -30px; }
}

/* ① 简介 */
.intro { display: flex; flex-direction: column; gap: 28px; }
.intro-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.hero {
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-hero);
  line-height: .8; color: var(--text-display); white-space: nowrap;
}
.hero-mark {
  font-family: var(--font-display); font-weight: 400; font-size: var(--fs-mark);
  line-height: 1; color: var(--text-strong); margin-top: .15em;
}
.pitch {
  font-weight: 400; font-size: var(--fs-body); line-height: 1.5;
  color: var(--text-body); max-width: 720px;
}

/* 首屏内容渐入：加载后按序「淡入 + 轻微上移」（Portfolio → 简介 → 问问AI → Sider 项目）。
   fill-mode backwards：延迟期间先停在起始态（隐身），错峰才成立、也不闪。 */
@keyframes intro-rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero, .pitch, .ai-btn, .featured {
  animation: intro-rise .7s cubic-bezier(.22, .61, .36, 1) backwards;
}
.pitch    { animation-delay: .14s; }
.ai-btn   { animation-delay: .28s; }
.featured { animation-delay: .42s; }
@media (prefers-reduced-motion: reduce) {
  .hero, .pitch, .ai-btn, .featured { animation: none; }
}

/* ② 重点项目：Sider AI 满出血轮播（图片铺到屏幕边、钻到毛玻璃导航下；箭头在标题行右下角） */
.fc {
  position: relative;
  width: var(--vw);                                /* 满出血到「内容可用宽」右缘：AI 开时让位给面板 */
  margin-left: calc(-1 * var(--content-left));     /* 左缘推到屏幕边(钻导航下) */
}
.fc-viewport { overflow: hidden; }
/* 右缘渐变蒙层：只盖「内容栏右缘 → 屏幕边」这段露边区，把露出的下一张柔和淡出到背景；
   宽度=露边区宽度（屏宽 - 内容左缘 - 图宽），所以当前满栏大图本体完全不被淡化、保持清晰。
   pointer-events:none 不挡拖拽/点按；两端同色仅变 alpha，浅色态无发灰。 */
.fc::after {
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: var(--fade-w);
  /* 起始/终点色 = 底色按各自 alpha 取透明度（都和 --bg-fade 同色相混，浅色态不发灰） */
  background: linear-gradient(to right,
    color-mix(in srgb, var(--bg) var(--fade-start-alpha), var(--bg-fade)) var(--fade-soft),
    color-mix(in srgb, var(--bg) var(--fade-end-alpha), var(--bg-fade)));
  pointer-events: none;
}
.fc-track {
  display: flex; gap: 16px;
  padding-left: var(--content-left);   /* 首图对齐内容栏左缘（与 Portfolio/简介 同一条线） */
  transform: translate3d(var(--fc-x, 0), 0, 0);
  transition: transform .6s cubic-bezier(.22, .61, .36, 1);
  touch-action: pan-y; will-change: transform;
}
.fc-slide {
  flex: 0 0 auto;
  width: var(--fc-slide-w); aspect-ratio: 16 / 9;   /* 单张 = 内容栏宽、16:9；铺满内容栏，右侧仅薄薄露下一张 */
  border-radius: 8px; overflow: hidden; background: var(--placeholder);
}
.fc-slide img { width: 100%; height: 100%; object-fit: cover; }

/* 标题行：左=标题+描述（留在内容栏）/ 右=切换按钮（实心圆） */
.fc-caption {
  margin-top: 24px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 24px;
}
.fc-text { display: flex; flex-direction: column; gap: 8px; }
.fc-title {
  font-weight: 500; font-size: 24px; line-height: 1.5;   /* 设计稿 11:5：24px Medium */
  color: var(--text-strong);
}
.fc-desc {
  font-weight: 400; font-size: 16px; line-height: 1.5;   /* 设计稿 11:5：16px Regular，白 84% */
  color: var(--text-body); max-width: 720px;
}
.ph-note { color: var(--text-subtle); font-size: .8em; }
.fc-nav { display: flex; gap: 16px; flex-shrink: 0; margin-top: 30px; }
.fc-arrow {
  width: 40px; height: 40px; border-radius: 999px; flex: 0 0 auto;
  display: grid; place-items: center; cursor: pointer; border: 0;
  background: var(--arrow-btn-bg); color: var(--arrow-btn-fg);
  transition: background .2s ease, opacity .2s ease, transform .15s ease;
}
.fc-arrow svg { width: 20px; height: 20px; }
.fc-arrow:hover { background: var(--arrow-btn-bg-hover); }
.fc-arrow:active { transform: scale(.94); }
.fc-arrow[disabled] { opacity: .35; pointer-events: none; }

/* ③ Before 2024 网格 */
.before { display: flex; flex-direction: column; gap: 24px; }
.h2 {
  font-family: var(--font-display); font-weight: 700; font-size: var(--fs-h2);
  line-height: .8; color: var(--text-display);
}
.work-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  column-gap: 16px; row-gap: 32px;
}
.work-card { display: flex; flex-direction: column; gap: 16px; }
.work-thumb {
  aspect-ratio: 514 / 289; border-radius: 8px; overflow: hidden;
  background: var(--placeholder);
}
.work-thumb img { width: 100%; height: 100%; object-fit: cover; }
.work-text { display: flex; flex-direction: column; gap: 4px; }
.work-title {
  font-weight: 500; font-size: var(--fs-card-title); line-height: 1.5;
  color: var(--text-strong);
}
.work-desc {
  font-weight: 400; font-size: var(--fs-card-desc); line-height: 1.5;
  color: var(--text-body);
}
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-flex; align-items: center; height: 32px; padding: 0 16px;
  border-radius: 999px; background: var(--chip-bg); color: var(--chip-text);
  font-size: var(--fs-card-desc); line-height: 1.5;
}

/* ④ 关于我 */
.about { display: flex; flex-direction: column; gap: 36px; }
/* 顶部：姓名标题 + 学历 meta 行（设计稿 2:115：标题 32px Semibold 暖白；meta 20px 白40%，1×24 竖线 16% 分隔） */
.about-head { display: flex; flex-direction: column; gap: 24px; }
.about-name {
  font-family: var(--font-cjk); font-weight: 600; font-size: var(--fs-h2);
  line-height: 1; color: var(--text-display);
}
.about-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.about-meta span:not(.meta-sep) {
  font-size: 16px; line-height: 1.5; color: var(--text-subtle);   /* 走透明阶梯 token（深 .50 / 浅 .64），过 WCAG AA；原硬编码 .4 在浅色仅 2.5:1 不达标 */
}
.meta-sep { flex: 0 0 auto; width: 1px; height: 24px; background: rgba(var(--ink-pure), .16); }
.about-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; column-gap: 40px; align-items: start;
}
.about-col { display: flex; flex-direction: column; gap: 36px; }
.about-p {
  font-weight: 400; font-size: 16px; line-height: 1.5;
  color: var(--text-body); max-width: 517px;
}
/* 简介：5 条带粗体标签的要点（设计稿 89:25：16px/1.5，标签白 100% Medium、描述白 84%） */
.about-intro { display: flex; flex-direction: column; gap: 8px; max-width: 768px; }
.about-intro .about-p { max-width: none; }
.about-k { font-weight: 500; color: var(--text-strong); }   /* PingFang Medium，贴设计稿 */
.about-aside { display: flex; }
.about-photo {
  width: 279px; height: 450px; max-width: 100%;
  object-fit: cover; background: var(--placeholder);   /* 照片填满、居中裁切 */
}

/* 数据区（10年+工作经验 / 20+项目经验）：横向 2 格、值大标签小 */
.about-stats { display: flex; flex-wrap: wrap; gap: 22px 48px; list-style: none; }
.about-stat { display: flex; flex-direction: column; gap: 6px; }
.stat-num {
  font-family: var(--font-display);
  font-weight: 600; font-size: clamp(24px, 2.4vw, 28px); line-height: 1;
  color: var(--text-display); letter-spacing: -.01em;
}
.stat-label { font-size: var(--fs-sm); line-height: 1.4; color: var(--text-subtle); }

/* 时间轴 */
.timeline-block { display: flex; flex-direction: column; gap: 16px; }
.timeline-label {
  font-size: var(--fs-xs); line-height: 1.4; letter-spacing: 2.16px;
  color: var(--text-subtle);
}
.timeline { display: flex; flex-direction: column; }
.tl-row {
  display: flex; align-items: center; gap: 24px; height: 58px;
  border-top: 1px solid var(--border);
}
.tl-row:last-child { border-bottom: 1px solid var(--border); }
.tl-year {
  flex: 0 0 auto; min-width: 80px;
  font-weight: 500; font-size: var(--fs-sm); line-height: 1.4; letter-spacing: .52px;
  color: var(--text-subtle);
}
.tl-role {
  font-weight: 400; font-size: var(--fs-role); line-height: 1.4;
  color: var(--text-role);
}

/* ---------------- 联系（桌面贴左下角，窄屏落页面底部） ---------------- */
.site-footer {
  position: fixed; left: 0; bottom: 0; width: var(--sidebar-w); z-index: 60;
  padding: 0 40px 80px; display: flex; flex-direction: column; gap: 20px; align-items: flex-start;
}
.contact { display: flex; flex-direction: column; gap: 12px; }
.contact-label {
  font-size: var(--fs-sm); line-height: 1.45; letter-spacing: .13px;
  color: var(--text-contact);
}

/* Contact 图标按钮（微信 / 邮箱 / 电话）：悬停上方浮窗，深浅自适应（设计稿 2:187） */
.contact-btns { display: flex; gap: 8px; }
.cbtn-wrap { position: relative; display: flex; }
.cbtn {
  width: 32px; height: 32px; flex: 0 0 auto; display: grid; place-items: center;
  padding: 0; cursor: pointer; border: 1px solid rgba(var(--ink-pure), .16);
  border-radius: 8px; background: transparent; color: var(--text-contact);
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.cbtn:hover, .cbtn:focus-visible { color: var(--text-strong); border-color: rgba(var(--ink-pure), .32); background: var(--chip-bg); }
.cbtn svg { width: 14px; height: 14px; display: block; }   /* 邮箱/电话：线性图标缩到 14 */
.cbtn .ico-wechat { width: 16px; height: 16px; }           /* 微信：笔画细，保持 16，三者视觉等大 */

/* 浮窗：贴住按钮顶（无 hover 死区，padding 当透明桥），由下微升淡入 */
.cpop {
  position: absolute; left: 0; bottom: 100%; padding-bottom: 10px;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(4px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
  z-index: 70;
}
.cbtn-wrap:hover .cpop, .cbtn-wrap:focus-within .cpop {
  opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0);
}
.cpop-card {
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  padding: 8px 10px;
}
.cpop-text {
  font-size: var(--fs-sm); line-height: 1.2; color: var(--text-body);
  font-variant-numeric: tabular-nums; letter-spacing: .2px;
}
.cpop-copy {
  flex: 0 0 auto; width: 24px; height: 24px; display: grid; place-items: center;
  padding: 0; cursor: pointer; border: 0; border-radius: 6px;
  background: transparent; color: var(--text-subtle);
  transition: color .2s ease, background .2s ease;
}
.cpop-copy:hover { color: var(--text-strong); background: var(--chip-bg); }
.cpop-copy svg { width: 15px; height: 15px; display: block; }
.cpop-copy .ico-check { display: none; }
.cpop-copy.copied .ico-copy { display: none; }
.cpop-copy.copied .ico-check { display: block; color: #2ea043; }   /* 复制成功反馈（绿勾） */
/* 微信二维码浮窗：QR 始终白底（保证可扫），外层卡片随主题 */
.cpop-qr .cpop-card { padding: 8px; }
.qr-box { display: grid; place-items: center; width: 140px; height: 140px; background: #fff; border-radius: 6px; }   /* 固定正方，QR 居中 */
.qr-box img { width: 124px; height: 124px; max-width: none; display: block; }   /* max-width:none 破掉全局 img{max-width:100%}，避免 SVG 在收缩容器里被压成 0 宽 */

/* ============================================================
   响应式
   ============================================================ */

/* ≥1200 基准：内容宽流体但不超 1044（已由 .section max-width 处理） */
@media (max-width: 1199px) {
  :root { --gap-section: 96px; --main-pad-x: 40px; }   /* 侧栏宽度沿用基准 240，不再于中屏收窄 */
  .sidebar { padding: 56px 32px; gap: 40px; }
  .main { padding: 56px var(--main-pad-x); }
  .site-footer { padding: 0 32px 56px; }
}

/* 600–899：侧栏 → sticky 顶栏，主区单列 */
@media (max-width: 899px) {
  :root {
    --gap-section: 80px; --main-pad-x: 32px; --content-left: var(--main-pad-x);
    --fc-slide-w: min(var(--content-w), 100vw - 2 * var(--main-pad-x));   /* 顶栏布局：主区满宽，不减侧栏 */
  }
  .sidebar {
    position: sticky; top: 0; left: auto; height: auto; width: 100%;
    flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 12px;
    padding: 12px 18px;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
  }
  .brand { flex: 0 1 auto; min-width: 0; }
  .brand-sub { display: none; }
  .brand-emoji { display: none; }                 /* 窄屏腾空间，名字独占更清爽 */
  .brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nav { flex: 0 0 auto; flex-direction: row; gap: 16px; margin-left: auto; }
  .main { margin-left: 0; padding: 40px var(--main-pad-x); }
  .section { scroll-margin-top: calc(var(--topbar-h, 60px) + 16px); }
  .site-footer { position: static; width: 100%; padding: 56px 32px; }
  .about-grid { grid-template-columns: 1fr; row-gap: 32px; }
  .about-photo {
    width: 100%; max-width: 320px; height: auto; aspect-ratio: 279 / 450;
    margin-inline: auto;
  }
}

/* ≤720：网格降为单列 */
@media (max-width: 720px) { .work-grid { grid-template-columns: 1fr; row-gap: 24px; } }

/* <600：手机，轮播取消 peek（一次一张 + 滑动 + 圆点），导航横向可滚动 */
@media (max-width: 599px) {
  :root { --gap-section: 64px; --fs-body: 16px; --main-pad-x: 22px; }
  .main { padding: 32px var(--main-pad-x); }
  .sidebar { padding: 12px 14px; gap: 10px; }
  .nav { gap: 14px; }
  .hero-mark { margin-top: .25em; }
  .about-stats { gap: 20px 28px; }
  .about-meta { gap: 12px; }                                  /* 窄屏收紧，让学历 meta 行不换行 */
}

/* ============================================================
   项目详情弹窗（底部上滑 Sheet，铺满到顶）
   点项目卡 → scrim 淡入 + Sheet 由下上滑铺满全屏；内部可滚；关闭键悬浮在抽屉右上角。
   ============================================================ */
.modal {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;   /* 高于 sidebar 50 / footer 60 */
  right: var(--ai-w);                               /* 右缘停在 AI 面板左侧，二者并排不重叠（面板开时随 --ai-w 平滑） */
  background: var(--scrim);
  -webkit-backdrop-filter: blur(8px);               /* 入场动画期间柔化露出的页面 */
  backdrop-filter: blur(8px);
  opacity: 0; transition: opacity .3s ease;
}
.modal.is-open { opacity: 1; }
.modal[hidden] { display: none; }

/* 抽屉铺满到顶，内部纵向滚，由下上滑入场 */
.modal-sheet {
  position: absolute; inset: 0; overflow-y: auto;
  background: var(--surface);
  padding: 0 40px;
  transform: translateY(100%);
  transition: transform .42s cubic-bezier(.22, .61, .36, 1);
  -webkit-overflow-scrolling: touch;
}
.modal.is-open .modal-sheet { transform: translateY(0); }

/* 关闭键：悬浮圆钮，常驻抽屉右上角、浮在滚动内容之上；磨砂底保证压在图上也清晰 */
.modal-close {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: var(--text-display); cursor: pointer;       /* 主题自适应：深=暖白 / 浅=暖墨 */
  display: grid; place-items: center;
  transition: background .2s ease, transform .15s ease;
}
.modal-close:hover { background: var(--surface); }
.modal-close:active { transform: scale(.92); }
.modal-close svg { width: 20px; height: 20px; }

.modal-inner {
  max-width: 1360px; margin-inline: auto;
  padding: 56px 0 64px;                 /* 顶部留白让首行内容避开右上角悬浮关闭键 */
  display: flex; flex-direction: column; gap: 64px;
}

/* 文字块：标签 + 标题 + 描述 */
.modal-text { display: flex; flex-direction: column; gap: 24px; }   /* 全宽：标题行铺满到内容区右缘，「问问 AI」按钮靠右与图片右缘对齐；正文另行限宽 */
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-tag {
  display: inline-flex; align-items: center;
  border: 1px solid var(--detail-tag-border); border-radius: 999px;
  padding: 3px 12px; background: transparent;
  font-size: 12px; line-height: 1.5; color: var(--text-body);
}
.detail-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(32px, 5vw, 48px); line-height: .8; color: var(--text-display);
}
/* 详情标题行：标题左、「问问 AI」按钮右；窄屏自动换行（按钮落到标题下） */
.detail-title-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px 20px; }
.detail-ai-btn {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border: 1px solid var(--border); border-radius: 999px;
  background: transparent; cursor: pointer; white-space: nowrap;
  font-family: var(--font-cjk); font-size: 14px; font-weight: 500; line-height: 1; color: var(--text-strong);
  transition: background-color .2s ease, border-color .2s ease;
}
.detail-ai-btn .ai-star { width: 14px; height: 14px; color: currentColor; transition: transform .4s ease; }
.detail-ai-btn:hover { background: rgba(var(--ink-pure), .05); border-color: rgba(var(--ink-pure), .22); }
.detail-ai-btn:hover .ai-star { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { .detail-ai-btn .ai-star { transition: none; } }
.detail-desc { font-weight: 400; font-size: 16px; line-height: 1.5; color: var(--text-body); max-width: 768px; }

/* 图片：满宽纵向堆叠（Behance 式连续浏览），gap 0、无描边、严丝相接。
   懒加载：每张 .fig 有轻量骨架底 + 尺寸占位（防跳动、让 loading=lazy 真正生效）；图载入后淡入。 */
.modal-figures { display: flex; flex-direction: column; gap: 0; }
.modal-figures .fig {
  background: rgba(var(--ink-pure), .05);   /* 骨架底：深浅自适应、克制 */
  overflow: hidden; line-height: 0;
}
.modal-figures .fig img,
.modal-figures .fig video {
  width: 100%; height: auto; display: block;
  opacity: 1; transition: opacity .45s ease;   /* 默认可见：JS 没跑也不会隐身 */
}
.modal-figures .fig video { background: #000; }
.modal-figures .fig img.preload,
.modal-figures .fig video.preload { opacity: 0; }   /* JS 给「未就绪」的媒体加上→载入后移除即淡入 */

/* 卡片可点交互态：保持默认黑箭头（点击感由「查看详情」气泡传达） */
.work-card { cursor: default; }
.fc-slide { cursor: default; }

/* 光标气泡：悬停可点项目时跟随光标右下角浮出「查看详情」（Figma 式；蓝、全圆角，光标本身不变） */
.cursor-bubble {
  position: fixed; top: 0; left: 0; z-index: 200;       /* 高于一切；仅 JS 在可点项目上才显示 */
  translate: calc(var(--cx, -200px) + 12px) calc(var(--cy, -200px) + 16px);   /* 跟随光标、落到右下角，瞬时无延迟 */
  padding: 6px 14px; border-radius: 999px;              /* 全圆角胶囊 */
  background: var(--cursor-bubble-bg); color: #fff;
  font-family: var(--font-cjk); font-size: 13px; font-weight: 500; line-height: 1;
  white-space: nowrap; pointer-events: none;
  box-shadow: 0 4px 14px rgba(37, 99, 235, .35);
  opacity: 0; scale: .8; transform-origin: left center;
  transition: opacity .14s ease, scale .14s ease;       /* 只过渡显隐/缩放，位置瞬时跟随 */
  will-change: translate;
}
.cursor-bubble.show { opacity: 1; scale: 1; }
@media (hover: none) { .cursor-bubble { display: none; } }   /* 触屏无悬停，不出现 */

/* 弹窗响应式（复用页面断点尺度） */
@media (max-width: 899px) {
  .modal-sheet { padding: 0 24px; }
  .modal-inner { padding: 52px 0 48px; gap: 40px; }   /* 顶部留白避开悬浮关闭键 */
  .modal-text { max-width: 100%; }
}
@media (max-width: 599px) {
  .modal-sheet { padding: 0 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .modal, .modal-sheet { transition: opacity .3s ease; }
  .modal-sheet { transform: none; }           /* 不滑动，仅随 scrim 淡入 */
  .work-thumb img { transition: none; }
  .modal-figures .fig img,
  .modal-figures .fig video { transition: none; }   /* 详情媒体直接显示，不淡入 */
}

/* ============================================================
   问问 AI · 触发按钮 + 右侧「挤推」式对话面板（UI 外壳，ChatGPT 风格·极简）
   桌面：面板把内容挤向左（--ai-w/--vw 驱动）；窄屏：全屏覆盖。无 scrim，单色克制。
   ============================================================ */
/* 触发按钮（替代 ·2026）：无描边、单色星 */
.ai-btn {
  display: inline-flex; align-items: center; gap: 6px; margin-top: .5em;
  padding: 0; border: 0; background: transparent; cursor: pointer;
  font-family: var(--font-cjk); font-size: 16px; font-weight: 500; line-height: 1; white-space: nowrap;
  color: var(--text-strong);                 /* 纯白(深)/近纯黑(浅)，不发灰 */
}
.ai-btn .ai-star { width: 18px; height: 18px; color: currentColor; transition: transform .4s ease; }
.ai-btn:hover .ai-star { transform: rotate(90deg); }

/* 面板：挤推式侧栏（桌面），窄屏全屏 */
.ai-panel {
  position: fixed; top: 0; right: 0; z-index: 160;
  width: var(--ai-panel-w); height: 100vh; height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--bg); border-left: 1px solid var(--border);   /* 底色与主界面一致 */
  transform: translateX(100%);
  transition: transform .42s cubic-bezier(.22, .61, .36, 1);
  will-change: transform;
}
html.ai-open .ai-panel { transform: translateX(0); }
.ai-panel[hidden] { display: none; }

/* 头部：极简 */
.ai-head {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
  padding: 16px 12px 16px 20px;
}
.ai-title {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-cjk); font-size: 15px; font-weight: 600; color: var(--text-display);
}
.ai-title .ai-star { width: 16px; height: 16px; color: currentColor; }
.ai-head-actions { display: flex; gap: 2px; }
.ai-icon-btn {
  width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent;
  color: var(--text-subtle); cursor: pointer; display: grid; place-items: center;
  transition: background .2s ease, color .2s ease;
}
.ai-icon-btn:hover { background: rgba(var(--ink-pure), .07); color: var(--text-display); }
.ai-icon-btn svg { width: 18px; height: 18px; }

/* 消息区：用户=克制灰气泡(右)，助手=纯文本(左)，无强调色 */
.ai-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; padding: 12px 20px 8px; }
.ai-messages { display: flex; flex-direction: column; gap: 22px; }
.ai-msg { font-size: 15px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.ai-msg.user {
  align-self: flex-end; max-width: 84%;
  background: rgba(var(--ink-pure), .07); color: var(--text-display);
  padding: 9px 15px; border-radius: 18px;
}
.ai-msg.bot { align-self: stretch; color: var(--text-body); white-space: normal; }   /* 结构靠 markdown 标签，不再依赖 pre-wrap */
/* 助手气泡里的 markdown 渲染元素 */
.ai-msg.bot strong { font-weight: 600; color: var(--text-display); }
.ai-msg.bot em { font-style: italic; }
.ai-msg.bot ul, .ai-msg.bot ol { margin: 6px 0; padding-left: 1.4em; }
.ai-msg.bot li { margin: 3px 0; }
.ai-msg.bot li::marker { color: var(--text-subtle); }
.ai-msg.bot code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; background: rgba(var(--ink-pure), .08); padding: 1px 5px; border-radius: 5px; }
.ai-msg.bot .ai-caret { display: inline-block; width: 7px; height: 15px; vertical-align: -2px; margin-left: 2px; border-radius: 1px; background: currentColor; animation: ai-blink 1.1s steps(2) infinite; }
@keyframes ai-blink { 50% { opacity: 0; } }

/* 空态：开场白 + 推荐问题（可点行，悬停底纹） */
.ai-empty { margin-top: auto; padding: 24px 0 8px; }
.ai-empty.hide { display: none; }
.ai-greet { font-family: var(--font-cjk); font-size: 18px; font-weight: 600; color: var(--text-display); margin-bottom: 14px; }
.ai-suggest { display: flex; flex-direction: column; gap: 2px; margin: 0 -12px; }
.ai-chip {
  display: block; width: 100%; text-align: left;
  padding: 11px 12px; border: 0; border-radius: 10px; background: transparent; cursor: pointer;
  font-family: var(--font-cjk); font-size: 14px; line-height: 1.4; color: var(--text-body);
  transition: background .15s ease;
}
.ai-chip:hover { background: rgba(var(--ink-pure), .05); }

/* 输入：圆角框内嵌发送（单色发送键，ChatGPT 式） */
.ai-input { flex: 0 0 auto; padding: 8px 16px 18px; }
.ai-input-box {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 5px 5px 16px; border: 1px solid var(--border); border-radius: 24px;
  background: rgba(var(--ink-pure), .04); transition: border-color .2s ease;   /* 面板=主底色，输入框微提一档以区分 */
}
.ai-input-box:focus-within { border-color: rgba(var(--ink-pure), .28); }
.ai-field {
  flex: 1 1 auto; min-width: 0; border: 0; background: transparent;
  padding: 7px 0; font-family: var(--font-cjk); font-size: 15px; line-height: 1.4; color: var(--text-body);
}
.ai-field::placeholder { color: var(--text-subtle); }
.ai-field:focus { outline: none; }
.ai-send {
  flex: 0 0 auto; width: 34px; height: 34px; border: 0; border-radius: 999px;
  background: var(--text-display); color: var(--bg); cursor: pointer;
  display: grid; place-items: center; transition: opacity .2s ease;
}
.ai-send:hover { opacity: .85; }
.ai-send svg { width: 17px; height: 17px; }
.ai-send:disabled { opacity: .25; cursor: default; }

/* 窄屏：全屏覆盖，不挤推 */
@media (max-width: 899px) {
  html.ai-open { --ai-w: 0px; }
  .ai-panel { width: 100vw; border-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html, .ai-panel { transition: none; }
  .ai-btn .ai-star { transition: none; }
}

/* ============================================================
   Sider 动态封面（轮播首屏 + 详情首图，共用一个 live 实例，见 cover.js）
   紫色流动渐变(WebGL) + 标语/Logo 渐现→上移渐隐 循环(纯 CSS)。
   两处都靠父级 overflow:hidden 裁角；字号/Logo 用容器单位随封面宽自适应。
   ============================================================ */
.sider-cover {
  position: relative; width: 100%; height: 100%;
  overflow: hidden; container-type: inline-size; isolation: isolate;
  background: var(--cover-fallback);  /* WebGL 未就绪/不支持/reduced-motion 的静态兜底 */
}
.sider-cover-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.sider-cover-bg canvas { display: block; width: 100% !important; height: 100% !important; }

.sider-cover-stage {
  position: absolute; inset: 0; z-index: 1;
  display: grid; place-items: center; padding: 4cqw;
  pointer-events: none;   /* 点击穿透到下层：轮播首屏点按可打开详情 */
}
.sider-cover .cover-phrase,
.sider-cover img.cover-logo { grid-area: 1 / 1; }
.sider-cover .cover-phrase {
  margin: 0; text-align: center; white-space: nowrap; color: #fff;
  font-family: "DM Sans", var(--font-display); font-weight: 600;
  line-height: 1.1; letter-spacing: -.01em;
  font-size: 48px; font-size: 5.2cqw;     /* 48px 为不支持容器单位的兜底；5.2cqw = 设计稿 100/1920 */
}
.sider-cover .cover-phrase .cw { display: inline-block; will-change: transform, opacity; }   /* 逐词出现：每个词单独动 */
.sider-cover img.cover-logo { will-change: transform, opacity; }
.sider-cover img.cover-logo {
  width: 208px; width: 20.8cqw; height: auto; max-width: none; object-fit: contain;   /* = 设计稿 400/1920；压过 .fc-slide img 的铺满规则 */
}

/* 两态循环 8s：渐现(≈0.72s)→停留(≈2.6s)→上移渐隐(≈0.72s)；标语先、Logo 延迟半程交替 */
@keyframes cover-cycle {
  0%   { opacity: 0; transform: translateY(22px); }
  9%   { opacity: 1; transform: translateY(0); }
  41%  { opacity: 1; transform: translateY(0); }
  50%  { opacity: 0; transform: translateY(-22px); }
  100% { opacity: 0; transform: translateY(-22px); }
}
/* 逐词错峰：3 个词依次上移渐显（纯 opacity/transform，无模糊，成本极低）；退场同样错峰。
   全体 +0.5s 起始延迟 = 首次出现前先空半秒（infinite 的 delay 仅作用于第 1 轮，循环节奏不变） */
.sider-cover .cover-phrase .cw              { animation: cover-cycle 8s cubic-bezier(.33, 0, .2, 1) infinite both; animation-delay: .5s; }
.sider-cover .cover-phrase .cw:nth-child(2) { animation-delay: .63s; }
.sider-cover .cover-phrase .cw:nth-child(3) { animation-delay: .76s; }
.sider-cover img.cover-logo                 { animation: cover-cycle 8s cubic-bezier(.33, 0, .2, 1) infinite both; animation-delay: 4.5s; }

/* 详情首图槽：16:9，与其它详情图同款 1px 描边 */
.detail-cover {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  overflow: hidden; line-height: 0;
  background: var(--cover-fallback);   /* 封面搬走的空档垫紫底，不露暗面 */
}

/* 智能助手动效槽（详情页第 5 张位置）：与轮播第三屏同比 16:9、同白底；live 助手搬进来铺满 */
.detail-assistant {
  width: 100%; aspect-ratio: 16 / 9;
  overflow: hidden; line-height: 0;
  background: #fff;   /* 助手未搬入时垫白底，与组件白底一致、不露面板灰 */
}

/* 仅供截图阅读器的隐藏文本（视觉隐藏，不占位） */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* 跳到主内容：键盘 Tab 第一站，平时藏起、聚焦时才滑出（WCAG 2.4.1） */
.skip-link {
  position: fixed; left: 12px; top: -56px; z-index: 200;
  padding: 8px 14px; border-radius: 8px; font-size: 14px;
  background: var(--surface); color: var(--text-strong); border: 1px solid var(--border);
  transition: top .15s ease;
}
.skip-link:focus-visible { top: 12px; outline: 2px solid var(--text-strong); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .sider-cover .cover-phrase  { display: none; }                                  /* 静态只留 Logo（品牌代表） */
  .sider-cover img.cover-logo { animation: none; opacity: 1; transform: none; }
}
