/* help.undusk.com 帮助与支持中心 · 亮色纸面
 * 官网 undusk.com 的功用层子站：与官网同一套语言（纸 / 墨 / 灯），零 JavaScript，页眉只有品牌与两条回链。
 * 九个纸面色与 undusk-site/assets/style.css 同值同名（text/bg 15.9 ｜ muted/bg 6.6 ｜ accent/bg 6.6 ｜ on-accent/ink 17.2
 * ｜ dim/bg 5.1 ｜ text/surface 17.5 ｜ muted/bg-alt 6.1 ｜ dim/bg-alt ≈4.68），scripts/verify.mjs 锁 WCAG AA；改色两站同改。
 */

/* ============ tokens ============ */
:root {
  color-scheme: light;
  --bg: #f7f4ee;
  --bg-alt: #efeae1;
  --surface: #ffffff;
  --text: #1c1914;
  --muted: #5c564c;
  --dim: #6d675c;
  --line: rgba(28, 25, 20, 0.12);
  --line-strong: #7a7368;
  --accent: #8a4318;
  --on-accent: #fffdf8;
  --ink: #1c1914;
  --ink-hover: #2c261e;
  --ink-active: #100e0b;
  --ghost-active: #e4ddd2;
  --selection-tint: rgba(196, 106, 46, 0.25);
  --dusk-amber: #c46a2e;
  --dusk-amber-soft: #e0a473;
  --dusk-violet: #8b7fa8;
  --hairline-dusk: linear-gradient(90deg, rgba(196, 106, 46, 0) 0%, rgba(196, 106, 46, 0.55) 28%, rgba(139, 127, 168, 0.55) 72%, rgba(139, 127, 168, 0) 100%);
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .03 .03 .03 0 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23g)'/%3E%3C/svg%3E");
  --radius-sm: 8px;
  --radius: 12px;
  --shell: 1120px;
  --header-h: 72px;
  --tracking-tight: -0.03em;
  --tracking-snug: -0.02em;
  --tracking-wide: 0.08em;
  --font-display: "Noto Serif SC", "Noto Serif CJK SC", "Songti SC", "STSong", "Source Han Serif SC", Georgia, serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --dur-fast: 90ms;
  --dur-base: 140ms;
  --dur-slow: 180ms;
  --dur-enter: 240ms;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --enter-y: 10px;
  --shadow-lift: 0 10px 28px -14px rgba(28, 25, 20, 0.22), 0 2px 6px rgba(28, 25, 20, 0.06);
  --glow: 0 0 0 4px rgba(138, 67, 24, 0.14);
}

/* ============ base ============ */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--bg);
  background-image:
    var(--noise),
    radial-gradient(120% 56% at 50% -12%, rgba(196, 106, 46, 0.09), rgba(196, 106, 46, 0) 62%);
  background-repeat: repeat, no-repeat;
  background-size: 200px 200px, 100% 900px;
  color: var(--text);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--selection-tint); }
a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-base) var(--ease-out);
}
img, svg { display: block; }
.shell { width: min(calc(100% - 40px), var(--shell)); margin-inline: auto; }

/* ============ a11y ============ */
.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;
}
.skip-link {
  position: fixed;
  left: max(16px, env(safe-area-inset-left, 0px));
  top: -72px;
  z-index: 2000;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--on-accent);
  font-weight: 700;
}
.skip-link:focus,
.skip-link:focus-visible { top: calc(12px + env(safe-area-inset-top, 0px)); }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
#main:focus { outline: none; }

/* ============ header（零 JS：品牌 + 两条回链，窄屏自然换行） ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 244, 238, 0.86);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  padding-block: 8px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
}
.brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  transition: transform var(--dur-slow) var(--ease-out);
}
.brand:hover img { transform: rotate(-6deg); }
.brand-latin {
  color: var(--dim);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
}
.brand-scope {
  margin-left: 4px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
}
.site-links {
  display: flex;
  align-items: center;
  gap: 8px 22px;
  color: var(--muted);
  font-size: 14px;
}
.site-links > a:not(.button) {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
}
.site-links > a:not(.button):hover {
  color: var(--text);
  text-decoration-line: underline;
  text-underline-offset: 6px;
}

/* ============ 按钮 ============ */
.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  transition:
    color var(--dur-base) var(--ease-out),
    background-color var(--dur-base) var(--ease-out),
    border-color var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
}
.button:active { transform: scale(0.98); }
.button-primary { background: var(--ink); color: var(--on-accent); }
.button-primary:hover { background: var(--ink-hover); box-shadow: var(--glow); }
.button-primary:focus-visible { box-shadow: var(--glow); }
.button-primary:active { background: var(--ink-active); box-shadow: none; }
.button-ghost { border-color: var(--line-strong); background: transparent; }
.button-ghost:hover { background: var(--bg-alt); }
.button-ghost:active { background: var(--ghost-active); }
.button-small { min-height: 40px; padding-inline: 14px; font-size: 13px; border-radius: 8px; }

