/* ============================================================
   九维心理官网 · 设计系统
   主题：绿色治愈系 / 专业可信 / 简洁现代
   ============================================================ */

:root {
  /* 主色 —— 取自九维 logo 的绿色系 */
  --green-900: #14432a;
  --green-800: #1b5e3a;
  --green-700: #237a4a;
  --green-600: #2e9459;
  --green-500: #45ac6d;
  --green-400: #6cc48d;
  --green-300: #9ad9b3;
  --green-200: #c8ead7;
  --green-100: #e6f6ec;
  --green-50:  #f3faf6;

  /* 辅助色 */
  --lime: #a8c93a;
  --amber: #d99a2b;
  --ink: #1f2a24;
  --ink-2: #3d4a43;
  --ink-3: #6b7a72;
  --ink-4: #97a49d;
  --line: #e2ebe5;
  --line-2: #eff5f1;
  --paper: #ffffff;
  --paper-2: #fafcfb;

  /* 排版 */
  --font-sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  --font-serif: "Songti SC", "SimSun", Georgia, serif;

  /* 尺寸 */
  --maxw: 1200px;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --radius-full: 999px;

  /* 阴影 */
  --shadow-sm: 0 1px 3px rgba(20, 67, 42, .06), 0 1px 2px rgba(20, 67, 42, .04);
  --shadow: 0 4px 16px rgba(20, 67, 42, .08), 0 1px 4px rgba(20, 67, 42, .04);
  --shadow-lg: 0 12px 40px rgba(20, 67, 42, .12), 0 4px 12px rgba(20, 67, 42, .06);
  --shadow-xl: 0 24px 64px rgba(20, 67, 42, .16);

  --ease: cubic-bezier(.4, 0, .2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul, ol { list-style: none; }

/* ---------- 布局 ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: 860px; margin: 0 auto; padding: 0 24px; }

section { position: relative; }
.sec { padding: 96px 0; }
.sec-sm { padding: 64px 0; }
.sec-tint { background: var(--green-50); }
.sec-paper { background: var(--paper-2); }

/* ---------- 顶部导航 ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}
.nav.scrolled { border-bottom-color: var(--line); background: rgba(255, 255, 255, .94); }
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
  height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.nav-logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.nav-logo img { height: 42px; width: auto; }
.nav-logo-text { font-size: 17px; font-weight: 700; letter-spacing: .5px; color: var(--green-800); }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 8px 14px; border-radius: var(--radius-full); font-size: 15px;
  color: var(--ink-2); font-weight: 500; transition: all .2s var(--ease); white-space: nowrap;
}
.nav-links a:hover { color: var(--green-700); background: var(--green-50); }
.nav-links a.active { color: var(--green-700); background: var(--green-100); font-weight: 600; }

.nav-cta {
  padding: 9px 20px; border-radius: var(--radius-full);
  background: var(--green-600); color: #fff !important; font-size: 14.5px; font-weight: 600;
  transition: all .2s var(--ease); box-shadow: var(--shadow-sm); white-space: nowrap;
}
.nav-cta:hover { background: var(--green-700); box-shadow: var(--shadow); transform: translateY(-1px); }

.nav-burger { display: none; flex-direction: column; gap: 5px; padding: 10px; }
.nav-burger span { display: block; width: 22px; height: 2px; background: var(--ink-2); border-radius: 2px; transition: all .3s var(--ease); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 30px; border-radius: var(--radius-full);
  font-size: 15.5px; font-weight: 600; transition: all .25s var(--ease);
  border: 1.5px solid transparent; white-space: nowrap;
}
.btn-primary { background: var(--green-600); color: #fff; box-shadow: 0 4px 14px rgba(46, 148, 89, .28); }
.btn-primary:hover { background: var(--green-700); box-shadow: 0 8px 24px rgba(46, 148, 89, .34); transform: translateY(-2px); }
.btn-ghost { background: #fff; color: var(--green-700); border-color: var(--green-300); }
.btn-ghost:hover { background: var(--green-50); border-color: var(--green-500); transform: translateY(-2px); }
.btn-light { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .38); backdrop-filter: blur(8px); }
.btn-light:hover { background: rgba(255, 255, 255, .26); transform: translateY(-2px); }
.btn-lg { padding: 16px 38px; font-size: 16.5px; }
.btn-block { width: 100%; }

/* ---------- 章节标题 ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  color: var(--green-600); margin-bottom: 16px;
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--green-400); border-radius: 2px; }

.sec-title { font-size: clamp(28px, 4vw, 40px); font-weight: 800; line-height: 1.25; letter-spacing: -.5px; color: var(--ink); margin-bottom: 16px; }
.sec-title .accent { color: var(--green-600); }
.sec-lead { font-size: 17px; color: var(--ink-3); line-height: 1.85; max-width: 720px; }
.sec-head { margin-bottom: 56px; }
.sec-head-center { text-align: center; }
.sec-head-center .sec-lead, .sec-head-center .eyebrow { margin-left: auto; margin-right: auto; }
.sec-head-center .sec-lead { text-align: center; }

/* ---------- 卡片 ---------- */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 32px; transition: all .3s var(--ease);
}
.card:hover { border-color: var(--green-200); box-shadow: var(--shadow-lg); transform: translateY(-4px); }

.grid { display: grid; gap: 24px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g-auto { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

/* ---------- 图标容器 ---------- */
.ico {
  width: 52px; height: 52px; border-radius: var(--radius);
  background: var(--green-100); color: var(--green-700);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  margin-bottom: 18px;
}
.ico svg { width: 26px; height: 26px; stroke-width: 1.8; }

/* 行内 SVG 默认尺寸约束 —— 防止未加尺寸的图标被撑到容器大小 */
svg:not([width]):not([height]) { width: 18px; height: 18px; flex-shrink: 0; }
.ico svg, .footer li svg, .tm-name svg { flex: none; }
.ico-sm { width: 40px; height: 40px; border-radius: 11px; margin-bottom: 0; }
.ico-sm svg { width: 20px; height: 20px; }

/* ---------- 标签 ---------- */
.chip {
  display: inline-block; padding: 5px 13px; border-radius: var(--radius-full);
  background: var(--green-50); color: var(--green-700);
  font-size: 13px; font-weight: 600; border: 1px solid var(--green-100);
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- 页头（内页） ---------- */
.page-hero {
  padding: 148px 0 72px;
  background: linear-gradient(160deg, var(--green-50) 0%, #fff 62%);
  position: relative; overflow: hidden;
}
.page-hero::after {
  content: ""; position: absolute; right: -140px; top: -140px; width: 460px; height: 460px;
  border-radius: 50%; background: radial-gradient(circle, rgba(108, 196, 141, .18), transparent 68%);
}
.page-hero .wrap { position: relative; z-index: 2; }

/* ---------- 页脚 ---------- */
.footer { background: var(--green-900); color: rgba(255, 255, 255, .74); padding: 72px 0 32px; }
.footer a { color: rgba(255, 255, 255, .74); transition: color .2s var(--ease); }
.footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.3fr; gap: 48px; margin-bottom: 48px; }
.footer-logo { height: 46px; margin-bottom: 18px; filter: brightness(0) invert(1); opacity: .95; }
.footer h4 { color: #fff; font-size: 15px; font-weight: 700; margin-bottom: 18px; letter-spacing: .5px; }
.footer li { margin-bottom: 11px; font-size: 14.5px; line-height: 1.6; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 26px;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  font-size: 13.5px; color: rgba(255, 255, 255, .5);
}

/* ---------- 浮动咨询按钮 ---------- */
.float-cta {
  position: fixed; right: 24px; bottom: 28px; z-index: 800;
  display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
}
.float-btn {
  width: 58px; height: 58px; border-radius: 50%;
  background: var(--green-600); color: #fff; box-shadow: var(--shadow-xl);
  display: flex; align-items: center; justify-content: center;
  transition: all .25s var(--ease);
}
.float-btn:hover { background: var(--green-700); transform: scale(1.06); }
.float-btn svg { width: 26px; height: 26px; }
.float-panel {
  display: none; background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-xl);
  padding: 22px; width: 300px; border: 1px solid var(--line);
}
.float-panel.open { display: block; animation: popIn .22s var(--ease); }
.float-panel h5 { font-size: 15px; margin-bottom: 4px; color: var(--ink); }
.float-panel p { font-size: 13.5px; color: var(--ink-3); margin-bottom: 16px; }
.float-qr { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); }

@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }

/* ---------- 动画 ----------
   采用「默认可见 + JS 增强」策略：JS 成功加载时才启用入场动画，
   确保任何情况下（JS 失败 / 无 IntersectionObserver）内容都可读。 */
.reveal { opacity: 1; transform: none; }

html.js-anim .reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
html.js-anim .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html.js-anim .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 36px; }
}

@media (max-width: 860px) {
  .nav-links {
    position: fixed; top: 72px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: #fff; padding: 16px 20px 24px;
    border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg);
    transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: all .28s var(--ease); max-height: calc(100vh - 72px); overflow-y: auto;
  }
  .nav-links.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-links a { padding: 13px 16px; border-radius: var(--radius); }
  .nav-burger { display: flex; }
  .nav-cta { display: none; }

  .sec { padding: 68px 0; }
  .sec-sm { padding: 48px 0; }
  .sec-head { margin-bottom: 40px; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .page-hero { padding: 120px 0 52px; }
  .card { padding: 26px; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .float-cta { right: 16px; bottom: 20px; }
  .float-panel { width: min(300px, calc(100vw - 48px)); }
}

@media (max-width: 480px) {
  body { font-size: 15.5px; }
  .wrap, .wrap-narrow { padding: 0 18px; }
  .btn { padding: 12px 24px; font-size: 15px; }
  .btn-lg { padding: 14px 30px; font-size: 16px; }
}
