/* ==========================================================================
   AI 手册 · 样式表
   纯手写，无构建、无 CDN 依赖
   ========================================================================== */

:root {
  --ink: #0d1424;
  --ink-2: #243044;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --bg: #f7f9fc;
  --bg-soft: #eef2f8;
  --card: #ffffff;
  --line: #e4eaf2;
  --line-strong: #d3dcea;
  --brand: #2563eb;
  --brand-soft: #eaf0ff;
  --violet: #7c3aed;
  --teal: #0d9488;
  --amber: #d97706;
  --rose: #e11d48;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-xs: 0 1px 2px rgba(13, 20, 36, .05);
  --shadow-sm: 0 2px 8px rgba(13, 20, 36, .06);
  --shadow-md: 0 12px 28px -12px rgba(13, 20, 36, .16);
  --shadow-lg: 0 24px 60px -24px rgba(13, 20, 36, .22);
  --max: 1160px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }

::selection { background: #c7d7ff; color: var(--ink); }

/* ---------- 布局 ---------- */
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.section { padding: 76px 0; }
.section--tight { padding: 48px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.section-head h2 { margin: 0; font-size: 26px; letter-spacing: -.02em; font-weight: 700; }
.section-head p { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--brand);
  margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 18px; height: 2px; background: var(--brand); border-radius: 2px; }

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 249, 252, .82);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s, background .25s;
}
.site-header.is-stuck { border-bottom-color: var(--line); background: rgba(247, 249, 252, .94); }
.nav { display: flex; align-items: center; gap: 28px; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; font-size: 16px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(140deg, var(--brand), var(--violet));
  color: #fff; display: grid; place-items: center;
  font-size: 13px; font-weight: 800; letter-spacing: -.02em;
  box-shadow: 0 6px 14px -6px rgba(37, 99, 235, .7);
}
.brand small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); letter-spacing: .04em; }
.nav-links { display: flex; gap: 4px; margin-left: 8px; }
.nav-links a {
  padding: 7px 13px; border-radius: 9px; font-size: 14.5px; color: var(--ink-2);
  transition: background .18s, color .18s;
}
.nav-links a:hover { background: var(--bg-soft); color: var(--ink); }
.nav-links a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card);
  display: grid; place-items: center; cursor: pointer;
  color: var(--ink-2); transition: border-color .18s, color .18s, transform .18s;
}
.icon-btn:hover { border-color: var(--line-strong); color: var(--brand); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 17px; height: 17px; }
.menu-toggle { display: none; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 20px; border-radius: 11px;
  font-size: 14.5px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; transition: transform .16s, box-shadow .2s, background .2s, border-color .2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: linear-gradient(180deg, #3b74f0, var(--brand));
  color: #fff; box-shadow: 0 10px 22px -12px rgba(37, 99, 235, .9), inset 0 1px 0 rgba(255,255,255,.22);
}
.btn--primary:hover { box-shadow: 0 14px 28px -12px rgba(37, 99, 235, .95); }
.btn--ghost { background: var(--card); border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--line-strong); background: #fff; }
.btn--sm { height: 34px; padding: 0 14px; font-size: 13.5px; border-radius: 9px; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 84px 0 68px; }
.hero-bg {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(760px 340px at 12% -6%, rgba(37, 99, 235, .13), transparent 62%),
    radial-gradient(620px 320px at 88% 4%, rgba(124, 58, 237, .12), transparent 60%),
    radial-gradient(520px 300px at 52% 108%, rgba(13, 148, 136, .10), transparent 64%);
}
.hero-grid {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(to right, rgba(13, 20, 36, .045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(13, 20, 36, .045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 20%, #000 0%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 20%, #000 0%, transparent 72%);
}
.hero .wrap { position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, .8); border: 1px solid var(--line);
  font-size: 13px; color: var(--ink-2); box-shadow: var(--shadow-xs);
  margin-bottom: 22px;
}
.hero-badge b {
  background: var(--brand-soft); color: var(--brand);
  font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  letter-spacing: .02em;
}
.hero h1 {
  margin: 0 0 20px; font-size: clamp(34px, 5.2vw, 58px); line-height: 1.14;
  letter-spacing: -.035em; font-weight: 800; max-width: 16em;
}
.hero h1 .grad {
  background: linear-gradient(100deg, var(--brand) 8%, var(--violet) 52%, var(--teal) 96%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-lead { margin: 0 0 32px; font-size: 17.5px; color: var(--muted); max-width: 40em; line-height: 1.75; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-stats {
  display: flex; flex-wrap: wrap; gap: 40px; margin-top: 52px;
  padding-top: 28px; border-top: 1px solid var(--line);
}
.stat b { display: block; font-size: 27px; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; }
.stat span { font-size: 13px; color: var(--muted); }

/* ---------- 卡片 ---------- */
.grid { display: grid; gap: 18px; }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow-xs);
  transition: transform .22s cubic-bezier(.2,.7,.3,1), box-shadow .22s, border-color .22s;
  position: relative;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-strong); }

/* 提示词卡 */
.prompt-card { display: flex; flex-direction: column; gap: 12px; }
.prompt-card .pc-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.prompt-card h3 { margin: 0; font-size: 16.5px; font-weight: 700; letter-spacing: -.01em; line-height: 1.4; }
.prompt-card p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.7; }
.pc-body {
  margin: 2px 0 0; padding: 13px 14px; border-radius: var(--radius-sm);
  background: var(--bg-soft); border: 1px dashed var(--line-strong);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.75; color: var(--ink-2);
  white-space: pre-wrap; max-height: 132px; overflow: hidden; position: relative;
}
.pc-body::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 42px;
  background: linear-gradient(to bottom, rgba(238,242,248,0), var(--bg-soft));
}
.pc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 4px; }
.pc-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
  display: inline-flex; align-items: center;
  padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600;
  background: var(--bg-soft); color: var(--muted); border: 1px solid transparent;
  letter-spacing: .01em;
}
.tag--brand { background: var(--brand-soft); color: var(--brand); }
.tag--teal { background: #e6f7f4; color: var(--teal); }
.tag--violet { background: #f1ecff; color: var(--violet); }
.tag--amber { background: #fdf3e3; color: var(--amber); }
.tag--rose { background: #fdeaee; color: var(--rose); }

.copy-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 11px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: all .18s;
}
.copy-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.copy-btn.is-done { border-color: var(--teal); color: var(--teal); background: #e6f7f4; }

/* ---------- 工具栏 / 筛选 ---------- */
.toolbar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  margin-bottom: 26px; padding: 14px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-xs);
}
.search {
  flex: 1 1 240px; display: flex; align-items: center; gap: 9px;
  height: 40px; padding: 0 13px; border-radius: 10px;
  background: var(--bg-soft); border: 1px solid transparent;
  transition: border-color .2s, background .2s;
}
.search:focus-within { border-color: var(--brand); background: #fff; }
.search svg { width: 16px; height: 16px; color: var(--muted-2); flex: none; }
.search input {
  border: 0; background: transparent; outline: none; width: 100%;
  font-size: 14px; color: var(--ink); font-family: inherit;
}
.search input::placeholder { color: var(--muted-2); }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  height: 32px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  font-size: 13px; font-weight: 600; transition: all .18s;
}
.chip:hover { border-color: var(--line-strong); color: var(--ink); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- 工具卡 ---------- */
.tool-card { display: flex; flex-direction: column; gap: 10px; }
.tool-card .tc-head { display: flex; align-items: center; gap: 11px; }
.tool-ico {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  display: grid; place-items: center; font-size: 16px; font-weight: 800;
  background: var(--brand-soft); color: var(--brand);
}
.tool-card h3 { margin: 0; font-size: 15.5px; font-weight: 700; }
.tool-card .tc-sub { font-size: 12.5px; color: var(--muted-2); font-family: var(--mono); margin-top: 1px; }
.tool-card p { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.7; }

/* ---------- 笔记列表 ---------- */
.note-item {
  display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center;
  padding: 20px 0; border-bottom: 1px solid var(--line);
  transition: padding-left .2s;
}
.note-item:first-child { border-top: 1px solid var(--line); }
.note-item:hover { padding-left: 6px; }
.note-item h3 { margin: 0 0 5px; font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.note-item p { margin: 0; font-size: 13.5px; color: var(--muted); }
.note-meta { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted-2); white-space: nowrap; }
.note-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-2); }

/* ---------- 文章 ---------- */
.article { max-width: 740px; margin: 0 auto; }
.article-head { padding: 20px 0 30px; border-bottom: 1px solid var(--line); margin-bottom: 34px; }
.article-head h1 { margin: 12px 0 14px; font-size: clamp(28px, 4vw, 40px); letter-spacing: -.03em; line-height: 1.22; font-weight: 800; }
.article-head .meta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: 13px; color: var(--muted); }
.article-body { font-size: 16px; line-height: 1.85; color: var(--ink-2); }
.article-body h2 {
  margin: 44px 0 14px; font-size: 22px; letter-spacing: -.02em; font-weight: 750; color: var(--ink);
  padding-top: 6px;
}
.article-body h3 { margin: 30px 0 10px; font-size: 17.5px; font-weight: 700; color: var(--ink); }
.article-body p { margin: 0 0 18px; }
.article-body ul, .article-body ol { margin: 0 0 20px; padding-left: 22px; }
.article-body li { margin-bottom: 8px; }
.article-body strong { color: var(--ink); font-weight: 700; }
.article-body code {
  font-family: var(--mono); font-size: .88em; padding: 2px 6px; border-radius: 6px;
  background: var(--bg-soft); color: var(--violet); border: 1px solid var(--line);
}
.article-body pre {
  margin: 0 0 22px; padding: 18px; border-radius: 12px; overflow-x: auto;
  background: #0d1424; border: 1px solid #1b2739;
}
.article-body pre code { background: none; border: 0; color: #d7e2f3; font-size: 13px; padding: 0; }
.article-body blockquote {
  margin: 0 0 22px; padding: 14px 20px; border-left: 3px solid var(--brand);
  background: var(--brand-soft); border-radius: 0 10px 10px 0; color: var(--ink-2);
}
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-foot { margin-top: 48px; padding-top: 26px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty b { display: block; font-size: 16px; color: var(--ink); margin-bottom: 6px; }

/* ---------- CTA ---------- */
.cta-band {
  position: relative; overflow: hidden;
  border-radius: 22px; padding: 52px 44px;
  background: linear-gradient(135deg, #101b31 0%, #182a4a 52%, #123047 100%);
  color: #fff; box-shadow: var(--shadow-lg);
}
.cta-band::after {
  content: ""; position: absolute; width: 420px; height: 420px; right: -110px; top: -170px;
  background: radial-gradient(circle, rgba(37, 99, 235, .55), transparent 66%);
  pointer-events: none;
}
.cta-band > * { position: relative; z-index: 1; }
.cta-band h2 { margin: 0 0 12px; font-size: 28px; letter-spacing: -.025em; font-weight: 750; }
.cta-band p { margin: 0 0 26px; color: #a9bad4; max-width: 34em; font-size: 15px; }
.cta-band .btn--ghost { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.18); color: #fff; }
.cta-band .btn--ghost:hover { background: rgba(255,255,255,.14); }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 46px; margin-top: 24px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; font-size: 13.5px; color: var(--muted); }
.footer-links a:hover { color: var(--brand); }
.footer-copy { font-size: 12.5px; color: var(--muted-2); }

/* ---------- 吐司 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; font-size: 13.5px; font-weight: 500;
  padding: 11px 20px; border-radius: 11px; box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .24s, transform .24s; z-index: 200;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 入场动画 ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s cubic-bezier(.2,.7,.3,1), transform .6s cubic-bezier(.2,.7,.3,1); }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .nav-links { display: none; }
  .menu-toggle { display: grid; }
  .hero { padding: 56px 0 44px; }
  .hero-stats { gap: 26px; margin-top: 38px; }
  .section { padding: 56px 0; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .cta-band { padding: 36px 24px; border-radius: 18px; }
  .note-item { grid-template-columns: 1fr; gap: 10px; }
  .note-meta { white-space: normal; }
  .wrap { padding: 0 18px; }
}

/* 移动端抽屉 */
.mobile-menu {
  display: none; position: fixed; inset: 66px 0 auto 0; z-index: 49;
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 12px 18px 18px; box-shadow: var(--shadow-md);
}
.mobile-menu.is-open { display: block; }
.mobile-menu a { display: block; padding: 12px 10px; border-radius: 10px; font-size: 15px; color: var(--ink-2); }
.mobile-menu a:active { background: var(--bg-soft); }

/* 打印 / 无障碍 */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
