/* ============================================================
   富晖 IM 官网 · imhome.fhsmarthub.com
   深色科技主题（智能客服线 · 青绿配色）
   ============================================================ */

/* ---------- 设计令牌 ---------- */
:root {
  --cs-bg: #04120E;
  --cs-bg-soft: #071A14;
  --cs-surface: #0A241C;
  --cs-surface-2: #0E2C22;
  --cs-surface-3: #123930;

  --cs-line: rgba(120, 200, 178, 0.16);
  --cs-line-strong: rgba(120, 200, 178, 0.3);

  --cs-text: #E7F7F1;
  --cs-text-dim: #A3C6BA;
  --cs-text-mute: #6B8F84;

  --cs-cyan: #2DD4BF;
  --cs-blue: #34D399;
  --cs-violet: #A3E635;
  --cs-green: #34D399;
  --cs-amber: #FBBF24;
  --cs-red: #F87171;

  --cs-cyan-rgb: 34, 211, 238;
  --cs-blue-rgb: 59, 130, 246;

  --cs-grad: linear-gradient(120deg, #2DD4BF 0%, #34D399 52%, #A3E635 100%);
  --cs-grad-soft: linear-gradient(180deg, rgba(45, 212, 191, .12), rgba(52, 211, 153, .04));

  --cs-radius: 14px;
  --cs-radius-lg: 20px;

  --cs-font-cn: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --cs-font-en: "DM Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --cs-font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  --cs-shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --cs-glow: 0 0 0 1px rgba(var(--cs-cyan-rgb), .28), 0 12px 40px rgba(var(--cs-cyan-rgb), .12);

  --cs-header-h: 72px;
  --cs-container: 1200px;
}

/* ---------- 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
  margin: 0;
  background: var(--cs-bg);
  color: var(--cs-text);
  font-family: var(--cs-font-cn);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; }
a { color: var(--cs-cyan); text-decoration: none; }
a:hover { color: #5EEAD4; }
h1, h2, h3, h4 { margin: 0; color: var(--cs-text); font-weight: 700; letter-spacing: -0.015em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
code { font-family: var(--cs-font-mono); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- 布局 ---------- */
.container {
  width: 100%;
  max-width: var(--cs-container);
  margin: 0 auto;
  padding: 0 24px;
}
.section { padding: 88px 0; position: relative; }
.section--soft { background: linear-gradient(180deg, var(--cs-bg-soft), var(--cs-bg)); }
.section--edge { border-top: 1px solid var(--cs-line); border-bottom: 1px solid var(--cs-line); }

.grid { display: grid; gap: 20px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.section-head { max-width: 760px; margin-bottom: 40px; }
.section-label {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--cs-font-en); font-size: 12px; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--cs-cyan); margin-bottom: 14px;
}
.section-label::before {
  content: ""; width: 22px; height: 1px; background: var(--cs-cyan);
}
.section-title { font-size: clamp(26px, 3vw, 38px); line-height: 1.25; }
.section-sub { margin-top: 14px; color: var(--cs-text-dim); font-size: 16px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 24px; border-radius: 999px;
  font-family: var(--cs-font-cn); font-size: 15px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary {
  background: var(--cs-grad); color: #04140F;
  box-shadow: 0 10px 30px rgba(var(--cs-cyan-rgb), .25);
}
.btn--primary:hover { color: #04140F; box-shadow: 0 14px 38px rgba(var(--cs-cyan-rgb), .38); }
.btn--ghost {
  background: rgba(255, 255, 255, .02);
  border-color: var(--cs-line-strong);
  color: var(--cs-text);
}
.btn--ghost:hover { border-color: var(--cs-cyan); color: var(--cs-cyan); background: rgba(var(--cs-cyan-rgb), .06); }
.btn--sm { height: 38px; padding: 0 18px; font-size: 14px; }
.btn--lg { height: 52px; padding: 0 30px; font-size: 16px; }

/* ---------- 顶部导航 ---------- */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 90;
  height: var(--cs-header-h);
  background: rgba(5, 10, 19, .55);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: background .2s ease, border-color .2s ease;
}
.header--solid {
  background: rgba(5, 10, 19, .92);
  border-bottom-color: var(--cs-line);
}
.header__inner { display: flex; align-items: center; gap: 18px; height: var(--cs-header-h); }

.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--cs-text); }
.logo__mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--cs-grad);
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 22px rgba(var(--cs-cyan-rgb), .28);
}
.logo__mark svg { width: 22px; height: 22px; fill: #06131F; }
.logo__text { display: flex; flex-direction: column; line-height: 1.12; }
.logo__name { font-size: 17px; font-weight: 700; letter-spacing: .01em; }
.logo__sub { font-size: 10.5px; letter-spacing: .14em; color: var(--cs-text-mute); font-family: var(--cs-font-en); }

.nav { display: flex; align-items: center; gap: 4px; margin-left: 26px; }
.nav a {
  color: var(--cs-text-dim); font-size: 14.5px; padding: 8px 12px; border-radius: 999px;
  transition: color .16s ease, background .16s ease;
}
.nav a:hover { color: var(--cs-text); background: rgba(255, 255, 255, .05); }
.nav a.is-active { color: var(--cs-cyan); background: rgba(var(--cs-cyan-rgb), .1); }

.header__actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.menu-btn {
  display: none; width: 40px; height: 40px; border-radius: 10px;
  background: transparent; border: 1px solid var(--cs-line); cursor: pointer;
  align-items: center; justify-content: center; color: var(--cs-text);
}
.menu-btn svg { width: 18px; height: 18px; }

.mobile-nav {
  display: none;
  position: fixed; inset: var(--cs-header-h) 0 auto 0; z-index: 89;
  background: rgba(5, 10, 19, .98);
  border-bottom: 1px solid var(--cs-line);
  padding: 12px 24px 20px;
}
.mobile-nav.is-open { display: block; }
.mobile-nav a {
  display: block; padding: 12px 4px; color: var(--cs-text-dim); font-size: 15px;
  border-bottom: 1px solid var(--cs-line);
}
.mobile-nav a.is-active { color: var(--cs-cyan); }
.mobile-nav .btn { margin-top: 16px; width: 100%; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: calc(var(--cs-header-h) + 76px) 0 76px;
  overflow: hidden;
  background:
    radial-gradient(900px 460px at 78% -10%, rgba(var(--cs-cyan-rgb), .18), transparent 60%),
    radial-gradient(760px 420px at 12% 8%, rgba(var(--cs-blue-rgb), .16), transparent 62%),
    linear-gradient(180deg, #051612 0%, var(--cs-bg) 78%);
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(120, 200, 178, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 200, 178, .07) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(70% 60% at 50% 20%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(70% 60% at 50% 20%, #000 30%, transparent 100%);
  pointer-events: none;
}
.hero__inner { position: relative; z-index: 1; max-width: 840px; }
.hero__badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid rgba(var(--cs-cyan-rgb), .35);
  background: rgba(var(--cs-cyan-rgb), .08);
  color: var(--cs-cyan); font-size: 13px; font-weight: 500;
}
.hero__badge .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cs-cyan); box-shadow: 0 0 10px var(--cs-cyan); }
.hero h1 {
  margin: 22px 0 20px;
  font-size: clamp(34px, 4.6vw, 60px);
  line-height: 1.14; letter-spacing: -0.03em;
}
.hero h1 em {
  font-style: normal;
  background: var(--cs-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero__desc { color: var(--cs-text-dim); font-size: 17px; max-width: 720px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.hero__meta {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px;
}
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--cs-line);
  color: var(--cs-text-dim); font-size: 13px;
}
.chip b { color: var(--cs-text); font-weight: 600; }

/* ---------- 卡片 ---------- */
.card {
  position: relative;
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.012));
  border: 1px solid var(--cs-line);
  border-radius: var(--cs-radius);
  padding: 26px;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.card:hover { border-color: rgba(var(--cs-cyan-rgb), .4); transform: translateY(-3px); box-shadow: var(--cs-shadow); }
.card__icon {
  width: 44px; height: 44px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(var(--cs-cyan-rgb), .1);
  border: 1px solid rgba(var(--cs-cyan-rgb), .22);
  color: var(--cs-cyan); margin-bottom: 16px;
}
.card__icon svg { width: 22px; height: 22px; }
.card h3 { font-size: 18px; margin-bottom: 10px; }
.card p { color: var(--cs-text-dim); font-size: 14.5px; }
.card__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tag {
  font-size: 12px; color: var(--cs-text-mute);
  border: 1px solid var(--cs-line); border-radius: 999px; padding: 3px 10px;
}

/* 数字索引卡 */
.num-card { position: relative; padding-top: 32px; }
.num-card__num {
  position: absolute; top: 20px; right: 22px;
  font-family: var(--cs-font-en); font-size: 13px; font-weight: 600; letter-spacing: .1em;
  color: rgba(120, 200, 178, .5);
}

/* ---------- 场景 ---------- */
.scene {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--cs-surface);
  border: 1px solid var(--cs-line);
  border-radius: var(--cs-radius);
  padding: 26px;
}
.scene__kicker { font-family: var(--cs-font-en); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--cs-cyan); }
.scene h3 { font-size: 18px; }
.scene p { color: var(--cs-text-dim); font-size: 14.5px; }
.scene ul { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.scene li { position: relative; padding-left: 18px; color: var(--cs-text-dim); font-size: 14px; }
.scene li::before { content: ""; position: absolute; left: 0; top: 9px; width: 6px; height: 6px; border-radius: 2px; background: var(--cs-cyan); opacity: .8; }

/* ---------- 表格 ---------- */
.table-wrap {
  border: 1px solid var(--cs-line); border-radius: var(--cs-radius);
  overflow: auto; background: rgba(255,255,255,.02);
}
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
thead th {
  text-align: left; padding: 12px 16px; white-space: nowrap;
  background: rgba(255,255,255,.04); color: var(--cs-text);
  font-weight: 600; font-size: 13px; letter-spacing: .02em;
  border-bottom: 1px solid var(--cs-line);
}
tbody td { padding: 12px 16px; border-bottom: 1px solid var(--cs-line); color: var(--cs-text-dim); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody td code, p code, li code {
  padding: 1px 6px; border-radius: 5px; font-size: .88em;
  background: rgba(var(--cs-cyan-rgb), .1); color: #6EE7B7;
  border: 1px solid rgba(var(--cs-cyan-rgb), .18);
}

/* ---------- CTA 区 ---------- */
.cta-band {
  position: relative; overflow: hidden;
  border: 1px solid var(--cs-line-strong);
  border-radius: var(--cs-radius-lg);
  background:
    radial-gradient(600px 260px at 80% 0%, rgba(var(--cs-cyan-rgb), .16), transparent 60%),
    linear-gradient(180deg, var(--cs-surface-2), var(--cs-surface));
  padding: 46px;
  display: flex; align-items: center; justify-content: space-between; gap: 28px;
  flex-wrap: wrap;
}
.cta-band h2 { font-size: clamp(24px, 2.6vw, 32px); }
.cta-band p { color: var(--cs-text-dim); margin-top: 10px; }
.cta-band__actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--cs-line);
  background: #030D0A;
  padding: 56px 0 28px;
}
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 36px; }
.footer__brand p { color: var(--cs-text-mute); font-size: 13.5px; margin-top: 14px; max-width: 320px; }
.footer h4 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--cs-text-mute); margin-bottom: 14px; font-weight: 600; }
.footer__links { display: flex; flex-direction: column; gap: 10px; }
.footer__links a { color: var(--cs-text-dim); font-size: 14px; }
.footer__links a:hover { color: var(--cs-cyan); }
.footer__bottom {
  margin-top: 42px; padding-top: 20px; border-top: 1px solid var(--cs-line);
  display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: space-between;
  color: var(--cs-text-mute); font-size: 12.5px;
}
.footer__bottom a { color: var(--cs-text-mute); }
.footer__bottom a:hover { color: var(--cs-cyan); }

