/* ============================================================
   FHAI 风火 · 落地页样式
   设计语言：纸感底色 + 朱砂印章红 + 衬线标题（中式编辑风）
   颜色与圆角全部走 CSS 变量，改品牌色只改 :root 即可
   ============================================================ */

/* ---------- 基础重置 ---------- */
html {
  /* 吸顶导航高度补偿，锚点跳转不会被页头遮住 */
  scroll-behavior: smooth;
}
/* hidden 属性必须能压住组件自带的 display，否则 logo 与印章会同时出现 */
[hidden] {
  display: none !important;
}
.anchor-target {
  display: block;
  position: relative;
  top: -84px;
  visibility: hidden;
}

/* ---------- 设计令牌 ---------- */
:root {
  --bg:            #f7f7f4;
  --surface:       #ffffff;
  --soft:          #f1f0eb;
  --hover:         #faf9f5;
  --text:          #141412;
  --text-2:        #595854;
  --text-3:        #8c8a83;
  --border:        #e4e3de;
  --border-strong: #cfcdc8;

  --primary:       #cc291f;   /* 朱砂红，主品牌色 */
  --primary-hover: #b32219;
  --on-primary:    #ffffff;
  --primary-tint:  #fbecea;

  --success:       #2f7a55;
  --success-tint:  #eaf3ee;
  --warning:       #9a6200;
  --warning-tint:  #faf4e8;
  --danger:        #911f43;

  --inverse:       #141412;
  --on-inverse:    #f7f7f4;
  --footer-bg:     #141412;
  --footer-text:   #eceae4;
  --footer-text-2: #adaaa2;
  --footer-border: #2c2b27;

  --radius-xs: 5px;
  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(20,20,18,.05), 0 6px 16px -10px rgba(20,20,18,.18);
  --shadow-lg: 0 1px 2px rgba(20,20,18,.05), 0 14px 36px -18px rgba(20,20,18,.28);

  --font-sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei",
               "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Noto Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  --container: 1180px;
  --header-h: 68px;
}

/* ---------- 深色模式 ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:            #100f0d;
    --surface:       #1a1917;
    --soft:          #232220;
    --hover:         #1f1e1b;
    --text:          #eceae4;
    --text-2:        #adaaa2;
    --text-3:        #77746d;
    --border:        #2c2b27;
    --border-strong: #3e3d39;

    --primary:       #e0503c;
    --primary-hover: #ef6350;
    --on-primary:    #ffffff;
    --primary-tint:  #2f1f1b;

    --success:       #63b98f;
    --success-tint:  #18261f;
    --warning:       #e5a93b;
    --warning-tint:  #2b2416;
    --danger:        #e8849c;

    --inverse:       #eceae4;
    --on-inverse:    #141412;
    --footer-bg:     #0a0908;
    --footer-text:   #eceae4;
    --footer-text-2: #8b8880;
    --footer-border: #2c2b27;

    --shadow-sm: 0 1px 2px rgba(0,0,0,.4), 0 6px 16px -10px rgba(0,0,0,.6);
    --shadow-lg: 0 1px 2px rgba(0,0,0,.4), 0 14px 36px -18px rgba(0,0,0,.7);
  }
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 600; letter-spacing: -.01em; }
h1 { font-family: var(--font-display); font-size: clamp(2.1rem, 5vw, 3.35rem); font-weight: 700; letter-spacing: .01em; }
h2 { font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2.05rem); font-weight: 700; }
h3 { font-size: 1.02rem; }
p  { margin: 0; }

a { color: inherit; text-decoration: none; }

code {
  font-family: var(--font-mono);
  font-size: .88em;
  background: var(--soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: .1em .38em;
}

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

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 820px; }

/* ---------- 顶部提示条 ---------- */
.topbar {
  background: var(--inverse);
  color: var(--on-inverse);
  font-size: 12.5px;
  letter-spacing: .02em;
}
.topbar-inner { display: flex; align-items: center; gap: 9px; height: 34px; }
.topbar .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--primary); flex: none;
  box-shadow: 0 0 0 3px rgba(204,41,31,.22);
}

