/* ==========================================================================
   components.css — 通用组件
   导航 / 按钮 / 卡片 / 表单 / 页脚 / 徽章
   ========================================================================== */

/* ---------- 顶部导航 ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), backdrop-filter var(--dur) var(--ease);
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-soft);
  box-shadow: 0 4px 24px rgba(15, 31, 61, 0.06);
}

.nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  color: var(--t-primary);
  font-size: 19px;
  letter-spacing: 0.02em;
}

.brand .brand-logo {
  height: 56px;
  width: auto;
  display: block;
  flex-shrink: 0;
  color: #fff; /* 默认白色：在 hero 深色背景上看得到 */
}

.nav.scrolled .brand-logo {
  color: var(--t-primary); /* 滚动后白底：变成深色文字色 */
}

.brand .brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--grad-primary);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-glow);
  flex-shrink: 0;
}

.brand .brand-mark svg { width: 22px; height: 22px; }

.brand small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--t-muted);
  letter-spacing: 0.18em;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-menu a {
  position: relative;
  padding: 9px 16px;
  font-size: 16px;
  color: var(--t-secondary);
  border-radius: var(--radius-sm);
  transition: color 0.3s var(--ease), background 0.3s var(--ease);
}

.nav-menu a:hover { color: var(--t-primary); }

.nav-menu a.active {
  color: var(--c-blue);
  background: rgba(22, 93, 255, 0.09);
}

.nav-menu a.active::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad-primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-phone {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--t-secondary);
  font-size: 14px;
  font-weight: 500;
}

.nav-phone svg { width: 18px; height: 18px; color: var(--c-cyan); }

/* 汉堡按钮 */
.nav-toggle {
  display: none;
  width: var(--icon-btn);
  height: var(--icon-btn);
  border-radius: var(--radius-sm);
  position: relative;
}

.nav-toggle span {
  position: absolute;
  left: 11px;
  right: 11px;
  height: 2px;
  background: var(--t-primary);
  border-radius: 2px;
  transition: transform 0.35s var(--ease), opacity 0.2s var(--ease);
}

.nav-toggle span:nth-child(1) { top: 15px; }
.nav-toggle span:nth-child(2) { top: 21px; }
.nav-toggle span:nth-child(3) { top: 27px; }

.nav-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* 移动端全屏抽屉 */
.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 0 32px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease), visibility 0.4s;
}

.mobile-drawer.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mobile-drawer a {
  font-size: 26px;
  font-weight: 600;
  color: var(--t-primary);
  padding: 14px 0;
  border-bottom: 1px solid var(--border-soft);
}

.mobile-drawer a.active { color: var(--c-blue); }

.mobile-drawer .btn { margin-top: 24px; }

/* ---------- 顶部导航 Mega Menu ---------- */
.nav-item { position: relative; }

.nav-item .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.nav-chevron {
  display: inline-flex;
  width: 14px;
  height: 14px;
  transition: transform 0.22s var(--ease);
}

.nav-chevron svg { width: 100%; height: 100%; }

.nav-item.open .nav-chevron { transform: rotate(180deg); }

/* 触发项与面板之间的透明热区，避免鼠标穿过间隙时判定为离开 */
.nav-item.has-panel::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 12px;
}

.nav-panel {
  position: absolute;
  top: calc(100% + 12px);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 26px 28px;
  max-height: calc(100vh - var(--nav-h) - 32px);
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease), visibility 0.22s;
}

.nav-panel[data-width="compact"] {
  left: 0;
  min-width: 380px;
}

.nav-panel[data-width="wide"] {
  left: 50%;
  width: min(1120px, calc(100vw - 48px));
  margin-left: calc(min(1120px, 100vw - 48px) / -2);
}

.nav-item.open .nav-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-cols {
  display: grid;
  gap: 22px;
}

.nav-panel[data-width="wide"] .nav-cols { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.nav-panel[data-width="compact"] .nav-cols { grid-template-columns: repeat(2, 1fr); }

.nav-col-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--c-cyan);
  margin-bottom: 10px;
}

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

