/* ============================================================================
   霓时 NexFoto 官网 —— 样式表
   源自 OpenDesign 导出稿，已剔除 61 条无对应 DOM 的死规则（1217 行 → 约 800 行）。
   改动原则：视觉与交互与设计稿一比一，仅做结构拆分、死代码清理与必要修正。
   注意：本文件位于 css/ 目录，url() 中的资源路径相对本文件解析（../assets/）。
   ============================================================================ */

/* ====================================================================
   设计令牌：颜色、字体、间距、圆角、阴影、字号梯度
   ==================================================================== */
:root {
  --bg: #f7f8f4;
  --surface: #ffffff;
  --surface-soft: #fbfcf8;
  --fg: #232323;
  --muted: #686c67;
  --border: #e1e4dc;
  --accent-blue: #6b90f7;
  --accent-coral: #f3847a;
  --accent-gold: #f5c84b;
  --accent-line: #b8c4ee;
  --shadow: 0 28px 80px rgba(42, 45, 39, .12);
  --focus: #4d66d8;
  --font-display: "Iowan Old Style", "Songti SC", "Noto Serif SC", Georgia, "Times New Roman", serif;
  --font-body: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs-h1: clamp(46px, 8vw, 104px);
  --fs-h2: clamp(32px, 4.8vw, 60px);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;
  --radius: 28px;
  --container: 1120px;
  color-scheme: light;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  scroll-behavior: smooth;
}

/* ====================================================================
   基础重置与全局排版
   ==================================================================== */
* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: clamp(84px, 10vw, 132px);
  scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar { display: none; }

body {
  margin: 0;
  min-width: 320px;
  overflow-x: clip;
  -ms-overflow-style: none;
  background:
        radial-gradient(circle at 12% 8%, color-mix(in oklch, var(--accent-blue) 10%, transparent), transparent 26%),
        radial-gradient(circle at 88% 4%, color-mix(in oklch, var(--accent-gold) 12%, transparent), transparent 22%),
        var(--bg);
  color: var(--fg);
  font-size: 16px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

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

button { font: inherit; }

p,
h1,
h2,
h3 { margin-top: 0; }

p { text-wrap: pretty; }

h1,
h2,
h3 { text-wrap: balance; }

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

/* ====================================================================
   无障碍：跳过导航链接 + 键盘焦点环
   ==================================================================== */
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: var(--space-3);
  z-index: 100;
  transform: translateY(-140%);
  background: var(--fg);
  color: var(--surface);
  padding: var(--space-2) var(--space-4);
  border-radius: 999px;
}

.skip-link:focus { transform: translateY(0); }

/* ====================================================================
   布局容器与锚点滚动偏移
   ==================================================================== */
.wrap {
  width: min(100% - 32px, var(--container));
  margin-inline: auto;
}

#home,
#about,
#contact { scroll-margin-top: clamp(84px, 10vw, 132px); }

/* ====================================================================
   顶部导航（sticky）
   ==================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in oklch, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid color-mix(in oklch, var(--border) 82%, transparent);
}

.nav {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: clamp(16px, 3vw, 40px);
  box-sizing: border-box;
}

.nav.wrap {
  width: 100%;
  max-width: none;
  padding-inline: clamp(20px, 4vw, 64px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  font-weight: 750;
  flex: 0 1 auto;
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 42px;
  flex: none;
  object-fit: contain;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  min-width: 0;
  white-space: nowrap;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  justify-content: flex-end;
  flex: 1 1 auto;
  min-width: 0;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}

.nav-links a,
/* ====================================================================
   中英语言切换按钮
   ==================================================================== */
.lang-switch button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 var(--space-3);
  border-radius: 999px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in oklch, var(--surface) 74%, transparent);
}

.lang-switch button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 14px;
  line-height: 1;
  letter-spacing: .02em;
}

.lang-switch button.active {
  color: var(--fg);
  background: var(--surface);
  box-shadow: 0 4px 16px rgba(42, 45, 39, .08);
}

@media (hover: hover) {
  .site-footer a:hover {
    color: var(--fg);
    text-decoration-color: currentColor;
  }

  .nav-links a:hover,
  .lang-switch button:hover {
    color: var(--fg);
    background: color-mix(in oklch, var(--fg) 5%, transparent);
  }
}

/* ====================================================================
   内容区块与标题层级
   ==================================================================== */
.section { padding-block: clamp(64px, 9vw, var(--space-9)); }

.section + .section { border-top: 1px solid var(--border); }

#about { padding-top: clamp(28px, 4vw, 48px); }

.hero {
  min-height: auto;
  display: grid;
  align-items: center;
  padding-block: 0 var(--space-4);
}

.hero.wrap {
  width: 100%;
  max-width: none;
  margin-inline: 0;
}

