/* ==========================================================================
   qianwen.page — 共享设计系统
   性能铁律（每条都有实测依据，勿改）：
   1. 动画只碰 transform / opacity / background-color，绝不碰 width/height/filter/blur
   2. backdrop-filter 只允许出现在「不随滚动重绘」的元素上 —— 顶栏仅在贴顶静止态启用
   3. 禁止 infinite 动画（会持续占用 GPU 合成，实测掉帧）
   4. 图片一律走 <picture> 多格式多尺寸，禁止直接把千像素大图缩到 40px 用
   ========================================================================== */

:root {
  /* 文字层级 —— 全部通过 WCAG AA 对比度实测（见 tools/check-contrast） */
  --ink: #1c2b31;          /* 标题/正文，对 #f7fbfa 约 14.6:1 */
  --ink-2: #33474f;        /* 次级标题，约 9.5:1 */
  --muted: #566b74;        /* 说明文字，约 5.9:1 */
  --muted-2: #64767e;      /* 极小号辅助字，约 4.6:1，只用于 >=11px 且非关键信息 */
  --line: rgba(28, 72, 84, .13);
  --line-strong: rgba(28, 72, 84, .2);

  --sky: #3f9dc6;          /* 装饰用（底色/描边），不要拿它写正文 */
  --link: #327b9c;         /* 正文里的链接色，对 #f7fbfa 实测 4.53:1 */
  --mint: #35a385;
  --amber: #c9812a;
  --rose: #cf6a6a;

  --surface: #ffffff;
  --card: rgba(255, 255, 255, .74);
  --card-solid: #ffffff;
  --page: #f7fbfa;

  --shadow-s: 0 2px 8px rgba(38, 78, 90, .06), 0 1px 2px rgba(38, 78, 90, .05);
  --shadow-m: 0 10px 28px rgba(38, 78, 90, .1), 0 2px 6px rgba(38, 78, 90, .05);
  --shadow-l: 0 26px 60px rgba(38, 78, 90, .14), 0 4px 12px rgba(38, 78, 90, .06);

  /* iOS 风格缓动曲线 */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-io: cubic-bezier(.4, 0, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .44, 1);

  --r-s: 12px;
  --r-m: 18px;
  --r-l: 26px;
  --r-xl: 34px;

  --bar-h: 44px;
  --bar-top: 10px;

  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --font-display: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif CJK SC",
    Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "PingFang SC", monospace;

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  /* 滚动手感 */
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--bar-h) + var(--bar-top) + 16px);
  background: var(--page);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--page);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* 背景：纯静态，无动画、无 fixed 模糊层（成本零，观感保留） */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(52rem 32rem at 88% -6%, rgba(126, 205, 240, .3), transparent 62%),
    radial-gradient(40rem 28rem at 4% 42%, rgba(255, 224, 148, .26), transparent 62%),
    radial-gradient(46rem 30rem at 76% 96%, rgba(120, 220, 190, .24), transparent 62%),
    linear-gradient(150deg, #fffdf7 0%, #f2fafd 46%, #f6fcf8 100%);
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
img { max-width: 100%; display: block; }
::selection { background: rgba(63, 157, 198, .2); }

:focus-visible {
  outline: 2.5px solid var(--link);
  outline-offset: 3px;
  border-radius: 6px;
}

/* --------------------------------------------------------------------------
   跳转过渡幕布：用 html 伪元素实现，无需 DOM，首帧即可见
   这是跨页面跳转不闪白的关键 —— Safari/微信 iOS 不支持跨文档 View Transition，
   所以不依赖浏览器特性，自己做一套所有环境一致的过渡。
   -------------------------------------------------------------------------- */
html::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  /* 图层顺序即堆叠顺序：品牌标记在最上，其次光晕，最下是底色。
     之前把标记写在最底层，被不透明底色盖住 → 幕布上是空的。 */
  background-image:
    linear-gradient(135deg, var(--sky), var(--mint)),
    radial-gradient(34rem 26rem at 50% 44%, rgba(126, 205, 240, .4), transparent 68%),
    linear-gradient(160deg, #fdfefd, #eff8fb 52%, #f4fcf8);
  background-size: 30px 30px, 100% 100%, 100% 100%;
  background-position: center, center, center;
  background-repeat: no-repeat, no-repeat, no-repeat;
  transition: opacity .34s var(--ease-out);
}
/* 离开当前页：快速淡入幕布 */
html.veil-go::after { opacity: 1; transition: opacity .2s linear; }
/* 到达新页：幕布已在首帧不透明，随后淡出 */
html.veil-on::after { opacity: 1; transition: none; }
html.veil-out::after { opacity: 0; transition: opacity .36s var(--ease-out); }

/* --------------------------------------------------------------------------
   顶栏 —— 唯一的常驻导航。44px 悬浮胶囊，向下滚动自动上滑隐藏
   -------------------------------------------------------------------------- */
.bar {
  position: fixed;
  left: 50%;
  top: var(--bar-top);
  z-index: 900;
  width: min(1180px, calc(100% - 30px));
  height: var(--bar-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 7px 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .78);
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow-s);
  transform: translate3d(-50%, 0, 0);
  transition: transform .44s var(--ease-out), box-shadow .3s var(--ease-io),
              background-color .3s var(--ease-io);
  will-change: transform;
}
.bar.is-hidden { transform: translate3d(-50%, calc(-1 * (var(--bar-h) + var(--bar-top) + 14px)), 0); }
/* 贴顶静止时才上玻璃模糊：此时背景不随滚动变化，不会每帧重绘 */
.bar.is-at-top {
  background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  box-shadow: var(--shadow-m);
}
.bar__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px 4px 4px;
  border-radius: 999px;
  flex: 0 0 auto;
  transition: background-color .25s var(--ease-io);
}
.bar__brand:hover { background: rgba(28, 72, 84, .055); }
.bar__mark { width: 30px; height: 30px; border-radius: 10px; overflow: hidden; flex: 0 0 auto; }
.bar__mark img { width: 100%; height: 100%; object-fit: cover; }
.bar__name { font-size: 13px; font-weight: 700; letter-spacing: .06em; color: var(--ink); }
.bar__name span { display: none; }

