/* 基础与变量 */
:root {
  --color-primary: #0d47a1;
  --color-primary-dark: #002171;
  --color-accent: #ff6f00;
  --color-text: #212121;
  --color-text-muted: #616161;
  --color-bg: #fafafa;
  --color-white: #ffffff;
  --font-sans: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --radius: 8px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
}

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

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

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* 顶部导航 */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-primary);
}

.logo-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-primary);
  white-space: nowrap;
}

.logo-img {
  height: 52px;
  width: auto;
  max-width: 280px;
  object-fit: contain;
}

.nav {
  display: flex;
  gap: 32px;
}

.nav-link {
  font-weight: 500;
  color: var(--color-text);
  transition: color 0.2s;
}

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

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--color-text);
}

/* 轮播图 */
.hero {
  margin-top: 64px;
  min-height: 480px;
}

.carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #1a237e;
}

.carousel-inner {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 42%;
}

.carousel-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.carousel-item.active {
  opacity: 1;
  z-index: 1;
}

.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 48px 24px 32px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
  color: var(--color-white);
}

.carousel-caption h2 {
  margin: 0 0 8px;
  font-size: 2rem;
  font-weight: 600;
}

.carousel-caption p {
  margin: 0;
  font-size: 1rem;
  opacity: 0.9;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 48px;
  height: 48px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: var(--color-white);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s;
}

.carousel-btn:hover {
  background: rgba(255, 255, 255, 0.35);
}

.carousel-prev {
  left: 16px;
}

.carousel-next {
  right: 16px;
}

.carousel-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 12px;
}

.dot {
  width: 10px;
  height: 10px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background 0.2s;
}

.dot.active,
.dot:hover {
  background: var(--color-white);
}

/* 通用区块 */
.section {
  padding: 80px 0;
}

.section-title {
  margin: 0 0 8px;
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--color-text);
  text-align: center;
}

.section-subtitle {
  margin: 0 0 48px;
  font-size: 1rem;
  color: var(--color-text-muted);
  text-align: center;
}

/* 关于我们 */
.about {
  background: var(--color-white);
}

.about-content {
  max-width: 720px;
  margin: 0 auto;
}

.about-content p {
  margin: 0 0 16px;
  color: var(--color-text-muted);
}

.about-content p:last-child {
  margin-bottom: 0;
}

/* 产品与服务 */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.product-card {
  padding: 32px 24px;
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* 产品卡片方形配图（替换 images/product-1.jpg … product-5.jpg） */
.product-card-thumb {
  width: 100%;
  max-width: 112px;
  aspect-ratio: 1 / 1;
  margin: 0 auto 16px;
  border-radius: var(--radius);
  overflow: hidden;
  background: #e8eaf6;
  flex-shrink: 0;
  user-select: none;
  -webkit-user-select: none;
}

.product-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}

.product-card h3 {
  margin: 0 0 12px;
  font-size: 1.125rem;
  font-weight: 600;
}

.product-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

/* 产品与服务：中心 + 四角布局（3×3 网格） */
.product-grid--center-corners {
  grid-template-columns: 1fr 1.15fr 1fr;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  max-width: 960px;
  margin: 0 auto;
  min-height: 420px;
}

.product-grid--center-corners .product-card--tl {
  grid-column: 1;
  grid-row: 1;
}
.product-grid--center-corners .product-card--tr {
  grid-column: 3;
  grid-row: 1;
}
.product-grid--center-corners .product-card--center {
  grid-column: 2;
  grid-row: 2;
}
.product-grid--center-corners .product-card--bl {
  grid-column: 1;
  grid-row: 3;
}
.product-grid--center-corners .product-card--br {
  grid-column: 3;
  grid-row: 3;
}

/* 中心卡片略大、更突出 */
.product-card--center {
  padding: 40px 28px;
  box-shadow: 0 4px 20px rgba(13, 71, 161, 0.15);
}
.product-card--center .product-card-thumb {
  max-width: 132px;
}
.product-card--center h3 {
  font-size: 1.2rem;
}

.product-card {
  cursor: pointer;
}
.product-card-more {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.875rem;
  color: var(--color-primary);
  font-weight: 500;
}
.product-card:hover .product-card-more {
  text-decoration: underline;
}

/* 产品详情弹窗 */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}
.modal.is-open {
  opacity: 1;
  visibility: visible;
}
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}
.modal-box {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  overflow: auto;
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  padding: 32px 40px 40px;
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  background: #f0f0f0;
  color: var(--color-text);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s;
}
.modal-close:hover {
  background: #e0e0e0;
}
.modal-title {
  margin: 0 0 20px;
  padding-right: 44px;
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--color-primary);
}
.modal-body {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--color-text-muted);
}
.modal-body p {
  margin: 0 0 12px;
}
.modal-body p:last-child {
  margin-bottom: 0;
}

/* 联系我们 */
.contact-info {
  max-width: 480px;
  margin: 0 auto;
  padding: 32px;
  background: var(--color-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.contact-info p {
  margin: 0 0 12px;
  color: var(--color-text-muted);
}

.contact-info p:last-child {
  margin-bottom: 0;
}

/* 页脚 */
.footer {
  padding: 24px 0;
  background: var(--color-primary-dark);
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  font-size: 0.875rem;
}

/* 响应式 */
@media (max-width: 768px) {
  .nav {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .nav.open {
    display: flex;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    padding: 16px;
    background: var(--color-white);
    box-shadow: var(--shadow);
  }

  .nav.open .nav-link {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
  }

  .carousel-inner {
    padding-bottom: 56%;
  }

  .carousel-caption h2 {
    font-size: 1.5rem;
  }

  .carousel-caption p {
    font-size: 0.9rem;
  }

  .product-grid {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .product-grid--center-corners .product-card--tl,
  .product-grid--center-corners .product-card--tr,
  .product-grid--center-corners .product-card--center,
  .product-grid--center-corners .product-card--bl,
  .product-grid--center-corners .product-card--br {
    grid-column: auto;
    grid-row: auto;
  }

  .product-card--center {
    padding: 32px 24px;
  }

  .section {
    padding: 48px 0;
  }

  .section-subtitle {
    margin-bottom: 32px;
  }
}
