/* ============================================================
   潇洒科技 - 基础布局与组件（配合 themes.css 的主题变量）
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --radius: 14px;
  --radius-sm: 9px;
  --maxw: 1120px;
  --header-h: 62px;
}

html { scroll-behavior: smooth; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background .35s ease, color .35s ease;
}
a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-2); }
img { max-width: 100%; display: block; }
::selection { background: var(--accent); color: var(--btn-text); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- 头部导航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: var(--header-bg);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 20px;
  height: 100%; display: flex; align-items: center; gap: 24px;
}
.logo {
  font-size: 1.25rem; font-weight: 800; letter-spacing: .02em;
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  cursor: pointer;
}
.logo .logo-dot { -webkit-text-fill-color: var(--accent); }
.main-nav { display: flex; gap: 4px; margin-left: auto; }
.main-nav a {
  color: var(--muted); font-size: .95rem; padding: 7px 13px; border-radius: var(--radius-sm);
  transition: all .2s;
}
.main-nav a:hover { color: var(--text); background: var(--chip-bg); }
.main-nav a.active { color: var(--accent); background: var(--chip-bg); font-weight: 600; }

/* ---------- Hero ---------- */
.hero {
  background: var(--hero-banner, var(--hero-bg));
  padding: 60px 0 54px;
  text-align: center;
}
.hero-badge {
  display: inline-block; font-size: .82rem; color: var(--accent);
  background: var(--chip-bg); border: 1px solid var(--border);
  padding: 4px 14px; border-radius: 999px; margin-bottom: 18px;
}
.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.4rem); font-weight: 900; line-height: 1.2;
  background: var(--hero-title-grad);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-slogan { margin-top: 14px; font-size: 1.08rem; color: var(--muted); }
.hero-actions { margin-top: 30px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border-radius: var(--radius-sm);
  font-size: .95rem; font-weight: 600; cursor: pointer; border: none;
  transition: all .2s;
}
.btn-primary {
  background: var(--accent-grad); color: var(--btn-text);
}
html[data-theme="corepress"] .btn-primary,
html[data-theme="kratos"] .btn-primary,
html[data-theme="puock"] .btn-primary,
html[data-theme="glass"] .btn-primary { color: #fff; }
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.08); }
.btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 6px 14px; font-size: .85rem; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }

/* ---------- 区块 ---------- */
.section { padding: 64px 0 20px; }
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 26px; flex-wrap: wrap; }
.section-title {
  font-size: 1.6rem; font-weight: 800; position: relative; padding-left: 16px;
}
.section-title::before {
  content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 5px;
  border-radius: 4px; background: var(--accent-grad);
}
.section-sub { color: var(--muted); font-size: .92rem; }

/* ---------- 卡片网格 ---------- */
.grid { display: grid; gap: 20px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 960px) { .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transition: transform .25s, box-shadow .25s, border-color .25s;
  overflow: hidden;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }

/* 产品卡片 */
.product-card .cover { height: 165px; overflow: hidden; }
.product-card .cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.product-card:hover .cover img { transform: scale(1.06); }
.product-body { padding: 18px; }
.product-tag {
  display: inline-block; font-size: .74rem; color: var(--accent);
  background: var(--chip-bg); padding: 2px 10px; border-radius: 999px; margin-bottom: 10px;
}
.product-name { font-size: 1.08rem; font-weight: 700; margin-bottom: 6px; }
.product-desc { font-size: .88rem; color: var(--muted); min-height: 60px; }
.product-link { display: inline-block; margin-top: 10px; font-size: .88rem; font-weight: 600; }