/* ---------- 页头 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.site-header.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 6px 20px -18px rgba(20,20,18,.5);
}
.header-inner {
  display: flex; align-items: center; gap: 26px;
  height: var(--header-h);
}

/* 品牌 */
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-logo { display: grid; place-items: center; flex: none; }
.brand-logo img { height: 34px; width: auto; border-radius: var(--radius-sm); }
.brand-seal {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--on-primary);
  font-family: var(--font-display);
  font-size: 14px; font-weight: 700;
  letter-spacing: .06em;
  text-indent: .06em;
  box-shadow: var(--shadow-sm);
}
.brand-text { display: flex; align-items: baseline; gap: 7px; }
.brand-text strong { font-size: 17px; font-weight: 700; letter-spacing: .04em; }
.brand-text em {
  font-style: normal; font-family: var(--font-display);
  font-size: 14px; color: var(--text-3); letter-spacing: .18em;
}

/* 导航 */
.nav { display: flex; align-items: center; gap: 22px; margin-left: 8px; }
.nav a {
  font-size: 14px; color: var(--text-2);
  padding: 6px 0; position: relative;
  transition: color .16s;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0;
  height: 1.5px; background: var(--primary);
  transition: right .22s ease;
}
.nav a:hover { color: var(--text); }
.nav a:hover::after { right: 0; }

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

/* 移动端菜单按钮 */
.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 4px;
  width: 38px; height: 38px; padding: 0 9px;
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer;
}
.nav-toggle span {
  display: block; height: 1.6px; background: var(--text);
  border-radius: 2px; transition: transform .2s, opacity .2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(5.6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-5.6px) rotate(-45deg); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; font-family: inherit;
  border: 1px solid transparent; cursor: pointer;
  transition: background .16s, color .16s, border-color .16s, transform .1s;
  white-space: nowrap;
}
.btn:active { transform: translateY(.5px); }
.btn-lg { height: 46px; padding: 0 24px; font-size: 15px; border-radius: var(--radius); }

.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-hover); }

.btn-outline { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-outline:hover { background: var(--soft); border-color: var(--text-3); }

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--soft); color: var(--text); }

.btn-light { background: var(--on-inverse); color: var(--inverse); }
.btn-light:hover { background: #fff; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* ---------- 首屏 ---------- */
.hero { padding: clamp(44px, 7vw, 84px) 0 clamp(40px, 6vw, 70px); position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto -10%; height: 520px;
  background: radial-gradient(60% 60% at 22% 0%, rgba(204,41,31,.09), transparent 70%),
              radial-gradient(50% 50% at 85% 10%, rgba(138,90,0,.07), transparent 70%);
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid; grid-template-columns: 1.05fr .95fr;
  gap: clamp(28px, 5vw, 64px); align-items: center;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600; letter-spacing: .1em;
  color: var(--primary); text-transform: uppercase;
  margin-bottom: 16px;
}
.eyebrow::before {
  content: ""; width: 18px; height: 1.5px; background: var(--primary); flex: none;
}

.hero h1 { margin-bottom: 18px; }
.lede { font-size: 16px; color: var(--text-2); max-width: 34em; line-height: 1.75; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.trust {
  display: flex; flex-wrap: wrap; gap: 8px 20px;
  list-style: none; margin: 26px 0 0; padding: 0;
  font-size: 13px; color: var(--text-3);
}
.trust li { display: flex; align-items: center; gap: 6px; }
.trust li::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--success); flex: none;
}

/* 代码卡片 */
.code-card { overflow: hidden; box-shadow: var(--shadow-lg); }
.code-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  background: var(--soft);
}
.code-tabs { display: flex; gap: 2px; }
.code-tab {
  height: 28px; padding: 0 11px; border: 0; border-radius: var(--radius-xs);
  background: transparent; color: var(--text-3);
  font-family: var(--font-mono); font-size: 12px; cursor: pointer;
  transition: background .15s, color .15s;
}
.code-tab:hover { color: var(--text); }
.code-tab.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.copy-btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 28px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: var(--radius-xs);
  background: var(--surface); color: var(--text-2);
  font-family: inherit; font-size: 12px; cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.copy-btn:hover { color: var(--text); border-color: var(--border-strong); }
.copy-btn.is-done { color: var(--success); border-color: var(--success); background: var(--success-tint); }
.copy-btn-sm { height: 24px; padding: 0 8px; font-size: 11.5px; }

.code-body {
  margin: 0; padding: 16px 18px;
  min-height: 208px;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.85;
  color: var(--text-2);
  overflow-x: auto;
  white-space: pre;
  tab-size: 2;
}
.code-body .k { color: var(--primary); }
.code-body .s { color: var(--success); }
.code-body .c { color: var(--text-3); font-style: italic; }

