/* ============================================================
   AI 新手导航 · 全站共享样式表
   所有详情页只允许使用本文件中已定义的 class，不要另写 <style>。
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #f6f7fb;
  --panel: #ffffff;
  --panel-2: #fbfbfe;
  --ink: #1b2130;
  --ink-2: #4b5469;
  --ink-3: #7c8598;
  --line: #e5e8f1;
  --line-2: #eef0f6;
  --brand: #4c5bd4;
  --brand-2: #7b8bff;
  --brand-soft: #eef0fe;
  --accent: #0f9f8f;
  --accent-soft: #e6f7f4;
  --amber: #b0700a;
  --amber-soft: #fff6e4;
  --red: #c53b3b;
  --red-soft: #fdeeee;
  --green: #1c8449;
  --green-soft: #e9f7ee;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 1px 2px rgba(18, 24, 48, .05), 0 12px 28px rgba(18, 24, 48, .07);
  --shadow-sm: 0 1px 2px rgba(18, 24, 48, .05);
  --maxw: 940px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

/* ---------- 基础 ---------- */
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.9;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: var(--mono);
  font-size: .9em;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 6px;
}

/* ---------- 顶部栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 20px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar .brand {
  font-weight: 800;
  font-size: 16px;
  color: var(--ink);
  letter-spacing: .01em;
}
.topbar .brand:hover { text-decoration: none; color: var(--brand); }

.crumbs { font-size: 14px; color: var(--ink-3); }
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--brand); }

/* ---------- 页面容器 ---------- */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 30px 20px 90px;
}

.hero {
  padding: 26px 26px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 140% at 100% 0%, var(--accent-soft) 0%, transparent 55%),
    radial-gradient(120% 140% at 0% 0%, var(--brand-soft) 0%, transparent 50%),
    var(--panel);
  box-shadow: var(--shadow-sm);
  margin-bottom: 8px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .14em;
  color: var(--accent);
}

.lede {
  margin: .35em 0 1.1em;
  font-size: 18.5px;
  line-height: 1.8;
  color: var(--ink-2);
}

/* ---------- 标题层级 ---------- */
h1 {
  font-size: 31px;
  line-height: 1.38;
  margin: .15em 0 .35em;
  letter-spacing: -.01em;
}
h2 {
  font-size: 23px;
  line-height: 1.5;
  margin: 1.9em 0 .55em;
  padding-left: 13px;
  border-left: 4px solid var(--brand);
}
h3 {
  font-size: 19px;
  line-height: 1.6;
  margin: 1.4em 0 .45em;
}
h4 { font-size: 16.5px; margin: 1.1em 0 .4em; }

p { margin: .7em 0; }
ul, ol { padding-left: 1.5em; }
li { margin: .35em 0; }

/* ---------- 卡片与栅格 ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin: 18px 0;
  box-shadow: var(--shadow-sm);
}
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }

.grid { display: grid; gap: 14px; }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.cols-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* ---------- 提示框 ---------- */
.tip, .warn, .danger, .info, .success {
  border-radius: 12px;
  padding: 13px 16px;
  margin: 15px 0;
  border: 1px solid var(--line);
  border-left-width: 4px;
  font-size: 16px;
}
.tip    { background: var(--accent-soft); border-left-color: var(--accent); }
.info   { background: var(--brand-soft);  border-left-color: var(--brand); }
.warn   { background: var(--amber-soft);  border-left-color: var(--amber); }
.danger { background: var(--red-soft);    border-left-color: var(--red); }
.success{ background: var(--green-soft);  border-left-color: var(--green); }

.callout-title {
  display: block;
  font-weight: 800;
  margin-bottom: 2px;
}

/* ---------- 可复制提示词 ---------- */
.prompt {
  position: relative;
  margin: 15px 0;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 12px;
  background: var(--panel-2);
  overflow: hidden;
}
.prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 12px;
  background: var(--brand-soft);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-2);
}
.prompt pre {
  margin: 0;
  padding: 14px 15px;
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--ink);
}
button.copy {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--brand);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
button.copy:hover { border-color: var(--brand); }
button.copy.done { background: var(--green-soft); color: var(--green); border-color: var(--green); }

/* ---------- 对话示例 ---------- */
.sample { display: grid; gap: 10px; margin: 16px 0; }
.msg {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 15px;
  background: var(--panel);
}
.msg.user { background: var(--brand-soft); border-color: #dde2ff; margin-right: 10%; }
.msg.ai { background: var(--panel-2); margin-left: 10%; }
.msg .who {
  display: block;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink-3);
  letter-spacing: .04em;
  margin-bottom: 1px;
}
.msg p { margin: .15em 0; }
.msg ul, .msg ol { margin: .3em 0; }

