/* ============================================================
   普通人的AI助手 · 全局样式表
   设计系统：清新渐变科技风 · 浅色主题 · 响应式
   ============================================================ */

/* ---------- 变量 ---------- */
:root {
  --bg: #f8fafc;
  --bg-soft: #eef2ff;
  --card: #ffffff;
  --text: #1e293b;
  --text-soft: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;

  --primary: #6366f1;
  --primary-2: #8b5cf6;
  --primary-3: #a855f7;
  --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #a855f7 100%);
  --grad-soft: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);

  --green: #10b981;
  --green-bg: #ecfdf5;
  --orange: #f59e0b;
  --orange-bg: #fffbeb;
  --red: #ef4444;
  --red-bg: #fef2f2;
  --blue: #3b82f6;
  --blue-bg: #eff6ff;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(30, 41, 59, .06), 0 8px 24px rgba(30, 41, 59, .06);
  --shadow-lg: 0 4px 12px rgba(30, 41, 59, .08), 0 16px 40px rgba(30, 41, 59, .10);

  --nav-h: 64px;
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Hiragino Sans GB", -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- 基础 ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 16px;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-2); }
h1, h2, h3, h4 { line-height: 1.35; font-weight: 700; }
p { margin-bottom: 1em; }
ul, ol { padding-left: 1.4em; margin-bottom: 1em; }
li { margin-bottom: .35em; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.section { padding: 56px 0; }
.section-title { font-size: 1.65rem; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.section-title .icon { font-size: 1.5rem; }
.section-sub { color: var(--text-soft); margin-bottom: 28px; }

/* 渐变文字 */
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ---------- 顶部导航 ---------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  z-index: 100;
  transition: box-shadow .25s, border-color .25s;
}
.navbar.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 2px 12px rgba(30, 41, 59, .07);
}
.navbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  height: var(--nav-h);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.12rem;
  color: var(--text);
  white-space: nowrap;
}
.logo-badge {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: var(--grad);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  color: var(--text-soft);
  font-size: .95rem;
  padding: 8px 14px;
  border-radius: 8px;
  transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--primary); background: var(--bg-soft); }
.nav-links a.active { color: var(--primary); font-weight: 600; background: var(--bg-soft); }
.nav-cta {
  margin-left: 8px;
  background: var(--grad);
  color: #fff !important;
  font-weight: 600;
  padding: 8px 16px !important;
}
.nav-cta:hover { color: #fff !important; opacity: .92; }

/* 汉堡菜单 */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px; height: 42px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
  transition: transform .25s, opacity .25s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 10px 20px 16px;
    gap: 4px;
    box-shadow: var(--shadow-lg);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; font-size: 1rem; }
  .nav-cta { margin-left: 0; text-align: center; }
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform .15s, box-shadow .2s, opacity .2s;
  font-family: var(--font);
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 6px 18px rgba(139, 92, 246, .35);
}
.btn-primary:hover { color: #fff; box-shadow: 0 8px 24px rgba(139, 92, 246, .45); }
.btn-outline {
  background: #fff;
  color: var(--primary);
  border: 1.5px solid #c7d2fe;
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-lg { padding: 15px 34px; font-size: 1.08rem; }

/* ---------- Hero ---------- */
.hero {
  padding: calc(var(--nav-h) + 64px) 0 64px;
  background:
    radial-gradient(700px 320px at 12% 0%, rgba(99, 102, 241, .12), transparent 60%),
    radial-gradient(700px 340px at 88% 10%, rgba(168, 85, 247, .12), transparent 60%),
    var(--bg);
  text-align: center;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; margin-bottom: 18px; letter-spacing: .5px; }
.hero-sub { font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--text-soft); max-width: 640px; margin: 0 auto 32px; }
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 48px;
  flex-wrap: wrap;
}
.hero-stats .stat { text-align: center; }
.hero-stats .stat b { display: block; font-size: 1.7rem; color: var(--primary); }
.hero-stats .stat span { color: var(--text-soft); font-size: .92rem; }

