/* ==========================================================================
   ESPDIY.COM - 核心设计系统 (Vanilla CSS Design System)
   风格：极客深色模式 (Cyber Dark) + 玻璃拟态 (Glassmorphism) + 霓虹发光强调
   ========================================================================== */

/* 引入现代字体 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  /* 基础主色板 */
  --bg-primary: #090d16;
  --bg-secondary: #0f172a;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --bg-input: #1e293b;
  
  /* 边框与分割线 */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #06b6d4;
  --border-glow: rgba(6, 182, 212, 0.35);

  /* 文字颜色 */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-inverse: #090d16;

  /* 品牌与状态强调色 */
  --color-cyan: #06b6d4;
  --color-cyan-glow: rgba(6, 182, 212, 0.4);
  --color-emerald: #10b981;
  --color-emerald-glow: rgba(16, 185, 129, 0.4);
  --color-amber: #f59e0b;
  --color-rose: #f43f5e;
  --color-purple: #8b5cf6;
  --color-blue: #3b82f6;

  /* 引脚功能专属高亮色 */
  --pin-power: #ef4444;
  --pin-gnd: #475569;
  --pin-analog: #f59e0b;
  --pin-digital: #10b981;
  --pin-i2c: #3b82f6;
  --pin-spi: #8b5cf6;
  --pin-uart: #06b6d4;
  --pin-warning: #ec4899;

  /* 字体族 */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Outfit', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

  /* 阴影与发光效果 */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --glow-cyan: 0 0 25px rgba(6, 182, 212, 0.25);
  --glow-emerald: 0 0 25px rgba(16, 185, 129, 0.25);

  /* 动画过渡 */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);

  /* 容器限制 */
  --container-max: 1280px;
  --nav-height: 72px;
}

/* ==========================================================================
   全局重置与排版
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 24px);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.65;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(6, 182, 212, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 65%, rgba(139, 92, 246, 0.06) 0%, transparent 45%),
    radial-gradient(circle at 50% 90%, rgba(16, 185, 129, 0.05) 0%, transparent 50%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* 优雅滚动条 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-cyan);
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

/* ==========================================================================
   通用布局容器与网格
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

.section {
  padding-top: 80px;
  padding-bottom: 80px;
  position: relative;
}

.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 50px auto;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 9999px;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--color-cyan);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-main);
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
}

/* ==========================================================================
   顶部导航栏 (Glassmorphic Header)
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 1000;
  transition: var(--transition-normal);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
}

.logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--color-cyan) 0%, var(--color-purple) 100%);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  box-shadow: var(--glow-cyan);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition-fast);
  position: relative;
  padding: 6px 0;
}

.nav-link:hover, .nav-link.active {
  color: #fff;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-cyan);
  border-radius: 2px;
  box-shadow: var(--glow-cyan);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* 多语言切换按钮 */
.lang-switcher {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  padding: 3px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 9999px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.lang-btn.active {
  background: var(--color-cyan);
  color: var(--text-inverse);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.4);
}

/* 按钮样式体系 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition-normal);
  border: 1px solid transparent;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-cyan) 0%, #0891b2 100%);
  color: #090d16;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(6, 182, 212, 0.5);
  background: linear-gradient(135deg, #22d3ee 0%, #06b6d4 100%);
}

.btn-secondary {
  background: rgba(30, 41, 59, 0.8);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  background: rgba(51, 65, 85, 0.9);
  border-color: var(--color-cyan);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.825rem;
  border-radius: 8px;
}

/* ==========================================================================
   首页 Hero 视觉横幅 (Hero Section)
   ========================================================================== */
.hero-section {
  padding-top: calc(var(--nav-height) + 60px);
  padding-bottom: 80px;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}

.hero-badge-group {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--color-emerald);
  font-family: var(--font-mono);
  font-size: 0.825rem;
  font-weight: 600;
  border-radius: 9999px;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.hero-highlight {
  background: linear-gradient(135deg, #22d3ee 0%, #38bdf8 50%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 1.2rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 36px;
  max-width: 580px;
}

.hero-cta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding-top: 32px;
  border-top: 1px solid var(--border-subtle);
}

.stat-item .stat-value {
  font-family: var(--font-mono);
  font-size: 1.85rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.stat-item .stat-label {
  font-size: 0.85rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

/* Hero 右侧动态卡片 */
.hero-visual-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 28px;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg), var(--glow-cyan);
}

.hero-code-box {
  background: #060911;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #cbd5e1;
  overflow-x: auto;
}

.hero-chip-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* ==========================================================================
   通用卡片 (Cards & Glassmorphism)
   ========================================================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 24px;
  backdrop-filter: blur(12px);
  transition: var(--transition-normal);
}

.card:hover {
  border-color: rgba(6, 182, 212, 0.4);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md), 0 0 20px rgba(6, 182, 212, 0.15);
}

/* ==========================================================================
   页脚 (Site Footer)
   ========================================================================== */
.site-footer {
  background: #060911;
  border-top: 1px solid var(--border-subtle);
  padding: 60px 0 30px 0;
  margin-top: 80px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-top: 12px;
  max-width: 320px;
}

.footer-col h4 {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.875rem;
  transition: var(--transition-fast);
}

.footer-links a:hover {
  color: var(--color-cyan);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.85rem;
  color: var(--text-dim);
  flex-wrap: wrap;
  gap: 16px;
}

/* 响应式断点 */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .hero-title {
    font-size: 2.75rem;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    display: none; /* 移动端可精简 */
  }
  .hero-title {
    font-size: 2.25rem;
  }
  .section {
    padding-top: 50px;
    padding-bottom: 50px;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
}
