/* ==========================================================================
   卫视眼镜官网 · 现代体验增强层 (Modern Experience Layer)
   HTML5 / CSS Houdini / Scroll-driven Animations / View Transitions
   纯静态、零第三方依赖，全部特性均带渐进增强回退
   ========================================================================== */

/* ---------------------------------------------------------------- 能力探测 */

/* --------------------------------------------------------- Houdini 自定义属性 */
@property --shine {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
@property --glow {
  syntax: '<number>';
  inherits: false;
  initial-value: 0;
}

/* ------------------------------------------------------------------ 根变量 */
:root {
  --ease-out-expo: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --glass-bg: rgba(255, 255, 255, .62);
  --glass-brd: rgba(255, 255, 255, .55);
  --glass-blur: saturate(180%) blur(18px);
  --halo: 0 0 0 1px rgba(0, 160, 168, .22), 0 18px 46px -18px rgba(0, 160, 168, .45);
  --grad-brand: linear-gradient(120deg, #00a0a8 0%, #1273a8 46%, #12395c 100%);
  --grad-gold: linear-gradient(120deg, #f3c46b 0%, #e8a33d 52%, #c9842a 100%);
}

/* ------------------------------------------------------------------ 视图过渡 */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .28s var(--ease-out-expo) both; }
::view-transition-new(root) { animation: vt-in .38s var(--ease-out-expo) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-8px) scale(.985); } }
@keyframes vt-in  { from { opacity: 0; transform: translateY(14px) scale(.99); } }

.logo, .header { view-transition-name: none; }
.logo-text strong { view-transition-name: brand-mark; }

/* ------------------------------------------------- 滚动时收紧顶栏（scroll-driven） */
.header { transition: box-shadow .3s ease, background-color .3s ease; }
.js .header.is-scrolled {
  box-shadow: 0 6px 24px rgba(18, 57, 92, .12);
}
/* 毛玻璃由 .header::before 承载，这里同步调整其不透明度 */
.js .header.is-scrolled::before {
  background: rgba(255, 255, 255, .92);
}
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .js .header {
      animation: header-shrink linear both;
      animation-timeline: scroll(root block);
      animation-range: 0 120px;
    }
    @keyframes header-shrink {
      from { box-shadow: 0 0 0 rgba(18, 57, 92, 0); }
      to   { box-shadow: 0 6px 24px rgba(18, 57, 92, .14); }
    }
  }
}

/* ------------------------------------------------------------ 滚动进度指示器 */
.progress-rail {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 200;
  background: transparent; pointer-events: none;
}
.progress-rail > i {
  display: block; height: 100%; width: 0%;
  background: var(--grad-brand);
  box-shadow: 0 0 14px rgba(0, 160, 168, .75);
  transition: width .1s linear;
}

/* ------------------------------------------------------------------ 进场动画 */
.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .72s var(--ease-out-expo), transform .72s var(--ease-out-expo);
  will-change: opacity, transform;
}
.js .reveal.is-in { opacity: 1; transform: none; }
.js .reveal[data-d="1"] { transition-delay: .07s; }
.js .reveal[data-d="2"] { transition-delay: .14s; }
.js .reveal[data-d="3"] { transition-delay: .21s; }
.js .reveal[data-d="4"] { transition-delay: .28s; }
.js .reveal[data-d="5"] { transition-delay: .35s; }

.js .reveal-scale { opacity: 0; transform: scale(.94) translateY(16px); }
.js .reveal-scale.is-in {
  opacity: 1; transform: none;
  transition: opacity .8s var(--ease-out-expo), transform .8s var(--ease-spring);
}

.js .reveal-mask { clip-path: inset(0 0 100% 0); opacity: 0; }
.js .reveal-mask.is-in {
  clip-path: inset(0 0 0 0); opacity: 1;
  transition: clip-path .95s var(--ease-out-expo), opacity .5s ease;
}