/* ---------- 内页通用 ---------- */
.page-head {
  padding: calc(var(--cs-header-h) + 64px) 0 48px;
  background:
    radial-gradient(760px 360px at 82% -20%, rgba(var(--cs-cyan-rgb), .14), transparent 62%),
    linear-gradient(180deg, #051612, var(--cs-bg));
  border-bottom: 1px solid var(--cs-line);
}
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--cs-text-mute); font-size: 13px; margin-bottom: 18px; }
.crumbs a { color: var(--cs-text-mute); }
.crumbs a:hover { color: var(--cs-cyan); }
.crumbs .sep { opacity: .5; }
.page-head h1 { font-size: clamp(30px, 3.8vw, 46px); line-height: 1.18; }
.page-head__desc { margin-top: 16px; color: var(--cs-text-dim); font-size: 16.5px; max-width: 780px; }
.page-head__meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

/* ---------- 文档 ---------- */
.docs-layout { display: flex; align-items: flex-start; gap: 40px; padding: 40px 0 84px; }
.docs-side {
  position: sticky; top: calc(var(--cs-header-h) + 16px);
  width: 250px; flex: 0 0 250px;
  border: 1px solid var(--cs-line); border-radius: var(--cs-radius);
  background: var(--cs-surface); padding: 20px;
}
.docs-side__title { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--cs-text-mute); margin-bottom: 14px; }
.docs-side a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--cs-text-dim); font-size: 14px; }
.docs-side a:hover { background: rgba(255,255,255,.04); color: var(--cs-text); }
.docs-side a.is-active { background: rgba(var(--cs-cyan-rgb), .1); color: var(--cs-cyan); }
.docs-side__group { margin-bottom: 18px; }
.docs-main { flex: 1 1 auto; min-width: 0; }
.docs-main h2 { font-size: 26px; margin: 44px 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--cs-line); }
.docs-main h2:first-child { margin-top: 0; }
.docs-main h3 { font-size: 18px; margin: 26px 0 10px; }
.docs-main p { color: var(--cs-text-dim); margin: 10px 0; }
.docs-main ul, .docs-main ol { margin: 12px 0 12px 4px; display: flex; flex-direction: column; gap: 8px; }
.docs-main ul li { position: relative; padding-left: 20px; color: var(--cs-text-dim); }
.docs-main ul li::before { content: ""; position: absolute; left: 2px; top: 10px; width: 6px; height: 6px; border-radius: 2px; background: var(--cs-cyan); opacity: .75; }
.docs-main ol { counter-reset: n; }
.docs-main ol li { counter-increment: n; position: relative; padding-left: 26px; color: var(--cs-text-dim); }
.docs-main ol li::before { content: counter(n, decimal-leading-zero); position: absolute; left: 0; top: 0; font-family: var(--cs-font-en); font-size: 12px; color: var(--cs-cyan); }
.docs-main .table-wrap { margin: 18px 0 24px; }
.docs-main .callout {
  border: 1px solid rgba(var(--cs-cyan-rgb), .25);
  border-left: 3px solid var(--cs-cyan);
  background: rgba(var(--cs-cyan-rgb), .06);
  border-radius: 10px; padding: 16px 18px; margin: 18px 0;
}
.docs-main .callout strong { color: var(--cs-cyan); display: block; margin-bottom: 6px; }
.docs-main .callout p { margin: 0; font-size: 14.5px; }