.bar__nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.bar__nav a, .bar__nav .is-current {
  display: grid;
  place-items: center;
  height: 32px;
  padding: 0 15px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-2);
  transition: background-color .22s var(--ease-io), color .22s var(--ease-io);
}
.bar__nav a:hover { background: rgba(28, 72, 84, .07); color: var(--ink); }
.bar__nav .is-current { background: var(--ink); color: #fff; box-shadow: var(--shadow-s); }

.bar__menu {
  display: none;
  width: 32px; height: 32px;
  margin-left: auto;
  border-radius: 999px;
  place-items: center;
  color: var(--ink-2);
  transition: background-color .22s var(--ease-io);
}
.bar__menu:active { background: rgba(28, 72, 84, .1); }
.bar__menu svg { width: 17px; height: 17px; }

/* 移动端抽屉菜单 */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
  background: rgba(24, 44, 51, .26);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--ease-io);
}
.sheet.is-open { opacity: 1; pointer-events: auto; }
.sheet__panel {
  border-radius: var(--r-xl);
  padding: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-l);
  transform: translate3d(0, 18px, 0) scale(.985);
  transition: transform .42s var(--ease-out);
}
.sheet.is-open .sheet__panel { transform: translate3d(0, 0, 0) scale(1); }
.sheet__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  border-radius: var(--r-m);
  font-size: 16.5px;
  font-weight: 600;
  color: var(--ink);
  transition: background-color .2s var(--ease-io);
}
.sheet__link:active { background: rgba(28, 72, 84, .07); }
.sheet__link small { color: var(--muted); font-size: 11.5px; font-weight: 500; letter-spacing: .04em; }
.sheet__link .is-current { color: var(--link); }

/* --------------------------------------------------------------------------
   通用版式
   -------------------------------------------------------------------------- */
.wrap { width: min(1180px, calc(100% - 34px)); margin-inline: auto; }
main { padding-top: calc(var(--bar-h) + var(--bar-top) + 24px); padding-bottom: 40px; }

