/* ============================================
   宁泰数能科技 - 企业官网样式
   NingTai Digital Energy Technology
   ============================================ */

/* ----- CSS 变量 ----- */
:root {
  --primary: #00d4ff;
  --primary-dark: #0099cc;
  --primary-glow: rgba(0, 212, 255, 0.3);
  --secondary: #0066ff;
  --accent: #7c3aed;
  --bg-dark: #0a0e17;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --text-primary: #e8edf5;
  --text-secondary: #8899aa;
  --text-muted: #556677;
  --border-color: rgba(0, 212, 255, 0.1);
  --border-glow: rgba(0, 212, 255, 0.2);
  --font-sans: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  --font-mono: 'Cascadia Code', 'SF Mono', 'Consolas', 'Courier New', monospace;
  --nav-height: 90px;
  --section-padding: 100px 0;
  --max-width: 1200px;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ----- 基础重置 ----- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: var(--font-sans);
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}
a:hover { color: #fff; }

img { max-width: 100%; height: auto; }

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb {
  background: var(--primary-dark);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ===== 选择文本 ===== */
::selection {
  background: var(--primary);
  color: var(--bg-dark);
}

/* ===== 粒子画布（背景） ===== */
#particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ===== 加载动画 ===== */
.loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.loader.hidden {
  opacity: 0;
  visibility: hidden;
}
.loader-ring {
  width: 60px;
  height: 60px;
  border: 3px solid transparent;
  border-top-color: var(--primary);
  border-right-color: var(--secondary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.loader-ring::after {
  content: '';
  position: absolute;
  inset: 6px;
  border: 3px solid transparent;
  border-bottom-color: var(--accent);
  border-left-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite reverse;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 导航栏 ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  background: transparent;
}
.navbar.scrolled {
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--border-color);
  height: 70px;
}
.navbar.scrolled .logo-img {
  height: 58px;
}
.navbar .container {
  width: 100%;
  max-width: var(--max-width);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.navbar .logo {
  display: flex;
  align-items: center;
}
.navbar .logo-img {
  height: 80px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 8px;
}
.nav-links a {
  padding: 8px 18px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  transition: var(--transition);
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 60%;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
  transition: transform 0.3s ease;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
  background: rgba(0, 212, 255, 0.06);
}
.nav-links a:hover::after,
.nav-links a.active::after {
  transform: translateX(-50%) scaleX(1);
}

/* 汉堡菜单 */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
  z-index: 1001;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 1px;
  transition: var(--transition);
}
.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== 进度指示器 ===== */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  z-index: 1002;
  transition: width 0.1s linear;
}

/* ===== 通用板块 ===== */
.section {
  position: relative;
  padding: var(--section-padding);
  z-index: 1;
}
.section-header {
  text-align: center;
  margin-bottom: 64px;
}
.section-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--primary);
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.15);
  padding: 6px 20px;
  border-radius: 20px;
  margin-bottom: 16px;
}
.section-title {
  font-size: 40px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
}
.section-title .highlight {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.section-desc {
  max-width: 600px;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.8;
}

/* ===== HER0 首屏 ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  overflow: hidden;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(0, 102, 255, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(124, 58, 237, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(0, 212, 255, 0.06) 0%, transparent 40%);
  z-index: 0;
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  z-index: 0;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}
.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 900px;
  padding: 0 24px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--primary);
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.15);
  padding: 6px 20px;
  border-radius: 20px;
  margin-bottom: 32px;
  animation: fadeInUp 1s ease 0.2s both;
}
.hero-badge .dot {
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  animation: pulse 2s ease infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.hero h1 {
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 24px;
  animation: fadeInUp 1s ease 0.4s both;
}
.hero h1 .line1 {
  display: block;
  color: #fff;
}
.hero h1 .line2 {
  display: block;
  background: linear-gradient(135deg, var(--primary) 0%, #60a5fa 40%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 40px;
  line-height: 1.8;
  animation: fadeInUp 1s ease 0.6s both;
}
.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeInUp 1s ease 0.8s both;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
  letter-spacing: 0.5px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  box-shadow: 0 4px 20px rgba(0, 212, 255, 0.25);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 212, 255, 0.35);
  color: #fff;
}
.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid rgba(0, 212, 255, 0.3);
}
.btn-outline:hover {
  background: rgba(0, 212, 255, 0.08);
  border-color: var(--primary);
  transform: translateY(-2px);
  color: var(--primary);
}
.btn-sm {
  padding: 10px 22px;
  font-size: 13px;
}

.hero-scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 2px;
  animation: fadeInUp 1s ease 1.2s both;
}
.scroll-indicator {
  width: 20px;
  height: 32px;
  border: 2px solid var(--text-muted);
  border-radius: 10px;
  position: relative;
}
.scroll-indicator::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 8px;
  background: var(--primary);
  border-radius: 2px;
  animation: scrollDown 2s ease infinite;
}
@keyframes scrollDown {
  0% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(12px); }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 关于我们 ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
.about-text h3 {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 20px;
}
.about-text p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  font-size: 15px;
}
.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.stat-card {
  text-align: center;
  padding: 28px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  transition: var(--transition);
}
.stat-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  transform: translateY(-4px);
}
.stat-number {
  font-size: 40px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}
.stat-label {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 8px;
}

/* ===== 核心业务 ===== */
.business-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
.business-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 40px 32px;
  transition: var(--transition);
  overflow: hidden;
  cursor: default;
}
.business-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: var(--transition);
}
.business-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(0, 212, 255, 0.2);
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.business-card:hover::before {
  opacity: 1;
}
.business-card .icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 20px;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.1);
  transition: var(--transition);
}
.business-card:hover .icon {
  background: rgba(0, 212, 255, 0.15);
  border-color: rgba(0, 212, 255, 0.2);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.15);
}
.business-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}
.business-card p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
}
.business-card .tag {
  display: inline-block;
  margin-top: 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(0, 212, 255, 0.06);
  padding: 4px 14px;
  border-radius: 20px;
}

