/* ============================================================
   码方二维码 Codeform · 内容页共享样式
   ------------------------------------------------------------
   只给 guides/ 下的专题页用，首页完全不引用这个文件。
   这样内容页怎么改都不会影响工具本体，反之亦然。

   做法：把首页的 CSS 变量与视觉语言抄过来，保持一致观感，
   但刻意不复用首页样式表 —— 首页样式是给「工具布局」写的，
   带大量 grid/flex 容器规则，直接拿来当文章样式会互相打架。
   ============================================================ */

:root {
  --bg: #0a0c12;
  --surface-1: rgba(20, 25, 40, 0.62);
  --surface-2: rgba(30, 37, 56, 0.55);
  --surface-3: rgba(255, 255, 255, 0.045);
  --hair: rgba(255, 255, 255, 0.055);
  --hair-strong: rgba(255, 255, 255, 0.10);

  --ink: #eef2fb;
  --ink-2: #a2aec7;
  --ink-3: #6a7690;
  --ink-4: #48536b;

  --accent: #5b8cff;
  --accent-2: #22d3ee;
  --accent-3: #a06bff;
  --grad: linear-gradient(135deg, #5b8cff 0%, #a06bff 100%);
  --glow: rgba(91, 140, 255, 0.42);

  --radius-lg: 22px;
  --radius: 16px;
  --radius-sm: 11px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-card: 0 1px 0 rgba(255,255,255,.045) inset, 0 18px 44px -24px rgba(0,0,0,.9);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC',
               'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
  overflow-x: hidden;
}

/* 与首页同源的光晕背景 */
body::before {
  content: ""; position: fixed; inset: -20%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(760px 560px at 80% -6%, rgba(91,140,255,.15), transparent 68%),
    radial-gradient(680px 540px at 4% 100%, rgba(160,107,255,.12), transparent 68%);
}

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

/* ---------- 顶栏 ---------- */
.g-top {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  background: rgba(10, 12, 18, 0.78);
  border-bottom: 1px solid var(--hair);
}
.g-top-in {
  max-width: 820px; margin: 0 auto; padding: 13px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
}
.g-brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 14.5px; font-weight: 650; color: var(--ink); text-decoration: none;
}
.g-brand:hover { text-decoration: none; }
.g-brand img { width: 26px; height: 26px; border-radius: 7px; }
.g-cta {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 16px; border-radius: 9px; font-size: 13px; font-weight: 600;
  background: var(--grad); color: #fff; text-decoration: none;
  box-shadow: 0 8px 22px -12px var(--glow);
  transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out);
  white-space: nowrap;
}
.g-cta:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 12px 28px -12px var(--glow); }

/* ---------- 正文容器 ---------- */
.g-wrap { max-width: 820px; margin: 0 auto; padding: 40px 22px 80px; }

/* ---------- 面包屑 ---------- */
.g-crumb {
  font-size: 12.5px; color: var(--ink-3); margin-bottom: 20px;
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
}
.g-crumb a { color: var(--ink-3); }
.g-crumb a:hover { color: var(--accent); }
.g-crumb .sp { color: var(--ink-4); }

/* ---------- 标题 ---------- */
h1 {
  font-size: 33px; font-weight: 750; line-height: 1.28; letter-spacing: -0.02em;
  margin: 0 0 16px;
}
.g-lead {
  font-size: 16.5px; line-height: 1.72; color: var(--ink-2);
  margin: 0 0 28px; padding-left: 16px; border-left: 3px solid var(--accent);
}
.g-meta {
  font-size: 12.5px; color: var(--ink-3); margin-bottom: 34px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.g-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-4); }

h2 {
  font-size: 22px; font-weight: 700; letter-spacing: -0.01em;
  margin: 46px 0 16px; padding-top: 22px;
  border-top: 1px solid var(--hair);
}
h2:first-of-type { border-top: 0; padding-top: 0; }
h3 { font-size: 17px; font-weight: 650; margin: 28px 0 10px; color: var(--ink); }

p { margin: 0 0 16px; color: var(--ink-2); }
strong, b { color: var(--ink); font-weight: 650; }

ul, ol { margin: 0 0 18px; padding-left: 22px; color: var(--ink-2); }
li { margin-bottom: 9px; }
li::marker { color: var(--accent); }

code {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em; padding: 2px 6px; border-radius: 5px;
  background: rgba(255,255,255,.065); color: #c9d6f5;
}

