/* ============================================================
   子皮的网络日志 · 橙皮黄 × 中国风
   宣纸白底 + 黛青正文 + 橙皮黄点缀
   ============================================================ */
:root {
  --bg: #FDFBF6;           /* 宣纸白 */
  --hero-from: #FFFDF8;
  --hero-to: #F7ECD4;      /* 淡杏 */
  --ink: #2B3A42;          /* 黛青 */
  --ink-soft: #6E6759;     /* 暖灰褐 */
  --ink-faint: #A69F90;
  --line: #EFE8D9;
  --accent: #FCA104;       /* 橙皮黄 */
  --accent-deep: #E08F00;  /* 深橙（悬停） */
  --accent-ink: #B87200;   /* 焦茶橙（小字链接，保证可读性） */
  --radius-lg: 18px;
  --serif: "EB Garamond", "Noto Serif SC", "Songti SC", serif;
  --sans: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.3; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 32px; }

/* ---------- 头部：紧凑、无重边框 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(253, 251, 246, 0.82);
  backdrop-filter: blur(12px);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 20px; position: relative; }
.brand { font-family: var(--serif); font-size: 19px; letter-spacing: 2px; color: var(--ink); }
.site-nav { display: flex; align-items: center; gap: 24px; }
.site-nav a { font-size: 13.5px; color: var(--ink-soft); transition: color .15s; }
.site-nav a:hover { color: var(--ink); }
.nav-toggle, .nav-burger { display: none; }

/* ---------- Hero：柔和渐变 + 大衬线标题 ---------- */
.hero {
  background: linear-gradient(150deg, var(--hero-from) 0%, #FAF0DC 55%, var(--hero-to) 100%);
  padding: 110px 0 96px;
}
.hero h1 {
  font-size: clamp(44px, 6.5vw, 76px);
  font-weight: 400; line-height: 1.15; letter-spacing: -0.5px;
  color: var(--ink); max-width: 900px;
}
.hero h1 em { font-style: italic; }
.hero-sub { margin-top: 26px; font-size: 15px; color: var(--ink-soft); letter-spacing: 1px; }

/* ---------- 区块 ---------- */
.section { padding: 56px 0 12px; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 30px;
}
.section-head h2 { font-size: clamp(26px, 3vw, 36px); font-weight: 400; letter-spacing: 1px; }
.section-more { font-size: 13.5px; color: var(--ink-faint); transition: color .15s; }
.section-more:hover { color: var(--accent); }

/* ---------- 卡片公共叠层 ---------- */
.card-overlay {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 18px 18px 16px; color: #fff;
}
.card-overlay::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to top, rgba(16, 21, 27, 0.88) 0%, rgba(16, 21, 27, 0.42) 42%, rgba(16, 21, 27, 0) 80%);
  border-radius: inherit;
}
.card-overlay h3 { text-shadow: 0 1px 8px rgba(16, 21, 27, 0.45); }
.card-overlay h3 {
  font-size: 16.5px; color: #fff; line-height: 1.45;
  margin-bottom: 5px; font-weight: 500;
}
.card-meta { font-size: 11.5px; color: rgba(255,255,255,.72); letter-spacing: 1px; }

/* ---------- 精选：一行四张竖版卡片 ---------- */
.feature-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.feature-card {
  position: relative; display: block; overflow: hidden;
  border-radius: var(--radius-lg); aspect-ratio: 3 / 4; background: #F2E8D0;
}
.feature-card img, .grid-card img {
  width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease;
}
.feature-card:hover img, .grid-card:hover img { transform: scale(1.05); }