.code {
  margin: 18px 0 24px; border: 1px solid var(--cs-line); border-radius: 12px;
  background: #06150F; overflow: hidden;
}
.code__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 14px; border-bottom: 1px solid var(--cs-line);
  font-family: var(--cs-font-en); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--cs-text-mute);
}
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-family: var(--cs-font-mono); font-size: 13px; line-height: 1.7; color: #D3E9E2; }
.code .copy {
  background: rgba(255,255,255,.05); border: 1px solid var(--cs-line); border-radius: 6px;
  color: var(--cs-text-mute); font-size: 11px; padding: 3px 9px; cursor: pointer;
  font-family: var(--cs-font-en); letter-spacing: .06em;
}
.code .copy:hover { color: var(--cs-cyan); border-color: rgba(var(--cs-cyan-rgb), .4); }

.doc-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-top: 28px; }
.doc-card {
  display: block; padding: 22px; border-radius: var(--cs-radius);
  border: 1px solid var(--cs-line); background: var(--cs-surface);
  transition: border-color .2s ease, transform .2s ease;
}
.doc-card:hover { border-color: rgba(var(--cs-cyan-rgb), .4); transform: translateY(-2px); }
.doc-card span { font-family: var(--cs-font-en); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--cs-cyan); }
.doc-card h3 { margin: 10px 0 8px; font-size: 17px; color: var(--cs-text); }
.doc-card p { color: var(--cs-text-dim); font-size: 14px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .nav, .header__actions .btn { display: none; }
  .menu-btn { display: inline-flex; }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .docs-layout { flex-direction: column; gap: 24px; padding-top: 28px; }
  .docs-side { position: static; width: 100%; flex: none; }
  .doc-cards { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .section { padding: 62px 0; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .hero { padding: calc(var(--cs-header-h) + 52px) 0 56px; }
  .hero h1 { font-size: clamp(30px, 8vw, 40px); }
  .cta-band { padding: 28px; }
  .footer__grid { grid-template-columns: 1fr; gap: 26px; }
  .hero__actions .btn { width: 100%; }
  .page-head { padding-top: calc(var(--cs-header-h) + 44px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