/* 资源卡片 */
.res-card { padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.res-cat {
  font-size: .72rem; color: var(--accent-2); background: var(--chip-bg);
  align-self: flex-start; padding: 2px 10px; border-radius: 999px;
}
.res-name { font-weight: 700; font-size: 1rem; }
.res-desc { font-size: .85rem; color: var(--muted); flex: 1; }

/* 资源筛选 */
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-chip {
  padding: 5px 16px; border-radius: 999px; font-size: .85rem; cursor: pointer;
  border: 1px solid var(--border-strong); background: transparent; color: var(--muted);
  transition: all .2s;
}
.filter-chip:hover { color: var(--text); border-color: var(--accent); }
.filter-chip.active {
  background: var(--accent-grad); color: var(--btn-text);
  border-color: transparent; font-weight: 600;
}
html[data-theme="corepress"] .filter-chip.active,
html[data-theme="kratos"] .filter-chip.active,
html[data-theme="puock"] .filter-chip.active,
html[data-theme="glass"] .filter-chip.active { color: #fff; }

/* 文章卡片 */
.post-card { display: flex; flex-direction: column; }
.post-card .cover { height: 170px; overflow: hidden; }
.post-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.post-body { padding: 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-meta { font-size: .78rem; color: var(--muted); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.post-tag {
  font-size: .72rem; color: var(--accent); background: var(--chip-bg);
  padding: 1px 9px; border-radius: 999px;
}
.post-title { font-size: 1.1rem; font-weight: 700; line-height: 1.45; }
.post-title a { color: var(--text); }
.post-title a:hover { color: var(--accent); }
.post-excerpt { font-size: .88rem; color: var(--muted); flex: 1; }

/* ---------- 文章页 ---------- */
.article-wrap { max-width: 800px; margin: 0 auto; padding: 48px 20px 40px; }
.article-head { margin-bottom: 30px; }
.article-title { font-size: 2rem; font-weight: 800; line-height: 1.3; margin: 12px 0; }
.article-cover { border-radius: var(--radius); margin: 22px 0; border: 1px solid var(--border); }

/* Markdown 正文 */
.md-body { font-size: 1rem; }
.md-body h1, .md-body h2, .md-body h3, .md-body h4 {
  margin: 1.5em 0 .6em; font-weight: 800; line-height: 1.4;
}
.md-body h2 { font-size: 1.45rem; padding-left: 12px; border-left: 4px solid var(--accent); }
.md-body h3 { font-size: 1.18rem; }
.md-body p { margin: .8em 0; color: var(--text); }
.md-body ul, .md-body ol { margin: .8em 0; padding-left: 1.6em; }
.md-body li { margin: .35em 0; }
.md-body blockquote {
  margin: 1.1em 0; padding: 12px 18px;
  border-left: 4px solid var(--accent);
  background: var(--chip-bg); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--muted);
}
.md-body code {
  background: var(--code-bg); border: 1px solid var(--border);
  padding: 2px 7px; border-radius: 5px; font-size: .88em;
  font-family: Consolas, "JetBrains Mono", monospace;
}
.md-body pre {
  background: var(--code-bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px; overflow-x: auto; margin: 1em 0;
}
.md-body pre code { background: none; border: none; padding: 0; font-size: .88rem; line-height: 1.6; }
.md-body table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: .92rem; }
.md-body th, .md-body td { border: 1px solid var(--border); padding: 9px 13px; text-align: left; }
.md-body th { background: var(--chip-bg); font-weight: 700; }
.md-body img { border-radius: var(--radius-sm); margin: 1em 0; }
.md-body a { border-bottom: 1px dashed var(--accent); }
.md-body hr { border: none; border-top: 1px solid var(--border); margin: 1.6em 0; }

/* ---------- 评论 ---------- */
.comments { max-width: 800px; margin: 0 auto; padding: 20px 20px 70px; }
.comment-box {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-top: 16px;
}
.comment-inputs { display: flex; gap: 10px; margin-bottom: 10px; }
.comment-inputs input {
  width: 200px; padding: 9px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--bg-soft); color: var(--text);
  font-size: .9rem; outline: none;
}
.comment-inputs input:focus { border-color: var(--accent); }
textarea.comment-content {
  width: 100%; min-height: 90px; padding: 12px 14px; resize: vertical;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--bg-soft); color: var(--text); font-size: .92rem;
  font-family: inherit; outline: none;
}
textarea.comment-content:focus { border-color: var(--accent); }
.comment-actions { margin-top: 10px; display: flex; align-items: center; gap: 12px; }
.comment-count-badge { font-size: .8rem; color: var(--muted); }
.comment-item {
  display: flex; gap: 12px; padding: 16px 4px; border-bottom: 1px dashed var(--border);
}
.comment-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-grad); color: #fff; font-weight: 700;
}
.comment-info { flex: 1; }
.comment-meta { font-size: .8rem; color: var(--muted); margin-bottom: 4px; display: flex; gap: 10px; }
.comment-meta .cname { font-weight: 700; color: var(--text); font-size: .88rem; }
.comment-text { font-size: .92rem; white-space: pre-wrap; word-break: break-word; }
.comments-empty { text-align: center; color: var(--muted); padding: 30px 0; font-size: .9rem; }