h1 {
  margin-bottom: var(--space-4);
  font-family: var(--font-display);
  font-size: var(--fs-h1);
  line-height: .96;
  letter-spacing: 0;
  font-weight: 700;
}

h2 {
  margin-bottom: var(--space-4);
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  line-height: 1.08;
  letter-spacing: 0;
  font-weight: 700;
}

h3 {
  font-size: 22px;
  line-height: 1.35;
  margin-bottom: var(--space-2);
}

.lead {
  max-width: 62ch;
  margin-bottom: var(--space-6);
  color: var(--muted);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.68;
}

/* ====================================================================
   首屏图片轮播（纯 CSS 动画，20s 一轮，4 张各停 5s）
   ==================================================================== */
.top-gallery {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.top-gallery::before,
.top-gallery::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: min(14vw, 120px);
  pointer-events: none;
}

.top-gallery::before {
  left: 0;
  background: linear-gradient(90deg, var(--bg), transparent);
}

.top-gallery::after {
  right: 0;
  background: linear-gradient(270deg, var(--bg), transparent);
}

.top-gallery-head {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-4);
}

.top-gallery-head strong {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 52px);
  line-height: 1;
  font-weight: 700;
}

.top-gallery-head span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.top-gallery-window {
  position: relative;
  z-index: 1;
  overflow: hidden;
  margin-inline: 0;
  padding-block: 0;
  width: 100%;
  aspect-ratio: 8 / 3;
  height: auto;
  max-height: 720px;
  border-radius: 0;
}

.top-gallery-track {
  display: flex;
  height: 100%;
  width: 400%;
  margin-inline: 0;
  overflow: hidden;
  border-radius: inherit;
  background: transparent;
  animation: topGallerySlide 20s ease-in-out infinite;
}

.top-gallery-card {
  flex: 0 0 25%;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background-image:
        linear-gradient(180deg, rgba(34, 35, 31, .02), rgba(34, 35, 31, .24)),
        var(--gallery-image);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: var(--gallery-position, center);
  box-shadow: none;
}

.top-gallery-card:nth-child(1) {
  --gallery-image: url("../assets/B1.jpg");
  --gallery-position: center;
}

.top-gallery-card:nth-child(2) {
  --gallery-image: url("../assets/B2.jpg");
  --gallery-position: center;
}

.top-gallery-card:nth-child(3) {
  --gallery-image: url("../assets/B3.jpg");
  --gallery-position: center;
}

.top-gallery-card:nth-child(4) {
  --gallery-image: url("../assets/B4.jpg");
  --gallery-position: center;
}

.top-gallery-dots {
  position: absolute;
  left: 50%;
  bottom: clamp(18px, 3vw, 32px);
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 10px;
  min-height: 18px;
}

.top-gallery-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .62);
  animation: topGalleryDot 20s ease-in-out infinite;
}

.top-gallery-dot:nth-child(1) { animation-delay: 0s; }

.top-gallery-dot:nth-child(2) { animation-delay: 5s; }

.top-gallery-dot:nth-child(3) { animation-delay: 10s; }

.top-gallery-dot:nth-child(4) { animation-delay: 15s; }

@keyframes topGallerySlide {
      0%, 21% { transform: translateX(0); }
      25%, 46% { transform: translateX(-25%); }
      50%, 71% { transform: translateX(-50%); }
      75%, 96% { transform: translateX(-75%); }
      100% { transform: translateX(0); }
    }

@keyframes topGalleryDot {
      0%, 21% {
        width: 22px;
        background: var(--surface);
      }

      25%, 96% {
        width: 9px;
        background: rgba(255, 255, 255, .62);
      }

      100% {
        width: 22px;
        background: var(--surface);
      }
    }

/* ====================================================================
   关于我们
   ==================================================================== */
.about-copy {
  max-width: 760px;
  font-size: 18px;
}

.about-copy p { color: var(--muted); }

.intro-visual-card {
  overflow: visible;
  padding: 0;
  display: grid;
  gap: var(--space-5);
  width: min(100%, 520px);
  justify-self: end;
  transform: none;
  color: var(--fg);
}

.intro-visual-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: calc(var(--radius) - 14px);
  /* 原稿此处写的是 --surface-muted，但该变量从未定义过（:root 里只有 --surface 和
     --surface-soft），属导出稿笔误。当前 .intro-visual-card 内没有 <img>，本规则不生效，
     先修正变量名，以免日后在「关于我们」右栏放图时背景色静默失效。 */
  background: var(--surface-soft);
}

.intro-text-copy {
  display: grid;
  gap: var(--space-6);
  text-align: center;
  line-height: 1.72;
  color: var(--fg);
}

.intro-text-copy p {
  margin: 0;
  color: var(--fg);
}

.intro-text-group {
  display: grid;
  gap: var(--space-2);
}

