/* ==========================================================================
   ZENYX 官网 · 视觉动效与聚合布局增强层
   依赖 style.css；色板严格限定 #092059 / #19A8D3 / #FFFFFF
   所有动效均提供 prefers-reduced-motion 降级
   ========================================================================== */

/* ------------------------------ 滚动进度 ------------------------------ */
.scroll-progress {
  position: fixed; top: 0; left: 0; z-index: 220;
  height: 2px; width: 0;
  background: linear-gradient(90deg, var(--cyan), #6fd8f2);
  box-shadow: 0 0 12px rgba(25, 168, 211, .55);
  pointer-events: none;
  transition: width .08s linear;
}

/* ------------------------------ 全站搜索 ------------------------------ */
.search-trigger {
  display: inline-flex; align-items: center; gap: 9px; flex: none;
  min-height: 36px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 18px;
  background: var(--card); color: var(--muted);
  font-size: 12px; letter-spacing: .02em;
  transition: border-color .2s, background .2s, color .2s;
}
.search-trigger:hover { border-color: var(--cyan); color: var(--navy-900); background: #fff; }
.search-trigger .ico { width: 15px; height: 15px; }
.search-trigger kbd {
  font-family: var(--font-en); font-size: 12px; line-height: 1;
  padding: 3px 5px; border: 1px solid var(--line); border-radius: 4px;
  background: #fff; color: var(--faint);
}

.search-overlay {
  position: fixed; inset: 0; z-index: 300;
  width: 100%; max-width: 100vw; overflow: hidden;
  display: grid; justify-items: center; align-content: start;
  padding: 11vh 16px 32px;
  background: rgba(7, 29, 77, .54);
  backdrop-filter: blur(8px) saturate(130%);
  -webkit-backdrop-filter: blur(8px) saturate(130%);
  opacity: 0; visibility: hidden;
  transition: opacity .22s ease, visibility .22s;
}
.search-overlay.open { opacity: 1; visibility: visible; }
.search-panel {
  width: min(640px, 100%);
  background: #fff; border: 1px solid var(--line);
  border-radius: 18px; overflow: hidden;
  box-shadow: 0 30px 90px rgba(7, 29, 77, .28);
  transform: translateY(-14px) scale(.985);
  transition: transform .26s cubic-bezier(.2,.8,.2,1);
}
.search-overlay.open .search-panel { transform: none; }
.search-field { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.search-field .ico { width: 19px; height: 19px; color: var(--cyan); }
.search-field input {
  flex: 1; min-width: 0; border: 0; outline: 0;
  font-size: 16px; color: var(--navy-900); background: transparent;
}
.search-field input::placeholder { color: var(--faint); }
.search-close {
  border: 1px solid var(--line); border-radius: 6px; background: var(--card);
  padding: 3px 8px; font-size: 12px; color: var(--muted);
}
.search-summary { padding: 11px 22px 4px; font-size: 12px; letter-spacing: .08em; color: var(--faint); }
.search-results { max-height: min(52vh, 440px); overflow-y: auto; padding: 6px 10px 14px; }
.search-result {
  display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 11px; color: var(--body);
  transition: background .15s;
}
.search-result:hover, .search-result.selected { background: var(--card); }
.search-result .res-no { font-family: var(--font-en); font-size: 12px; color: var(--cyan); }
.search-result strong { display: block; font-size: 14px; color: var(--navy-900); }
.search-result small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.search-result .res-cat { font-size: 12px; color: var(--faint); }
.search-empty { padding: 34px 22px 44px; text-align: center; font-size: 14px; color: var(--muted); }
.search-foot {
  display: flex; gap: 18px; padding: 11px 22px;
  border-top: 1px solid var(--line); background: var(--card);
  font-size: 12px; color: var(--faint);
}
.search-foot span { display: inline-flex; align-items: center; gap: 5px; }
.search-foot kbd {
  font-family: var(--font-en); padding: 2px 5px; border: 1px solid var(--line);
  border-radius: 4px; background: #fff; color: var(--muted);
}

/* ------------------------------ AIGC 首屏 ------------------------------ */
.hero-media { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.hero-media img {
  width: 100%; height: 100%; object-fit: cover; object-position: center right;
  opacity: 0; transform: scale(1.05);
  animation: heroImageIn 1.5s cubic-bezier(.2,.7,.2,1) .1s forwards;
}
.hero-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg,
    #071d4d 0%, rgba(7,29,77,.97) 24%, rgba(7,29,77,.86) 40%,
    rgba(7,29,77,.45) 62%, rgba(7,29,77,.08) 88%);
}
.hero h1, .hero .hero-sub, .hero .hero-desc, .hero .hero-actions, .hero .hero-eyebrow, .hero .hero-stats {
  animation: heroRise .85s cubic-bezier(.2,.75,.2,1) both;
}
.hero .hero-eyebrow { animation-delay: .06s; }
.hero h1 { animation-delay: .16s; }
.hero .hero-sub { animation-delay: .27s; }
.hero .hero-desc { animation-delay: .36s; }
.hero .hero-actions { animation-delay: .45s; }
.hero .hero-stats { animation-delay: .56s; }
.hero h1 { text-wrap: balance; }
.stat strong, .kpi strong { font-variant-numeric: tabular-nums; }

@keyframes heroImageIn { to { opacity: 1; transform: scale(1); } }
@keyframes heroRise {
  from { opacity: 0; transform: translateY(22px); filter: blur(4px); }
  to { opacity: 1; transform: none; filter: blur(0); }
}

/* ------------------------------ 磁性交互 ------------------------------ */
[data-magnetic] { will-change: transform; }
[data-magnetic] > span { display: inline-flex; align-items: center; gap: 10px; will-change: transform; }

/* ------------------------------ 卡片聚合 / Bento ------------------------------ */
.bento-grid { grid-auto-rows: minmax(180px, auto); }
.bento-grid .tile { position: relative; overflow: hidden; }
.bento-grid .tile:first-child {
  grid-column: span 2; grid-row: span 2;
  padding: 38px; display: flex; flex-direction: column; justify-content: flex-end;
  border-color: transparent; color: #fff;
  background-image:
    linear-gradient(180deg, rgba(7,29,77,.20) 0%, rgba(7,29,77,.62) 42%, rgba(7,29,77,.94) 100%),
    url('../media/apps-modules.webp');
  background-size: cover; background-position: center;
  box-shadow: 0 20px 60px rgba(9,32,89,.20);
}
.bento-grid .tile:first-child::before {
  content: "APPLICATION SPOTLIGHT"; position: absolute; top: 26px; left: 38px;
  font-family: var(--font-en); font-size: 12px; letter-spacing: .16em; color: var(--cyan-soft);
}
.bento-grid .tile:first-child h3 { position: relative; margin-top: 12px; font-size: 28px; color: #fff; }
.bento-grid .tile:first-child p { position: relative; color: #c8d9f2; font-size: 14px; max-width: 400px; }
.bento-grid .tile:first-child .tile-more { position: relative; color: #7fdaf3; }
.bento-grid .tile:first-child .tile-ico { stroke: var(--cyan); width: 40px; height: 40px; }

/* 3D 倾斜 + 光泽扫过 */
.tilt-card { transform-style: preserve-3d; will-change: transform; }
.tilt-card > * { transform: translateZ(22px); }
.tilt-card::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--px, 50%) var(--py, 50%), rgba(25,168,211,.13), transparent 62%);
  opacity: 0; transition: opacity .3s;
}
.tilt-card:hover::before { opacity: 1; }
.shine-card { position: relative; overflow: hidden; }
.shine-card::after {
  content: ""; position: absolute; top: -60%; left: -120%;
  width: 55%; height: 220%; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.42), transparent);
  transform: skewX(-18deg);
  transition: left .72s cubic-bezier(.2,.7,.2,1);
}
.shine-card:hover::after { left: 150%; }

