/* =========================================================
   SoftWindy 车机多语言系统升级官网
   纯静态页面，无外部依赖（国内访问不加载任何境外字体/CDN）
   ========================================================= */

:root {
  --fog: #E9EDF1;        /* 页面底色：展厅冷灰 */
  --paper: #F6F8FA;      /* 浅色面板 */
  --graphite: #1A222D;   /* 正文 */
  --steel: #50607A;      /* 次级文字 */
  --line: #C9D1DA;       /* 分隔线 */
  --cabin: #0F2236;      /* 深色座舱 */
  --cabin-2: #183553;
  --amber: #F0A202;      /* 转向灯琥珀色：唯一强调色 */
  --amber-soft: rgba(240, 162, 2, .16);

  --font-display: "Bahnschrift", "DIN Alternate", "DIN Pro", "Barlow Semi Condensed", "Arial Narrow", "Microsoft YaHei", "PingFang SC", sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Noto Sans", sans-serif;

  --wrap: 1240px;
  --gutter: clamp(20px, 4vw, 48px);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.65, 0, .35, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fog);
  color: var(--graphite);
  font: 400 1rem/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
ol, ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--cabin); color: #fff; padding: 10px 16px; border-radius: 6px; text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- 语言切换时文字过渡 ---------- */
[data-i18n] { transition: opacity .22s ease, transform .22s ease, filter .22s ease; }
.i18n-out { opacity: 0; transform: translateY(6px); filter: blur(3px); }

/* ---------- 页面加载编排 ---------- */
.load-in { opacity: 0; transform: translateY(14px); }
body.is-ready .load-in {
  opacity: 1; transform: none;
  transition: opacity .8s var(--ease-out) var(--d, 0s), transform .8s var(--ease-out) var(--d, 0s);
}

