/* esao.life 博客共享样式 —— 手维源文件（非生成物）；md2html 不代产 CSS（决策 D-1，设计-博客壳重做-v1.md §2.1.3） */
/* 2026-08-28 阶段 1 换肤 V2「花园的昼与夜」；原「生成文件，勿手改 / 模板在 scripts/md2html.mjs」旧注作废（2026-09-14 博客壳重做批） */
/* 三端断点（§九 统一变量表）：<768 手机 / 768-1024 pad / ≥1024 电脑；断点只改变量 */
/* 2026-09-14 站点小改批手改：导航组件更名 .site-nav（规格见 docs/设计-站点上线前站内小改-v1.md §2.2；批 B 按此重做本表） */
/* 2026-09-15 博客面包屑改运河式：面包屑并入导航行（路径链；规格见 docs/设计-站点上线前站内小改-v1.md §2.2 修订） */

/* 昼 · 暖纸花园（默认） */
:root {
  --bg: #f5efe2;
  --card: #efe6d3;
  --text: #33302a;
  --muted: #6f695c; /* AA 4.8:1 on 纸底 */
  --accent: #9d4e3c;
  --accent-soft: #b97a68;
  --border: #d9cfb8;
  --r: 20px;
  --code-bg: #322e27;   /* 代码块两套天色统一（如便签） */
  --code-ink: #e8e0cf;
  --quote-bg: rgba(157, 78, 60, .06);
  /* 容器变量（§九）：手机 */
  --pad: 16px;
  --maxw: 100%;
  --gap: 8px;
  --cols: 1;
}