.nav-col-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  margin: 0 -10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  line-height: 1.5;
  color: var(--t-secondary);
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.nav-col-item:hover {
  background: rgba(22, 93, 255, 0.06);
  color: var(--c-blue);
}

.nav-panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-soft);
}

.nav-chips { display: flex; flex-wrap: wrap; gap: 8px; }

.nav-chip {
  font-size: 13px;
  padding: 5px 13px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-soft);
  color: var(--t-secondary);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), background 0.2s var(--ease);
}

.nav-chip:hover {
  border-color: rgba(22, 93, 255, 0.35);
  background: rgba(22, 93, 255, 0.06);
  color: var(--c-blue);
}

.nav-foot-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--c-blue);
  margin-left: auto;
}

.nav-foot-link svg { width: 16px; height: 16px; }

/* 面板展开时给透明状态的导航补白底，避免与正文视觉重叠 */
.nav.menu-open {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-soft);
}

/* ---------- 移动端抽屉手风琴 ---------- */
.drawer-group { width: 100%; max-width: 320px; }

.drawer-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drawer-group-head a { flex: 1; }

.drawer-arrow {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--t-muted);
  cursor: pointer;
  transition: transform 0.22s var(--ease), color 0.2s var(--ease);
}

.drawer-arrow svg { width: 16px; height: 16px; }

.drawer-group.open .drawer-arrow {
  transform: rotate(180deg);
  color: var(--c-blue);
}

.drawer-sub {
  display: grid;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s var(--ease), opacity 0.22s var(--ease);
}

.drawer-group.open .drawer-sub {
  max-height: 520px;
  opacity: 1;
}

.drawer-sub-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--c-cyan);
  margin: 14px 0 4px;
}

.drawer-sub-item {
  font-size: 15px !important;
  color: var(--t-secondary);
  padding: 5px 0;
}

@media (prefers-reduced-motion: reduce) {
  .nav-panel,
  .nav-chevron,
  .drawer-sub,
  .drawer-arrow { transition: none; }
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: var(--btn-h-md);
  padding: 0 var(--btn-pad-x-md);
  border-radius: var(--radius-pill);
  font-size: var(--btn-font-md);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease);
  white-space: nowrap;
}

.btn svg { width: 18px; height: 18px; }

.btn-primary {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: 0 6px 24px rgba(79, 143, 255, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 32px rgba(79, 143, 255, 0.5);
  background: var(--grad-primary-hover);
}

.btn-outline {
  box-shadow: inset 0 0 0 1px var(--border-strong);
  color: var(--t-primary);
  background: rgba(79, 143, 255, 0.04);
}

.btn-outline:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 0 0 1px var(--c-blue);
  background: rgba(79, 143, 255, 0.12);
}

.btn-text {
  color: var(--c-blue);
  min-height: 32px;
  padding: 0 4px;
  font-size: 14px;
  line-height: 1;
}

.btn-text:hover { color: var(--c-cyan); gap: 14px; }

.btn-lg {
  min-height: var(--btn-h-lg);
  padding: 0 var(--btn-pad-x-lg);
  font-size: var(--btn-font-lg);
}

/* ---------- 卡片 ---------- */
.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  overflow: hidden;
}

/* 流光边框（hover 时显现） */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(120deg, transparent 20%, var(--c-blue), var(--c-purple), transparent 80%);
  background-size: 200% 100%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

.card:hover::before {
  opacity: 1;
  animation: border-flow 2.4s linear infinite;
}

.card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(22, 93, 255, 0.12), rgba(109, 92, 255, 0.1));
  border: 1px solid var(--border-mid);
  color: var(--c-blue);
  margin-bottom: var(--sp-3);
}

.card-icon svg { width: 28px; height: 28px; }

.card h3 { margin-bottom: 12px; }
.card p { font-size: 16px; line-height: 1.75; }

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: var(--sp-3);
  color: var(--c-blue);
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  transition: gap 0.3s var(--ease), color 0.3s var(--ease);
}

.card-link svg { flex-shrink: 0; }

.card:hover .card-link { gap: 12px; color: var(--c-cyan); }

