/* ================================================
   河北华晟智控电气有限公司 - 官网自定义样式 v2
   清新活泼 · 浅色玻璃拟态（液态玻璃按钮/卡片）
   ================================================ */
:root {
  --bg-0: #f5f9fd;
  --bg-1: #e9f1fa;
  --ink: #1e293b;
  --blue: #3b82f6;
  --indigo: #6366f1;
  --cyan: #06b6d4;
  --coral: #ff7f50;
  --amber: #f59e0b;
}

html { scroll-behavior: smooth; }
body {
  background: linear-gradient(180deg, var(--bg-0) 0%, var(--bg-1) 100%);
  color: #334155;
  font-family: "MiSans", "MiSans VF", "HarmonyOS Sans SC", "PingFang SC",
    "Source Han Sans SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { letter-spacing: .015em; color: var(--ink); }

/* 渐变标题字 */
.grad-blue {
  background: linear-gradient(100deg, #2563eb 10%, #06b6d4 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.grad-warm {
  background: linear-gradient(100deg, #ff7f50 10%, #f59e0b 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- 层级：3D背景永远在最底层 ---------- */
#bg3d, #bg2d {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none; display: block;
}
.site-ui { position: relative; z-index: 10; }

/* 背景之上的轻纱遮罩：保证文字可读又不压暗3D场景 */
.bg-scrim {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(ellipse at 28% 18%, rgba(255,255,255,.05) 0%, rgba(243,248,253,.42) 75%),
    linear-gradient(180deg, rgba(245,250,255,.18) 0%, rgba(236,244,251,.4) 100%);
}

/* ---------- 开屏动画层 ---------- */
#intro-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: radial-gradient(circle at 50% 32%, #ffffff 0%, #e3edf9 62%, #d4e3f5 100%);
  cursor: pointer; opacity: 1; overflow: hidden; touch-action: manipulation;
  transition: opacity .9s ease;
}
#intro-overlay.fade-out { opacity: 0; pointer-events: none; }
#intro-overlay canvas { width: 100%; height: 100%; display: block; }
#intro-skip {
  position: absolute; bottom: 6.5vh; left: 50%; transform: translateX(-50%);
  color: #64748b; font-size: 13px; letter-spacing: .32em; text-indent: .32em;
  padding: 10px 30px; border-radius: 9999px;
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: 0 6px 22px rgba(59,130,246,.14), inset 0 1px 0 rgba(255,255,255,.9);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  user-select: none; animation: introHint 2.4s ease-in-out infinite;
}
#intro-title {
  position: absolute; top: 11vh; left: 0; right: 0; text-align: center;
  color: #1e293b; letter-spacing: .42em; font-size: clamp(17px, 2.7vw, 32px);
  font-weight: 700; text-indent: .42em; opacity: 0;
  animation: introTitle 1.4s cubic-bezier(.2,.8,.3,1) .55s forwards;
}
#intro-sub {
  position: absolute; top: calc(11vh + 3.1em); left: 0; right: 0; text-align: center;
  letter-spacing: .7em; font-size: clamp(11px, 1.25vw, 15px); text-indent: .7em;
  background: linear-gradient(90deg, #2563eb, #06b6d4, #ff7f50);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  opacity: 0; animation: introTitle 1.4s ease 1.05s forwards;
}
#intro-progress {
  position: absolute; bottom: 0; left: 0; right: 0; height: 4px;
  background: rgba(59,130,246,.12);
}
#intro-progress span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #3b82f6, #06b6d4, #ff7f50);
  border-radius: 0 9999px 9999px 0;
}
@keyframes introTitle { from { transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes introHint { 0%,100% { opacity: .55; } 50% { opacity: 1; } }

@media (max-width: 900px) {
  #intro-title {
    top: max(58px, 8.4vh);
    padding: 0 18px;
    font-size: clamp(16px, 3.15vw, 24px);
    line-height: 1.45;
    letter-spacing: .16em;
    text-indent: .16em;
    white-space: nowrap;
    text-shadow: 0 1px 0 rgba(255,255,255,.85);
  }
  #intro-sub {
    top: calc(max(58px, 8.4vh) + 3.05em);
    padding: 0 18px;
    font-size: clamp(11px, 2.6vw, 13px);
    line-height: 1.5;
    letter-spacing: .28em;
    text-indent: .28em;
  }
  #intro-skip {
    bottom: calc(4.8vh + env(safe-area-inset-bottom));
    padding: 9px 20px;
    max-width: calc(100vw - 48px);
    white-space: nowrap;
    font-size: 12px;
    letter-spacing: .16em;
    text-indent: .16em;
    background: rgba(255,255,255,.68);
  }
  #intro-progress { height: 5px; }
}

