/* ============================================================
   上海摩基数字科技有限公司 - 官方网站样式（v2 对齐原站视觉）
   配色参考原站：浅灰头 #f4f5f7 / 导航蓝 #5c8db8 / 合作入驻青 #00e6ff
   文字 #333 辅 #666 #888 #999 / 按钮深蓝 #0b5394 / 页脚 #2b2d31
   ============================================================ */

:root {
  --c-primary: #e75845;
  --c-primary-soft: #fff1f1;
  --c-primary-line: #ffa8a8;
  --c-accent: #0b5394;
  --c-accent-light: #1db9f1;
  --c-nav: #2e5f8c;
  --c-nav-hover: #24517f;
  --c-text: #333333;
  --c-text-2: #666666;
  --c-text-3: #666666;
  --c-text-4: #999999;
  --c-join: #4fd9e3;
  --c-head-bg: #f4f5f7;
  --c-footer: #2b2d31;
  --font-sans: "Noto Sans CJK SC", "Source Han Sans SC", "Source Han Sans",
               "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", Tahoma, sans-serif;
  --font-en: "Trebuchet MS", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --container: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font-family: var(--font-sans);
  color: var(--c-text);
  background: #fff;
  line-height: 1.6;
  font-size: 16px;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

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

/* ============ 顶部导航：logo 居中 + 导航条（非固定，随页滚动） ============ */
.site-header {
  position: relative;
  background: var(--c-head-bg);
  padding: 18px 20px 0;
}
.header-logo-row {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.brand img { width: 110px; height: auto; }

.main-nav ul {
  max-width: 820px;
  margin: 8px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.main-nav .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 22px;
  font-size: 17.28px;
  color: var(--c-nav);
  transition: color .25s ease;
  white-space: nowrap;
}
/* 仅当前鼠标悬停的导航项加粗变深；不再有常驻 active 高亮 */
.main-nav .nav-link:hover,
.main-nav .nav-link:focus-visible { color: var(--c-nav-hover); font-weight: 700; }
/* 邮箱图标颜色跟随导航文字（currentColor，hover 同步变深） */

/* 汉堡按钮（仅移动端可见） */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span { display: block; height: 2px; background: var(--c-text); border-radius: 2px; transition: transform .3s, opacity .3s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============ 首屏 ============ */
.hero {
  position: relative;
  width: 100%;
  aspect-ratio: 100 / 31.3;
  min-height: 280px;
  overflow: hidden;
  color: #fff;
}
.hero-bg {
  position: absolute; inset: 0;
  background-image: url("../assets/images/hero-bg.jpg");
  background-position: 50% 50%;
  background-size: cover;
  z-index: 0;
}
.hero-bg::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.18) 0%, rgba(0,0,0,0.05) 45%, rgba(0,0,0,0.22) 100%);
}
.hero-content {
  position: absolute; inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 20px;
}
.hero-title {
  font-size: 72px;
  font-weight: 700;
  letter-spacing: 15px;
  text-indent: 15px;
  line-height: 1.1;
  text-shadow: 0 2px 20px rgba(0,0,0,0.4);
}
.hero-sub {
  font-size: 24px;
  line-height: 1.75;
  margin-top: 18px;
  text-shadow: 0 1px 10px rgba(0,0,0,0.45);
}

