/* ========================================
   OpWafer - 晶圆双面位置对准测量仪
   主样式表
   ======================================== */

/* ----- CSS Custom Properties ----- */
:root {
  /* 色彩系统 */
  --color-primary: #0C447C;
  --color-primary-hover: #08305A;
  --color-primary-light: #E6F1FB;
  --color-accent: #1D9E75;
  --color-accent-hover: #0F6E56;
  --color-accent-light: #E1F5EE;
  
  /* 文字色 */
  --color-text: #1a1a2e;
  --color-text-secondary: #555;
  --color-text-muted: #888;
  --color-text-light: #bbb;
  
  /* 背景色 */
  --bg-white: #ffffff;
  --bg-light: #f5f7fa;
  --bg-lighter: #fafbfc;
  --bg-alt: #f0f2f5;
  
  /* 边框 */
  --border-color: #e0e4e8;
  --border-light: #eef0f2;
  
  /* 阴影 */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
  --shadow-card: 0 2px 12px rgba(0,0,0,0.06);
  
  /* 布局 */
  --max-width: 1200px;
  --header-height: 72px;
  --section-padding: 80px;
  --border-radius: 8px;
  --border-radius-lg: 12px;
  
  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;
  
  /* 过渡 */
  --transition: 0.3s ease;
}

/* ----- Reset & Base ----- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--bg-white);
  -webkit-font-smoothing: antialiased;
}

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

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

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

ul {
  list-style: none;
}

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

/* ----- Section ----- */
.section {
  padding: var(--section-padding) 0;
}

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

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

.section-title {
  font-size: 32px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}

.section-subtitle {
  font-size: 14px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 400;
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 28px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  text-decoration: none;
  line-height: 1.5;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-outline {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255,255,255,0.6);
}

.btn-outline:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-color: #fff;
}

.btn-lg {
  padding: 14px 40px;
  font-size: 16px;
  border-radius: 8px;
}

.btn-block {
  width: 100%;
}

.btn-nav {
  display: none;
  font-size: 13px;
  padding: 8px 18px;
}

/* ========================================
   Header & Navigation
   ======================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-height);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  transition: all var(--transition);
}

.header.scrolled {
  box-shadow: var(--shadow-sm);
}

.nav-container {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 32px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 24px;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.logo-img {
  height: 36px;
  width: auto;
}

.logo-text {
  font-weight: 700;
}

.nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.nav-list {
  display: flex;
  gap: 4px;
}

.nav-link {
  display: block;
  padding: 8px 14px;
  font-size: 14px;
  color: var(--color-text-secondary);
  border-radius: 6px;
  transition: all var(--transition);
  font-weight: 400;
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  z-index: 1001;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: all var(--transition);
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: #0a1628;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-image-fallback {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(10,22,40,0.85) 0%, rgba(8,48,90,0.75) 50%, rgba(12,68,124,0.65) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  color: #fff;
  padding-top: var(--header-height);
}

.hero-title {
  font-size: 44px;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: -0.5px;
  line-height: 1.3;
}

.hero-subtitle {
  font-size: 20px;
  font-weight: 400;
  margin-bottom: 12px;
  opacity: 0.92;
}

.hero-desc {
  font-size: 15px;
  margin-bottom: 36px;
  opacity: 0.7;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  animation: bounceDown 2s infinite;
}

.scroll-indicator span {
  display: block;
  width: 28px;
  height: 28px;
  border-right: 2px solid rgba(255,255,255,0.5);
  border-bottom: 2px solid rgba(255,255,255,0.5);
  transform: rotate(45deg);
}

@keyframes bounceDown {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(10px); }
}

/* ========================================
   Product Overview
   ======================================== */
.product-overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.product-image-wrapper {
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--bg-alt);
}

.product-main-img {
  width: 100%;
  height: auto;
  display: block;
}

.product-info h3 {
  font-size: 26px;
  font-weight: 600;
  margin-bottom: 4px;
}

.product-model {
  font-size: 14px;
  color: var(--color-primary);
  font-family: var(--font-mono);
  margin-bottom: 20px;
  font-weight: 500;
}