/* ---------- 主题切换器 ---------- */
.theme-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 200;
  width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--accent-grad);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-hover); transition: transform .25s;
}
.theme-fab:hover { transform: scale(1.1) rotate(20deg); }
.theme-fab svg { width: 24px; height: 24px; fill: #fff; }
.theme-panel {
  position: fixed; right: 22px; bottom: 86px; z-index: 200;
  width: 230px; background: var(--card-solid);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-hover); padding: 12px;
  display: none; flex-direction: column; gap: 6px;
}
.theme-panel.open { display: flex; }
.theme-panel-title { font-size: .8rem; color: var(--muted); padding: 2px 6px 6px; }
.theme-option {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid transparent; font-size: .9rem; color: var(--text);
  transition: all .15s;
}
.theme-option:hover { background: var(--chip-bg); }
.theme-option.active { border-color: var(--accent); background: var(--chip-bg); font-weight: 600; }
.theme-dot {
  width: 20px; height: 20px; border-radius: 6px; flex-shrink: 0;
  border: 1px solid rgba(128,128,128,.3);
}
.theme-dot.t-tech { background: linear-gradient(135deg,#0a0e17,#22d3ee); }
.theme-dot.t-glass { background: linear-gradient(135deg,#dfe6f7,#7c3aed); }
.theme-dot.t-corepress { background: linear-gradient(135deg,#f7f8fa,#2563eb); }
.theme-dot.t-kratos { background: linear-gradient(135deg,#ff6b9d,#ff8e53); }
.theme-dot.t-puock { background: linear-gradient(135deg,#f4f9f7,#10b981); }

/* ---------- 编辑器 ---------- */
.editor-layout {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  max-width: 1400px; margin: 0 auto; padding: 16px 20px 30px;
  height: calc(100vh - var(--header-h) - 96px); min-height: 480px;
}
.editor-layout.single-edit { grid-template-columns: 1fr; }
.editor-layout.single-edit .editor-preview { display: none; }
.editor-layout.single-view { grid-template-columns: 1fr; }
.editor-layout.single-view .editor-input { display: none; }
.editor-panel {
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-card); overflow: hidden;
}
.editor-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 14px; border-bottom: 1px solid var(--border);
  font-size: .82rem; color: var(--muted); font-weight: 600;
}
.editor-textarea {
  flex: 1; width: 100%; resize: none; border: none; outline: none;
  background: transparent; color: var(--text);
  padding: 16px 18px; font-size: .95rem; line-height: 1.75;
  font-family: Consolas, "JetBrains Mono", "Courier New", monospace;
}
.editor-preview {
  flex: 1; overflow-y: auto; padding: 18px 22px;
}
.editor-toolbar {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
  max-width: 1400px; margin: 14px auto 0; padding: 0 20px;
}
.tool-btn {
  padding: 6px 12px; font-size: .84rem; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--card); color: var(--text); transition: all .15s;
}
.tool-btn:hover { border-color: var(--accent); color: var(--accent); }
.toolbar-sep { width: 1px; height: 20px; background: var(--border-strong); margin: 0 4px; }
.editor-statusbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  max-width: 1400px; margin: 12px auto; padding: 0 20px;
  font-size: .82rem; color: var(--muted);
}
.editor-statusbar .spacer { flex: 1; }
.draft-list { max-width: 1400px; margin: 0 auto; padding: 0 20px 40px; }
.draft-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 10px;
}
.draft-item .d-title { font-weight: 600; flex: 1; }
.draft-item .d-time { font-size: .78rem; color: var(--muted); }
.view-toggle .tool-btn.active {
  background: var(--accent-grad); color: var(--btn-text); border-color: transparent;
  font-weight: 600;
}
html[data-theme="corepress"] .view-toggle .tool-btn.active,
html[data-theme="kratos"] .view-toggle .tool-btn.active,
html[data-theme="puock"] .view-toggle .tool-btn.active,
html[data-theme="glass"] .view-toggle .tool-btn.active { color: #fff; }

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--border); margin-top: 60px;
  padding: 30px 0; text-align: center; color: var(--muted); font-size: .86rem;
}
.site-footer .footer-logo {
  font-weight: 800; background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

/* ---------- 其他 ---------- */
.toast {
  position: fixed; left: 50%; top: 74px; transform: translateX(-50%) translateY(-16px);
  background: var(--card-solid); color: var(--text);
  border: 1px solid var(--accent); border-radius: var(--radius-sm);
  padding: 10px 22px; font-size: .9rem; z-index: 300;
  box-shadow: var(--shadow-hover); opacity: 0; pointer-events: none;
  transition: all .3s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.empty-tip { color: var(--muted); text-align: center; padding: 40px 0; font-size: .92rem; }
.back-link { font-size: .9rem; }

@media (max-width: 760px) {
  .editor-layout { grid-template-columns: 1fr; height: auto; }
  .editor-layout .editor-preview { min-height: 320px; }
  .main-nav { gap: 0; }
  .main-nav a { padding: 6px 8px; font-size: .85rem; }
  .hero { padding: 56px 0 48px; }
}

/* ============================================================
   WordPress 博客式整体框架（参照 CorePress / Kratos / Puock 布局方案）
   头部：Logo + 菜单 + 搜索 + 明暗切换 ｜ 内容区：文章流 + 侧栏 ｜ 多栏页脚
   ============================================================ */

/* ---------- 头部扩展：搜索 + 明暗切换 ---------- */
.header-search {
  margin-left: auto; display: flex; align-items: center;
}
.header-search input {
  width: 170px; padding: 7px 14px; font-size: .86rem;
  border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--bg-soft); color: var(--text); outline: none;
  transition: width .25s, border-color .2s;
}
.header-search input:focus { width: 220px; border-color: var(--accent); }
.mode-toggle {
  width: 36px; height: 36px; margin-left: 10px; flex-shrink: 0;
  border-radius: 50%; border: 1px solid var(--border-strong);
  background: var(--bg-soft); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s; font-size: 1rem; line-height: 1;
}
.mode-toggle:hover { border-color: var(--accent); transform: rotate(24deg); }
.mode-toggle svg { width: 17px; height: 17px; fill: var(--text); }

/* ---------- 博客主布局：文章流 + 侧栏 ---------- */
.home-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px; padding-top: 40px; align-items: start;
}
@media (max-width: 960px) { .home-layout { grid-template-columns: 1fr; } }

/* 文章流列表（Kratos 式横向卡片） */
.post-list { display: flex; flex-direction: column; gap: 18px; }
.post-list-item {
  display: flex; gap: 0; overflow: hidden;
}
.post-list-item .pl-cover {
  width: 230px; flex-shrink: 0; overflow: hidden; background: var(--chip-bg);
}
.post-list-item .pl-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.post-list-item:hover .pl-cover img { transform: scale(1.06); }
.post-list-item .pl-body { padding: 18px 20px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.post-list-item .pl-title { font-size: 1.12rem; font-weight: 700; line-height: 1.5; }
.post-list-item .pl-title a { color: var(--text); }
.post-list-item .pl-title a:hover { color: var(--accent); }
.post-list-item .pl-excerpt { font-size: .88rem; color: var(--muted); flex: 1; }
.post-list-item .pl-more { font-size: .86rem; font-weight: 600; align-self: flex-start; }
.post-list-item.pl-noimg .pl-cover { display: none; }
.post-type-badge {
  font-size: .7rem; color: #fff; background: var(--accent-grad);
  padding: 1px 8px; border-radius: 999px; margin-left: 6px; vertical-align: 2px;
}
@media (max-width: 640px) {
  .post-list-item { flex-direction: column; }
  .post-list-item .pl-cover { width: 100%; height: 150px; }
  .post-list-item.pl-noimg .pl-cover { display: none; }
}

/* ---------- 侧栏（WordPress Widget 区） ---------- */
.sidebar { display: flex; flex-direction: column; gap: 18px; position: sticky; top: calc(var(--header-h) + 16px); }
@media (max-width: 960px) { .sidebar { position: static; } }
.widget {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-card);
  padding: 18px; overflow: hidden;
}
.widget-title {
  font-size: .95rem; font-weight: 800; margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.widget-title::before {
  content: ""; width: 4px; height: 16px; border-radius: 3px;
  background: var(--accent-grad);
}
.widget-about { text-align: center; }
.widget-about .wa-logo {
  width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 16px;
  background: var(--accent-grad); display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.6rem; font-weight: 900;
}
.widget-about p { font-size: .84rem; color: var(--muted); text-align: left; }
.widget-list { list-style: none; }
.widget-list li {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 7px 0; border-bottom: 1px dashed var(--border);
  font-size: .88rem;
}
.widget-list li:last-child { border-bottom: none; }
.widget-list a {
  color: var(--text); overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; flex: 1;
}
.widget-list a:hover { color: var(--accent); }
.widget-list .wl-date { color: var(--muted); font-size: .76rem; flex-shrink: 0; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a {
  font-size: .82rem; color: var(--muted);
  background: var(--chip-bg); border: 1px solid transparent;
  padding: 3px 12px; border-radius: 999px; transition: all .15s;
}
.tag-cloud a:hover { color: var(--accent); border-color: var(--accent); }
.widget-cats .wc-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; font-size: .88rem;
}
.widget-cats .wc-row .wc-count {
  font-size: .74rem; color: var(--accent); background: var(--chip-bg);
  padding: 1px 9px; border-radius: 999px;
}
.widget-search input {
  width: 100%; padding: 9px 14px; font-size: .88rem;
  border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--bg-soft); color: var(--text); outline: none;
}
.widget-search input:focus { border-color: var(--accent); }

/* ---------- HTML 文章 iframe ---------- */
.post-html-frame {
  width: 100%; min-height: 120vh; border: 1px solid var(--border);
  border-radius: var(--radius); background: #fff;
}
.html-frame-tip {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: .82rem; color: var(--muted);
  background: var(--chip-bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 14px; margin-bottom: 12px;
}

/* ---------- 多栏页脚（WP 风格） ---------- */
.site-footer { margin-top: 30px; }
.footer-columns {
  max-width: var(--maxw); margin: 0 auto; padding: 34px 20px 22px;
  display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 26px;
  text-align: left;
}
@media (max-width: 760px) { .footer-columns { grid-template-columns: 1fr; text-align: center; } }
.footer-col .f-title {
  font-size: .92rem; font-weight: 800; margin-bottom: 10px;
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.footer-col p, .footer-col a.f-link {
  font-size: .84rem; color: var(--muted); display: inline-block; margin: 4px 14px 4px 0;
}
.footer-col a.f-link:hover { color: var(--accent); }
.footer-bar {
  border-top: 1px solid var(--border);
  padding: 14px 0; text-align: center; color: var(--muted); font-size: .8rem;
}

/* ---------- 分类筛选/分页区 ---------- */
.archive-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 18px;
}
.archive-head .archive-title { font-size: 1.3rem; font-weight: 800; }
.archive-head .archive-count { font-size: .84rem; color: var(--muted); }

/* Editor.md 容器 */
#editormd-container { flex: 1; display: flex; flex-direction: column; }
#editormd-container .editormd { flex: 1; height: 100% !important; margin: 0 !important; border-radius: 0; }

/* ============================================================
   功能扩展：TOC / 进度条 / 搜索 / 归档 / 友链 / 编辑器门禁
   ============================================================ */

/* 阅读进度条 */
#readProgress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: var(--accent-grad); z-index: 300;
  transition: width .1s linear;
}

/* 文章 TOC（宽屏悬浮） */
.article-toc {
  display: none; position: fixed; z-index: 90;
  top: 120px; right: calc((100vw - 800px) / 2 - 250px);
  width: 210px; max-height: 60vh; overflow-y: auto;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-card);
  padding: 14px;
}
@media (min-width: 1380px) { .article-toc { display: block; } }
.article-toc .toc-title { font-size: .85rem; font-weight: 800; margin-bottom: 8px; color: var(--accent); }
.article-toc .toc-link {
  display: block; font-size: .82rem; color: var(--muted);
  padding: 4px 8px; border-radius: 6px; margin: 2px 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.article-toc .toc-link.toc-h3 { padding-left: 20px; }
.article-toc .toc-link:hover { color: var(--text); background: var(--chip-bg); }
.article-toc .toc-link.active { color: var(--accent); background: var(--chip-bg); font-weight: 600; }

/* 全文搜索页 */
.search-layout { max-width: 800px; margin: 0 auto; padding: 44px 20px 60px; }
.search-box {
  display: flex; gap: 10px; margin-bottom: 14px;
}
.search-box input {
  flex: 1; padding: 12px 20px; font-size: 1rem;
  border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--bg-soft); color: var(--text); outline: none;
}
.search-box input:focus { border-color: var(--accent); }
.search-count { font-size: .86rem; color: var(--muted); margin-bottom: 20px; }
.search-item { padding: 18px 20px; margin-bottom: 14px; }
.search-snippet { font-size: .88rem; color: var(--muted); line-height: 1.7; }
.search-snippet mark {
  background: var(--chip-bg); color: var(--accent);
  padding: 0 3px; border-radius: 3px; font-weight: 700;
}

/* 归档页 */
.archive-layout { max-width: 800px; margin: 0 auto; padding: 44px 20px 60px; }
.archive-year { margin-bottom: 30px; }
.archive-year .ay-label {
  font-size: 1.5rem; font-weight: 900;
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  padding: 6px 0 12px;
}
.archive-year .ay-label small { font-size: .9rem; color: var(--muted); -webkit-text-fill-color: var(--muted); }
.archive-item {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 4px; border-bottom: 1px dashed var(--border);
  flex-wrap: wrap;
}
.archive-item .ai-date { color: var(--muted); font-size: .84rem; flex-shrink: 0; }
.archive-item .ai-title { color: var(--text); font-size: .95rem; flex: 1; min-width: 200px; }
.archive-item .ai-title:hover { color: var(--accent); }

/* 友链页 */
.links-layout { max-width: 900px; margin: 0 auto; padding: 44px 20px 60px; }
.links-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 760px) { .links-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .links-grid { grid-template-columns: 1fr; } }
.link-card { display: flex; align-items: center; gap: 14px; padding: 18px; }
.link-avatar {
  width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
  background: var(--accent-grad); background-size: cover;
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; font-weight: 900;
}
.link-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.link-info b { color: var(--text); font-size: .95rem; }
.link-info small { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 编辑器门禁 */
.editor-gate {
  position: fixed; inset: 0; z-index: 500;
  background: var(--bg); display: flex; align-items: center; justify-content: center;
}
.gate-card {
  width: 360px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-hover);
  padding: 36px 30px; text-align: center;
}
.gate-card .g-logo {
  width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 16px;
  background: var(--accent-grad); display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.5rem; font-weight: 900;
}
.gate-card h2 { font-size: 1.2rem; margin-bottom: 6px; }
.gate-card p { font-size: .84rem; color: var(--muted); margin-bottom: 18px; }
.gate-card input {
  width: 100%; padding: 11px 16px; font-size: .95rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--bg-soft); color: var(--text); outline: none; text-align: center;
  margin-bottom: 14px;
}
.gate-card input:focus { border-color: var(--accent); }

/* ============================================================
   站点设置弹窗 / HTML 文章编辑 / 品牌 Logo
   ============================================================ */

/* 头部 Logo 图片与设置按钮 */
.logo { display: flex; align-items: center; gap: 8px; }
.logo .logo-img { width: 30px; height: 30px; object-fit: cover; border-radius: 8px; }
.logo .logo-text { -webkit-text-fill-color: var(--text); }
.nav-settings {
  width: 36px; height: 36px; margin-left: 10px; flex-shrink: 0;
  border-radius: 50%; border: 1px solid var(--border-strong);
  background: var(--bg-soft); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.nav-settings:hover { border-color: var(--accent); transform: rotate(60deg); }
.nav-settings svg { width: 16px; height: 16px; fill: var(--muted); }

/* 设置弹窗 */
.settings-modal {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.settings-card {
  width: 560px; max-width: 100%; max-height: 86vh; overflow-y: auto;
  background: var(--card-solid); border: 1px solid var(--border-strong);
  border-radius: var(--radius); box-shadow: var(--shadow-hover);
  padding: 22px;
}
.settings-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; font-size: 1.05rem;
}
.settings-section {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px; margin-bottom: 14px;
}
.settings-title { font-weight: 800; margin-bottom: 12px; color: var(--accent); }
.settings-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.settings-tip { color: var(--muted); font-size: .76rem; display: block; margin-top: 8px; }
.menu-row { display: flex; gap: 8px; margin-bottom: 8px; }
.menu-row input {
  padding: 7px 12px; font-size: .86rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--bg-soft); color: var(--text); outline: none;
}
.menu-row .mr-label { width: 110px; flex-shrink: 0; }
.menu-row .mr-href { flex: 1; }
.menu-row .mr-del { flex-shrink: 0; }
.brand-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.brand-label { width: 80px; font-size: .86rem; color: var(--muted); flex-shrink: 0; }
.brand-preview {
  width: 38px; height: 38px; border-radius: 10px; object-fit: cover;
  border: 1px solid var(--border-strong);
}

/* HTML 文章在线编辑 */
.html-edit-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  height: 520px;
}
.html-edit-grid .editor-panel { display: flex; flex-direction: column; overflow: hidden; }
.html-edit-grid .editor-textarea { font-size: .85rem; }
@media (max-width: 860px) {
  .html-edit-grid { grid-template-columns: 1fr; height: auto; }
  .html-edit-grid .editor-panel { min-height: 300px; }
}