.intro-text-group h3 {
  margin: 0;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 500;
  letter-spacing: .08em;
}

.intro-text-group p { color: var(--muted); }

/* ====================================================================
   联系我们：邮箱与企业微信二维码
   ==================================================================== */
.info-list {
  display: grid;
  gap: var(--space-3);
  margin: 0;
}

.info-list div {
  display: grid;
  grid-template-columns: minmax(88px, .3fr) minmax(0, 1fr);
  gap: var(--space-3);
  align-items: start;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.info-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.info-list dt {
  color: var(--fg);
  font-weight: 400;
}

.info-list dd {
  margin: 0;
  min-width: 0;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, .52fr) minmax(0, .48fr);
  gap: var(--space-8);
  align-items: start;
}

.contact-grid > * { min-width: 0; }

.contact-card {
  display: grid;
  gap: var(--space-4);
  padding: 0;
  width: 100%;
  justify-self: stretch;
  transform: none;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.qr-contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-4);
  align-items: center;
  width: 100%;
  min-width: 0;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.qr-contact > * { min-width: 0; }

.qr-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.qr-label {
  color: var(--fg);
  font-weight: 400;
}

.qr-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  max-width: 42ch;
  overflow-wrap: anywhere;
}

.qr-image {
  display: block;
  width: clamp(88px, 12vw, 132px);
  max-width: 100%;
  height: auto;
  aspect-ratio: 137 / 140;
  justify-self: end;
}

/* ====================================================================
   页脚：版权与工信部备案号
   ==================================================================== */
.site-footer a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in oklch, var(--muted) 38%, transparent);
  transition: color .2s ease, text-decoration-color .2s ease;
}

.site-footer {
  padding: var(--space-6) 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 14px;
}

.footer-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  text-align: center;
}

.footer-inner > span {
  display: inline-flex;
  justify-content: center;
  text-align: center;
}

/* ====================================================================
   双语显隐：body.lang-en 一个 class 切换全站语言
   ==================================================================== */
[data-lang-content="en"] { display: none; }

body.lang-en [data-lang-content="zh"] { display: none; }

body.lang-en [data-lang-content="en"] { display: revert; }

body.lang-en span[data-lang-content="en"],
body.lang-en strong[data-lang-content="en"] {
  display: inline;
}

/* ====================================================================
   响应式断点
   ==================================================================== */
@media (max-width: 900px) {
  .nav {
    min-height: auto;
    padding-block: var(--space-3);
    align-items: flex-start;
  }

  .nav-actions {
    flex: 1 1 280px;
    justify-content: flex-start;
  }

  .hero {
    min-height: auto;
    padding-block: 0 var(--space-4);
  }

  .top-gallery-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .contact-grid { grid-template-columns: 1fr; }

  .contact-grid { gap: var(--space-6); }

  .intro-visual-card,
  .contact-card {
    width: 100%;
    justify-self: stretch;
  }
}

@media (min-width: 561px) and (max-width: 900px) {
  .qr-contact {
    grid-template-columns: 1fr;
    justify-items: start;
    text-align: left;
  }

  .qr-image {
    justify-self: start;
    width: 124px;
  }
}

@media (max-width: 768px) {
  .qr-contact {
    grid-template-columns: 1fr;
    justify-items: start;
    text-align: left;
    gap: var(--space-3);
  }

  .qr-image {
    justify-self: start;
    width: clamp(104px, 26vw, 132px);
  }
}

@media (max-width: 560px) {
  .wrap { width: min(100% - 28px, var(--container)); }

  .nav.wrap {
    width: 100%;
    padding-inline: 14px;
  }

  .brand-name { font-size: 20px; }

  .brand { gap: 8px; }

  .brand-mark {
    width: 34px;
    height: 38px;
  }

  .nav-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
  }

  .nav-links a {
    min-height: 38px;
    padding-inline: 10px;
    font-size: 15px;
  }

  .intro-visual-card {
    padding: var(--space-5);
    border-radius: 28px;
  }

  .section { padding-block: clamp(40px, 10vw, 64px); }

  #about { padding-top: 24px; }

  .top-gallery-window {
    margin-inline: 0;
    aspect-ratio: 8 / 3;
    height: auto;
    border-radius: 0;
  }

  .info-list div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .qr-contact {
    grid-template-columns: 1fr;
    justify-items: start;
    text-align: left;
  }

  .qr-image {
    width: min(124px, 42vw);
    justify-self: start;
  }
}

/* ====================================================================
   用户偏好减弱动效时关闭轮播动画
   ==================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  .top-gallery-track,
  .top-gallery-dot { animation: none; }

  .top-gallery-track { transform: translateX(0); }

  .top-gallery-dot:first-child {
    width: 22px;
    background: var(--surface);
  }
}
