:root {
  --bg: #0d1117;
  --bg-elev: #161b22;
  --bg-input: #1c2128;
  --bg-hover: #21262d;
  --border: #2d333b;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --text-faint: #6e7681;
  --accent: #6366f1;
  --accent-soft: #818cf8;
  --accent-bg: rgba(99, 102, 241, 0.14);
  --teal: #22d3ee;
  --radius: 12px;
  --radius-sm: 8px;
  --header-h: 60px;
  --font: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "SF Mono", "Cascadia Code", Consolas, "Courier New", monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--page-bg, var(--bg));
  background-image: var(--page-bg-image, none);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
/* 背景风格 */
body[data-bg-style="gradient"] {
  background-image: linear-gradient(135deg, var(--page-bg, var(--bg)), color-mix(in srgb, var(--page-bg, var(--bg)) 65%, var(--accent)));
}
body[data-bg-style="dots"] {
  background-color: var(--page-bg, var(--bg));
  background-image: radial-gradient(var(--text-faint) 1px, transparent 1px);
  background-size: 22px 22px;
}
body[data-bg-style="solid"] { background-image: none; }
a { color: var(--accent-soft); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ===== 头部导航 ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg, rgba(13, 17, 23, 0.85));
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--header-border, var(--border));
}
.nav { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); position: relative; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); }
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), var(--teal));
  color: #fff; font-weight: 500; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.logo-text { font-size: 17px; font-weight: 500; letter-spacing: 0.5px; }
.nav-links { display: flex; list-style: none; gap: 4px; }
.nav-links a {
  display: block; padding: 8px 14px; border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 15px; transition: color 0.15s, background 0.15s;
}
.nav-links a:hover { color: var(--text); background: var(--bg-hover); text-decoration: none; }
.nav-links a.active { color: var(--text); background: var(--accent-bg); }
.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: 0; padding: 12px; cursor: pointer;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: transform 0.2s, opacity 0.2s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== 布局 ===== */
.main { flex: 1; min-width: 0; padding-bottom: 40px; }

