/* ============================================
   YIGAN Homepage - Pixel-perfect from Figma
   Design: 1920x8734, 16 sections
   ============================================ */

/* === Font Faces === */
@font-face {
  font-family: 'DingTalk JinBuTi';
  src: local('DingTalk JinBuTi');
  font-weight: normal;
  font-style: normal;
}

/* === Design Tokens (from Figma) === */
/* 主色只需改 --primary-6, 其余色阶跟随调整 */
:root {
  /* ---- 基础色板 Light ---- */

  /* 主色 primary (基于 #0363e9) */
  --primary-1: #e8f2ff;
  --primary-2: #c8dfff;
  --primary-3: #9cc6ff;
  --primary-4: #6eabfe;
  --primary-5: #4292fe;
  --primary-6: #0363e9;
  --primary-7: #1568d8;
  --primary-8: #1257b4;
  --primary-9: #0e4691;
  --primary-10: #0b3772;

  /* 中性色 gray */
  --gray-1: #f7f8fa;
  --gray-2: #f2f3f5;
  --gray-3: #e5e6eb;
  --gray-4: #c9cdd4;
  --gray-5: #a9aeb8;
  --gray-6: #86909c;
  --gray-7: #6b7785;
  --gray-8: #4e5969;
  --gray-9: #272e3b;
  --gray-10: #1d2129;

  /* 功能色 */
  --red-1: #ffece8;
  --red-3: #fbaca3;
  --red-6: #f53f3f;
  --red-7: #cb272d;

  --orange-red-6: #f77234;

  --orange-1: #fff7e8;
  --orange-3: #ffcf8b;
  --orange-6: #ff7d00;
  --orange-7: #d25f00;

  --gold-6: #f7ba1e;

  --green-1: #e8ffea;
  --green-3: #7be188;
  --green-6: #00b42a;
  --green-7: #009a29;

  --cyan-6: #0fc6c2;

  --blue-1: #e8f7ff;
  --blue-6: #3491fa;

  --purple-6: #722ed1;

  --pink-purple-6: #d91ad9;

  --magenta-6: #f5319d;

  /* ---- 语义 Token (Light) ---- */

  /* 文字 */
  --color-text-1: var(--gray-10);   /* #1d2129 标题 */
  --color-text-2: var(--gray-8);    /* #4e5969 正文 */
  --color-text-3: var(--gray-6);    /* #86909c 辅助 */
  --color-text-4: var(--gray-4);    /* #c9cdd4 占位 */
  --color-text-white: #ffffff;

  /* 主色语义 */
  --color-primary: var(--primary-6);
  --color-primary-light: var(--primary-1);
  --color-primary-hover: var(--primary-5);
  --color-primary-active: var(--primary-7);
  --color-primary-disabled: var(--primary-3);

  /* 功能色语义 */
  --color-success: var(--green-6);
  --color-success-light: var(--green-1);
  --color-success-disabled: var(--green-3);
  --color-warning: var(--orange-6);
  --color-warning-light: var(--orange-1);
  --color-warning-disabled: var(--orange-3);
  --color-danger: var(--red-6);
  --color-danger-light: var(--red-1);
  --color-danger-disabled: var(--red-3);

  /* 背景 */
  --color-bg-1: #ffffff;
  --color-bg-2: #ffffff;
  --color-bg-3: #ffffff;
  --color-bg-4: #ffffff;
  --color-bg-5: #003acb;
  --color-bg-white: #ffffff;
  --color-bg-dark: #0b1d30;
  --color-bg-page: #000d2d;     /* 深色页面背景 */

  /* 填充 */
  --color-fill-1: var(--gray-1);
  --color-fill-2: var(--gray-2);
  --color-fill-3: var(--gray-3);
  --color-fill-4: var(--gray-4);

  /* 边框 */
  --color-border-1: var(--gray-2);
  --color-border-2: var(--gray-3);
  --color-border-3: var(--gray-4);
  --color-border-4: var(--gray-6);

  /* 遮罩 */
  --color-mask: rgba(29, 33, 41, 0.60);

  /* 白色透明度 */
  --white-10: rgba(255, 255, 255, 0.10);
  --white-20: rgba(255, 255, 255, 0.20);
  --white-40: rgba(255, 255, 255, 0.40);
  --white-60: rgba(255, 255, 255, 0.60);
  --white-80: rgba(255, 255, 255, 0.80);
  --white-100: #ffffff;

  /* ---- 组件 Token ---- */
  --btn-primary-disabled-text: #ffffff;
  --btn-brand-disabled-bg: var(--primary-3);
  --btn-success-disabled-bg: var(--green-3);
  --btn-danger-disabled-bg: var(--red-3);
  --btn-warning-disabled-bg: var(--orange-3);
  --tooltip-bg: var(--gray-10);
  --pagination-bg: var(--primary-1);

  /* ---- 旧变量兼容 (逐步迁移后可删) ---- */
  --color-border: var(--color-border-2);
  --color-border-light: var(--color-border-1);

  /* 圆角 */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;
  --radius-xl: 12px;

  /* 阴影 */
  --shadow-1: 0 2px 5px rgba(0, 0, 0, 0.06);
  --shadow-2: 0 4px 10px rgba(0, 0, 0, 0.08);
  --shadow-3: 0 8px 24px rgba(0, 0, 0, 0.12);
}

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

