/* ============================
   宸矩科技官网样式表 v0.2 — 蓝图纸风格（亮色）
   纸感底色 · 墨蓝文字 · 琥珀金主色 · 青碧辅色 · 浅色方格网格
   ============================ */
:root {
  /* 纸感亮色底色 */
  --bg-page: #f6f3ea;
  --bg-card: #ffffff;
  --bg-card-hover: #fffdf7;
  --bg-glass: rgba(255, 255, 255, 0.72);

  /* 琥珀金主色（亮底加深，保证对比度） */
  --primary: #d97706;
  --primary-strong: #b45309;
  --primary-glow: rgba(217, 119, 6, 0.14);
  --primary-glow-strong: rgba(217, 119, 6, 0.28);

  /* 青碧辅色 */
  --secondary: #0d9488;
  --secondary-glow: rgba(13, 148, 136, 0.14);

  /* 墨蓝文字 */
  --text-primary: #16233a;
  --text-secondary: #4a5a74;
  --text-muted: #8a97ab;

  /* 边框 & 阴影 */
  --border-subtle: rgba(22, 35, 58, 0.08);
  --border-glow: rgba(217, 119, 6, 0.25);
  --border-glow-hover: rgba(217, 119, 6, 0.5);
  --shadow-glow: 0 2px 20px rgba(22, 35, 58, 0.05);
  --shadow-elevated: 0 8px 30px rgba(22, 35, 58, 0.1);

  /* 圆角 */
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;

  /* 过渡 */
  --transition: 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-slow: 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);

  /* 尺寸 */
  --nav-height: 72px;
  --max-width: 1240px;
  --section-gap: 40px;
}

/* ============================
   Reset & Base
   ============================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }

/* ============================
   Canvas Background
   ============================ */
#particleCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ============================
   Blueprint Grid Background (CSS) — 蓝图纸方格
   ============================ */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(13, 148, 136, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13, 148, 136, 0.07) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* ============================
   Navbar
   ============================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  z-index: 1000;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-subtle);
  transition: all var(--transition);
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.94);
  border-bottom-color: var(--border-glow);
  box-shadow: 0 1px 24px rgba(217, 119, 6, 0.08);
}

.nav-container {
  max-width: 94%;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 32px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.logo-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 6px;
}

/* 导航栏品牌文字（渐变） */
.logo-wordmark {
  background: linear-gradient(135deg, var(--primary-strong) 0%, #16233a 50%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}

.nav-link {
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  position: relative;
  letter-spacing: 0.3px;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 20px;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
  transition: transform var(--transition);
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary-strong);
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: translateX(-50%) scaleX(1);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition);
}

/* Contact Dropdown */
.contact-wrapper {
  position: relative;
}

.contact-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  width: 360px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 40px rgba(22, 35, 58, 0.14), 0 0 0 4px var(--primary-glow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  z-index: 100;
}

.contact-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.contact-dropdown-header {
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.contact-dropdown-header h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.3px;
}

