/* =========================================================
   公共样式：全站头部 / 底部 / 基础排版 / 按钮
   所有页面通过 public/base.html 引入
   ========================================================= */

:root {
  --navy: #014DB2;
  --navy-dark: #013F92;
  --navy-deep: #001645;
  --ink: #0A1628;
  --muted: #6B7280;
  --line: #EAEAEA;
  --bg: #F9F9F9;
  --card: #FFFFFF;
  --blue-soft: #EAF1FB;
  --on-dark: #C7D5EE;
  --on-dark-dim: #9FB4D8;
  --amber: #F59E0B;
  --gutter: clamp(20px, 8.3vw, 120px);
  --radius-card: 24px;
  --radius-pill: 50px;
  --shadow-card: 0 12px 32px -8px rgba(1, 77, 178, .06);
  --shadow-raised: 0 20px 48px -12px rgba(1, 77, 178, .35);
  --font-sans: "Inter", "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }

p { margin: 0; }

ul { margin: 0; padding: 0; list-style: none; }

.wrap {
  width: 100%;
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 50px);
}

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 30px;
  border-radius: var(--radius-pill);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease, color .18s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-dark); box-shadow: 0 10px 24px -8px rgba(1, 77, 178, .55); }

.btn-sm { padding: 11px 24px; font-size: 15px; }

.btn-white { background: #fff; color: var(--navy); }
.btn-white:hover { box-shadow: 0 12px 28px -10px rgba(0, 22, 69, .6); }

.btn-ghost {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .4);
  color: #fff;
}
.btn-ghost:hover { background: rgba(255, 255, 255, .14); }

.btn-soft { background: rgba(1, 77, 178, .08); color: var(--navy); }
.btn-soft:hover { background: rgba(1, 77, 178, .14); }

.btn.block { width: 100%; }

/* ---------------- 顶部导航 ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 80px;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .2s ease;
}
.site-header.scrolled { box-shadow: 0 6px 20px -12px rgba(10, 22, 40, .28); }

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand-mark { width: 36px; height: 36px; flex: none; }
.brand-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .01em;
  white-space: nowrap;
}

.nav { display: flex; align-items: center; gap: 40px; }
.nav a {
  position: relative;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  padding: 6px 0;
  transition: color .18s ease;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .22s ease;
}
.nav a:hover { color: var(--navy); }
.nav a:hover::after,
.nav a.active::after { transform: scaleX(1); }
.nav a.active { color: var(--navy); font-weight: 600; }

.header-actions { display: flex; align-items: center; gap: 20px; flex: none; }

.hotline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex: none;
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  transition: color .18s ease;
}
.hotline:hover { color: var(--navy); }
.hotline .ico { width: 20px; height: 20px; flex: none; }

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  padding: 9px 8px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transform-origin: center;
  transition: transform .22s ease, opacity .18s ease;
}
body.nav-open .nav-toggle { background: var(--blue-soft); border-color: transparent; }
body.nav-open .nav-toggle span { background: var(--navy); }
body.nav-open .nav-toggle span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
body.nav-open .nav-toggle span:nth-child(2) { opacity: 0; transform: scaleX(.2); }
body.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* ---------------- 页脚 ---------------- */
.site-footer {
  background: var(--ink);
  color: #fff;
  padding: 80px 0 36px;
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, .6fr));
  gap: 48px 64px;
}

.brand-invert .brand-name { color: #fff; }

.tagline {
  margin-top: 20px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--on-dark-dim);
}

