/* Header + Footer — 全站共用，后续页面保持一致 */

/* ========== Header ========== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-height);
  background: #fff;
  border-bottom: 1px solid #e8edf5;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

body:not([data-header="overlay"]) {
  padding-top: var(--header-height);
}

body[data-header="overlay"] .site-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  box-shadow: none;
  border-bottom-color: rgba(232, 237, 245, 0.7);
}

#site-header,
#site-footer {
  display: block;
  min-height: var(--header-height);
}

.site-header__inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  height: 100%;
  max-width: var(--layout-max);
  margin: 0 auto;
  padding: 0 40px;
  gap: 20px 28px;
}

.site-header__logo {
  flex-shrink: 0;
  width: 196px;
  height: 40px;
}

.site-header__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left center;
}

/* 中间列：菜单整体居中 + 等距，避免最后一项后空一大块 */
.site-header__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: clamp(10px, 1.4vw, 28px);
  margin: 0;
  min-width: 0;
}

.site-header__nav a:not(.site-header__nav-promo) {
  position: relative;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #334155;
  white-space: nowrap;
  padding: 10px 4px;
  border-radius: 8px;
  flex: 0 0 auto;
  transition: color var(--duration) var(--ease), background var(--duration) var(--ease);
}

.site-header__nav a:not(.site-header__nav-promo):hover {
  color: var(--color-primary);
  background: rgba(61, 56, 245, 0.06);
}

.site-header__nav a:not(.site-header__nav-promo).is-active {
  color: var(--color-primary);
  font-weight: 700;
  background: transparent;
}

.site-header__nav a:not(.site-header__nav-promo).is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 3px;
  border-radius: 999px;
  background: var(--color-primary);
}

.site-header__nav-promo {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: #fff7ed;
  border: 1px solid #fdba74;
  text-decoration: none;
  line-height: 1.2;
  flex: 0 0 auto;
  transition: background var(--duration) var(--ease), border-color var(--duration) var(--ease);
}

.site-header__nav-promo:hover,
.site-header__nav-promo.is-active {
  background: #ffedd5;
  border-color: #fb923c;
}

.site-header__nav-promo-title {
  font-size: 16px;
  font-weight: 700;
  color: #9a3412;
  white-space: nowrap;
}

.site-header__nav-promo-sub {
  position: absolute;
  top: -8px;
  right: -8px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  line-height: 1.2;
  padding: 3px 7px;
  border-radius: 999px;
  background: #ea580c;
  box-shadow: 0 2px 6px rgba(234, 88, 12, 0.35);
  pointer-events: none;
}

.site-header__tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-shrink: 0;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: 0;
}

.site-header__actions .btn {
  height: 40px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
  border-radius: 8px;
}

.site-header__actions .btn--ghost {
  border-color: #dbe3ef;
  color: #334155;
}

.site-header__actions .btn--prepaid {
  width: auto;
  min-width: 88px;
  padding: 0 12px;
}

.site-header__actions .btn--prepaid .badge {
  top: -9px;
  right: -10px;
  height: 18px;
  padding: 0 8px;
  font-size: 11px;
  line-height: 18px;
  border-radius: 999px;
}

.site-header__search {
  position: relative;
  width: 220px;
  max-width: 220px;
  min-width: 148px;
  height: 40px;
  flex: 0 0 220px;
  margin-left: 0;
}

/* 桌面分档：只收间距/搜索宽度，保持三栏结构；字号不低于 15px */
@media (max-width: 1759px) {
  .site-header__inner {
    padding: 0 28px;
    gap: 16px 20px;
  }
  .site-header__logo {
    width: 180px;
    height: 36px;
  }
  .site-header__nav {
    gap: clamp(8px, 1vw, 20px);
  }
  .site-header__search {
    width: 200px;
    max-width: 200px;
    flex: 0 0 200px;
  }
}

@media (max-width: 1599px) {
  .site-header__inner {
    padding: 0 20px;
    gap: 12px 16px;
  }
  .site-header__logo {
    width: 168px;
    height: 34px;
  }
  .site-header__nav {
    gap: clamp(6px, 0.8vw, 14px);
  }
  .site-header__nav a:not(.site-header__nav-promo),
  .site-header__nav-promo-title {
    font-size: 15px;
  }
  .site-header__nav a:not(.site-header__nav-promo) {
    padding: 8px 2px;
  }
  .site-header__nav-promo {
    padding: 7px 10px;
  }
  .site-header__tools {
    gap: 10px;
  }
  .site-header__actions .btn {
    height: 38px;
    padding: 0 12px;
    font-size: 14px;
  }
  .site-header__search {
    width: 180px;
    max-width: 180px;
    height: 38px;
    flex: 0 0 180px;
  }
}

@media (max-width: 1439px) {
  .site-header__inner {
    padding: 0 16px;
    gap: 10px 12px;
  }
  .site-header__logo {
    width: 148px;
    height: 32px;
  }
  .site-header__nav {
    gap: 4px;
    justify-content: flex-start;
  }
  .site-header__nav a:not(.site-header__nav-promo),
  .site-header__nav-promo-title {
    font-size: 15px;
  }
  .site-header__nav a:not(.site-header__nav-promo) {
    padding: 8px 4px;
  }
  .site-header__nav-promo {
    padding: 7px 8px;
  }
  .site-header__tools {
    gap: 8px;
  }
  .site-header__actions {
    gap: 6px;
  }
  .site-header__actions .btn {
    height: 36px;
    padding: 0 10px;
  }
  .site-header__search {
    width: 160px;
    max-width: 160px;
    height: 36px;
    flex: 0 1 160px;
    min-width: 132px;
  }
}