.product-desc {
  font-size: 15px;
  color: var(--color-text-secondary);
  margin-bottom: 12px;
  line-height: 1.8;
}

.product-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0;
}

.product-highlights li {
  padding: 6px 16px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

/* ========================================
   Features Grid
   ======================================== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--bg-white);
  border-radius: var(--border-radius-lg);
  padding: 32px 28px;
  transition: all var(--transition);
  border: 1px solid var(--border-light);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-light);
}

.feature-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 20px;
  border-radius: 12px;
  background: var(--color-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
}

.feature-icon img {
  width: 28px;
  height: 28px;
}

.feature-icon .icon-fallback {
  width: 28px;
  height: 28px;
}

.feature-card h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--color-text);
}

.feature-card p {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.7;
}

/* ========================================
   Product Gallery
   ======================================== */
.gallery-mosaic {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.gallery-item {
  position: relative;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-alt);
  aspect-ratio: 4/3;
}

.gallery-item-large {
  grid-column: span 2;
  grid-row: span 2;
  aspect-ratio: auto;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transition: opacity var(--transition);
}

.gallery-item:hover .gallery-caption {
  opacity: 1;
}

.gallery-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
  color: var(--color-text-muted);
  font-size: 13px;
  padding: 20px;
  text-align: center;
}

.gallery-hint {
  text-align: center;
  margin-top: 16px;
  font-size: 12px;
  color: var(--color-text-muted);
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  z-index: 2000;
  inset: 0;
  background: rgba(0,0,0,0.92);
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 32px;
  color: #fff;
  font-size: 36px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--transition);
  z-index: 2001;
  line-height: 1;
}

.lightbox-close:hover {
  opacity: 1;
}

.lightbox-caption {
  color: #fff;
  font-size: 14px;
  margin-top: 16px;
  opacity: 0.7;
}

/* ========================================
   Specs Table
   ======================================== */
.specs-table-wrapper {
  background: var(--bg-white);
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
}

.specs-table tr {
  transition: background var(--transition);
}

.specs-table tr:hover {
  background: var(--bg-lighter);
}

.specs-table td {
  padding: 16px 24px;
  font-size: 14px;
  border-bottom: 1px solid var(--border-light);
}

.specs-table tr:last-child td {
  border-bottom: none;
}

.spec-label {
  width: 18%;
  color: var(--color-text-secondary);
  font-weight: 500;
  background: var(--bg-lighter);
}

.spec-value {
  width: 32%;
  font-family: var(--font-mono);
  color: var(--color-primary);
  font-weight: 500;
}

/* ========================================
   Applications
   ======================================== */
.applications-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.app-card {
  background: var(--bg-white);
  border-radius: var(--border-radius-lg);
  padding: 32px 24px;
  border: 1px solid var(--border-light);
  transition: all var(--transition);
  text-align: center;
}

.app-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-light);
}

.app-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-icon svg {
  width: 48px;
  height: 48px;
}

.app-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
}

.app-card p {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.7;
}

/* ========================================
   About Us
   ======================================== */
.about-grid {
  display: grid;
  grid-template-columns: 0.45fr 0.55fr;
  gap: 64px;
  align-items: center;
}

.about-image {
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.about-image img {
  width: 100%;
  height: auto;
}

.about-content h3 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 20px;
}

.about-content p {
  font-size: 15px;
  color: var(--color-text-secondary);
  line-height: 1.8;
  margin-bottom: 12px;
}

.about-stats {
  display: flex;
  gap: 40px;
  margin-top: 28px;
}

.stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 32px;
  font-weight: 700;
  color: var(--color-primary);
}

.stat-label {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* ========================================
   Contact
   ======================================== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 48px;
}

.contact-info h3 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 12px;
}

.contact-info > p {
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: 32px;
  line-height: 1.7;
}

.contact-items {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.contact-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--color-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
}

.contact-label {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}

.contact-value {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text);
}

/* Contact Form */
.contact-form {
  background: var(--bg-white);
  border-radius: var(--border-radius-lg);
  padding: 32px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 6px;
}

