:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --ink: #1f1f1f;
  --muted: #6c6c6c;
  --tertiary: #9a9a9a;
  --line: #eeeeee;
  --accent: #1e1e1e;
  --accent-soft: #f5f5f5;
  --radius: 10px;
  --maxw: 960px;
  --maxw-post: 768px;
  --header-bg: rgba(255,255,255,.82);
  --hover-line: #e3e3e3;
  --soft: #f4f4f4;
  --link: #1a5fb4;
  font-size: 16px;
}

/* 深色模式：只在前台生效（后台页面没有 data-theme 属性，保持浅色更耐看） */
html[data-theme="dark"] {
  --bg: #141414;
  --surface: #191919;
  --ink: #e9e7e4;
  --muted: #a6a29c;
  --tertiary: #7c7873;
  --line: #2b2b2b;
  --accent: #ecebe8;
  --accent-soft: #222222;
  --header-bg: rgba(20,20,20,.82);
  --hover-line: #3a3a3a;
  --soft: #232323;
  --link: #7aa7e0;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  word-break: break-word;
}
a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* Header —— 仿 kinas 的 sticky 半透明顶栏 */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--header-bg); backdrop-filter: saturate(180%) blur(10px); -webkit-backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 58px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; color: var(--ink); letter-spacing: .02em; }
.brand-logo { height: 34px; width: 34px; display: block; }
.brand-text { font-size: 19px; }
.brand:hover { text-decoration: none; }
.nav { display: flex; gap: 24px; }
.nav-link { color: var(--muted); font-size: 15px; }
.nav-link:hover { text-decoration: none; color: var(--ink); }
.nav-link.active { color: var(--ink); font-weight: 600; }

/* Layout */
.main { padding: 44px 20px 72px; min-height: 60vh; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 0 22px; }
.section-head h2 { font-size: 22px; font-weight: 700; margin: 0; color: var(--ink); }
.more { font-size: 14px; color: var(--muted); }
.more:hover { color: var(--ink); text-decoration: none; }

/* Hero */
.hero { margin-bottom: 46px; }
.hero h1 { font-size: 34px; font-weight: 800; letter-spacing: .01em; margin: 0 0 10px; color: var(--ink); }
.tagline { color: var(--muted); font-size: 18px; margin: 0 0 14px; }
.intro { color: var(--muted); font-size: 16px; line-height: 1.75; max-width: 62ch; margin: 0 0 26px; }

/* Category pills */
.cat-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 28px; }
.cat-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 14px; background: var(--surface); transition: border-color .15s, color .15s, background .15s; }
.cat-pill:hover { text-decoration: none; border-color: var(--hover-line); color: var(--ink); }
.cat-pill.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.cat-pill span { font-size: 12px; opacity: .7; }

