/* ====== 闪电豆 · 个人博客主题 ====== */
:root {
  --yellow: #FFDE21;
  --yellow-deep: #FFC400;
  --yellow-soft: #FFF3B0;
  --navy: #0D1B3F;
  --navy-2: #14224A;
  --navy-3: #1E2F5C;
  --ink: #1A2238;
  --ink-soft: #5A6478;
  --bg: #FFFDF5;
  --bg-2: #FFFBEC;
  --sky: #4DA3FF;
  --white: #ffffff;
  --radius: 22px;
  --radius-lg: 34px;
  --shadow-sm: 0 6px 18px rgba(13, 27, 63, .08);
  --shadow-md: 0 14px 40px rgba(13, 27, 63, .14);
  --shadow-yellow: 0 10px 30px rgba(255, 196, 0, .35);
  --font-display: "ZCOOL KuaiLe", "Baloo 2", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  --maxw: 1140px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ====== Navigation ====== */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 253, 245, .82);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(13, 27, 63, .06);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--navy);
}
.brand img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--yellow);
  padding: 4px;
  box-shadow: var(--shadow-yellow);
}
.brand .bolt { color: var(--yellow-deep); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
}
.nav-links a {
  font-weight: 600;
  color: var(--ink);
  position: relative;
  transition: color .2s;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 3px;
  border-radius: 3px;
  background: var(--yellow);
  transition: width .25s;
}
.nav-links a:hover, .nav-links a.active { color: var(--navy); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-cta {
  background: var(--navy);
  color: var(--white) !important;
  padding: 10px 20px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
}
.nav-cta::after { display: none; }
.nav-cta:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.nav-toggle { display: none; background: none; border: 0; font-size: 26px; cursor: pointer; color: var(--navy); }

/* ====== Buttons ====== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 16px;
  padding: 14px 28px;
  border-radius: 999px;
  cursor: pointer;
  border: 0;
  transition: transform .2s, box-shadow .2s, background .2s;
  font-family: var(--font-body);
}
.btn-primary {
  background: var(--yellow);
  color: var(--navy);
  box-shadow: var(--shadow-yellow);
}
.btn-primary:hover { transform: translateY(-3px); background: var(--yellow-deep); }
.btn-ghost {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255, 255, 255, .35);
}
.btn-ghost:hover { border-color: var(--yellow); color: var(--yellow); transform: translateY(-3px); }
.btn-navy {
  background: var(--navy);
  color: var(--white);
}
.btn-navy:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

/* ====== Hero ====== */
.hero {
  position: relative;
  background: radial-gradient(1200px 600px at 80% -10%, rgba(255, 222, 33, .18), transparent 60%),
              radial-gradient(900px 500px at 0% 100%, rgba(77, 163, 255, .14), transparent 55%),
              var(--navy);
  color: var(--white);
  overflow: hidden;
  padding: 86px 0 110px;
}
.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: .5;
  pointer-events: none;
}
.hero-blob.b1 { width: 340px; height: 340px; background: rgba(255, 222, 33, .14); top: -90px; right: -60px; }
.hero-blob.b2 { width: 260px; height: 260px; background: rgba(77, 163, 255, .16); bottom: -80px; left: -40px; }
.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 40px;
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 222, 33, .14);
  color: var(--yellow);
  font-weight: 700;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 14px;
  letter-spacing: .5px;
  border: 1px solid rgba(255, 222, 33, .3);
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(38px, 5.4vw, 66px);
  line-height: 1.18;
  margin: 22px 0 16px;
  letter-spacing: 1px;
}
.hero h1 .hl { color: var(--yellow); }
.hero .sub {
  font-size: clamp(18px, 2.2vw, 24px);
  color: #C9D3F0;
  font-weight: 500;
  margin-bottom: 32px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 16px; }
.hero-meta {
  margin-top: 36px;
  display: flex;
  gap: 34px;
  flex-wrap: wrap;
}
.hero-meta .stat .n { font-family: var(--font-display); font-size: 30px; color: var(--yellow); }
.hero-meta .stat .l { font-size: 14px; color: #A9B4D6; }

.hero-art {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}
.mascot {
  width: min(330px, 80%);
  animation: float 5s ease-in-out infinite;
  filter: drop-shadow(0 24px 40px rgba(0,0,0,.35));
}
@keyframes float { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-18px) rotate(2deg); } }
.spark {
  position: absolute;
  color: var(--yellow);
  font-size: 26px;
  animation: twinkle 2.6s ease-in-out infinite;
}
.spark.s1 { top: 8%; left: 6%; }
.spark.s2 { bottom: 14%; right: 4%; animation-delay: .8s; }
.spark.s3 { top: 30%; right: 14%; animation-delay: 1.5s; font-size: 18px; }
@keyframes twinkle { 0%,100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.2); } }