/* ===== 首页 hero ===== */
.hero { padding: 40px 0 28px; }
.hero-title { font-size: 34px; font-weight: 500; letter-spacing: 0.5px; }
.accent-text {
  background: linear-gradient(90deg, var(--accent-soft), var(--teal));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { margin-top: 12px; color: var(--text-muted); font-size: 16px; }

/* ===== AI 对话卡片 ===== */
.chat-card {
  margin: 8px 0 40px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  height: 460px; overflow: hidden;
}
.chat-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.chat-title { font-size: 15px; font-weight: 500; }
.chat-meta { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.chat-messages {
  flex: 1; overflow-y: auto; padding: 18px;
  display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.msg { display: flex; gap: 10px; max-width: 100%; }
.msg-user { justify-content: flex-end; }
.msg-avatar {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 500;
  background: var(--accent-bg); color: var(--accent-soft); border: 1px solid var(--accent);
}
.msg-user .msg-avatar { background: var(--bg-hover); color: var(--text-muted); border-color: var(--border); order: 1; }
.msg-bubble {
  padding: 10px 14px; border-radius: var(--radius);
  background: var(--bg-input); border: 1px solid var(--border);
  font-size: 14px; white-space: pre-wrap; word-break: break-word; max-width: 85%;
}
.msg-user .msg-bubble { background: var(--accent-bg); border-color: var(--accent); }
.msg-bubble.typing::after { content: "▍"; animation: blink 1s step-end infinite; color: var(--accent-soft); }
@keyframes blink { 50% { opacity: 0; } }
.chat-input {
  display: flex; gap: 10px; padding: 14px 18px;
  border-top: 1px solid var(--border); background: var(--bg-elev);
}
.chat-input input {
  flex: 1; padding: 11px 14px; border-radius: var(--radius-sm);
  background: var(--bg-input); border: 1px solid var(--border); color: var(--text);
  font-size: 14px; font-family: inherit; outline: none; min-height: 44px;
}
.chat-input input:focus { border-color: var(--accent); }
.chat-input input:disabled { opacity: 0.6; }
.chat-status { min-height: 0; font-size: 12px; color: var(--text-faint); padding: 0 18px; }
.chat-status.show { padding-bottom: 12px; }

/* ===== 按钮 ===== */
.btn-primary {
  border: 0; cursor: pointer; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 500;
  padding: 10px 18px; min-height: 44px; transition: background 0.15s;
}
.btn-primary:hover { background: var(--accent-soft); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-ghost {
  border: 1px solid var(--border); cursor: pointer; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-muted); font-size: 13px;
  padding: 7px 14px; min-height: 36px; transition: border-color 0.15s, color 0.15s;
}
.btn-ghost:hover { border-color: var(--text-faint); color: var(--text); }

/* ===== 区块 ===== */
.section { margin-bottom: 40px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-head h2 { font-size: 20px; font-weight: 500; }
.link-more { font-size: 14px; color: var(--text-muted); }
.link-more:hover { color: var(--text); }

/* ===== 卡片网格 ===== */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.card-date { font-size: 12px; color: var(--text-faint); }
.card-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: var(--accent-bg); color: var(--accent-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 500;
}
.card-title { font-size: 16px; font-weight: 500; color: var(--text); }
.card-desc {
  font-size: 13px; color: var(--text-muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ===== 页面头 / 博客列表 ===== */
.page-head { padding: 32px 0 20px; }
.page-title { font-size: 28px; font-weight: 500; }
.page-sub { margin-top: 6px; color: var(--text-muted); font-size: 14px; }
/* 列表搜索栏 */
.list-search {
  width: 100%; padding: 11px 16px; margin: 4px 0 18px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 14px; outline: none;
  transition: border-color 0.15s;
}
.list-search::placeholder { color: var(--text-faint); }
.list-search:focus { border-color: var(--accent); }
.list-empty { display: none; padding: 24px 0; color: var(--text-faint); font-size: 14px; text-align: center; }
.post-list { display: flex; flex-direction: column; gap: 14px; }
.post-item {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px;
  transition: border-color 0.15s;
}
.post-item:hover { border-color: var(--accent); }
.post-item-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.post-date { font-size: 13px; color: var(--text-faint); }
.post-item-link h2 { font-size: 19px; font-weight: 500; color: var(--text); }
.post-item-link:hover { text-decoration: none; }
.post-item-link:hover h2 { color: var(--accent-soft); }
.post-excerpt { margin-top: 8px; font-size: 14px; color: var(--text-muted); }
.tag {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  background: var(--bg-input); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 12px;
}
.tag-link { cursor: pointer; text-decoration: none; transition: all 0.15s; }
.tag-link:hover { color: var(--accent-soft); border-color: var(--accent); text-decoration: none; }
.post-tags { display: flex; gap: 6px; flex-wrap: wrap; }

/* ===== 分类导航 + 关键词筛选 ===== */
.cat-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 18px; }
.cat-chip {
  padding: 7px 16px; border-radius: 999px; font-size: 14px; cursor: pointer;
  background: var(--bg-elev); border: 1px solid var(--border); color: var(--text-muted);
  text-decoration: none; transition: all 0.15s;
}
.cat-chip:hover { color: var(--text); border-color: var(--text-faint); text-decoration: none; }
.cat-chip.active { background: var(--accent-bg); border-color: var(--accent); color: var(--accent-soft); }
.filter-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; margin-bottom: 16px; border-radius: var(--radius-sm);
  background: var(--accent-bg); border: 1px solid var(--accent); font-size: 13px; color: var(--accent-soft);
}
.filter-clear { color: var(--accent-soft); text-decoration: none; font-size: 13px; }
.filter-clear:hover { text-decoration: underline; }
.post-cat {
  padding: 2px 10px; border-radius: 999px; font-size: 12px;
  background: var(--bg-input); border: 1px solid var(--border); color: var(--text-muted);
}
.cat-cat-coding { color: #818cf8; border-color: rgba(129,140,248,0.4); }
.cat-cat-video { color: #22d3ee; border-color: rgba(34,211,238,0.4); }
.cat-cat-deploy { color: #34d399; border-color: rgba(52,211,153,0.4); }
.cat-cat-automation { color: #fbbf24; border-color: rgba(251,191,36,0.4); }
.cat-cat-api { color: #f472b6; border-color: rgba(244,114,182,0.4); }
.cat-cat-general { color: var(--text-muted); }

/* ===== 外观自定义悬浮按钮 + 面板 ===== */
.theme-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 200;
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--bg-elev); border: 1px solid var(--border); color: var(--text);
  font-size: 20px; cursor: pointer; box-shadow: 0 6px 20px rgba(0,0,0,0.35);
  transition: transform 0.15s; display: flex; align-items: center; justify-content: center;
}
.theme-fab:hover { transform: scale(1.08); border-color: var(--accent); }
.theme-panel {
  position: fixed; right: 18px; bottom: 74px; z-index: 200;
  width: 268px; padding: 16px; border-radius: 14px;
  background: var(--bg-elev); border: 1px solid var(--border);
  box-shadow: 0 12px 36px rgba(0,0,0,0.45); color: var(--text);
}
.theme-panel[hidden] { display: none; }
.theme-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 15px; font-weight: 500; margin-bottom: 14px;
}
.theme-close { cursor: pointer; color: var(--text-faint); font-size: 14px; }
.theme-close:hover { color: var(--text); }
.theme-group { margin-bottom: 14px; }
.theme-group > label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 7px; }
.theme-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.theme-preset, .theme-style {
  padding: 6px 12px; border-radius: 8px; font-size: 13px; cursor: pointer;
  background: var(--bg-input); border: 1px solid var(--border); color: var(--text-muted);
}
.theme-preset:hover, .theme-style:hover { color: var(--text); border-color: var(--text-faint); }
.theme-preset.active, .theme-style.active { background: var(--accent-bg); border-color: var(--accent); color: var(--accent-soft); }
.theme-row { display: flex; align-items: center; gap: 8px; }
.theme-row input[type="color"] {
  width: 42px; height: 34px; padding: 2px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--bg-input); cursor: pointer;
}
.theme-reset {
  padding: 6px 12px; border-radius: 8px; font-size: 13px; cursor: pointer;
  background: var(--bg-input); border: 1px solid var(--border); color: var(--text-muted);
}
.theme-reset:hover { color: var(--text); border-color: var(--text-faint); }

/* ===== 社区讨论 ===== */
.comm-bar { margin: 6px 0 18px; font-size: 14px; color: var(--text-muted); }
.comm-bar a { color: var(--accent-soft); }
.comm-user b { color: var(--text); }
.comm-ask {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 22px; display: flex; flex-direction: column; gap: 10px;
}
.comm-ask input, .comm-ask textarea, .comm-comment-form textarea {
  width: 100%; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--bg-input); border: 1px solid var(--border); color: var(--text);
  font-size: 14px; font-family: inherit; outline: none;
}
.comm-ask input:focus, .comm-ask textarea:focus, .comm-comment-form textarea:focus { border-color: var(--accent); }
.comm-ask textarea { min-height: 90px; resize: vertical; line-height: 1.6; }
.comm-ask-foot { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.comm-msg { color: var(--text-faint); font-size: 13px; }
.comm-list { display: flex; flex-direction: column; gap: 12px; }
.comm-item {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; text-decoration: none; transition: border-color 0.15s;
}
.comm-item:hover { border-color: var(--accent); text-decoration: none; }
.comm-item-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.comm-item-head h3 { font-size: 17px; font-weight: 500; color: var(--text); }
.comm-count { font-size: 13px; color: var(--text-faint); white-space: nowrap; }
.comm-item-excerpt { margin: 8px 0; font-size: 14px; color: var(--text-muted); }
.comm-item-meta { display: flex; gap: 14px; font-size: 12px; color: var(--text-faint); }
.comm-detail { padding-top: 8px; }
.comm-topic {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; margin: 14px 0 30px;
}
.comm-topic-title { font-size: 24px; font-weight: 500; line-height: 1.4; }
.comm-topic-content { margin-top: 14px; white-space: pre-wrap; word-break: break-word; font-size: 15px; color: var(--text); }
.comm-comments-title { font-size: 16px; font-weight: 500; margin-bottom: 14px; }
.comm-comments { display: flex; flex-direction: column; gap: 10px; }
.comm-comment {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 16px;
}
.comm-comment-head { display: flex; gap: 12px; font-size: 12px; color: var(--text-faint); margin-bottom: 6px; }
.comm-comment-author { color: var(--accent-soft); font-weight: 500; }
.comm-comment-body { font-size: 14px; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.comm-comment-form { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.comm-comment-form textarea { min-height: 80px; resize: vertical; }

/* ===== 论坛：版块 tab / 标签 / 楼层 ===== */
.board-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 18px; }
.board-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px; cursor: pointer;
  background: var(--bg-elev); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 14px; transition: all 0.15s;
}
.board-tab:hover { border-color: var(--accent); color: var(--text); text-decoration: none; }
.board-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.board-tab-icon { font-size: 15px; }
.board-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 999px;
  background: var(--accent-bg); color: var(--accent-soft);
  font-size: 12px; white-space: nowrap;
}
.comm-item-head h3 { flex: 1; min-width: 0; }
.comm-item-head .board-chip { flex: none; }
.comm-board-select {
  min-height: 44px; padding: 0 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-input); color: var(--text);
  font-size: 14px;
}
.comm-board-select:focus { border-color: var(--accent); }
.comm-floor {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 20px; padding: 0 6px; border-radius: 6px;
  background: var(--bg-input); color: var(--text-faint);
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.comm-login-hint { margin-top: 18px; font-size: 14px; color: var(--text-muted); }
.comm-login-hint a { color: var(--accent-soft); }

/* ===== 登录 / 注册 ===== */
.auth-wrap { max-width: 420px; margin: 8vh auto 0; padding: 0 16px; }
.auth-card {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 16px; padding: 32px 28px;
  display: flex; flex-direction: column;
}
.auth-title { font-size: 22px; font-weight: 500; }
.auth-sub { margin: 8px 0 18px; color: var(--text-muted); font-size: 14px; }
#loginForm, #registerForm { display: flex; flex-direction: column; gap: 12px; }
#loginForm input, #registerForm input {
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--bg-input); border: 1px solid var(--border); color: var(--text);
  font-size: 15px; outline: none; min-height: 46px;
}
#loginForm input:focus, #registerForm input:focus { border-color: var(--accent); }
.btn-block { width: 100%; }
.auth-error { min-height: 20px; margin-top: 12px; color: #f87171; font-size: 13px; text-align: center; }
.auth-switch { margin-top: 6px; font-size: 13px; color: var(--text-muted); text-align: center; }
.auth-switch a { color: var(--accent-soft); }

/* ===== 仿 DeepSeek 对话页 ===== */
.chat-page {
  display: flex; flex-direction: column;
  height: calc(100vh - var(--header-h) - 40px);
  max-width: 760px; margin: 0 auto; padding: 0 20px 20px;
}
.chat-page-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; flex-shrink: 0;
}
.chat-page-brand { font-size: 14px; color: var(--text-muted); }
.ds-clear {
  padding: 6px 14px; border-radius: 999px; font-size: 13px; cursor: pointer;
  background: transparent; border: 1px solid var(--border); color: var(--text-muted);
}
.ds-clear:hover { color: var(--text); border-color: var(--text-faint); }
.chat-page-inner { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.ds-welcome {
  margin: auto; text-align: center; padding: 40px 0; flex-shrink: 0;
}
.ds-logo {
  width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 18px;
  background: linear-gradient(135deg, var(--accent), var(--teal)); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 500;
}
.ds-title { font-size: 26px; font-weight: 500; }
.ds-sub { margin-top: 10px; color: var(--text-muted); font-size: 15px; max-width: 460px; margin-left: auto; margin-right: auto; }
.ds-messages { display: flex; flex-direction: column; gap: 18px; padding: 10px 0 20px; }
.ds-msg { display: flex; }
.ds-user { justify-content: flex-end; }
.ds-bubble {
  max-width: 86%; padding: 12px 16px; border-radius: 16px; font-size: 15px;
  white-space: pre-wrap; word-break: break-word; line-height: 1.7;
}
.ds-ai .ds-bubble { background: var(--bg-elev); border: 1px solid var(--border); border-top-left-radius: 4px; }
.ds-user .ds-bubble { background: var(--accent-bg); border: 1px solid var(--accent); border-top-right-radius: 4px; }
.ds-bubble.typing::after { content: "▍"; animation: blink 1s step-end infinite; color: var(--accent-soft); }
.ds-input {
  display: flex; align-items: flex-end; gap: 10px; padding: 12px 14px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 18px; flex-shrink: 0;
}
.ds-input:focus-within { border-color: var(--accent); }
.ds-input textarea {
  flex: 1; resize: none; border: 0; outline: none; background: transparent; color: var(--text);
  font-size: 15px; font-family: inherit; line-height: 1.6; max-height: 200px; padding: 6px 2px;
}
.ds-send {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent); color: #fff; font-size: 18px; transition: opacity 0.15s;
}
.ds-send:hover { opacity: 0.9; }
.ds-send:disabled { opacity: 0.4; cursor: not-allowed; }
.ds-status { min-height: 18px; text-align: center; font-size: 12px; color: var(--text-faint); margin-top: 6px; }
.ds-status.show { color: var(--accent-soft); }

/* ===== 文章详情 ===== */
.post { padding-top: 8px; max-width: 820px; margin: 0 auto; }
.about-card { max-width: 820px; margin: 0 auto; }
.post-head { padding: 24px 0 18px; border-bottom: 1px solid var(--border); margin-bottom: 28px; }
.post-title {
  font-size: 30px; font-weight: 600; line-height: 1.35; letter-spacing: 0.3px;
  background: linear-gradient(120deg, var(--text), var(--accent-soft));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.post-meta { margin-top: 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--text-faint); font-size: 13px; }
.post-back { display: inline-block; margin-top: 44px; }

/* ===== prose（文章 / 预览渲染区） ===== */
.prose { font-size: 15.5px; line-height: 1.85; color: var(--text); word-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 {
  font-weight: 600; line-height: 1.4; color: var(--text); scroll-margin-top: 80px;
}
.prose h1 { font-size: 25px; margin: 1.8em 0 0.7em; }
.prose h2 {
  font-size: 21px; margin: 1.9em 0 0.7em; padding-bottom: 0.35em;
  border-bottom: 1px solid var(--border);
}
.prose h3 { font-size: 17.5px; margin: 1.6em 0 0.6em; }
.prose h4 { font-size: 15.5px; margin: 1.4em 0 0.5em; color: var(--text-muted); }

.prose p { margin: 1.05em 0; }
.prose a {
  color: var(--accent-soft); text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent-soft) 45%, transparent);
  transition: border-color .15s, color .15s;
}
.prose a:hover { color: var(--accent); border-bottom-color: var(--accent); text-decoration: none; }

