:root {
  --color-primary: #2850f0;
  --color-primary-dark: #1a3dd9;
  --color-primary-light: #4d6fff;
  --color-accent: #00c6a8;
  --color-navy: #000028;
  --color-navy-mid: #0a1628;
  --color-text-primary: #1a1f36;
  --color-text-secondary: #4a5568;
  --color-text-muted: #8896a8;
  --color-bg-page: #f5f7fa;
  --color-bg-section: #f0f4ff;
  --color-border: #e4e8f0;
  --color-border-light: #f0f2f5;
  --gradient-primary: linear-gradient(135deg, #2850f0 0%, #1a3dd9 100%);
  --gradient-hero-overlay: linear-gradient(180deg, rgba(0,0,40,0.55) 0%, rgba(0,0,40,0.35) 50%, rgba(0,0,40,0.65) 100%);
  --gradient-blue-banner: linear-gradient(135deg, #1240ab 0%, #2060e8 50%, #2850f0 100%);
  --gradient-dark: linear-gradient(180deg, #080d1e 0%, #0d1a3a 100%);
  --shadow-card: 0 4px 20px rgba(40, 80, 240, 0.08);
  --shadow-card-hover: 0 8px 32px rgba(40, 80, 240, 0.16);
  --shadow-nav: 0 2px 16px rgba(0, 0, 0, 0.08);
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;
  --font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
  --nav-height: 64px;
  --container-max: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { overflow-x: hidden; }
body {
  margin: 0;
  font-family: var(--font-family);
  color: var(--color-text-primary);
  background: var(--color-bg-page);
  -webkit-font-smoothing: antialiased;
}
p, h1, h2, h3, h4, h5, h6, span, div { word-break: break-word; }
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 40px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 28px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.25s ease;
}
.btn-primary {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(40, 80, 240, 0.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(40, 80, 240, 0.5); }
.btn-outline-white {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
}
.btn-outline-white:hover { background: rgba(255, 255, 255, 0.1); border-color: #fff; }
.btn-white {
  background: #fff;
  color: var(--color-primary);
  font-weight: 600;
}
.btn-white:hover { background: var(--color-bg-section); }

.section-title {
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  color: var(--color-text-primary);
  margin: 0 0 8px;
  line-height: 1.3;
}
.section-subtitle {
  font-size: 16px;
  color: var(--color-text-muted);
  text-align: center;
  margin: 0 0 48px;
}

/* ── Navigation ── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--nav-height);
  transition: background 0.3s, box-shadow 0.3s;
}
/* Transparent nav (default for hero pages) */
.nav-transparent .nav { background: transparent; }
.nav-transparent .nav-link { color: rgba(255, 255, 255, 0.9); }
.nav-transparent .nav-logo-text { color: #fff; }
.nav-transparent .nav-logo-sub { color: rgba(255,255,255,0.7); }
.nav-transparent .nav.is-scrolled {
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--color-border-light);
  box-shadow: var(--shadow-nav);
}
.nav-transparent .nav.is-scrolled .nav-link { color: var(--color-text-secondary); }
.nav-transparent .nav.is-scrolled .nav-logo-text { color: var(--color-primary); }
.nav-transparent .nav.is-scrolled .nav-logo-sub { color: var(--color-text-muted); }
.nav-transparent .nav-link:hover, .nav-transparent .nav-link.active { color: #fff; }
.nav-transparent .nav.is-scrolled .nav-link:hover,
.nav-transparent .nav.is-scrolled .nav-link.active { color: var(--color-primary); }
.nav-transparent .nav-link:hover { background: rgba(255,255,255,0.08); }
.nav-transparent .nav.is-scrolled .nav-link:hover { background: rgba(40,80,240,0.06); }
.nav-transparent .nav-icon { color: rgba(255,255,255,0.85); }
.nav-transparent .nav.is-scrolled .nav-icon { color: var(--color-text-secondary); }
.nav-transparent .nav-icon:hover { background: rgba(255,255,255,0.15); }
.nav-transparent .nav.is-scrolled .nav-icon:hover { background: var(--color-bg-section); color: var(--color-primary); }

/* White nav (for inner pages) */
.nav-white .nav {
  background: rgba(255,255,255,0.98);
  border-bottom: 1px solid var(--color-border-light);
}
.nav-white .nav-link { color: var(--color-text-secondary); }
.nav-white .nav-logo-text { color: var(--color-primary); }
.nav-white .nav-logo-sub { color: var(--color-text-muted); }
.nav-white .nav-link:hover,
.nav-white .nav-link.active { color: var(--color-primary); }
.nav-white .nav-link:hover { background: rgba(40,80,240,0.06); }
.nav-white .nav-icon { color: var(--color-text-secondary); }
.nav-white .nav-icon:hover { background: var(--color-bg-section); color: var(--color-primary); }
.nav-white .nav.is-scrolled { box-shadow: var(--shadow-nav); }

.nav-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 40px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.nav-logo-icon {
  width: 32px; height: 32px;
  background: var(--gradient-primary);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 16px;
}
.nav-logo-text {
  font-size: 18px;
  font-weight: 700;
  transition: color 0.3s;
}
.nav-logo-sub {
  font-size: 10px;
  letter-spacing: 1px;
  display: block;
  line-height: 1;
}
.nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
  list-style: none;
  margin: 0; padding: 0;
}
.nav-link {
  padding: 8px 14px;
  font-size: 14px;
  border-radius: 4px;
  white-space: nowrap;
  transition: color 0.2s;
}

/* ── Nav Dropdown ── */
.nav-has-dropdown {
  position: relative;
}
.nav-has-dropdown .nav-link::after {
  content: '';
  display: inline-block;
  width: 5px; height: 5px;
  border: 2px solid currentColor;
  border-top: none; border-left: none;
  transform: rotate(45deg);
  margin-left: 5px;
  vertical-align: 1px;
  opacity: 0.5;
  transition: transform 0.2s;
}
.nav-has-dropdown:hover .nav-link::after {
  transform: rotate(225deg) translateY(-1px);
}
.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  transform: translateY(8px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 16px 60px rgba(0,0,0,0.18);
  padding: 12px;
  min-width: 480px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 200;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}
.nav-has-dropdown:hover .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-drop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--color-text-primary);
  border-radius: 10px;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}
.nav-drop-item:hover {
  background: var(--color-bg-page);
  color: var(--color-primary);
  transform: translateX(4px);
}
.nd-tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.6;
  flex-shrink: 0;
}
.nd-sol-icon {
  font-size: 18px;
  flex-shrink: 0;
  width: 28px;
  text-align: center;
}
.nav-actions { display: flex; gap: 8px; }
.nav-icon {
  width: 36px; height: 36px;
  border: none; background: none; cursor: pointer;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}

/* ── Chat Widget ── */
.chat-fab {
  position: fixed;
  right: 24px;
  top: 80%;
  z-index: 9999;
}
.chat-btn {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--gradient-primary);
  border: none;
  box-shadow: 0 4px 20px rgba(40,80,240,0.4);
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  color: #fff;
}
.chat-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(40,80,240,0.55);
}
.chat-btn svg {
  width: 26px; height: 26px;
  transition: transform 0.25s;
}
.chat-btn.open svg {
  transform: rotate(90deg);
}
.chat-panel {
  position: absolute;
  right: 0;
  bottom: 68px;
  width: 340px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.15);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.96);
  transform-origin: bottom right;
  transition: all 0.25s ease;
  overflow: hidden;
}
.chat-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}
.chat-header {
  background: var(--gradient-primary);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.chat-header-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
}
.chat-header-info h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.chat-header-info p {
  margin: 2px 0 0;
  font-size: 11px;
  opacity: 0.75;
}
.chat-body {
  padding: 16px 20px;
  max-height: 280px;
  overflow-y: auto;
}
.chat-msg {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.chat-msg.bot { align-items: flex-start; }
.chat-msg.user { flex-direction: row-reverse; }
.chat-msg-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.chat-msg.bot .chat-msg-avatar { background: #eef2ff; color: var(--color-primary); }
.chat-msg.user .chat-msg-avatar { background: var(--gradient-primary); color: #fff; }
.chat-msg-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.6;
}
.chat-msg.bot .chat-msg-bubble {
  background: #f0f2f5;
  color: var(--color-text-primary);
  border-bottom-left-radius: 4px;
}
.chat-msg.user .chat-msg-bubble {
  background: var(--gradient-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--color-border-light);
  display: flex;
  gap: 8px;
}
.chat-footer input {
  flex: 1;
  border: 1px solid var(--color-border);
  border-radius: 24px;
  padding: 8px 14px;
  font-size: 13px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}
.chat-footer input:focus { border-color: var(--color-primary); }
.chat-footer button {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--gradient-primary);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.chat-footer button:hover { transform: scale(1.1); }
.chat-footer button svg { width: 16px; height: 16px; }
@media (max-width: 480px) {
  .chat-panel { width: 300px; right: -10px; }
}

/* ── Footer ── */
.footer {
  background: #1a1f2e;
  color: rgba(255,255,255,0.75);
  padding: 56px 0 28px;
}
.footer-cols {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 40px;
}
.footer-col-title {
  font-size: 14px; font-weight: 600;
  color: #fff; margin: 0 0 20px;
}
.footer-links {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.footer-links a {
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  transition: color 0.2s;
}
.footer-links a:hover { color: #fff; }
.footer-hr {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin-bottom: 24px;
}
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.socials { display: flex; gap: 12px; }
.social-icon {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.5);
  transition: all 0.2s;
}
.social-icon:hover { background: rgba(255,255,255,0.1); color: #fff; }
.footer-meta {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
.footer-meta a { color: inherit; }
.footer-meta a:hover { color: rgba(255,255,255,0.7); }

/* ── Hamburger Menu (mobile) ── */
.nav-hamburger {
  display: none;
  width: 36px; height: 36px;
  border: none; background: none; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; border-radius: 50%; transition: background 0.2s;
}
.nav-hamburger:hover { background: rgba(255,255,255,0.12); }
.nav-white .nav-hamburger:hover,
.nav.is-scrolled .nav-hamburger:hover { background: var(--color-bg-section); }
.nav-hamburger span {
  display: block; width: 20px; height: 2px;
  background: currentColor; border-radius: 2px;
  transition: all 0.3s ease;
}
.nav-hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .footer-cols { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .nav-hamburger { display: flex; }
  .nav-links {
    display: none;
    position: fixed;
    top: var(--nav-height); left: 0; right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.98);
    flex-direction: column;
    padding: 20px;
    gap: 4px;
    overflow-y: auto;
    z-index: 999;
  }
  .nav-links.open { display: flex; }
  .nav-link { padding: 14px 12px; font-size: 16px; color: var(--color-text-primary) !important; }
  .nav-link:hover { background: var(--color-bg-section); color: var(--color-primary) !important; }
  .nav-has-dropdown .nav-link::after { display: none; }
  .nav-has-dropdown .nav-dropdown {
    position: static; opacity: 1; visibility: visible;
    transform: none; box-shadow: none;
    grid-template-columns: 1fr;
    padding: 4px 0 4px 12px;
    min-width: auto; background: transparent;
  }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .container { padding: 0 20px; }
  .section-title { font-size: 24px; }
  .section-subtitle { font-size: 14px; }
}
/* ── 通用 page-banner 响应式 ── */
@media (max-width: 768px) {
  .page-banner { padding-top: calc(var(--nav-height) + 32px); padding-bottom: 40px; }
}

/* ── 通用侧栏布局（侧栏+内容）响应式 — ≤768px 侧栏折叠为顶部横排 ── */
@media (max-width: 768px) {
  .product-layout,
  .solutions-layout,
  .about-layout,
  .service-layout,
  .resources-layout {
    flex-direction: column;
    min-height: auto;
  }
  .product-sidebar,
  .solutions-sidebar,
  .about-sidebar,
  .service-sidebar,
  .resources-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--color-border-light);
    padding: 0;
    background: #fff;
  }
  .sidebar-title {
    display: none;
  }
  .sidebar-item {
    display: inline-flex;
    padding: 8px 16px;
    border-left: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    font-size: 13px;
  }
  .sidebar-item:hover {
    background: transparent;
    border-bottom-color: var(--color-primary-light);
    transform: none;
  }
  .sidebar-item.active {
    border-left-color: transparent;
    border-bottom-color: var(--color-primary);
    color: var(--color-primary);
    font-weight: 600;
  }
  .sidebar-item.active .sidebar-tag,
  .sidebar-item.active .sidebar-icon {
    background: var(--gradient-primary);
    color: #fff;
  }
  .sidebar-tag {
    width: auto;
    height: auto;
    background: transparent;
    font-size: 10px;
    border: none;
    padding: 0;
    display: inline;
  }
  .sidebar-item.all-item .sidebar-tag {
    border: none;
  }
  .sidebar-item.all-item .sidebar-tag,
  .sidebar-item.all-item:hover .sidebar-tag {
    border: none;
    color: var(--color-primary);
  }
  .product-content,
  .solutions-content,
  .about-content,
  .service-content,
  .resources-content {
    padding: 24px 20px;
  }
}

/* ── 通用 page-header 响应式 ── */
@media (max-width: 768px) {
  .page-header {
    padding-top: calc(var(--nav-height) + 40px);
    padding-bottom: 40px;
  }
  .page-header h1 { font-size: 26px; }
  .page-header p { font-size: 14px; }
}
@media (max-width: 480px) {
  .page-header h1 { font-size: 22px; }
}

/* ── 通用网格响应式：3列→2列→1列 ── */
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .grid-3 { grid-template-columns: 1fr; max-width: 400px; margin: 0 auto; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .grid-4 { grid-template-columns: 1fr; }
}

/* ── 通用面包屑响应式 ── */
@media (max-width: 480px) {
  .breadcrumb { font-size: 12px; }
  .breadcrumb .sep { margin: 0 4px; }
}

@media (max-width: 480px) {
  .footer-cols { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .nav-inner { padding: 0 16px; }
  .container { padding: 0 16px; }
}
