:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --accent: #2563eb;
  --accent-bg: #eff6ff;
  --radius: 14px;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Noto Sans SC", sans-serif;
  --font-head: Georgia, "Noto Serif SC", "Songti SC", serif;
}
body.theme-minimal {
  --bg: #ffffff;
  --card: #ffffff;
  --border: #ececec;
  --accent: #111827;
  --accent-bg: #f3f4f6;
  --font-head: var(--font-body);
}
body.theme-terminal {
  --bg: #0b0f17;
  --card: #121826;
  --ink: #e2e8f0;
  --muted: #94a3b8;
  --border: #233044;
  --accent: #38bdf8;
  --accent-bg: #0c2438;
  --font-head: ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  body:not(.theme-minimal):not(.theme-terminal) {
    --bg: #0f1117;
    --card: #161a23;
    --ink: #e5e7eb;
    --muted: #94a3b8;
    --border: #262c3a;
    --accent: #60a5fa;
    --accent-bg: #172554;
  }
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.75 var(--font-body); background: var(--bg); color: var(--ink); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 22px; }
.topbar { position: sticky; top: 0; z-index: 20; background: var(--card); border-bottom: 1px solid var(--border); padding: 14px 0; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { font: 700 20px/1.2 var(--font-head); color: var(--ink); }
.nav { display: flex; gap: 18px; font-size: 14px; align-items: center; flex-wrap: wrap; }
.hero { padding: 38px 0 26px; border-bottom: 1px solid var(--border); margin-bottom: 28px; background: var(--card); }
.hero h1 { margin: 0 0 8px; font: 700 32px/1.25 var(--font-head); }
.subtitle { margin: 0; color: var(--muted); font-size: 15px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 26px; align-items: start; }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } }
.sidebar .widget { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.widget h4 { margin: 0 0 12px; font-size: 14px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.post-card, .post-full, .comments-wrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 26px; margin-bottom: 20px; }
.post-card.featured { border-color: var(--accent); }
.post-cover { width: 100%; max-height: 320px; object-fit: cover; border-radius: 10px; margin-bottom: 16px; display: block; }
.prose-img { max-width: 100%; height: auto; border-radius: 10px; margin: 12px 0; display: block; }
.post-card h2 { margin: 0 0 8px; font: 700 22px/1.35 var(--font-head); }
.post-full h1 { margin: 0 0 10px; font: 700 30px/1.3 var(--font-head); }
.meta { font-size: 13px; color: var(--muted); margin-bottom: 14px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tag { background: var(--accent-bg); color: var(--accent); padding: 2px 9px; border-radius: 999px; font-size: 12px; display: inline-block; border: none; cursor: pointer; font-family: inherit; }
.tag.active { background: var(--accent); color: #fff; }
.badge-feat { background: var(--accent); color: #fff; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.search-box { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg); color: var(--ink); font: inherit; }
.toc-list { list-style: none; padding: 0; margin: 0; font-size: 13.5px; }
.toc-list li { margin: 5px 0; }
.toc-list li.lvl-3 { padding-left: 14px; font-size: 13px; }
.prose pre { background: #0f172a; color: #f8fafc; padding: 15px; border-radius: 10px; overflow-x: auto; font-size: 13.5px; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; }
.prose blockquote { border-left: 3px solid var(--accent); margin: 14px 0; padding: 6px 16px; color: var(--muted); background: var(--bg); border-radius: 0 8px 8px 0; }
/* LaTeX math containers */
.cent-math-block { overflow-x: auto; padding: 12px 16px; margin: 14px 0; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; font-family: "Cambria Math", "STIX Two Math", Georgia, serif; text-align: center; }
.cent-math-inline { font-family: "Cambria Math", "STIX Two Math", Georgia, serif; padding: 0 3px; background: var(--accent-bg); border-radius: 4px; }
/* Hexo Tag Plugins styling */
.hexo-note { padding: 12px 16px; border-radius: 8px; border-left: 4px solid var(--accent); background: var(--accent-bg); margin: 14px 0; font-size: 14.5px; }
.hexo-note-warning { border-left-color: #d97706; background: #fef3c7; color: #78350f; }
.hexo-note-danger { border-left-color: #dc2626; background: #fee2e2; color: #7f1d1d; }
.hexo-note-success { border-left-color: #16a34a; background: #dcfce7; color: #14532d; }
.hexo-fold { border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin: 14px 0; background: var(--bg); }
.hexo-fold summary { cursor: pointer; font-weight: 600; }
.hexo-fold-body { margin-top: 8px; }
.hexo-code { margin: 14px 0; }
.hexo-code-cap { font-size: 12px; color: var(--muted); margin-bottom: 4px; font-family: ui-monospace, monospace; }
.hexo-btn { display: inline-block; background: var(--accent); color: #fff !important; padding: 7px 16px; border-radius: 8px; font-weight: 600; font-size: 14px; margin: 4px 0; }
.hexo-link-card { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; margin: 12px 0; background: var(--bg); }
.hexo-link-card span { font-size: 12px; color: var(--muted); word-break: break-all; }
.site-footer { padding: 28px 20px 48px; font-size: 13px; color: var(--muted); text-align: center; border-top: 1px solid var(--border); margin-top: 32px; }
.cent-comment { border-top: 1px solid var(--border); padding: 14px 0; }
.cent-comment.reply { margin-left: 24px; padding-left: 14px; border-left: 2px solid var(--border); }
.cent-c-head { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 6px; flex-wrap: wrap; }
.cent-c-head strong { color: var(--ink); }
.cent-badge { font-family: ui-monospace, monospace; font-size: 11px; background: var(--accent-bg); color: var(--accent); padding: 1px 6px; border-radius: 6px; }
.cent-form { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.cent-form input, .cent-form textarea { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--ink); font: inherit; }
.cent-btn { align-self: flex-start; background: var(--accent); color: #fff; border: none; padding: 8px 18px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 14px; }
.cent-btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--border); padding: 4px 11px; font-size: 12.5px; }
.cent-msg { font-size: 13px; color: var(--muted); }