/* ============ 眉题 / 序号 / 文字链 ============ */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  color: var(--dim);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
}
.eyebrow::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dusk-amber);
  box-shadow: 0 0 0 4px rgba(196, 106, 46, 0.14);
}
.index-mark {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.text-link,
.prose a:not(.button),
.related a,
.not-found-links a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 650;
}
.text-link > [aria-hidden="true"] {
  display: inline-block;
  transition: transform var(--dur-slow) var(--ease-out);
}
.text-link:hover > [aria-hidden="true"],
.help-card:hover .text-link > [aria-hidden="true"] { transform: translateX(4px); }

/* ============ 内页骨架 ============ */
.page { padding: 48px 0 88px; }
.page-title,
.prose h1 {
  margin: 0 0 16px;
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 36px);
  letter-spacing: 0.01em;
  line-height: 1.25;
  font-weight: 600;
  text-wrap: balance;
}
.page-head {
  position: relative;
  margin: 0 0 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.page-head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 88px;
  height: 2px;
  background: var(--dusk-amber);
}
.page-head h1 { margin-bottom: 12px; }
.page-lede {
  margin: 0;
  max-width: 36em;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  row-gap: 4px;
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
}
.crumbs a:hover,
.crumbs a:focus-visible { color: var(--text); text-decoration: underline; text-underline-offset: 6px; }
.crumbs [aria-current="page"] {
  color: var(--text);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}
.crumbs > [aria-hidden="true"] {
  color: var(--dim);
  -webkit-user-select: none;
  user-select: none;
}
.crumbs a,
.crumbs [aria-current="page"] { white-space: nowrap; }
@media (min-width: 881px) {
  .crumbs a {
    padding-block: 4px;
    margin-block: -4px;
  }
}

.prose {
  max-width: 68ch;
  font-size: 17px;
  line-height: 1.8;
}
.prose h2 {
  margin: 44px 0 14px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.3;
}
.prose h2:first-of-type { margin-top: 36px; }
.prose-numbered { counter-reset: sec; }
.prose-numbered h2::before {
  counter-increment: sec;
  content: counter(sec, decimal-leading-zero);
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent);
}
.prose p, .prose li { color: var(--muted); }
.prose li + li { margin-top: 6px; }
.prose ul { padding-left: 1.2em; }
/* 引自官网深页的原文块：左侧一道琥珀线，尾注写来源页 */
.quote-source {
  margin: 0;
  padding: 4px 0 4px 18px;
  border-left: 2px solid var(--dusk-amber);
}
.quote-source p { margin: 0 0 10px; }
.quote-source p:last-child { margin-bottom: 0; }
.source-note {
  display: block;
  margin-top: 10px;
  color: var(--dim);
  font-size: 13px;
}

/* 步骤行（获取 / 反馈）：编号在左 */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}
.steps li {
  position: relative;
  padding-left: 40px;
  margin: 0;
}
.steps li + li { margin-top: 14px; }
.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.25em;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  line-height: 24px;
  text-align: center;
}

/* ============ 首页：产品卡 + 写信卡 ============ */
.help-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.help-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 24px 24px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition:
    border-color var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out);
}
a.help-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.help-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.product-glyph {
  width: 32px;
  height: 32px;
  color: var(--text);
  --glyph-dot: var(--dusk-amber);
}
.product-glyph .dot {
  fill: var(--glyph-dot);
  transform-box: fill-box;
  transform-origin: center;
  transition: transform var(--dur-slow) var(--ease-out), fill var(--dur-slow) var(--ease-out);
}
.help-card:hover .product-glyph .dot { transform: scale(1.35); }
.help-card:hover .product-glyph { --glyph-dot: var(--dusk-amber-soft); }
.help-card h2,
.help-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  letter-spacing: var(--tracking-snug);
  line-height: 1.35;
}
.help-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.help-card .text-link {
  margin-top: auto;
  padding-top: 18px;
  text-decoration: none;
}

.section { padding: 8px 0 0; }
.section + .section { margin-top: 56px; }
.section-heading { max-width: 40em; margin-bottom: 24px; }
.section-heading h2 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.25;
  text-wrap: balance;
}
.section-heading p { margin: 0; color: var(--muted); max-width: 42em; }

