/* ============================================
   公共样式 - 帝国CMS模板
   所有页面共用的基础样式、导航、页脚、按钮、表单等
   ============================================ */

/* --- CSS 变量 --- */
:root {
  --ink: #252526;
  --muted: rgba(37, 37, 38, .68);
  --brand: #921241;
  --brand-dark: #252526;
  --brand-soft: rgba(146, 18, 65, .1);
  --line: rgba(37, 37, 38, .16);
  --glass: rgba(255, 255, 255, .72);
  --max: 1180px;
  --shadow: 0 24px 80px rgba(31, 55, 91, .14);
}

/* --- 基础重置 --- */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background: #f7f9fc;
  letter-spacing: 0;
}

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

button,
input,
textarea {
  font: inherit;
}

/* --- 导航栏 --- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(248, 251, 255, .78);
  border-bottom: 1px solid rgba(255, 255, 255, .72);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
}

.nav-inner {
  width: min(var(--max), calc(100% - 40px));
  height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  height: 38px;
  flex: 0 0 auto;
}

.brand img {
  width: 182px;
  height: auto;
  display: block;
}

/* 移动端菜单按钮 */
.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(146, 18, 65, .22);
  border-radius: 14px;
  background: rgba(255, 255, 255, .66);
  box-shadow: 0 10px 28px rgba(31, 55, 91, .08);
  color: var(--ink);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.menu-toggle svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

/* 导航链接 */
.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  color: #1b2940;
  font-size: 14px;
  font-weight: 500;
}

.nav-links a {
  opacity: .76;
  transition: opacity .2s ease, color .2s ease;
}

.nav-links a:hover,
.nav-links .active {
  opacity: 1;
  color: var(--brand);
}

/* 下拉菜单项 */
.nav-item {
  position: relative;
  height: 64px;
  display: inline-flex;
  align-items: center;
}

.nav-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  opacity: .76;
  transition: opacity .2s ease, color .2s ease;
}

.nav-trigger::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: .55;
}

.nav-item:hover .nav-trigger,
.nav-item:focus-within .nav-trigger {
  opacity: 1;
  color: var(--brand);
}

/* 下拉面板 */
.dropdown {
  position: absolute;
  top: 58px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 520px;
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, .78);
  border-radius: 24px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 26px 70px rgba(31, 55, 91, .16);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}

.nav-item:hover .dropdown,
.nav-item:focus-within .dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.dropdown-group {
  padding: 12px;
  border-radius: 18px;
  background: rgba(246, 249, 253, .62);
  border: 1px solid rgba(37, 37, 38, .1);
}

.dropdown-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #101b31;
  font-size: 14px;
  font-weight: 800;
  opacity: 1 !important;
}

.dropdown-title span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.dropdown-link {
  display: block;
  padding: 8px 10px;
  border-radius: 12px;
  color: #304057;
  font-size: 13px;
  line-height: 1.35;
  opacity: .82 !important;
}

.dropdown-link:hover,
.dropdown-title:hover {
  background: rgba(146, 18, 65, .08);
  color: var(--brand);
  opacity: 1 !important;
}

.dropdown.solutions-menu {
  min-width: 360px;
  grid-template-columns: 1fr;
}

/* CTA 按钮 */
.nav-cta {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid rgba(146, 18, 65, .22);
  background: rgba(255, 255, 255, .62);
  box-shadow: 0 10px 28px rgba(31, 55, 91, .08);
  font-weight: 700;
  opacity: 1 !important;
}

/* --- 通用按钮 --- */
.btn,
.ghost-btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 24px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  transition: transform .2s ease, box-shadow .2s ease;
}

.btn {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .35);
  background: linear-gradient(135deg, var(--brand-dark), var(--brand) 64%, #b71c52);
  box-shadow: 0 18px 36px rgba(146, 18, 65, .28);
}