/* ---------- 最新发布：三列图片卡片 ---------- */
.grid-feed { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.grid-card {
  position: relative; display: block; overflow: hidden;
  border-radius: var(--radius-lg); aspect-ratio: 4 / 3; background: #F2E8D0;
}


/* ---------- 内页页头 ---------- */
.page-head { padding: 56px 0 22px; margin-bottom: 8px; }
.page-head h1 { font-size: clamp(30px, 4vw, 44px); font-weight: 400; }
.page-desc { color: var(--ink-soft); margin-top: 10px; font-size: 14px; }

/* ---------- 频道页文章列表 ---------- */
.post-list { display: flex; flex-direction: column; }
.post-row {
  display: flex; gap: 20px; align-items: flex-start; justify-content: space-between;
  padding: 24px 0; border-bottom: 1px solid var(--line);
}
.post-row h3 { font-size: 20px; margin-bottom: 6px; transition: color .15s; }
.post-row:hover h3 { color: var(--accent); }
.post-row .summary { font-size: 13.5px; color: var(--ink-soft); margin-bottom: 8px; }
.post-card-foot { display: flex; gap: 14px; font-size: 12px; color: var(--ink-faint); flex-wrap: wrap; }

/* ---------- 标签 ---------- */
.chip {
  display: inline-block; font-size: 11px; letter-spacing: 1px;
  padding: 3px 12px; border-radius: 50px; border: 1px solid var(--line);
  color: var(--ink-soft); white-space: nowrap;
}
.chip-channel, .chip-topic { border-color: var(--accent); color: var(--accent); margin-bottom: 10px; }
.tag { color: var(--accent); font-size: 12.5px; }

/* ---------- 专题 ---------- */
.topic-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.topic-card {
  display: block; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 26px 30px; transition: box-shadow .2s;
}
.topic-card:hover { box-shadow: 0 6px 24px rgba(30, 38, 49, 0.08); }
.topic-card h3 { font-size: 21px; margin-bottom: 6px; }
.topic-card p { font-size: 13.5px; color: var(--ink-soft); margin-bottom: 10px; }
.topic-count { font-size: 12px; letter-spacing: 1px; color: var(--accent); }
.topic-list { list-style: none; }
.topic-item {
  display: flex; gap: 18px; align-items: flex-start;
  padding: 20px 0; border-bottom: 1px solid var(--line);
}
.topic-no {
  width: 32px; height: 32px; flex: none; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 13.5px;
}
.topic-item h3 { font-size: 18px; margin-bottom: 4px; }
.topic-item:hover h3 { color: var(--accent); }
.topic-item time { font-size: 12px; color: var(--ink-faint); }

/* ---------- 文章页 ---------- */
.post-detail { max-width: 720px; margin: 44px auto 56px; }
.post-detail-head { margin-bottom: 34px; }
.post-detail-head h1 {
  font-size: clamp(28px, 4vw, 40px); font-weight: 400;
  line-height: 1.4; margin: 14px 0 16px;
}
.post-meta { display: flex; gap: 14px; font-size: 12.5px; color: var(--ink-faint); flex-wrap: wrap; }
.post-cover {
  width: 100%; max-height: 440px; object-fit: cover;
  border-radius: var(--radius-lg); margin-bottom: 36px;
}
.post-body { font-size: 16px; line-height: 2; color: var(--ink); }
.post-body p { margin-bottom: 18px; }
.post-body h2 {
  font-size: 25px; margin: 42px 0 14px; font-weight: 500;
}
.post-body h3 { font-size: 19px; margin: 30px 0 10px; }
.post-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.post-body blockquote {
  border-left: 3px solid var(--accent); padding: 4px 0 4px 20px;
  margin: 24px 0; color: var(--ink-soft); font-family: var(--serif); font-size: 17.5px;
}
.post-body pre {
  background: var(--ink); color: #EDEAE0; padding: 18px 20px;
  border-radius: 10px; overflow-x: auto; font-size: 13px; margin: 22px 0; line-height: 1.7;
}
.post-body code { font-family: "SFMono-Regular", Consolas, monospace; }
.post-body p code { background: #F7F1E1; padding: 2px 7px; border-radius: 4px; font-size: 13.5px; }
.post-body ul, .post-body ol { padding-left: 24px; margin-bottom: 18px; }
.post-body li { margin-bottom: 6px; }
.post-body table { border-collapse: collapse; width: 100%; margin: 22px 0; font-size: 14px; }
.post-body th, .post-body td { border: 1px solid var(--line); padding: 9px 14px; text-align: left; }
.post-body th { background: #F7F1E1; font-weight: 500; }
.post-body img { border-radius: 10px; margin: 8px 0; }
.post-body video, .post-body iframe { width: 100%; border: 0; border-radius: var(--radius-lg); margin: 20px 0; }
.post-body iframe { aspect-ratio: 16 / 9; }
.post-nav {
  display: flex; gap: 16px; justify-content: space-between;
  margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line);
  font-size: 13.5px; flex-wrap: wrap;
}
.post-nav-item { color: var(--ink-soft); }
.post-nav-item:hover { color: var(--accent); }
.post-nav-item.right { margin-left: auto; text-align: right; }

/* ---------- 归档 ---------- */
.archive-month { padding: 22px 0; border-bottom: 1px solid var(--line); }
.archive-month h2 { font-size: 20px; color: var(--accent); margin-bottom: 10px; }
.archive-month ul { list-style: none; }
.archive-month li { display: flex; gap: 18px; padding: 6px 0; font-size: 14.5px; }
.archive-month time { color: var(--ink-faint); font-size: 12.5px; width: 52px; flex: none; }

/* ---------- 页脚 ---------- */
.site-footer { padding: 40px 0 44px; }
.footer-inner { text-align: center; }
.site-footer .fine { font-size: 12px; color: var(--ink-faint); }
.site-footer .fine a { color: var(--ink-faint); text-decoration: none; }
.site-footer .fine a:hover { color: var(--accent); }

/* ---------- 移动端 ---------- */
@media (max-width: 900px) {
  .feature-row { grid-template-columns: repeat(2, 1fr); }
  .grid-feed { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .wrap { padding: 0 20px; }
  .hero { padding: 72px 0 60px; }
  .hero h1 { font-size: 42px; }
  .feature-row, .grid-feed { grid-template-columns: 1fr; }
  .feature-card { aspect-ratio: 4 / 3; }

  /* 汉堡按钮固定在最右 */
  .nav-burger {
    display: block; cursor: pointer; margin-left: auto; flex: none;
    width: 30px; height: 26px; position: relative; z-index: 1002;
  }
  .nav-burger span {
    position: absolute; left: 3px; right: 3px; top: 12px; height: 1.8px;
    background: var(--ink); border-radius: 2px; transition: .2s;
  }
  .nav-burger::before, .nav-burger::after {
    content: ""; position: absolute; left: 3px; right: 3px; height: 1.8px;
    background: var(--ink); border-radius: 2px; transition: .2s;
  }
  .nav-burger::before { top: 4px; }
  .nav-burger::after { top: 20px; }
  /* 展开时汉堡变叉 */
  .nav-toggle:checked ~ .nav-burger span { background: transparent; }
  .nav-toggle:checked ~ .nav-burger::before { top: 12px; transform: rotate(45deg); }
  .nav-toggle:checked ~ .nav-burger::after { top: 12px; transform: rotate(-45deg); }

  /* 下拉菜单：fixed 定位脱离 sticky 头部层叠上下文，靠右、实色、阴影、最高层 */
  .header-inner .site-nav {
    display: none;
    position: fixed; top: 60px; right: 16px;
    width: max-content; min-width: 116px; max-width: calc(100vw - 32px);
    flex-direction: column; align-items: stretch;
    gap: 0; padding: 8px 0;
    background: #FFFFFF;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(43, 58, 66, .22);
    z-index: 1001;
  }
  /* 高特异性，确保覆盖后面 284 行的 .site-nav a 定义 */
  .header-inner .site-nav a {
    padding: 11px 20px; font-size: 14.5px; width: auto;
    text-align: right; line-height: 1.5; border-radius: 0;
  }
  .header-inner .site-nav a::after { display: none; }
  .nav-toggle:checked ~ .site-nav { display: flex; }
  /* 展开时把头部提到最上层（含 fixed 菜单），避免被正文卡片盖住 */
  .site-header:has(.nav-toggle:checked) { z-index: 1000; }
  .post-detail { margin: 24px auto 36px; }
  .section { padding: 40px 0 8px; }
}

/* ============================================================
   阅读体验打磨层
   ============================================================ */

::selection { background: rgba(252, 161, 4, .22); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 0 0 10px 0;
  font-size: 13px;
}
.skip-link:focus { left: 0; }

/* ---------- 导航：当前页高亮 + 细线动画 ---------- */
.site-nav a { position: relative; padding: 4px 0; }
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform .22s ease;
}
.site-nav a:hover::after, .site-nav a.is-active::after { transform: scaleX(1); }
.site-nav a.is-active { color: var(--ink); }

/* ---------- 卡片：悬停上浮 ---------- */
.feature-card, .grid-card {
  transition: transform .35s cubic-bezier(.2, .7, .3, 1), box-shadow .35s ease;
  will-change: transform;
}
.feature-card:hover, .grid-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(43, 58, 66, .14);
}

/* ---------- 按钮 ---------- */

/* ---------- 文章：目录 + 正文双栏 ---------- */
.post-layout {
  display: grid; grid-template-columns: minmax(0, 720px) 216px;
  gap: 56px; justify-content: center; align-items: start;
  margin: 40px 0 24px;
}
.post-layout .post-detail { max-width: none; margin: 0; }

.post-toc { position: sticky; top: 92px; padding-top: 4px; font-size: 13px; }
.toc-title {
  font-size: 11px; letter-spacing: 2px; color: var(--ink-faint);
  margin-bottom: 12px;
}
.post-toc ol { list-style: none; border-left: 1px solid var(--line); }
.post-toc li a {
  display: block; padding: 6px 0 6px 14px; margin-left: -1px;
  border-left: 1px solid transparent; color: var(--ink-soft);
  line-height: 1.55; transition: color .15s, border-color .15s;
}
.post-toc li a:hover { color: var(--ink); }
.post-toc li a.is-current { color: var(--accent); border-left-color: var(--accent); }
.post-toc .toc-lvl-3 a { padding-left: 26px; font-size: 12.5px; }

.toc-mobile {
  display: none; max-width: 760px; margin: 28px auto 0;
  border: 1px solid var(--line); border-radius: 12px;
  background: #fff; padding: 14px 18px;
}
.toc-mobile summary { cursor: pointer; font-size: 13.5px; color: var(--ink-soft); list-style: none; }
.toc-mobile summary::-webkit-details-marker { display: none; }
.toc-mobile summary::before { content: "▸ "; color: var(--accent); }
.toc-mobile[open] summary::before { content: "▾ "; }
.toc-mobile ol { margin: 10px 0 2px 18px; font-size: 13.5px; line-height: 2; }
.toc-mobile li.lvl-3 { margin-left: 14px; font-size: 12.5px; }

/* ---------- 阅读进度 ---------- */
.reading-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; pointer-events: none; }
.reading-progress span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, #FFB733, var(--accent));
  transition: width .12s linear;
}

