/* ============================================================
   八州流体官网 · 视觉与交互增强层 v1
   叠加在 style.css 之后；移除本文件与 site-enhance.js 即可完整回退。
   设计基调：深海军蓝画布 / 精密仪器感 / 青色测量线
   ============================================================ */

/* ---------- 1. 补齐归档里记录、主样式却未落地的 token ---------- */
:root {
  --warn: #F5A623;        /* 金 */
  --accent-2: #35C98F;    /* 翡翠 */
  --accent-3: #7FA0E8;    /* 靛蓝 */
  --ink-2: #F2F6FB;
  --ease-out: cubic-bezier(.16, .8, .24, 1);
  --edge: rgba(0, 194, 224, .42);
  --hair: rgba(255, 255, 255, .07);
}

/* ---------- 2. 修复主样式中的残缺与深色适配遗留 ---------- */
/* 主样式 .line-card__specs 后有一段丢失选择器的孤立声明，重新落地 .spec */
.spec {
  background: var(--navy-700);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.specs-grid .spec { transition: border-color .25s, transform .25s; }
.specs-grid .spec:hover { border-color: var(--edge); transform: translateY(-2px); }

/* Hero 第二行强调色：原样式缺 .text-cyan 定义 */
.text-cyan {
  color: var(--cyan);
  text-shadow: 0 0 34px rgba(0, 194, 224, .32);
}
/* 页脚栏目标题原先误用边框色，几乎不可见 */
.footer__col-title { color: var(--slate-400); letter-spacing: 1px; }
/* 浅底残留改为深色玻璃标签 */
.case-card__tag {
  background: rgba(0, 194, 224, .10);
  border: 1px solid rgba(0, 194, 224, .26);
  color: var(--cyan);
}
.dblock__no { background: rgba(0, 194, 224, .13); color: var(--cyan); }
.inq__tip { color: #5EEAD4; }
.media-placeholder--diagram { border-color: #2C4A70; }
.prod-tile__media--xj {
  background:
    radial-gradient(ellipse at 32% 24%, rgba(53, 201, 143, .20), transparent 58%),
    radial-gradient(ellipse at 78% 78%, rgba(0, 194, 224, .20), transparent 60%),
    linear-gradient(135deg, #0E3355, #0A2540);
}
.prod-tile--dark { background: linear-gradient(180deg, #142943, #102037); }
.matrix__head { background: linear-gradient(90deg, #0F3B66, #145284); }
section[id] { scroll-margin-top: 96px; }

/* ---------- 3. 首屏：流光景深 + 图纸展台 ---------- */
.hero { isolation: isolate; }
.hero::before {
  content: "";
  position: absolute;
  inset: -30% -10% auto -10%;
  height: 150%;
  background:
    radial-gradient(ellipse 38% 34% at 72% 26%, rgba(0, 194, 224, .16), transparent 70%),
    radial-gradient(ellipse 30% 28% at 18% 74%, rgba(30, 111, 190, .18), transparent 72%);
  animation: heroDrift 22s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: -1;
}
.hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 120px;
  background: linear-gradient(180deg, transparent, rgba(13, 24, 40, .72));
  pointer-events: none;
}
@keyframes heroDrift {
  from { transform: translate3d(-3%, -2%, 0) scale(1); }
  to   { transform: translate3d(4%, 3%, 0) scale(1.08); }
}
.hero__title { text-shadow: 0 10px 40px rgba(3, 12, 26, .48); }
.hero__kicker-line {
  background: linear-gradient(90deg, var(--cyan), rgba(0, 194, 224, .15));
  box-shadow: 0 0 14px rgba(0, 194, 224, .55);
}
.hero__figure {
  padding: 20px 20px 14px;
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .012));
  border: 1px solid rgba(127, 168, 217, .18);
  box-shadow: 0 26px 60px rgba(3, 12, 26, .38), inset 0 1px 0 var(--hair);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform .5s var(--ease-out), border-color .35s;
}
.hero__figure:hover { transform: translateY(-5px); border-color: rgba(0, 194, 224, .34); }
.hero__svg { transition: transform .6s var(--ease-out); }
.hero__figure:hover .hero__svg { transform: scale(1.025); }
.hero__figure-badge {
  position: absolute;
  top: 14px; left: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-num);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.6px;
  color: var(--cyan);
  background: rgba(8, 22, 40, .72);
  border: 1px solid rgba(0, 194, 224, .26);
  border-radius: 999px;
  padding: 6px 12px;
}
.hero__figure-badge i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 4px rgba(0, 194, 224, .16);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 8px rgba(0, 194, 224, 0); } }
.hero__figure-cap { padding-bottom: 2px; }
.hero__badges { border-top-color: rgba(0, 194, 224, .22); }
.hbadge { border-left-color: rgba(127, 168, 217, .20); transition: transform .3s var(--ease-out); }
.hbadge:hover { transform: translateY(-3px); }
.hbadge__num { filter: drop-shadow(0 4px 18px rgba(0, 194, 224, .22)); }

/* ---------- 4. 章节标题：测量线装饰 ---------- */
.section__title { position: relative; padding-bottom: 16px; }
.section__title::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 76px; height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--cyan), rgba(0, 194, 224, 0));
  -webkit-text-fill-color: initial;
}
.kicker { letter-spacing: 3.2px; }
.mediabar__item { position: relative; transition: color .25s, letter-spacing .25s; }
.mediabar__item::before {
  content: "";
  display: inline-block;
  width: 5px; height: 5px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--cyan);
  vertical-align: middle;
  opacity: .7;
}
.mediabar__item:hover { color: var(--ink); }