/* 写信卡：邮箱 + 两个主题按钮 + 说明 */
.mail-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px 48px;
  align-items: center;
  padding: 32px 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.mail-card dt {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.mail-card dd { margin: 0; }
.mail-card dd a {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--dusk-amber);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
  overflow-wrap: anywhere;
}
.mail-card dd a:hover { color: var(--accent); }
.mail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.mail-note { margin: 20px 0 0; color: var(--muted); max-width: 44em; }
.mail-note + .mail-note { margin-top: 10px; }

/* 服务一览（fact-grid） */
.fact-grid {
  display: grid;
  grid-template-columns: 1fr;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.fact-grid > div { padding: 20px 24px; border-bottom: 1px solid var(--line); }
.fact-grid > div:last-child { border-bottom: 0; }
.fact-grid dt {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.fact-grid dd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin: 0;
  color: var(--text);
}
.fact-grid dd a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.fact-grid dd .dim { color: var(--dim); font-size: 13px; }

.related {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 36px;
  font-size: 14px;
}
/* 产品页收尾：回官网深页与产品站 */
.closing {
  margin-top: 48px;
  padding: 32px 36px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.closing h2 { margin-top: 0; }
.closing > p:last-of-type { margin-bottom: 0; }
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}
.not-found-links { margin: 32px 0 0; }
.not-found-links ul { margin: 0; padding: 0; list-style: none; }
.not-found-links li + li { margin-top: 8px; }

/* ============ footer ============ */
.site-footer {
  position: relative;
  padding: 44px 0 52px;
  background: var(--bg-alt);
  color: var(--dim);
  font-size: 13px;
}
.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--hairline-dusk);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 40px 48px;
  align-items: start;
  margin-bottom: 40px;
}
.footer-brand .brand { color: var(--text); }
.footer-brand .brand img { width: 28px; height: 28px; }
.footer-brand p { margin: 12px 0 0; max-width: 32em; line-height: 1.6; }
.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 40px;
}
.footer-title { margin: 0 0 12px; color: var(--text); font-size: 13px; font-weight: 700; }
.footer-cols nav { display: grid; gap: 8px; }
.footer-cols a,
.footer-copy,
.footer-copy a { color: var(--muted); }
.footer-cols a:hover,
.footer-copy a:hover { color: var(--text); }
.footer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.footer-copy { margin: 0; }

/* ============ 滚动入场（纯 CSS 渐进增强，无 JS 回退，不支持即静态） ============ */
@keyframes reveal-in {
  from { opacity: 0.001; translate: 0 var(--enter-y); }
  to { opacity: 1; translate: 0 0; }
}
@supports (animation-timeline: view()) {
  [data-reveal] {
    animation: reveal-in linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 30%;
  }
}

/* ============ @media 1080 / 880 / 390 ============ */
@media (max-width: 1080px) {
  .help-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 880px) {
  :root { --header-h: 56px; }
  .shell {
    width: min(100%, var(--shell));
    padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
  }
  .header-inner { min-height: 56px; }
  .brand-scope { display: none; }
  .site-links { gap: 8px 16px; font-size: 13px; }
  .site-links > a:not(.button) { min-height: 44px; }
  .page { padding: 36px 0 64px; }
  .page-title,
  .prose h1 { font-size: clamp(28px, 6vw, 32px); }
  .page-head { margin-bottom: 28px; padding-bottom: 22px; }
  .prose { font-size: 16px; line-height: 1.75; }
  .help-grid { grid-template-columns: 1fr; gap: 12px; }
  .mail-card { grid-template-columns: 1fr; padding: 24px 20px; }
  .mail-card dd a { font-size: 17px; }
  .closing { padding: 24px 20px 20px; }
  .fact-grid > div { padding: 16px; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr; gap: 24px; }
  .footer-bar { flex-direction: column; align-items: flex-start; }
  /* 44px 触控目标 */
  .brand,
  .crumbs a,
  .prose a,
  .related a,
  .not-found-links a,
  .fact-grid dd a,
  .mail-note a,
  .text-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .crumbs a,
  .text-link { min-width: 44px; }
  .footer-cols a,
  .footer-copy a {
    display: flex;
    align-items: center;
    min-height: 44px;
  }
}
@media (max-width: 390px) {
  .hero-actions,
  .mail-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .button,
  .mail-actions .button { width: 100%; }
  .section + .section { margin-top: 40px; }
  .site-footer { padding: 28px 0 40px; }
}

@media (forced-colors: active) {
  .eyebrow::before, .page-head::after, .quote-source { border-color: CanvasText; background: CanvasText; }
}

/* ============ 减弱动效（保事件写法） ============ */
@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;
  }
  [data-reveal] { animation: none; }
  a.help-card:hover,
  .help-card:hover .product-glyph .dot,
  .text-link:hover > [aria-hidden="true"],
  .help-card:hover .text-link > [aria-hidden="true"],
  .brand:hover img,
  .button:active { transform: none; }
}