/* ---------- 文章头部 ---------- */
.post-chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.post-chips .chip { margin-bottom: 0; }
.post-detail-head { margin-bottom: 32px; }
.post-detail-head h1 { margin: 16px 0 16px; letter-spacing: -.2px; }
.post-meta { align-items: center; }
.post-meta .meta-dot { color: var(--ink-faint); }
.post-cover-wrap { margin: 0 0 36px; }
.post-cover { margin: 0; max-height: 460px; }
.post-tags { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 34px; }

/* ---------- 正文排版 ---------- */
.post-body { font-size: 16.5px; line-height: 1.95; letter-spacing: .01em; }
.post-body p { margin-bottom: 20px; }
.post-body h2 { position: relative; padding-bottom: 12px; margin: 46px 0 18px; }
.post-body h2::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 34px; height: 2px; background: var(--accent);
}
.post-body h3 { margin: 32px 0 12px; }
.post-body ul li::marker, .post-body ol li::marker { color: var(--accent); }
.post-body blockquote {
  background: #FDF6E7; border-radius: 0 8px 8px 0;
  padding: 14px 20px; margin: 26px 0;
}
.post-body table { font-size: 14.5px; }
.post-body tbody tr:nth-child(even) { background: #FCF9F0; }
.post-body hr { border: 0; border-top: 1px solid var(--line); margin: 42px 0; }
.post-body img { cursor: zoom-in; transition: opacity .2s; }
.post-body img:hover { opacity: .92; }

/* 代码块：相对定位 + 复制按钮 */
.post-body pre, .post-body .codehilite { position: relative; }
.post-body .codehilite pre { margin: 22px 0; }
.copy-btn {
  position: absolute; top: 9px; right: 9px; z-index: 3;
  background: rgba(255, 255, 255, .12); color: #EDEAE0;
  border: 1px solid rgba(255, 255, 255, .2); border-radius: 6px;
  font-size: 11px; letter-spacing: .5px; padding: 4px 9px;
  cursor: pointer; opacity: 0; transform: translateY(-2px);
  transition: opacity .18s, background .18s, border-color .18s;
}
.post-body pre:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; transform: none; }
.copy-btn:hover { background: rgba(255, 255, 255, .22); }
.copy-btn.done { background: var(--accent); border-color: var(--accent); color: #fff; opacity: 1; }

/* ---------- 上下篇 ---------- */
.post-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  border-top: 1px solid var(--line); padding-top: 24px; margin-top: 46px;
}
.post-nav-item { display: flex; flex-direction: column; gap: 5px; }
.post-nav-item.right { text-align: right; align-items: flex-end; }
.nav-label { font-size: 11.5px; letter-spacing: 1px; color: var(--ink-faint); }
.nav-title { font-size: 14.5px; font-family: var(--serif); line-height: 1.45; transition: color .15s; }
.post-nav-item:hover .nav-title { color: var(--accent); }


