/* ============================================================
   MOSINTER GROUP - 配方中心  |  style.css
   主色：深绿 #1a4a2e / 中绿 #2d6a4f / 浅绿 #52b788
   背景：白 #ffffff / 浅灰 #f8f9f6
   ============================================================ */

/* ---------- CSS 变量 ---------- */
:root {
  --green-dark:   #1a4a2e;
  --green-mid:    #2d6a4f;
  --green-light:  #52b788;
  --green-pale:   #e8f5ee;
  --text-dark:    #1a1a1a;
  --text-mid:     #444444;
  --text-light:   #888888;
  --bg-white:     #ffffff;
  --bg-light:     #f8f9f6;
  --border:       #e0e8e3;
  --radius:       8px;
  --shadow:       0 2px 16px rgba(0,0,0,.08);
  --transition:   .25s ease;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text-dark);
  background: var(--bg-white);
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { display: block; max-width: 100%; height: auto; }

/* .container 已由 main.css 定义，此处移除冲突规则 */

.section { padding: 72px 0; }

/* ============================================================
   HEADER
   ============================================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
  transition: box-shadow var(--transition);
}

.header.scrolled { box-shadow: 0 2px 20px rgba(0,0,0,.12); }

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo__img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

/* 图片缺失时显示绿色占位 */
.logo__img[src="images/logo.png"]:not([src=""]) {
  background: var(--green-pale);
  border-radius: 4px;
}

.logo__text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo__name {
  font-size: 18px;
  font-weight: 700;
  color: var(--green-dark);
  letter-spacing: 1px;
}

.logo__sub {
  font-size: 9px;
  color: var(--text-light);
  letter-spacing: .5px;
}

/* Nav */
.nav__list {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav__link {
  display: block;
  padding: 6px 14px;
  font-size: 14px;
  color: var(--text-mid);
  border-radius: 4px;
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}

.nav__link:hover { color: var(--green-mid); }

.nav__item--active .nav__link {
  color: var(--green-dark);
  font-weight: 600;
  border-bottom: 2px solid var(--green-dark);
  border-radius: 0;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--green-dark);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.hamburger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  background: var(--bg-light);
  overflow: hidden;
  padding: 0;
}

.hero__inner {
  display: flex;
  align-items: center;
  min-height: 480px;
  gap: 40px;
}

.hero__content {
  flex: 1;
  padding: 60px 0;
}

.hero__title {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-dark);
  margin-bottom: 20px;
}

.hero__title--green { color: var(--green-dark); }

.hero__desc {
  font-size: 15px;
  color: var(--text-mid);
  margin-bottom: 36px;
  line-height: 1.8;
}

/* 四项特点 */
.hero__features {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
}

.hero__feature {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.hero__feature-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
  /* 图片缺失时的占位样式 */
  background: var(--green-pale);
  border-radius: 4px;
  padding: 4px;
}

.hero__feature-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
}

.hero__feature-sub {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
}

/* Hero 右侧图片 */
.hero__image {
  flex: 1;
  max-width: 520px;
  height: 480px;
  overflow: hidden;
  border-radius: 0 0 0 0;
}

.hero__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* 图片缺失占位 */
  background: linear-gradient(135deg, #d8ede2 0%, #b7d9c4 100%);
  min-height: 480px;
}

/* ============================================================
   SECTION HEADER (通用)
   ============================================================ */
.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
}

.section-title__line {
  color: var(--green-light);
  font-weight: 300;
  font-size: 20px;
}

.section-subtitle {
  font-size: 14px;
  color: var(--text-light);
}

/* ============================================================
   配方中心
   ============================================================ */
.formula-center { background: var(--bg-white); }

/* formula-center 父容器使用 main.css 的 .container 默认宽度，不额外覆盖 */

.formula-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  width: 100%;
}

.formula-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
  cursor: pointer;
}

.formula-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.formula-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  background: var(--bg-white);
}

.formula-card__icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  background: var(--green-pale);
  border-radius: 4px;
  padding: 3px;
  flex-shrink: 0;
}

.formula-card__title {
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-dark);
  text-align: center;
}

.formula-card__arrow {
  font-size: 16px;
  color: var(--green-mid);
  transition: transform var(--transition);
}

.formula-card:hover .formula-card__arrow { transform: translateX(4px); }

.formula-card__image {
  width: 100%;
  height: 180px;
  overflow: hidden;
}

.formula-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
  background: linear-gradient(135deg, #e8f5ee 0%, #c8e6d4 100%);
  min-height: 180px;
}

.formula-card:hover .formula-card__image img { transform: scale(1.05); }

/* ============================================================
   配方优势
   ============================================================ */
.advantages { background: var(--bg-light); }

.advantages__title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 36px;
}

.advantages__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.advantage-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 24px 20px;
  background: var(--bg-white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: box-shadow var(--transition);
}

.advantage-item:hover { box-shadow: var(--shadow); }