/* 页头（子页面） */
.page-header {
  padding: calc(var(--nav-h) + 48px) 0 40px;
  background:
    radial-gradient(600px 260px at 10% 0%, rgba(99, 102, 241, .14), transparent 60%),
    radial-gradient(600px 280px at 90% 0%, rgba(168, 85, 247, .12), transparent 60%),
    var(--bg);
}
.page-header .crumbs { color: var(--text-light); font-size: .9rem; margin-bottom: 14px; }
.page-header .crumbs a { color: var(--text-light); }
.page-header .crumbs a:hover { color: var(--primary); }
.page-header h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 800; margin-bottom: 12px; }
.page-header .lead { color: var(--text-soft); max-width: 720px; font-size: 1.06rem; }
.page-header .lead b { color: var(--primary); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.card-grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.card-grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; }

/* 主题卡片 */
.topic-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 30px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  position: relative;
  overflow: hidden;
}
.topic-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--grad);
  opacity: 0;
  transition: opacity .2s;
}
.topic-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: #c7d2fe; }
.topic-card:hover::before { opacity: 1; }
.topic-icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: var(--grad);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
}
.topic-card h3 { font-size: 1.25rem; }
.topic-card p { color: var(--text-soft); font-size: .95rem; flex: 1; }
.topic-meta { display: flex; gap: 10px; flex-wrap: wrap; }
.topic-meta .tag { background: var(--bg-soft); color: var(--primary); }
.topic-card .btn { align-self: flex-start; margin-top: 6px; }