/* ============ 通用区块 ============ */
.section { padding: 60px 0 64px; }
.section-head { text-align: center; margin-bottom: 44px; }
.section-title { font-size: 36px; font-weight: 600; color: #000; line-height: 1.4; }
.section-en {
  font-family: var(--font-en);
  font-size: 16px;
  color: #737373;
  letter-spacing: 2px;
  margin-top: 4px;
}

/* ============ 关于我们 ============ */
.about-body {
  max-width: 960px;
  margin: 0 auto;
  font-size: 18px;
  color: var(--c-text-2);
  line-height: 2;
  text-align: justify;
}

/* ============ 业务范围：图标 + 文字同行（黑色线性图标） ============ */
.business { background: #f9f9f9; }
.business-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 60px;
  row-gap: 46px;
}
.biz-card { display: flex; align-items: flex-start; }
.biz-icon {
  flex: 0 0 auto;
  width: 46px; height: 46px;
  margin-right: 18px;
}
.biz-title { font-size: 20px; font-weight: 600; color: #000; margin-bottom: 10px; }
.biz-desc { font-size: 14px; color: var(--c-text-3); line-height: 1.75; }

/* ============ 产品服务：两页 13 图 + 点击放大 ============ */
.gallery-page[hidden] { display: none; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
button.gallery-item {
  width: 100%;
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
}
.gallery-item {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 353 / 231;
  background: #eee;
  cursor: zoom-in;
}
.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.gallery-item:hover img { transform: scale(1.06); }
.gallery-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 21.6%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  color: #fff;
  font-family: Tahoma, "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 14px;
  font-weight: 400;
  text-align: center;
  background: rgba(0, 0, 0, 0.6);
}

/* 分页器 */
.gallery-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 36px;
}
.pg-arrow, .pg-num {
  width: 30px; height: 30px;
  border: 1px solid #ccc;
  background: #fff;
  color: #555;
  border-radius: 50%;
  font-size: 15px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .25s;
  font-family: inherit;
}
.pg-num.active { background: #555; color: #fff; border-color: #555; }
.pg-arrow:hover, .pg-num:hover { border-color: #888; color: #000; }

/* ============ 合作入驻：亮青背景 + 白色面板 ============ */
.join {
  background: var(--c-join);
  padding: 60px 0 70px;
}
.join .section-title { color: #000; }
.join .section-en { color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,0.12); }
.join-panel {
  max-width: 880px;
  margin: 0 auto;
  background: #fff;
  border-radius: 10px;
  padding: 40px 46px 5px;
  box-shadow: 0 10px 32px rgba(0, 120, 140, 0.18);
}
.form-row { display: grid; gap: 20px; margin-bottom: 20px; }
.form-row:first-of-type { grid-template-columns: repeat(3, 1fr); }
.form-row:nth-of-type(2) { grid-template-columns: repeat(2, 1fr); }
.form-field { display: flex; flex-direction: column; }
.form-field label { font-size: 15px; color: var(--c-text); margin-bottom: 7px; }
.req { color: var(--c-primary); font-style: normal; }

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  padding: 11px 13px;
  font-size: 15px;
  font-family: inherit;
  color: var(--c-text);
  background: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  outline: none;
  transition: border-color .25s, box-shadow .25s;
}
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  border-color: #0b5394;
  box-shadow: 0 0 0 3px rgba(11, 83, 148, 0.12);
}
.form-field textarea { resize: vertical; min-height: 108px; }
.form-field.error input,
.form-field.error textarea,
.form-field.error select { border-color: var(--c-primary-line); background: var(--c-primary-soft); }

.city-select { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.city-select select { padding: 11px 6px; }

.err-msg {
  display: none;
  margin-top: 7px;
  padding: 5px 10px 6px;
  font-size: 12px;
  color: var(--c-primary);
  border: 1px solid var(--c-primary-line);
  background: var(--c-primary-soft);
  border-radius: 7px;
}
.form-field.error .err-msg { display: block; }

.form-submit { text-align: center; margin-top: 31px; }
.btn-submit {
  width: 45%;
  max-width: 240px;
  padding: 12px 20px;
  font-size: 17px;
  color: #fff;
  background: #3a76b0;
  border: 0;
  border-radius: 100px;
  cursor: pointer;
  letter-spacing: 4px;
  transition: background .3s;
  font-family: inherit;
}
.btn-submit:hover { background: #1159a1; }
.btn-submit:disabled {
  background: #8aa2b8;
  cursor: not-allowed;
}
/* 表单占位符统一浅灰（跨浏览器一致） */
.form-field input::placeholder,
.form-field textarea::placeholder {
  color: #8c8c8c;
  opacity: 1;
}

.form-tip {
  margin-top: 16px;
  text-align: center;
  font-size: 14px;
  color: var(--c-text-3);
  min-height: 20px;
}
.form-tip.success { color: #1a9e5c; }
.form-tip.error { color: var(--c-primary); }

/* ============ 页脚 ============ */
.site-footer { background: var(--c-footer); color: #bdbdbd; }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 288px);
  justify-content: space-between;
  padding-top: 32px;
  padding-bottom: 27px;
}
.footer-grid > .footer-col { min-height: 160px; }
.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.footer-logo { display: inline-block; margin-bottom: 13px; }
.footer-logo img { width: 188px; height: auto; }
.footer-copy { font-size: 13.9px; color: #9a9a9a; }
.footer-grid > .footer-col:nth-child(2) {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.footer-title { font-size: 17.6px; font-weight: 600; color: #fff; line-height: 26.5px; margin-bottom: 10.1px; }
.footer-contact li { font-size: 17.1px; line-height: 27.1px; color: #bdbdbd; word-break: break-all; }
.footer-contact a { color: #bdbdbd; transition: color .25s; }
.footer-contact a:hover { color: #fff; }
.footer-contact .lbl { color: #9a9a9a; }

.footer-map-col {
  display: flex;
  align-items: center;
  justify-content: center;
}
.map-img-link {
  position: relative;
  display: block;
  width: 217.5px;
  max-width: 100%;
  aspect-ratio: 3 / 2;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
}
.map-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.map-img-link:hover .map-img { transform: scale(1.14); }
.map-open {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 6px 16px;
  font-size: 13px;
  color: #fff;
  background: #3a76b0;
  border-radius: 100px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.map-img-link:hover .map-open { background: #1159a1; }

.footer-bar {
  background: #fbfbfb;
  border-top: 1px solid #e6e6e6;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0;
}
.fb-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  text-align: center;
  font-size: 10.4px;
  color: #666;
  line-height: 1.72;
}
.fb-row a { color: #666; }
.fb-row a:hover { color: var(--c-accent); }
.fb-sep { color: #bbb; }
.ga-icon { display: inline-block; vertical-align: -2px; margin-right: 4px; width: 14px; height: 16px; }

/* ============ 灯箱（点击图片放大） ============ */
.lightbox { position: fixed; inset: 0; z-index: 2000; }
.lightbox[hidden] { display: none; }
.lb-mask { position: absolute; inset: 0; background: rgba(0,0,0,0.9); }
.lb-close {
  position: absolute;
  top: 16px; right: 20px;
  width: 44px; height: 44px;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
  opacity: .85;
}
.lb-close:hover { opacity: 1; }
.lb-stage {
  position: absolute;
  inset: 0 0 92px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 70px;
}
.lb-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px; height: 72px;
  background: rgba(255,255,255,0.08);
  border: 0;
  color: #fff;
  font-size: 34px;
  cursor: pointer;
  border-radius: 6px;
  z-index: 3;
}
.lb-nav:hover { background: rgba(255,255,255,0.2); }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
.lb-caption {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 0 3%;
  text-align: center;
  color: #fff;
  font-family: "Microsoft YaHei", "PingFang SC", "SimHei", sans-serif;
  background: rgba(0, 0, 0, 0.6);
  pointer-events: none;
  overflow: hidden;
}
.lb-thumbs {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  overflow-x: auto;
  background: rgba(0,0,0,0.45);
}
.lb-thumbs img {
  height: 68px;
  width: 92px;
  object-fit: cover;
  cursor: pointer;
  opacity: .55;
  border: 2px solid transparent;
  border-radius: 4px;
  flex: 0 0 auto;
  transition: opacity .2s, border-color .2s;
}
.lb-thumbs img:hover { opacity: .9; }
.lb-thumbs img.active { opacity: 1; border-color: #fff; }


/* ============ 页面加载入场动画（对齐原版动效） ============ */
@keyframes slideDownIn { from { opacity: 0; transform: translateY(-36px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUpIn   { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: translateY(0); } }
@keyframes heroZoomIn  { from { opacity: 0; transform: scale(0.35); } to { opacity: 1; transform: scale(1); } }
@keyframes heroFadeFast { from { opacity: 0; } to { opacity: 1; } }

.brand img { animation: slideDownIn 0.6s ease 0.05s both; }
.main-nav  { animation: slideUpIn 0.5s ease 0.15s both; }
.hero-sub   { animation: heroFadeFast 0.6s ease 0.3s both; }
.hero-title { animation: heroZoomIn 0.8s cubic-bezier(0.22, 0.9, 0.35, 1) 0.45s both; }

@media (prefers-reduced-motion: reduce) {
  .brand img, .main-nav, .hero-title, .hero-sub { animation: none; opacity: 1; }
}

/* ============ 滚动入场动画（JS 启用时生效；尊重减弱动效） ============ */
html.js [data-animate] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .75s ease, transform .75s ease;
}
html.js [data-animate].in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js [data-animate] { opacity: 1; transform: none; transition: none; }
}

/* ============ 可访问性增强（v2.27-acc 审查修复） ============ */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  background: #000;
  color: #fff;
  padding: 10px 18px;
  font-size: 15px;
}
.skip-link:focus { left: 0; }
main { display: block; }
.lb-thumbs img:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 1px;
  opacity: 1;
}