/* 夜 · 深金花园（跟随系统） */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1f1b15; /* 暖褐黑（较原 #12100c 提亮，muted #888 仍 AA 4.8:1） */
    --card: #262118;
    --text: #f2ead8;
    --muted: #888; /* 红线⑤ */
    --accent: #e8b64c;
    --accent-soft: #f0c060;
    --border: #3a352c;
    --quote-bg: rgba(232, 182, 76, .07);
  }
}
@media (min-width: 768px) {
  :root { --pad: 24px; --maxw: 900px; --gap: 12px; --cols: 2; }
}
@media (min-width: 1024px) {
  :root { --pad: 24px; --maxw: 1080px; --gap: 16px; --cols: 3; }
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Microsoft YaHei UI",
               "Hiragino Sans GB", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  font-variant-numeric: oldstyle-nums;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* 顶部导航 */
.site-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 20px var(--pad); max-width: var(--maxw); margin: 0 auto;
  font-size: 13px; color: var(--muted);
}
.site-nav a { color: var(--muted); transition: color .2s; }
.site-nav a:hover { color: var(--accent); text-decoration: none; }
.site-nav .sep { color: var(--border); padding: 0 6px; }
.site-nav .links { display: flex; align-items: center; flex-wrap: wrap; }
/* 面包屑路径链（内页：文章/主题；并入导航行——2026-09-15 批《博客面包屑改运河式》）：窄屏单行省略（机制沿运河 canal-crumb），右槽 4 格不收缩 */
.site-nav .crumb-left { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-nav .links { flex-shrink: 0; }
/* 2026-09-15 目检修正（轮 2 · 分组感）：出口组 4 格 = pill 按钮（形态沿 .p-tag）；分隔符隐去、以 gap 代 */
.site-nav .links { gap: 6px; }
.site-nav .links .sep { display: none; }
.site-nav .links a { border: 1px solid var(--border); border-radius: var(--r); padding: 2px 10px; font-size: 11px; white-space: nowrap; transition: color .2s, border-color .2s; }
.site-nav .links a:hover { border-color: var(--accent); }

/* 页头 */
.blog-head { padding: 24px 0 28px; }
.blog-head h1 { font-family: "Kaiti SC", "KaiTi", "STKaiti", "Noto Serif SC", serif; font-size: 32px; font-weight: 600; letter-spacing: .04em; }
.blog-head .blog-sub { color: var(--muted); margin-top: 10px; font-size: 15px; }
.blog-head .blog-sub a { color: var(--accent); }

/* 分区标签 */
.section-label {
  font-size: 10px; color: var(--muted); letter-spacing: .16em; text-transform: uppercase;
  margin: 28px 0 14px; padding-left: 4px; font-weight: 600;
}
.gold-label { color: var(--accent); }

/* 文章卡片网格（--cols 随断点变化） */
.posts { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: var(--gap); }
#searchResults[hidden], .posts[hidden] { display: none; }
.p-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r);
  padding: 20px 18px; min-width: 0;
  transition: border-color .2s, background .2s, transform .2s;
  color: inherit;
}
.p-card:hover { border-color: var(--accent-soft); text-decoration: none; transform: translateY(-2px); }
.p-date { font-size: 12px; color: var(--muted); letter-spacing: .02em; }
.p-title { font-family: "Kaiti SC", "KaiTi", "STKaiti", "Noto Serif SC", serif; font-size: 17px; font-weight: 600; line-height: 1.5; color: var(--text); }
.p-summary {
  font-size: 13px; color: var(--muted); overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
}
.p-flag { font-size: 12px; color: #c0392b; font-weight: 600; }
.p-flag.gold { color: var(--accent); }
.p-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.p-tag {
  font-size: 11px; color: var(--muted); border: 1px solid var(--border);
  border-radius: 20px; padding: 2px 10px; white-space: nowrap; transition: color .2s, border-color .2s;
}
.p-tag:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.p-topic { color: var(--accent); }

/* 桌面密排列表（≥1024：时间流单栏密排——批《博客壳重做》） */
@media (min-width: 1024px) {
  .posts { grid-template-columns: 1fr; max-width: 760px; margin-left: auto; margin-right: auto; gap: 0; }
  .section-label { max-width: 760px; margin-left: auto; margin-right: auto; }
  .p-card {
    flex-direction: row; align-items: baseline; gap: 18px;
    background: none; border: none; border-radius: 0;
    border-bottom: 1px solid var(--border);
    padding: 22px 2px;
  }
  .p-card:hover { border-color: transparent; border-bottom-color: var(--accent-soft); transform: none; }
  .p-date { flex: none; }
  .p-title { flex: 0 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .p-summary { flex: 1 1 auto; min-width: 0; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .p-tags { display: none; }
}

.empty-hint { color: var(--muted); font-size: 14px; padding: 24px 4px; }

/* 搜索框（F10） */
.search { padding: 0 0 8px; }
.search input {
  width: 100%; padding: 12px 16px; font-size: 14px; font-family: inherit;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r);
  color: var(--text); outline: none;
}
.search input:focus { border-color: var(--accent); }

/* 文章页 */
.article-head { padding: 12px 0 20px; }
.article-head h1 { font-family: "Kaiti SC", "KaiTi", "STKaiti", "Noto Serif SC", serif; font-size: 26px; font-weight: 600; line-height: 1.4; letter-spacing: .02em; }
.p-meta { margin-top: 12px; font-size: 13px; color: var(--muted); }
.p-revision { margin-top: 8px; font-size: 12px; color: var(--muted); }
.series-nav {
  margin-top: 14px; padding: 10px 14px; background: var(--card);
  border: 1px solid var(--border); border-radius: 12px;
  font-size: 13px; display: flex; flex-wrap: wrap; gap: 8px 16px;
}
.series-nav .series-name { color: var(--accent); font-weight: 600; }
.series-nav a { color: var(--muted); }
.series-nav a:hover { color: var(--accent); }

.article .markdown { max-width: 720px; margin: 0 auto; font-size: 16px; }
.article .markdown p { margin: 18px 0; }
.article .markdown h1, .article .markdown h2, .article .markdown h3, .article .markdown h4 {
  margin: 32px 0 12px; font-weight: 700; line-height: 1.4;
}
.article .markdown h2 { font-size: 21px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.article .markdown h3 { font-size: 18px; }
.article .markdown a { text-decoration: underline; text-underline-offset: 3px; }
.article .markdown ul, .article .markdown ol { margin: 16px 0; padding-left: 24px; }
.article .markdown li { margin: 6px 0; }
.article .markdown blockquote {
  margin: 20px 0; padding: 12px 18px; border-left: 3px solid var(--accent);
  background: var(--quote-bg); border-radius: 0 12px 12px 0; color: var(--muted);
}
.article .markdown code {
  background: var(--code-bg); color: var(--code-ink); border: 1px solid var(--border); border-radius: 6px;
  padding: 2px 7px; font-size: 14px; font-family: ui-monospace, "SF Mono", Consolas, monospace;
}
.article .markdown pre {
  background: var(--code-bg); color: var(--code-ink); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 18px; overflow-x: auto; margin: 20px 0;
}
.article .markdown pre code { background: none; border: none; padding: 0; color: inherit; }
.article .markdown hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }
.article .markdown img { max-width: 100%; border-radius: 12px; }
.article .markdown em { color: var(--muted); }

/* 文章尾（F11：仅 相关作品 + 发我邮箱） */
.post-end {
  margin-top: 36px; padding: 18px 20px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--r);
  max-width: 720px; margin-left: auto; margin-right: auto;
}
.post-end-item { font-size: 14px; color: var(--muted); margin: 6px 0; }
.post-end-item a { color: var(--accent); }

/* 分享行（2026-09-25 分享 v1）：与「有想法」同块；flex 换行防 375 横向溢出 */
.post-end .share-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.post-end .share-btn {
  display: inline-flex; align-items: center; font-family: inherit; font-size: 12px; line-height: 1.4;
  background: none; border: 1px solid var(--border); border-radius: var(--r); color: var(--muted);
  padding: 2px 10px; text-decoration: none; cursor: pointer;
}
.post-end .share-btn[hidden] { display: none; }
.post-end .share-btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.post-end .share-tip { font-size: 12px; color: var(--accent); }

/* 站脚（C1 隐私声明） */
.site-footer {
  border-top: 1px solid var(--border); margin-top: 48px; text-align: center;
  padding: 28px var(--pad) 32px; color: var(--muted); font-size: 12px;
}
.site-footer .privacy { margin-bottom: 8px; max-width: 640px; margin-left: auto; margin-right: auto; }
.site-footer .icp a { color: var(--muted); }
.site-footer .icp a:hover { color: var(--accent); }
/* 页脚 · 备案块（2026-09-20 收口批：门面页——blog 入口；行式口径沿 assets/site.css:213–214） */
.site-footer .beian-row { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 8px; }
.beian-mps { display: inline-flex; align-items: center; gap: 4px; }
.site-footer .beian-row a { color: var(--muted); }
.site-footer .beian-row a:hover { color: var(--accent); }

/* 手机微调（断点之外的小调整，不改容器变量） */
@media (max-width: 767px) {
  .site-nav { padding: 16px var(--pad); font-size: 12px; }
  /* 2026-09-15 目检修正（乙案）：<768 链另起一行——导航行 = 右 4 格（保持右对齐），链 = 下一整行 */
  .site-nav { flex-wrap: wrap; }
  .site-nav .links { margin-left: auto; }
  .site-nav .crumb-left { order: 2; flex-basis: 100%; }
  .blog-head { padding: 16px 0 20px; }
  .blog-head h1 { font-size: 26px; }
  .article-head h1 { font-size: 22px; }
  .article .markdown { font-size: 15px; }
  .p-card { padding: 16px 14px; }
}
