/* ============================================================
   爱鑫光电官网 / Dongguan Aixin Optoelectronics - 主样式
   响应式、SEO 友好、零依赖外部字体
   ============================================================ */

/* ---------- 1. 设计变量 ---------- */
:root {
  --primary:       #1e40af;       /* 主深蓝 */
  --primary-dark:  #1e3a8a;
  --primary-light: #3b82f6;
  --accent:        #0891b2;       /* 强调青 */
  --accent-light:  #06b6d4;
  --dark:          #0f172a;       /* 主文字 */
  --text:          #334155;
  --text-light:    #64748b;
  --bg:            #ffffff;
  --bg-alt:        #f8fafc;
  --bg-muted:      #f1f5f9;
  --border:        #e2e8f0;
  --success:       #10b981;
  --max-width:     1280px;
  --shadow-sm:     0 1px 2px rgba(15, 23, 42, .06);
  --shadow:        0 4px 12px rgba(15, 23, 42, .08);
  --shadow-lg:     0 12px 28px rgba(15, 23, 42, .12);
  --radius:        8px;
  --radius-lg:     12px;
  --transition:    .3s ease;
}

/* ---------- 2. 基础重置 ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, svg { max-width: 100%; height: auto; display: block; }

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

a:hover { color: var(--primary-light); }

ul { list-style: none; }

h1, h2, h3, h4, h5, h6 {
  color: var(--dark);
  font-weight: 700;
  line-height: 1.3;
}

button { font: inherit; cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 2px;
}

/* ---------- 3. 容器 ---------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- 4. 顶部条 ---------- */
.header-top {
  background: var(--primary-dark);
  color: #fff;
  font-size: 13px;
  padding: 8px 0;
}

