/* Shengxinyuan – abc landing page */
:root {
  --sx-green: #7cb521;
  --sx-green-dark: #5f9414;
  --sx-green-deep: #2d5a1a;
  --sx-lime: #f1f7ec;
  --sx-ink: #1f2937;
  --sx-muted: #6b7280;
  --header-h: 4.25rem;
}

@media (min-width: 768px) {
  :root {
    --header-h: 5.25rem;
  }
}

@media (min-width: 1024px) {
  :root {
    --header-h: 5.75rem;
  }
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 0.5rem);
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  color: var(--sx-ink);
  background: #fff;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--sx-green);
  color: #fff;
  font-size: 0.875rem;
}
.skip-link:focus {
  left: 0.75rem;
  top: 0.75rem;
}

.focus-ring:focus-visible {
  outline: 2px solid var(--sx-green);
  outline-offset: 2px;
}

/* Top bar */
.topbar {
  background: #f3f4f6;
  font-size: 12px;
  color: #4b5563;
}

.topbar-cta {
  background: var(--sx-green);
  color: #fff;
  padding: 0.35rem 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  line-height: 1.2;
}

/* Header */
.site-header.is-scrolled {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.nav-link {
  position: relative;
  padding: 0.5rem 0;
  color: #374151;
  transition: color 0.2s ease;
  white-space: nowrap;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--sx-green);
  transform: translateX(-50%);
  transition: width 0.25s ease;
}
.nav-link:hover,
.nav-link.is-active {
  color: var(--sx-green-deep);
}
.nav-link:hover::after,
.nav-link.is-active::after {
  width: 100%;
}

.lang-switch {
  flex-shrink: 0;
  align-items: flex-end;
  gap: 0.5rem;
}

.lang-btn {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.2rem;
  min-height: 1.85rem;
  padding: 0.15rem;
  border: none;
  border-radius: 2px;
  background: transparent;
  color: inherit;
  line-height: 1;
  transition: opacity 0.2s ease;
}

.lang-btn:hover {
  opacity: 0.85;
}

.lang-btn.is-active {
  background: transparent;
  border: none;
  color: inherit;
}

/* 绿色三角在国旗上方；未选中透明占位，三面旗底边对齐 */
.lang-btn::before {
  content: "";
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid transparent;
}

.lang-btn.is-active::before {
  border-top-color: #7cb521;
}

.lang-flag {
  width: 2rem;
  height: auto;
  flex-shrink: 0;
  display: block;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}

