/* SJX Hub —— 浅灰白底、深色文字、克制的红色点缀。只用系统字体，不下载网络字体。 */
:root {
  --bg: #f6f5f8;  /* 设计底色 #f5f5f7 经 AVIF/WebP 编码后按标准解码显示为 #f6f5f8（Chrome 桌面与安卓实测）；全站用这个值，首屏画面与页面逐像素一致、没有分界线 */
  --surface: #ffffff;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #6b6b70;  /* 对 #f6f5f8 4.88:1、对白色 5.30:1，满足 AA */
  --line: rgba(0, 0, 0, 0.1);
  --accent: #bc293d;
  --accent-ink: #a3182c;
  --accent-hover: #a3202f;
  --hero-bg: var(--bg);
  --focus: #0071e3;
  --nav-bg: rgba(246, 245, 248, 0.78);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", "Helvetica Neue", Arial, sans-serif;

  /* 矮窗口按高度收紧，但上限里带 rem 项：浏览器放大、默认字号调大时仍会变大（WCAG 1.4.4） */
  --fs-hero: min(clamp(2.5rem, 1.2rem + 4.2vw, 4.25rem), calc(3.5svh + 2.25rem));
  --fs-h1: clamp(2.25rem, 1.3rem + 4vw, 4.5rem);
  --fs-h2: clamp(1.9rem, 1.2rem + 2.8vw, 3.5rem);
  --fs-h3: clamp(1.15rem, 1rem + 0.5vw, 1.4rem);
  --fs-lead: clamp(1.1rem, 0.98rem + 0.55vw, 1.5rem);
  --fs-body: 1.0625rem;
  --fs-small: 0.875rem;

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: clamp(4rem, 3rem + 5vw, 8rem);
  --gutter: max(16px, env(safe-area-inset-left), 4vw);
  --maxw: 1080px;
  --radius-card: 28px;
  --radius-pill: 980px;
  --nav-h: 48px;

  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 0.6s;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
/* 标题按意群断行：每个片段内部不断开 */
.line { display: inline-block; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 12px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: var(--fs-body); line-height: 1.7;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-kerning: normal; text-rendering: optimizeLegibility;
}
img, video, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.12; letter-spacing: -0.015em; }
/* 中文标题字间距归零（负字距只适合拉丁字母） */
:lang(zh) :is(h1, h2, h3) { letter-spacing: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

.container { width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 8px 14px; background: var(--text); color: #fff; border-radius: 8px; }
.skip-link:focus { top: 8px; }

/* ---------- 导航 ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 50; height: var(--nav-h);
  background: var(--nav-bg); border-bottom: 1px solid transparent;
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  transition: border-color 0.3s var(--ease);
}
.site-nav.is-scrolled { border-bottom-color: var(--line); }
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) { .site-nav { background: rgba(246, 245, 248, 0.96); } }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto; }
.brand { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.01em; }
.brand::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 2px; background: var(--accent); vertical-align: 0.12em; }
.nav-links { display: flex; gap: clamp(16px, 3vw, 32px); font-size: 0.875rem; color: var(--text-2); }
.nav-links a { display: inline-flex; align-items: center; min-height: 44px; transition: color 0.2s var(--ease); }
.nav-links a:hover { color: var(--text); }
.nav-links .nav-pill { position: relative; min-height: 28px; padding: 3px 12px; margin-block: 8px; border-radius: var(--radius-pill); background: var(--text); color: #fff; font-weight: 500; }
/* 视觉 28px、可点区域约 46px */
.nav-links .nav-pill::after { content: ""; position: absolute; inset: -8px -4px; border-radius: inherit; }
.nav-links .nav-pill:hover { color: #fff; background: #000; }
.nav-links li { display: flex; align-items: center; }

/* ---------- 通用 ---------- */
.eyebrow { font-size: var(--fs-small); font-weight: 600; color: var(--accent); letter-spacing: 0.02em; }
.lead { font-size: var(--fs-lead); line-height: 1.5; color: var(--text-2); }
.section { padding-block: var(--space-5); }
.section-title { font-size: var(--fs-h2); }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 22px; border-radius: var(--radius-pill);
  background: var(--accent); color: #fff; font-size: 1rem; font-weight: 500; line-height: 1.2;
  border: 1px solid var(--accent); transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.button:active { transform: scale(0.98); }
.button svg { width: 18px; height: 18px; flex: none; }
.button--ghost { background: transparent; color: var(--text); border-color: rgba(0, 0, 0, 0.22); }
.button--ghost:hover { background: rgba(0, 0, 0, 0.05); border-color: rgba(0, 0, 0, 0.22); }
.text-link { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; color: var(--accent-ink); font-weight: 500; }
.text-link svg { width: 12px; height: 12px; transition: transform 0.2s var(--ease); }
.text-link:hover svg { transform: translateX(3px); }
.text-link:hover span, .text-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-list li { padding: 4px 12px; border-radius: var(--radius-pill); background: rgba(0, 0, 0, 0.05); color: var(--text-2); font-size: var(--fs-small); line-height: 1.6; }

/* ---------- 首页首屏 ----------
   桌面：画面铺满首屏但不裁切（contain，贴底对齐），文字叠在画面顶部预留的文字带里。
   画面底色与页面底色相同、四边羽化，看不出画面边界。拆解动画是 AVIF 动图（只播一次），由脚本叠在海报上方、
   播完换回海报；页面上没有视频元素，也没有进度条、播放按钮之类的播放器外观。 */
.hero { position: relative; min-height: max(560px, calc(100vh - var(--nav-h))); min-height: max(560px, calc(100svh - var(--nav-h))); display: grid; overflow: hidden; background: var(--hero-bg); }
.hero-stage { position: absolute; inset: 0; background: var(--hero-bg); container-type: size; }
/* 画面元素与动画同比例、贴底居中，羽化作用在真实画面边缘上 */
.hero-poster, .hero-anim { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); display: block; width: min(100%, (100vh - var(--nav-h)) * 16 / 9); width: min(100cqw, 100cqh * 16 / 9); height: auto; aspect-ratio: 16 / 9; }
.hero-poster img { width: 100%; height: 100%; object-fit: cover; }
.hero-anim { object-fit: cover; pointer-events: none; -webkit-user-select: none; user-select: none; }  /* 尺寸由上一条按比例决定，必须与海报逐像素重合 */
.hero-stage.is-playing .hero-poster { visibility: hidden; }  /* 动画首帧与开场图相同，换上时看不出切换 */
/* 开场图 = 动画首帧（散开的零件），结束图 = 动画末帧（停好的整车）：播完、停止、失败、减少动态效果时显示结束图 */
.hero-poster--end { display: none; }
.hero-poster--only, .hero-stage.is-end .hero-poster--end { display: block; }
.hero-stage.is-end .hero-poster--start { display: none; }
@media (prefers-reduced-motion: reduce) {
  .hero-poster--start { display: none; }
  .hero-poster--end { display: block; }
}
/* 从结束图重播时动画柔和切入（首次播放首帧与开场图相同，直接换上）；淡入完成前海报留在下面 */
.hero-anim--fade { animation: hero-anim-in 0.25s ease-out both; }
@keyframes hero-anim-in { from { opacity: 0; } }
/* 边缘羽化：画面左右边缘会切到车身；个别浏览器解码的底色可能与首屏底色差 1 个色阶，较宽的羽化让边界慢慢过渡 */
.hero-poster img, .hero-anim {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent), linear-gradient(to bottom, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent), linear-gradient(to bottom, transparent, #000 8%, #000 92%, transparent);
  mask-composite: intersect;
}
.hero-copy {
  position: relative; z-index: 2; align-self: start;
  width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto;
  padding-top: clamp(20px, 4.5svh, 64px);
}
.hero-copy > * { max-width: 34rem; }
.hero-copy > .hero-title { max-width: 46rem; }
.hero-title { font-size: var(--fs-hero); line-height: 1.1; margin-top: min(8px, 0.9svh); }
.hero-lead { margin-top: min(14px, 1.5svh); font-size: min(var(--fs-lead), calc(1svh + 0.9rem)); line-height: 1.5; color: var(--text-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: min(24px, 2.6svh); }
/* 首屏按钮可能叠在画面上：描边按钮加磨砂底，保证任何一帧上都清晰可读 */
.hero .button--ghost { background: rgba(255, 255, 255, 0.72); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.hero .button--ghost:hover { background: rgba(255, 255, 255, 0.9); }
.hero-note { margin-top: min(14px, 1.6svh); font-size: 0.75rem; line-height: 1.5; color: var(--text-3); }
/* 停止/重播拆解动画：只给键盘和读屏软件用，平时看不见，用 Tab 键移到它时才出现（触屏和鼠标点画面即可） */
.hero-toggle {
  position: absolute; z-index: 3; left: 50%; bottom: clamp(14px, 3svh, 32px); transform: translateX(-50%);
  min-height: 44px; padding: 10px 20px; border: 0; border-radius: var(--radius-pill);
  background: rgba(246, 245, 248, 0.92); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: var(--text); font: inherit; font-size: var(--fs-small); white-space: nowrap; cursor: pointer;
}
.hero-toggle:not(:focus) { width: 1px; height: 1px; min-height: 0; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
.hero-scroll {
  position: absolute; z-index: 3; left: 50%; bottom: clamp(64px, 10svh, 96px); transform: translateX(-50%);
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--text);
  background: rgba(246, 245, 248, 0.8); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.hero-scroll svg { width: 22px; height: 22px; }
@media (prefers-reduced-motion: no-preference) {
  .hero-scroll svg { animation: nudge 2.4s var(--ease) 2; }  /* 只提示两次，约 5 秒后停止 */
}
@keyframes nudge { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(5px); } }

/* 手机与竖屏：文字在上，画面在下，互不遮挡 */
@media (max-aspect-ratio: 1/1), (max-width: 700px) {
  .hero { min-height: auto; grid-template-rows: auto auto; }
  .hero-copy { order: 1; padding-top: clamp(28px, 6vh, 56px); text-align: center; }
  .hero-copy > * { max-width: none; margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .hero-stage { position: relative; order: 2; inset: auto; aspect-ratio: 4 / 5; width: 100%; max-height: 72svh; margin-top: 4px; }
  .hero-poster, .hero-anim { width: 100%; width: min(100cqw, 100cqh * 4 / 5); aspect-ratio: 4 / 5; }
  .hero-scroll { display: none; }
}

/* 手机横屏等矮视口：首屏只留主标题与按钮，高度正好一屏，画面贴底 */
@media (orientation: landscape) and (max-height: 500px) {
  .hero { min-height: calc(100svh - var(--nav-h)); }
  .hero-copy { padding-top: 14px; }
  .hero-eyebrow, .hero-lead { display: none; }
  .hero-title { font-size: min(var(--fs-hero), calc(6svh + 0.75rem)); margin-top: 0; }
  .hero-actions { margin-top: 12px; }
  .hero-actions .button { min-height: 40px; padding: 8px 18px; }
  .hero-note { margin-top: 8px; }
  .hero-scroll { display: none; }
}

/* ---------- 作品 ---------- */
.work .section-title { margin-bottom: var(--space-4); }
.work-card { background: var(--surface); border-radius: var(--radius-card); }
.work-link { display: block; overflow: hidden; background: #eceef0; border-radius: var(--radius-card) var(--radius-card) 0 0; }
.work-link:focus-visible { outline-offset: -4px; border-radius: var(--radius-card) var(--radius-card) 0 0; }
.work-media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; transition: transform 0.8s var(--ease-out); }
.work-link:hover img { transform: scale(1.02); }
.work-body { padding: clamp(24px, 4vw, 48px); display: grid; gap: 12px; }
.work-title { font-size: var(--fs-h2); }
.work-summary { font-size: var(--fs-lead); line-height: 1.5; color: var(--text-2); max-width: 36em; }
.work-actions { display: flex; flex-wrap: wrap; gap: 24px; }

/* ---------- 关于 / 联系 ---------- */
.about { background: var(--surface); }
.about-grid, .case-grid { display: grid; gap: var(--space-3) var(--space-4); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 820px) { .about-grid, .case-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); } }
.about-body, .case-body { display: grid; gap: 1em; font-size: var(--fs-lead); line-height: 1.6; color: var(--text-2); }
.about-body p:first-child, .case-body p:first-child { color: var(--text); }
.about-tools-title { margin-top: 12px; font-size: var(--fs-small); color: var(--text-3); }
.contact-inner { text-align: center; display: grid; gap: 16px; justify-items: center; }
.contact-list { display: grid; gap: 10px; }
.contact-label { color: var(--text-3); margin-right: 12px; font-size: var(--fs-small); }
.contact-list a { color: var(--accent-ink); }

/* ---------- 案例页 ---------- */
.breadcrumb { display: flex; gap: 8px; padding-top: 18px; font-size: var(--fs-small); color: var(--text-3); }
.breadcrumb a:hover { color: var(--text); }
.case-hero { padding-top: clamp(40px, 8vh, 96px); display: grid; gap: 14px; }
.case-title { font-size: var(--fs-h1); line-height: 1.08; letter-spacing: -0.02em; }
.case-lead { max-width: 34em; }
.credit { font-size: var(--fs-small); color: var(--text-3); }
.case-cover { margin-top: var(--space-4); }
.case-cover img, .figure img { width: 100%; border-radius: var(--radius-card); background: #eceef0; }
.stats { padding-block: var(--space-4) 0; }
.stat-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 24px; border-top: 1px solid var(--line); padding-top: var(--space-3); }
.stat-list li { display: grid; gap: 4px; }
.stat-list strong { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.2rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-list span { color: var(--text-2); font-size: var(--fs-small); }
.case-section + .case-section { padding-top: 0; }
.figure { margin: var(--space-4) 0 0; }
.figure figcaption { margin-top: 12px; font-size: var(--fs-small); color: var(--text-3); text-align: center; }
.highlight-grid { margin-top: var(--space-4); display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.highlight { background: var(--surface); border-radius: 22px; padding: 28px; display: grid; gap: 8px; align-content: start; }
.highlight h3 { font-size: var(--fs-h3); }
.highlight p { color: var(--text-2); }
.boundary-box { border: 1px solid var(--line); border-radius: var(--radius-card); padding: clamp(24px, 4vw, 48px); background: var(--surface); }
.boundary-title { font-size: var(--fs-h3); display: flex; align-items: center; gap: 10px; }
.boundary-title::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }
.boundary-box ul { margin-top: 16px; display: grid; gap: 10px; color: var(--text-2); }
.boundary-box li { padding-left: 18px; position: relative; }
.boundary-box li::before { content: ""; position: absolute; left: 0; top: 0.8em; width: 6px; height: 1px; background: var(--text-3); }
.lab-cta-inner { text-align: center; display: grid; justify-items: center; gap: 18px; }
.lab-cta-inner .lead { max-width: 32em; }
.fine-print { font-size: var(--fs-small); color: var(--text-3); max-width: 36em; }
.notfound { min-height: 60vh; display: grid; align-content: center; gap: 16px; }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 24px calc(24px + env(safe-area-inset-bottom)); font-size: 0.8125rem; color: var(--text-3); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.footer-inner a:hover { color: var(--text); text-decoration: underline; }

/* ---------- 入场动效（减少动态效果时关闭） ---------- */
@media screen and (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(24px); transition: opacity var(--dur) var(--ease), transform 0.9s var(--ease-out); }
  .js .reveal.is-in { opacity: 1; transform: none; }
}

@media print {
  .reveal { opacity: 1 !important; transform: none !important; }
  .site-nav, .hero-scroll, .hero-anim, .hero-toggle, .hero-poster--start { display: none !important; }
  .hero-poster--end { display: block !important; }
}