.eyebrow {
  display: flex; align-items: center; gap: 9px;
  margin: 0 0 18px;
  color: #3c7c8f;
  font-size: 10.5px; font-weight: 800; letter-spacing: .22em; text-transform: uppercase;
}
.eyebrow::before {
  content: ""; width: 26px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--sky), var(--mint));
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; color: var(--ink); }
.display {
  font-family: var(--font-display);
  font-size: clamp(42px, 7.2vw, 88px);
  line-height: 1.02;
  letter-spacing: -.03em;
}
.h2 { font-family: var(--font-display); font-size: clamp(28px, 4.4vw, 42px); line-height: 1.12; letter-spacing: -.03em; }
.h3 { font-size: clamp(20px, 2.4vw, 25px); line-height: 1.25; letter-spacing: -.01em; }
.lede { margin: 18px 0 0; max-width: 33em; color: var(--muted); font-size: 15.5px; line-height: 1.85; }
.grad {
  background: linear-gradient(104deg, #297b9f 0%, #268168 52%, #a2661c 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.card {
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: var(--r-xl);
  background: var(--card);
  box-shadow: var(--shadow-m);
}
.card--solid { background: var(--surface); box-shadow: var(--shadow-s); border-color: var(--line); }

.section { padding: 54px 0 8px; }
.section + .section { padding-top: 46px; }
.section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 26px; margin-bottom: 22px; }
.section__head p { margin: 0; max-width: 30em; color: var(--muted); font-size: 13px; line-height: 1.75; }

.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  color: var(--muted);
  font-size: 11px; font-weight: 600;
}
.pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); flex: 0 0 auto; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 20px;
  border-radius: 999px;
  font-size: 14px; font-weight: 650;
  transition: transform .28s var(--ease-out), box-shadow .3s var(--ease-io), background-color .25s var(--ease-io), opacity .25s;
}
.btn--primary { background: var(--ink); color: #fff; box-shadow: var(--shadow-m); }
.btn--primary:hover { transform: translate3d(0, -2px, 0); box-shadow: var(--shadow-l); }
.btn--primary:active { transform: translate3d(0, 0, 0) scale(.98); }
.btn--ghost { border: 1px solid var(--line-strong); background: rgba(255,255,255,.8); color: var(--ink-2); }
.btn--ghost:hover { background: #fff; border-color: var(--link); color: var(--ink); }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* --------------------------------------------------------------------------
   进入动画（一次性，只碰 transform/opacity，禁止循环）
   -------------------------------------------------------------------------- */
.rise { opacity: 0; transform: translate3d(0, 16px, 0); }
.rise.is-in {
  opacity: 1;
  transform: none;
  transition: opacity .5s var(--ease-out), transform .6s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 55ms);
}
/* 首屏元素不等待 IntersectionObserver，直接播 */
.hero .rise.is-in { transition-duration: .62s, .72s; }

footer.site {
  margin-top: 56px;
  padding: 26px 0 30px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  color: var(--muted-2);
  font-size: 11.5px; letter-spacing: .04em;
}
footer.site strong { color: var(--ink-2); font-weight: 700; }
footer.site nav { display: flex; gap: 16px; }
footer.site a { transition: color .2s var(--ease-io); }
footer.site a:hover { color: var(--ink); }

/* 跳转到内容的无障碍链接 */
.skip {
  position: fixed; left: 50%; top: -60px; z-index: 9998;
  transform: translateX(-50%);
  padding: 9px 16px; border-radius: 999px;
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 600;
  transition: top .25s var(--ease-out);
}
.skip:focus { top: 12px; }

/* --------------------------------------------------------------------------
   响应式：<=880px 手机布局
   -------------------------------------------------------------------------- */
@media (max-width: 880px) {
  :root { --bar-h: 44px; --bar-top: 8px; }
  .wrap { width: min(100% - 26px, 680px); }
  .bar { width: calc(100% - 22px); padding: 0 6px 0 7px; }
  .bar__nav { display: none; }
  .bar__menu { display: grid; }
  .bar__name span { display: none; }
  main { padding-top: calc(var(--bar-h) + var(--bar-top) + 18px); }
  .section { padding-top: 42px; }
  .section__head { display: block; }
  .section__head p { margin-top: 10px; }
  .display { letter-spacing: -.035em; }
  footer.site { flex-direction: column; align-items: flex-start; gap: 12px; padding-bottom: 34px; }
}

@media (max-width: 400px) {
  .bar__name { font-size: 12px; }
}

/* 让动效敏感用户得到静态版本 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .rise { opacity: 1; transform: none; }
  html::after { display: none; }
}

/* 打印：去掉一切装饰与固定层 */
@media print {
  .bar, .sheet, html::after, .skip { display: none !important; }
  body::before { display: none; }
  main { padding-top: 0; }
}