.advantage-item__icon-wrap {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: var(--green-pale);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.advantage-item__icon-wrap img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.advantage-item__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.advantage-item__title--green { color: var(--green-mid); }

.advantage-item__desc {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.7;
}

/* ============================================================
   配方应用价值
   ============================================================ */
.value { background: var(--bg-white); }

.value__inner {
  display: flex;
  align-items: center;
  gap: 0;
  /* 背景图路径请自行替换，不添加任何遮罩，原色显示 */
  background-image: url('/assets/imgs/formulations_home/value-bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  /* 与 formula-grid 左右宽度对齐：与 main.css .container 保持相同的 max-width */
  max-width: var(--content-max) !important;
  /* 去掉内部 padding，让背景图完整铺满，由子元素自行控制内边距 */
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  min-height: 280px;
  overflow: hidden;
}

.value__content {
  flex: 1;
  /* 去掉白色遮罩，文字直接显示在背景图上 */
  background: transparent;
  padding: 48px var(--content-pad);
}

.value__title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.value__desc {
  font-size: 14px;
  color: var(--text-mid);
  margin-bottom: 28px;
}

.value__list { margin-bottom: 36px; }

.value__list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text-mid);
  margin-bottom: 14px;
}

.value__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--green-mid);
  color: var(--green-mid);
  font-size: 11px;
  flex-shrink: 0;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 28px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  border: none;
}

.btn--primary {
  background: var(--green-dark);
  color: #fff;
}

.btn--primary:hover {
  background: var(--green-mid);
  transform: translateX(2px);
}

/* Value 右侧：背景图已由 value__inner 提供，右侧区域透明展示背景 */
.value__image {
  flex: 1;
  background: transparent;
  /* 隐藏右侧图片容器，背景图已由 value__inner 展示 */
  display: none;
}

.value__image img {
  display: none;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--green-dark);
  color: rgba(255,255,255,.85);
}

.footer__inner {
  display: grid;
  grid-template-columns: 220px repeat(6, 1fr) 160px;
  gap: 32px;
  padding-top: 56px;
  padding-bottom: 48px;
}

/* 品牌区 */
.footer__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.footer__logo-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  background: rgba(255,255,255,.1);
  border-radius: 4px;
}

.footer__logo-name {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 1px;
}

.footer__logo-sub {
  display: block;
  font-size: 8px;
  color: rgba(255,255,255,.5);
  letter-spacing: .5px;
}

.footer__brand-desc {
  font-size: 12px;
  line-height: 1.8;
  color: rgba(255,255,255,.6);
  margin-bottom: 20px;
}

.footer__social {
  display: flex;
  gap: 10px;
}

.footer__social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.3);
  font-size: 11px;
  color: rgba(255,255,255,.7);
  transition: background var(--transition), border-color var(--transition);
}

.footer__social-link:hover {
  background: rgba(255,255,255,.15);
  border-color: rgba(255,255,255,.6);
}

/* 列 */
.footer__col-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 16px;
}

.footer__col-list li {
  margin-bottom: 10px;
}

.footer__col-list a,
.footer__col-list li {
  font-size: 12px;
  color: rgba(255,255,255,.6);
  transition: color var(--transition);
  line-height: 1.5;
}

.footer__col-list a:hover { color: #fff; }

/* 联系 + 二维码 */
.footer__contact-list li { display: flex; align-items: flex-start; gap: 6px; }

.footer__qr {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.footer__qr img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  background: rgba(255,255,255,.15);
  border-radius: 4px;
}

.footer__qr span {
  font-size: 11px;
  color: rgba(255,255,255,.6);
}

/* 底部版权 */
.footer__bottom {
  border-top: 1px solid rgba(255,255,255,.1);
}

.footer__bottom-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  font-size: 12px;
  color: rgba(255,255,255,.4);
}

.footer__bottom-links {
  display: flex;
  gap: 24px;
}

.footer__bottom-links a {
  color: rgba(255,255,255,.4);
  transition: color var(--transition);
}

.footer__bottom-links a:hover { color: rgba(255,255,255,.8); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet */
@media (max-width: 1024px) {
  .formula-grid { grid-template-columns: repeat(2, 1fr); }
  .advantages__grid { grid-template-columns: repeat(2, 1fr); }
  .footer__inner {
    grid-template-columns: repeat(4, 1fr);
  }
  .footer__brand { grid-column: 1 / -1; }
}

/* Mobile */
@media (max-width: 768px) {
  /* Nav */
  .nav {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    transform: translateY(-120%);
    transition: transform var(--transition);
    z-index: 999;
  }

  .nav.open { transform: translateY(0); }

  .nav__list { flex-direction: column; align-items: flex-start; gap: 0; }

  .nav__link { padding: 12px 0; width: 100%; border-bottom: 1px solid var(--border); }

  .nav__item--active .nav__link { border-bottom: 1px solid var(--border); border-left: 3px solid var(--green-dark); padding-left: 10px; }

  .hamburger { display: flex; }

  /* Hero */
  .hero__inner { flex-direction: column; min-height: auto; }
  .hero__content { padding: 40px 0 24px; }
  .hero__title { font-size: 26px; }
  .hero__image { max-width: 100%; height: 280px; width: 100%; }
  .hero__features { gap: 20px; }

  /* Sections */
  .section { padding: 48px 0; }
  .formula-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .advantages__grid { grid-template-columns: 1fr; }

  /* Value */
  .value__inner { flex-direction: column; gap: 32px; }
  .value__image { max-width: 100%; width: 100%; height: 240px; }

  /* Footer */
  .footer__inner { grid-template-columns: repeat(2, 1fr); gap: 24px; }
  .footer__brand { grid-column: 1 / -1; }
  .footer__col--contact { grid-column: 1 / -1; }
  .footer__bottom-inner { flex-direction: column; gap: 10px; text-align: center; }
}

@media (max-width: 480px) {
  .formula-grid { grid-template-columns: 1fr; }
  .hero__title { font-size: 22px; }
  .section-title { font-size: 22px; }
}
