/* === 数迹官网自定义样式 === */

:root {
  --color-bg: #0B0B10;
  --color-card: #1E1E23;
  --color-border: #1E293B;
  --color-text: #F8FAFC;
  --color-muted: #94A3B8;
  --color-purple: #5B3FD6;
  --color-purple-light: #7C5CFF;
  --color-cyan: #00D9FF;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: 'DM Sans', 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
  overflow-x: hidden;
}

/* 移除默认 focus 边框（自定义见 Task 15） */
*:focus-visible {
  outline: 2px solid var(--color-cyan);
  outline-offset: 2px;
}

/* 通用工具类 */
.text-gradient {
  background: linear-gradient(90deg, #7C5CFF 0%, #00D9FF 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.font-display { font-family: 'Space Grotesk', 'DM Sans', 'PingFang SC', 'Microsoft YaHei', sans-serif; }
.font-mono-data { font-family: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace; }

/* 滚动条美化（Webkit） */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb { background: var(--color-purple); border-radius: 4px; }

/* === 导航 === */
.nav-link {
  position: relative;
  color: var(--color-muted);
  transition: color 200ms ease-out;
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #7C5CFF, #00D9FF);
  transition: width 200ms ease-out;
}
.nav-link:hover,
.nav-link.active {
  color: var(--color-text);
}
.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* 滚动后导航收紧 */
#navbar.scrolled {
  background: rgba(11, 11, 16, 0.92);
  border-bottom-color: rgba(91, 63, 214, 0.3);
}

/* Mobile nav menu — absolute dropdown positioning */
#nav-menu:not(.hidden) {
  animation: nav-menu-in 200ms ease-out;
}
@keyframes nav-menu-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  #nav-menu:not(.hidden) { animation: none; }
}

/* === Hero 静态降级背景 === */
.hero-static-bg {
  background:
    radial-gradient(ellipse at 30% 20%, rgba(91, 63, 214, 0.4) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(0, 217, 255, 0.2) 0%, transparent 50%),
    linear-gradient(135deg, #0B0B10 0%, #1E1147 50%, #0B0B10 100%);
}

/* === Ticker 滚动 === */
@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.ticker {
  animation: ticker 30s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .ticker { animation: none; }
}

/* === 区块背景扫描线 === */
.scan-line {
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0px,
      transparent 3px,
      rgba(124, 92, 255, 0.03) 3px,
      rgba(124, 92, 255, 0.03) 4px
    );
}

/* === 滚动揭示 === */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 600ms ease-out, transform 600ms ease-out;
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* === 移动端微调 === */
@media (max-width: 767px) {
  .ticker { font-size: 0.7rem; }
  .product-card, .capability-card, .scene-card {
    padding: 1.5rem;
  }
}

/* 安全区适配 iOS 刘海 */
@supports (padding: env(safe-area-inset-top)) {
  body { padding-top: env(safe-area-inset-top); }
}

/* === 资质证书卡 (简净版) === */
.cert-card {
  position: relative;
  background: rgba(30, 30, 35, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 10px;
  transition: transform 300ms ease-out, border-color 300ms ease-out, box-shadow 300ms ease-out;
}
.cert-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 217, 255, 0.5);
  box-shadow: 0 10px 30px -10px rgba(0, 217, 255, 0.35);
}

.cert-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #FBF8F1;
  border-radius: 6px;
  overflow: hidden;
}
.cert-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .cert-card { transition: none; }
  .cert-card:hover { transform: none; }
}
