/* 官网多页公用：设计变量、基础排版、按钮、顶栏导航、页脚、滚动显隐、全站回到顶部样式。各页面请先引入本文件再引入页面级 CSS；回到顶部需配合 body 末尾的 #siteBackToTop 与 common/js/back-to-top.js。 */
:root {
  --primary: #1677ff;
  --secondary: #ff7d00;
  --bg: #ffffff;
  --light: #fafafa;
  --text: #333333;
  --text-muted: #666666;
  --dark: #222222;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 24px;
  --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 10px 20px rgba(0, 0, 0, 0.14);
  --container: min(1200px, calc(100% - 48px));
  --container-xl: min(1400px, calc(100% - 48px));
  --container-xxl: min(1600px, calc(100% - 48px));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* 避免首屏图片/字体加载后滚动锚定把视口「微调」下移（刷新时像滚过一点） */
  overflow-anchor: none;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: var(--container);
  margin: 0 auto;
}

.container-xl {
  width: var(--container-xl);
  margin: 0 auto;
}

.container-xxl {
  width: var(--container-xxl);
  margin: 0 auto;
}

.section {
  padding: 72px 0;
}

.section-gray {
  background: var(--light);
}

.section-title {
  margin: 0;
  font-size: 32px;
  font-weight: 600;
  text-align: center;
  line-height: 1.4;
}

.section-subtitle {
  margin: 13px auto 0;
  max-width: 760px;
  font-size: 15px;
  color: var(--text-muted);
  text-align: center;
}