/* ============================================================
   文章列表多布局 / 占位封面 / 布局切换
   ============================================================ */
.layout-switch { display: flex; gap: 4px; }
.layout-btn {
  padding: 4px 12px; font-size: .8rem; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: 999px;
  background: transparent; color: var(--muted); transition: all .15s;
}
.layout-btn:hover { color: var(--text); border-color: var(--accent); }
.layout-btn.active {
  background: var(--accent-grad); color: var(--btn-text);
  border-color: transparent; font-weight: 600;
}

/* 占位封面（无图文章统一卡片样式） */
.pl-cover.pl-placeholder {
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-grad); opacity: .88;
}
.pl-cover.pl-placeholder span {
  font-size: 2rem; font-weight: 900; color: rgba(255,255,255,.92);
  letter-spacing: .05em;
}

/* 卡片布局：竖排封面 + 双列网格 */
.post-list.layout-card {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px;
}
@media (max-width: 720px) { .post-list.layout-card { grid-template-columns: 1fr; } }
.post-list.layout-card .post-list-item { flex-direction: column; }
.post-list.layout-card .pl-cover { width: 100%; height: 160px; }
.post-list.layout-card .pl-cover.pl-placeholder { height: 160px; }
.post-list.layout-card .pl-excerpt { min-height: 42px; }