.code-foot {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 14px; border-top: 1px solid var(--border);
  background: var(--soft); font-size: 12px;
}
.mono-label {
  font-family: var(--font-mono); font-size: 10.5px;
  letter-spacing: .09em; color: var(--text-3); flex: none;
}
.code-foot code {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: transparent; border: 0; padding: 0; color: var(--text);
  font-size: 12px;
}

/* ---------- 区块通用 ---------- */
.section { padding: clamp(52px, 7vw, 88px) 0; }
.section-soft { background: var(--soft); }

.section-head { max-width: 640px; margin-bottom: 38px; }
.section-head h2 { margin-bottom: 12px; }
.section-head p { color: var(--text-2); font-size: 15px; }
.section-head strong { color: var(--primary); font-weight: 600; }

/* ---------- 栅格 ---------- */
.grid { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

/* ---------- 特性卡 ---------- */
.feature { padding: 24px 22px; transition: transform .18s, box-shadow .18s, border-color .18s; }
.feature:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.feature-icon {
  display: grid; place-items: center;
  width: 38px; height: 38px; margin-bottom: 15px;
  border-radius: var(--radius-sm);
  background: var(--primary-tint); color: var(--primary);
}
.feature-icon svg { width: 19px; height: 19px; }
.feature h3 { margin-bottom: 8px; }
.feature p { font-size: 13.5px; color: var(--text-2); line-height: 1.7; }

/* ---------- 筛选 chip ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip {
  height: 32px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--text-2);
  font-family: inherit; font-size: 13px; cursor: pointer;
  transition: all .15s;
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.is-active { background: var(--inverse); border-color: var(--inverse); color: var(--on-inverse); }

/* ---------- 价格表 ---------- */
.table-card { overflow: hidden; }
.table-wrap { overflow-x: auto; }
.price-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.price-table th {
  text-align: left; padding: 13px 16px;
  background: var(--soft); color: var(--text-3);
  font-size: 11.5px; font-weight: 600; letter-spacing: .07em;
  white-space: nowrap; border-bottom: 1px solid var(--border);
}
.price-table td {
  padding: 13px 16px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.price-table tbody tr:last-child td { border-bottom: 0; }
.price-table tbody tr:hover { background: var(--hover); }
.price-table .num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); font-size: 12.5px; }
.price-table .model-name { font-weight: 500; }
.price-table .model-name small { display: block; color: var(--text-3); font-size: 11.5px; font-weight: 400; }
.price-table .vendor-tag {
  display: inline-block; padding: 2px 8px; border-radius: var(--radius-pill);
  background: var(--soft); border: 1px solid var(--border);
  font-size: 11.5px; color: var(--text-2); white-space: nowrap;
}
.price-table .price-now { color: var(--primary); font-weight: 600; }
.price-table .empty { text-align: center; color: var(--text-3); padding: 34px 16px; }
.discount-badge {
  display: inline-block; padding: 2px 7px; border-radius: var(--radius-xs);
  background: var(--primary-tint); color: var(--primary);
  font-size: 11.5px; font-weight: 600; font-family: var(--font-mono);
}
.table-note { padding: 12px 16px; margin: 0; font-size: 12px; color: var(--text-3); background: var(--soft); border-top: 1px solid var(--border); }

