/* ===== 基础与变量 ===== */
:root {
  --accent: #c8472d;          /* 工业橙红 */
  --accent-dark: #a8381f;
  --dark: #14151a;
  --ink: #2b2b2b;
  --muted: #6b6b6b;
  --line: #e6e6e6;
  --bg-soft: #f7f7f5;
  --white: #ffffff;
  --maxw: 1140px;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

h2.section-title {
  font-size: clamp(26px, 4vw, 38px);
  text-align: center;
  margin: 0 0 8px;
  font-weight: 700;
  letter-spacing: 1px;
}
h2.section-title.light { color: var(--white); }

.section-sub {
  text-align: center;
  color: var(--muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 13px;
  margin: 0 0 48px;
}

/* ===== 按钮 ===== */
.btn {
  display: inline-block;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 14px 34px;
  border-radius: 999px;
  text-decoration: none;
  transition: transform .15s ease, background .2s ease, box-shadow .2s ease;
  font-weight: 600;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 20px rgba(200, 71, 45, 0.35);
}
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-2px); }

/* ===== 顶部导航 ===== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(20, 21, 26, 0.0);
  border: none;
  border-bottom: 0;
  box-shadow: none;
  transition: background .3s ease, box-shadow .3s ease;
}
.site-header.scrolled {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.10);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
}
.brand-logo {
  height: 36px;
  width: auto;
  object-fit: contain;
  /* 导航未滚动时：深色背景 → LOGO 反转为白色 */
  filter: brightness(0) invert(1);
  transition: filter .3s ease;
}
.site-header.scrolled .brand-logo {
  /* 导航滚动后：浅色背景 → LOGO 显示原始黑色 */
  filter: none;
}

.nav-menu { display: flex; align-items: center; gap: 28px; }
.nav-menu a {
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  opacity: .9;
  text-shadow: 0 1px 6px rgba(0,0,0,.4);
  transition: color .2s ease, opacity .2s ease;
}
.nav-menu a:hover { color: var(--accent); opacity: 1; }
.nav-menu a.nav-cta {
  border: 1px solid rgba(255,255,255,.6);
  padding: 8px 18px;
  border-radius: 999px;
}
.nav-menu a.nav-cta:hover { background: var(--accent); border-color: var(--accent); }

/* 滚动后（白底）：菜单文字、CTA、汉堡按钮转为黑色 */
.site-header.scrolled .nav-menu a {
  color: #1a1a1a;
  opacity: .85;
  text-shadow: none;
}
.site-header.scrolled .nav-menu a:hover { color: var(--accent); opacity: 1; }
.site-header.scrolled .nav-menu a.nav-cta {
  border-color: rgba(0, 0, 0, .25);
}
.site-header.scrolled .nav-menu a.nav-cta:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.site-header.scrolled .nav-toggle span {
  background: #1a1a1a;
  box-shadow: none;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  width: 26px; height: 2px; background: #fff; display: block;
  box-shadow: 0 0 4px rgba(0,0,0,.4);
}

/* ===== 首屏 Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(120deg, rgba(10,10,12,.65), rgba(10,10,12,.25));
}
.hero-content {
  position: relative;
  z-index: 2;
  color: #fff;
  text-align: center;
  padding-top: 70px;
}
.hero-title {
  font-size: clamp(38px, 7vw, 72px);
  margin: 0 0 14px;
  font-weight: 800;
  letter-spacing: 2px;
  text-shadow: 0 4px 24px rgba(0,0,0,.5);
}
.hero-sub {
  font-size: clamp(16px, 2.5vw, 22px);
  margin: 0 0 34px;
  opacity: .95;
  text-shadow: 0 2px 12px rgba(0,0,0,.5);
}

/* ===== 标题区 ===== */
.statement {
  position: relative;
  background-size: cover;
  background-position: center;
  padding: 130px 0;
  text-align: center;
  color: #fff;
}
.statement-overlay {
  position: absolute; inset: 0;
  background: rgba(20, 21, 26, 0.62);
}
.statement-content { position: relative; z-index: 2; }
.statement h2 {
  font-size: clamp(24px, 4vw, 40px);
  margin: 0 0 10px;
  font-weight: 700;
  letter-spacing: 1px;
}
.statement .en {
  color: rgba(255,255,255,.8);
  letter-spacing: 2px;
  font-size: 14px;
  margin: 0;
}

/* ===== 关于小匠人 ===== */
.about {
  background-size: cover;
  background-position: center;
  padding: 90px 0;
}
.media-rows { display: flex; flex-direction: column; gap: 36px; }
.media-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  align-items: center;
  background: rgba(255,255,255,.92);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.media-img img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: 8px;
}
.media-text h3 { font-size: 22px; margin: 0 0 12px; color: var(--dark); }
.media-text p { margin: 0; color: var(--ink); }
.media-text .en { color: var(--muted); font-size: 13px; letter-spacing: 1px; margin-bottom: 10px; }