.gradient-bar {
  width: 140px;
  height: 4px;
  background: linear-gradient(to right, #007bff, #ff7b00);
  border-radius: 4px;
  margin: 12px auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: var(--radius-lg);
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn:hover {
  transform: scale(1.05);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-secondary {
  background: var(--secondary);
  color: #fff;
}

.btn-white {
  background: #fff;
  color: var(--primary);
}

.btn .osm-icon-jinru {
  font-size: 14px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(8px);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.site-header.scrolled {
  background: #fff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06);
}

.nav {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
}

.nav-container .btn {
  margin-left: auto;
}

.consult-entry {
  position: relative;
  margin-left: auto;
}

.consult-popup {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  width: 170px;
  padding: 8px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
  border: 1px solid rgba(0, 0, 0, 0.06);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 40;
}

.consult-popup.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.consult-qr-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.consult-qr-tip {
  margin: 2px 0 0;
  text-align: center;
  font-size: 14px;
  color: #8d8d8d;
  line-height: 1.4;
}

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo-image {
  display: block;
  height: 50px;
  width: auto;
  max-width: min(200px, 42vw);
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 16px;
}

.nav-links a {
  position: relative;
  color: var(--text);
  transition: color 0.2s ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 100%;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}

.nav-links a:hover {
  color: var(--primary);
}

.nav-links a:hover::after {
  transform: scaleX(1);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: none;
  background: #fff;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.menu-toggle span {
  position: relative;
  width: 18px;
  height: 2px;
  background: #444;
  display: block;
}

.menu-toggle span::before,
.menu-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: #444;
}

.menu-toggle span::before {
  top: -6px;
}

.menu-toggle span::after {
  top: 6px;
}

/* ---- 页脚与版权 ---- */
footer {
  color: #fff;
  background: #1d2430;
}

.footer-main {
  padding: 54px 0 46px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 140px 140px minmax(360px, 560px) 140px;
  gap: 24px;
  align-items: start;
  justify-content: center;
}

.footer-qr-block {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 12px;
}

.footer-qr-image {
  width: 102px;
  height: 102px;
  object-fit: cover;
  border: 4px solid rgba(255, 255, 255, 0.08);
  background: #fff;
}

.footer-qr-label {
  font-size: 18px;
  line-height: 1.35;
  font-weight: 600;
}

.footer-contact {
  text-align: left;
  color: #fff;
  line-height: 1.75;
  font-size: 16px;
}

.footer-contact strong {
  display: inline-block;
  margin-bottom: 10px;
  font-size: 42px;
  line-height: 1.2;
}

.footer-contact p {
  margin: 0;
}

.copyright {
  background: #0f151d;
  padding: 18px 0 20px;
  font-size: 13px;
  color: #fff;
  text-align: center;
  line-height: 1.5;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.show {
  opacity: 1;
  transform: translateY(0);
}

.section-title-with-lines {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.section-title-with-lines::before,
.section-title-with-lines::after {
  content: "";
  height: 1px;
  flex: 1;
}

.section-title-with-lines::before {
  background: linear-gradient(to left, rgba(148, 163, 184, 0.55), rgba(148, 163, 184, 0));
}

.section-title-with-lines::after {
  background: linear-gradient(to right, rgba(148, 163, 184, 0.55), rgba(148, 163, 184, 0));
}

@media (max-width: 1199px) {
  .footer-contact {
    max-width: 460px;
    font-size: 15px;
  }

  .footer-contact strong {
    font-size: 34px;
  }
}

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
    justify-items: center;
  }

  .footer-contact {
    text-align: center;
  }
}

@media (max-width: 1055px) {
  .menu-toggle {
    display: inline-flex;
  }

  .nav {
    height: 64px;
  }

  .logo-image {
    height: 40px;
    max-width: min(180px, 48vw);
  }

  .nav-container {
    position: static;
  }

  .nav-links {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    width: auto;
    max-height: none;
    overflow: visible;
    background: #f7f8fa;
    border-top: 1px solid #e7eaf0;
    border-bottom: 1px solid #e7eaf0;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px 16px 14px;
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s ease;
    z-index: 35;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav-links a {
    padding: 11px 4px;
  }

  .nav-links a::after {
    display: none;
  }

  .nav-links .consult-entry {
    margin: 12px 0 0;
    width: 100%;
  }

  .nav-links .consult-entry .btn-secondary {
    width: 100%;
    margin-left: 0;
    justify-content: center;
  }

  .nav-links .consult-popup {
    top: auto;
    bottom: calc(100% + 8px);
    left: 50%;
    width: min(210px, calc(100vw - 60px));
    transform: translateX(-50%) translateY(6px);
  }

  .nav-links .consult-popup.show {
    transform: translateX(-50%) translateY(0);
  }
}

@media (max-width: 767px) {
  :root {
    --container: calc(100% - 32px);
  }

  .section {
    padding: 52px 0;
  }

  .section-title {
    font-size: 24px;
  }

  .footer-main {
    padding: 40px 0 34px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 26px;
    justify-items: center;
  }

  .footer-contact {
    text-align: center;
    font-size: 14px;
  }

  .footer-contact strong {
    font-size: 24px;
  }

  .footer-qr-label {
    font-size: 15px;
  }

  .copyright {
    font-size: 12px;
  }
}

/* 全站回到顶部（小米风）：与 #siteBackToTop、common/js/back-to-top.js 配合使用 */
.site-back-to-top {
  position: fixed;
  z-index: 90;
  right: max(16px, env(safe-area-inset-right, 0px) + 12px);
  bottom: max(32px, env(safe-area-inset-bottom, 0px) + 24px);
  width: 48px;
  min-height: 64px;
  padding: 10px 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: none;
  border-radius: 10px;
  background: rgba(189, 189, 189, 0.92);
  color: #ffffff;
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease,
    transform 0.25s ease,
    background 0.2s ease;
}

.site-back-to-top:hover,
.site-back-to-top:focus-visible {
  background: rgba(158, 158, 158, 0.96);
  outline: none;
}

.site-back-to-top:focus-visible {
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--primary);
}

.site-back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.site-back-to-top__icon svg {
  display: block;
}

.site-back-to-top__label {
  line-height: 1;
}
