/* ==========================================================================
   鲸渡 WHALEGO · 基础层
   重置 · 排版 · 版心 · 氛围纹理 · 降级动效
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  /* 平滑滚动由 motion.js 的 lerp 负责 —— CSS smooth 会让它每帧
     scrollTo 都再启动一次平滑动画，帧帧叠加直接卡死。 */
  scroll-behavior: auto;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.72;
  letter-spacing: 0.012em;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* 不在此处设置 overflow-x: hidden —— 它会让 body 成为滚动容器，
     从而破坏内部 position: sticky 的吸顶导航。溢出应逐个修复来源。 */
}

body.is-locked { overflow: hidden; }

/* ---------- 排版 ---------- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.028em;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: var(--fs-display); font-variation-settings: "SOFT" 0, "WONK" 1; }
h2 { font-size: clamp(2.1rem, 4.6vw, var(--fs-4xl)); }
h3 { font-size: clamp(1.5rem, 2.4vw, var(--fs-2xl)); line-height: 1.14; }
h4 { font-size: var(--fs-lg); line-height: 1.3; font-weight: 600; }
h5 { font-size: var(--fs-md); line-height: 1.4; font-weight: 600; letter-spacing: -0.01em; }

/* 中文标题走宋体，字距回正。
   刻意不用 :lang(zh-TW) 之类的选择器——切换语言时 :lang() 会改变字体匹配，
   触发整页字体抖动与重排，观感就是「切换很卡」。语言差异交给 .cn 类控制。 */
h1.cn, h2.cn, h3.cn {
  font-family: var(--font-serif-cn);
  font-weight: 700;
  letter-spacing: 0.005em;
  line-height: 1.16;
}
h1.cn { line-height: 1.08; }

p { margin: 0 0 1.1em; max-width: 68ch; }
p:last-child { margin-bottom: 0; }
a { color: inherit; text-decoration: none; }
strong, b { font-weight: 600; color: var(--ink); }
small { font-size: var(--fs-sm); }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--sp-5) 0; }
ul, ol { margin: 0; padding-left: 1.15em; }
figure { margin: 0; }

/* 表单控件重置：避免浏览器默认外观污染组件样式 */
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }

.num, .mono, time, .price, .stat-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

::selection { background: var(--accent); color: var(--on-accent); }

/* ---------- 焦点可见 · 2px + 2px 偏移 ---------- */
:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}
:focus:not(:focus-visible) { outline: none; }

/* ---------- 版心 ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap--narrow { max-width: var(--wrap-narrow); }
.wrap--wide { max-width: 1560px; }

/* ---------- 区块节奏 ---------- */
.section { padding-block: clamp(4.5rem, 9vw, var(--sp-8)); position: relative; }
.section--tight { padding-block: clamp(3rem, 6vw, var(--sp-7)); }
/* 一比一复刻：对标站无大面积深色区，深板块局部映射到浅灰（--deep 令牌本身保留黑色给公告条） */
.section--deep {
  --deep: var(--surface-2);
  --deep-2: #ECEEF1;
  --deep-fg: var(--ink);
  --deep-muted: var(--muted);
  --deep-line: rgba(26, 26, 26, 0.08);
  background: var(--surface-2);
  color: var(--ink);
}
.section--deep p { color: var(--deep-muted); }
.section--deep h1, .section--deep h2, .section--deep h3, .section--deep h4 { color: var(--deep-fg); }
.section--deep .muted { color: var(--deep-muted); }
.section--surface { background: var(--surface); }
.section--alt { background: var(--bg-2); }

/* ---------- 氛围层 ---------- */
.atmosphere { position: relative; }
.atmosphere::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none; z-index: 0;
  background:
    radial-gradient(58rem 38rem at 8% -14%, rgba(192, 57, 27, 0.13), transparent 62%),
    radial-gradient(48rem 36rem at 102% 4%, rgba(8, 24, 42, 0.10), transparent 58%),
    radial-gradient(40rem 30rem at 50% 108%, rgba(168, 119, 32, 0.10), transparent 60%);
}
.atmosphere > * { position: relative; z-index: 2; }