/* 紧凑布局：纯文字行 */
.post-list.layout-compact { gap: 10px; }
.post-list.layout-compact .post-list-item { padding: 10px 16px; }
.post-list.layout-compact .pl-cover { display: none; }
.post-list.layout-compact .pl-body { padding: 0; gap: 4px; }
.post-list.layout-compact .pl-title { font-size: 1rem; }
.post-list.layout-compact .pl-meta-row { font-size: .74rem; }

/* CodeMirror HTML 编辑器尺寸适配 */
.html-edit-grid .CodeMirror { height: 100%; font-size: .85rem; font-family: Consolas, "Courier New", monospace; }
.html-edit-grid .CodeMirror-gutters { border-right: 1px solid var(--border); }

/* 编辑模式 Tab 与发布向导 */
.editor-tabs {
  max-width: var(--maxw); margin: 22px auto 0; padding: 0 20px;
  display: flex; align-items: center; gap: 8px;
}
.editor-tab {
  padding: 8px 18px; font-size: .9rem; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: 999px 999px 0 0;
  background: var(--bg-soft); color: var(--muted);
  transition: all .15s;
}
.editor-tab:hover { color: var(--text); }
.editor-tab.active {
  background: var(--accent-grad); color: var(--btn-text);
  border-color: transparent;
}
.editor-tab-tip { font-size: .76rem; color: var(--muted); margin-left: 10px; }
.pw-field { margin-bottom: 12px; }
.pw-field label { display: block; font-size: .82rem; color: var(--muted); margin-bottom: 5px; }
.pw-field input, .pw-field textarea {
  width: 100%; padding: 9px 14px; font-size: .9rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--bg-soft); color: var(--text); outline: none;
  font-family: inherit; resize: vertical;
}
.pw-field input:focus, .pw-field textarea:focus { border-color: var(--accent); }

