/* ============================================
   49统计 - 基础样式（设计令牌 / 重置 / 通用组件 / 导航 / 页脚 / 客服浮窗）
   ============================================ */

/* === 设计令牌 === */
:root {
  /* 品牌主色：低饱和青绿系 */
  --brand-900: #2F4F4E;
  --brand-700: #598987;
  --brand-600: #678F8D;
  --brand-500: #77A88D;
  --brand-100: #E6F0EB;
  --brand-50: #F4F9F6;

  /* 高饱和点缀 */
  --gold: #FFD000;
  --gold-dark: #E6BB00;
  --coral: #FF6670;
  --coral-dark: #F04E59;

  /* 中性文字与背景 */
  --ink: #1C2B2A;
  --ink-2: #3D514F;
  --ink-3: #6E8380;
  --ink-4: #9AA9A6;
  --line: #DCE7E3;
  --line-soft: #EDF3F1;
  --bg: #FFFFFF;
  --bg-soft: #F7FAF9;

  /* 度量 */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --container: 1180px;
  --nav-h: 68px;

  --shadow-sm: 0 1px 2px rgba(28, 43, 42, .06);
  --shadow-md: 0 8px 24px rgba(28, 43, 42, .08);
  --shadow-lg: 0 18px 48px rgba(28, 43, 42, .12);

  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  margin: 0 0 .5em;
  color: var(--ink);
  line-height: 1.3;
  font-weight: 700;
}

h1 { font-size: 2.75rem; letter-spacing: -.5px; }
h2 { font-size: 2rem; letter-spacing: -.3px; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }

a { color: var(--brand-700); text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--brand-900); }

img { max-width: 100%; height: auto; display: block; }

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

button { font-family: inherit; }

/* === 布局容器 === */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 84px 0; }
.section--soft { background: var(--bg-soft); }

.section-head { max-width: 720px; margin: 0 auto 48px; text-align: center; }

.section-label {
  display: inline-block;
  margin-bottom: 14px;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--brand-100);
  color: var(--brand-700);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .5px;
}

.section-title { margin-bottom: 14px; }

.section-desc { margin: 0; color: var(--ink-3); font-size: 1.02rem; }

/* === 按钮 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: .96rem;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.btn svg { flex: none; }

/* 主按钮：品牌青绿 */
.btn-primary { background: var(--brand-700); color: #fff; box-shadow: 0 6px 16px rgba(89, 137, 135, .28); }
.btn-primary:hover { background: var(--brand-900); color: #fff; transform: translateY(-1px); }

/* 次按钮：白底品牌描边 */
.btn-outline { background: #fff; color: var(--brand-700); border-color: var(--brand-600); }
.btn-outline:hover { background: var(--brand-50); color: var(--brand-900); border-color: var(--brand-700); }

/* 高亮按钮：金黄，用于强转化入口 */
.btn-gold { background: var(--gold); color: var(--brand-900); box-shadow: 0 6px 16px rgba(255, 208, 0, .32); }
.btn-gold:hover { background: var(--gold-dark); color: var(--brand-900); transform: translateY(-1px); }

.btn-sm { padding: 8px 16px; font-size: .88rem; }
.btn-lg { padding: 15px 30px; font-size: 1.02rem; }
.btn-block { width: 100%; }

.btn-group { display: flex; flex-wrap: wrap; gap: 14px; }

/* === 顶部导航 === */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 90;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.nav.scrolled { border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }

.nav-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--nav-h);
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* 品牌标识 */
.nav-logo { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 1.2rem; font-weight: 700; }
.nav-logo:hover { color: var(--ink); }

.nav-logo-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-700), var(--brand-500));
  color: #fff;
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: -.5px;
}

.nav-logo-text small { display: block; margin-top: -4px; color: var(--ink-4); font-size: .68rem; font-weight: 500; letter-spacing: 1.5px; }

/* 主导航链接 */
.nav-links { display: flex; align-items: center; gap: 4px; margin: 0 auto; }

.nav-links a {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: .95rem;
  font-weight: 500;
}

.nav-links a:hover { background: var(--brand-50); color: var(--brand-900); }

.nav-links a.active { background: var(--brand-100); color: var(--brand-900); font-weight: 600; }

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

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  font-size: 1.15rem;
  cursor: pointer;
}

/* 移动端下拉菜单（内容由 js/main.js 从桌面导航克隆） */
.mobile-menu {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  z-index: 89;
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 16px 24px 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-md);
}

.mobile-menu.open { display: flex; }