/* ---------- 5. 卡片：统一描边、跟随光晕、层次 ---------- */
.qcard, .acard, .wcard, .pcard, .mcard, .step, .proof,
.prod-tile, .case-card, .contact-card, .xj-fig, .line-card, .about-fig {
  position: relative;
  isolation: isolate;
}
.qcard, .acard, .wcard, .pcard, .mcard, .step, .proof, .case-card {
  transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out), border-color .35s;
}
.qcard:hover, .acard:hover, .wcard:hover, .pcard:hover,
.mcard:hover, .step:hover, .proof:hover, .case-card:hover {
  border-color: var(--edge);
  box-shadow: 0 22px 48px rgba(3, 12, 26, .48), inset 0 1px 0 var(--hair);
  transform: translateY(-4px);
}
.qcard::before, .acard::before, .wcard::before, .mcard::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(280px circle at var(--mx, 50%) var(--my, 0%), rgba(0, 194, 224, .10), transparent 72%);
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
  z-index: -1;
}
.qcard:hover::before, .acard:hover::before,
.wcard:hover::before, .mcard:hover::before { opacity: 1; }
.qcard__fig img, .about-fig img, .xj-fig img, .dfig img {
  transition: transform .5s var(--ease-out);
}
.qcard:hover .qcard__fig img, .about-fig:hover img,
.xj-fig:hover img, .dfig:hover img { transform: scale(1.035); }
.qcard__fig, .about-fig, .xj-fig, .dfig { overflow: hidden; }
.prod-tile__link, .mcard__more, .pick-bar__link { transition: letter-spacing .25s, color .25s; }
.prod-tile:hover .prod-tile__link, .mcard:hover .mcard__more { letter-spacing: .6px; }
.proof__num { letter-spacing: -.3px; }
.matrix__row { transition: background .2s, box-shadow .2s; }
.matrix__row:hover {
  background: rgba(0, 194, 224, .07);
  box-shadow: inset 3px 0 0 var(--cyan);
}
.pick-bar { border-left-width: 3px; transition: box-shadow .3s; }
.pick-bar:hover { box-shadow: 0 12px 34px rgba(0, 194, 224, .09); }