.contact-dropdown-body {
  padding: 12px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.contact-icon {
  width: 18px;
  height: 18px;
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.contact-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 2px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.contact-value {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ============================
   Section Common
   ============================ */
.section {
  position: relative;
  z-index: 1;
  margin-bottom: var(--section-gap);
}

.section:first-of-type {
  margin-top: var(--nav-height);
}

.section-header {
  width: 90%;
  margin: 0 auto 36px;
  text-align: center;
  padding: 60px 20px 0;
}

/* 标题下方装饰线 */
.section-header::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  margin: 20px auto 0;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  border-radius: 2px;
}

.section-title {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(180deg, #16233a 0%, #4a5a74 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.8;
  margin-top: 12px;
}

/* Paper Card */
.section-card {
  width: 90%;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 48px 48px;
  box-shadow: var(--shadow-glow);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

/* 卡片顶部微光扫线 */
.section-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(217, 119, 6, 0.45) 20%,
    rgba(13, 148, 136, 0.45) 50%,
    rgba(217, 119, 6, 0.45) 80%,
    transparent 100%
  );
}

/* ============================
   Scroll Reveal
   ============================ */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger delays (handled via JS) */

/* ============================
   Hero Section
   ============================ */
.hero-section {
  padding: 0;
  margin-bottom: 0;
}

.hero-section:first-of-type {
  margin-top: var(--nav-height);
}

.hero-section .section-card {
  width: 100%;
  max-width: 100%;
  margin: 0;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.hero-section .section-card::before {
  display: none;
}

.hero-content {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 64px;
  padding: 100px 32px 120px;
  position: relative;
}

.hero-text {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 2;
}

.hero-title {
  font-size: 48px;
  font-weight: 900;
  line-height: 1.25;
  margin-bottom: 24px;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #16233a 0%, var(--primary-strong) 40%, var(--secondary) 80%, #16233a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 2;
  margin-bottom: 36px;
  max-width: 520px;
}

/* CTA 按钮组 */
.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 36px;
  background: var(--bg-card);
  color: var(--primary-strong);
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glow);
  transition: all var(--transition);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(217, 119, 6, 0.08);
}

.btn-outline:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(217, 119, 6, 0.18);
  background: #fff8ec;
  transform: translateY(-3px);
}

/* Hero 视觉区 — Canvas 粒子网络 */
.hero-visual {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 1;
}

#heroCanvas {
  width: 420px;
  height: 420px;
}

/* ============================
   Products / Services — 通用行布局
   ============================ */
.product-list,
.service-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.item-row {
  display: flex;
  align-items: center;
  gap: 64px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.item-row:last-child {
  border-bottom: none;
}

.item-row.reverse {
  flex-direction: row-reverse;
}

.item-row .item-text {
  flex: 1;
  min-width: 0;
  padding: 24px 48px;
}

.item-row .item-text h3 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
  position: relative;
  display: inline-block;
}

/* 标题下方短线 */
.item-row .item-text h3::after {
  content: "";
  display: block;
  width: 32px;
  height: 2px;
  margin-top: 8px;
  background: var(--primary);
  border-radius: 1px;
}

.item-row .item-text p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.9;
}

/* 标签 */
.tech-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.tech-tag {
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 500;
  color: #92400e;
  background: rgba(217, 119, 6, 0.07);
  border: 1px solid rgba(217, 119, 6, 0.2);
  border-radius: 20px;
  letter-spacing: 0.3px;
}

.item-row .item-media {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.item-row .item-media img {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 4px 24px rgba(22, 35, 58, 0.08);
  transition: all var(--transition);
}

.item-row .item-media:hover img {
  border-color: var(--border-glow);
  box-shadow: 0 12px 36px rgba(22, 35, 58, 0.14);
}

/* ============================
   Code Window 占位图（浅色 IDE 主题）
   ============================ */
.code-window {
  width: 100%;
  max-width: 460px;
  background: #fdfcf9;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 24px rgba(22, 35, 58, 0.08);
  overflow: hidden;
  transition: all var(--transition);
  text-align: left;
}

.item-row .item-media:hover .code-window {
  border-color: var(--border-glow);
  box-shadow: 0 12px 36px rgba(22, 35, 58, 0.14);
}

.code-window-bar {
  display: flex;
  gap: 7px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(22, 35, 58, 0.03);
}

.code-window-bar span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--text-muted);
  opacity: 0.5;
}

.code-window-bar span:nth-child(1) { background: #ff5f57; }
.code-window-bar span:nth-child(2) { background: #febc2e; }
.code-window-bar span:nth-child(3) { background: #28c840; }

.code-body {
  padding: 20px 22px;
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  font-size: 13px;
  line-height: 1.9;
  color: var(--text-secondary);
  overflow-x: auto;
}

.code-ok { color: var(--secondary); }

.code-cursor {
  color: var(--primary);
  animation: cursorBlink 1.1s steps(1) infinite;
}

@keyframes cursorBlink {
  0%, 60% { opacity: 1; }
  61%, 100% { opacity: 0; }
}

/* ============================
   Paper Card 公共基类
   ============================ */
.paper-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-align: center;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  cursor: default;
}

.paper-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--transition);
}

