/* 文章页共用样式：4 篇文章都用这个文件，改这里就会一起变 */

/* ========== 颜色设置：和首页保持一致 ========== */
:root {
  --bg: #F5F6FA;
  --surface: #FFFFFF;
  --ink: #181A20;
  --muted: #5B6070;
  --line: #E3E5EE;
  --accent: #4150C8;
  --accent-soft: #E8EAFB;
  --blob1: #CBD8FF;
  --blob2: #F8D6E4;
  --sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
}
[data-theme="dark"] {
  --bg: #10121A;
  --surface: #181B26;
  --ink: #ECEEF5;
  --muted: #9AA0B4;
  --line: #2A2E3D;
  --accent: #8C98FF;
  --accent-soft: #252A45;
  --blob1: #1E2A5A;
  --blob2: #3A1F36;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  padding-left: 84px;
  transition: background .3s, color .3s;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

.blob { position: fixed; border-radius: 50%; filter: blur(90px); z-index: -2; pointer-events: none; opacity: .6; }
.blob.b1 { width: 480px; height: 480px; background: var(--blob1); top: -180px; right: 0; }
.blob.b2 { width: 380px; height: 380px; background: var(--blob2); bottom: -160px; left: 5%; }

/* ========== 左侧导航栏（和首页一样） ========== */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: 84px;
  display: flex; flex-direction: column; align-items: center;
  padding: 18px 0; gap: 6px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  backdrop-filter: blur(14px);
  border-right: 1px solid var(--line);
  z-index: 10;
}
.logo { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: 26px; font-size: 12px; font-weight: 600; }
.logo-mark {
  width: 42px; height: 42px; border-radius: 13px;
  display: grid; place-items: center;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 15px; letter-spacing: -.02em;
}
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  width: 64px; padding: 8px 0; border-radius: 14px;
  font-size: 12px; color: var(--muted);
  transition: background .2s, color .2s;
}
.nav a svg { width: 22px; height: 22px; }
.nav a:hover { color: var(--ink); background: var(--accent-soft); }
.nav a.active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.side-bottom { margin-top: auto; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 12px; border: 0; cursor: pointer;
  display: grid; place-items: center; background: transparent; color: var(--muted);
}
.icon-btn:hover { background: var(--accent-soft); color: var(--ink); }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn .sun { display: none; }
[data-theme="dark"] .icon-btn .sun { display: block; }
[data-theme="dark"] .icon-btn .moon { display: none; }

/* ========== 文章 ========== */
main { max-width: 760px; margin: 0 auto; padding: 56px 40px 0; }

.back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.back svg { width: 16px; height: 16px; }
.back:hover { color: var(--accent); }

.post-head { margin: 34px 0 40px; padding-bottom: 30px; border-bottom: 1px solid var(--line); }
.post-head h1 { font-size: clamp(30px, 4.6vw, 46px); font-weight: 900; line-height: 1.25; letter-spacing: -.02em; }
.post-meta { display: flex; align-items: center; gap: 14px; margin-top: 18px; font-size: 14px; color: var(--muted); }
.tag { font-size: 13px; padding: 3px 10px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); }

.content { font-size: 17px; line-height: 1.95; }
.content > * + * { margin-top: 1.1em; }
.content h2 { font-size: 24px; font-weight: 800; line-height: 1.4; margin-top: 2em; }
.content h3 { font-size: 19px; font-weight: 700; margin-top: 1.6em; }
.content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.content strong { font-weight: 700; }
.content ul, .content ol { padding-left: 1.4em; }
.content li + li { margin-top: .4em; }
.content blockquote {
  padding: 14px 20px; border-left: 4px solid var(--accent);
  background: var(--surface); border-radius: 0 12px 12px 0; color: var(--muted);
}
.content code {
  font-family: var(--mono); font-size: .88em;
  padding: 2px 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent);
}
.content pre {
  font-family: var(--mono); font-size: 14px; line-height: 1.7;
  padding: 18px 20px; border-radius: 14px; overflow-x: auto;
  background: var(--surface); border: 1px solid var(--line);
}
.content pre code { padding: 0; background: none; color: var(--ink); font-size: inherit; }
.content figure { margin-top: 1.8em; margin-bottom: 1.8em; }
.content figure img { display: block; width: 100%; border-radius: 18px; border: 1px solid var(--line); }
.content figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); text-align: center; }

/* 上一篇 / 下一篇 */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 64px; }
.pager a {
  display: block; padding: 18px 20px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line);
  transition: border-color .2s;
}
.pager a:hover { border-color: var(--accent); }
.pager small { display: block; font-size: 13px; color: var(--muted); }
.pager span { font-weight: 700; }
.pager .next { text-align: right; grid-column: 2; }

footer { padding: 60px 0 40px; color: var(--muted); font-size: 14px; }

/* ========== 手机适配 ========== */
@media (max-width: 760px) {
  body { padding-left: 0; padding-bottom: 72px; }
  .sidebar {
    top: auto; right: 0; width: auto; height: 68px; flex-direction: row; justify-content: space-around;
    padding: 0 8px; border-right: 0; border-top: 1px solid var(--line);
  }
  .logo { display: none; }
  .nav { flex-direction: row; flex: 1; justify-content: space-around; }
  .nav a { width: 58px; }
  .side-bottom { margin-top: 0; }
  main { padding: 28px 22px 0; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ========== GPT-6 Astra 版鹈鹕动画（原作品用到的颜色变量） ========== */
.gpt-pelican {
  --background: #FFFFFF;
  --foreground: #1A1C1F;
  --blue: #339CFF;
  --orange: #E25507;
  --green: #00A240;
  --yellow: #FFC300;
  --muted-foreground: rgba(26, 28, 31, .5);
  --font-size-base: 16px;
  padding: 18px 18px 20px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--background);
}
/* 深色模式下也保持浅色，鹈鹕才是白色的 */
.gpt-pelican .btn {
  font: inherit; font-size: 14px; font-weight: 600;
  height: 38px; padding: 0 18px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--accent); color: #fff;
}
[data-theme="dark"] .gpt-pelican .btn { color: #10121A; }
.gpt-pelican .text-small { font-size: 14px; }