/* ===== 我们的业务 ===== */
.business { padding: 90px 0; background: var(--bg-soft); }
.business .media-row { background: #fff; }

/* ===== 客户 logo 墙 ===== */
.customers { padding: 90px 0; background: var(--bg-soft); }
.logo-wall {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
.logo-cell {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  transition: box-shadow .2s ease;
}
.logo-cell:hover { box-shadow: var(--shadow); }
.logo-cell img { max-height: 100%; width: auto; object-fit: contain; }

/* ===== 联系我们（含联系方式 + 表单 + 地图）===== */
.contact {
  position: relative;
  background-size: cover;
  background-position: center;
  padding: 100px 0;
}
.contact-overlay {
  position: absolute; inset: 0;
  background: rgba(20, 21, 26, 0.72);
}
.contact-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
}
.contact-lead {
  color: rgba(255,255,255,.9);
  text-align: center;
  margin: 0 0 36px;
}

/* 联系方式卡片 */
.contact-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 32px;
}
.contact-info-item {
  background: rgba(255,255,255,.95);
  border-radius: var(--radius);
  padding: 22px 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: var(--shadow);
  transition: transform .2s ease;
}
.contact-info-item:hover { transform: translateY(-3px); }
.ci-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}
.ci-body { display: flex; flex-direction: column; gap: 4px; }
.ci-body strong {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.ci-body a,
.ci-body span {
  font-size: 15px;
  color: var(--ink);
  text-decoration: none;
  word-break: break-all;
}
.ci-body a:hover { color: var(--accent); }

/* 留言表单 */
.contact-form {
  background: #fff;
  padding: 34px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--ink);
  font-weight: 600;
}
.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color .2s ease, box-shadow .2s ease;
  resize: vertical;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(200, 71, 45, 0.15);
}
.contact-form .btn { width: 100%; margin-top: 6px; }
.form-status {
  margin: 14px 0 0;
  text-align: center;
  font-size: 14px;
  min-height: 20px;
}
.form-status.ok { color: #1f8a4c; }
.form-status.err { color: #c0392b; }

/* 表单字段级校验 */
.req { color: #c0392b; margin-left: 2px; }
.field-error {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: #c0392b;
  min-height: 0;
}
.field input.invalid,
.field textarea.invalid {
  border-color: #c0392b;
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.12);
}
.field input.shake,
.field textarea.shake { animation: field-shake .4s; }
@keyframes field-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}
/* 蜜罐字段：对正常用户不可见 */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  border: 0;
  padding: 0;
}

/* 地图 */
.map-wrapper {
  margin-top: 28px;
  margin-bottom: 28px;
}
.map-canvas {
  display: block;
  width: 100%;
  height: 360px;
  border: none;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #e8e8e8;
}
#mapFallback { height: 360px; }
.map-actions {
  position: relative;
  padding: 12px 14px;
  text-align: center;
  background: #f6f6f6;
  border-top: 1px solid #ececec;
  border-radius: 0 0 12px 12px;
  display: flex;
  justify-content: center;
}
.map-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s ease, transform .1s ease;
}
.map-nav-btn:hover { background: #d6442f; }
.map-nav-btn:active { transform: scale(.97); }

/* ===== 页脚 ===== */
.site-footer {
  background: var(--dark);
  color: rgba(255,255,255,.75);
  text-align: center;
  padding: 40px 0;
}
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.footer-brand { color: #fff; font-weight: 700; font-size: 18px; margin: 0; letter-spacing: 1px; }
.footer-copy { margin: 0; font-size: 13px; color: rgba(255,255,255,.55); }
.footer-beian { margin: 0; font-size: 13px; }
.footer-beian a {
  color: rgba(255,255,255,.55);
  text-decoration: none;
  transition: color .2s ease;
}
.footer-beian a:hover { color: #fff; }

/* ===== 响应式 ===== */
@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    display: none;
    position: absolute;
    top: 70px; left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(20, 21, 26, 0.97);
    padding: 10px 0;
  }
  .nav-menu.open { display: flex; }
  /* 滚动后白底下拉菜单：面板转白、文字转黑 */
  .site-header.scrolled .nav-menu {
    background: #fff;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.10);
  }
  .site-header.scrolled .nav-menu a { color: #1a1a1a; }
  .nav-menu a { padding: 14px 24px; width: 100%; }
  .nav-menu a.nav-cta { border: none; border-radius: 0; }

  .media-row { grid-template-columns: 1fr; gap: 18px; }
  .media-img img { height: 240px; }
  .logo-wall { grid-template-columns: repeat(3, 1fr); }
  .statement { padding: 90px 0; }

  .contact-info-grid { grid-template-columns: 1fr; }
  .contact-content { max-width: 560px; }
}

@media (max-width: 480px) {
  .logo-wall { grid-template-columns: repeat(2, 1fr); }
  .contact-form { padding: 24px 18px; }
  #mapFallback { height: 240px; }
  .map-canvas { height: 240px; }
  .brand-logo { height: 34px; }
}
