/* 成都明日东华官网 - 公共定制样式 */

/* 基础重置 */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: #1e293b;
  overflow-x: hidden;
}

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* 通用容器最大宽度 */
.container-x {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}
@media (min-width: 768px) {
  .container-x {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* 文字渐变 */
.text-gradient-primary {
  background: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.text-gradient-geo {
  background: linear-gradient(135deg, #9333ea 0%, #f97316 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* 渐变背景 */
.bg-gradient-primary {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #06b6d4 100%);
}
.bg-gradient-geo {
  background: linear-gradient(135deg, #7e22ce 0%, #9333ea 50%, #c084fc 100%);
}
.bg-gradient-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 45%, #1e40af 100%);
}

/* 卡片悬浮效果 */
.card-hover {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
}
.card-hover:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px -12px rgba(30, 58, 138, 0.25);
}

/* 图标容器 */
.icon-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.875rem;
}

/* Banner 轮播 */
.banner-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}
.banner-slide.active {
  opacity: 1;
}
/* 轮播圆点：视觉小点 + 44px 触摸命中区（WCAG 2.5.5） */
.banner-dot {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.banner-dot::before {
  content: "";
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.45);
  transition: background 0.2s ease, transform 0.2s ease;
}
.banner-dot:hover::before {
  background: rgba(255, 255, 255, 0.75);
}
.banner-dot-active::before,
.banner-dot[aria-selected="true"]::before {
  background: #ffffff;
  transform: scale(1.15);
}
.banner-dot:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
  border-radius: 9999px;
}
/* 暂停/播放按钮 */
.banner-pause {
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.banner-pause:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}
.banner-pause:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}
.banner-pause.is-paused {
  background: rgba(255, 255, 255, 0.9);
  color: #1e3a8a;
}

/* 导航栏滚动后样式 */
.nav-scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.08);
}

/* 悬浮侧边栏（核心转化入口） */
.float-sidebar {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
/* “联系我们”按钮+面板容器：面板相对该容器定位，避免与“售前咨询”按钮一起居中错位 */
.float-sidebar-contact {
  position: relative;
  display: flex;
  flex-direction: column;
}
.float-sidebar-panel {
  position: absolute;
  top: 50%;
  right: calc(100% + 0.5rem);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.float-sidebar-contact:hover .float-sidebar-panel,
.float-sidebar-contact.open .float-sidebar-panel,
.float-sidebar-contact:focus-within .float-sidebar-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) translateX(0);
}

/* 移动端汉堡菜单（grid-template-rows 动画，避免 max-height 触发布局重排 + 自动适应内容高度无裁切） */
.mobile-menu {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s ease;
}
.mobile-menu > * {
  overflow: hidden;
  min-height: 0;
}
.mobile-menu.open {
  grid-template-rows: 1fr;
}

/* 滚动渐入动画（no-js 时强制可见，避免 JS 失败导致内容藏匿） */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
/* 无 JS 兜底：核心内容直接可见，不依赖 main.js 的 IntersectionObserver */
.no-js .reveal {
  opacity: 1 !important;
  transform: none !important;
}