/* ---------- 6. 按钮：光泽扫过 ---------- */
.btn { position: relative; overflow: hidden; transition: transform .2s var(--ease-out), box-shadow .25s, filter .2s; }
.btn::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 60%;
  left: -70%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .28), transparent);
  transform: skewX(-18deg);
  transition: left .65s var(--ease-out);
  pointer-events: none;
}
.btn:hover::after { left: 130%; }
.btn--primary { background: linear-gradient(135deg, #2479C8, #1E6FBE); box-shadow: 0 8px 24px rgba(30, 111, 190, .24); }
.btn--cyan { background: linear-gradient(135deg, #37D6EC, #00C2E0); box-shadow: 0 8px 26px rgba(0, 194, 224, .24); }
.btn--ghost, .btn--ghost-blue { border-color: rgba(127, 168, 217, .48); }
.btn--ghost:hover, .btn--ghost-blue:hover { border-color: var(--cyan); color: var(--cyan); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

/* ---------- 7. 页头：滚动收紧 + 当前区块指示 + 移动抽屉 ---------- */
.header { transition: background .3s, box-shadow .3s, border-color .3s; }
.header.is-scrolled {
  background: rgba(8, 18, 33, .94);
  box-shadow: 0 12px 34px rgba(3, 12, 26, .42);
  border-bottom-color: rgba(0, 194, 224, .18);
}
.header.is-scrolled .header__inner { height: 66px; }
.header__inner { transition: height .3s var(--ease-out); }
.nav__link { position: relative; padding: 6px 0; }
.nav__link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease-out);
}
.nav__link:hover::after, .nav__link.is-current::after { transform: scaleX(1); }
.nav__link.is-current { color: var(--cyan); }

.nav-toggle {
  display: none;
  width: 42px; height: 38px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  background: rgba(0, 194, 224, .08);
  border: 1px solid rgba(0, 194, 224, .26);
  border-radius: 8px;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 18px; height: 2px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform .28s var(--ease-out), opacity .2s;
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .header__inner { position: relative; }
  .header .nav {
    display: flex;
    position: absolute;
    top: calc(100% + 1px);
    left: -24px; right: -24px;
    flex-direction: column;
    gap: 0;
    padding: 10px 24px 18px;
    background: rgba(8, 18, 33, .98);
    border-bottom: 1px solid rgba(0, 194, 224, .20);
    box-shadow: 0 24px 40px rgba(3, 12, 26, .55);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: max-height .38s var(--ease-out), opacity .25s, padding .3s, visibility .25s;
  }
  .header .nav.is-open {
    max-height: 70vh;
    opacity: 1;
    visibility: visible;
    overflow-y: auto;
  }
  .header .nav .nav__link {
    font-size: 16px;
    padding: 13px 4px;
    border-bottom: 1px solid rgba(127, 168, 217, .12);
  }
  .header .nav .nav__link::after { display: none; }
  .header__inner > .btn--sm { margin-left: auto; margin-right: 10px; }
}

/* ---------- 8. 全局交互组件 ---------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--cyan), #7FA0E8, var(--accent-2));
  box-shadow: 0 0 12px rgba(0, 194, 224, .7);
  z-index: 300;
  pointer-events: none;
  transition: width .08s linear;
}
.to-top {
  position: fixed;
  right: 26px; bottom: 26px;
  width: 46px; height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(19, 35, 58, .92);
  border: 1px solid rgba(0, 194, 224, .34);
  color: var(--cyan);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(3, 12, 26, .45);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity .3s, transform .3s var(--ease-out), visibility .3s, border-color .25s;
  z-index: 250;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { border-color: var(--cyan); transform: translateY(-3px); }

/* reveal 交错节奏（配合 site-enhance.js 写入的 --reveal-delay） */
.reveal { transition-delay: var(--reveal-delay, 0ms); }
.hbadge__num, .stat__num, .proof__num { will-change: transform; }

/* ---------- 9. 低动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero::before { animation: none; }
  .hero__figure-badge i { animation: none; }
  .btn::after { display: none; }
  *, *::before, *::after { scroll-behavior: auto !important; }
}