.paper-card:hover::before {
  opacity: 1;
}

.paper-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(22, 35, 58, 0.12);
}

/* ============================
   Services Grid Section
   ============================ */
.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.service-card {
  padding: 36px 28px;
}

.service-card::before {
  background: radial-gradient(circle at 50% 0%, rgba(217, 119, 6, 0.07) 0%, transparent 70%);
}

.service-card:hover {
  border-color: var(--border-glow-hover);
  box-shadow: 0 20px 50px rgba(22, 35, 58, 0.12), 0 0 0 3px var(--primary-glow);
}

.service-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(217, 119, 6, 0.07);
  border: 1px solid rgba(217, 119, 6, 0.18);
  border-radius: var(--radius-md);
  color: var(--primary-strong);
  transition: all var(--transition);
}

.service-card:hover .service-icon {
  border-color: var(--primary);
  box-shadow: 0 4px 16px var(--primary-glow);
}

.service-icon svg {
  width: 26px;
  height: 26px;
}

.service-card h4 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-primary);
  transition: color var(--transition);
}

.service-card:hover h4 {
  color: var(--primary-strong);
}

.service-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ============================
   Advantages Section
   ============================ */
.advantage-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.advantage-card {
  padding: 44px 32px;
}

.advantage-card::before {
  background: radial-gradient(circle at 50% 100%, rgba(13, 148, 136, 0.06) 0%, transparent 60%);
}

.advantage-card:hover {
  border-color: rgba(13, 148, 136, 0.35);
  box-shadow: 0 20px 50px rgba(22, 35, 58, 0.12), 0 0 0 3px var(--secondary-glow);
}

.advantage-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 24px;
  color: var(--primary);
  transition: color var(--transition);
}

.advantage-card:hover .advantage-icon {
  color: var(--secondary);
}

.advantage-icon svg {
  width: 100%;
  height: 100%;
}

.advantage-card h4 {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.advantage-card p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.8;
}

/* ============================
   Footer
   ============================ */
.footer {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  padding: 16px 20px;
  margin-top: 20px;
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  text-align: center;
}

.footer-copyright {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.footer-license {
  font-size: 12px;
  color: var(--text-muted);
}

.beian-link {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}

.beian-link:hover {
  color: var(--primary-strong);
  text-decoration: underline;
}

/* ============================
   Responsive
   ============================ */
@media (max-width: 1024px) {
  .hero-content {
    flex-direction: column;
    gap: 48px;
    text-align: center;
    padding: 64px 24px 80px;
  }

  .hero-title { font-size: 36px; }
  .hero-desc { max-width: 100%; }
  .hero-actions { justify-content: center; }
  #heroCanvas { width: 320px; height: 320px; }

  .service-grid,
  .advantage-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .item-row {
    flex-direction: column !important;
    gap: 24px;
    text-align: center;
  }
  .item-row .item-text h3::after {
    margin: 8px auto 0;
  }
  .tech-tags {
    justify-content: center;
  }
}

@media (max-width: 640px) {
  .nav-container { padding: 0 16px; }

  .nav-menu {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: 100%;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    padding: 16px;
    gap: 4px;
    transform: translateY(-120%);
    transition: transform var(--transition);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 12px 30px rgba(22, 35, 58, 0.1);
  }

  .nav-menu.open { transform: translateY(0); }
  .nav-toggle { display: flex; }

  .nav-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .hero-title { font-size: 28px; }
  .section-title { font-size: 26px; }
  #heroCanvas { width: 260px; height: 260px; }

  .section-card { padding: 32px 20px; }

  .service-grid,
  .advantage-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions { flex-direction: column; align-items: center; }
}