/* ===== 技术优势 ===== */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
.tech-card {
  text-align: center;
  padding: 36px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  transition: var(--transition);
}
.tech-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(0, 212, 255, 0.2);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}
.tech-card .icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.08), rgba(124, 58, 237, 0.08));
  border: 1px solid rgba(0, 212, 255, 0.1);
  transition: var(--transition);
}
.tech-card:hover .icon {
  border-color: rgba(0, 212, 255, 0.3);
  box-shadow: 0 0 30px rgba(0, 212, 255, 0.1);
}
.tech-card h4 {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 10px;
}
.tech-card p {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.7;
}

/* ===== 应用场景 ===== */
.scenarios {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}
.scenario-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 40px;
}
.scenario-tab {
  padding: 10px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
}
.scenario-tab:hover {
  border-color: rgba(0, 212, 255, 0.2);
  color: var(--text-primary);
}
.scenario-tab.active {
  background: rgba(0, 212, 255, 0.08);
  border-color: rgba(0, 212, 255, 0.3);
  color: var(--primary);
}
.scenario-panel {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  animation: fadeInUp 0.5s ease;
}
.scenario-panel.active {
  display: grid;
}
.scenario-panel .placeholder-img {
  width: 100%;
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.05), rgba(124, 58, 237, 0.05));
  border: 1px solid var(--border-color);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 14px;
}
.scenario-panel h3 {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
}
.scenario-panel p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 16px;
}
.scenario-panel ul {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.scenario-panel li {
  color: var(--text-secondary);
  font-size: 13px;
  padding-left: 20px;
  position: relative;
}
.scenario-panel li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--primary);
}

/* ===== 合作伙伴 ===== */
.partners-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
}
.partner-logo {
  width: 160px;
  height: 80px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  transition: var(--transition);
  filter: grayscale(1) opacity(0.5);
}
.partner-logo:hover {
  filter: grayscale(0) opacity(1);
  border-color: rgba(0, 212, 255, 0.2);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

/* ===== 联系我们 ===== */
.contact-wrapper {
  max-width: 700px;
  margin: 0 auto;
  padding: 0 24px;
}

.contact-items-row {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}
.contact-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.contact-item .icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  background: rgba(0, 212, 255, 0.06);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.contact-item h4 {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}
.contact-item p {
  font-size: 13px;
  color: var(--text-secondary);
}


/* ===== 页脚 ===== */
.footer {
  position: relative;
  z-index: 1;
  padding: 48px 24px 24px;
  border-top: 1px solid var(--border-color);
}
.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}
.footer-logo {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}
.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
}
.footer-links a {
  color: var(--text-muted);
  font-size: 13px;
}
.footer-links a:hover {
  color: var(--primary);
}
.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

/* ===== 滚动动画（reveal）===== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ===== 综合背景网格（部分板块用） ===== */
.bg-grid-section {
  position: relative;
}
.bg-grid-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 0;
  pointer-events: none;
}
.bg-grid-section > * {
  position: relative;
  z-index: 1;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  :root {
    --nav-height: 72px;
    --section-padding: 60px 0;
  }

  .navbar .container {
    padding: 0 16px;
  }

  .navbar .logo-img {
    height: 50px;
  }
  .navbar.scrolled .logo-img {
    height: 40px;
  }

  .hamburger {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    flex-direction: column;
    background: rgba(10, 14, 23, 0.96);
    backdrop-filter: blur(20px);
    padding: 80px 32px 32px;
    gap: 4px;
    transition: right 0.4s ease;
    border-left: 1px solid var(--border-color);
  }
  .nav-links.open {
    right: 0;
  }
  .nav-links a {
    font-size: 16px;
    padding: 12px 16px;
    width: 100%;
  }

  .section-title {
    font-size: 28px;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .scenario-panel {
    grid-template-columns: 1fr;
  }
  .scenario-panel.active {
    grid-template-columns: 1fr;
  }
  .scenario-panel ul {
    grid-template-columns: 1fr;
  }

  .about-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
  .stat-number {
    font-size: 28px;
  }

  .hero h1 {
    font-size: 32px;
  }
  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .about-stats {
    grid-template-columns: 1fr;
  }
  .business-grid {
    grid-template-columns: 1fr;
  }
  .tech-grid {
    grid-template-columns: 1fr;
  }
}