/* ========================= Header ========================= */
.site-header {
  position: sticky; top: 0; z-index: 50;
  transition: background-color .35s ease, box-shadow .35s ease, backdrop-filter .35s ease;
  transform: translateY(-100%);
}
body.is-ready .site-header { transform: none; transition: transform .7s var(--ease-out), background-color .35s ease, box-shadow .35s ease; }
.site-header.is-scrolled {
  background: rgba(233, 237, 241, .82);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  box-shadow: 0 1px 0 var(--line);
}
.header-inner { display: flex; align-items: center; gap: 32px; height: 72px; transition: height .35s ease; }
.site-header.is-scrolled .header-inner { height: 60px; }
/* 滚动到深色段落时页头同步变深 */
.site-header.on-dark.is-scrolled { background: rgba(15, 34, 54, .84); box-shadow: 0 1px 0 rgba(255,255,255,.08); }
.site-header.on-dark .brand { color: #E7EEF6; }
.site-header.on-dark .site-nav a { color: #9FB2C8; }
.site-header.on-dark .site-nav a:hover, .site-header.on-dark .site-nav a.is-current { color: #fff; }
.site-header.on-dark .lang-switch { background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.site-header.on-dark .lang-switch button { color: #9FB2C8; }
.site-header.on-dark .lang-switch button[aria-pressed="true"] { color: var(--cabin); }
.site-header.on-dark .lang-thumb { background: var(--amber); }
.brand { transition: color .35s ease; }
.lang-switch { transition: background-color .35s ease, box-shadow .35s ease; }
.lang-thumb { transition: transform .45s var(--ease-out), background-color .35s ease; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--cabin); }
.brand-mark { width: 30px; height: 30px; transition: transform .6s var(--ease-out); }
.brand:hover .brand-mark { transform: rotate(-90deg); }
.brand-name { font: 600 1.2rem/1 var(--font-display); letter-spacing: .01em; }

.site-nav { display: flex; gap: 28px; margin-left: auto; }
.site-nav a {
  position: relative; text-decoration: none; color: var(--steel); font-size: .95rem; padding: 6px 0;
  transition: color .2s ease;
}
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--amber);
  transform: scaleX(0); transform-origin: right; transition: transform .35s var(--ease-out);
}
.site-nav a:hover, .site-nav a.is-current { color: var(--graphite); }
.site-nav a:hover::after, .site-nav a.is-current::after { transform: scaleX(1); transform-origin: left; }

.lang-switch {
  position: relative; display: inline-flex; padding: 3px; border-radius: 999px;
  background: #fff; box-shadow: inset 0 0 0 1px var(--line);
}
.lang-switch button {
  position: relative; z-index: 1; border: 0; background: none; cursor: pointer;
  font: 600 .85rem/1 var(--font-body); color: var(--steel);
  padding: 8px 14px; border-radius: 999px; min-width: 52px; transition: color .3s ease;
}
.lang-switch button[aria-pressed="true"] { color: #fff; }
.lang-thumb {
  position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px);
  background: var(--cabin); border-radius: 999px; transition: transform .45s var(--ease-out);
}
.lang-switch[data-active="en"] .lang-thumb { transform: translateX(100%); }

/* ========================= Hero ========================= */
.hero { padding: clamp(28px, 5vw, 56px) 0 clamp(56px, 8vw, 96px); }
.hero-head {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 24px 64px; align-items: end;
}
.hero-title {
  font: 600 clamp(1.5rem, 2.6vw, 2.1rem)/1.25 var(--font-display);
  color: var(--cabin);
}
.hero-lead { color: var(--steel); max-width: 38em; font-size: 1.02rem; }

/* 大字：随演示语言切换的那句话 */
.phrase {
  margin: clamp(20px, 3vw, 36px) 0 clamp(20px, 3vw, 32px);
  min-height: 1.15em;
  font: 600 clamp(2.3rem, 6.4vw, 5.6rem)/1.08 var(--font-display);
  font-stretch: 87.5%;
  letter-spacing: -.01em;
  color: var(--cabin);
  text-align: start;
  transition: text-align 0s;
}
.phrase .w {
  display: inline-block; white-space: pre;
  opacity: 0; transform: translateY(.45em); filter: blur(8px);
  transition: opacity .55s var(--ease-out), transform .7s var(--ease-out), filter .55s var(--ease-out);
  transition-delay: calc(var(--i) * 70ms);
}
.phrase.is-in .w { opacity: 1; transform: none; filter: none; }
.phrase.is-out .w {
  opacity: 0; transform: translateY(-.35em); filter: blur(6px);
  transition-duration: .3s; transition-delay: calc(var(--i) * 30ms);
}
.phrase[dir="rtl"] { text-align: right; }

/* 控制台：左侧语言列表 + 车机屏 */
.console { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(16px, 2.4vw, 32px); align-items: start; }

.rail { padding-top: 6px; }
.rail-title { font-size: .85rem; color: var(--steel); margin-bottom: 10px; padding-left: 18px; }
.rail-list { position: relative; display: flex; flex-direction: column; }
.rail-indicator {
  position: absolute; z-index: 2; left: 0; top: 0; width: 3px; height: 58px; border-radius: 3px; background: var(--amber);
  transition: transform .55s var(--ease-out), height .55s var(--ease-out);
}
.rail-item {
  position: relative; display: grid; gap: 1px; text-align: start;
  border: 0; background: none; cursor: pointer; color: var(--steel);
  padding: 9px 12px 9px 18px; min-height: 58px; border-radius: 0 10px 10px 0;
  transition: color .25s ease, background-color .25s ease;
  overflow: hidden;
}
.rail-item:hover { color: var(--graphite); background: rgba(255,255,255,.55); }
.rail-item[aria-selected="true"] { color: var(--cabin); background: #fff; }
.rail-native { font: 600 1.12rem/1.3 var(--font-display); justify-self: start; text-align: left; unicode-bidi: isolate; }
.rail-local { justify-self: start; }
.rail-local { font-size: .78rem; opacity: .8; }
.rail-item .rail-timer {
  position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--amber-soft);
  transform: scaleX(0); transform-origin: left;
}
.rail-item[aria-selected="true"].is-timing .rail-timer { animation: railTimer var(--cycle, 7s) linear forwards; }
@keyframes railTimer { to { transform: scaleX(1); } }

/* 车机屏 */
.screen-wrap { margin: 0; }
.bezel {
  position: relative; padding: clamp(6px, .9vw, 12px); border-radius: clamp(14px, 1.6vw, 22px);
  background: linear-gradient(160deg, #22344A, var(--cabin) 55%);
  box-shadow: 0 30px 60px -30px rgba(15, 34, 54, .55), 0 0 0 1px rgba(255,255,255,.04) inset;
}
.screen {
  position: relative; aspect-ratio: 2556 / 1436; overflow: hidden;
  border-radius: clamp(8px, 1vw, 12px); background: #050B12;
}
.screen-video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.025);
  transition: opacity .7s ease, transform 1.2s var(--ease-out);
}
.screen-video.is-active { opacity: 1; transform: none; }
.screen-glare {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,.10) 0%, rgba(255,255,255,0) 32%);
  mix-blend-mode: screen;
}
/* 开机动画：屏幕从一条亮线展开 */
.bezel .screen { clip-path: inset(49.5% 0 49.5% 0); }
.bezel .screen::after {
  content: ""; position: absolute; inset: 0; background: #DDE8F5; opacity: .9; pointer-events: none;
}
.bezel.is-on .screen { clip-path: inset(0 0 0 0); transition: clip-path .9s var(--ease-io) .1s; }
.bezel.is-on .screen::after { opacity: 0; transition: opacity .8s ease .75s; }