.ghost-btn {
  color: #172033;
  border: 1px solid rgba(146, 18, 65, .18);
  background: rgba(255, 255, 255, .62);
  box-shadow: 0 14px 38px rgba(31, 55, 91, .08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.btn:hover,
.ghost-btn:hover {
  transform: translateY(-2px);
}

.arrow {
  width: 18px;
  height: 18px;
}

/* --- 通用区块 --- */
.section {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: 86px 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 32px;
  margin-bottom: 44px;
}

.section-head h2 {
  margin: 0;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.12;
  font-weight: 800;
}

.section-head p {
  max-width: 450px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

/* --- 图标容器 --- */
.icon {
  width: 48px;
  height: 48px;
  margin: 0 0 18px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: var(--brand);
  border: 1px solid rgba(255, 255, 255, .78);
  background: linear-gradient(145deg, rgba(255, 255, 255, .86), rgba(146, 18, 65, .08));
  box-shadow: inset 0 0 0 1px rgba(146, 18, 65, .08), 0 18px 38px rgba(37, 37, 38, .1);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --- 通用卡片 --- */
.card,
.faq {
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, .74);
  background: rgba(255, 255, 255, .56);
  box-shadow: 0 18px 46px rgba(31, 55, 91, .08);
  backdrop-filter: blur(20px) saturate(145%);
  -webkit-backdrop-filter: blur(20px) saturate(145%);
  transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease;
  padding: 28px;
}

.card:hover,
.faq:hover {
  transform: translateY(-7px);
  border-color: rgba(146, 18, 65, .22);
  box-shadow: 0 26px 64px rgba(146, 18, 65, .12);
}

.card h3,
.faq h3 {
  margin: 0;
  font-size: 19px;
  line-height: 1.38;
}

.card p,
.faq p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

/* --- 联系区块 --- */
.contact {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto 44px;
  padding: 68px;
  display: grid;
  grid-template-columns: .82fr 1fr;
  gap: 58px;
  align-items: center;
  border-radius: 34px;
  border: 1px solid rgba(255, 255, 255, .76);
  background: linear-gradient(130deg, rgba(255, 255, 255, .68), rgba(226, 238, 252, .48));
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px) saturate(145%);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
}

.contact h2 {
  margin: 0;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.12;
}

.contact p {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.85;
}

/* --- 表单 --- */
.form {
  display: grid;
  gap: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field {
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  border: 1px solid rgba(37, 37, 38, .16);
  border-radius: 16px;
  outline: 0;
  background: rgba(255, 255, 255, .64);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.field:focus {
  border-color: rgba(146, 18, 65, .48);
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 0 0 4px rgba(146, 18, 65, .08);
}

textarea.field {
  min-height: 120px;
  padding-top: 16px;
  resize: vertical;
}

/* --- 页脚 --- */
.footer {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
  padding: 26px 0 42px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
  font-size: 14px;
}

/* --- 全站公共底部 --- */
.site-footer {
  margin-top: 44px;
  padding: 64px 0 34px;
  color: rgba(255, 255, 255, .78);
  background:
    linear-gradient(135deg, rgba(37, 37, 38, .98), rgba(52, 35, 44, .98) 52%, rgba(146, 18, 65, .94)),
    radial-gradient(circle at 82% 12%, rgba(255, 255, 255, .14), transparent 34%);
}

.site-footer__inner {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.25fr) repeat(3, minmax(0, 1fr));
  gap: 34px;
  align-items: start;
}

.site-footer__logo {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .9);
}

.site-footer__logo img {
  width: 168px;
  height: auto;
  display: block;
}

.site-footer__brand p {
  max-width: 360px;
  margin: 18px 0 0;
  font-size: 14px;
  line-height: 1.8;
}

.site-footer h5 {
  margin: 0 0 16px;
  color: #fff;
  font-size: 16px;
  line-height: 1.35;
}

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.site-footer a {
  color: inherit;
  transition: color .2s ease, opacity .2s ease;
}

.site-footer a:hover {
  color: #fff;
}

.site-footer__contact {
  display: grid;
  gap: 10px;
  font-size: 14px;
  line-height: 1.7;
}

.site-footer__contact p {
  margin: 0;
}

.site-footer__contact span {
  display: inline-block;
  min-width: 42px;
  margin-right: 8px;
  color: rgba(255, 255, 255, .52);
}

.site-footer__bottom {
  margin-top: 42px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, .16);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  font-size: 13px;
}

.site-footer__bottom p {
  margin: 0;
}

.site-footer__bottom nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

/* --- 响应式：导航折叠 --- */
@media (max-width: 1100px) {
  .nav .nav-links {
    position: absolute;
    left: 14px;
    right: 14px;
    top: 72px;
    z-index: 60;
    display: none;
    max-height: calc(100vh - 88px);
    max-height: calc(100dvh - 88px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
    border: 1px solid rgba(255, 255, 255, .78);
    border-radius: 22px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 26px 70px rgba(31, 55, 91, .16);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
  }

  .nav .nav-links.open {
    display: flex;
  }

  html.nav-menu-open,
  body.nav-menu-open {
    overflow: hidden;
    overscroll-behavior: none;
  }

  .nav .menu-toggle {
    display: inline-flex;
  }

  .nav .nav-item {
    height: auto;
    display: block;
  }

  .nav .nav-links a,
  .nav .nav-trigger {
    min-height: 42px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    border-radius: 12px;
  }

  .nav .dropdown,
  .nav .dropdown.solutions-menu,
  .nav .dropdown.blog-menu {
    position: static;
    min-width: 0;
    transform: none;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 4px 0 8px;
    padding: 8px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    box-shadow: none;
    background: rgba(246, 249, 253, .74);
  }

  .nav .nav-item:hover .dropdown,
  .nav .nav-item:focus-within .dropdown {
    transform: none;
  }
}

/* --- 响应式：平板 --- */
@media (max-width: 980px) {
  .contact {
    grid-template-columns: 1fr;
  }

  .site-footer__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-footer__brand {
    grid-column: 1 / -1;
  }
}

/* --- 响应式：手机 --- */
@media (max-width: 640px) {
  .nav-inner,
  .section,
  .contact,
  .footer {
    width: min(100% - 28px, var(--max));
  }

  .nav .nav-links {
    left: 10px;
    right: 10px;
  }

  .brand img {
    width: 152px;
  }

  .section {
    padding: 64px 0;
  }

  .section-head {
    display: block;
  }

  .section-head p {
    margin-top: 16px;
  }

  .contact {
    padding: 40px 24px;
  }

  .form-row,
  .footer {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .site-footer {
    padding: 50px 0 28px;
  }

  .site-footer__inner {
    width: min(100% - 28px, var(--max));
  }

  .site-footer__grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .site-footer__bottom {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-actions {
    align-items: stretch;
  }

  .btn,
  .ghost-btn {
    width: 100%;
  }
}

/* --- 无障碍：减少动画 --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