/* ============================================================
   管理员后台 / 评论增强 / iframe 自适应
   ============================================================ */

/* HTML 文章 iframe：高度由 JS 自适应，消除双滚动条 */
.post-html-frame { min-height: 600px; overflow: hidden; }

/* 评论：双输入 + 快捷回复 */
.comment-inputs { display: flex; gap: 10px; margin-bottom: 10px; }
.comment-inputs input {
  flex: 1; padding: 9px 14px; font-size: .88rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--bg-soft); color: var(--text); outline: none;
}
.comment-inputs input:focus { border-color: var(--accent); }
.quick-replies { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.quick-replies .qr-label { font-size: .78rem; color: var(--muted); }
.qr-chip {
  font-size: .78rem; padding: 3px 12px; cursor: pointer;
  border: 1px dashed var(--border-strong); border-radius: 999px;
  background: transparent; color: var(--muted); transition: all .15s;
}
.qr-chip:hover { color: var(--accent); border-color: var(--accent); border-style: solid; }
.comment-meta .cemail { color: var(--muted); font-size: .76rem; }

/* 管理后台布局 */
.admin-layout { max-width: 1000px; margin: 0 auto; padding: 40px 20px 40px; }
.admin-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 20px; }
.admin-head .archive-title { margin-right: auto; }
.admin-stats { font-size: .84rem; color: var(--muted); }
.admin-tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.admin-tab {
  padding: 8px 20px; font-size: .9rem; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--bg-soft); color: var(--muted); transition: all .15s;
}
.admin-tab.active { background: var(--accent-grad); color: var(--btn-text); border-color: transparent; }
.admin-panel .settings-section { background: var(--card); }

