/* =========================================================================
   律所 AI 知识库 · 企业 AI 应用  —  专业可信 SaaS 蓝主题
   参考：浅灰白底 #F4F5F9 + 科技蓝主色 #0A84FF + 蓝紫渐变 + 卡片化布局
   数据驱动、专业、可信 · 全部类名兼容既有 JS 逻辑
   ========================================================================= */
:root {
  /* 品牌色 */
  --brand: #0A84FF;          /* 科技蓝 主色 */
  --brand2: #5856D6;         /* 靛蓝紫 辅色（渐变） */
  --brand-grad: linear-gradient(to right, #0A84FF, #5856D6);
  --brand-grad-soft: linear-gradient(135deg, #0A84FF, #5856D6);
  --danger: #FF3B30;         /* 警示红 */
  --success-bg: #F0FFF4;     /* 成功淡绿底 */
  --success-fg: #1A7F4B;     /* 成功绿字 */

  /* 中性 */
  --bg: #F4F5F9;             /* 页面浅灰白 */
  --card: #FFFFFF;           /* 卡片纯白 */
  --ink: #18181B;            /* 正文深灰 */
  --muted: #71717A;          /* 次级文字 */
  --line: #E6E8EF;           /* 分隔线/边框 */
  --line-soft: #EEF0F5;

  /* 风险分级 */
  --risk-high: #FF3B30;
  --risk-mid: #FF9500;
  --risk-low: #FFCC00;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
  --shadow: 0 8px 24px rgba(10,132,255,0.10);
  --shadow-hover: 0 14px 34px rgba(10,132,255,0.16);
  --font: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
.section, #review, #demo, #features { scroll-margin-top: 84px; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
h1, h2, h3 { margin: 0; }

/* ===================== 顶部提示条 ===================== */
.notice-bar {
  background: linear-gradient(to right, rgba(10,132,255,.08), rgba(88,86,214,.08));
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line-soft);
}

/* ===================== 顶部导航 ===================== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 18px;
  height: 64px; padding: 0 28px;
  background: #FFFFFF;
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--ink); }
.brand .logo {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--brand-grad);
  display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 17px;
  box-shadow: 0 4px 10px rgba(10,132,255,.3);
}
.brand .brand-sub { font-size: 11px; font-weight: 500; color: var(--muted); margin-top: -2px; letter-spacing: .5px; }
.nav { display: flex; gap: 4px; margin-left: 10px; }
.nav a {
  padding: 8px 14px; border-radius: 9px; color: var(--ink); font-weight: 500; font-size: 14px;
  transition: all .2s;
}
.nav a:hover { background: #EEF4FF; color: var(--brand); }
.nav a.active { background: var(--brand-grad); color: #fff; }
.cta-nav { margin-left: auto; }
.status-badge {
  margin-left: 12px; font-size: 12px; padding: 5px 12px; border-radius: 9999px;
  background: #EEF4FF; color: var(--brand); border: 1px solid #D8E6FF; white-space: nowrap;
}
.status-badge.offline { background: #FFF5E9; color: #B26A00; border-color: #FCE3B8; }

/* ===================== 容器 ===================== */
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.page { padding: 28px 0 56px; }

/* ===================== HERO ===================== */
.hero {
  position: relative; overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 64px 48px; margin: 24px 0 28px;
  box-shadow: var(--shadow);
}
.hero::before {
  content: ""; position: absolute; top: -160px; right: -120px;
  width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(10,132,255,.18), transparent 70%);
  pointer-events: none;
}
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero-inner { position: relative; z-index: 1; max-width: 760px; }
.eyebrow {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 2px;
  color: var(--brand); background: #EEF4FF; padding: 5px 12px; border-radius: 9999px; margin-bottom: 18px;
}
.hero-title { font-size: 38px; line-height: 1.25; font-weight: 800; letter-spacing: .5px; }
.grad-text {
  background: var(--brand-grad-soft);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub { margin: 18px 0 28px; color: var(--muted); font-size: 16px; max-width: 640px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

/* ===================== 按钮 ===================== */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: none; cursor: pointer; padding: 13px 24px; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600; font-family: inherit; color: #fff;
  background: var(--brand-grad); transition: all .2s; white-space: nowrap;
  box-shadow: 0 6px 16px rgba(10,132,255,.22);
}
.btn:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 10px 22px rgba(10,132,255,.30); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .6; cursor: not-allowed; filter: none; transform: none; }
.btn-ghost { background: #fff; color: var(--brand); border: 1px solid var(--line); box-shadow: none; }
.btn-ghost:hover { border-color: var(--brand); background: #F7FAFF; }
.btn-sm { padding: 8px 16px; font-size: 14px; }

/* ===================== 数据统计 ===================== */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 8px 0 36px;
}
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 18px; text-align: center; box-shadow: var(--shadow-sm); transition: transform .3s, box-shadow .3s;
}
.stat:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.stat-num { font-size: 34px; font-weight: 800; line-height: 1; }
.stat-num .num { background: var(--brand-grad-soft); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.stat-num .unit { font-size: 15px; font-weight: 700; color: var(--brand); margin-left: 3px; -webkit-text-fill-color: var(--brand); }
.stat-label { margin-top: 10px; color: var(--muted); font-size: 13px; }

/* ===================== 区块通用 ===================== */
.section { margin: 40px 0; }
.divider {
  width: 120px; height: 1px; margin: 0 auto 18px;
  background: linear-gradient(to right, transparent, var(--brand), transparent);
}
.section-title { font-size: 26px; font-weight: 800; text-align: center; }
.section-sub { text-align: center; color: var(--muted); margin: 10px 0 26px; font-size: 15px; }

/* ===================== 能力卡片网格 ===================== */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; transition: transform .3s, box-shadow .3s; position: relative; overflow: hidden;
}
.feature::after {
  content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 0;
  background: var(--brand-grad); transition: width .3s;
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.feature:hover::after { width: 100%; }
.feature .ic {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center;
  font-size: 22px; background: #EEF4FF; color: var(--brand); margin-bottom: 14px;
}
.feature h3 { font-size: 17px; margin-bottom: 6px; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }
/* 能力卡截图占位（替换为真实截图即可，<img> 自适应填充） */
.feature-shot {
  height: 132px; border-radius: 10px; margin-bottom: 16px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #EAF2FF, #EDEBFF); border: 1px solid var(--line); display: block;
}
.feature-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ===================== 流程步骤 ===================== */
.steps { display: flex; align-items: stretch; gap: 0; margin-top: 10px; }
.step { flex: 1; text-align: center; position: relative; padding: 0 10px; }
.step .step-num {
  width: 42px; height: 42px; border-radius: 50%; margin: 0 auto 12px;
  display: grid; place-items: center; font-weight: 800; color: #fff;
  background: var(--brand-grad); box-shadow: 0 6px 14px rgba(10,132,255,.28);
}
.step h3 { font-size: 15px; margin-bottom: 4px; }
.step p { margin: 0; font-size: 13px; color: var(--muted); }
.step:not(:last-child)::after {
  content: ""; position: absolute; top: 21px; right: -8px; width: 16px; height: 2px;
  background: var(--brand); opacity: .4;
}

/* ===================== 分类卡片（JS 渲染） ===================== */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-sm); transition: transform .3s, box-shadow .3s; cursor: default; overflow: hidden;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
/* 分类卡截图占位（<img> 满幅出血到卡片顶部圆角内） */
.card-shot { height: 104px; margin: -20px -20px 14px; display: block; border-radius: 0; background: linear-gradient(135deg, #EAF2FF, #EDEBFF); overflow: hidden; }
.card-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: #EEF4FF; color: var(--brand); margin-bottom: 12px; }
.card h3 { font-size: 17px; margin-bottom: 4px; }
.card .cnt { color: var(--muted); font-size: 13px; }

/* ===================== Tabs ===================== */
.tabs { display: flex; gap: 8px; margin: 6px 0 16px; }
.tab {
  padding: 10px 20px; border-radius: var(--radius-sm); cursor: pointer; font-weight: 600;
  background: var(--card); border: 1px solid var(--line); color: var(--muted); transition: all .2s;
}
.tab:hover { color: var(--brand); border-color: #D8E6FF; }
.tab.active { background: var(--brand-grad); color: #fff; border-color: transparent; box-shadow: 0 6px 14px rgba(10,132,255,.22); }

/* ===================== 搜索框 ===================== */
.searchbar { display: flex; gap: 10px; margin-bottom: 16px; }
.searchbar input {
  flex: 1; padding: 13px 16px; border: 1px solid var(--line); border-radius: 12px;
  font-size: 15px; outline: none; transition: border .2s, box-shadow .2s; font-family: inherit; background:#fff;
}
.searchbar input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(10,132,255,.12); }

/* ===================== 布局：问答 + 相关文档 ===================== */
.kb-layout { display: grid; grid-template-columns: 1.55fr 1fr; gap: 18px; align-items: start; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.panel .phead { padding: 15px 18px; border-bottom: 1px solid var(--line); font-weight: 700; display: flex; align-items: center; gap: 8px; }
.panel .pbody { padding: 16px 18px; }

/* ===================== 聊天 ===================== */
.chat { display: flex; flex-direction: column; gap: 14px; min-height: 320px; max-height: 560px; overflow-y: auto; padding-right: 4px; }
.msg { display: flex; gap: 10px; max-width: 92%; }
.msg .av { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; }
.msg.ai .av { background: var(--brand-grad); }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg.user .av { background: var(--brand2); }
.bubble { padding: 12px 15px; border-radius: 14px; white-space: pre-wrap; word-break: break-word; font-size: 14.5px; }
.msg.ai .bubble { background: #F5F8FF; border: 1px solid var(--line); border-top-left-radius: 4px; }
.msg.user .bubble { background: var(--brand-grad); color: #fff; border-top-right-radius: 4px; }
.bubble .ref { display: inline-block; margin: 0 2px; padding: 1px 8px; border-radius: 8px; font-size: 12px; background: #E3EDFF; color: var(--brand); cursor: pointer; font-weight: 600; }
.bubble .ref:hover { background: var(--brand); color: #fff; }
.typing { display: inline-flex; gap: 4px; padding: 6px 2px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); animation: blink 1.2s infinite; }
.typing span:nth-child(2){ animation-delay:.2s;} .typing span:nth-child(3){ animation-delay:.4s;}
@keyframes blink { 0%,80%,100%{opacity:.3;} 40%{opacity:1;} }

.chat-input { display: flex; gap: 10px; margin-top: 14px; }
.chat-input textarea { flex: 1; resize: none; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; font-size: 15px; outline: none; font-family: inherit; background:#fff; }
.chat-input textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(10,132,255,.12); }
.chat-tools { display: flex; gap: 8px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.chat-tools a { cursor: pointer; transition: color .15s; }
.chat-tools a:hover { color: var(--brand); }

/* ===================== 相关文档 ===================== */
.doc-item { border: 1px solid var(--line); border-radius: 11px; padding: 12px 13px; margin-bottom: 10px; cursor: pointer; transition: border .15s, background .15s, transform .15s; }
.doc-item:hover { border-color: var(--brand); background: #F7FAFF; transform: translateX(2px); }
.doc-item .dt { font-weight: 600; font-size: 14px; }
.doc-item .dmeta { font-size: 12px; color: var(--muted); margin-top: 4px; display: flex; gap: 8px; align-items: center; }
.tag { background: #EEF4FF; color: var(--brand); padding: 1px 9px; border-radius: 8px; font-size: 11px; font-weight: 600; }
.empty { color: var(--muted); text-align: center; padding: 30px 0; }

/* ===================== 文档详情弹窗 ===================== */
.modal-mask { position: fixed; inset: 0; background: rgba(24,24,27,.45); display: none; place-items: center; z-index: 100; padding: 20px; }
.modal-mask.show { display: grid; }
.modal { background: #fff; border-radius: 16px; max-width: 720px; width: 100%; max-height: 84vh; overflow-y: auto; padding: 26px 28px; }
.modal h2 { margin-top: 0; color: var(--brand); }
.modal .close { float: right; cursor: pointer; font-size: 24px; color: var(--muted); line-height: 1; }
.modal .close:hover { color: var(--ink); }
.modal pre { white-space: pre-wrap; background: #F7FAFF; border: 1px solid var(--line); border-radius: 10px; padding: 14px; font-family: inherit; color: var(--ink); }

/* ===================== 合同审查 ===================== */
.cr-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.editor { width: 100%; min-height: 420px; border: 1px solid var(--line); border-radius: 12px; padding: 14px; font-size: 14px; font-family: inherit; outline: none; resize: vertical; background:#fff; }
.editor:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(10,132,255,.12); }
.dropzone { border: 2px dashed var(--line); border-radius: 12px; padding: 18px; text-align: center; color: var(--muted); margin: 12px 0; cursor: pointer; transition: all .2s; background:#fff; }
.dropzone.hover { border-color: var(--brand); background: #F7FAFF; color: var(--brand); }
.cr-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.review-box { min-height: 420px; }

/* 风险卡片 */
.overall { background: var(--brand-grad-soft); color: #fff; border-radius: 12px; padding: 16px 18px; margin-bottom: 14px; white-space: pre-wrap; font-size: 14.5px; }
.risk { border: 1px solid var(--line); border-left-width: 5px; border-radius: 11px; margin-bottom: 12px; overflow: hidden; background:#fff; }
.risk.high { border-left-color: var(--risk-high); }
.risk.mid { border-left-color: var(--risk-mid); }
.risk.low { border-left-color: var(--risk-low); }
.risk .rh { padding: 12px 14px; cursor: pointer; display: flex; align-items: center; gap: 10px; font-weight: 600; }
.risk .lv { font-size: 12px; padding: 2px 11px; border-radius: 9999px; color: #fff; flex: none; font-weight: 700; }
.risk.high .lv { background: var(--risk-high); }
.risk.mid .lv { background: var(--risk-mid); }
.risk.low .lv { background: var(--risk-low); color: #3a2f00; }
.risk .arrow { margin-left: auto; color: var(--muted); transition: transform .15s; }
.risk.open .arrow { transform: rotate(90deg); }
.risk .rb { padding: 0 14px 14px; display: none; font-size: 14px; }
.risk.open .rb { display: block; }
.risk .rb p { margin: 6px 0; }
.risk .rb b { color: var(--brand); }
.review-md { white-space: pre-wrap; }

/* 示例合同预览折叠区 */
.sample-preview {
  margin: 18px 0 0; border: 1px solid var(--line); border-radius: 12px; background: var(--card); overflow: hidden;
}
.sample-preview summary {
  cursor: pointer; padding: 14px 18px; font-weight: 600; color: var(--ink); user-select: none;
}
.sample-preview summary:hover { color: var(--brand); }
.sample-preview pre {
  margin: 0; padding: 0 18px 16px; white-space: pre-wrap; color: var(--muted); font-size: 13.5px;
  max-height: 300px; overflow: auto; border-top: 1px solid var(--line-soft);
}

/* ===================== CTA 转化区 ===================== */
.cta {
  margin: 48px 0 8px; padding: 44px 24px; text-align: center;
  border-radius: 18px; color: #fff; position: relative; overflow: hidden;
  background: var(--brand-grad-soft);
  box-shadow: 0 16px 40px rgba(10,132,255,.25);
}
.cta h2 { font-size: 26px; font-weight: 800; }
.cta p { margin: 12px auto 24px; opacity: .92; max-width: 560px; }
.cta .btn { background: #fff; color: var(--brand); box-shadow: 0 8px 20px rgba(0,0,0,.12); }

/* ===================== 页脚 ===================== */
.footer { background: #fff; border-top: 1px solid var(--line); margin-top: 40px; padding: 40px 0 28px; }
.footer-inner { max-width: 1180px; margin: 0 auto; padding: 0 20px; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
.footer .f-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--ink); margin-bottom: 12px; }
.footer .f-brand .logo { width: 30px; height: 30px; border-radius: 8px; background: var(--brand-grad); display: grid; place-items: center; color: #fff; font-weight: 800; }
.footer p { color: var(--muted); font-size: 13.5px; margin: 0 0 8px; }
.footer h4 { font-size: 14px; margin: 0 0 12px; color: var(--ink); }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 8px; }
.footer li a { color: var(--muted); font-size: 13.5px; }
.footer li a:hover { color: var(--brand); }
.footer-bottom { max-width: 1180px; margin: 28px auto 0; padding: 18px 20px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; text-align: center; }

/* ===================== 滚动揭示 ===================== */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in-view { opacity: 1; transform: none; }

/* ===================== 响应式 ===================== */
@media (max-width: 980px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .kb-layout, .cr-layout { grid-template-columns: 1fr; }
  .steps { flex-wrap: wrap; gap: 18px; }
  .step { min-width: 40%; }
  .step:not(:last-child)::after { display: none; }
  .nav { display: none; }
}
@media (max-width: 620px) {
  .hero { padding: 40px 22px; }
  .hero-title { font-size: 28px; }
  .features, .stats, .cards { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; gap: 10px; }
  .cta-nav { display: none; }
  .status-badge { margin-left: auto; }
}