.screen-caption {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-top: 14px; font-size: .92rem; color: var(--steel); min-height: 1.6em;
}
#heroCaption { flex: 1 1 0; min-width: 0; color: var(--graphite); transition: opacity .3s ease, transform .3s ease; }
#heroCaption.is-swapping { opacity: 0; transform: translateX(-6px); }
.caption-note { margin-left: auto; font-size: .82rem; }
.rec-dot { flex: none; align-self: center; width: 8px; height: 8px; border-radius: 50%; background: #E5484D; animation: rec 1.6s ease-in-out infinite; }
@keyframes rec { 50% { opacity: .25; } }

.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: clamp(28px, 4vw, 44px); padding-left: calc(220px + clamp(16px, 2.4vw, 32px)); }

/* 按钮 */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px; border-radius: 999px; overflow: hidden;
  font: 600 .98rem/1 var(--font-body); text-decoration: none; cursor: pointer; isolation: isolate;
  transition: transform .25s var(--ease-out), box-shadow .25s ease, color .25s ease;
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  transform: translateX(-101%); transition: transform .45s var(--ease-out);
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--cabin); color: #fff; }
.btn-primary::before { background: var(--cabin-2); }
.btn-primary:hover::before { transform: none; }
.btn-ghost { color: var(--cabin); box-shadow: inset 0 0 0 1.5px var(--cabin); }
.btn-ghost::before { background: var(--cabin); }
.btn-ghost:hover { color: #fff; }
.btn-ghost:hover::before { transform: none; }

/* ========================= 通用段落标题 ========================= */
.section-head { max-width: 760px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head h2 {
  font: 600 clamp(1.9rem, 3.8vw, 3rem)/1.15 var(--font-display);
  font-stretch: 87.5%; color: inherit; margin-bottom: 14px;
}
.section-head p { color: var(--steel); font-size: 1.05rem; max-width: 40em; }

/* 滚动出现 */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease-out), transform .9s var(--ease-out); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ========================= Layers（深色座舱段） ========================= */
.layers {
  background: var(--cabin); color: #E7EEF6;
  padding: clamp(72px, 10vw, 128px) 0;
  clip-path: polygon(0 0, 100% 3vw, 100% 100%, 0 100%);
  margin-top: -3vw;
}
.layers .section-head p { color: #9FB2C8; }
.layers-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); }
.layers-stage { position: sticky; top: 96px; align-self: start; }
.bezel-dark { background: linear-gradient(160deg, #24405F, #0A1828 60%); box-shadow: 0 40px 80px -40px rgba(0,0,0,.7); }
.stage-meter { margin-top: 18px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.1); overflow: hidden; }
.stage-meter span { display: block; height: 100%; width: 0; background: var(--amber); transition: width .6s var(--ease-out); }

.layer-list { counter-reset: none; }
.layer {
  padding: clamp(36px, 7vh, 72px) 0 clamp(36px, 7vh, 72px) 24px;
  border-left: 1px solid rgba(255,255,255,.12);
  position: relative; min-height: 46vh; display: flex; flex-direction: column; justify-content: center;
  color: #7F93AA; transition: color .5s ease;
}
.layer::before {
  content: ""; position: absolute; left: -1px; top: 50%; width: 2px; height: 0; background: var(--amber);
  transform: translateY(-50%); transition: height .6s var(--ease-out);
}
.layer.is-active { color: #E7EEF6; }
.layer.is-active::before { height: 64%; }
.layer h3 {
  font: 600 clamp(1.4rem, 2.4vw, 2rem)/1.2 var(--font-display); margin-bottom: 10px;
  transition: transform .5s var(--ease-out);
}
.layer.is-active h3 { transform: translateX(6px); }
.layer p { max-width: 30em; }
.layer-media { display: none; }

/* 语音波形 */
.wave { display: flex; align-items: center; gap: 4px; height: 36px; margin-top: 18px; }
.wave i { width: 4px; height: 20%; border-radius: 2px; background: currentColor; opacity: .55; }
.layer.is-active .wave i { background: var(--amber); opacity: 1; animation: wave 1.1s ease-in-out infinite; }
.wave i:nth-child(1) { animation-delay: -.9s } .wave i:nth-child(2) { animation-delay: -.2s }
.wave i:nth-child(3) { animation-delay: -.6s } .wave i:nth-child(4) { animation-delay: -1s }
.wave i:nth-child(5) { animation-delay: -.4s } .wave i:nth-child(6) { animation-delay: -.75s }
.wave i:nth-child(7) { animation-delay: -.1s } .wave i:nth-child(8) { animation-delay: -.55s }
.wave i:nth-child(9) { animation-delay: -.85s } .wave i:nth-child(10) { animation-delay: -.3s }
.wave i:nth-child(11) { animation-delay: -.65s } .wave i:nth-child(12) { animation-delay: -.15s }
@keyframes wave { 0%, 100% { height: 18%; } 50% { height: 100%; } }

/* ========================= 车型矩阵 ========================= */
.models { padding: clamp(72px, 10vw, 128px) 0 clamp(48px, 7vw, 88px); }
.matrix-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 16px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.matrix { width: 100%; min-width: 720px; border-collapse: collapse; font-size: .95rem; }
.matrix th, .matrix td { padding: 16px 14px; text-align: center; border-bottom: 1px solid var(--line); }
.matrix tbody tr:last-child th, .matrix tbody tr:last-child td { border-bottom: 0; }
.matrix thead th { font-weight: 600; color: var(--steel); font-size: .85rem; background: #EEF2F6; }
.matrix thead th .native { display: block; font: 600 1.05rem/1.3 var(--font-display); color: var(--graphite); }
.matrix th[scope="row"], .matrix thead th:first-child { text-align: start; padding-left: 24px; }
.matrix th[scope="row"] { font-weight: 600; white-space: nowrap; }
.matrix tbody tr { transition: background-color .25s ease; }
.matrix tbody tr:hover { background: #fff; }
.matrix td.col-hover, .matrix th.col-hover { background: rgba(240,162,2,.07); }

.dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line); vertical-align: middle; }
.dot.is-on { background: var(--amber); box-shadow: 0 0 0 4px var(--amber-soft); }
.matrix .dot { transform: scale(0); transition: transform .5s var(--ease-out); transition-delay: var(--dd, 0s); }
.matrix.is-lit .dot { transform: scale(1); }
.matrix-legend { display: flex; align-items: center; gap: 10px; margin-top: 16px; color: var(--steel); font-size: .9rem; }

/* ========================= 升级流程 ========================= */
.process { padding: clamp(48px, 7vw, 88px) 0 clamp(80px, 11vw, 140px); }
.flash { --p: 0; }
.flash-bar {
  position: relative; height: 10px; border-radius: 10px; background: #D7DEE6; margin-bottom: 40px; overflow: visible;
}
.flash-fill {
  position: absolute; inset: 0 auto 0 0; width: calc(var(--p) * 1%); border-radius: inherit;
  background: linear-gradient(90deg, var(--cabin), var(--cabin-2));
  overflow: hidden;
}
.flash-fill::after {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(115deg, rgba(255,255,255,.0) 0 12px, rgba(255,255,255,.18) 12px 24px);
  animation: stripes 1s linear infinite;
}
.flash.is-done .flash-fill::after { animation: none; opacity: 0; transition: opacity .4s; }
@keyframes stripes { to { background-position: 52px 0; } }
.flash-pct {
  position: absolute; right: 0; top: -34px; font: 600 1.25rem/1 var(--font-display); color: var(--cabin);
  font-variant-numeric: tabular-nums;
}
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 32px); }
.step { position: relative; padding-top: 4px; color: var(--steel); transition: color .4s ease; }
.step-no {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  font: 600 1.1rem/1 var(--font-display); color: var(--steel);
  box-shadow: inset 0 0 0 1.5px var(--line); margin-bottom: 16px;
  transition: background-color .4s ease, color .4s ease, box-shadow .4s ease, transform .5s var(--ease-out);
}
.step h3 { font: 600 1.25rem/1.3 var(--font-display); color: var(--graphite); margin-bottom: 6px; opacity: .55; transition: opacity .4s ease; }
.step.is-done { color: var(--graphite); }
.step.is-done h3 { opacity: 1; }
.step.is-done .step-no { background: var(--amber); color: var(--cabin); box-shadow: none; transform: scale(1.08); }