/* 列表 */
.prose ul, .prose ol { margin: 1.05em 0; }
.prose ul { list-style: none; padding-left: 0; }
.prose ul > li { position: relative; padding-left: 1.5em; margin: 0.5em 0; }
.prose ul > li::before {
  content: ""; position: absolute; left: 0.35em; top: 0.72em;
  width: 6px; height: 6px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--teal));
}
.prose ol { padding-left: 1.6em; }
.prose ol > li { margin: 0.5em 0; padding-left: 0.3em; }
.prose li::marker { color: var(--accent-soft); }
.prose li > ul, .prose li > ol { margin: 0.4em 0; padding-left: 1.5em; }

/* 引用 */
.prose blockquote {
  margin: 1.4em 0; padding: 14px 20px;
  border-left: 3px solid var(--accent);
  background: var(--accent-bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
}
.prose blockquote > :first-child { margin-top: 0; }
.prose blockquote > :last-child { margin-bottom: 0; }
.prose blockquote p { margin: 0.5em 0; }

/* 行内代码 */
.prose code {
  font-family: var(--mono); font-size: 0.87em;
  background: var(--bg-input); border: 1px solid var(--border);
  padding: 2px 6px; border-radius: 6px; color: var(--teal);
}
/* 代码块 */
.prose pre {
  margin: 1.4em 0; padding: 0; overflow: hidden;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.prose pre code {
  display: block; padding: 16px 18px; overflow-x: auto;
  background: none; border: 0; font-size: 13px; line-height: 1.7; color: var(--text);
}

/* 表格 */
.prose table {
  width: 100%; margin: 1.5em 0; border-collapse: separate; border-spacing: 0;
  font-size: 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden;
}
.prose th, .prose td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.prose th { background: var(--bg-elev); font-weight: 600; color: var(--text); }
.prose tr:last-child td { border-bottom: 0; }
.prose tbody tr:nth-child(even) { background: color-mix(in srgb, var(--bg-elev) 55%, transparent); }
.prose tbody tr:hover { background: var(--bg-hover); }

/* 图片 / 分隔 / 杂项 */
.prose img { max-width: 100%; height: auto; border-radius: var(--radius-sm); border: 1px solid var(--border); margin: 1.2em 0; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }
.prose kbd {
  font-family: var(--mono); font-size: 0.85em; background: var(--bg-elev);
  border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px;
}
.prose mark { background: color-mix(in srgb, var(--teal) 32%, transparent); color: var(--text); padding: 0 2px; border-radius: 3px; }

/* 文章/关于 小屏表格横向滚动 */
@media (max-width: 640px) {
  .post-title { font-size: 25px; }
  .prose table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ===== 工具：Markdown 预览 ===== */
.tool-md { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tool-md-pane { display: flex; flex-direction: column; min-height: 480px; }
.tool-md-label { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.tool-md-input {
  flex: 1; resize: none; padding: 14px;
  background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); font-family: var(--mono); font-size: 13px; line-height: 1.6; outline: none;
  min-height: 300px;
}
.tool-md-input:focus { border-color: var(--accent); }
.tool-md-output {
  flex: 1; overflow-y: auto; padding: 14px 16px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-sm);
  min-height: 300px;
}

/* ===== 工具：时间戳 ===== */
.tool-ts { display: flex; flex-direction: column; gap: 16px; max-width: 640px; }
.tool-ts-card {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.tool-ts-title { font-size: 16px; font-weight: 500; margin-bottom: 14px; }
.tool-row { display: flex; gap: 10px; }
.tool-row + .tool-row { margin-top: 12px; }
.tool-row input {
  flex: 1; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--bg-input); border: 1px solid var(--border); color: var(--text);
  font-size: 14px; font-family: var(--mono); outline: none; min-height: 44px;
}
.tool-row input:focus { border-color: var(--accent); }
.tool-ts-result {
  margin-top: 12px; padding: 12px 14px; min-height: 44px;
  background: var(--bg-input); border: 1px dashed var(--border);
  border-radius: var(--radius-sm); font-size: 14px; color: var(--text);
  white-space: pre-wrap; word-break: break-all;
}

/* ===== 关于 / 404 ===== */
.about-card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.nf { text-align: center; padding: 80px 0; }
.nf-code {
  font-size: 72px; font-weight: 500;
  background: linear-gradient(90deg, var(--accent-soft), var(--teal));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nf-text { color: var(--text-muted); margin: 12px 0 24px; }
.nf-btn { display: inline-block; }

/* ===== 页脚 ===== */
.site-footer { border-top: 1px solid var(--border); padding: 22px 0; margin-top: auto; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--text-faint); }
.footer-note { letter-spacing: 1px; }
.footer-icp { margin-top: 10px; text-align: center; font-size: 12px; }
.footer-icp a { color: var(--text-faint); }
.footer-icp a:hover { color: var(--text); }

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ===== 响应式：平板 ===== */
@media (max-width: 860px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== 响应式：移动端 ===== */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute; top: var(--header-h); left: -20px; right: -20px;
    flex-direction: column; gap: 0; padding: 8px 34px 14px;
    background: var(--bg-elev); border-bottom: 1px solid var(--border);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 13px 14px; font-size: 16px; }
  .hero { padding: 28px 0 20px; }
  .hero-title { font-size: 27px; }
  .hero-sub { font-size: 15px; }
  .chat-card { height: 420px; }
  .tool-md { grid-template-columns: 1fr; }
  .tool-md-pane { min-height: 0; }
  .tool-md-input { min-height: 220px; }
  .tool-md-output { min-height: 260px; }
  .page-title { font-size: 24px; }
  .post-title { font-size: 23px; }
  .footer-inner { flex-direction: column; gap: 6px; text-align: center; }
}

/* ===== 响应式：小屏手机 ===== */
@media (max-width: 520px) {
  .card-grid { grid-template-columns: 1fr; }
  .container { padding: 0 14px; }
  .chat-card { height: 400px; }
  .chat-messages { padding: 14px; }
  .chat-input { padding: 12px 14px; }
  .msg-bubble { max-width: 90%; }
  .hero-title { font-size: 24px; }
  .tool-row { flex-direction: column; }
  .tool-row .btn-primary { width: 100%; }
}