/* ---------------------------------------------------------------- 玻璃拟态 */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-brd);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow);
}
.section--alt .glass, .section--dark .glass { }

/* ---------------------------------------------------------------- 光斑背景 */
.aurora {
  position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0;
}
.aurora::before, .aurora::after {
  content: ""; position: absolute; border-radius: 50%;
  filter: blur(70px);
  opacity: .5;
}
.aurora::before {
  width: 46vw; height: 46vw; left: -12vw; top: -18vw;
  background: radial-gradient(circle, rgba(0, 160, 168, .5), transparent 68%);
  animation: drift-a 22s ease-in-out infinite alternate;
}
.aurora::after {
  width: 38vw; height: 38vw; right: -10vw; bottom: -16vw;
  background: radial-gradient(circle, rgba(232, 163, 61, .38), transparent 68%);
  animation: drift-b 26s ease-in-out infinite alternate;
}
@keyframes drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(9vw, 7vh, 0) scale(1.22); }
}
@keyframes drift-b {
  from { transform: translate3d(0, 0, 0) scale(1.1); }
  to   { transform: translate3d(-8vw, -6vh, 0) scale(.92); }
}

/* ------------------------------------------------------------- 网格科技底纹 */
.grid-lines {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(120% 90% at 50% 20%, #000 25%, transparent 78%);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 20%, #000 25%, transparent 78%);
}

/* ------------------------------------------------------------------ Hero 增强 */
.hero {
  isolation: isolate;
  background: linear-gradient(115deg, #0b2233 0%, #12395c 55%, #17556e 100%);
}
.hero-slide { background: transparent; }
.hero-track { position: relative; z-index: 3; }
.aurora { z-index: 0; }
.grid-lines { z-index: 0; }
.hero-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 2; pointer-events: none; opacity: .85;
}
.hero-inner { z-index: 3; }
.hero-slide::after { z-index: 2; }
.hero-nav { z-index: 4; }

.hero-kicker {
  position: relative; padding-left: 44px;
  animation: fade-rise .8s var(--ease-out-expo) both;
}
.hero-kicker::before {
  position: absolute; left: 0; top: 50%; width: 34px; height: 2px;
  background: var(--grad-gold);
  transform: translateY(-50%);
  box-shadow: 0 0 12px rgba(232, 163, 61, .8);
}

.hero-title { text-wrap: balance; }
.hero-title::after {
  content: ""; display: block; height: 3px; width: 0;
  margin-top: 22px; border-radius: 3px;
  background: var(--grad-gold);
  box-shadow: 0 0 18px rgba(232, 163, 61, .55);
  animation: bar-grow 1.1s .35s var(--ease-out-expo) forwards;
}
@keyframes bar-grow { to { width: 128px; } }

.hero-sub { text-wrap: pretty; }

.js .hero-slide.is-active .hero-kicker { animation: fade-rise .8s var(--ease-out-expo) both; }
.js .hero-slide.is-active .hero-title { animation: fade-rise .9s .08s var(--ease-out-expo) both; }
.js .hero-slide.is-active .hero-sub { animation: fade-rise .9s .18s var(--ease-out-expo) both; }
.js .hero-slide.is-active .hero-stats { animation: fade-rise .9s .26s var(--ease-out-expo) both; }
.js .hero-slide.is-active .btn-row { animation: fade-rise .9s .34s var(--ease-out-expo) both; }
@keyframes fade-rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}