.site-footer { background: #0A1828; color: #7F93AA; font-size: .88rem; }
.site-footer { padding-top: 1px; }
.footer-inner { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 24px; padding-top: 26px; padding-bottom: 26px; }
.footer-inner a { text-decoration: none; transition: color .2s ease; }
.footer-inner a:hover { color: #fff; }
.footer-inner .to-top { margin-left: auto; }

/* ========================= 响应式 ========================= */
@media (max-width: 960px) {
  .site-nav { display: none; }
  .lang-switch { margin-left: auto; }
  .hero-head { grid-template-columns: 1fr; }
  .console { grid-template-columns: minmax(0, 1fr); }
  .rail { padding-top: 0; min-width: 0; }
  .rail-title { padding-left: 0; }
  .rail-list { flex-direction: row; overflow-x: auto; gap: 8px; padding-bottom: 6px; scrollbar-width: none; }
  .rail-list::-webkit-scrollbar { display: none; }
  .rail-indicator { display: none; }
  .rail-item { flex: 0 0 auto; border-radius: 12px; padding: 8px 14px; min-height: 0; box-shadow: inset 0 0 0 1px var(--line); }
  .rail-item[aria-selected="true"] { box-shadow: inset 0 0 0 2px var(--amber); }
  .hero-cta { padding-left: 0; }

  .layers-grid { grid-template-columns: 1fr; }
  .layers-stage { display: none; }
  .layer { min-height: 0; color: #E7EEF6; padding: 28px 0 28px 20px; }
  .layer-media { display: block; margin-top: 18px; border-radius: 12px; overflow: hidden; background: #050B12; aspect-ratio: 2556 / 1436; }
  .layer-media video { width: 100%; height: 100%; object-fit: cover; }

  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 32px; }
}
@media (max-width: 560px) {
  .brand-name { display: none; }
  .steps { grid-template-columns: 1fr; }
  .caption-note { margin-left: 18px; width: 100%; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  .footer-inner .to-top { margin-left: 0; }
}

/* ========================= 减少动态效果 ========================= */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  .load-in, .reveal { opacity: 1; transform: none; }
  .bezel .screen { clip-path: none; }
  .bezel .screen::after { display: none; }
}