/* 三大能力卡：把"了解详情"链接的点击区扩展到整张卡片
   （.card 已是 position: relative，::before 铺满后 hover/click 整张卡片都触发链接） */
.service-card .card-link::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* 数据卡片 */
.stat {
  text-align: center;
  padding: var(--sp-3);
}

.stat .stat-num {
  font-size: clamp(38px, 5vw, 56px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat .stat-suffix { font-size: 0.5em; }
.stat .stat-label {
  margin-top: 12px;
  color: var(--t-secondary);
  font-size: 16px;
}

/* 标签徽章 */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid var(--border-mid);
  color: var(--c-blue);
  background: rgba(22, 93, 255, 0.07);
}

.tag.tag-purple { color: var(--c-purple); border-color: rgba(109, 92, 255, 0.3); background: rgba(109, 92, 255, 0.08); }
.tag.tag-blue { color: var(--c-blue); }

/* ---------- 表单 ---------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-3);
}

.field { display: flex; flex-direction: column; gap: 8px; }
.field.full { grid-column: 1 / -1; }

.field label {
  font-size: 14px;
  font-weight: 500;
  color: var(--t-secondary);
}

.field label .req { color: var(--c-cyan); margin-left: 2px; }

.field input,
.field textarea,
.field select {
  background: var(--bg-input);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  color: var(--t-primary);
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease);
  width: 100%;
}

.field input::placeholder,
.field textarea::placeholder { color: var(--t-muted); }

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  background: #fff;
  border-color: var(--c-blue);
  box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.15);
}

.field textarea { resize: vertical; min-height: 130px; }

.field.error input,
.field.error textarea {
  border-color: #ff6b81;
  box-shadow: 0 0 0 3px rgba(255, 107, 129, 0.15);
}

.field .err-msg {
  font-size: 12px;
  color: #ff8095;
  display: none;
}

.field.error .err-msg { display: block; }

.form-note {
  margin-top: var(--sp-2);
  font-size: 13px;
  color: var(--t-muted);
}

.form-success {
  display: none;
  margin-top: var(--sp-3);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.35);
  color: var(--c-cyan-2);
  font-size: 14px;
}

.form-success.show { display: block; }

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--border-soft);
  background: var(--bg-soft);
  padding-block: var(--sp-8) var(--sp-4);
  margin-top: var(--sp-8);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
  gap: var(--sp-6);
  margin-bottom: var(--sp-6);
}

.footer-col h5 {
  color: var(--t-primary);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: var(--sp-3);
}

.footer-col ul li { margin-bottom: 12px; }

.footer-col a {
  color: var(--t-muted);
  font-size: 15px;
  transition: color 0.3s var(--ease);
}

.footer-col a:hover { color: var(--c-blue); }

.footer-about p {
  font-size: 15px;
  color: var(--t-muted);
  margin-top: var(--sp-2);
  max-width: 320px;
}

.footer .brand { margin-bottom: var(--sp-2); }

.footer-contact li {
  color: var(--t-muted);
  font-size: 15px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.footer-contact svg { width: 16px; height: 16px; color: var(--c-cyan); flex-shrink: 0; margin-top: 3px; }

.footer-bottom {
  border-top: 1px solid var(--border-soft);
  padding-top: var(--sp-3);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--t-muted);
}

.footer-bottom a { color: var(--t-muted); }
.footer-bottom a:hover { color: var(--c-blue); }

.footer-beian { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.footer-gongan { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.footer-gongan-icon { width: 18px; height: 18px; vertical-align: middle; }

/* 让 [hidden] 在所有 display: flex/grid 容器内都能正常生效 */
[hidden] { display: none !important; }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
  .nav-menu,
  .nav-phone { display: none; }
  .nav-toggle { display: block; }
}

@media (max-width: 768px) {
  .form-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .nav-actions .btn { min-height: 36px; padding: 0 16px; font-size: 13px; }
  .btn-lg { min-height: 48px; padding: 0 28px; font-size: 15px; }
  .nav-toggle { width: 36px; height: 36px; }
}