.header-top .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.header-top a { color: rgba(255, 255, 255, .9); }
.header-top a:hover { color: #fff; }

.header-top .meta { display: flex; gap: 20px; flex-wrap: wrap; }
.header-top .meta span::before { content: "✦ "; opacity: .7; }
.header-top .lang-switch a { margin-left: 14px; font-weight: 500; }
.header-top .lang-switch a.active { color: #fff; font-weight: 700; }

/* ---------- 5. 站点头部 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  box-shadow: var(--shadow-sm);
  border-bottom: 1px solid var(--border);
}

.navbar {
  display: flex;
  align-items: center;
  padding: 14px 0;
  position: relative;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--dark);
}
.logo img { height: 46px; width: auto; }
.logo .brand { font-size: 18px; font-weight: 700; line-height: 1.2; }
.logo .brand small { display: block; font-size: 11px; color: var(--text-light); font-weight: 400; letter-spacing: .5px; }

.nav-menu {
  display: flex;
  gap: 4px;
  margin-left: auto;
  align-items: center;
}

.nav-menu > li > a {
  display: block;
  padding: 12px 18px;
  color: var(--dark);
  font-weight: 500;
  border-radius: var(--radius);
  transition: var(--transition);
}

.nav-menu > li > a:hover,
.nav-menu > li > a.active {
  color: var(--primary);
  background: var(--bg-muted);
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  font-size: 26px;
  color: var(--dark);
  padding: 8px;
  margin-left: auto;
  align-items: center;
  justify-content: center;
}

/* ---------- 6. Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(6, 182, 212, .35) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 30%, rgba(59, 130, 246, .35) 0%, transparent 60%),
    linear-gradient(135deg, #0c1f4d 0%, #1e3a8a 50%, #0891b2 100%);
  color: #fff;
  padding: 96px 0 112px;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, .12) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: .4;
  pointer-events: none;
}

.hero .container {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 64px;
  align-items: center;
}

.hero .label {
  display: inline-block;
  padding: 6px 14px;
  background: rgba(255, 255, 255, .15);
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .5px;
  margin-bottom: 20px;
  backdrop-filter: blur(8px);
}

.hero h1 {
  color: #fff;
  font-size: clamp(30px, 4.6vw, 54px);
  font-weight: 800;
  margin-bottom: 20px;
  letter-spacing: -.5px;
}

.hero h1 span {
  background: linear-gradient(135deg, #06b6d4, #67e8f9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  font-size: clamp(15px, 1.6vw, 19px);
  opacity: .92;
  margin-bottom: 32px;
  max-width: 560px;
}

.hero-cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-image {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero-image svg { filter: drop-shadow(0 30px 60px rgba(0, 0, 0, .4)); }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid rgba(255, 255, 255, .15);
  max-width: 520px;
}

.hero-stat strong {
  display: block;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}

.hero-stat span {
  font-size: 13px;
  opacity: .8;
}

/* ---------- 7. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 15px;
  border: 0;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff;
  box-shadow: 0 8px 20px rgba(8, 145, 178, .35);
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-light), #22d3ee);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(8, 145, 178, .45);
}

.btn-secondary {
  background: rgba(255, 255, 255, .15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .35);
  backdrop-filter: blur(8px);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, .25);
  color: #fff;
  transform: translateY(-2px);
}

.btn-ghost {
  background: var(--bg-muted);
  color: var(--dark);
}
.btn-ghost:hover {
  background: var(--border);
  color: var(--dark);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
}

/* ---------- 8. 章节 ---------- */
section { padding: 88px 0; }

.section-alt { background: var(--bg-alt); }

.section-dark {
  background: var(--dark);
  color: rgba(255, 255, 255, .85);
}
.section-dark h2,
.section-dark h3 { color: #fff; }

.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-header .label {
  display: inline-block;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section-header h2 {
  font-size: clamp(26px, 3vw, 38px);
  margin-bottom: 14px;
  letter-spacing: -.3px;
}

.section-header p {
  color: var(--text-light);
  font-size: 16px;
  max-width: 720px;
  margin: 0 auto;
}

.section-header.left { text-align: left; }
.section-header.left p { margin: 0; }

/* ---------- 9. 网格 ---------- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- 10. 产品卡片 ---------- */
.product-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.product-card .img {
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #f8fafc 0%, #e0f2fe 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  border-bottom: 1px solid var(--border);
}
.product-card .img svg { max-height: 100%; max-width: 100%; }
.product-card .img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(0,0,0,.08);
}

/* 产品详情画廊缩略图 */
.visual .gal { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.visual .gal img.thumb {
  width: 72px; height: 54px; object-fit: contain;
  border: 1px solid var(--border); border-radius: 6px;
  background: #fff; padding: 4px;
}

.product-card .body { padding: 24px 24px 28px; flex: 1; display: flex; flex-direction: column; }

.product-card h3 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--dark);
}

.product-card .sku {
  display: inline-block;
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  color: var(--accent);
  background: rgba(8, 145, 178, .08);
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 12px;
  width: max-content;
}

.product-card p {
  color: var(--text-light);
  font-size: 14px;
  line-height: 1.55;
  flex: 1;
}

.product-card .more {
  margin-top: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}
.product-card:hover .more { color: var(--accent); }

/* ---------- 11. 特性卡片 ---------- */
.feature-card {
  padding: 32px 26px;
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.feature-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
  border-color: var(--primary-light);
}

.feature-card .icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.feature-card .icon svg { width: 28px; height: 28px; }

.feature-card h3 { font-size: 18px; margin-bottom: 10px; }
.feature-card p { color: var(--text-light); font-size: 14.5px; line-height: 1.6; }

/* ---------- 12. 关于区块 ---------- */
.about-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.about-block.reverse { grid-template-columns: 1fr 1fr; direction: rtl; }
.about-block.reverse > * { direction: ltr; }

.about-block .visual {
  background: linear-gradient(135deg, var(--bg-alt), #e0f2fe);
  border-radius: var(--radius-lg);
  padding: 32px;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
}

.about-block h2 {
  font-size: clamp(24px, 3vw, 34px);
  margin-bottom: 18px;
}
.about-block .lead { font-size: 17px; color: var(--text); margin-bottom: 16px; }
.about-block p { color: var(--text-light); margin-bottom: 24px; }
.about-block ul li {
  padding-left: 28px;
  position: relative;
  margin-bottom: 12px;
  color: var(--text);
}
.about-block ul li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  width: 20px;
  height: 20px;
  background: var(--success);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  margin-top: 3px;
}

/* ---------- 13. 数据展示 ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  text-align: center;
}
.stats .stat-num {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.stats .stat-label {
  margin-top: 8px;
  font-size: 14px;
  color: rgba(255, 255, 255, .85);
}

/* ---------- 14. 联系区块 ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.contact-info {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--accent) 100%);
  color: #fff;
  padding: 44px;
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.contact-info::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, .1) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: .3;
}

.contact-info > * { position: relative; z-index: 1; }

.contact-info h2 { color: #fff; font-size: 26px; margin-bottom: 8px; }
.contact-info > p { opacity: .9; margin-bottom: 28px; }

.contact-info ul li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .15);
  font-size: 15px;
}
.contact-info ul li:last-child { border-bottom: 0; }
.contact-info strong {
  display: inline-block;
  min-width: 76px;
  opacity: .85;
  font-weight: 500;
  flex-shrink: 0;
}
.contact-info a { color: #fff; }

.contact-form {
  background: #fff;
  padding: 44px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.contact-form h2 {
  font-size: 24px;
  margin-bottom: 24px;
}

.contact-form .field { margin-bottom: 18px; }
.contact-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--dark);
  font-size: 14px;
}
.contact-form input,
.contact-form textarea,
.contact-form select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-family: inherit;
  transition: var(--transition);
  background: #fff;
}
.contact-form input:focus,
.contact-form textarea:focus,
.contact-form select:focus {
  outline: 0;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(30, 64, 175, .1);
}
.contact-form textarea { min-height: 130px; resize: vertical; }
.contact-form .form-status {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  display: none;
}
.contact-form .form-status.success {
  display: block;
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}

/* ---------- 15. 面包屑 ---------- */
.breadcrumb {
  background: var(--bg-alt);
  padding: 14px 0;
  font-size: 14px;
  color: var(--text-light);
  border-bottom: 1px solid var(--border);
}
.breadcrumb a { color: var(--primary); }
.breadcrumb .sep { margin: 0 8px; opacity: .5; }

/* ---------- 16. 页脚 ---------- */
.site-footer {
  background: var(--dark);
  color: rgba(255, 255, 255, .75);
  padding: 64px 0 0;
  position: relative;
  overflow: hidden;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

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

.footer-grid h4 {
  color: #fff;
  margin-bottom: 18px;
  font-size: 15px;
  letter-spacing: .5px;
}
.footer-grid ul li { margin-bottom: 10px; }
.footer-grid a {
  color: rgba(255, 255, 255, .7);
  font-size: 14px;
}
.footer-grid a:hover { color: #fff; }

.footer-brand { max-width: 360px; }
.footer-brand .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  margin-bottom: 16px;
}
.footer-brand .logo img { height: 36px; filter: brightness(0) invert(1); }
.footer-brand p {
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 20px;
  opacity: .85;
}
.footer-contact { font-size: 14px; line-height: 1.9; opacity: .85; }
.footer-contact strong { color: #fff; font-weight: 600; display: block; margin-top: 4px; }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding: 20px 0;
  text-align: center;
  font-size: 13px;
  opacity: .7;
}
.footer-bottom a { color: rgba(255, 255, 255, .7); }
.footer-bottom a:hover { color: #fff; }

/* ---------- 17. 回到顶部 ---------- */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border: 0;
  border-radius: 50%;
  box-shadow: var(--shadow-lg);
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.to-top.visible { display: flex; }
.to-top:hover { transform: translateY(-4px); }
.to-top svg { width: 22px; height: 22px; }

/* ---------- 18. 新闻卡片 ---------- */
.news-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
}
.news-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-3px);
  border-color: var(--primary-light);
}
.news-card .body { padding: 24px; }
.news-card .date {
  display: inline-block;
  font-size: 12px;
  color: var(--accent);
  background: rgba(8, 145, 178, .1);
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 12px;
  font-weight: 600;
}
.news-card h3 {
  font-size: 17px;
  margin-bottom: 10px;
  line-height: 1.4;
}
.news-card p {
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 14px;
}
.news-card .more {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

/* ---------- 19. 时间线 ---------- */
.timeline { position: relative; max-width: 800px; margin: 0 auto; padding-left: 40px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
}
.timeline-item { position: relative; margin-bottom: 32px; padding-left: 24px; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: -32px;
  top: 6px;
  width: 16px;
  height: 16px;
  background: #fff;
  border: 3px solid var(--accent);
  border-radius: 50%;
}
.timeline-item .year {
  display: inline-block;
  font-weight: 700;
  color: var(--accent);
  font-size: 14px;
  margin-bottom: 6px;
}
.timeline-item h4 { font-size: 17px; margin-bottom: 6px; }
.timeline-item p { color: var(--text-light); font-size: 14.5px; }

/* ---------- 20. 响应式断点 ---------- */
@media (max-width: 1024px) {
  .container { padding: 0 20px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .hero .container { grid-template-columns: 1fr; gap: 48px; }
  .hero-image { max-width: 460px; margin: 0 auto; }
  .about-block { grid-template-columns: 1fr; gap: 40px; }
  .about-block.reverse { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  body { font-size: 15px; }
  section { padding: 56px 0; }
  .hero { padding: 56px 0 64px; }

  /* 头部折叠菜单 */
  .nav-toggle { display: flex; }
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: #fff;
    padding: 12px 0;
    box-shadow: var(--shadow);
    border-radius: 0 0 var(--radius) var(--radius);
    align-items: stretch;
  }
  .nav-menu.open { display: flex; }
  .nav-menu > li > a { padding: 14px 24px; border-radius: 0; }

  /* 网格折叠 */
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }

  /* header top */
  .header-top .container { flex-direction: column; align-items: flex-start; gap: 6px; }
  .header-top .meta { font-size: 12px; gap: 12px; }

  /* hero stats */
  .hero-stats { grid-template-columns: 1fr 1fr; gap: 16px; padding-top: 24px; margin-top: 32px; }

  /* contact + form */
  .contact-info, .contact-form { padding: 28px; }

  /* buttons */
  .btn { padding: 12px 22px; font-size: 14px; }
  .hero-cta { gap: 10px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero-stats { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; gap: 24px; }
}

/* ---------- 21. 打印样式 ---------- */
@media print {
  .site-header, .site-footer, .nav-menu, .hero-cta, .to-top, .header-top { display: none !important; }
  body { color: #000; }
}

/* ---------- 22. 无障碍 — 减弱动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
