/* ================================================================
   隐士工作室 · 特效样式表 v1.0
   • 光晕光标  • 噪声纹理  • Preloader
   • 页面过渡  • 顶部导航  • 品牌数据
   • Toast     • 星空层
   ================================================================ */

/* ══════════════════════════════════════
   自定义光晕光标（仅桌面）
   ══════════════════════════════════════ */
#cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9997;
  background: radial-gradient(circle at center,
    rgba(99, 102, 241, 0.10) 0%,
    rgba(25, 200, 255, 0.05) 40%,
    transparent 70%
  );
  will-change: transform;
  transition: width 0.3s ease, height 0.3s ease;
}

#cursor-glow.hovered {
  width: 180px;
  height: 180px;
  background: radial-gradient(circle at center,
    rgba(99, 102, 241, 0.18) 0%,
    rgba(25, 200, 255, 0.09) 40%,
    transparent 70%
  );
}

@media (pointer: coarse), (max-width: 768px) {
  #cursor-glow { display: none !important; }
}

/* ══════════════════════════════════════
   噪声纹理叠层（film grain）
   ══════════════════════════════════════ */
.noise-overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.032;
  mix-blend-mode: screen;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.78' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: noiseShift 0.2s steps(1) infinite;
  will-change: transform;
}

@keyframes noiseShift {
  0%   { transform: translate(0,    0)    scale(1.4); }
  25%  { transform: translate(-4%, -3%)   scale(1.4); }
  50%  { transform: translate(3%,  5%)    scale(1.4); }
  75%  { transform: translate(5%,  -3%)   scale(1.4); }
  100% { transform: translate(-2%, 4%)    scale(1.4); }
}

@media (prefers-reduced-motion: reduce) {
  .noise-overlay { animation: none; }
}

/* ══════════════════════════════════════
   Preloader 启动屏
   ══════════════════════════════════════ */
#preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-xl);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

#preloader.done {
  opacity: 0;
  transform: scale(1.02);
  pointer-events: none;
}

.preloader-brand {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 300;
  letter-spacing: 10px;
  background: var(--gradient-text);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: textShimmer 2s ease-in-out infinite;
}

.preloader-tagline {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 4px;
  margin-top: -12px;
}

.preloader-bar {
  width: 160px;
  height: 2px;
  background: rgba(99, 102, 241, 0.12);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.preloader-fill {
  height: 100%;
  width: 0%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width 0.1s ease;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.7);
}

/* ══════════════════════════════════════
   页面切换过渡遮罩
   ══════════════════════════════════════ */
#page-transition {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: var(--bg-base);
  pointer-events: none;
  transition: opacity 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ══════════════════════════════════════
   顶部导航栏（产品 / 联系 页）
   ══════════════════════════════════════ */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: rgba(7, 11, 20, 0.78);
  border-bottom: 1px solid rgba(99, 140, 255, 0.1);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  height: 56px;
  padding: 0 var(--space-xl);
}

.nav-logo {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 5px;
  background: var(--gradient-text);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: textShimmer 5s ease-in-out infinite;
  transition: opacity var(--transition-fast);
}

.nav-logo:hover { opacity: 0.75; }

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.nav-link {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 2px;
  transition: color var(--transition-fast);
  position: relative;
  padding-bottom: 3px;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transition: transform var(--transition-base);
  border-radius: var(--radius-full);
}

.nav-link:hover,
.nav-link.active { color: var(--text-primary); }

.nav-link:hover::after,
.nav-link.active::after { transform: scaleX(1); }

/* 有导航时内容下移 */
body[data-page="products"] .centerBox,
body[data-page="contact"] .centerBox {
  padding-top: 56px;
}

@media (max-width: 600px) {
  .nav-links { gap: var(--space-lg); }
  .nav-link   { font-size: 11px; letter-spacing: 1px; }
  .nav-logo   { font-size: 13px; letter-spacing: 3px; }
}

/* ══════════════════════════════════════
   品牌数据统计区（首页）
   ══════════════════════════════════════ */
.brand-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xl);
  margin-top: var(--space-xl);
  padding: var(--space-lg) var(--space-2xl);
  background: rgba(13, 21, 37, 0.5);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  animation: fadeUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.55s both;
}

.stat-item {
  text-align: center;
}

.stat-value {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 1px;
  line-height: 1;
}

.stat-number {
  font-family: var(--font-serif);
  font-size: 34px;
  font-weight: 700;
  background: var(--gradient-text);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: textShimmer 4s ease-in-out infinite;
}

.stat-unit {
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
  margin-left: 1px;
}

.stat-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 2px;
  margin-top: var(--space-xs);
}

.stat-divider {
  width: 1px;
  height: 44px;
  background: linear-gradient(to bottom, transparent, var(--bg-card-border), transparent);
}

@media (max-width: 640px) {
  .brand-stats {
    flex-direction: column;
    gap: var(--space-md);
    padding: var(--space-lg);
  }

  .stat-divider {
    width: 44px;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--bg-card-border), transparent);
  }

  .stat-number { font-size: 28px; }
}

/* ══════════════════════════════════════
   Toast 提示
   ══════════════════════════════════════ */
.hermit-toast {
  position: fixed;
  bottom: 72px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 10px 22px;
  background: rgba(13, 21, 37, 0.92);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-full);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--text-primary);
  font-size: 13px;
  letter-spacing: 0.8px;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 16px rgba(99, 102, 241, 0.15);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.hermit-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.hermit-toast svg {
  color: var(--accent);
  flex-shrink: 0;
}