/* Hero */
.hero-caption {
  animation: fadeUp 0.9s ease both 0.15s;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-video.is-ready {
  opacity: 1;
}

.hero-loading {
  pointer-events: none;
  background: linear-gradient(180deg, rgba(15, 30, 10, 0.18), rgba(15, 30, 10, 0.35));
  transition: opacity 0.35s ease;
}

.hero-loading.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.hero-loading__spinner {
  width: 2.5rem;
  height: 2.5rem;
  border: 3px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: heroSpin 0.75s linear infinite;
}

@keyframes heroSpin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-loading__spinner {
    animation: none;
    border-top-color: rgba(255, 255, 255, 0.7);
  }
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.6rem;
  border-radius: 999px;
  background: linear-gradient(90deg, #5f9414, #8fc63a);
  color: #fff;
  font-weight: 500;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: 0 8px 20px rgba(124, 181, 33, 0.35);
}
.btn-primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.6rem;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  color: #fff;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease;
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* About watermark year */
.year-watermark {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(5rem, 14vw, 9rem);
  line-height: 0.85;
  color: rgba(0, 0, 0, 0.05);
  font-weight: 700;
  letter-spacing: -0.02em;
  user-select: none;
  pointer-events: none;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-icon {
  display: inline-flex;
  color: #7cb521;
  margin-bottom: 0.4rem;
}

.stat-icon svg {
  width: 2.25rem;
  height: 2.25rem;
}

@media (min-width: 640px) {
  .stat-icon svg {
    width: 3.8rem;
    height: 3.8rem;
  }
}

.stat-value {
  color: #2c3340;
  font-weight: 800;
  font-size: 1.75rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

@media (min-width: 640px) {
  .stat-value {
    font-size: 2.15rem;
  }
}

@media (min-width: 768px) {
  .stat-value {
    font-size: 2.5rem;
  }
}

.stat-line {
  display: block;
  width: 80%;
  height: 2px;
  margin: 0.55rem 0 0.45rem;
  background: #dbdbdb;
  border-radius: 999px;
}

.stat-label {
  font-size: 0.75rem;
  color: #4b5563;
  line-height: 1.4;
}

@media (min-width: 640px) {
  .stat-label {
    font-size: 0.875rem;
  }
}

/* Product section */
.products-section {
  background: var(--sx-lime);
}

.product-card {
  display: block;
  color: inherit;
}

.product-card__inner {
  position: relative;
  overflow: hidden;
  border-radius: 1.25rem;
  background: #fff;
  box-shadow: 0 10px 28px rgba(45, 90, 26, 0.12);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover .product-card__inner {
  transform: translateY(-3px);
  box-shadow: 0 16px 36px rgba(45, 90, 26, 0.18);
}

.product-card__media {
  aspect-ratio: 16 / 11;
  overflow: hidden;
  background: #f3f4f6;
}

.product-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}

.product-card:hover .product-card__media img {
  transform: scale(1.04);
}

.product-card__name {
  margin: 0;
  padding: 0.9rem 1rem 1.05rem;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
  color: #2d5a1a;
  position: relative;
  z-index: 2;
  background: #fff;
}

.product-card__mask {
  position: absolute;
  inset: 0;
  background: rgba(124, 181, 33, 0.45);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.3s ease;
  border-radius: inherit;
}

.product-card:hover .product-card__mask {
  opacity: 1;
}

.product-card:hover .product-card__name {
  background: #7cb521;
  color: #fff;
}

/* Certs */
/* Certs carousel — 单行横向滚动 */
.cert-carousel__viewport {
  overflow: hidden;
  width: 100%;
  padding-top: 0.5rem;
}

.cert-carousel__track {
  display: flex;
  gap: 1.25rem;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.cert-card {
  text-align: center;
  flex: 0 0 calc((100% - 2.5rem) / 3);
  min-width: 0;
}

@media (max-width: 1023px) {
  .cert-card {
    flex-basis: calc((100% - 1.25rem) / 2);
  }
}

@media (max-width: 639px) {
  .cert-card {
    flex-basis: 78%;
  }
}

.cert-card__frame {
  border: 2px solid var(--sx-green);
  border-radius: 1.25rem;
  background: #fff;
  padding: 0.85rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.cert-card:hover .cert-card__frame {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.1);
}
.cert-card__frame img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: top;
  border-radius: 0.5rem;
  background: #f9fafb;
  display: block;
}
.cert-card figcaption {
  margin-top: 0.85rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #374151;
}

.cert-carousel__nav {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.cert-nav-btn {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.cert-nav-btn:hover:not(:disabled) {
  border-color: var(--sx-green);
  color: var(--sx-green);
}

.cert-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* News */
.news-card {
  display: block;
  color: inherit;
  background: #fff;
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.news-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.1);
}
.news-card__media {
  overflow: hidden;
  aspect-ratio: 16 / 10;
}
.news-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}
.news-card:hover .news-card__media img {
  transform: scale(1.04);
}
.news-card__body {
  padding: 1.15rem 1.25rem 1.35rem;
}
.news-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: #9ca3af;
  margin-bottom: 0.65rem;
}
.news-tag {
  background: #f3f4f6;
  color: #6b7280;
  padding: 0.15rem 0.5rem;
  border-radius: 0.25rem;
}
.news-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.45;
  transition: color 0.2s ease;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-card:hover h3 {
  color: var(--sx-green-deep);
}
.news-card p {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-read {
  margin-top: 1rem;
  display: inline-flex;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: var(--sx-green-deep);
}

/* Footer — 底图 + 半透明黑 + 白字 */
.site-footer {
  color: #fff;
  background: #111;
}
.footer-title {
  font-size: 0.975rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #fff;
}
.footer-link {
  color: rgba(255, 255, 255, 0.78);
  transition: color 0.2s ease;
  font-size: 0.875rem;
}
.footer-link:hover {
  color: #fff;
}
.footer-link.inline {
  display: inline;
}

.footer-contact p {
  white-space: nowrap;
}

@media (max-width: 639px) {
  .footer-contact p {
    white-space: normal;
  }
}

.footer-social__btn {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
}

.footer-social__btn:hover {
  background: #7cb521;
  color: #fff;
}

/* Mobile drawer */
.mobile-drawer {
  transform: translateX(100%);
  transition: transform 0.3s ease;
}
.mobile-drawer.is-open {
  transform: translateX(0);
}
.drawer-backdrop {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.drawer-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}
.mobile-nav-link {
  display: block;
  padding: 0.85rem 0.25rem;
  border-bottom: 1px solid #f1f1f1;
  color: #1f2937;
}
.mobile-nav-link:hover {
  color: var(--sx-green-deep);
}

/* Float / back top */
.float-cs,
.back-top {
  position: fixed;
  right: 1rem;
  z-index: 40;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.15);
}
.float-cs {
  bottom: 5.5rem;
  width: 3.5rem!important;
  height: 3.5rem!important;
  background: none!important;
  right: 0.75rem!important;
}
.back-top {
  bottom: 1.5rem;
  background: #fff;
  color: var(--sx-ink);
  border: 1px solid #e5e7eb;
}
.back-top:hover {
  color: var(--sx-green);
  border-color: var(--sx-green);
}
.back-top[hidden] {
  display: none !important;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
  color: var(--sx-green-deep);
  border-bottom: 1px solid currentColor;
  padding-bottom: 0.1rem;
  transition: opacity 0.2s ease;
}
.text-link:hover {
  opacity: 0.75;
}

/* Banner Carousel */
.sub-banner-section {
  padding: 2rem 0;
  background: #f9fafb;
}

.banner-carousel {
  position: relative;
  width: 100%;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.banner-track {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 40%; /* 保持宽高比，根据第一张图片的实际高度调整 */
  overflow: hidden;
}

.banner-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  pointer-events: none;
}

.banner-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.banner-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.banner-indicators {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.75rem;
  z-index: 10;
}

.indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.indicator:hover {
  background: rgba(255, 255, 255, 0.8);
}

.indicator.active {
  background: var(--sx-green);
  transform: scale(1.2);
}

@media (max-width: 768px) {
  .sub-banner-section {
    padding: 1rem 0;
  }
  
  .banner-carousel {
    border-radius: 0.5rem;
  }
  
  .banner-track {
    padding-bottom: 50%; /* 在小屏幕上调整宽高比 */
  }
  
  .banner-indicators {
    bottom: 1rem;
  }
  
  .indicator {
    width: 10px;
    height: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-caption,
  .product-card img,
  .news-card,
  .news-card__media img,
  .cert-card__frame,
  .mobile-drawer,
  .drawer-backdrop,
  .banner-slide {
    animation: none !important;
    transition: none !important;
  }
}