@media (max-width: 1279px) {
  .site-header__inner {
    padding: 0 14px;
    gap: 8px;
  }
  .site-header__logo {
    width: 136px;
    height: 30px;
  }
  .site-header__nav {
    gap: 2px;
  }
  .site-header__nav a:not(.site-header__nav-promo),
  .site-header__nav-promo-title {
    font-size: 15px;
  }
  .site-header__nav a:not(.site-header__nav-promo) {
    padding: 7px 3px;
  }
  .site-header__actions .btn {
    height: 34px;
    font-size: 13px;
    padding: 0 8px;
  }
  .site-header__search {
    width: 140px;
    max-width: 140px;
    height: 34px;
    flex: 0 1 140px;
    min-width: 120px;
  }
}

.site-header__search input {
  width: 100%;
  height: 100%;
  padding: 0 14px 0 36px;
  border: 1px solid #d7deea;
  border-radius: 999px;
  background: #f8fafc;
  font-size: 14px;
  color: var(--color-text);
  transition: border-color var(--duration) var(--ease), background var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.site-header__search input:focus {
  outline: none;
  background: #fff;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(61, 56, 245, 0.12);
}

.site-header__search input::placeholder {
  color: #94a3b8;
}

.site-header__search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  pointer-events: none;
}

.site-header__search-icon img {
  width: 100%;
  height: 100%;
}

.site-header__suggest {
  position: absolute;
  left: 0;
  right: auto;
  top: calc(100% + 6px);
  z-index: 80;
  /* 比搜索框更宽，避免长产品名被挤成省略号（如「燃烧离子色谱 (CIC)」） */
  width: max(100%, min(480px, 92vw));
  max-height: min(360px, 60vh);
  overflow: auto;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: #fff;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  box-sizing: border-box;
}

.site-header__suggest[hidden] {
  display: none !important;
}

.site-header__suggest-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  text-align: left;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  box-sizing: border-box;
}

.site-header__suggest-item:hover,
.site-header__suggest-item.is-active {
  background: #f1f5ff;
}

.site-header__suggest-item__name {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.45;
  /* 客户反馈：相似品名缩字后易点错，完整展示不省略 */
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  word-break: break-word;
}

.site-header__suggest-item__ch {
  flex: 0 0 auto;
  margin-top: 1px;
  font-size: 11px;
  color: #3d38f5;
  background: #eff6ff;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
}

.site-header__suggest-empty,
.site-header__suggest-more {
  display: block;
  padding: 10px 12px;
  font-size: 12px;
  color: #64748b;
  text-decoration: none;
}

.site-header__suggest-more:hover {
  color: #3d38f5;
  background: #f8fafc;
}

/* ========== Footer ========== */
.site-footer {
  position: relative;
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  overflow: hidden;
  min-height: 360px;
}

.site-footer__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.site-footer__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.site-footer__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 280px 1fr auto;
  gap: 80px;
  width: 100%;
  max-width: min(var(--layout-content), calc(100% - 48px));
  margin: 0 auto;
  padding: 48px 0 40px;
  box-sizing: border-box;
}

.site-footer__brand-logo {
  width: 260px;
  height: 47px;
}

.site-footer__brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left center;
}

.site-footer__slogan {
  margin-top: 16px;
  font-size: var(--font-size-sm);
  color: var(--color-footer-text);
}

.site-footer__address {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 70px;
  font-size: var(--font-size-sm);
  line-height: 1.5;
  max-width: 256px;
}

.site-footer__address img {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}

.site-footer__nav-title {
  font-size: var(--font-size-md);
  font-weight: 500;
  color: #fff;
  margin-bottom: 24px;
}

.site-footer__nav-list {
  display: grid;
  grid-template-columns: repeat(2, auto);
  column-gap: 120px;
  row-gap: 20px;
  justify-content: start;
}

.site-footer__nav-list a {
  position: relative;
  padding-left: 14px;
  font-size: var(--font-size-sm);
  color: var(--color-footer-text);
  transition: color var(--duration) var(--ease);
}

.site-footer__nav-list a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  transform: translateY(-50%);
}

.site-footer__nav-list a:hover {
  color: #fff;
}

.site-footer__qr {
  display: flex;
  gap: 20px;
}

.site-footer__qr-card {
  width: 146px;
  height: 190px;
  padding: 10px 18px 0;
  border-radius: var(--radius-md);
  border: 1px solid rgba(241, 245, 249, 0.1);
  background: rgba(255, 255, 255, 0.06);
  text-align: center;
}

.site-footer__qr-img {
  width: 110px;
  height: 110px;
  margin: 0 auto;
  padding: 7px;
  background: #fff;
  border-radius: var(--radius-sm);
}

.site-footer__qr-img img {
  width: 96px;
  height: 96px;
  object-fit: cover;
}

.site-footer__qr-text {
  margin-top: 12px;
  font-size: var(--font-size-xs);
  color: #fff;
  line-height: 1.4;
}

.site-footer__copy {
  position: relative;
  z-index: 1;
  padding: 16px 20px 24px;
  text-align: center;
  font-size: var(--font-size-xs);
  color: var(--color-text-copyright);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  line-height: 1.6;
}
.site-footer__copy a {
  color: inherit;
  text-decoration: none;
  opacity: 0.92;
}
.site-footer__copy a:hover {
  opacity: 1;
  text-decoration: underline;
}
.site-footer__copy-sep {
  margin: 0 4px;
}