/* 颗粒噪点叠加 */
.grain::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: var(--z-grain);
  opacity: 0.042;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
[data-theme="dark"] .grain::after { mix-blend-mode: overlay; opacity: 0.06; }

/* 航海网格底纹 —— 航线图系统的底衬 */
.seagrid {
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 72px 72px;
  background-position: -1px -1px;
}
.section--deep.seagrid {
  background-image:
    linear-gradient(var(--deep-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--deep-line) 1px, transparent 1px);
}

/* ---------- 入场动效 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  will-change: opacity, transform;
}
.reveal.is-in {
  opacity: 1;
  transform: none;
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
}
.reveal--left  { transform: translate3d(-30px, 0, 0); }
.reveal--right { transform: translate3d(30px, 0, 0); }
.reveal--scale { transform: scale(0.94); }
.reveal--clip  { opacity: 1; clip-path: inset(0 0 100% 0); transform: none; }
.reveal--clip.is-in { clip-path: inset(0 0 0 0); }

/* 首屏编排序列 · 4 组，间隔 90ms */
.stagger > * { opacity: 0; transform: translateY(22px); }
.stagger.is-in > * {
  opacity: 1; transform: none;
  transition: opacity 760ms var(--ease-out), transform 760ms var(--ease-out);
}
.stagger.is-in > *:nth-child(1) { transition-delay: 60ms; }
.stagger.is-in > *:nth-child(2) { transition-delay: 150ms; }
.stagger.is-in > *:nth-child(3) { transition-delay: 240ms; }
.stagger.is-in > *:nth-child(4) { transition-delay: 330ms; }
.stagger.is-in > *:nth-child(5) { transition-delay: 420ms; }
.stagger.is-in > *:nth-child(6) { transition-delay: 510ms; }

/* 逐字标题 */
.split-line { display: block; overflow: hidden; }
.split-line > span {
  display: block;
  transform: translateY(110%);
  transition: transform 1000ms var(--ease-out);
}
.is-in .split-line > span, .split-line.is-in > span { transform: translateY(0); }

/* 航线描边动画 */
.route-draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset 2200ms var(--ease-out);
}
.route-draw.is-in { stroke-dashoffset: 0; }
.route-node { opacity: 0; transition: opacity 420ms ease-out; }
.route-node.is-in { opacity: 1; }

/* ---------- 降级：关闭全部动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal, .stagger > *, .split-line > span, .route-node, .route-draw {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
    stroke-dashoffset: 0 !important;
  }
}

/* ---------- 降级：无 JavaScript ---------- */
html.no-js .reveal,
html.no-js .stagger > *,
html.no-js .split-line > span,
html.no-js .route-node {
  opacity: 1 !important;
  transform: none !important;
  clip-path: none !important;
}
html.no-js .route-draw { stroke-dashoffset: 0 !important; }
html.no-js [data-counter] { opacity: 1; }