.mobile-menu a { padding: 12px 8px; border-radius: var(--radius-sm); color: var(--ink-2); font-weight: 500; }
.mobile-menu a.active { background: var(--brand-100); color: var(--brand-900); }
.mobile-menu a.mobile-menu-cta {
  justify-content: center;
  width: 100%;
  margin-top: 6px;
  padding: 12px 16px;
  text-align: center;
  font-weight: 600;
}

.mobile-menu a.mobile-menu-cta.btn-outline { color: var(--brand-700); background: #fff; border-color: var(--brand-600); }
.mobile-menu a.mobile-menu-cta.btn-primary { color: #fff; background: var(--brand-700); }

/* === 通用卡片 === */
.card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.card:hover { border-color: var(--brand-500); box-shadow: var(--shadow-md); transform: translateY(-3px); }

/* === 页脚 === */
.footer { padding: 64px 0 28px; background: var(--brand-900); color: rgba(255, 255, 255, .74); }

.footer a { color: rgba(255, 255, 255, .74); }
.footer a:hover { color: #fff; }

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, .14);
}

.footer .nav-logo { color: #fff; }
.footer .nav-logo:hover { color: #fff; }

.footer-brand p { margin: 16px 0 0; max-width: 380px; font-size: .92rem; line-height: 1.8; }

.footer-col h4 { margin-bottom: 16px; color: #fff; font-size: .95rem; font-weight: 600; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { font-size: .92rem; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 24px;
  font-size: .86rem;
}

.footer-bottom p { margin: 0; }
.footer-bottom-links { display: flex; gap: 20px; }

/* === 常见问题手风琴 === */
.faq-list { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }

.faq-item { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; transition: border-color .2s ease, box-shadow .2s ease; }
.faq-item.open { border-color: var(--brand-500); box-shadow: var(--shadow-sm); }

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  color: var(--ink);
  font-size: 1.02rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.faq-arrow { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand-100); color: var(--brand-700); transition: transform .22s ease, background-color .22s ease; }
.faq-item.open .faq-arrow { transform: rotate(180deg); background: var(--brand-700); color: #fff; }

.faq-answer { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .26s ease; }
.faq-item.open .faq-answer { grid-template-rows: 1fr; }

.faq-answer-inner { overflow: hidden; padding: 0 24px; color: var(--ink-3); font-size: .95rem; }
.faq-item.open .faq-answer-inner { padding-bottom: 22px; }

/* === 滚动淡入动画 === */
.fade-up { opacity: 0; transform: translateY(18px); transition: opacity .5s ease, transform .5s ease; }
.fade-up.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fade-up { opacity: 1; transform: none; transition: none; }
}

/* === 客服浮窗 === */
.kefu-widget {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 10px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  touch-action: none;
}

.kefu-title { padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); color: var(--ink); font-size: .8rem; font-weight: 600; text-align: center; }

.kefu-items { display: flex; flex-direction: column; gap: 8px; }

.kefu-item {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 10px;
  background: var(--brand-700);
  cursor: pointer;
  transition: background-color .18s ease, transform .18s ease;
}

.kefu-item:hover { transform: translateY(-2px); }

.kefu-item-wechat { background: #2EBE5B; }
.kefu-item-wechat:hover { background: #26A34E; }
.kefu-item-telegram { background: #2AA3DA; }
.kefu-item-telegram:hover { background: #1E8CBF; }
.kefu-item-service { background: var(--brand-700); }
.kefu-item-service:hover { background: var(--brand-900); }

.kefu-close {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: var(--ink-4);
  color: #fff;
  font-size: .9rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color .18s ease;
}

.kefu-close:hover { background: var(--ink-2); }

.kefu-qr-pop {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  padding: 12px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.kefu-qr-pop img { width: 200px; height: 200px; max-width: none; object-fit: contain; }
.kefu-qr-pop span { display: block; margin-top: 8px; color: var(--ink-3); font-size: .78rem; }

/* 在线客服聊天弹窗 */
.kefu-chat-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(28, 43, 42, .45);
}

.kefu-chat-modal[hidden] { display: none; }

.kefu-chat-modal-box {
  position: relative;
  width: 100%;
  max-width: 380px;
  height: min(600px, 82vh);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.kefu-chat-modal-box iframe { width: 100%; height: 100%; border: 0; }

.kefu-chat-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: var(--brand-100);
  color: var(--brand-900);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
}

/* === 响应式 === */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  h1 { font-size: 2.1rem; }
  h2 { font-size: 1.6rem; }

  .section { padding: 60px 0; }

  .nav-links, .nav-actions { display: none; }
  .nav-toggle { display: grid; place-items: center; margin-left: auto; }

  .kefu-widget { right: 12px; padding: 10px 8px; }
}

@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { justify-content: flex-start; }
  .btn-group { flex-direction: column; align-items: stretch; }
  .btn-group .btn { width: 100%; }
}