/* 几何装饰背景 */
.grid-pattern {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* 章节标题装饰线 */
.section-line {
  width: 64px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, #2563eb, #06b6d4);
}
.section-line-geo {
  background: linear-gradient(90deg, #9333ea, #c084fc);
}

/* H5 端隐藏 hover 效果，优化触摸 */
@media (hover: none) {
  .card-hover:hover {
    transform: none;
    box-shadow: 0 10px 30px -12px rgba(30, 58, 138, 0.2);
  }
}

/* 防止图片溢出 */
img {
  max-width: 100%;
  height: auto;
}

/* ============ Logo 滚动切换（深色/浅色背景） ============ */
.nav-logo-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 2.25rem;
}
@media (min-width: 768px) {
  .nav-logo-link { height: 2.5rem; }
}
.nav-logo {
  height: 100%;
  width: auto;
  display: block;
}
.nav-logo-dark {
  position: absolute;
  inset: 0;
  height: 100%;
  width: auto;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.nav-logo-light {
  transition: opacity 0.35s ease;
}
/* 滚动后：白色 logo 淡出，主题色 logo 淡入 */
#siteNav.nav-scrolled .nav-logo-light { opacity: 0; }
#siteNav.nav-scrolled .nav-logo-dark { opacity: 1; }

/* Footer logo（深色背景用白色） */
.footer-logo {
  height: 2rem;
  width: auto;
}
@media (min-width: 768px) {
  .footer-logo { height: 2.25rem; }
}

/* ============ Impeccable 样式精修 ============ */

/* 文字抗锯齿，更细腻的渲染 */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* 锚点滚动偏移，固定导航不遮挡目标 */
section[id], div[id], [id] {
  scroll-margin-top: 6rem;
}

/* 键盘焦点可见性 */
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
  border-radius: 6px;
}

/* 卡片更精致的分层阴影 */
.card-hover {
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.05);
}
.card-hover:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px -16px rgba(30, 58, 138, 0.22), 0 8px 16px -8px rgba(30, 58, 138, 0.10);
}

/* 按钮按压反馈 */
.btn-press {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease, background-color 0.3s ease;
}
.btn-press:hover { transform: translateY(-2px); }
.btn-press:active { transform: translateY(0) scale(0.97); }

/* 导航栏滚动后更柔和的分层阴影 */
.nav-scrolled {
  box-shadow: 0 4px 24px -12px rgba(15, 23, 42, 0.12), 0 1px 0 rgba(15, 23, 42, 0.06);
}

/* 表格圆角修复（配合 border-collapse） */
table { border-collapse: separate; border-spacing: 0; }

/* 选中文本配色 */
::selection {
  background: rgba(37, 99, 235, 0.16);
  color: #1e3a8a;
}

/* 图片懒加载淡入 */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.6s ease;
}
img[loading="lazy"].loaded {
  opacity: 1;
}

/* 尊重减弱动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ============ 深空科技主题（theme-space 作用域） ============ */
.theme-space {
  background: #050b18;
}
/* 深空下滚动后的导航：暗色玻璃 */
.theme-space .nav-scrolled {
  background: rgba(5, 11, 24, 0.82);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06), 0 12px 40px -16px rgba(0, 0, 0, 0.7);
}
/* 深空 hero：更深的星域渐变 */
.theme-space .bg-gradient-hero {
  background: linear-gradient(135deg, #020617 0%, #0a1122 45%, #172554 100%);
}
/* GEO 极光渐变：靛 → 紫 → 青 */
.theme-space .bg-gradient-geo {
  background: linear-gradient(135deg, #1e1b4b 0%, #6d28d9 55%, #0e7490 100%);
}
/* CTA 横幅/步骤序号：深空蓝青渐变 */
.theme-space .bg-gradient-primary {
  background: linear-gradient(135deg, #172554 0%, #1d4ed8 55%, #0e7490 100%);
}
/* 玻璃拟态卡片基底 */
.glass-card {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
/* 深空下卡片悬浮：蓝青辉光 */
.theme-space .card-hover:hover {
  box-shadow: 0 24px 48px -16px rgba(37, 99, 235, 0.35), 0 0 24px -6px rgba(34, 211, 238, 0.18);
}
.theme-space ::selection {
  background: rgba(34, 211, 238, 0.25);
  color: #f0f9ff;
}
.theme-space ::-webkit-scrollbar-track { background: #0a1122; }
.theme-space ::-webkit-scrollbar-thumb { background: #1e293b; }
.theme-space ::-webkit-scrollbar-thumb:hover { background: #334155; }
.theme-space a:focus-visible,
.theme-space button:focus-visible,
.theme-space summary:focus-visible {
  outline-color: #22d3ee;
}