.contact-list { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.contact-list li { font-size: 14px; color: var(--on-dark); }
.contact-list strong { font-weight: 500; color: var(--on-dark-dim); }
.contact-list a { transition: color .18s ease; }
.contact-list a:hover { color: #fff; }

.footer-col { display: flex; flex-direction: column; gap: 16px; }
.footer-col h4 { font-size: 15px; font-weight: 600; }
.footer-col a { font-size: 14px; color: var(--on-dark-dim); transition: color .18s ease, transform .18s ease; }
.footer-col a:hover { color: #fff; }

.watermark {
  margin: 56px 0 0;
  font-size: clamp(52px, 8vw, 96px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  text-align: right;
  background: linear-gradient(90deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .012));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  user-select: none;
  white-space: nowrap;
}

.footer-rule { height: 1px; background: rgba(255, 255, 255, .1); margin: 32px 0 24px; }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--on-dark-dim);
}
.icp { color: #64748B; }

/* ===== 防止旧站 app.css 的 a:link 颜色覆盖公共头尾 ===== */
.site-header .brand,
.site-header .brand-name { color: var(--ink); }
.site-header .nav a { color: var(--ink); }
.site-header .nav a:hover,
.site-header .nav a.active { color: var(--navy); }
.site-header .hotline { color: var(--ink); }
.site-header .hotline:hover { color: var(--navy); }
.site-header .header-actions .btn-primary,
.site-header .header-actions .btn-primary:hover { color: #fff; }
.site-header .subnav a { color: var(--ink); }
.site-header .subnav a:hover { color: var(--navy); }

.site-footer .brand-name { color: #fff; }
.site-footer .contact-list li { color: var(--on-dark); }
.site-footer .contact-list a,
.site-footer .footer-col a { color: var(--on-dark-dim); }
.site-footer .contact-list a:hover,
.site-footer .footer-col a:hover { color: #fff; }
.site-footer .footer-bottom { color: var(--on-dark-dim); }

/* ---------------- 头部 / 底部响应式 ---------------- */
@media (max-width: 1180px) {
  .nav { gap: 26px; }
  .hotline span { display: none; }
  .footer-top { grid-template-columns: minmax(0, 1fr) repeat(3, minmax(0, .55fr)); gap: 40px; }
}

@media (max-width: 960px) {
  .footer-top { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; }
  .footer-brand { grid-column: 1 / -1; }
  .watermark { text-align: left; }
}

@media (max-width: 860px) {
  .nav {
    position: fixed;
    top: 80px; left: 0; right: 0;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px var(--gutter) 20px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 30px -22px rgba(10, 22, 40, .45);
  }
  body.nav-open .nav { display: flex; }
  .nav a { width: 100%; padding: 14px 0; font-size: 16px; border-bottom: 1px solid #F4F5F7; }
  .nav a::after { display: none; }
  .nav-toggle { display: flex; }
  .header-actions { gap: 12px; }
}

@media (max-width: 680px) {
  .site-header { height: 68px; }
  .nav { top: 68px; }
  .brand-name { font-size: 17px; }
  .brand-mark { width: 32px; height: 32px; }
  .header-actions .btn-primary { display: none; }

  .watermark { font-size: 46px; margin-top: 40px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ===== 后端 logo / 长公司名适配 ===== */
img.brand-mark { object-fit: contain; }
.brand-name { max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 680px) {
  .brand-name { max-width: 170px; }
}

/* ===== 后端动态菜单 / 下拉 ===== */
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
}
.nav-item > a { white-space: nowrap; }

.subnav {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  z-index: 60;
  min-width: 168px;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(6px);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
/* 桌面端悬停下拉（窄屏为点击展开，避免触摸设备的粘滞 hover 干扰） */
@media (min-width: 1281px) {
  .nav-item:hover .subnav {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
  }
}
.subnav a {
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}
.subnav a::after { display: none; }
.subnav a:hover { background: var(--blue-soft); color: var(--navy); }

/* PC 端菜单项间距加大 */
@media (min-width: 1281px) {
  .site-header .nav { gap: 40px; }
}
@media (min-width: 1181px) and (max-width: 1500px) {
  .hotline span { display: none; }
}

/* 窄屏切换为折叠菜单 */
@media (max-width: 1280px) {
  .nav {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px var(--gutter) 20px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 30px -22px rgba(10, 22, 40, .45);
    max-height: calc(100vh - 80px);
    overflow-y: auto;
  }
  body.nav-open .nav { display: flex; }
  .nav-item {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
  }
  .nav-item > a {
    display: block;
    width: 100%;
    padding: 14px 0;
    font-size: 16px;
    border-bottom: 1px solid #F4F5F7;
  }
  .nav-item > a::after { display: none; }
  /* 展开的一级项与当前栏目保持同一高亮样式 */
  .nav-item.open > a { color: var(--navy); font-weight: 600; }
  /* 展开其他栏目时，当前栏目暂时恢复普通样式，保持只有一项高亮 */
  .nav.has-open .nav-item.current:not(.open) > a { color: var(--ink); font-weight: 500; }
  .nav-item.has-sub > a::before { transition: transform .2s ease; }
  .subnav {
    position: static;
    display: none;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    margin: 4px 0 12px;
    padding: 4px 0 4px 14px;
    border: 0;
    border-left: 2px solid var(--blue-soft);
    border-radius: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }
  .nav-item.open > .subnav { display: flex; }
  .subnav a {
    padding: 10px 14px;
    font-size: 15px;
    font-weight: 500;
    color: var(--muted);
    border-bottom: 0;
    border-radius: 10px;
  }
  .subnav a:hover,
  .subnav a.active { color: var(--navy); background: var(--blue-soft); }
  .subnav a.active { font-weight: 600; }
  .nav-toggle { display: flex; }
  .header-actions { gap: 12px; }
}
@media (max-width: 680px) {
  .nav { top: 68px; max-height: calc(100vh - 68px); }
}

/* 有子菜单的项：下拉箭头 + 悬停过渡区 */
.nav-item.has-sub > a::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  opacity: .45;
}
.nav-item.has-sub::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 16px;
}
@media (max-width: 1280px) {
  .nav-item.has-sub > a { position: relative; padding-right: 26px; }
  .nav-item.has-sub > a::before {
    position: absolute;
    right: 8px;
    top: 50%;
    margin: 0;
    transform: translateY(-50%) rotate(45deg);
  }
  .nav-item.open > a::before { transform: translateY(-50%) rotate(-135deg); }
  .nav-item.has-sub::after { display: none; }
}

/* ---------------- 留言弹窗 ---------------- */
.lead-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lead-modal.is-open { display: flex; }
.lead-modal__mask {
  position: absolute;
  inset: 0;
  background: rgba(10, 22, 40, .58);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.lead-modal__dialog {
  position: relative;
  width: min(480px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 36px 36px 30px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 32px 80px -24px rgba(0, 20, 60, .5);
  animation: leadIn .22s ease;
}
@keyframes leadIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes leadUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: none; }
}
.lead-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--muted);
  background: #F3F5F9;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease;
}
.lead-modal__close:hover { color: var(--navy); background: var(--blue-soft); }
.lead-modal__close svg { width: 18px; height: 18px; }
.lead-modal__title { padding-right: 40px; font-size: 24px; font-weight: 700; color: var(--ink); }
.lead-modal__desc { margin-top: 8px; font-size: 14px; color: var(--muted); }
.lead-form { margin-top: 24px; }
.lead-field { display: block; margin-bottom: 16px; }
.lead-field__label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 600; color: var(--ink); }
.lead-field__label em { font-style: normal; color: #E5484D; }
.lead-field input,
.lead-field textarea {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: #FAFBFC;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.lead-field input { height: 48px; }
.lead-field textarea { min-height: 96px; line-height: 1.6; resize: vertical; }
.lead-field input:focus,
.lead-field textarea:focus {
  background: #fff;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(1, 77, 178, .12);
}
.lead-field input::placeholder,
.lead-field textarea::placeholder { color: #A0AAB8; }
.lead-field input.is-error,
.lead-field textarea.is-error { background: #FFF7F7; border-color: #E5484D; }
.lead-form__error { min-height: 20px; margin: -4px 0 8px; font-size: 13px; color: #E5484D; }
.lead-form__submit { width: 100%; height: 50px; font-size: 16px; }
.lead-form__tip { margin-top: 12px; font-size: 12px; line-height: 1.6; color: #9AA4B2; text-align: center; }
.lead-success { padding: 18px 0 6px; text-align: center; }
.lead-success__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  color: var(--navy);
  background: var(--blue-soft);
  border-radius: 50%;
}
.lead-success__icon svg { width: 32px; height: 32px; }
.lead-success h4 { margin-top: 16px; font-size: 20px; color: var(--ink); }
.lead-success p { margin-top: 8px; font-size: 14px; color: var(--muted); }
.lead-success .btn { min-width: 140px; margin-top: 24px; }
body.lead-open { overflow: hidden; }

@media (max-width: 680px) {
  .lead-modal { align-items: flex-end; padding: 0; }
  .lead-modal__dialog {
    width: 100%;
    max-height: calc(100vh - 32px);
    padding: 28px 22px calc(24px + env(safe-area-inset-bottom));
    border-radius: 20px 20px 0 0;
    animation: leadUp .24s ease;
  }
  .lead-modal__title { font-size: 21px; }
}