/* ---------- 入场：UI 初始隐藏，开屏结束后淡入 + 轻微上移 ---------- */
body:not(.site-ready) #intro-overlay ~ .site-ui {
  opacity: 0; transform: translateY(26px);
}
body:not(.site-ready) #intro-overlay ~ .bg-scrim { opacity: 0; }
.site-ui { opacity: 1; transform: translateY(0); }
.bg-scrim { opacity: 0; transition: opacity 1.4s ease .1s; }
body.site-ready .site-ui {
  opacity: 1; transform: translateY(0);
  transition: opacity 1.3s ease .15s, transform 1.3s cubic-bezier(.22,.8,.32,1) .15s;
}
body.site-ready .bg-scrim { opacity: 1; }
#intro-overlay.fade-out ~ .site-ui {
  opacity: 1; transform: translateY(0);
  transition: opacity 1.3s ease .15s, transform 1.3s cubic-bezier(.22,.8,.32,1) .15s;
}
#intro-overlay.fade-out ~ .bg-scrim { opacity: 1; }

/* ---------- 导航（滚动后：白色液态玻璃） ---------- */
#navbar {
  transition: background-color .45s ease, backdrop-filter .45s ease,
              border-color .45s ease, box-shadow .45s ease;
  border-bottom: 1px solid transparent;
}
#navbar.nav-scrolled {
  background: rgba(255, 255, 255, .62);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  backdrop-filter: blur(18px) saturate(1.5);
  border-bottom-color: rgba(59, 130, 246, .12);
  box-shadow: 0 8px 30px rgba(30, 64, 175, .08);
}
.nav-link { position: relative; }
.nav-link::after {
  content: ""; position: absolute; left: 50%; bottom: -6px;
  width: 0; height: 3px; border-radius: 9999px;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  transition: width .3s ease, left .3s ease;
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; left: 0; }
.nav-link.active { color: var(--ink); font-weight: 600; }

#mobile-menu {
  max-height: 0; overflow: hidden;
  transition: max-height .45s cubic-bezier(.22,.8,.32,1);
  background: rgba(255, 255, 255, .9);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-radius: 0 0 22px 22px;
  box-shadow: 0 18px 40px rgba(30, 64, 175, .1);
}
#mobile-menu.open { max-height: 480px; }

/* ---------- 滚动显现动效 ---------- */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .9s ease, transform .9s cubic-bezier(.22,.8,.32,1); }
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-d1 { transition-delay: .12s; }
.reveal-d2 { transition-delay: .24s; }
.reveal-d3 { transition-delay: .36s; }

/* 展开式过渡（图片/图纸卡片） */
.sheet-unfold { opacity: 0; transform: perspective(900px) rotateX(30deg) translateY(34px); transform-origin: top center;
  transition: opacity 1s ease, transform 1s cubic-bezier(.2,.85,.3,1); }
.sheet-unfold.visible { opacity: 1; transform: perspective(900px) rotateX(0deg) translateY(0); }

/* ---------- 卡片悬浮微动效 ---------- */
.hover-lift { transition: transform .35s cubic-bezier(.22,.8,.32,1), box-shadow .35s ease, border-color .35s ease; }
.hover-lift:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 24px 48px rgba(59, 130, 246, .16), 0 0 0 1px rgba(59, 130, 246, .22);
  border-color: rgba(59, 130, 246, .35) !important;
}

/* 液态玻璃卡片（沿用 .metal-panel 类名） */
.metal-panel {
  background: rgba(255, 255, 255, .58);
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: 22px;
  box-shadow: 0 10px 34px rgba(30, 64, 175, .07), inset 0 1px 0 rgba(255,255,255,.9);
  -webkit-backdrop-filter: blur(18px) saturate(1.45);
  backdrop-filter: blur(18px) saturate(1.45);
  position: relative; overflow: hidden;
}
.metal-panel::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,.35) 0%, transparent 38%);
}
.rivet::after {
  content: ""; position: absolute; top: 12px; right: 12px; width: 7px; height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  opacity: .55;
}