/* 数字发光：仅在支持 background-clip:text 时启用，避免文字变透明 */
.hero-stat b, .trust-item b {
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 12px rgba(232, 163, 61, .28);
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero-stat b, .trust-item b {
    background: linear-gradient(180deg, #fff 0%, var(--c-gold) 92%);
    -webkit-background-clip: text; background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
  }
}

/* ------------------------------------------------------------------ 按钮特效 */
.btn {
  position: relative; overflow: hidden; isolation: isolate;
  transition: transform .22s var(--ease-spring), box-shadow .22s ease, background-color .22s ease;
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(115deg, transparent 28%, rgba(255, 255, 255, .42) 48%, transparent 68%);
  transform: translateX(-120%);
  transition: transform .62s var(--ease-out-expo);
}
.btn:hover::before { transform: translateX(120%); }
.btn--primary:hover, .btn--accent:hover { box-shadow: 0 14px 34px -10px rgba(0, 160, 168, .6); }
.btn--gold:hover { box-shadow: 0 14px 34px -10px rgba(232, 163, 61, .65); }
.btn:active { transform: translateY(0) scale(.97); }

/* ------------------------------------------------------------------ 卡片 3D */
.js .tilt-card {
  transform-style: preserve-3d;
  transition: transform .28s var(--ease-out-expo), box-shadow .28s ease, border-color .25s ease;
}
.js .tilt-card.is-tilting { transition: box-shadow .28s ease, border-color .25s ease; }
.js .tilt-card .card-icon, .js .tilt-card .card-en { transform: translateZ(28px); }

/* 卡片顶部流光描边 */
.card { position: relative; overflow: hidden; }
.card::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  padding: 1px;
  background: linear-gradient(135deg, rgba(0, 200, 210, .55), transparent 42%, rgba(232, 163, 61, .45));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0; transition: opacity .35s ease;
}
.js .card:hover::after, .js .store-card:hover::after { opacity: 1; }

/* 卡片图标光环 */
.card-icon { position: relative; overflow: hidden; }
.card-icon::after {
  content: ""; position: absolute; inset: -50%;
  background: conic-gradient(from 0deg, transparent 0 62%, rgba(255, 255, 255, .5) 78%, transparent 92%);
  animation: icon-spin 4.5s linear infinite;
}
@keyframes icon-spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ 玻璃面板 */
.glass-panel {
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(255, 255, 255, .6);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  box-shadow: 0 14px 40px -22px rgba(18, 57, 92, .5);
}

/* ------------------------------------------------------- 聚光跟随指针 */
.hero, .page-hero, .story-hero, .section--dark { --mx: 78%; --my: 26%; }
.hero::before, .page-hero::before, .story-hero::before, .section--dark::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(46% 42% at var(--mx) var(--my),
              rgba(0, 190, 200, .30), transparent 68%);
}
.hero > *:not(.aurora):not(.grid-lines):not(.hero-canvas):not(.hero-nav) { position: relative; z-index: 3; }
.hero-nav { position: absolute; z-index: 4; }
.page-hero > .container, .story-hero > .container { position: relative; z-index: 3; }
.page-hero .aurora, .story-hero .aurora { z-index: 0; }
.page-hero .grid-lines, .story-hero .grid-lines { z-index: 0; }
.section--dark > .container { position: relative; z-index: 3; }

/* ------------------------------------------------------------- 磁性交互按钮 */
@media (hover: hover) and (pointer: fine) {
  .js .magnetic { transition: transform .28s var(--ease-spring); }
}

/* ---------------------------------------------------------------- 返回顶部 */
.to-top {
  position: fixed; right: 20px; bottom: 84px; z-index: 80;
  width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--c-primary); color: #fff; font-size: 20px; line-height: 1;
  display: grid; place-items: center;
  box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(14px) scale(.86);
  transition: all .3s var(--ease-out-expo);
}
.to-top.is-on { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--c-accent); transform: translateY(-3px); }
.to-top .ic-svg { width: 21px; height: 21px; }

/* -------------------------------------------------------------- 门店卡片动效 */
.js .store-card {
  transition: transform .3s var(--ease-out-expo), box-shadow .3s ease, border-color .25s ease;
}
.js .store-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 46px -20px rgba(0, 160, 168, .55), var(--shadow);
  border-color: rgba(0, 160, 168, .45);
}
.store-badge {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28);
  transition: transform .25s var(--ease-spring);
}
.js .store-card:hover .store-badge { transform: scale(1.06); }