.required {
  color: #d85a30;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--font-sans);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  outline: none;
  transition: all var(--transition);
  background: var(--bg-white);
  color: var(--color-text);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(12,68,124,0.08);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-success {
  background: var(--color-accent-light);
  border: 1px solid var(--color-accent);
  border-radius: var(--border-radius);
  padding: 24px;
  text-align: center;
  color: var(--color-accent-hover);
  font-weight: 500;
}

/* ========================================
   Footer
   ======================================== */
.footer {
  background: #0a1628;
  color: rgba(255,255,255,0.7);
  padding: 64px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.5fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-brand h3 {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}

.footer-brand p {
  font-size: 13px;
  line-height: 1.8;
}

.footer-links h4,
.footer-contact h4 {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 16px;
}

.footer-links ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a {
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  transition: color var(--transition);
}

.footer-links a:hover {
  color: #fff;
}

.footer-contact p {
  font-size: 13px;
  line-height: 2;
}

.footer-bottom {
  padding: 24px 0;
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,0.35);
}

.footer-bottom a {
  color: rgba(255,255,255,0.45);
}

.footer-bottom a:hover {
  color: #fff;
}

/* ========================================
   Back to Top
   ======================================== */
.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  z-index: 999;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition);
  box-shadow: var(--shadow-md);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--color-primary-hover);
  transform: translateY(-3px);
}

/* ========================================
   Animations
   ======================================== */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-delay-1 { transition-delay: 0.1s; }
.fade-in-delay-2 { transition-delay: 0.2s; }
.fade-in-delay-3 { transition-delay: 0.3s; }

/* ========================================
   Responsive - Tablet
   ======================================== */
@media (max-width: 1024px) {
  :root {
    --section-padding: 60px;
  }
  
  .section-title {
    font-size: 28px;
  }
  
  .hero-title {
    font-size: 34px;
  }
  
  .hero-subtitle {
    font-size: 17px;
  }
  
  .product-overview-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  .gallery-mosaic {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .gallery-item-large {
    grid-column: span 1;
    grid-row: span 1;
    aspect-ratio: 4/3;
  }
  
  .applications-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .about-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 36px;
  }

  .specs-table td {
    padding: 12px 16px;
    font-size: 13px;
  }
  
  .spec-label {
    width: 22%;
  }
  
  .spec-value {
    width: 28%;
  }
  
  .btn-nav {
    display: none;
  }
  
  .nav-link {
    padding: 8px 10px;
    font-size: 13px;
  }
}

/* ========================================
   Responsive - Mobile
   ======================================== */
@media (max-width: 768px) {
  :root {
    --section-padding: 48px;
    --header-height: 60px;
  }
  
  .section-header {
    margin-bottom: 36px;
  }
  
  .section-title {
    font-size: 24px;
  }
  
  .hero {
    min-height: 500px;
  }
  
  .hero-title {
    font-size: 28px;
  }
  
  .hero-subtitle {
    font-size: 15px;
  }
  
  .hero-desc {
    font-size: 13px;
  }
  
  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .btn-nav {
    display: block;
  }
  
  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--bg-white);
    box-shadow: var(--shadow-lg);
    transition: right var(--transition);
    padding: 100px 24px 24px;
    flex-direction: column;
    justify-content: flex-start;
  }
  
  .nav.active {
    right: 0;
  }
  
  .nav-list {
    flex-direction: column;
    gap: 4px;
  }
  
  .nav-link {
    padding: 12px 16px;
    font-size: 15px;
  }
  
  .menu-toggle {
    display: flex;
    margin-left: auto;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .gallery-mosaic {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  
  .applications-grid {
    grid-template-columns: 1fr;
  }
  
  .specs-table td {
    display: block;
    width: 100%;
    padding: 8px 16px;
  }
  
  .specs-table tr {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-light);
  }
  
  .spec-label {
    background: none;
    width: 40%;
    font-size: 12px;
  }
  
  .spec-value {
    width: 60%;
    font-size: 13px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .about-stats {
    gap: 24px;
    flex-wrap: wrap;
  }
  
  .stat-number {
    font-size: 26px;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
  }
}