/* ---------- 步骤 ---------- */
.steps { counter-reset: s; list-style: none; padding-left: 0; }
.steps > li {
  counter-increment: s;
  position: relative;
  padding-left: 44px;
  margin: 14px 0;
}
.steps > li::before {
  content: counter(s);
  position: absolute;
  left: 0;
  top: 3px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 13.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.checklist { list-style: none; padding-left: 0; }
.checklist > li { position: relative; padding-left: 30px; margin: 7px 0; }
.checklist > li::before {
  content: "✓";
  position: absolute;
  left: 4px;
  top: 0;
  color: var(--accent);
  font-weight: 800;
}

/* ---------- 好坏对比 ---------- */
.compare { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin: 15px 0; }
.compare > div { border: 1px solid var(--line); border-radius: 12px; padding: 13px 16px; }
.compare .good { background: var(--green-soft); border-color: #cdebd8; }
.compare .bad  { background: var(--red-soft);   border-color: #f6d6d6; }
.compare h4 { margin: 0 0 4px; font-size: 16px; }
.compare ul { margin: .3em 0; }

/* ---------- 表格 ---------- */
.table-wrap {
  overflow-x: auto;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
table { border-collapse: collapse; width: 100%; font-size: 15.5px; }
th, td { padding: 10px 13px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; }
th { background: var(--brand-soft); font-weight: 800; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }

/* ---------- FAQ 折叠 ---------- */
details.faq {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 16px;
  margin: 10px 0;
}
details.faq > summary {
  cursor: pointer;
  font-weight: 700;
  padding: 12px 0;
  list-style: none;
}
details.faq > summary::-webkit-details-marker { display: none; }
details.faq > summary::before { content: "＋ "; color: var(--brand); font-weight: 800; }
details.faq[open] > summary::before { content: "－ "; }
details.faq .faq-body { border-top: 1px dashed var(--line); padding: 10px 0 14px; }
details.faq .faq-body > :first-child { margin-top: 0; }

/* ---------- 标签 ---------- */
.pill, .tag, .badge {
  display: inline-block;
  font-size: 12.5px;
  line-height: 1.65;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
  margin: 0 6px 6px 0;
}
.tag   { background: var(--accent-soft); color: #0b7568; }
.badge { background: var(--amber-soft);  color: var(--amber); }

/* ---------- 数据块 ---------- */
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin: 16px 0; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat .stat-num { font-size: 26px; font-weight: 800; color: var(--brand); line-height: 1.25; }
.stat .stat-label { font-size: 13.5px; color: var(--ink-3); line-height: 1.6; }

/* ---------- 其它 ---------- */
.quote {
  margin: 14px 0;
  padding: 2px 0 2px 16px;
  border-left: 4px solid var(--line);
  color: var(--ink-2);
}
.hl { background: linear-gradient(transparent 62%, #ffe9a8 62%); padding: 0 2px; font-weight: 600; }
.kbd {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 1px 7px;
}

.toc {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 20px;
  margin: 18px 0;
  font-size: 15.5px;
}
.toc > strong { font-size: 14px; letter-spacing: .06em; color: var(--ink-3); }
.toc ol { margin: .4em 0; }

.btns { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 15.5px;
}
.btn:hover { text-decoration: none; opacity: .92; }
.btn.ghost { background: var(--panel); color: var(--brand); }

.footer {
  margin-top: 44px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink-3);
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 60;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

.backtotop {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 50;
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink-2);
  font-size: 18px;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.backtotop.show { display: block; }

/* ---------- 深色模式 ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161d;
    --panel: #1b1e27;
    --panel-2: #191c24;
    --ink: #e8eaf2;
    --ink-2: #b4bacb;
    --ink-3: #8b92a5;
    --line: #2b3140;
    --line-2: #232836;
    --brand: #909cff;
    --brand-soft: #232a48;
    --accent: #4ecdb8;
    --accent-soft: #1b3230;
    --amber: #e0b464;
    --amber-soft: #372d1a;
    --red: #ff8f8f;
    --red-soft: #3a2222;
    --green: #6fd39a;
    --green-soft: #1d3327;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 28px rgba(0, 0, 0, .35);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .35);
  }
  .msg.user { border-color: #333c6b; }
  .compare .good { border-color: #2b4b39; }
  .compare .bad { border-color: #57302f; }
  .hl { background: linear-gradient(transparent 62%, #5a4a1e 62%); }
  .topbar { background: rgba(27, 30, 39, .9); }
}

/* ---------- 打印 ---------- */
@media print {
  .topbar, .backtotop, .progress, button.copy, .btns { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .card, .prompt, .table-wrap, details.faq { box-shadow: none; break-inside: avoid; }
  details.faq { open: true; }
  a { color: #000; }
}

/* ---------- 窄屏 ---------- */
@media (max-width: 640px) {
  body { font-size: 16.5px; }
  h1 { font-size: 26px; }
  h2 { font-size: 21px; }
  .wrap { padding: 20px 15px 70px; }
  .hero { padding: 20px 18px; }
  .msg.user { margin-right: 0; }
  .msg.ai { margin-left: 0; }
}