/* ====== Section heading ====== */
.section { padding: 84px 0; }
.section.alt { background: var(--bg-2); }
.sec-head { text-align: center; max-width: 680px; margin: 0 auto 52px; }
.sec-head .tag {
  display: inline-block;
  font-weight: 700; color: var(--yellow-deep);
  background: var(--navy); padding: 6px 16px; border-radius: 999px;
  font-size: 13px; letter-spacing: 1px; margin-bottom: 16px;
}
.sec-head h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.6vw, 42px);
  color: var(--navy);
  line-height: 1.25;
}
.sec-head p { color: var(--ink-soft); margin-top: 14px; font-size: 17px; }

/* ====== Post cards ====== */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.post-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(13, 27, 63, .05);
  transition: transform .25s, box-shadow .25s;
  display: flex;
  flex-direction: column;
}
.post-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-md); }
.post-cover {
  height: 168px;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 16px;
}
.post-cover .cat {
  background: var(--white);
  color: var(--navy);
  font-weight: 700;
  font-size: 13px;
  padding: 5px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.post-body { padding: 20px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.post-body h3 {
  font-size: 20px;
  color: var(--navy);
  line-height: 1.4;
  margin-bottom: 10px;
}
.post-body p { color: var(--ink-soft); font-size: 15px; flex: 1; }
.post-foot {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ink-soft);
}
.post-foot .read { color: var(--yellow-deep); font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }

/* gradient covers */
.cover-1 { background: linear-gradient(135deg, #FFDE21, #FF8A00); }
.cover-2 { background: linear-gradient(135deg, #4DA3FF, #0D1B3F); }
.cover-3 { background: linear-gradient(135deg, #FF6B9D, #FFDE21); }
.cover-4 { background: linear-gradient(135deg, #34D399, #0D1B3F); }
.cover-5 { background: linear-gradient(135deg, #A78BFA, #4DA3FF); }
.cover-6 { background: linear-gradient(135deg, #FF8A00, #FFDE21); }
.cover-grad::after {
  content: "⚡";
  position: absolute;
  top: 14px; right: 18px;
  font-size: 30px;
  color: rgba(255,255,255,.85);
}

/* ====== Category chips ====== */
.chips { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 8px; }
.chip {
  background: var(--white);
  border: 1.5px solid rgba(13, 27, 63, .1);
  color: var(--ink);
  font-weight: 600;
  padding: 9px 20px;
  border-radius: 999px;
  transition: all .2s;
  cursor: pointer;
}
.chip:hover, .chip.active { background: var(--navy); color: var(--yellow); border-color: var(--navy); }

/* ====== About teaser ====== */
.about-grid {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 48px;
  align-items: center;
}
.about-art {
  background: linear-gradient(135deg, var(--navy), var(--navy-3));
  border-radius: var(--radius-lg);
  padding: 40px;
  display: flex;
  justify-content: center;
}
.about-art img { width: 70%; animation: float 6s ease-in-out infinite; }
.about-text h2 { font-family: var(--font-display); font-size: clamp(26px, 3.2vw, 38px); color: var(--navy); margin-bottom: 18px; }
.about-text p { color: var(--ink-soft); font-size: 17px; margin-bottom: 16px; }
.about-text .lead { color: var(--ink); font-size: 19px; font-weight: 600; }

/* ====== Newsletter ====== */
.newsletter {
  background: linear-gradient(135deg, var(--navy), #1a2c63);
  border-radius: var(--radius-lg);
  padding: 56px 48px;
  text-align: center;
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.newsletter::before {
  content: "⚡";
  position: absolute;
  font-size: 220px;
  right: -30px; top: -60px;
  color: rgba(255, 222, 33, .08);
}
.newsletter h2 { font-family: var(--font-display); font-size: clamp(26px, 3.4vw, 38px); position: relative; }
.newsletter p { color: #C9D3F0; margin: 12px auto 28px; max-width: 520px; position: relative; }
.sub-form { display: flex; gap: 12px; max-width: 480px; margin: 0 auto; position: relative; }
.sub-form input {
  flex: 1;
  padding: 15px 22px;
  border-radius: 999px;
  border: 0;
  font-size: 15px;
  outline: none;
}
.sub-form .btn { white-space: nowrap; }

/* ====== Footer ====== */
.footer { background: var(--navy); color: #A9B4D6; padding: 56px 0 30px; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 36px; padding-bottom: 36px; border-bottom: 1px solid rgba(255,255,255,.1); }
.footer .brand { color: var(--white); margin-bottom: 14px; }
.footer .brand img { background: var(--yellow); }
.footer p { font-size: 15px; max-width: 320px; }
.footer h4 { color: var(--white); font-size: 16px; margin-bottom: 16px; font-family: var(--font-display); letter-spacing: 1px; }
.footer ul { list-style: none; }
.footer ul li { margin-bottom: 10px; }
.footer ul a:hover { color: var(--yellow); }
.footer-bottom { text-align: center; padding-top: 22px; font-size: 14px; color: #7E8AB0; }

/* ====== Blog list page ====== */
.page-hero {
  background: var(--navy);
  color: var(--white);
  padding: 70px 0 56px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-hero::after {
  content: "⚡";
  position: absolute; font-size: 200px; left: -20px; bottom: -80px;
  color: rgba(255, 222, 33, .07);
}
.page-hero h1 { font-family: var(--font-display); font-size: clamp(32px, 4.5vw, 52px); position: relative; }
.page-hero p { color: #C9D3F0; margin-top: 12px; position: relative; }
.blog-toolbar { display: flex; justify-content: center; padding: 36px 0 8px; }

/* ====== Post page ====== */
.post-hero {
  background: linear-gradient(135deg, var(--navy), var(--navy-3));
  color: var(--white);
  padding: 60px 0 100px;
}
.post-hero .breadcrumb { color: #A9B4D6; font-size: 14px; margin-bottom: 18px; }
.post-hero .breadcrumb a:hover { color: var(--yellow); }
.post-hero .cat {
  display: inline-block; background: var(--yellow); color: var(--navy);
  font-weight: 700; padding: 6px 16px; border-radius: 999px; font-size: 13px; margin-bottom: 16px;
}
.post-hero h1 { font-family: var(--font-display); font-size: clamp(30px, 4.4vw, 50px); line-height: 1.25; max-width: 820px; }
.post-hero .meta { margin-top: 22px; display: flex; gap: 22px; flex-wrap: wrap; color: #C9D3F0; font-size: 14px; align-items: center; }
.post-hero .meta .avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--yellow); display: inline-flex; align-items: center; justify-content: center;
  color: var(--navy); font-weight: 700; margin-right: 8px;
}
.post-cover-banner {
  height: 240px; width: calc(100% - 48px); max-width: calc(var(--maxw) - 48px);
  border-radius: var(--radius-lg); margin: -48px auto 0; position: relative;
  box-shadow: var(--shadow-md); display: flex; align-items: flex-end; padding: 24px;
}
.post-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 24px 30px;
}
.post-content h2 { font-family: var(--font-display); color: var(--navy); font-size: 28px; margin: 38px 0 14px; }
.post-content h3 { color: var(--navy); font-size: 21px; margin: 26px 0 10px; }
.post-content p { margin-bottom: 18px; font-size: 17px; color: var(--ink); }
.post-content ul, .post-content ol { margin: 0 0 18px 22px; }
.post-content li { margin-bottom: 8px; }
.post-content blockquote {
  border-left: 5px solid var(--yellow);
  background: var(--bg-2);
  padding: 16px 22px;
  border-radius: 0 14px 14px 0;
  margin: 22px 0;
  color: var(--ink-soft);
  font-style: italic;
}
.post-content code { background: var(--navy); color: var(--yellow); padding: 2px 8px; border-radius: 6px; font-size: 14px; }
.post-tags { display: flex; gap: 10px; flex-wrap: wrap; margin: 30px 0; }
.post-tags .chip { cursor: default; }
.post-nav { display: flex; justify-content: space-between; gap: 16px; margin: 40px auto; max-width: 760px; padding: 0 24px; }
.post-nav a {
  flex: 1; background: var(--white); border: 1px solid rgba(13,27,63,.08);
  border-radius: var(--radius); padding: 18px 22px; box-shadow: var(--shadow-sm); transition: transform .2s;
}
.post-nav a:hover { transform: translateY(-4px); }
.post-nav .dir { font-size: 13px; color: var(--ink-soft); }
.post-nav .ttl { color: var(--navy); font-weight: 700; margin-top: 4px; }

/* ====== About page ====== */
.about-page { padding: 70px 0; }
.about-hero { text-align: center; max-width: 720px; margin: 0 auto 50px; }
.about-hero img { width: 160px; margin: 0 auto 24px; animation: float 6s ease-in-out infinite; }
.about-hero h1 { font-family: var(--font-display); font-size: clamp(30px, 4vw, 46px); color: var(--navy); }
.about-hero p { color: var(--ink-soft); font-size: 18px; margin-top: 14px; }
.about-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 20px; }
.about-card { background: var(--white); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow-sm); border-top: 5px solid var(--yellow); }
.about-card .ico { font-size: 34px; }
.about-card h3 { color: var(--navy); margin: 12px 0 8px; font-size: 20px; }
.about-card p { color: var(--ink-soft); font-size: 15px; }
.timeline { max-width: 720px; margin: 50px auto 0; }
.timeline-item { display: flex; gap: 20px; padding-bottom: 28px; position: relative; }
.timeline-item::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: -10px; width: 2px; background: rgba(13,27,63,.12); }
.timeline-item:last-child::before { display: none; }
.timeline-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 4px var(--yellow-soft); flex-shrink: 0; margin-top: 4px; }
.timeline-item .y { font-family: var(--font-display); color: var(--navy); font-size: 18px; }
.timeline-item p { color: var(--ink-soft); }

/* ====== Animations（仅在 JS 可用时隐藏，保证无脚本也能读到内容） ====== */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* ====== Responsive ====== */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-art { order: -1; }
  .hero-actions, .hero-meta { justify-content: center; }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; }
  .about-cards { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; gap: 14px;
    position: absolute; top: 72px; left: 0; right: 0;
    background: var(--bg); padding: 22px 24px; box-shadow: var(--shadow-md);
  }
  .nav-toggle { display: block; }
  .post-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; }
  .newsletter { padding: 40px 24px; }
  .sub-form { flex-direction: column; }
  .post-nav { flex-direction: column; }
}

/* ================================================================
   v2 · 搜索 / 进度 / 分享 / SEO 组件 / 可访问性
   ================================================================ */

/* --- 可访问性 --- */
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  background: var(--yellow); color: var(--navy);
  padding: 10px 20px; border-radius: 999px; font-weight: 700;
  transition: top .2s;
}
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--yellow-deep); outline-offset: 3px; border-radius: 4px; }

/* --- 补充按钮 --- */
.btn-outline-light { background: transparent; color: var(--white); border: 2px solid rgba(255,255,255,.35); }
.btn-outline-light:hover { border-color: var(--yellow); color: var(--yellow); transform: translateY(-3px); }
.btn-outline-dark { background: transparent; color: var(--navy); border: 2px solid rgba(13,27,63,.2); }
.btn-outline-dark:hover { border-color: var(--navy); transform: translateY(-3px); }
.btn-ghost-dark { background: var(--white); color: var(--navy); border: 2px solid rgba(13,27,63,.12); }
.btn-ghost-dark:hover { border-color: var(--yellow-deep); transform: translateY(-3px); }
.btn.copied { background: var(--yellow-deep); color: var(--navy); }

/* --- 阅读进度条 --- */
.reading-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 100;
  background: var(--yellow); transform: scaleX(0); transform-origin: left center;
  opacity: 0; transition: opacity .25s ease;
}

/* --- 返回顶部 --- */
.to-top {
  position: fixed; right: 28px; bottom: 28px; z-index: 60;
  width: 48px; height: 48px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--navy); color: var(--yellow); font-size: 22px; font-weight: 700;
  box-shadow: var(--shadow-md); opacity: 0; pointer-events: none;
  transform: translateY(12px); transition: opacity .25s, transform .25s, background .2s;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { background: var(--navy-3); transform: translateY(-4px); }

/* --- RSS 订阅区 --- */
.rss-box {
  position: relative; display: flex; gap: 12px; align-items: center;
  justify-content: center; flex-wrap: wrap;
}
.rss-box code {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 15px; background: rgba(255,255,255,.1); color: var(--yellow);
  padding: 13px 20px; border-radius: 999px; border: 1px solid rgba(255,255,255,.16);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.newsletter .sub-note { margin-top: 20px; margin-bottom: 0; font-size: 13px; color: #8E9AC0; }

/* --- 文章列表：搜索 + 结果数 --- */
.blog-toolbar {
  display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 36px 0 0;
}
.search-box {
  position: relative; width: min(520px, 100%);
  display: flex; align-items: center;
  background: var(--white); border: 1.5px solid rgba(13,27,63,.1);
  border-radius: 999px; box-shadow: var(--shadow-sm);
  transition: border-color .2s, box-shadow .2s;
}
.search-box:focus-within { border-color: var(--yellow-deep); box-shadow: var(--shadow-yellow); }
.search-icon { padding-left: 20px; font-size: 16px; }
.search-box input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  padding: 14px 12px; font-size: 15px; font-family: var(--font-body); color: var(--ink);
}
.search-box input::-webkit-search-cancel-button { display: none; }
#search-clear {
  border: 0; background: rgba(13,27,63,.08); color: var(--ink-soft);
  width: 26px; height: 26px; border-radius: 50%; margin-right: 14px;
  cursor: pointer; font-size: 18px; line-height: 1;
}
#search-clear:hover { background: var(--yellow); color: var(--navy); }
.result-count { font-size: 14px; color: var(--ink-soft); }
.blog-toolbar + .post-grid { margin-top: 22px; }

/* --- 空状态 --- */
.empty-state {
  grid-column: 1 / -1; text-align: center; padding: 60px 24px;
  background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.empty-emoji { font-size: 48px; margin-bottom: 10px; }
.empty-state h2, .empty-state h3 { color: var(--navy); font-family: var(--font-display); font-size: 26px; margin-bottom: 10px; }
.empty-state p { color: var(--ink-soft); margin-bottom: 24px; }

/* --- 文章目录 --- */
.toc {
  background: var(--bg-2); border: 1px solid rgba(13,27,63,.08);
  border-left: 5px solid var(--yellow); border-radius: 0 16px 16px 0;
  padding: 20px 26px; margin: 0 0 30px;
}
.toc-title { font-weight: 700; color: var(--navy); margin-bottom: 10px; font-size: 15px; }
.toc ul { list-style: none; margin: 0; }
.toc li { margin: 0; }
.toc a { color: var(--ink-soft); font-size: 15px; display: block; padding: 4px 0; }
.toc a:hover { color: var(--yellow-deep); }
.toc-h3 a { padding-left: 18px; font-size: 14px; }
.post-content h2, .post-content h3 { scroll-margin-top: 92px; }

/* --- 分享栏 --- */
.share-bar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  padding-top: 26px; margin-top: 8px; border-top: 1px solid rgba(13,27,63,.1);
}
.share-bar .btn { font-size: 14px; padding: 11px 20px; }
.post-tags a.chip { text-decoration: none; display: inline-block; }

/* --- 相关文章 --- */
.related { max-width: 760px; margin: 20px auto 0; padding: 0 24px; }
.related h2 { font-family: var(--font-display); color: var(--navy); font-size: 26px; margin-bottom: 18px; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.related-item {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--white); border: 1px solid rgba(13,27,63,.07);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm);
  transition: transform .2s, box-shadow .2s;
}
.related-item:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); }
.related-cat { font-size: 12px; font-weight: 700; color: var(--yellow-deep); }
.related-title { color: var(--navy); font-weight: 700; font-size: 15px; line-height: 1.5; flex: 1; }
.related-date { font-size: 12px; color: var(--ink-soft); }
.post-nav .align-right { text-align: right; }

/* --- 404 --- */
.notfound { padding: 70px 0 90px; text-align: center; }
.notfound-mascot { width: 150px; margin: 0 auto 8px; animation: float 5s ease-in-out infinite; }
.notfound-code {
  font-family: var(--font-display); font-size: clamp(90px, 18vw, 170px);
  line-height: 1; color: var(--navy); letter-spacing: 6px;
}
.notfound-code span { color: var(--yellow); text-shadow: 0 6px 0 rgba(255,196,0,.25); }
.notfound h1 { font-family: var(--font-display); font-size: clamp(24px, 3.4vw, 34px); color: var(--navy); margin: 8px 0 12px; }
.notfound p { color: var(--ink-soft); margin-bottom: 26px; }
.notfound-search { display: flex; gap: 10px; max-width: 480px; margin: 0 auto 22px; }
.notfound-search input {
  flex: 1; min-width: 0; padding: 14px 20px; border-radius: 999px;
  border: 1.5px solid rgba(13,27,63,.12); font-size: 15px; outline: none; font-family: var(--font-body);
}
.notfound-search input:focus { border-color: var(--yellow-deep); }
.notfound-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* --- 减少动效偏好 --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* --- v2 响应式补充 --- */
@media (max-width: 900px) {
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .rss-box { flex-direction: column; }
  .rss-box code { width: 100%; text-align: center; }
  .related-grid { grid-template-columns: 1fr; }
  .share-bar .btn { flex: 1; justify-content: center; }
  .notfound-search { flex-direction: column; }
  .to-top { right: 18px; bottom: 18px; width: 44px; height: 44px; }
  .toc { padding: 16px 18px; }
}

/* ================================================================
   v3 · 深色主题 / 品牌封面 / 归档 / 视图 / 收藏 / 阅读增强
   ================================================================ */

/* 主题变量。字体全部走系统字体栈：不再向外网请求 Google Fonts；
   若本机恰好装了 ZCOOL KuaiLe，会自动优先使用。 */
:root {
  --surface: #ffffff;
  --border: rgba(13, 27, 63, .09);
  --heading: #0D1B3F;
  --nav-bg: rgba(255, 253, 245, .82);
}
html[data-theme="dark"] {
  --ink: #E7EDFB;
  --ink-soft: #A6B2CE;
  --bg: #0B142B;
  --bg-2: #101C36;
  --surface: #17233F;
  --border: rgba(255, 255, 255, .13);
  --heading: #F4F7FF;
  --nav-bg: rgba(11, 20, 43, .88);
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, .28);
  --shadow-md: 0 14px 40px rgba(0, 0, 0, .42);
}

/* --- 深色模式的表面与文字 --- */
html[data-theme="dark"] .nav { background: var(--nav-bg); border-bottom-color: var(--border); }
html[data-theme="dark"] .post-card,
html[data-theme="dark"] .about-card,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .related-item,
html[data-theme="dark"] .post-nav a,
html[data-theme="dark"] .search-box,
html[data-theme="dark"] .chip,
html[data-theme="dark"] .btn-ghost-dark,
html[data-theme="dark"] .stat-box,
html[data-theme="dark"] .month-group,
html[data-theme="dark"] .mini-post,
html[data-theme="dark"] .tag-cloud-item,
html[data-theme="dark"] .filter-pill,
html[data-theme="dark"] .view-toggle { background: var(--surface); border-color: var(--border); }
html[data-theme="dark"] .sec-head h2,
html[data-theme="dark"] .post-body h3,
html[data-theme="dark"] .about-text h2,
html[data-theme="dark"] .about-hero h1,
html[data-theme="dark"] .about-card h3,
html[data-theme="dark"] .timeline-item .y,
html[data-theme="dark"] .post-content h2,
html[data-theme="dark"] .post-content h3,
html[data-theme="dark"] .toc-title,
html[data-theme="dark"] .post-nav .ttl,
html[data-theme="dark"] .related h2,
html[data-theme="dark"] .related-title,
html[data-theme="dark"] .empty-state h2,
html[data-theme="dark"] .empty-state h3,
html[data-theme="dark"] .notfound-code,
html[data-theme="dark"] .notfound h1,
html[data-theme="dark"] .month-title,
html[data-theme="dark"] .personal-col h3,
html[data-theme="dark"] .stat-box .stat-n,
html[data-theme="dark"] .nav .brand,
html[data-theme="dark"] .nav-toggle { color: var(--heading); }
html[data-theme="dark"] .btn-navy { background: var(--yellow); color: #0D1B3F; }
html[data-theme="dark"] .btn-outline-dark { border-color: var(--border); }
html[data-theme="dark"] .btn-outline-dark:hover { border-color: var(--yellow-deep); }
html[data-theme="dark"] .card-tags span { background: rgba(255,255,255,.09); }
html[data-theme="dark"] .nav-links a,
html[data-theme="dark"] .btn-ghost-dark,
html[data-theme="dark"] .btn-outline-dark { color: var(--ink); }
html[data-theme="dark"] .nav-cta { background: var(--yellow); color: #0D1B3F !important; }
html[data-theme="dark"] .notfound-search input { background: var(--surface); color: var(--ink); border-color: var(--border); }
html[data-theme="dark"] #search-clear { background: rgba(255,255,255,.14); color: var(--ink-soft); }
html[data-theme="dark"] .toc,
html[data-theme="dark"] .share-bar,
html[data-theme="dark"] .timeline-item::before { border-color: var(--border); }
html[data-theme="dark"] .theme-toggle { background: var(--surface); color: var(--ink); }
html[data-theme="dark"] .quote-copy { background: rgba(255,255,255,.12); color: var(--ink-soft); }
html[data-theme="dark"] .post-cover-banner { box-shadow: 0 18px 44px rgba(0,0,0,.5); }

/* --- 主题切换按钮 --- */
.nav-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.theme-toggle {
  border: 1.5px solid var(--border); background: var(--surface); color: var(--ink);
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  font-size: 17px; line-height: 1; display: inline-flex;
  align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  transition: transform .25s, background .2s, border-color .2s;
}
.theme-toggle svg { display: block; }
.theme-toggle:hover { transform: rotate(20deg); background: var(--yellow); border-color: var(--yellow); color: var(--navy); }

/* --- 卡片标签行 --- */
.card-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.card-tags span {
  font-size: 12px; color: var(--ink-soft); background: var(--bg-2);
  border-radius: 999px; padding: 3px 10px; line-height: 1.6;
}
.card-tags .match-hint { background: var(--yellow-soft); color: #7A5600; font-weight: 700; }

/* --- 程序化封面 --- */
.cover-art { background-size: cover; background-position: center; background-repeat: no-repeat; }
.cover-grad::after { display: none !important; }
.mark, mark { background: var(--yellow); color: #0D1B3F; padding: 0 3px; border-radius: 4px; }

/* --- 列表工具栏：视图切换 + 筛选提示 --- */
.toolbar-row { display: flex; gap: 12px; align-items: center; justify-content: center; width: 100%; flex-wrap: wrap; }
.view-toggle {
  display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.view-toggle button {
  border: 0; background: transparent; color: var(--ink-soft); cursor: pointer;
  width: 36px; height: 32px; border-radius: 999px; font-size: 15px; line-height: 1;
}
.view-toggle button.active { background: var(--navy); color: var(--yellow); }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; }
.active-filters:empty { display: none; }
.filter-label { font-size: 13px; color: var(--ink-soft); }
.filter-pill, .filter-clear {
  border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 6px 15px; font-size: 13px; cursor: pointer;
  font-family: var(--font-body);
}
.filter-pill:hover { border-color: var(--yellow-deep); }
.filter-clear { background: transparent; color: var(--ink-soft); }

/* --- 列表视图 --- */
.post-grid.list-view { grid-template-columns: 1fr; max-width: 860px; margin-left: auto; margin-right: auto; }
.post-grid.list-view .post-card { flex-direction: row; }
.post-grid.list-view .post-cover { width: 250px; height: auto; min-height: 172px; flex-shrink: 0; }
.post-grid.list-view .post-body { flex: 1; }

/* --- 归档页 --- */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.stat-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 18px; text-align: center; box-shadow: var(--shadow-sm);
}
.stat-ico { font-size: 26px; }
.stat-n { font-family: var(--font-display); font-size: 24px; color: var(--heading); margin-top: 6px; }
.stat-l { font-size: 13px; color: var(--ink-soft); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.tag-cloud-item {
  display: inline-flex; align-items: flex-start; gap: 3px; font-weight: 700;
  padding: 8px 18px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--border); color: var(--ink);
  transition: transform .2s, background .2s;
}
.tag-cloud-item:hover { background: var(--yellow); color: var(--navy); transform: translateY(-3px); }
.tag-cloud-item sup { font-size: 11px; color: var(--yellow-deep); }
.month-group {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px 26px; margin-bottom: 18px;
}
.month-title {
  font-family: var(--font-display); color: var(--heading); font-size: 22px;
  display: flex; justify-content: space-between; align-items: baseline;
}
.month-title span { font-family: var(--font-body); font-size: 13px; color: var(--ink-soft); }
.month-group ul { list-style: none; margin: 14px 0 0; }
.month-group li {
  display: flex; gap: 14px; align-items: baseline;
  padding: 10px 0; border-top: 1px dashed var(--border);
}
.month-day { color: var(--yellow-deep); font-weight: 700; font-size: 13px; min-width: 42px; }
.month-group li a { flex: 1; color: var(--ink); font-weight: 600; }
.month-group li a:hover { color: var(--yellow-deep); }
.month-cat { font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.personal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.personal-col h3 { font-family: var(--font-display); color: var(--heading); font-size: 22px; margin-bottom: 14px; }
.mini-post {
  display: flex; justify-content: space-between; gap: 12px; align-items: baseline;
  padding: 12px 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; margin-bottom: 10px; color: var(--ink); font-weight: 600;
}
.mini-post:hover { border-color: var(--yellow-deep); }
.mini-post small { color: var(--ink-soft); font-weight: 400; white-space: nowrap; }
.muted-empty { color: var(--ink-soft); font-size: 15px; }

/* --- 阅读增强 --- */
.toc a.active { color: var(--yellow-deep); font-weight: 700; border-left: 3px solid var(--yellow); padding-left: 8px; }
.quote-copy {
  position: absolute; right: 10px; top: 10px; border: 0; cursor: pointer;
  background: rgba(13,27,63,.08); color: var(--ink-soft);
  width: 28px; height: 28px; border-radius: 8px; font-size: 14px;
  opacity: 0; transition: opacity .2s, background .2s;
}
blockquote:hover .quote-copy, .quote-copy:focus-visible { opacity: 1; }
.quote-copy:hover { background: var(--yellow); color: var(--navy); }
.kbd-hint { font-size: 12px; color: var(--ink-soft); margin-top: 10px; }
kbd {
  display: inline-block; padding: 1px 6px; border: 1px solid var(--border);
  border-bottom-width: 2px; border-radius: 5px; background: var(--surface);
  font-family: ui-monospace, Consolas, monospace; font-size: 11px;
}

/* --- v3 响应式 --- */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .personal-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .toolbar-row { flex-direction: column; }
  .view-toggle { align-self: center; }
  .post-grid.list-view .post-card { flex-direction: column; }
  .post-grid.list-view .post-cover { width: 100%; height: 168px; min-height: 0; }
  .month-group { padding: 18px; }
  .month-group li { flex-wrap: wrap; gap: 6px; }
  .nav-links { gap: 18px; }
}

/* ================================================================
   v4 · AI 专题随笔栏目
   ================================================================ */
.ai-home-section {
  background: linear-gradient(135deg, rgba(255, 222, 33, .16), rgba(255, 249, 214, .35) 55%, rgba(77, 163, 255, .08));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.ai-home-foot {
  display: flex; align-items: center; flex-wrap: wrap; gap: 14px;
  margin-top: 30px; padding-top: 24px; border-top: 1px dashed var(--border);
  color: var(--ink-soft); font-size: 14px;
}
.ai-home-foot strong { color: var(--heading); font-size: 20px; }
.ai-home-foot .btn { margin-left: auto; }
.ai-home-foot .btn + .btn { margin-left: 10px; }
.ai-empty {
  padding: 30px; text-align: center; color: var(--ink-soft);
  background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius);
}

/* --- 专题页 hero 与声明卡 --- */
.ai-hero { position: relative; overflow: hidden; }
.ai-hero-badge {
  display: inline-block; margin-bottom: 16px; padding: 6px 16px;
  background: var(--yellow); color: var(--navy); font-weight: 700;
  font-size: 13px; border-radius: 999px;
}
.ai-hero-sub { opacity: .85; font-size: 15px; margin-top: 6px; }
.ai-disclaimer {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 5px solid var(--yellow);
  border-radius: var(--radius); padding: 32px 36px; box-shadow: var(--shadow-sm);
}
.ai-disclaimer h2 { color: var(--heading); font-size: 24px; margin-bottom: 12px; }
.ai-disclaimer p { color: var(--ink-soft); }
.ai-disclaimer ul { margin: 16px 0 16px 22px; color: var(--ink-soft); }
.ai-disclaimer li { margin: 8px 0; }
.ai-disclaimer-foot { font-size: 13px; border-top: 1px dashed var(--border); padding-top: 14px; }
.ai-topic-line { text-align: center; margin-top: 22px; color: var(--ink-soft); font-size: 15px; }
.ai-topic-line strong { color: var(--heading); }
.ai-stat-date { font-size: 26px !important; }

/* --- 随笔列表行 --- */
.ai-list { display: flex; flex-direction: column; gap: 16px; }
.ai-row {
  display: flex; align-items: center; gap: 24px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px 28px;
  box-shadow: var(--shadow-sm); transition: transform .25s, box-shadow .25s, border-color .25s;
}
.ai-row:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--yellow-deep); }
.ai-row-date {
  flex: 0 0 82px; text-align: center; border-right: 1px solid var(--border); padding-right: 20px;
}
.ai-row-date .d { display: block; font-size: 24px; font-weight: 800; color: var(--heading); line-height: 1.2; }
.ai-row-date .y { display: block; font-size: 12px; color: var(--ink-soft); letter-spacing: .08em; }
.ai-row-main { flex: 1; min-width: 0; }
.ai-row-main h3 { color: var(--heading); font-size: 20px; margin-bottom: 6px; }
.ai-row-main p {
  color: var(--ink-soft); font-size: 14px; line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ai-row-meta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 12px; color: var(--ink-soft); }
.ai-topic { color: var(--yellow-deep); font-weight: 700; }
.ai-row-arrow { flex: 0 0 auto; font-size: 22px; color: var(--yellow-deep); }

/* --- 运行机制 --- */
.ai-how { display: grid; grid-template-columns: 1.6fr .8fr; gap: 48px; align-items: center; }
.ai-how-text h2 { color: var(--heading); font-size: 28px; margin: 12px 0 20px; }
.ai-steps { margin-left: 22px; color: var(--ink-soft); }
.ai-steps li { margin: 12px 0; }
.ai-steps strong { color: var(--heading); }
.ai-how-note {
  margin-top: 22px; padding: 16px 18px; font-size: 13px; line-height: 1.8;
  background: rgba(255, 222, 33, .14); border: 1px solid var(--border); border-radius: 14px;
  color: var(--ink-soft);
}
.ai-how-note code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.ai-how-art img { max-width: 260px; margin: 0 auto; filter: drop-shadow(0 18px 30px rgba(13, 27, 63, .18)); }

/* --- 文章卡片上的 AI 标记 --- */
.ai-flag {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  background: var(--yellow); color: var(--navy); font-size: 11px; font-weight: 800;
  padding: 4px 10px; border-radius: 999px; box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}
.post-cover { position: relative; }
.ai-badge {
  display: inline-block; background: var(--yellow); color: var(--navy);
  font-size: 12px; font-weight: 800; padding: 4px 12px; border-radius: 999px;
}
.ai-badge.inline { margin-left: 10px; vertical-align: middle; }

/* --- 文章页：AI 声明 + 参考资料 --- */
.ai-notice {
  margin: 0 0 30px; padding: 22px 26px;
  background: rgba(255, 222, 33, .13);
  border: 1px solid var(--border); border-left: 5px solid var(--yellow);
  border-radius: 16px; font-size: 14px; line-height: 1.85; color: var(--ink-soft);
}
.ai-notice strong { color: var(--heading); }
.ai-notice p + p { margin-top: 8px; }
.ai-notice-meta { font-size: 12px; opacity: .9; }
.ai-notice-meta a { color: var(--yellow-deep); font-weight: 700; }
.references {
  margin: 44px 0 28px; padding: 26px 30px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius);
}
.references h2 { color: var(--heading); font-size: 21px; margin-bottom: 8px; }
.ref-note { font-size: 12px; color: var(--ink-soft); margin-bottom: 16px; }
.references ol { margin-left: 22px; }
.references li { margin: 12px 0; line-height: 1.7; color: var(--ink-soft); }
.references li a { color: var(--navy-3); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.references li a:hover { color: var(--yellow-deep); }
.ref-pub { display: block; font-size: 12px; opacity: .8; }

/* --- 深色模式 --- */
html[data-theme="dark"] .ai-home-section {
  background: linear-gradient(135deg, rgba(255, 222, 33, .09), rgba(23, 35, 63, .6) 55%, rgba(77, 163, 255, .06));
}
html[data-theme="dark"] .ai-row,
html[data-theme="dark"] .ai-disclaimer,
html[data-theme="dark"] .ai-empty { background: var(--surface); border-color: var(--border); }
html[data-theme="dark"] .ai-row-main h3,
html[data-theme="dark"] .ai-disclaimer h2,
html[data-theme="dark"] .ai-how-text h2,
html[data-theme="dark"] .references h2 { color: var(--heading); }
html[data-theme="dark"] .ai-notice { background: rgba(255, 222, 33, .08); }
html[data-theme="dark"] .references { background: var(--surface); border-color: var(--border); }
html[data-theme="dark"] .references li a { color: var(--yellow); }
html[data-theme="dark"] .ai-topic { color: var(--yellow); }
html[data-theme="dark"] .ai-how-note { background: rgba(255, 222, 33, .07); }

/* 专题页是 4 项统计，单独给一行 4 列，避免第 4 个孤零零换行 */
body[data-page="ai"] .stats-grid { grid-template-columns: repeat(4, 1fr); }

/* --- v4 响应式 --- */
@media (max-width: 900px) {
  .ai-how { grid-template-columns: 1fr; gap: 24px; }
  .ai-how-art { order: -1; }
  .ai-how-art img { max-width: 160px; }
  body[data-page="ai"] .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .ai-row { flex-direction: column; align-items: flex-start; gap: 12px; padding: 20px; }
  .ai-row-date { flex: none; border-right: 0; border-bottom: 1px solid var(--border); padding: 0 0 10px; text-align: left; display: flex; align-items: baseline; gap: 8px; }
  .ai-row-date .d { font-size: 19px; }
  .ai-row-arrow { display: none; }
  .ai-disclaimer { padding: 24px 20px; }
  .references { padding: 20px; }
  .ai-home-foot .btn { margin-left: 0; }
  .ai-home-foot .btn + .btn { margin-left: 0; }
}
