/* ==========================================================================
   kf.eycit.com · 增强组件层 v6
   --------------------------------------------------------------------------
   依赖顺序：style.css → components.css
   本文件只放「新增能力」，不覆盖主样式，全部走 .kf- 前缀或独立命名避免冲突。

   ⚠️ 关键韧性设计：若 main.js 因任何原因未执行，.reveal 元素必须仍然可见。
   由 <html class="no-js"> + head 内联脚本切换为 .js 实现。
   ========================================================================== */

/* ---------- no-js 降级：没有 JS 时所有入场动画元素直接可见 ---------- */
.no-js .reveal,
.no-js .reveal-x { opacity: 1 !important; transform: none !important; transition: none !important; }
/* 没有 JS 时隐藏纯装饰性交互件，避免点了没反应 */
.no-js #fab,
.no-js #fabPanel,
.no-js #backTop,
.no-js #readProgress { display: none !important; }

/* ==========================================================================
   1. 顶部阅读进度条
   ========================================================================== */
#readProgress {
  position: fixed; top: 0; left: 0; right: 0; height: 2.5px;
  background: transparent; z-index: 70; pointer-events: none;
}
#readProgress i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #1a6fd4, #0b8fe8 45%, #22d3ff);
  box-shadow: 0 0 10px rgba(26, 111, 212, .45);
  transition: width 90ms linear;
}

/* ==========================================================================
   2. Header 滚动态
   ========================================================================== */
.topbar { transition: box-shadow .3s var(--ease-out), background-color .3s var(--ease-out); }
.topbar.scrolled { box-shadow: 0 2px 14px rgba(26, 111, 212, .10); }

/* 导航：次级页面（服务区域、常见问题）收纳到 footer，主导航控制在 8 项以内
   防止 1080px 容器下换行顶破 62px 高的 header */
.nav { flex-wrap: nowrap; }
.nav a { white-space: nowrap; }
@media (max-width: 1080px) {
  .nav a { padding: 8px 9px; font-size: 14px; }
  .nav-cta { padding: 8px 12px !important; }
}
@media (max-width: 960px) {
  .nav a { padding: 8px 7px; font-size: 13.5px; }
  .nav-cta { display: none; }   /* 窄屏优先保证主导航完整可见 */
}

/* ==========================================================================
   3. 悬浮客服面板（转化核心）
   ========================================================================== */
#fab {
  position: fixed; right: 20px; bottom: 22px; z-index: 65;
  width: 56px; height: 56px; border: 0; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #1a6fd4 0%, #0b8fe8 55%, #16b8e8 100%);
  box-shadow: 0 4px 16px rgba(26, 111, 212, .35), 0 8px 28px rgba(26, 111, 212, .18);
  transition: transform .28s var(--ease-out), box-shadow .28s var(--ease-out);
}
#fab:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 6px 22px rgba(26, 111, 212, .45); }
#fab:active { transform: translateY(-1px) scale(.98); }
#fab svg { width: 25px; height: 25px; transition: transform .3s var(--ease-out); }
#fab.active svg { transform: rotate(90deg); }
#fab:focus-visible { outline: 3px solid rgba(26, 111, 212, .45); outline-offset: 3px; }

/* 主按钮上的未读提示点 */
#fab::after {
  content: ""; position: absolute; top: 3px; right: 3px;
  width: 11px; height: 11px; border-radius: 50%;
  background: #22c55e; border: 2px solid #fff;
}
#fab.offline-mode::after { background: #f59e0b; }

#fabPanel {
  position: fixed; right: 20px; bottom: 88px; z-index: 66;
  width: 296px; max-width: calc(100vw - 40px);
  background: #fff; border-radius: 16px; padding: 18px;
  box-shadow: 0 10px 40px rgba(15, 40, 80, .18), 0 2px 8px rgba(15, 40, 80, .08);
  border: 1px solid var(--line);
  opacity: 0; visibility: hidden;
  transform: translateY(14px) scale(.96); transform-origin: bottom right;
  transition: opacity .26s var(--ease-out), transform .26s var(--ease-out), visibility .26s;
}
#fabPanel.show { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }

.fab-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.fab-avatar {
  width: 42px; height: 42px; flex: 0 0 42px; border-radius: 11px;
  background: linear-gradient(135deg, #1a6fd4, #22d3ff);
  color: #fff; font-weight: 800; font-size: 17px;
  display: flex; align-items: center; justify-content: center;
}
.fab-head-txt { flex: 1; min-width: 0; }
.fab-head-txt b { display: block; font-size: 15px; color: var(--ink); line-height: 1.35; }
.fab-status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--ink-3); line-height: 1.5;
}
.fab-status i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); flex: 0 0 7px;
}
.fab-status i.online { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .16); }
.fab-status i.offline { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .16); }

.fab-call {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 12px 14px; margin-bottom: 9px; border-radius: 11px;
  background: linear-gradient(135deg, #1a6fd4, #0b8fe8);
  color: #fff; font-size: 16px; font-weight: 700; letter-spacing: .01em;
  box-shadow: 0 3px 12px rgba(26, 111, 212, .28);
  transition: transform .22s var(--ease-out), box-shadow .22s var(--ease-out);
}
.fab-call:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 6px 18px rgba(26, 111, 212, .36); }
.fab-call svg { width: 19px; height: 19px; flex: 0 0 19px; }
.fab-call small { display: block; font-size: 11.5px; font-weight: 400; opacity: .85; letter-spacing: 0; }

.fab-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 9px; background: var(--bg-2);
  border: 1px solid var(--line-2); margin-bottom: 7px; min-height: 40px;
}
.fab-row .k { font-size: 12.5px; color: var(--ink-3); flex: 0 0 46px; }
.fab-row .v { flex: 1; font-size: 14px; color: var(--ink); font-family: var(--font-mono); letter-spacing: .01em; }
.fab-row button {
  flex: 0 0 auto; border: 1px solid var(--line); background: #fff; color: var(--primary);
  font-size: 12px; padding: 4px 9px; border-radius: 6px; cursor: pointer;
  font-family: var(--font-body); transition: all .18s var(--ease-out);
}
.fab-row button:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.fab-row button.copied { background: #10b981; color: #fff; border-color: #10b981; }

.fab-link {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; padding: 10px; border-radius: 9px; margin-top: 4px;
  border: 1px solid var(--line); color: var(--ink-2); font-size: 13.5px;
  background: #fff; transition: all .2s var(--ease-out);
}
.fab-link:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-ll); }
.fab-link svg { width: 15px; height: 15px; }

.fab-foot {
  margin-top: 12px; padding-top: 11px; border-top: 1px dashed var(--line);
  font-size: 12px; color: var(--ink-3); text-align: center; line-height: 1.6;
}