/* 子页面 AIGC 视觉质感 */
.subhero::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: url('../media/hero-network.webp') center 45% / cover no-repeat;
  opacity: .13; mix-blend-mode: screen;
}

/* 品牌无限滚动带 */
.brand-marquee {
  margin-top: 26px; padding: 20px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  overflow: hidden; position: relative;
}
.brand-marquee::before, .brand-marquee::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 90px; z-index: 2; pointer-events: none;
}
.brand-marquee::before { left: 0; background: linear-gradient(90deg, #fff, transparent); }
.brand-marquee::after { right: 0; background: linear-gradient(270deg, #fff, transparent); }
.marquee-track { display: flex; width: max-content; animation: marquee 42s linear infinite; }
.brand-marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-group { display: flex; align-items: center; gap: 46px; padding-right: 46px; }
.marquee-item {
  font-family: var(--font-en); font-size: 14px; font-weight: 700;
  letter-spacing: .08em; color: var(--navy-900); white-space: nowrap;
}
.marquee-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--cyan); flex: none; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* 渠道网络视觉带 */
.network-band {
  position: relative; height: 190px; margin: 0 0 44px;
  border-radius: 18px; overflow: hidden;
  background: url('../media/channels-globe.webp') center 42% / cover no-repeat, var(--navy-950);
}
.network-band::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(7,29,77,.90), rgba(7,29,77,.28) 55%, rgba(7,29,77,.70));
}
.network-band::after {
  content: "GLOBAL CHANNEL NETWORK / 渠道网络"; position: absolute; left: 38px; bottom: 28px;
  font-family: var(--font-en); font-size: 12px; letter-spacing: .16em; color: var(--cyan-soft);
}
.network-band .network-line {
  position: absolute; left: 38px; top: 34px; width: 42px; height: 2px; background: var(--cyan);
}

/* ------------------------------ 矩阵十字高亮 ------------------------------ */
.matrix-wrap { position: relative; }
.matrix tbody tr, .matrix td, .matrix tbody th { transition: background .18s, color .18s; }
.matrix td.hi, .matrix tbody th.hi { background: rgba(25,168,211,.11) !important; }
.matrix thead th.hi { background: var(--navy-850) !important; }
.matrix tbody tr:hover th { color: var(--cyan-dark); }

/* ------------------------------ 时间轴滚动激活 ------------------------------ */
.timeline li { transition: opacity .4s, transform .4s; }
.timeline li.active .dot { background: var(--cyan); color: #fff; box-shadow: 0 0 0 6px rgba(25,168,211,.14); }
.timeline .dot { transition: background .35s, color .35s, box-shadow .35s; }

/* ------------------------------ 筛选计数 ------------------------------ */
.filter-count { margin-left: auto; align-self: center; font-family: var(--font-en); font-size: 12px; color: var(--faint); }
.filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }

/* ------------------------------ 响应式降级 ------------------------------ */
@media (max-width: 1100px) {
  .search-trigger kbd { display: none; }
  .network-band { height: 158px; }
}
@media (max-width: 900px) {
  .hero-media img { object-position: 62% center; }
  .hero-media::after {
    background: linear-gradient(90deg, #071d4d 0%, rgba(7,29,77,.93) 42%, rgba(7,29,77,.62) 78%, rgba(7,29,77,.38) 100%);
  }
  .bento-grid { grid-auto-rows: minmax(150px, auto); }
  .bento-grid .tile:first-child { grid-column: span 2; grid-row: span 1; padding: 28px; }
  .bento-grid .tile:first-child::before { left: 28px; top: 20px; }
}
@media (max-width: 768px) {
  .search-trigger { padding: 0 11px; }
  .search-trigger span { display: none; }
  .network-band { height: 126px; margin-bottom: 30px; }
  .network-band::after { left: 22px; bottom: 18px; font-size: 12px; }
  .network-band .network-line { left: 22px; top: 22px; }
  .bento-grid .tile:first-child h3 { font-size: 22px; }
  .brand-marquee .marquee-group { gap: 28px; padding-right: 28px; }
}
@media (max-width: 640px) {
  .bento-grid .tile:first-child { grid-column: span 2; }
  .search-overlay { padding-top: 7vh; }
  .search-foot { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-progress { transition: none; }
  .hero-media img { animation: none; opacity: 1; transform: none; }
  .hero h1, .hero .hero-sub, .hero .hero-desc, .hero .hero-actions, .hero .hero-eyebrow, .hero .hero-stats { animation: none; opacity: 1; transform: none; filter: none; }
  .marquee-track { animation: none; }
  .tilt-card, .shine-card::after { display: none !important; }
  .search-panel, .search-overlay { transition: none; }
}