/* 标签 */
.tag {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: .82rem;
  background: var(--bg-soft);
  color: var(--primary);
  font-weight: 500;
}
.tag-green { background: var(--green-bg); color: var(--green); }
.tag-orange { background: var(--orange-bg); color: var(--orange); }
.tag-red { background: var(--red-bg); color: var(--red); }
.tag-blue { background: var(--blue-bg); color: var(--blue); }
.tag-gray { background: #f1f5f9; color: var(--text-soft); }

/* 徽标（免费/收费） */
.badge-free {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 6px;
  font-size: .78rem;
  font-weight: 700;
  background: var(--green-bg);
  color: var(--green);
}
.badge-paid {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 6px;
  font-size: .78rem;
  font-weight: 700;
  background: var(--orange-bg);
  color: var(--orange);
}
.badge-free-part {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 6px;
  font-size: .78rem;
  font-weight: 700;
  background: var(--blue-bg);
  color: var(--blue);
}

/* ---------- 提示框 ---------- */
.tip, .note, .warn {
  border-radius: var(--radius-sm);
  padding: 16px 18px 16px 52px;
  margin: 20px 0;
  position: relative;
  font-size: .96rem;
}
.tip::before, .note::before, .warn::before {
  position: absolute;
  left: 18px; top: 16px;
  font-size: 1.2rem;
}
.tip { background: var(--green-bg); border-left: 4px solid var(--green); }
.tip::before { content: "💡"; }
.note { background: var(--blue-bg); border-left: 4px solid var(--blue); }
.note::before { content: "📌"; }
.warn { background: var(--orange-bg); border-left: 4px solid var(--orange); }
.warn::before { content: "⚠️"; }
.tip b, .note b, .warn b { display: block; margin-bottom: 4px; }

/* ---------- 步骤条 ---------- */
.steps { counter-reset: step; display: grid; gap: 16px; margin: 20px 0; }
.step {
  position: relative;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px 18px 64px;
  counter-increment: step;
}
.step::before {
  content: counter(step);
  position: absolute;
  left: 18px; top: 16px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: .95rem;
}
.step h4 { margin-bottom: 6px; font-size: 1.05rem; }
.step p { color: var(--text-soft); font-size: .95rem; margin: 0; }

/* ---------- 时间线 ---------- */
.timeline { position: relative; margin: 24px 0; padding-left: 28px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 8px; top: 6px; bottom: 6px;
  width: 3px;
  background: linear-gradient(to bottom, var(--primary), var(--primary-3));
  border-radius: 3px;
  opacity: .5;
}
.tl-item { position: relative; margin-bottom: 22px; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -25px; top: 6px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--primary-2);
}
.tl-item .tl-year {
  display: inline-block;
  background: var(--grad);
  color: #fff;
  font-weight: 700;
  font-size: .82rem;
  padding: 2px 12px;
  border-radius: 20px;
  margin-bottom: 6px;
}
.tl-item h4 { margin-bottom: 4px; }
.tl-item p { color: var(--text-soft); font-size: .95rem; margin: 0; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; margin: 20px 0; border-radius: var(--radius-sm); border: 1px solid var(--border); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: .93rem; min-width: 640px; }
th, td { padding: 12px 16px; text-align: left; vertical-align: top; }
thead th {
  background: var(--grad-soft);
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
tbody tr { border-bottom: 1px solid #f1f5f9; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f8faff; }
td .sub { color: var(--text-light); font-size: .82rem; }

/* ---------- 对话气泡 ---------- */
.chat { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin: 20px 0; box-shadow: var(--shadow); }
.chat .chat-head { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; color: var(--text-light); font-size: .85rem; }
.chat .chat-head b { color: var(--text); }
.msg { display: flex; gap: 10px; margin-bottom: 14px; }
.msg:last-child { margin-bottom: 0; }
.msg .avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  color: #fff;
  font-weight: 700;
}
.msg.user .avatar { background: var(--grad); }
.msg.ai .avatar { background: linear-gradient(135deg, #10b981, #0ea5e9); }
.msg .bubble {
  background: #f1f5f9;
  padding: 12px 16px;
  border-radius: 4px 14px 14px 14px;
  font-size: .95rem;
  max-width: 85%;
}
.msg.user .bubble { background: var(--bg-soft); }
.msg.ai .bubble { background: #f8fafc; border: 1px solid var(--border); }
.msg .bubble .meta { display: block; color: var(--text-light); font-size: .78rem; margin-top: 6px; }
.msg.user { flex-direction: row-reverse; }
.msg.user .bubble { border-radius: 14px 4px 14px 14px; }

/* ---------- FAQ 折叠 ---------- */
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; margin-bottom: 12px; overflow: hidden; }
.faq-q {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 16px 48px 16px 20px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  font-family: var(--font);
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}
.faq-q::after {
  content: "+";
  position: absolute;
  right: 20px;
  font-size: 1.4rem;
  color: var(--primary);
  transition: transform .25s;
}
.faq-item.open .faq-q::after { transform: rotate(45deg); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-a-inner { padding: 0 20px 18px 20px; color: var(--text-soft); font-size: .95rem; }
.faq-a-inner p { margin-bottom: .6em; }

/* ---------- 图文插图 ---------- */
.figure { margin: 24px 0; }
.figure .fig-cap { text-align: center; color: var(--text-light); font-size: .85rem; margin-top: 10px; }
.figure .img-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.figure .img-box svg, .figure .img-box img { margin: 0 auto; }

/* ---------- 学习路径 ---------- */
.path { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 24px 0; }
.path-step {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow);
}
.path-step .num {
  width: 36px; height: 36px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.path-step h4 { font-size: 1.02rem; margin-bottom: 4px; }
.path-step p { color: var(--text-soft); font-size: .86rem; margin: 0; }

/* ---------- 页内目录 ---------- */
.toc-box {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  font-size: .9rem;
}
.toc-box h4 { font-size: .85rem; color: var(--text-light); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 12px; }
.toc-box a {
  display: block;
  color: var(--text-soft);
  padding: 6px 10px;
  border-radius: 6px;
  margin-bottom: 2px;
  border-left: 3px solid transparent;
}
.toc-box a:hover { color: var(--primary); background: var(--bg-soft); }
.toc-box a.active { color: var(--primary); border-left-color: var(--primary); background: var(--bg-soft); font-weight: 600; }
.toc-box a.level-2 { padding-left: 24px; }

.layout-with-toc { display: grid; grid-template-columns: 220px 1fr; gap: 32px; align-items: start; }
@media (max-width: 900px) {
  .layout-with-toc { grid-template-columns: 1fr; }
  .toc-box { position: static; }
}

/* ---------- 返回顶部 ---------- */
.back-top {
  position: fixed;
  right: 24px; bottom: 24px;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(139, 92, 246, .4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .25s, transform .25s, visibility .25s;
  z-index: 90;
}
.back-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-top:hover { transform: translateY(-2px); }

/* ---------- 页脚 ---------- */
.footer {
  margin-top: 64px;
  background: #0f172a;
  color: #94a3b8;
  padding: 48px 0 32px;
  font-size: .92rem;
}
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; }
.footer h5 { color: #e2e8f0; font-size: 1rem; margin-bottom: 14px; }
.footer a { color: #94a3b8; display: block; margin-bottom: 8px; }
.footer a:hover { color: #fff; }
.footer .logo { color: #fff; margin-bottom: 12px; }
.footer .copyright { border-top: 1px solid #1e293b; margin-top: 32px; padding-top: 20px; text-align: center; color: #64748b; font-size: .85rem; }
@media (max-width: 768px) {
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
}

/* ---------- 代码块 ---------- */
.code-block {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-family: "SFMono-Regular", Consolas, "Courier New", monospace;
  font-size: .88rem;
  overflow-x: auto;
  margin: 16px 0;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.code-block .cmt { color: #64748b; }
.code-block .hl { color: #a5b4fc; }

/* ---------- 特色列表 ---------- */
.check-list { list-style: none; padding-left: 0; }
.check-list li { position: relative; padding-left: 28px; margin-bottom: 10px; }
.check-list li::before { content: "✅"; position: absolute; left: 0; top: 0; }
.cross-list { list-style: none; padding-left: 0; }
.cross-list li { position: relative; padding-left: 28px; margin-bottom: 10px; }
.cross-list li::before { content: "❌"; position: absolute; left: 0; top: 0; }

/* ---------- 内容正文排版 ---------- */
.article h2 { font-size: 1.5rem; margin: 44px 0 16px; padding-bottom: 10px; border-bottom: 2px solid var(--grad-soft); }
.article h3 { font-size: 1.2rem; margin: 32px 0 12px; }
.article h4 { font-size: 1.05rem; margin: 24px 0 10px; }
.article strong { color: var(--text); }
.article .highlight { background: var(--bg-soft); color: var(--primary); padding: 1px 6px; border-radius: 4px; font-weight: 600; }

/* 名词术语网格 */
.term-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin: 20px 0; }
.term {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}
.term h4 { font-size: 1rem; margin-bottom: 4px; }
.term .en { color: var(--text-light); font-size: .8rem; font-weight: 400; display: block; }
.term p { color: var(--text-soft); font-size: .92rem; margin: 6px 0 0; }

/* 工具/产品行 */
.tool-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-bottom: 12px;
}
.tool-row .tool-logo {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: var(--grad-soft);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.tool-row h4 { font-size: 1.02rem; margin-bottom: 2px; }
.tool-row p { color: var(--text-soft); font-size: .92rem; margin: 0; }
.tool-row .price { font-size: .82rem; margin-top: 6px; }

/* ---------- 移动端细节 ---------- */
@media (max-width: 768px) {
  .section { padding: 40px 0; }
  .container { padding: 0 16px; }
  .hero { padding-top: calc(var(--nav-h) + 40px); }
  .page-header { padding-top: calc(var(--nav-h) + 32px); }
  .card { padding: 22px; }
  .msg .bubble { max-width: 92%; }
  table { font-size: .85rem; }
}
