/**
 * 与 preview.html 顶栏（含 .header / .nav / .btn / 移动端菜单）一致，供抽离导航复用
 */
:root {
  --primary: #0ea5e9;
  --primary-dark: #0284c7;
  --secondary: #6366f1;
  --accent: #f97316;
  --neon-cyan: #00f5ff;
  --dark-bg: #0a0e1a;
  --dark-card: #111827;
  --dark-border: #1e293b;
  --dark-surface: #0f172a;
  --font-heading: 'Exo', 'Noto Sans SC', sans-serif;
  --font-body: 'Noto Sans SC', sans-serif;
}

body.with-preview-site-nav {
  color: #F8FAFC;
}

body.with-preview-site-nav .header .header-content .header-actions,
body.with-preview-site-nav .header .header-content .mobile-toggle {
  flex-shrink: 0;
}

.zh-site-nav-root .header,
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 14, 26, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(14, 165, 233, 0.1);
}
.header-line {
  height: 2px;
  background: linear-gradient(to right, transparent, var(--primary), transparent);
  opacity: 0.6;
}
.header-content {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 10px;
  min-width: 0;
  container-type: inline-size;
  container-name: header-bar;
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: white;
}
.logo-icon {
  width: 140px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.nav {
  display: none;
}
.nav.open {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 64px;
  left: 0;
  right: 0;
  padding: 12px;
  background: rgba(17, 24, 39, 0.98);
  border-bottom: 1px solid var(--dark-border);
  gap: 8px;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
@media (max-width: 1135px) {
  .nav.open {
    max-height: none;
    overflow: visible;
  }
}
@media (min-width: 1136px) {
  .nav {
    display: flex;
    gap: 4px;
  }
}
.nav-item {
  position: relative;
  padding: 8px 16px;
  color: #cbd5e1;
  text-decoration: none;
  font-size: 14px;
  border-radius: 8px;
  transition: all 0.2s;
  cursor: pointer;
}
.nav-item:hover {
  color: white;
  background: rgba(255, 255, 255, 0.05);
}
.nav-item.active {
  color: var(--neon-cyan);
  background: rgba(14, 165, 233, 0.1);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.header-actions .lang-toggle {
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.1;
  border-radius: 6px;
}
.header-actions .lang-toggle:hover {
  transform: translateY(-1px);
}
.header-phone {
  font-size: 13px;
  color: #cbd5e1;
  white-space: nowrap;
}
.header-phone span {
  color: var(--neon-cyan);
  font-weight: 600;
}
/* 仅横排顶栏、无汉堡时收电话；≤1295 与汉堡同现时由 ciip-agent-dropdown.css 强制展示 */
@media (min-width: 1296px) and (max-width: 1364px) {
  .header-phone {
    display: none;
  }
}
@media (max-width: 1135px) {
  .header-content {
    padding: 0 0.75rem;
    gap: 6px;
    min-width: 0;
  }
  .header-actions {
    gap: 6px;
    flex-shrink: 0;
  }
  .header-actions .btn:not(.btn-primary) {
    padding: 6px 12px;
    font-size: 12px;
  }
  .logo {
    min-width: 0;
  }
  .logo-icon {
    width: 140px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}
.btn {
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  text-decoration: none;
  border: none;
}
.btn-outline {
  color: #cbd5e1;
  border: 1px solid var(--dark-border);
}
.btn-outline:hover {
  border-color: rgba(14, 165, 233, 0.5);
  color: white;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--dark-bg);
}
.btn-primary:hover {
  box-shadow: 0 0 25px rgba(14, 165, 233, 0.25);
  transform: translateY(-1px);
}
.mobile-toggle {
  display: none;
  padding: 8px;
  color: #cbd5e1;
  cursor: pointer;
  flex-shrink: 0;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
}
@media (max-width: 1295px) {
  .header .header-content .mobile-toggle {
    display: inline-flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    color: #fff !important;
  }
  .header .header-content .mobile-toggle > span {
    display: block !important;
    width: 22px !important;
    height: 3px !important;
    background: #fff !important;
    border-radius: 2px;
    position: relative;
  }
  .header .header-content .mobile-toggle > span::before,
  .header .header-content .mobile-toggle > span::after {
    content: '';
    display: block;
    width: 22px;
    height: 3px;
    background: #fff;
    border-radius: 2px;
    position: absolute;
    left: 0;
  }
  .header .header-content .mobile-toggle > span::before {
    top: -8px;
  }
  .header .header-content .mobile-toggle > span::after {
    top: 8px;
  }
}
@media (min-width: 1296px) {
  .header .header-content .mobile-toggle {
    display: none !important;
  }
}

/* 顶栏内容区宽度不足时：收起中间主导航、显示汉堡，并与电话并排展示（与 min-width:1136 横排规则叠加） */
@supports (container-type: inline-size) {
  @container header-bar (max-width: 1295px) {
    .header .header-content #mainNav.nav:not(.open),
    .header .header-content nav#mainNav:not(.open) {
      display: none !important;
    }
    .header .header-content .mobile-toggle {
      display: inline-flex !important;
    }
    .header .header-content .header-phone {
      display: inline-flex !important;
      align-items: center;
      flex-shrink: 0;
    }
  }
}

/* 使用 preview 顶栏时，轮播详情 hero 与 64px 顶栏对齐 */
.with-preview-site-nav .header {
  height: auto !important;
  min-height: 64px;
}

.with-preview-site-nav .sub-hero-carousel {
  margin-top: 64px;
  height: calc(100vh - 64px);
  min-height: 520px;
}

.with-preview-site-nav .sub-hero-slide .slide-ov {
  pointer-events: none;
}

.with-preview-site-nav .hero .hero-bg,
.with-preview-site-nav .hero .hero-particles {
  pointer-events: none;
}

.with-preview-site-nav .hero-breadcrumb,
.with-preview-site-nav .hero-breadcrumb a {
  pointer-events: auto;
  position: relative;
  z-index: 3;
}

/* style.css .nav{height:100%} 在任意视口下都会把 .nav.open 锁死在顶栏高度，二级菜单不可见 */
.with-preview-site-nav .header .header-content .nav.open,
.with-preview-site-nav .header .header-content #mainNav.nav.open {
  height: auto !important;
  min-height: calc(100vh - 64px);
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 1295px) {
  .with-preview-site-nav .sub-hero-carousel {
    height: auto;
    min-height: 0;
  }
  .with-preview-site-nav main.page-detail-sub .sub-hero-slide,
  .with-preview-site-nav .page-detail-sub .sub-hero-slide {
    position: relative;
    height: auto;
    min-height: 400px;
    align-items: flex-start;
    padding-top: 32px;
    padding-bottom: 64px;
  }
  .with-preview-site-nav main.page-detail-sub .sub-hero-slide[style*='opacity:0'],
  .with-preview-site-nav main.page-detail-sub .sub-hero-slide[style*='opacity: 0'],
  .with-preview-site-nav .page-detail-sub .sub-hero-slide[style*='opacity:0'],
  .with-preview-site-nav .page-detail-sub .sub-hero-slide[style*='opacity: 0'] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 0;
    pointer-events: none;
  }
  .with-preview-site-nav .hero {
    min-height: auto;
    padding-top: 96px;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  body.with-preview-site-nav .header .header-content {
    padding: 0 0.75rem;
    gap: 4px;
  }
  body.with-preview-site-nav .header .header-content .logo-icon {
    width: 96px !important;
    height: 28px !important;
  }
  body.with-preview-site-nav .header .header-content .header-actions {
    gap: 4px;
  }
  body.with-preview-site-nav .header .header-content .header-actions .lang-toggle {
    padding: 4px 6px;
    font-size: 11px;
  }
  body.with-preview-site-nav .header .header-content .ciip-foreign-trigger {
    padding: 0 8px;
    font-size: 12px;
  }
}

@media (max-width: 750px) {
  .header .header-content .header-phone,
  body.with-preview-site-nav .header .header-content .header-phone {
    display: none !important;
  }
  .header .header-content .header-actions .ciip-mobile-switch,
  body.with-preview-site-nav .header .header-content .header-actions .ciip-mobile-switch {
    display: none !important;
  }
}

@media (max-width: 1295px) {
  body.with-preview-site-nav .header .header-content .nav.open,
  body.with-preview-site-nav .header .header-content #mainNav.nav.open {
    display: flex !important;
    z-index: 1101 !important;
    top: 64px !important;
  }
  body.with-preview-site-nav .header:has(.nav.open) {
    z-index: 1100 !important;
  }
}

