/*
 * HZC Lighting — 优化版主样式
 * 性能策略：
 *  1. 首屏关键样式内联于 <head>（见 index.html），本文件为异步加载的其余样式
 *  2. 只使用 CSS 自定义属性，避免重复颜色计算
 *  3. 不使用 CSS 滤镜/阴影叠加过多层，控制合成层数量
 *  4. 动画仅使用 transform / opacity，避免触发 layout/paint
 *  5. 尊重 prefers-reduced-motion
 */

:root {
  --hzc-brand: #0b5c4a;
  --hzc-brand-dark: #073f33;
  --hzc-accent: #d4a017;
  --hzc-ink: #16211e;
  --hzc-body: #4a5a56;
  --hzc-line: #e2e8e6;
  --hzc-bg: #ffffff;
  --hzc-bg-soft: #f6f9f8;
  --hzc-radius: 10px;
  --hzc-maxw: 1180px;
  --hzc-shadow: 0 1px 3px rgba(11, 92, 74, 0.08), 0 8px 24px rgba(11, 92, 74, 0.06);
  --hzc-transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, "PingFang SC",
    "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--hzc-body);
  background: var(--hzc-bg);
  /* 避免移动端 100vh 造成的地址栏抖动问题 */
  min-height: 100dvh;
}

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

/* 焦点样式必须保留 —— 无障碍要求 */
:focus-visible {
  outline: 3px solid var(--hzc-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--hzc-brand);
  color: #fff;
  padding: 10px 18px;
  z-index: 100;
}
.skip-link:focus {
  left: 8px;
  top: 8px;
}

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--hzc-maxw);
  margin-inline: auto;
  padding-inline: 20px;
}

.section {
  padding-block: 72px;
}
.section--soft {
  background: var(--hzc-bg-soft);
}

/* ---------- 语言切换器 ---------- */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--hzc-line);
  border-radius: 999px;
  background: #fff;
  flex-shrink: 0;
}
.lang-switch a {
  display: inline-block;
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--hzc-body);
  text-decoration: none;
  line-height: 1.4;
  white-space: nowrap;
  transition: background var(--hzc-transition), color var(--hzc-transition);
}
.lang-switch a:hover {
  color: var(--hzc-brand);
}
.lang-switch a.is-active {
  background: var(--hzc-brand);
  color: #fff;
}

/* ---------- 中文排版适配 ---------- */
/* 中文正文行高比英文需要更宽松，字间距略紧 */
html[lang="zh-CN"] body {
  line-height: 1.8;
  letter-spacing: 0.01em;
  /* 中文字体栈：优先系统自带，避免加载 Web Font（中文 Web Font 动辄 MB 级） */
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB",
    "Source Han Sans SC", "Noto Sans CJK SC", "Helvetica Neue", Arial, sans-serif;
}
html[lang="zh-CN"] h1,
html[lang="zh-CN"] h2,
html[lang="zh-CN"] h3 {
  letter-spacing: 0;
  line-height: 1.4;
}
html[lang="zh-CN"] .lede {
  line-height: 1.85;
}
/* 中文正文两端对齐更整齐，但需配合 text-align: justify 的边界处理 */
html[lang="zh-CN"] .card__body p,
html[lang="zh-CN"] .features li {
  text-align: justify;
  text-justify: inter-ideograph;
}
/* 中文表格表头不换行 */
html[lang="zh-CN"] th {
  white-space: nowrap;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hzc-line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 19px;
  color: var(--hzc-ink);
  text-decoration: none;
  letter-spacing: 0.2px;
}
.brand__mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--hzc-brand), var(--hzc-accent));
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

.nav {
  display: flex;
  align-items: center;
  gap: 26px;
}
.nav a {
  color: var(--hzc-body);
  text-decoration: none;
  font-size: 15px;
  transition: color var(--hzc-transition);
}
.nav a:hover {
  color: var(--hzc-brand);
}

/* 移动端导航：默认隐藏，由 JS 切换 .is-open */
.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--hzc-line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  padding: 0;
  place-items: center;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  background: var(--hzc-ink);
  transition: transform var(--hzc-transition), opacity var(--hzc-transition);
}
.nav-toggle span {
  position: relative;
}
.nav-toggle span::before {
  position: absolute;
  top: -6px;
}
.nav-toggle span::after {
  position: absolute;
  top: 6px;
}

@media (max-width: 860px) {
  .nav-toggle {
    display: grid;
  }
  .nav {
    position: absolute;
    inset: 68px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid var(--hzc-line);
    padding: 8px 20px 16px;
    /* 隐藏用 visibility + opacity，避免 display:none 造成重排 */
    visibility: hidden;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity var(--hzc-transition), transform var(--hzc-transition),
      visibility var(--hzc-transition);
  }
  .nav.is-open {
    visibility: visible;
    opacity: 1;
    transform: none;
  }
  .nav a {
    padding: 12px 0;
    border-bottom: 1px solid var(--hzc-line);
  }
  .section {
    padding-block: 52px;
  }
}