/* ------------------------------------------------------------------ 时间轴 */
.js .tl-item .tl-body { transition: transform .32s var(--ease-out-expo), box-shadow .32s ease; }
.js .tl-item:hover .tl-body {
  transform: translateX(6px);
  box-shadow: 0 16px 40px -22px rgba(0, 160, 168, .6);
}
.tl-dot { transition: transform .3s var(--ease-spring), box-shadow .3s ease; }
.js .tl-item:hover .tl-dot { transform: scale(1.45); box-shadow: 0 0 0 8px rgba(0, 160, 168, .12); }

/* ------------------------------------------------------------------ 步骤条 */
.js .step { transition: transform .3s var(--ease-out-expo); }
.js .step:hover { transform: translateY(-4px); }
.step::before {
  box-shadow: 0 0 0 0 rgba(0, 160, 168, .5);
  transition: box-shadow .35s ease, background .3s ease;
}
.js .step:hover::before {
  background: var(--c-accent);
  box-shadow: 0 0 0 8px rgba(0, 160, 168, .12);
}

/* ------------------------------------------------------------------ FAQ 动效 */
.faq-item { transition: border-color .25s ease, box-shadow .3s ease, transform .3s var(--ease-out-expo); }
.faq-item[open] { box-shadow: 0 16px 40px -26px rgba(0, 160, 168, .6); }
.faq-q::after { transition: transform .28s var(--ease-spring), color .2s ease; }
.faq-item[open] .faq-q::after { transform: rotate(180deg); color: var(--c-accent); }

/* ------------------------------------------------------------------ 表格动效 */
table.data tbody tr { transition: background-color .2s ease; }
table.data tbody tr:hover { background: rgba(0, 160, 168, .06); }

/* ------------------------------------------------------------------ 分割线 */
.section { position: relative; }
.js .section + .section::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: min(1200px, 100% - 40px); height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 160, 168, .35), transparent);
}

/* ------------------------------------------------------------------ 页脚光效 */
.footer { position: relative; overflow: hidden; }
.footer::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60% 46% at 12% 0%, rgba(0, 160, 168, .18), transparent 70%),
    radial-gradient(50% 40% at 92% 14%, rgba(232, 163, 61, .14), transparent 70%);
}
.footer .container { position: relative; z-index: 1; }

/* ------------------------------------------------------------------ 排版增强 */
h1, h2, h3, .sec-title, .hero-title { text-wrap: balance; }
p { text-wrap: pretty; }
.page-hero h1 { letter-spacing: .01em; }
.sec-desc { max-width: 62ch; }

/* ------------------------------------------------------------------ 无障碍 */
@media (prefers-reduced-motion: reduce) {
  .js .reveal, .js .reveal-scale, .js .reveal-mask { opacity: 1 !important; transform: none !important; clip-path: none !important; }
  .aurora::before, .aurora::after { animation: none; }
  .hero-title::after { animation: none; width: 128px; }
  .cursor-glow { display: none; }
  .to-top { transition: none; }
  .card-icon::after { animation: none; }
  .btn::before { display: none; }
}