@media (max-width: 768px) {
  .with-preview-site-nav main.page-detail-sub .sub-hero-slide,
  .with-preview-site-nav .page-detail-sub .sub-hero-slide {
    padding-top: 148px;
  }
  .with-preview-site-nav main.page-detail-sub .det-inner .breadcrumb,
  .with-preview-site-nav .page-detail-sub .det-inner .breadcrumb {
    padding-right: 56px;
  }
  .with-preview-site-nav .hero {
    padding-top: 148px;
  }
  .with-preview-site-nav .hero-breadcrumb {
    padding-right: 56px;
    justify-content: flex-start;
  }
}

body.with-preview-site-nav .header-actions .ciip-mobile-switch {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  align-self: center;
  flex-shrink: 0;
  overflow: visible;
  z-index: 110;
}

@media (min-width: 1136px) {
  body.with-preview-site-nav .header-actions .ciip-mobile-switch {
    height: 64px;
  }
}

body.with-preview-site-nav .ciip-mobile-trigger {
  display: inline-flex;
  align-items: center;
  align-self: stretch;
  height: 100%;
  gap: 4px;
  padding: 0 12px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
}

body.with-preview-site-nav .ciip-mobile-switch:hover .ciip-mobile-trigger,
body.with-preview-site-nav .ciip-mobile-switch:focus-within .ciip-mobile-trigger {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

body.with-preview-site-nav .ciip-mobile-caret {
  font-size: 11px;
  opacity: 0.65;
  margin-left: 1px;
}

body.with-preview-site-nav .header-actions .ciip-mobile-dropdown {
  position: absolute !important;
  top: 100%;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  min-width: 0 !important;
  width: max-content;
  max-width: none;
  padding: 10px !important;
  margin-top: 2px;
  border-top: 3px solid var(--primary) !important;
  box-shadow: 0 12px 40px rgba(14, 165, 233, 0.2) !important;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.with-preview-site-nav .header-actions .ciip-mobile-dropdown::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 8px;
}

body.with-preview-site-nav .header-actions .ciip-mobile-dropdown img {
  display: block;
  width: 168px;
  height: 168px;
  object-fit: contain;
}

body.with-preview-site-nav .header-actions .ciip-mobile-switch:hover .ciip-mobile-dropdown,
body.with-preview-site-nav .header-actions .ciip-mobile-switch:focus-within .ciip-mobile-dropdown,
body.with-preview-site-nav .header-actions .ciip-mobile-switch.ciip-mobile-is-open .ciip-mobile-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

@media (max-width: 1135px) {
  body.with-preview-site-nav .header-actions .ciip-mobile-switch:hover .ciip-mobile-dropdown,
  body.with-preview-site-nav .header-actions .ciip-mobile-switch:focus-within .ciip-mobile-dropdown {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  body.with-preview-site-nav .header-actions .ciip-mobile-switch.ciip-mobile-is-open .ciip-mobile-dropdown {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    display: block !important;
    position: absolute !important;
    top: 100% !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    min-width: 0 !important;
    width: max-content;
    height: auto !important;
    overflow: visible !important;
    z-index: 200;
  }
}

@media (max-width: 767px) {
  body.with-preview-site-nav .header .header-content {
    overflow: visible;
  }
  body.with-preview-site-nav .header .header-content .header-actions {
    position: relative;
    overflow: visible;
  }
  body.with-preview-site-nav .header-actions .ciip-mobile-switch {
    overflow: visible;
  }
  body.with-preview-site-nav .header-actions .ciip-mobile-dropdown {
    max-width: calc(100vw - 16px);
  }
}