/* Cards —— 极简 entry 卡片 */
.cards { display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; transition: box-shadow .2s, border-color .2s, transform .12s; }
.card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.05); border-color: var(--hover-line); transform: translateY(-1px); }
.card-title { font-size: 21px; font-weight: 700; line-height: 1.45; margin: 0 0 8px; }
.card-title a { color: var(--ink); }
.card-title a:hover { text-decoration: underline; }
.card-summary { color: var(--muted); font-size: 15.5px; line-height: 1.65; margin: 0 0 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 首页分页 —— 右下角胶囊按钮 */
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin: 30px 0 6px; }
.pager-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 20px; border-radius: 999px;
  background: var(--ink); color: #fff;
  border: 1px solid var(--ink);
  font-size: 14px; letter-spacing: .02em;
  transition: background .18s ease, transform .18s ease, box-shadow .18s ease, color .18s ease, border-color .18s ease;
}
.pager-btn:hover {
  background: #000; color: #fff; text-decoration: none;
  transform: translateY(-1px); box-shadow: 0 5px 16px rgba(0,0,0,.15);
}
.pager-btn.prev { background: transparent; color: var(--ink); border-color: #dcdcdc; }
.pager-btn.prev:hover { background: var(--accent-soft); color: var(--ink); border-color: #cfcfcf; box-shadow: none; }
@media (max-width: 560px) {
  .pager { margin-top: 24px; }
  .pager-btn { padding: 9px 18px; font-size: 13.5px; }
}

/* Meta 行：分类 · 日期 · 阅读约 X 分钟 · N 字 */
.card-meta, .post-meta { display: flex; align-items: center; gap: 8px; color: var(--tertiary); font-size: 13px; flex-wrap: wrap; }
.card-meta .tag, .post-meta .tag { color: var(--muted); background: var(--soft); border-radius: 4px; padding: 1px 8px; font-size: 12px; }
.card-meta .dot, .post-meta .dot { color: #d2d2d2; }
.card-meta time, .post-meta time { color: var(--tertiary); }

/* Post —— 正文阅读区单独限宽，保持舒适阅读宽度，不被列表加宽带偏 */
.post { max-width: var(--maxw-post); margin: 0 auto; padding: 4px 0; }
.post-title { font-size: 30px; font-weight: 800; line-height: 1.3; margin: 0; color: var(--ink); letter-spacing: .01em; }
.post-meta { margin: 0 0 22px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.post-body { font-size: 18px; line-height: 1.85; color: var(--ink); margin-top: 4px; }
.post-body h1, .post-body h2, .post-body h3 { line-height: 1.4; margin: 1.6em 0 .6em; color: var(--ink); }
.post-body h2 { font-size: 23px; }
.post-body h3 { font-size: 20px; }
.post-body p { margin: 0 0 1.1em; }
.post-body img { max-width: 100%; height: auto; display: block; border-radius: 8px; margin: 1.4em 0; }
.post-body a { color: var(--link); }
.post-body a:hover { text-decoration: underline; }
.post-body pre { background: #1c1d21; color: #f5f5f5; padding: 16px; border-radius: 8px; overflow: auto; }
.post-body code { background: var(--soft); padding: 2px 6px; border-radius: 4px; font-size: .9em; }
.post-body pre code { background: none; padding: 0; color: inherit; }
.post-body blockquote { border-left: 3px solid var(--hover-line); margin: 1.2em 0; padding: .2em 0 .2em 16px; color: var(--muted); }
.post-body table { border-collapse: collapse; width: 100%; margin: 1.2em 0; }
.post-body th, .post-body td { border: 1px solid var(--line); padding: 8px 12px; }
.post-body ul, .post-body ol { padding-left: 1.5em; margin: 0 0 1.1em; }
.post-body li { margin: .3em 0; }
.back { margin-top: 30px; }
.back a { color: var(--muted); }
.back a:hover { color: var(--ink); }

/* 上一篇 / 下一篇 */
.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 44px 0 0;
}
.post-nav-item {
  display: block;
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 14px 18px;
  text-align: left;
  transition: background .15s ease;
}
.post-nav-item.next { text-align: right; }
.post-nav-item:hover { background: var(--accent-soft); }
.post-nav-item.is-empty { visibility: hidden; }
.post-nav-label {
  display: block;
  font-size: 12px;
  color: var(--tertiary);
  margin-bottom: 4px;
}
.post-nav-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.45;
}
@media (max-width: 600px) {
  .post-nav { grid-template-columns: 1fr; gap: 10px; }
  .post-nav-item.next { text-align: left; }
}

/* 相关文章 */
.related { margin: 46px 0 6px; padding-top: 26px; border-top: 1px solid var(--line); }
.related-head { font-size: 15px; font-weight: 700; color: var(--muted); margin: 0 0 16px; letter-spacing: .06em; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.related-item {
  display: flex; flex-direction: column; gap: 7px;
  padding: 15px 16px; border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .2s, box-shadow .2s, transform .12s;
}
.related-item:hover { text-decoration: none; border-color: var(--hover-line); box-shadow: 0 5px 18px rgba(0,0,0,.05); transform: translateY(-1px); }
.related-cat { font-size: 12px; color: var(--tertiary); }
.related-title { font-size: 15px; font-weight: 600; line-height: 1.5; color: var(--ink); }
.related-date { font-size: 12px; color: var(--tertiary); font-variant-numeric: tabular-nums; margin-top: auto; }
@media (max-width: 720px) { .related-grid { grid-template-columns: 1fr; gap: 10px; } }

/* 访问统计页 */
.stats { max-width: 900px; }
.stats-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 34px; }
.stats-card {
  display: flex; flex-direction: column; gap: 4px; align-items: flex-start;
  padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.stats-num { font-size: 28px; font-weight: 800; line-height: 1.2; color: var(--ink); font-variant-numeric: tabular-nums; }
.stats-num small { font-size: 15px; font-weight: 500; color: var(--tertiary); }
.stats-label { font-size: 13px; color: var(--muted); }
.stats-sub { font-size: 15px; font-weight: 700; color: var(--ink); margin: 30px 0 14px; }
.stats-chart {
  display: flex; align-items: flex-end; gap: 4px; height: 150px;
  padding: 12px 14px 0; border: 1px solid var(--line); border-radius: var(--radius); background: #fcfcfc;
}
.chart-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; position: relative; }
.chart-bar { width: 100%; max-width: 26px; background: var(--ink); border-radius: 3px 3px 0 0; opacity: .82; transition: opacity .15s; }
.chart-col:hover .chart-bar { opacity: 1; }
.chart-x { font-size: 10px; color: var(--tertiary); margin-top: 5px; height: 12px; }
.stats-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.stats-table th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--muted); padding: 0 10px 9px; border-bottom: 1px solid var(--line); }
.stats-table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.stats-table tr:last-child td { border-bottom: none; }
.stats-table .rank { width: 34px; color: var(--tertiary); font-variant-numeric: tabular-nums; }
.stats-table .cell-title a { color: var(--ink); }
.stats-table .cell-title a:hover { text-decoration: underline; }
.stats-table .cell-cat { width: 82px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.stats-table .cell-date { width: 96px; color: var(--tertiary); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stats-table .cell-bar { width: 150px; position: relative; }
.stats-table .cell-bar .bar { display: inline-block; height: 7px; background: #e8e8e8; border-radius: 4px; vertical-align: middle; }
.stats-table .cell-bar .num { display: inline-block; margin-left: 8px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; vertical-align: middle; }
.stats-table.small td { padding: 9px 4px; font-size: 13.5px; }
.stats-table.small .cell-bar { width: 60px; text-align: right; }
.stats-two { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media (max-width: 760px) {
  .stats-cards { grid-template-columns: 1fr 1fr; }
  .stats-two { grid-template-columns: 1fr; gap: 8px; }
  .stats-table .cell-date { display: none; }
  .stats-table .cell-bar { width: 84px; }
}

.empty { color: var(--muted); text-align: center; padding: 48px 0; }

/* 搜索 */
.search-bar { display: flex; gap: 10px; margin: 4px 0 26px; }
.search-bar input[type="search"] {
  flex: 1; min-width: 0; font-family: inherit; font-size: 15px;
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px;
  background: var(--surface); color: var(--ink); -webkit-appearance: none; appearance: none;
}
.search-bar input[type="search"]:focus { outline: none; border-color: var(--accent); }
.search-bar input[type="search"]::placeholder { color: #a8adb5; }
.search-bar button {
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
  border-radius: 10px; padding: 11px 20px; font-size: 15px; font-family: inherit;
  cursor: pointer; white-space: nowrap;
}
.search-bar button:hover { opacity: .88; }
.search-hint { color: var(--muted); font-size: 14px; margin: -10px 0 22px; }
.search-hint a { color: var(--link); }
.filter-label { font-size: 13px; color: var(--tertiary); margin: 0 0 8px; }
.cat-row + .filter-label { margin-top: 6px; }

/* 归档 */
.archive-year { margin-bottom: 38px; }
.archive-year h2 {
  font-size: 24px; font-weight: 800; color: var(--ink); margin: 0 0 8px; padding-bottom: 10px;
  border-bottom: 1px solid var(--line); display: flex; align-items: baseline; gap: 10px;
}
.archive-year h2 .count { font-size: 14px; color: var(--tertiary); font-weight: 400; }
.archive-list { list-style: none; margin: 0; padding: 0; }
.archive-list li {
  display: flex; align-items: baseline; gap: 14px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.archive-list li:last-child { border-bottom: none; }
.archive-list .d { flex: 0 0 48px; color: var(--tertiary); font-size: 13px; font-variant-numeric: tabular-nums; }
.archive-list .t { flex: 1; min-width: 0; }
.archive-list .t a { color: var(--ink); }
.archive-list .t a:hover { text-decoration: underline; }
.archive-list .c { flex: 0 0 auto; color: var(--tertiary); font-size: 13px; }

/* 返回顶部悬浮按钮 */
.to-top { position: fixed; right: 22px; bottom: 22px; width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--ink); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .25s, transform .25s, background .15s; box-shadow: 0 4px 16px rgba(0,0,0,.18); z-index: 60; }
.to-top.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.to-top:hover { background: #000; }

@media (max-width: 560px) {
  .nav { gap: 16px; }
  .nav-link { font-size: 14px; }
  .hero h1 { font-size: 1.7rem; }
  .post-title { font-size: 1.5rem; }
  .post-body { font-size: 17px; }
  .archive-list .c { display: none; }
}

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 30px 0; color: var(--tertiary); font-size: 14px; text-align: center; margin-top: 20px; }
.site-footer p { margin: 0; }
.site-footer .footer-links { margin-top: 8px; font-size: 13px; }
.site-footer .footer-links a { color: var(--tertiary); }
.site-footer .footer-links a:hover { color: var(--ink); text-decoration: none; }
.site-footer .footer-icp { margin-top: 6px; font-size: 12px; }
.site-footer .footer-icp a { color: var(--line); }
.site-footer .footer-icp a:hover { color: var(--muted); text-decoration: none; }
.site-footer .footer-social { margin-bottom: 8px; font-size: 13px; }
.site-footer .footer-social a { color: var(--muted); }
.site-footer .footer-social a:hover { color: var(--ink); text-decoration: none; }
.site-footer .footer-social .sep { margin: 0 8px; color: var(--line); }

/* 关于页 —— 外部账号 */
.about-sub { font-size: 1.05rem; margin: 32px 0 14px; color: var(--ink); font-weight: 700; }
.social-links { display: flex; flex-wrap: wrap; gap: 10px; }
.social-chip { display: inline-block; padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); font-size: .9rem; }
.social-chip:hover { background: var(--accent-soft); border-color: var(--line); text-decoration: none; }
.social-qrs { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 14px; align-items: flex-start; }
.qr-card { margin: 0; text-align: center; }
.qr-card img { width: 160px; height: auto; object-fit: contain; border-radius: 8px; border: 1px solid var(--line); background: #fff; padding: 6px; }
.qr-card figcaption { margin-top: 7px; font-size: 13px; color: var(--muted); }

/* Admin —— 配色与前端统一为深灰极简 */
.admin-wrap { max-width: 980px; margin: 0 auto; padding: 28px 20px 60px; }
.admin-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.admin-top h1 { font-size: 1.3rem; margin: 0; color: var(--ink); }
.admin-grid { display: grid; grid-template-columns: 320px 1fr; gap: 24px; }
.admin-list { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.admin-list h3 { margin: 0; padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: .95rem; }
.admin-list ul { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow: auto; }
.admin-list li { padding: 12px 16px; border-bottom: 1px solid var(--line); cursor: pointer; }
.admin-list li:hover { background: var(--accent-soft); }
.admin-list li .li-title { font-weight: 600; font-size: .92rem; color: var(--ink); }
.admin-list li .li-meta { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.badge { font-size: .72rem; padding: 1px 8px; border-radius: 999px; }
.badge.pub { background: var(--accent-soft); color: var(--ink); }
.badge.draft { background: #f3f3f3; color: var(--muted); }
.editor { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 18px; }
.editor .row { display: flex; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.editor input, .editor select, .editor textarea { font-family: inherit; font-size: .95rem; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px; background: #fff; color: var(--ink); }
.editor input.title { flex: 1; min-width: 220px; }
.editor textarea.body { width: 100%; min-height: 320px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; line-height: 1.6; }
.editor .summary, .editor .tags-input { width: 100%; }
.editor .tags-input { font-size: .9rem; }
.md-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fafafa; }
.md-toolbar button { font-family: inherit; font-size: .84rem; line-height: 1; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; cursor: pointer; transition: background .12s ease; }
.md-toolbar button:hover { background: var(--accent-soft); border-color: #dcdcdc; }
.md-toolbar button:active { transform: translateY(1px); }
.md-toolbar button b, .md-toolbar button i { font-size: .95rem; }
.md-sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.split .preview { border: 1px dashed var(--line); border-radius: 8px; padding: 14px; min-height: 320px; overflow: auto; background: var(--accent-soft); }
.split .preview h1, .split .preview h2, .split .preview h3 { line-height: 1.4; }
.split .preview pre { background: #1c1d21; color: #f5f5f5; padding: 12px; border-radius: 6px; overflow: auto; }
.split .preview code { background: #f1f1f1; padding: 1px 5px; border-radius: 4px; }
.split .preview pre code { background: none; color: inherit; }
.split .preview img { max-width: 100%; height: auto; border-radius: 6px; display: block; margin: 10px 0; }
.btn { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 8px 16px; cursor: pointer; font-size: .9rem; font-family: inherit; }
a.btn { display: inline-block; line-height: 1.3; text-decoration: none; }
a.btn:hover { text-decoration: none; }
.btn:hover { border-color: #cfcfcf; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { opacity: .88; color: #fff; }
.btn.danger { color: #b42318; border-color: #f0c6c0; }
.btn.danger:hover { background: #fdecea; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }

/* Admin 补充 */
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.list-head { border-bottom: 1px solid var(--line); padding: 12px 14px; }
.list-head h3 { margin: 0 0 8px; padding: 0; border: none; font-size: .95rem; }
.list-head input {
  width: 100%; font-family: inherit; font-size: .88rem; padding: 7px 11px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
  -webkit-appearance: none; appearance: none;
}
.list-head input:focus { outline: none; border-color: var(--accent); }
.note-inline { color: var(--muted); font-size: .8rem; font-weight: 400; }
.admin-list li.active { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.admin-list li.li-empty { color: var(--muted); font-size: .88rem; cursor: default; }
.admin-list li.li-empty:hover { background: none; }
.editor input[type="date"] { width: 150px; }
.status { font-size: .85rem; color: var(--muted); }
.status.good { color: #1a7f37; font-weight: 600; }
.status.bad { color: #b42318; font-weight: 600; }
.hint { color: var(--muted); font-size: .8rem; margin: 12px 0 0; line-height: 1.6; word-break: break-all; }
.edit-link { margin-left: auto; font-size: .8rem; color: var(--muted); }
.edit-link:hover { color: var(--ink); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; }

@media (max-width: 820px) {
  .admin-grid { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .split .preview { min-height: 180px; }
}

/* Login */
.login-wrap { max-width: 360px; margin: 12vh auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.login-wrap h1 { font-size: 1.2rem; margin: 0 0 18px; text-align: center; color: var(--ink); }
.login-wrap input { width: 100%; margin-bottom: 12px; font-family: inherit; font-size: .95rem; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.login-wrap input:focus { outline: none; border-color: var(--accent); }
.login-wrap .btn { width: 100%; }
.note { color: var(--muted); font-size: .82rem; margin-top: 10px; text-align: center; }

/* ---------- 顶栏右侧：导航 + 深色切换 ---------- */
.header-right { display: flex; align-items: center; gap: 18px; }
.theme-toggle {
  width: 32px; height: 32px; padding: 0; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; line-height: 1; cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--hover-line); background: var(--accent-soft); }
.theme-icon { display: block; transition: transform .3s ease; }
.theme-toggle[data-mode="dark"] .theme-icon { transform: rotate(180deg); }

/* ---------- 文章目录 ---------- */
.toc { border-left: 2px solid var(--line); padding: 2px 0 2px 14px; margin: 0 0 26px; }
.toc-head { margin: 0 0 8px; font-size: 11.5px; letter-spacing: .14em; color: var(--tertiary); }
.toc-list { margin: 0; padding: 0; list-style: none; font-size: 14px; line-height: 1.95; }
.toc-list a { color: var(--muted); }
.toc-list a:hover { color: var(--ink); text-decoration: none; }
.toc-lv3 { padding-left: 16px; font-size: 13px; }

/* ---------- 文章标签 ---------- */
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: -2px 0 22px; }
.tag-chip { font-size: 13px; color: var(--muted); background: var(--soft); border-radius: 999px; padding: 3px 11px; transition: color .15s, background .15s; }
.tag-chip:hover { color: var(--ink); background: var(--accent-soft); text-decoration: none; }

/* ---------- 分享栏 ---------- */
.share-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin: 34px 0 10px; padding: 13px 16px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.share-label { font-size: 13px; color: var(--tertiary); margin-right: 2px; }
.share-btn {
  font-family: inherit; font-size: 13.5px; color: var(--ink);
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 15px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.share-btn:hover { border-color: var(--hover-line); background: var(--accent-soft); text-decoration: none; }
.share-tip { font-size: 13px; color: var(--muted); opacity: 0; transition: opacity .2s; }
.share-tip.on { opacity: 1; }

/* ---------- 标签云 ---------- */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.tag-cloud-item {
  display: inline-flex; align-items: baseline; gap: 6px;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px;
  color: var(--ink); transition: border-color .15s, background .15s;
}
.tag-cloud-item:hover { text-decoration: none; border-color: var(--hover-line); background: var(--accent-soft); }
.tag-cloud-item .n { font-size: 12px; color: var(--tertiary); }
.tag-cloud-item.md { font-size: 14px; }
.tag-cloud-item.lg { font-size: 16px; }
.tag-cloud-item.xl { font-size: 18px; font-weight: 600; }
.tag-more { margin-top: 42px; }

/* ---------- 404 ---------- */
.notfound { max-width: 520px; margin: 11vh auto; text-align: center; }
.nf-code { font-size: 64px; font-weight: 800; letter-spacing: -.04em; color: #d9d9d9; margin: 0 0 6px; line-height: 1; }
.nf-title { font-size: 22px; margin: 0 0 12px; }
.nf-text { color: var(--muted); margin: 0 0 22px; }
.notfound .search-bar { margin: 0 auto 22px; }
.nf-links { font-size: 14px; color: var(--tertiary); }
.nf-links a { color: var(--muted); }
.nf-links .sep { margin: 0 10px; color: var(--line); }

/* ---------- 深色下的必要修正 ---------- */
html[data-theme="dark"] .qr-card img { background: #fff; border-color: #333; }
html[data-theme="dark"] .site-header { border-bottom-color: #262626; }
html[data-theme="dark"] .post-body pre,
html[data-theme="dark"] .split .preview pre { background: #0d0d0d; }
html[data-theme="dark"] .pager-btn { background: #ecebe8; color: #141414; border-color: #ecebe8; }
html[data-theme="dark"] .pager-btn:hover { background: #fff; color: #000; }
html[data-theme="dark"] .pager-btn.prev { background: transparent; color: var(--ink); border-color: #3a3a3a; }
html[data-theme="dark"] .pager-btn.prev:hover { background: var(--accent-soft); }

/* ---------- 顶栏在窄屏的收拢 ---------- */
@media (max-width: 720px) {
  .header-inner { height: 54px; }
  .nav { gap: 14px; }
  .nav-link { font-size: 14px; }
  .header-right { gap: 10px; }
  .brand-text { font-size: 17px; }
}
@media (max-width: 460px) {
  .nav { gap: 10px; }
  .nav-link { font-size: 13px; }
  .theme-toggle { width: 28px; height: 28px; font-size: 13px; }
  .brand-logo { height: 30px; width: 30px; }
}
html[data-theme="dark"] .card,
html[data-theme="dark"] .share-bar,
html[data-theme="dark"] .related-item,
html[data-theme="dark"] .cat-pill { border-color: #303030; }
html[data-theme="dark"] .share-btn { border-color: #3a3a3a; }
html[data-theme="dark"] .site-footer { color: var(--muted); }
html[data-theme="dark"] .nf-code { color: #2e2e2e; }
html[data-theme="dark"] .tag-chip, html[data-theme="dark"] .card-meta .tag, html[data-theme="dark"] .post-meta .tag { background: #262626; }
html[data-theme="dark"] .card,
html[data-theme="dark"] .share-bar,
html[data-theme="dark"] .related-item,
html[data-theme="dark"] .cat-pill { border-color: #303030; }
html[data-theme="dark"] .share-btn { border-color: #3a3a3a; }
html[data-theme="dark"] .site-footer { color: var(--muted); }
html[data-theme="dark"] .nf-code { color: #2e2e2e; }
html[data-theme="dark"] .tag-chip, html[data-theme="dark"] .card-meta .tag, html[data-theme="dark"] .post-meta .tag { background: #262626; }

/* 草稿预览提示 */
.draft-banner { font-size: 13px; color: #8a6d3b; background: #fdf6e3; border: 1px solid #f0e0b8; border-radius: 6px; padding: 8px 12px; margin: 0 0 18px; }

/* ---------- 正文里的视频：B 站播放器 ---------- */
.video-block { display: block; margin: 28px 0; }
.video-embed {
  display: block; position: relative; width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  background: #000; border-radius: var(--radius); overflow: hidden;
}
.video-embed iframe {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%; border: 0; display: block;
}
.video-cap { display: block; margin-top: 7px; font-size: 12.5px; color: var(--tertiary); text-align: right; }
.video-cap a { color: var(--tertiary); }
.video-cap a:hover { color: var(--ink); text-decoration: none; }

/* ---------- 正文里的视频：视频号卡片 ---------- */
.channels-block { display: block; margin: 28px 0; }
.channels-card {
  display: flex; align-items: center; gap: 14px;
  padding: 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
a.channels-card:hover { text-decoration: none; border-color: var(--hover-line); box-shadow: 0 6px 20px rgba(0,0,0,.05); }
.channels-cover {
  flex: 0 0 132px; width: 132px; height: 88px;
  border-radius: 6px; overflow: hidden; background: var(--soft);
  display: flex; align-items: center; justify-content: center;
}
.channels-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.channels-noimg { font-size: 12px; color: var(--tertiary); letter-spacing: .16em; }
.channels-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.channels-kicker { font-size: 11px; letter-spacing: .12em; color: #e58a2b; }
.channels-title { font-size: 15.5px; font-weight: 600; line-height: 1.45; }
.channels-hint { font-size: 12.5px; color: var(--tertiary); }
.channels-qr { flex: 0 0 62px; width: 62px; height: 62px; border-radius: 4px; background: #fff; overflow: hidden; }
.channels-qr img { width: 100%; height: 100%; object-fit: contain; display: block; }
.channels-arrow {
  flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--soft); color: var(--muted); font-size: 11px;
  display: flex; align-items: center; justify-content: center;
}

@media (max-width: 560px) {
  .channels-cover { flex-basis: 104px; width: 104px; height: 70px; }
  .channels-title { font-size: 14.5px; }
  .channels-qr { flex-basis: 54px; width: 54px; height: 54px; }
  .channels-card { gap: 11px; padding: 10px; }
}

html[data-theme="dark"] .channels-card { border-color: #303030; }
html[data-theme="dark"] .channels-arrow { background: #2a2a2a; }
html[data-theme="dark"] .channels-qr { background: #fff; }

/* ---------- 后台：视频号插入弹层 ---------- */
.md-modal {
  position: fixed; inset: 0; z-index: 999; padding: 20px;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
}
.md-modal[hidden] { display: none; }
.md-modal-box {
  width: min(460px, 100%); max-height: 90vh; overflow: auto;
  background: #fff; border-radius: 12px; padding: 22px 24px 18px;
  box-shadow: 0 24px 70px rgba(0,0,0,.22);
}
.md-modal-box h3 { margin: 0 0 6px; font-size: 16px; }
.md-modal-note { margin: 0 0 16px; font-size: 12.5px; line-height: 1.65; color: #8a8a8a; }
.md-modal-box label { display: block; margin-bottom: 12px; font-size: 13px; color: #555; }
.md-modal-box label input {
  display: block; width: 100%; margin-top: 6px; box-sizing: border-box;
  font-family: inherit; font-size: 14px; padding: 9px 11px;
  border: 1px solid #ddd; border-radius: 7px; color: #1f1f1f; background: #fff;
}
.md-modal-box label input:focus { outline: none; border-color: #bbb; }
.md-modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.md-cover-row { display: flex; align-items: center; gap: 10px; }
.md-cover-row input { flex: 1 1 auto; }
.md-cover-preview {
  width: 62px; height: 42px; border-radius: 5px; background: #f2f2f2;
  border: 1px solid #e6e6e6; object-fit: cover; flex: 0 0 62px;
}
.md-cover-preview[hidden] { display: none; }