/* ---------- 工具接入 ---------- */
.tool-layout { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: start; }
.tool-tabs { display: flex; flex-direction: column; gap: 4px; }
.tool-tab {
  text-align: left; padding: 10px 14px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-2);
  font-family: inherit; font-size: 13.5px; cursor: pointer;
  transition: all .15s;
}
.tool-tab:hover { background: var(--surface); color: var(--text); border-color: var(--border); }
.tool-tab.is-active {
  background: var(--surface); color: var(--text);
  border-color: var(--border); box-shadow: var(--shadow-sm); font-weight: 500;
}
.tool-panel { padding: 22px 24px; min-height: 300px; }
.tool-content h3 { font-size: 15px; margin-bottom: 6px; }
.tool-content > p { color: var(--text-2); font-size: 13.5px; margin-bottom: 16px; }
.tool-fields { display: grid; gap: 10px; margin-bottom: 18px; }
.tool-field {
  display: grid; grid-template-columns: 96px 1fr auto; align-items: center; gap: 10px;
  padding: 9px 12px; background: var(--soft); border-radius: var(--radius-sm);
  font-size: 13px;
}
.tool-field .k { color: var(--text-3); font-size: 12px; }
.tool-field code { background: transparent; border: 0; padding: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-steps { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 13.5px; line-height: 1.85; }
.tool-steps li { margin-bottom: 4px; }

/* ---------- 步骤 ---------- */
.steps { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 0; padding: 0; counter-reset: s; }
.step { padding: 24px 22px; position: relative; }
.step-no {
  font-family: var(--font-display); font-size: 30px; font-weight: 700;
  color: var(--primary); opacity: .28; line-height: 1;
  display: block; margin-bottom: 12px;
}
.step h3 { margin-bottom: 8px; }
.step p { font-size: 13.5px; color: var(--text-2); }
.step a { color: var(--primary); border-bottom: 1px solid color-mix(in srgb, var(--primary) 35%, transparent); }
.step a:hover { border-bottom-color: var(--primary); }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 10px; }
.faq-item { padding: 0 20px; overflow: hidden; }
.faq-item summary {
  list-style: none; cursor: pointer;
  padding: 17px 0; font-size: 14.5px; font-weight: 500;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; flex: none;
  font-family: var(--font-mono); font-size: 17px; color: var(--text-3);
  transition: transform .2s;
}
.faq-item[open] summary::after { content: "−"; color: var(--primary); }
.faq-item p {
  padding: 0 0 18px; margin: 0;
  color: var(--text-2); font-size: 13.5px; line-height: 1.75;
}

/* ---------- 底部 CTA ---------- */
.cta-band { background: var(--inverse); color: var(--on-inverse); padding: clamp(40px, 6vw, 62px) 0; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.cta-inner h2 { font-size: clamp(1.35rem, 2.6vw, 1.85rem); margin-bottom: 8px; }
.cta-inner p { color: rgba(255,255,255,.62); font-size: 14px; }

/* ---------- 页脚 ---------- */
.site-footer { background: var(--footer-bg); color: var(--footer-text); padding: 52px 0 0; }
.footer-grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 32px; padding-bottom: 40px;
}
.footer-brand .brand { margin-bottom: 14px; }
.footer-brand .brand-text strong { color: var(--footer-text); }
.footer-brand .brand-text em { color: var(--footer-text-2); }
.footer-brand p { color: var(--footer-text-2); font-size: 13px; max-width: 26em; line-height: 1.7; }

.footer-col h4 {
  font-size: 12px; font-weight: 600; letter-spacing: .1em;
  color: var(--footer-text-2); text-transform: uppercase;
  margin-bottom: 14px;
}
.footer-col a {
  display: block; font-size: 13.5px; color: var(--footer-text);
  opacity: .78; padding: 4px 0; transition: opacity .15s, color .15s;
}
.footer-col a:hover { opacity: 1; color: var(--primary); }

.footer-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
  padding: 18px 24px; border-top: 1px solid var(--footer-border);
  font-size: 12.5px; color: var(--footer-text-2);
}
.footer-legal { opacity: .8; }

/* ---------- 滚动进入动画 ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-panel { order: 2; }
  .code-body { min-height: 0; }
}

@media (max-width: 860px) {
  .nav { display: none; }
  .nav-toggle { display: flex; }
  .header-actions .btn-ghost { display: none; }

  /* 移动端展开菜单 */
  .nav.is-open {
    display: flex; flex-direction: column; align-items: stretch; gap: 0;
    position: absolute; left: 0; right: 0; top: var(--header-h);
    margin: 0; padding: 8px 24px 18px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
  }
  .nav.is-open a { padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
  .nav.is-open a:last-child { border-bottom: 0; }

  .tool-layout { grid-template-columns: 1fr; }
  .tool-tabs { flex-direction: row; flex-wrap: wrap; }
  .tool-tab { flex: 1 1 auto; text-align: center; }
  .steps { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .container { padding: 0 18px; }
  .grid-3 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .cta-inner { flex-direction: column; align-items: flex-start; }
  .brand-text em { display: none; }
  .tool-field { grid-template-columns: 1fr; gap: 4px; }
  .tool-field .k { font-size: 11px; }
  .price-table th, .price-table td { padding: 11px 12px; }
  .hero-cta .btn { flex: 1 1 100%; }
}

/* ---------- 打印 ---------- */
@media print {
  .topbar, .site-header, .cta-band, .site-footer, .nav-toggle { display: none; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; }
}
