/* ============================================================
   marketing.css —— 营销页公共样式（图解统计 / 实战流程共用）
   从两页内联样式抽取，语义一致部分；页面独有部分见
   concept_board.css / tutorial.css
   ============================================================ */
/* ============ 基础：浅色文章 + 深色交互卡 ============ */
/* lucide 内联图标基础尺寸：随父级 font-size 缩放（width/height:1em），
   与原 emoji 占位一致；currentColor 取父级 color（如 callout.tip 的绿、
   .num 徽章的白）。营销页不加载 app shell 的 icons.js，故在此独立声明。 */
.svg-ico { display: inline-flex; align-items: center; line-height: 1; vertical-align: -0.14em; }
.svg-ico svg { width: 1em; height: 1em; display: block; }
:root {
  --bg: #f6f7f9;          /* 页面背景 */
  --surface: #ffffff;     /* 卡片/面板 */
  --ink: #1f2937;         /* 正文 */
  --ink-soft: #4b5563;    /* 次要正文 */
  --muted: #6b7280;       /* 弱化文字 */
  --line: #e5e7eb;        /* 分隔线 */
  --accent: #4f46e5;      /* 主色（链接/标题装饰） */
  --accent-soft: #eef2ff;
  --code-bg: #f1f5f9;
  --tip: #16a34a;  --tip-bg: #f0fdf4;  --tip-line: #bbf7d0;
  --warn: #d97706; --warn-bg: #fffbeb; --warn-line: #fde68a;
  --danger: #dc2626;--danger-bg:#fef2f2;--danger-line:#fecaca;
  --maxw: 1080px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", Inter, system-ui, sans-serif;
  font-size: 16px; line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============ 顶栏 ============ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .inner {
  width: 100%; margin: 0;
  display: flex; align-items: baseline; gap: 14px;
  padding: 14px 24px;
}
.site-header h1 { font-size: 20px; font-weight: 700; letter-spacing: .5px; }
.site-header h1 .brand-mark { color: var(--accent); font-size: 1.15em; vertical-align: -0.16em; }
.site-header .lede { font-size: 13px; color: var(--muted); }

/* 右上：回到 AI 助手的轻量入口（文字链接，非推广按钮） */
.to-assistant {
  margin-left: auto; align-self: center;
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--muted);
  padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  transition: color .2s, border-color .2s, background .2s, box-shadow .2s, transform .2s;
  text-decoration: none; white-space: nowrap; line-height: 1;
}
.to-assistant:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.to-assistant .ta-ico { font-size: 14px; }
.to-assistant .ta-arrow { font-size: 14px; transition: transform .2s; }
.to-assistant:hover .ta-arrow { transform: translateX(2px); }
/* 主入口：实心主色按钮（「带自己的数据去 AI 助手跑一遍」/「打开 AI 助手」）*/
.cta-main {
  background: var(--accent); border-color: var(--accent);
  color: #fff; font-weight: 600; font-size: 13.5px;
  box-shadow: 0 2px 6px rgba(79,70,229,.35);
}
.cta-main:hover {
  background: #4338ca; border-color: #4338ca; color: #fff;
  box-shadow: 0 3px 10px rgba(79,70,229,.45);
  transform: translateY(-1px);
}
/* 次入口：主色描边 + 浅底（跨页导航：图解统计 / 实战流程 / 使用教程）*/
.cta-sub {
  background: var(--accent-soft); border-color: var(--accent);
  color: var(--accent); font-weight: 600;
}
.cta-sub:hover {
  background: var(--accent); border-color: var(--accent);
  color: #fff; transform: translateY(-1px);
}
@media (max-width: 640px) {
  .to-assistant .ta-text { display: none; }
  .to-assistant { padding: 7px 11px; }
}