.user-form { display: flex; gap: 10px; flex-wrap: wrap; }
.user-form input, .user-form select {
  padding: 9px 14px; font-size: .88rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--bg-soft); color: var(--text); outline: none;
}
.user-form input { flex: 1; min-width: 140px; }

.admin-table { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.at-row {
  display: grid; grid-template-columns: 1.6fr 1fr .7fr .6fr 1.2fr;
  gap: 10px; align-items: center; padding: 10px 16px;
  border-bottom: 1px solid var(--border); font-size: .86rem;
}
.at-row:last-child { border-bottom: none; }
.at-row.at-head { font-weight: 800; color: var(--muted); font-size: .8rem; background: var(--chip-bg); }
.at-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.at-row .at-title { white-space: normal; line-height: 1.5; }
.at-row .at-ccontent { white-space: normal; }
.at-row select {
  padding: 4px 8px; font-size: .8rem;
  border: 1px solid var(--border-strong); border-radius: 6px;
  background: var(--bg-soft); color: var(--text);
}
.status-badge { font-size: .72rem; padding: 2px 10px; border-radius: 999px; }
.st-active { background: rgba(46, 204, 113, .15); color: #27ae60; }
.st-frozen { background: rgba(231, 76, 60, .15); color: #e74c3c; }
@media (max-width: 720px) {
  .at-row { grid-template-columns: 1fr 1fr; }
  .at-row.at-head { display: none; }
}

/* 编辑器门禁双登录方式 & 用户密码标识 */
.gate-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.gate-tab {
  flex: 1; padding: 7px 0; font-size: .82rem; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: 999px;
  background: transparent; color: var(--muted); transition: all .15s;
}
.gate-tab.active { background: var(--accent-grad); color: var(--btn-text); border-color: transparent; }
.gate-card input { margin-bottom: 10px; }
.gate-card .settings-tip { text-align: center; }
.pwd-badge { margin-left: 6px; font-size: .72rem; opacity: .85; }

/* 密码规则实时检查与强度条 */
.pw-strength { display: flex; align-items: center; gap: 10px; margin: -4px 0 10px; }
.pw-strength span { font-size: .78rem; color: var(--muted); min-width: 60px; }
.pw-strength-bar { flex: 1; height: 6px; border-radius: 999px; background: var(--chip-bg); overflow: hidden; }
.pw-strength-bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: #e74c3c; transition: all .25s; }
.pwd-checks { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; }
.pwd-checks li { font-size: .76rem; }
.pwd-checks .pc-ok { color: #27ae60; }
.pwd-checks .pc-fail { color: var(--muted); opacity: .8; }
.pw-error { color: #e74c3c; font-size: .8rem; margin-bottom: 12px; }

/* 用户表 6 列布局（用户名/昵称/邮箱/分组/状态/操作） */
.at-row { grid-template-columns: .9fr 1.3fr 1fr .7fr .6fr 1.3fr; }