/* 二维码弹层 */
.fab-qr {
  display: none; margin: 10px 0 4px; padding: 12px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 11px;
  text-align: center;
}
.fab-qr.show { display: block; }
.fab-qr img { width: 158px; height: 158px; margin: 0 auto 7px; border-radius: 8px; background: #fff; }
.fab-qr p { font-size: 12.5px; color: var(--ink-3); margin: 0; }

@media (max-width: 720px) {
  #fab { right: 14px; bottom: 78px; width: 50px; height: 50px; }
  #fab svg { width: 22px; height: 22px; }
  #fabPanel { right: 14px; bottom: 136px; width: 272px; padding: 16px; }
}

/* ==========================================================================
   4. 回到顶部
   ========================================================================== */
#backTop {
  position: fixed; right: 20px; bottom: 88px; z-index: 64;
  width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%;
  background: #fff; color: var(--ink-2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 10px rgba(26, 111, 212, .10);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .26s var(--ease-out), transform .26s var(--ease-out), visibility .26s;
}
#backTop.show { opacity: 1; visibility: visible; transform: translateY(0); }
#backTop:hover { color: var(--primary); border-color: var(--primary); box-shadow: 0 4px 16px rgba(26, 111, 212, .2); }
#backTop svg { width: 18px; height: 18px; }
@media (max-width: 720px) { #backTop { display: none; } }

/* ==========================================================================
   5. 面包屑导航（SEO + 用户体验）
   ========================================================================== */
.crumb {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  font-size: 13px; color: var(--ink-3); margin: 0 0 14px; padding: 0;
  list-style: none;
}
.crumb li { display: inline-flex; align-items: center; gap: 6px; }
.crumb li + li::before {
  content: ""; width: 4px; height: 4px; border-radius: 50%;
  background: var(--ink-4); margin-right: 2px;
}
.crumb a { color: var(--ink-3); }
.crumb a:hover { color: var(--primary); }
.crumb li[aria-current] { color: var(--ink-2); font-weight: 500; }

/* ==========================================================================
   6. 通用提示条 / 强调卡
   ========================================================================== */
.kf-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: var(--primary-l); color: var(--primary-d); border: 1px solid #cfe0fb;
}
.kf-badge.ok { background: #e8fbf3; color: #047857; border-color: #b8ecd6; }
.kf-badge.warn { background: #fff7ed; color: var(--warn-ink); border-color: var(--warn-line); }

/* ==========================================================================
   7. 智能故障诊断工具（diagnose.html）
   ========================================================================== */
.diag-wrap { max-width: 900px; }
.diag-step {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-l);
  padding: 22px; margin-bottom: 16px; box-shadow: var(--shadow-card);
}
.diag-step-h {
  display: flex; align-items: center; gap: 11px; margin-bottom: 6px;
}
.diag-step-no {
  width: 27px; height: 27px; flex: 0 0 27px; border-radius: 50%;
  background: linear-gradient(135deg, #1a6fd4, #22d3ff); color: #fff;
  font-size: 13.5px; font-weight: 700; font-family: var(--font-mono);
  display: flex; align-items: center; justify-content: center;
}
.diag-step-h h3 { font-size: 17px; font-weight: 700; color: var(--ink); margin: 0; }
.diag-step-hint { font-size: 13.5px; color: var(--ink-3); margin: 0 0 14px 38px; }

.diag-opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 10px; }

.diag-opt {
  position: relative; display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 11px;
  background: #fff; cursor: pointer; text-align: left;
  font-family: var(--font-body); font-size: 14.5px; color: var(--ink-2); line-height: 1.5;
  transition: all .2s var(--ease-out);
}
.diag-opt:hover { border-color: #9dc2f5; background: var(--primary-ll); transform: translateY(-1px); }
.diag-opt.on {
  border-color: var(--primary); background: var(--primary-l);
  color: var(--primary-d); font-weight: 600;
  box-shadow: 0 0 0 3px rgba(26, 111, 212, .10);
}
.diag-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.diag-opt .ico { flex: 0 0 19px; width: 19px; height: 19px; color: var(--primary); margin-top: 1px; }
.diag-opt.on .ico { color: var(--primary-d); }
.diag-opt small { display: block; font-size: 12px; font-weight: 400; color: var(--ink-3); margin-top: 2px; }
.diag-opt.on small { color: #3b6fa8; }
.diag-opt:focus-within { outline: 3px solid rgba(26, 111, 212, .3); outline-offset: 2px; }

.diag-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 18px 0 6px; }
.diag-bar .btn { cursor: pointer; font-family: var(--font-body); }

.diag-result {
  margin-top: 20px; border-radius: var(--r-l); overflow: hidden;
  border: 1px solid var(--line); background: #fff;
  box-shadow: var(--shadow-card-h); animation: diagIn .42s var(--ease-out);
}
@keyframes diagIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .diag-result { animation: none; } }

.diag-res-top {
  padding: 20px 22px; color: #fff;
  background: linear-gradient(135deg, #1a6fd4 0%, #0b8fe8 60%, #16b8e8 100%);
}
.diag-res-top.remote { background: linear-gradient(135deg, #0d9488 0%, #14b8a6 60%, #22c9a8 100%); }
.diag-res-top.onsite { background: linear-gradient(135deg, #b45309 0%, #d97706 60%, #f59e0b 100%); }
.diag-res-mode {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600;
  padding: 4px 11px; border-radius: 999px; margin-bottom: 9px;
  background: rgba(255, 255, 255, .2); border: 1px solid rgba(255, 255, 255, .3);
}
.diag-res-top h3 { font-size: 21px; font-weight: 800; color: #fff; margin: 0 0 6px; line-height: 1.35; }
.diag-res-top p { font-size: 14.5px; color: rgba(255, 255, 255, .92); margin: 0; line-height: 1.65; }

.diag-res-price {
  display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 13px; border-top: 1px solid rgba(255, 255, 255, .25);
}
.diag-res-price .lbl { font-size: 12.5px; color: rgba(255, 255, 255, .82); }
.diag-price-num {
  font-family: var(--font-mono); font-size: 30px; font-weight: 700; color: #fff; line-height: 1;
  letter-spacing: -.02em;
}
.diag-price-num span { font-size: 15px; font-weight: 500; opacity: .85; margin-left: 2px; }
.diag-res-price .note { font-size: 12.5px; color: rgba(255, 255, 255, .82); }

.diag-res-body { padding: 20px 22px; }
.diag-res-body h4 {
  font-size: 14.5px; font-weight: 700; color: var(--ink); margin: 0 0 10px;
  display: flex; align-items: center; gap: 7px;
}
.diag-res-body h4 svg { width: 16px; height: 16px; color: var(--primary); }
.diag-res-body h4 + ul { margin-bottom: 18px; }
.diag-res-body ul { list-style: none; padding: 0; }
.diag-res-body li {
  position: relative; padding-left: 22px; margin-bottom: 7px;
  font-size: 14.5px; color: var(--ink-2); line-height: 1.65;
}
.diag-res-body li::before {
  content: ""; position: absolute; left: 4px; top: 9px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--primary);
}
.diag-file-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; border-radius: 10px; background: var(--warn-bg);
  border: 1px solid var(--warn-line); font-size: 13.5px; color: var(--warn-ink);
  margin-bottom: 16px;
}
.diag-file-row svg { width: 17px; height: 17px; flex: 0 0 17px; }

.diag-cta-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.diag-cta-row .btn { cursor: pointer; font-family: var(--font-body); }

@media (max-width: 560px) {
  .diag-step { padding: 17px; }
  .diag-opts { grid-template-columns: 1fr; }
  .diag-step-hint { margin-left: 0; }
  .diag-res-top { padding: 17px; }
  .diag-res-top h3 { font-size: 18.5px; }
  .diag-price-num { font-size: 26px; }
  .diag-res-body { padding: 17px; }
}

/* ==========================================================================
   8. 工具 grid 首页入口卡
   ========================================================================== */
.kf-tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.kf-tool {
  display: block; padding: 20px; border-radius: var(--r-l); background: #fff;
  border: 1px solid var(--line); box-shadow: var(--shadow-card);
  transition: transform .24s var(--ease-out), box-shadow .24s var(--ease-out), border-color .24s;
}
.kf-tool:hover { transform: translateY(-3px); box-shadow: var(--shadow-card-h); border-color: #9dc2f5; color: inherit; }
.kf-tool .ico {
  width: 40px; height: 40px; border-radius: 11px; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: center; color: #fff;
  background: linear-gradient(135deg, #1a6fd4, #22d3ff);
}
.kf-tool .ico.g2 { background: linear-gradient(135deg, #0d9488, #2dd4bf); }
.kf-tool .ico.g3 { background: linear-gradient(135deg, #9333ea, #c084fc); }
.kf-tool .ico svg { width: 21px; height: 21px; }
.kf-tool h3 { font-size: 16px; font-weight: 700; color: var(--ink); margin: 0 0 6px; }
.kf-tool p { font-size: 13.5px; color: var(--ink-3); margin: 0; line-height: 1.6; }

@media print {
  #fab, #fabPanel, #backTop, #readProgress, .mbar, .topbar { display: none !important; }
}