/* ============ 布局：左侧目录贴边 + 正文限宽可读 ============ */
.layout {
  width: 100%; margin: 0;
  display: grid; grid-template-columns: 220px minmax(0, 1fr);
  gap: 48px; padding: 32px 24px 80px 24px;
}
.toc {
  position: sticky; top: 72px; align-self: start;
  max-height: calc(100vh - 88px); overflow-y: auto;
  font-size: 14px;
}
.toc .toc-title { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin: 14px 0 8px 4px; }
.toc a { display: block; color: var(--ink-soft); padding: 5px 10px; border-radius: 6px; border-left: 2px solid transparent; }
.toc a:hover { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.toc a.active { color: var(--accent); border-left-color: var(--accent); background: var(--accent-soft); font-weight: 600; }

/* ============ 正文 ============ */
.article { min-width: 0; max-width: 920px; }
.method { display: none; scroll-margin-top: 80px; }
.method.active { display: block; margin-bottom: 0; }
.method > h2 {
  font-size: 26px; font-weight: 700; margin-bottom: 6px;
  display: flex; align-items: center; gap: 12px;
}
.method > h2 .num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent); color: #fff; font-size: 16px;
}
.method .tagline { color: var(--muted); font-size: 15px; margin-bottom: 22px; }
.method h3 {
  font-size: 18px; font-weight: 600; margin: 28px 0 10px;
  padding-left: 12px; border-left: 4px solid var(--accent);
  scroll-margin-top: 80px;
}
.method p { margin-bottom: 12px; color: var(--ink-soft); }
.method ul { margin: 0 0 14px 22px; color: var(--ink-soft); }
.method ul li { margin-bottom: 6px; }
.method strong { color: var(--ink); }

.formula {
  font-family: "JetBrains Mono", "SF Mono", Consolas, "Liberation Mono", monospace;
  background: var(--code-bg); border-left: 3px solid var(--accent);
  padding: 14px 18px; border-radius: 6px; margin: 14px 0;
  font-size: 14.5px; line-height: 1.9; overflow-x: auto; white-space: pre;
}
.callout {
  display: flex; gap: 12px; padding: 14px 16px; border-radius: 8px;
  margin: 16px 0; font-size: 14.5px; line-height: 1.7;
}
.callout .ico { flex-shrink: 0; font-size: 18px; line-height: 1.4; }
.callout.tip { background: var(--tip-bg); border: 1px solid var(--tip-line); }
.callout.tip .ico { color: var(--tip); }
.callout.warn { background: var(--warn-bg); border: 1px solid var(--warn-line); }
.callout.warn .ico { color: var(--warn); }
.callout.danger { background: var(--danger-bg); border: 1px solid var(--danger-line); }
.callout.danger .ico { color: var(--danger); }
.callout b { color: var(--ink); }

/* ============ 交互演示卡（深色，复用原 widget 配色） ============ */
.demo {
  --d-bg: #0f172a; --d-canvas: #1e293b; --d-primary: #6366f1; --d-accent: #a855f7;
  --d-success: #22c55e; --d-warn: #f59e0b; --d-muted: #94a3b8; --d-text: #e2e8f0; --d-line: #334155;
  background: var(--d-bg); border-radius: 16px; padding: 18px 20px 20px;
  margin: 18px 0 8px; box-shadow: 0 8px 28px rgba(15,23,42,.12);
}
.demo-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
.demo-head .demo-title { color: var(--d-text); font-size: 14px; font-weight: 600; }
.demo-head .demo-title .hint-sm { color: var(--d-muted); font-weight: 400; margin-left: 8px; font-size: 13px; }
/* 高度由各页独有样式指定（concept_board 420px / tutorial 360px） */
.graph {
  width: 100%;
  background: var(--d-canvas); border: 1px solid var(--d-line);
  border-radius: 12px; overflow: hidden;
}
.graph svg { width: 100%; height: 100%; display: block; }
.graph text { font-family: inherit; }

/* ============ 动画 ============ */
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.pulse { animation: pulse .9s ease-in-out infinite; }

/* ============ 窄屏 ============ */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; gap: 0; }
  .toc { position: static; max-height: none; margin-bottom: 24px; }
}