.product-render-card { border-radius: 22px; }
.product-render-card::before { display: none; }
.product-render-head {
  min-width: 0;
  max-width: min(720px, 100%);
}
.product-render-desc {
  max-width: 680px;
  overflow-wrap: anywhere;
  line-break: anywhere;
}
.product-render-media {
  position: relative;
  height: 260px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(219,234,254,.72), rgba(255,255,255,.82));
}
.product-render-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .55s cubic-bezier(.22,.8,.32,1), filter .55s ease;
}
.product-render-card:hover .product-render-img {
  transform: scale(1.045);
  filter: saturate(1.08) contrast(1.03);
}
.product-render-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 6px 10px;
  border-radius: 9999px;
  background: rgba(255,255,255,.76);
  border: 1px solid rgba(255,255,255,.9);
  color: #2563eb;
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: .12em;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 18px rgba(30,64,175,.12);
}

@media (max-width: 640px) {
  .product-render-media { height: 220px; }
}

/* 活力渐变条（沿用 .hazard-bar 类名） */
.hazard-bar {
  height: 6px; border-radius: 9999px;
  background: linear-gradient(90deg, var(--coral), var(--amber), var(--cyan), var(--blue));
}

/* 蓝图网格背景（图纸感 · 浅色） */
.blueprint {
  background-color: rgba(59, 130, 246, .05);
  background-image:
    linear-gradient(rgba(59, 130, 246, .1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(59, 130, 246, .1) 1px, transparent 1px);
  background-size: 22px 22px;
}

/* 数字滚动统计 */
.stat-num { font-variant-numeric: tabular-nums; }

/* ---------- 表单 ---------- */
.form-input {
  background: rgba(255, 255, 255, .75);
  border: 1px solid rgba(100, 116, 139, .22);
  color: var(--ink); transition: border-color .3s, box-shadow .3s, background .3s; width: 100%;
  padding: .74rem 1.1rem; border-radius: 14px; font-size: .92rem;
}
.form-input::placeholder { color: #94a3b8; }
.form-input:focus {
  outline: none; border-color: var(--blue); background: rgba(255,255,255,.95);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, .14);
}
.form-input.err { border-color: var(--coral); box-shadow: 0 0 0 4px rgba(255, 127, 80, .15); }
.err-msg { color: #f4633a; font-size: .78rem; margin-top: .3rem; min-height: 1rem; }

/* ---------- 液态玻璃按钮 ---------- */
.btn-industrial, .btn-orange {
  border-radius: 9999px; text-align: center;
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  backdrop-filter: blur(12px) saturate(1.4);
  transition: transform .3s cubic-bezier(.22,.8,.32,1), box-shadow .3s ease, filter .3s ease;
  position: relative; overflow: hidden;
}
.btn-industrial:not(.hidden), .btn-orange:not(.hidden) { display: inline-block; }
.btn-industrial::before, .btn-orange::before {
  content: ""; position: absolute; inset: 1px; border-radius: 9999px; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.42), rgba(255,255,255,.05) 48%);
}
.btn-industrial {
  background: linear-gradient(135deg, rgba(59,130,246,.88), rgba(99,102,241,.88));
  border: 1px solid rgba(255, 255, 255, .55); color: #fff;
  box-shadow: 0 10px 26px rgba(59, 130, 246, .32), inset 0 1px 0 rgba(255,255,255,.45);
}
.btn-industrial:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 16px 34px rgba(59, 130, 246, .42); }
.btn-orange {
  background: linear-gradient(135deg, rgba(255,138,76,.92), rgba(255,111,60,.92));
  border: 1px solid rgba(255, 255, 255, .6); color: #fff; font-weight: 700;
  box-shadow: 0 10px 26px rgba(255, 122, 60, .34), inset 0 1px 0 rgba(255,255,255,.5);
}
.btn-orange:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 16px 34px rgba(255, 122, 60, .45); }

/* 章节标题装饰：圆润渐变竖条 */
.sec-title { position: relative; padding-left: 18px; }
.sec-title::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 6px; height: 78%; border-radius: 9999px;
  background: linear-gradient(180deg, var(--cyan), var(--blue));
}

/* 滚动条 */
::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-track { background: var(--bg-1); }
::-webkit-scrollbar-thumb { background: #b9cbe2; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--blue); }

/* 弱动效偏好 */
@media (prefers-reduced-motion: reduce) {
  .reveal, .sheet-unfold, .site-ui { transition: none !important; transform: none !important; opacity: 1 !important; }
}