/* ---------- 提示块 ---------- */
.note {
  margin: 22px 0; padding: 16px 18px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--hair);
  border-left: 3px solid var(--accent);
  font-size: 14.5px; line-height: 1.72; color: var(--ink-2);
}
.note.warn { border-left-color: #f5a524; }
.note.ok { border-left-color: #34d399; }
.note b { color: var(--ink); }
.note p:last-child { margin-bottom: 0; }

/* ---------- 表格 ---------- */
.g-table {
  width: 100%; border-collapse: collapse; margin: 20px 0 26px;
  font-size: 14px; overflow: hidden; border-radius: var(--radius-sm);
  border: 1px solid var(--hair);
}
.g-table th {
  text-align: left; padding: 12px 14px; font-weight: 650; font-size: 13px;
  color: var(--ink); background: var(--surface-3);
  border-bottom: 1px solid var(--hair-strong); white-space: nowrap;
}
.g-table td {
  padding: 11px 14px; color: var(--ink-2);
  border-bottom: 1px solid var(--hair);
}
.g-table tr:last-child td { border-bottom: 0; }
.g-table tbody tr:hover { background: rgba(255,255,255,.02); }

/* ---------- CTA 卡片 ---------- */
.g-cta-card {
  margin: 38px 0; padding: 26px 24px; border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(91,140,255,.12), rgba(160,107,255,.10));
  border: 1px solid rgba(91,140,255,.24);
  box-shadow: var(--shadow-card); text-align: center;
}
.g-cta-card h3 { margin: 0 0 8px; font-size: 18px; color: var(--ink); }
.g-cta-card p { margin: 0 0 18px; font-size: 14px; color: var(--ink-2); }
.g-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 26px; border-radius: 11px; font-size: 14.5px; font-weight: 600;
  background: var(--grad); color: #fff; text-decoration: none;
  box-shadow: 0 10px 26px -12px var(--glow);
  transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
.g-btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 14px 32px -12px var(--glow); }

/* ---------- 步骤 ---------- */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 22px 0; }
.steps > li {
  counter-increment: step; position: relative;
  padding: 0 0 22px 46px; margin: 0; color: var(--ink-2);
}
.steps > li::before {
  content: counter(step);
  position: absolute; left: 0; top: 1px;
  width: 29px; height: 29px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13.5px; font-weight: 700; color: #fff;
  background: var(--grad); box-shadow: 0 4px 14px -5px var(--glow);
}
.steps > li::after {
  content: ""; position: absolute; left: 14px; top: 34px; bottom: 4px;
  width: 1px; background: var(--hair-strong);
}
.steps > li:last-child { padding-bottom: 0; }
.steps > li:last-child::after { display: none; }
.steps > li b { display: block; color: var(--ink); font-weight: 650; margin-bottom: 3px; }

/* ---------- 常见问题（折叠） ----------
   必须与页面 head 里的 FAQPage 结构化数据逐条对应：
   Google 要求结构化数据与可见内容一致，只标不写会被判欺骗性标记。 */
.g-faq { margin: 22px 0 8px; }
.g-faq-item { border-bottom: 1px solid var(--hair); }
.g-faq-item:last-child { border-bottom: 0; }
.g-faq-q {
  width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 15px 2px; font-size: 15.5px; font-weight: 600; color: var(--ink);
  font-family: inherit; line-height: 1.6;
  transition: color .18s var(--ease-out);
}
.g-faq-q:hover { color: var(--accent); }
.g-faq-q .chev {
  flex-shrink: 0; width: 15px; height: 15px; color: var(--ink-3);
  transition: transform .25s var(--ease-out), color .18s var(--ease-out);
}
.g-faq-item.on .g-faq-q .chev { transform: rotate(180deg); color: var(--accent); }
.g-faq-a {
  overflow: hidden; max-height: 0; opacity: 0;
  transition: max-height .3s var(--ease-out), opacity .25s var(--ease-out);
}
/* JS 会用内联 max-height 精确控制展开高度；这里的值只是
   JS 未执行时的兜底，别设太小以免内容被切。 */
.g-faq-item.on .g-faq-a { max-height: 1200px; opacity: 1; }
.g-faq-a p {
  margin: 0; padding: 0 2px 17px; font-size: 14.5px; line-height: 1.78; color: var(--ink-2);
}

/* ---------- 相关阅读 ---------- */
.g-rel { margin-top: 52px; padding-top: 26px; border-top: 1px solid var(--hair); }
.g-rel h2 { font-size: 16px; margin: 0 0 16px; padding: 0; border: 0; color: var(--ink-2); font-weight: 600; }
.g-rel ul { list-style: none; padding: 0; margin: 0; }
.g-rel li { margin-bottom: 10px; }
.g-rel a {
  display: block; padding: 13px 16px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--hair);
  color: var(--ink); font-size: 14.5px; text-decoration: none;
  transition: border-color .2s var(--ease-out), background .2s var(--ease-out), transform .2s var(--ease-out);
}
.g-rel a:hover {
  text-decoration: none; transform: translateX(3px);
  border-color: rgba(91,140,255,.4); background: var(--surface-3);
}
.g-rel a span { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 3px; font-weight: 400; }

/* ---------- 页脚 ---------- */
.g-foot {
  max-width: 820px; margin: 0 auto; padding: 26px 22px 46px;
  font-size: 12.5px; color: var(--ink-3); text-align: center;
  border-top: 1px solid var(--hair);
}
.g-foot a { color: var(--ink-3); }
.g-foot a:hover { color: var(--accent); }
.g-foot .sp { margin: 0 9px; color: var(--ink-4); }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .g-wrap { padding: 28px 18px 60px; }
  h1 { font-size: 26px; }
  h2 { font-size: 19px; margin-top: 36px; }
  .g-lead { font-size: 15.5px; }
  .g-table { font-size: 13px; }
  .g-table th, .g-table td { padding: 9px 10px; }
  .g-cta { padding: 7px 13px; font-size: 12.5px; }
}