/* ---------- 降级：打印 ---------- */
@media print {
  .topbar, .drawer, .cursor-dot, .cursor-ring, .toasts, .nav__toggle { display: none !important; }
  .nav { position: static; }
  .reveal, .stagger > *, .split-line > span, .route-node {
    opacity: 1 !important; transform: none !important; clip-path: none !important;
  }
  .route-draw { stroke-dashoffset: 0 !important; }
  body { background: #fff; }
}

/* ---------- 工具类 ---------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
}
.eyebrow::before {
  content: "";
  width: 26px; height: 1px;
  background: var(--accent);
}
.section--deep .eyebrow { color: var(--deep-muted); }
.section--deep .eyebrow::before { background: var(--accent-bright); }

.lead { font-size: var(--fs-md); color: var(--muted); line-height: 1.8; max-width: 60ch; }
.section--deep .lead { color: var(--deep-muted); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.tnum { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.center p, .center .lead { margin-inline: auto; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; left: var(--sp-4); top: -100px;
  background: var(--ink); color: var(--bg);
  padding: var(--sp-2) var(--sp-3); z-index: var(--z-overlay);
  border-radius: var(--r-sm); transition: top var(--dur-fast);
}
.skip-link:focus { top: var(--sp-4); }

/* 规则线 */
.rule { height: 1px; background: var(--line); border: 0; }
.rule--accent { background: var(--accent-line); }
.section--deep .rule { background: var(--deep-line); }

/* 徽标/标签 */
.tag-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: var(--fs-xs);
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 5px 11px; border-radius: var(--r-pill);
  border: 1px solid var(--line-strong); color: var(--muted);
}
.section--deep .tag-pill { border-color: var(--deep-line); color: var(--deep-muted); }

/* ---------- 响应式断点参考 ---------- */
@media (max-width: 1024px) {
  :root { --gutter: 1.5rem; }
}
@media (max-width: 640px) {
  body { line-height: 1.7; }
  .section { padding-block: 3.5rem; }
}

/* ==========================================================================
   RTL 基础镜像（阿拉伯语）
   原则：flex / grid 随 direction 自动镜像，不重复写；
   这里只翻转「写死方向」的部分 —— 文本对齐、绝对定位的常用角、发丝线。
   深度镜像（每个组件逐一调参）等阿语成为主要语言时再做。
   ========================================================================== */
[dir="rtl"] {
  direction: rtl;
  --font-serif: "Noto Naskh Arabic", "Noto Serif TC", Georgia, serif;
  --font-sans: "Noto Naskh Arabic", "Noto Sans TC", -apple-system, sans-serif;
}
[dir="rtl"] body { text-align: right; }
[dir="rtl"] p,
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3,
[dir="rtl"] .lead { text-align: right; }
[dir="rtl"] .hero__foot-item,
[dir="rtl"] .tag-pill,
[dir="rtl"] .btn,
[dir="rtl"] .lang-switch__btn { flex-direction: row; }  /* flex 随 direction 自动镜像，显式声明防外部干扰 */
[dir="rtl"] .eyebrow,
[dir="rtl"] .tag-pill { letter-spacing: 0; }            /* 字距在阿语里破坏连写 */
[dir="rtl"] .hero__supertitle { letter-spacing: 0; }
[dir="rtl"] .rule { transform: scaleX(-1); }
/* 抽屉：从右滑入 */
[dir="rtl"] .drawer__panel { left: 0; right: auto; transform: translateX(-102%); }
[dir="rtl"] .drawer.is-open .drawer__panel { transform: translateX(0); }
/* 表单与表格 */
[dir="rtl"] input, [dir="rtl"] textarea, [dir="rtl"] select { text-align: right; }
[dir="rtl"] table.data th, [dir="rtl"] table.data td { text-align: right; }
[dir="rtl"] .pastebar { flex-direction: row-reverse; }
/* 代码/数字仍保持 LTR（价格、编号、追踪号是方向中立的） */
[dir="rtl"] .mono, [dir="rtl"] code, [dir="rtl"] .price,
[dir="rtl"] .routemap__badge, [dir="rtl"] .weight-bar { direction: ltr; }
/* 回退英文的长句在 RTL 页面里按内容自身方向渲染，避免标点与词序错乱 */
[dir="rtl"] .hero h1 span,
[dir="rtl"] .hero__supertitle,
[dir="rtl"] .hero .lead,
[dir="rtl"] .section-title,
[dir="rtl"] p { unicode-bidi: plaintext; }

/* ==========================================================================
   motion 层：逐字揭示 / 3D 倾斜
   ========================================================================== */
.char-wrap { display: inline-block; overflow: hidden; vertical-align: bottom; }
.char {
  display: inline-block;
  transform: translateY(105%);
  transition: transform .7s cubic-bezier(.16,1,.3,1);
  will-change: transform;
}
[data-split-chars].is-in .char,
.char-ready.is-in .char { transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .char { transform: none !important; transition: none !important; }
}