h1, h2, h3, h4, h5, h6 {
  font-weight: 500;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-weight: normal;
  color: var(--color-text-1);
  background: var(--color-bg-1);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

ul, li {
  list-style: none;
}

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

.container {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 0 40px;
  box-sizing: border-box;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 16px;
  line-height: 24px;
  cursor: pointer;
  border: none;
  border-radius: 4px;
  transition: opacity 0.3s;
}

.btn:hover {
  opacity: 0.85;
}

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

.btn-outline {
  background: #fff;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}

.btn-outline-white {
  background: #fff;
  color: var(--color-primary);
  border: 1px solid #fff;
}

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

/* === Section 0: Header === */
.header {
  width: 100%;
  height: 64px;
  background: #fff;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

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

.header-left {
  display: flex;
  align-items: center;
  gap: 80px;
}

.header-logo {
  font-family: 'DingTalk JinBuTi', -apple-system, 'PingFang SC', sans-serif;
  font-size: 20px;
  color: var(--color-text-1);
  white-space: nowrap;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 40px;
}

.header-nav a {
  font-family: inherit;
  font-size: 14px;
  color: var(--color-text-2);
  transition: color 0.3s;
}

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

.header-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.header-phone {
  font-family: inherit;
  font-size: 14px;
  color: var(--color-text-1);
}

.header-btn {
  padding: 6px 16px;
  font-size: 14px;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.3s;
}

.header-btn:hover {
  opacity: 0.85;
}

/* Nav Items with Dropdown */
.header-nav-item {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.header-nav-item > a {
  font-size: 14px;
  color: var(--color-text-2);
  transition: color 0.3s;
}
.header-nav-item > a:hover {
  color: var(--color-primary);
}

/* Dropdown Menu */
.header-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 160px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--gray-3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 1001;
}
.header-nav-item:hover .header-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.header-dropdown a {
  display: block;
  padding: 8px 20px;
  font-size: 14px;
  color: var(--color-text-2);
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.header-dropdown a:hover {
  background: var(--gray-1);
  color: var(--color-primary);
}

/* === Section 1: Banner === */
.banner {
  width: 100%;
  height: 600px;
  margin-top: 64px;
  background: url('../images/homepage/banner-bg.jpg') center center / cover no-repeat;
  display: flex;
  align-items: center;
}

.banner .container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.banner-title {
  font-family: inherit;
  font-size: 56px;
  line-height: 64px;
  color: var(--color-text-1);
}

.banner-subtitle {
  font-family: inherit;
  font-size: 24px;
  line-height: 32px;
  color: var(--color-text-2);
  max-width: 800px;
}

.banner-buttons {
  display: flex;
  gap: 24px;
  margin-top: 8px;
}

.banner-buttons .btn {
  padding: 12px 32px;
}

/* === Section 2: Overlay === */
.overlay-section {
  width: 100%;
  height: 174px;
  padding: 40px 0;
}

.overlay-section .container {
  display: flex;
  gap: 20px;
}

.overlay-card {
  width: 480px;
  height: 94px;
  padding: 20px;
  background: #fff;
  border-radius: 0;
  display: flex;
  align-items: center;
  gap: 20px;
}

.overlay-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.overlay-icon img {
  width: 40px;
  height: 40px;
}

.overlay-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.overlay-text h4 {
  font-size: 16px;
  line-height: 24px;
  color: var(--color-bg-dark);
  font-weight: 400;
}

.overlay-text p {
  font-size: 14px;
  line-height: 22px;
  color: var(--color-text-2);
}

/* === Section 3: Two-Column Info === */
/* === Section 3: Stats Cards Grid === */
.stats-grid-section {
  width: 100%;
  padding: 40px 0;
}

.stats-grid-section .container {
  background: transparent;
  border-radius: 4px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.sg-span2 {
  grid-column: span 2;
}

.sg-card {
  background: #f7f8fa;
  border-radius: 8px;
  padding: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 240px;
}

.sg-text {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sg-num {
  font-size: 48px;
  line-height: 56px;
  font-weight: 400;
  color: var(--gray-10);
}

.sg-label {
  font-size: 16px;
  line-height: 24px;
  color: var(--gray-6);
}

.sg-illust {
  width: 160px;
  height: 160px;
  flex-shrink: 0;
}

.sg-illust-wide {
  width: 200px;
}

.sg-illust img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* === Section 4: Why Choose Us === */
.why-choose {
  width: 100%;
  padding: 40px 0;
}

.why-choose .container {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.section-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.section-header h2 {
  font-family: inherit;
  font-size: 36px;
  line-height: 44px;
  color: var(--color-text-1);
  font-weight: 500;
}

.section-header .blue-line {
  width: 128px;
  height: 4px;
  background: var(--color-primary);
  border-radius: 2px;
}

.section-header .subtitle {
  font-family: inherit;
  font-size: 16px;
  line-height: 24px;
  color: var(--color-text-2);
}

.why-choose-body {
  font-family: inherit;
  font-size: 16px;
  line-height: 24px;
  color: var(--color-text-2);
  text-align: center;
}

.why-choose-row {
  display: flex;
  gap: 48px;
  align-items: center;
  margin-bottom: 32px;
}

.why-choose-text {
  flex: 1;
  font-size: 18px;
  line-height: 2.4;
  color: var(--color-text-2);
  text-align: left;
}

.why-choose-image {
  flex: 0 0 50%;
  height: 360px;
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.why-choose-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Advantage Grid (2x2) */
.advantage-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
}

.advantage-card {
  width: 700px;
  min-height: 236px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.advantage-card img {
  width: 48px;
  height: 48px;
}

.advantage-card h4 {
  font-family: inherit;
  font-size: 20px;
  line-height: 28px;
  color: var(--color-text-1);
  font-weight: 400;
}

.advantage-card p {
  font-family: inherit;
  font-size: 16px;
  line-height: 24px;
  color: var(--color-text-2);
  font-weight: 400;
}

/* === Section 5: Products Title === */
.products-title-section {
  width: 100%;
  padding: 40px 0;
}

.products-title-section .container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* === Section 5.5: Hardware Showcase === */
.hardware-showcase {
  width: 100%;
  padding: 80px 0;
}

.hardware-showcase .container {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.hw-tabs {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.hw-tab-nav {
  display: flex;
  justify-content: center;
  gap: 16px;
}

.hw-tab-btn {
  padding: 10px 28px;
  font-size: 15px;
  line-height: 22px;
  color: var(--gray-6);
  background: var(--gray-2, #f2f3f5);
  border: 1px solid var(--gray-3, #e5e6eb);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s;
}

.hw-tab-btn:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: #fff;
}

.hw-tab-btn.active {
  color: #fff;
  background: var(--color-primary);
  border-color: var(--color-primary);
}

.hw-tab-panel {
  display: none;
}

.hw-tab-panel.active {
  display: block;
}

.hw-product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.hw-product-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--gray-3, #e5e6eb);
  transition: box-shadow 0.3s, transform 0.3s;
  cursor: pointer;
  text-decoration: none;
  display: block;
}

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

.hw-product-img {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.hw-product-card img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.4s ease;
}

.hw-product-card:hover img {
  transform: scale(1.05);
}

.hw-product-info {
  padding: 14px 16px;
  background: #f7f8fa;
  border-top: 1px solid var(--gray-3, #e5e6eb);
}

.hw-product-info h4 {
  font-size: 14px;
  line-height: 22px;
  color: var(--color-text-1);
  font-weight: 500;
  margin: 0;
  text-align: center;
}

.hw-product-info p {
  font-size: 13px;
  line-height: 20px;
  color: var(--gray-6);
  margin: 4px 0 0;
  text-align: center;
}

.hw-view-all {
  text-align: center;
}

.hw-view-all-btn {
  display: inline-block;
  padding: 12px 40px;
  font-size: 15px;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.3s, color 0.3s;
}

.hw-view-all-btn:hover {
  background: var(--color-primary);
  color: #fff;
}

@media (max-width: 1024px) {
  .hw-product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .hw-product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (max-width: 480px) {
  .hw-product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

/* === Sections 6-13: Product Blocks === */
.product-block {
  width: 100%;
  padding: 120px 0;
}

.product-block .container {
  display: flex;
  align-items: center;
  gap: 80px;
}

/* Light block: text-left, image-right */
.product-block.light {
  background: #fff;
}

.product-block.light .product-text h3 {
  color: var(--color-text-1);
}

.product-block.light .product-text p {
  color: var(--color-text-2);
}

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

/* Dark block: image-left, text-right */
.product-block.dark {
  background: var(--color-bg-dark);
}

.product-block.dark .product-text h3 {
  color: #fff;
}

.product-block.dark .product-text p {
  color: rgba(255, 255, 255, 0.85);
}

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

.product-block.dark .container {
  flex-direction: row-reverse;
}

.product-text {
  width: 640px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.product-text h3 {
  font-family: inherit;
  font-size: 36px;
  line-height: 44px;
  font-weight: 500;
}

.product-text p {
  font-family: inherit;
  font-size: 20px;
  line-height: 28px;
}

.product-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 172px;
  height: 48px;
  padding: 7px 24px;
  gap: 8px;
  border: none;
  border-radius: 4px;
  font-family: inherit;
  font-size: 16px;
  cursor: pointer;
  margin-top: 16px;
  transition: opacity 0.3s;
}

.product-btn:hover {
  opacity: 0.85;
}

.product-image {
  width: 720px;
  height: 357.75px;
  flex-shrink: 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* === Section 14: CTA === */
.cta-section {
  width: 100%;
  padding-top: 80px;
}

.cta-bg {
  width: 100%;
  height: 800px;
  background: url('../images/homepage/stats-bg.jpg') center center / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cta-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 80px;
}

.cta-title {
  text-align: center;
}

.cta-title span {
  font-family: 'DingTalk JinBuTi', -apple-system, 'PingFang SC', sans-serif;
  font-size: 48px;
  font-weight: 400;
  color: #000;
  line-height: 67px;
}

.cta-title .highlight {
  color: #2659ff;
}

.cta-metrics {
  display: flex;
  gap: 200px;
}

.cta-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.cta-metric .metric-value {
  font-family: inherit;
  font-size: 48px;
  line-height: 56px;
  font-weight: 500;
  color: var(--color-primary);
}

.cta-metric .metric-value .percent {
  font-size: 36px;
  line-height: 44px;
}

.cta-metric .metric-label {
  font-family: inherit;
  font-size: 20px;
  color: var(--color-text-1);
}

.cta-buttons {
  display: flex;
  gap: 24px;
}

.cta-buttons .btn {
  padding: 12px 32px;
  font-size: 16px;
}

/* === Section 15: Footer === */
.footer {
  width: 100%;
  padding: 40px 0;
  background: #fff;
}

.footer .container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-guarantees {
  display: flex;
  gap: 16px;
}

.guarantee-item {
  width: 348px;
  height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.guarantee-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.guarantee-icon img {
  width: 32px;
  height: 32px;
}

.guarantee-text h5 {
  font-family: inherit;
  font-size: 16px;
  color: var(--color-text-1);
  font-weight: 400;
}

.guarantee-text p {
  font-family: inherit;
  font-size: 14px;
  color: var(--color-text-2);
}

.footer-divider {
  width: 100%;
  height: 1px;
  background: var(--color-border);
  margin: 16px 0;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  height: 128px;
  gap: 80px;
}

.footer-info {
  width: 1094px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.footer-nav-row {
  display: flex;
  align-items: center;
  height: 40px;
  gap: 80px;
}

.footer-logo {
  font-family: 'DingTalk JinBuTi', -apple-system, 'PingFang SC', sans-serif;
  font-size: 20px;
  line-height: 28px;
  color: var(--color-text-1);
  white-space: nowrap;
}

.footer-nav {
  display: flex;
  gap: 40px;
}

.footer-nav a {
  font-size: 14px;
  line-height: 22px;
  color: var(--color-text-1);
  transition: color 0.3s;
}

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

.footer-copyright {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-copyright p {
  font-size: 12px;
  line-height: 20px;
  color: var(--color-text-3);
}

.footer-contact {
  width: 266px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-contact-row {
  display: flex;
  font-size: 14px;
  line-height: 22px;
}

.footer-contact-row span:first-child {
  color: var(--color-text-1);
}

.footer-contact-row .contact-value {
  color: var(--color-text-1);
}

/* === Scroll Animation === */
.fade-in {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

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