/* ------------------------------------------------------ 门店即时检索框 */
.locator { margin-bottom: 18px; }
.locator-field {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--c-line); border-radius: 999px;
  padding: 6px 8px 6px 18px; box-shadow: var(--shadow);
  transition: border-color .22s ease, box-shadow .22s ease;
}
.locator-field:focus-within {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 4px rgba(0, 160, 168, .14), var(--shadow);
}
.locator-ic { font-size: 19px; color: var(--c-accent-deep); line-height: 1; flex-shrink: 0; }
.locator-input {
  flex: 1; min-width: 0; border: 0; outline: none; background: transparent;
  font: inherit; font-size: 15px; color: var(--c-text); padding: 10px 0; min-height: 40px;
}
.locator-input::placeholder { color: var(--c-text-3); }
.locator-input::-webkit-search-cancel-button { display: none; }
.locator-clear {
  flex-shrink: 0; border: 0; background: var(--c-bg-2); color: var(--c-text-2);
  border-radius: 999px; padding: 7px 15px; font-size: 13px; cursor: pointer;
  min-height: 34px;
}
.locator-clear:hover { background: var(--c-accent); color: #fff; }
.locator-hint { margin-top: 8px; font-size: 13px; color: var(--c-text-2); padding-left: 6px; }

@media (max-width: 767px) {
  .locator-field { padding: 4px 6px 4px 14px; }
  .locator-input { font-size: 16px; }
}

/* ------------------------------------------------ 门店网络星座（首页） */
.section--net { background: linear-gradient(180deg, #f7fafc 0%, #eef4f9 100%); position: relative; overflow: hidden; }
.section--net::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(18, 57, 92, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 57, 92, .045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(110% 80% at 50% 40%, #000 30%, transparent 82%);
  -webkit-mask-image: radial-gradient(110% 80% at 50% 40%, #000 30%, transparent 82%);
}
.section--net > .container { position: relative; z-index: 2; }

.net-wrap {
  position: relative; border-radius: var(--radius-lg); overflow: hidden;
  background: linear-gradient(150deg, #0b2233, #12395c 58%, #17556e);
  box-shadow: var(--shadow-lg);
  padding: 8px;
}
.net-svg { display: block; width: 100%; height: auto; }

.net-link { stroke: rgba(0, 200, 210, .38); stroke-width: 1.4; stroke-dasharray: 5 7; }
.net-link--soft { stroke: rgba(232, 163, 61, .32); stroke-width: 1; stroke-dasharray: 3 5; }
.js .net-link { animation: net-flow 3.4s linear infinite; }
@keyframes net-flow { to { stroke-dashoffset: -48; } }

.net-halo {
  fill: rgba(0, 200, 210, .12);
  animation: net-pulse 3s ease-in-out infinite;
}
@keyframes net-pulse {
  0%, 100% { transform: scale(.85); opacity: .5; }
  50%      { transform: scale(1.18); opacity: .95; }
}
.net-ring {
  fill: rgba(11, 34, 51, .78);
  stroke: rgba(0, 210, 220, .85); stroke-width: 1.6;
}
.net-core { fill: var(--c-gold); }
.net-count {
  fill: #fff; font-size: 14px; font-weight: 700; text-anchor: middle;
  pointer-events: none;
}
.net-label {
  fill: rgba(255, 255, 255, .86); font-size: 14px; font-weight: 600;
  text-anchor: middle; pointer-events: none;
}
.net-legend {
  display: flex; flex-wrap: wrap; gap: 10px 26px; justify-content: center;
  list-style: none; margin: 18px 0 0; padding: 0;
  font-size: 13px; color: var(--c-text-2);
}
.net-legend span { display: inline-flex; align-items: center; gap: 8px; }
.net-dot {
  width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid var(--c-accent); background: #fff;
}
.net-dot--core { background: var(--c-gold); border-color: var(--c-gold); }
.net-line { width: 22px; height: 0; border-top: 2px dashed rgba(0, 160, 168, .6); }

@media (max-width: 767px) {
  .net-legend { font-size: 12px; gap: 8px 16px; }
  .net-label { font-size: 16px; }
  .net-count { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .js .net-link { animation: none; }
  .net-halo { animation: none; opacity: .7; }
}

/* ------------------------------------------------------------ 移动端降噪 */
@media (max-width: 767px) {
  .card-icon::after { animation: none; opacity: .4; }
  .btn::before { display: none; }
  .aurora::before, .aurora::after { opacity: .35; }
  .grid-lines { background-size: 40px 40px; }
  .to-top { bottom: 76px; width: 42px; height: 42px; }
}