/* ---------- Hero ---------- */
.hero {
  padding-block: 84px;
  background:
    radial-gradient(1100px 460px at 82% -12%, rgba(212, 160, 23, 0.14), transparent 62%),
    linear-gradient(180deg, var(--hzc-bg-soft), #fff);
}
.hero__inner {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 52px;
  align-items: center;
}
.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--hzc-brand);
  background: rgba(11, 92, 74, 0.09);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}
h1 {
  font-size: clamp(30px, 4.6vw, 47px);
  line-height: 1.18;
  color: var(--hzc-ink);
  margin: 0 0 18px;
  letter-spacing: -0.4px;
}
.lede {
  font-size: 17px;
  max-width: 56ch;
  margin: 0 0 28px;
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 26px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--hzc-radius);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: transform var(--hzc-transition), background var(--hzc-transition),
    box-shadow var(--hzc-transition);
  border: 1px solid transparent;
}
.btn--primary {
  background: var(--hzc-brand);
  color: #fff;
  box-shadow: 0 6px 18px rgba(11, 92, 74, 0.22);
}
.btn--primary:hover {
  background: var(--hzc-brand-dark);
  transform: translateY(-2px);
}
.btn--ghost {
  background: #fff;
  color: var(--hzc-brand);
  border-color: var(--hzc-line);
}
.btn--ghost:hover {
  border-color: var(--hzc-brand);
  transform: translateY(-2px);
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 34px;
  padding-top: 22px;
  border-top: 1px solid var(--hzc-line);
}
.stat b {
  display: block;
  font-size: 25px;
  color: var(--hzc-brand);
  line-height: 1.2;
}
.stat span {
  font-size: 13px;
}

/* 首屏图：显式宽高比，避免 CLS */
.hero__media img {
  width: 100%;
  aspect-ratio: 1536 / 1024;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: var(--hzc-shadow);
}

/* ---------- Section head ---------- */
.section-head {
  max-width: 62ch;
  margin-bottom: 40px;
}
.section-head h2 {
  font-size: clamp(24px, 3.1vw, 33px);
  color: var(--hzc-ink);
  margin: 0 0 12px;
  line-height: 1.25;
}
.section-head p {
  margin: 0;
}

/* ---------- Cards ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
  gap: 24px;
}
.card {
  background: #fff;
  border: 1px solid var(--hzc-line);
  border-radius: 14px;
  overflow: hidden;
  transition: transform var(--hzc-transition), box-shadow var(--hzc-transition);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--hzc-shadow);
}
.card__media {
  aspect-ratio: 4 / 3;
  background: var(--hzc-bg-soft);
  overflow: hidden;
}
.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 420ms cubic-bezier(0.4, 0, 0.2, 1);
}
.card:hover .card__media img {
  transform: scale(1.04);
}
.card__body {
  padding: 20px 22px 24px;
}
.card__body h3 {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--hzc-ink);
}
.card__body p {
  margin: 0 0 14px;
  font-size: 14.5px;
}
.tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--hzc-brand);
  background: rgba(11, 92, 74, 0.08);
  padding: 3px 10px;
  border-radius: 999px;
}

/* ---------- Feature list ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px 36px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.features li {
  padding-left: 30px;
  position: relative;
  font-size: 15px;
}
.features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: var(--hzc-accent);
  opacity: 0.85;
}
.features strong {
  color: var(--hzc-ink);
  display: block;
  margin-bottom: 2px;
}

/* ---------- Table ---------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--hzc-line);
  border-radius: 12px;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
  font-size: 14.5px;
}
th,
td {
  text-align: left;
  padding: 14px 18px;
  border-bottom: 1px solid var(--hzc-line);
}
th {
  background: var(--hzc-bg-soft);
  color: var(--hzc-ink);
  font-weight: 700;
  white-space: nowrap;
}
tbody tr:last-child td {
  border-bottom: 0;
}

/* ---------- CTA ---------- */
.cta {
  background: linear-gradient(135deg, var(--hzc-brand-dark), var(--hzc-brand));
  color: #fff;
  border-radius: 18px;
  padding: 48px 44px;
}
.cta h2 {
  color: #fff;
  margin: 0 0 10px;
  font-size: clamp(22px, 2.8vw, 30px);
}
.cta p {
  color: rgba(255, 255, 255, 0.88);
  margin: 0 0 24px;
  max-width: 58ch;
}

/* ---------- Footer ---------- */
.site-footer {
  background: #0d1a17;
  color: rgba(255, 255, 255, 0.7);
  padding-block: 44px 30px;
  font-size: 14px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}
.site-footer h4 {
  color: #fff;
  margin: 0 0 12px;
  font-size: 15px;
}
.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.site-footer li {
  margin-bottom: 7px;
}
.site-footer a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
}
.site-footer a:hover {
  color: var(--hzc-accent);
}
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  font-size: 13px;
}

/* ---------- 滚动进场动画（仅 transform/opacity，不触发 layout） ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 520ms ease, transform 520ms ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}