[data-tilt] {
  transition: transform .35s cubic-bezier(.16,1,.3,1), box-shadow .35s ease;
  transform-style: preserve-3d;
  will-change: transform;
}
[data-tilt]:hover { box-shadow: var(--shadow-3); }
@media (prefers-reduced-motion: reduce), (hover: none) {
  [data-tilt] { transition: none; }
}

/* ==========================================================================
   微交互密度（React Bits / Aceternity / UIverse 拆解后落地的部分）
   ========================================================================== */

/* 章节大数字：eyebrow 前的超轻描边数字 */
.sec-num {
  font-family: var(--font-display);
  font-size: 1.15em; font-weight: 600; font-style: italic;
  color: transparent;
  -webkit-text-stroke: 1px var(--accent);
  margin-right: 14px; letter-spacing: 0;
  opacity: .85;
}

/* 链接下划线滑入（导航 / 页脚 / 正文内链接） */
.nav__menu a, .footer a, .drawer a, p a, .topbar__links a {
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat; background-position: 0 100%;
  background-size: 0% 1px;
  transition: background-size var(--dur-base) var(--ease-out);
}
.nav__menu a:hover, .footer a:hover, .drawer a:hover, p a:hover, .topbar__links a:hover {
  background-size: 100% 1px;
}
@media (prefers-reduced-motion: reduce) {
  .nav__menu a, .footer a, .drawer a, p a, .topbar__links a { transition: none; }
}

/* 商品卡图片悬停微缩放 */
.pcard__media { overflow: hidden; }
.pcard__media svg { transition: transform .6s var(--ease-out); }
.pcard:hover .pcard__media svg { transform: scale(1.045); }

/* ---------- Aceternity 式强调层 ---------- */
/* 光晕：hero / 深色区块的极光底 */
.glow-field { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.glow-field::before, .glow-field::after {
  content: ""; position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: .16; will-change: transform;
}
.glow-field::before {
  width: 46vw; height: 46vw; left: -8vw; top: -18vw;
  background: radial-gradient(circle, var(--accent-bright), transparent 65%);
  animation: glow-drift 22s ease-in-out infinite alternate;
}
.glow-field::after {
  width: 38vw; height: 38vw; right: -10vw; bottom: -14vw;
  background: radial-gradient(circle, var(--gold), transparent 65%);
  animation: glow-drift 26s ease-in-out infinite alternate-reverse;
}
@keyframes glow-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(6vw, 4vh, 0) scale(1.15); }
}
@media (prefers-reduced-motion: reduce) {
  .glow-field::before, .glow-field::after { animation: none; }
}

/* 流光描边按钮（primary CTA 专属） */
@keyframes border-beam {
  to { --beam-angle: 360deg; }
}
@property --beam-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.btn--accent {
  position: relative;
}
.btn--accent::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit;
  padding: 1px; pointer-events: none;
  background: conic-gradient(from var(--beam-angle),
    transparent 0deg, transparent 250deg,
    rgba(255,255,255,.85) 285deg, transparent 320deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity var(--dur-base);
}
.btn--accent:hover::before, .btn--accent:focus-visible::before {
  opacity: 1; animation: border-beam 2.6s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .btn--accent::before { display: none; }
}

/* 移动端整体字号缩小（客户反馈：字体太大）——全站 rem 字号随根字号等比缩 10% */
@media (max-width: 768px) {
  html { font-size: 90%; }
}

/* ===== 补丁10 F-04：iOS 滑动拉屏/抖动根治 ===== */
html { overscroll-behavior-y: none; }
body { position: relative; }
/* iOS 聚焦自动缩放：输入类控件字号 ≥16px */
@media (max-width: 768px) {
  input, select, textarea { font-size: 16px !important; }
}