/* ---------- 返回顶部 ---------- */
.back-to-top {
  position: fixed; right: 28px; bottom: 32px; z-index: 70;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px); color: var(--ink-soft); font-size: 15px;
  cursor: pointer; box-shadow: 0 6px 20px rgba(43, 58, 66, .10);
  transition: color .18s, transform .18s, box-shadow .18s;
}
.back-to-top:hover { color: var(--accent); transform: translateY(-2px); box-shadow: 0 10px 26px rgba(43, 58, 66, .14); }
.back-to-top[hidden] { display: none; }

/* ---------- 列表页缩略图 ---------- */
.post-row { transition: background .18s; }
.post-row:hover h3 { color: var(--accent); }
.post-row-thumb {
  width: 132px; height: 88px; flex: none; object-fit: cover;
  border-radius: 10px; background: #F2E8D0;
  transition: transform .35s ease;
}
.post-row:hover .post-row-thumb { transform: scale(1.03); }
.empty-state { padding: 60px 0; text-align: center; color: var(--ink-faint); font-size: 14px; }

/* ---------- 归档 ---------- */
.archive-month li a { transition: color .15s; }
.archive-month li a:hover { color: var(--accent); }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 24px; }

/* ---------- 滚动淡入（仅下方元素，JS 未执行时保持可见） ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s cubic-bezier(.2, .7, .3, 1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none; }
  .feature-card, .grid-card, }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .post-layout { grid-template-columns: minmax(0, 760px); }
  .post-toc { display: none; }
  .toc-mobile { display: block; }
}
@media (max-width: 760px) {
}
@media (max-width: 640px) {
  .post-nav { grid-template-columns: 1fr; gap: 20px; }
  .post-nav-item.right { text-align: left; align-items: flex-start; }
  .post-body { font-size: 16px; }
  .post-body h2 { font-size: 22px; }
  .back-to-top { right: 16px; bottom: 20px; width: 38px; height: 38px; }
  .post-row-thumb { width: 96px; height: 68px; }
  }

/* 图片放大 */
.img-lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 4vw; background: rgba(16, 20, 25, .92);
  opacity: 0; transition: opacity .2s ease; cursor: zoom-out;
}
.img-lightbox.show { opacity: 1; }
.img-lightbox img {
  max-width: 100%; max-height: 92vh; border-radius: 8px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}

/* 锚点跳转避开吸顶导航 */
.post-body h2, .post-body h3 { scroll-margin-top: 88px; }

/* 列表页补充 */
.page-count { margin-top: 10px; font-size: 12.5px; color: var(--ink-faint); letter-spacing: .5px; }
.topic-item .summary { font-size: 13.5px; color: var(--ink-soft); margin: 2px 0 6px; line-height: 1.7; }
.post-row-main { min-width: 0; }
.post-row-main h3 { line-height: 1.45; }

/* 404 */
.error-code { font-family: var(--serif); font-size: 13px; letter-spacing: 8px; color: var(--accent); margin-bottom: 8px; }
