/* =========================================================
   FINALLY BLOG · 
   ========================================================= */
:root {
  --brand: #3366ff;
  --brand-hover: #1a53ff;
  --brand-active: #0f45ff;
  --brand-soft: #f2f5ff;
  --brand-line: #dbe4ff;

  --bg: #f7f8f9;
  --surface: #ffffff;
  --surface-2: #fbfcfd;

  --text: #303742;
  --text-2: #3b4351;
  --muted: #66758c;
  --faint: #97a3b6;
  --line: #eef0f3;
  --line-2: #e3e7ec;

  --ok: #32b643;
  --warn: #ffb700;
  --danger: #e85600;

  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-pill: 999px;

  --shadow-card: 0 0 0 0.5px rgba(188, 195, 206, 0.12), 0 2px 10px rgba(48, 55, 66, 0.06);
  --shadow-hover: 0 0 0 0.5px rgba(188, 195, 206, 0.16), 0 6px 20px rgba(48, 55, 66, 0.1);
  --shadow-pop: 0 10px 32px rgba(48, 55, 66, 0.14);
  --shadow-brand: 0 4px 12px rgba(51, 102, 255, 0.32);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --mono: "SF Mono", "Segoe UI Mono", Menlo, Consolas, monospace;

  --header-h: 64px;
  --shell: 1080px;
}

html[data-theme="dark"] {
  --bg: #1b1f27;
  --surface: #232831;
  --surface-2: #262c36;
  --text: #e6eaf2;
  --text-2: #cbd3e0;
  --muted: #8b97ab;
  --faint: #6b7788;
  --line: #2c333e;
  --line-2: #353d4a;
  --brand-soft: #1f2a45;
  --brand-line: #2c3d66;
  --shadow-card: 0 0 0 0.5px rgba(0, 0, 0, 0.3), 0 2px 10px rgba(0, 0, 0, 0.25);
  --shadow-hover: 0 0 0 0.5px rgba(0, 0, 0, 0.35), 0 6px 20px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color .3s, color .3s;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }

.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }

/* ============ 基础工具类 ============ */
.flex { display: flex; align-items: center; }
.between { display: flex; align-items: center; justify-content: space-between; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; }
.gap-10 { gap: 10px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.col { display: flex; flex-direction: column; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.bold { font-weight: 600; }
.center { text-align: center; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.hide { display: none; }

.card {
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12.5px;
  white-space: nowrap;
}

.divider { height: 1px; background: var(--line); }

/* =========================================================
   前台布局
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
}
.site-header__inner {
  max-width: var(--shell);
  height: 100%;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 9px;
}
.logo:hover { color: var(--brand); }
.logo__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
}
.header-actions { display: flex; align-items: center; gap: 10px; }

.search {
  position: relative;
  width: 200px;
  height: 36px;
}
.search input {
  width: 100%;
  height: 100%;
  padding: 0 34px 0 14px;
  border: none;
  outline: none;
  border-radius: var(--r-pill);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}
.search input::placeholder { color: var(--faint); }
.search .icon {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
}
.icon-btn {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--muted);
  box-shadow: var(--shadow-card);
  transition: .2s;
}
.icon-btn:hover { color: var(--brand); transform: translateY(-1px); }

.layout {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 8px 16px 40px;
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr) 220px;
  gap: 20px;
  align-items: start;
}

.side {
  position: sticky;
  top: calc(var(--header-h) + 8px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.nav-card { padding: 8px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 14px;
  transition: .18s;
}
.nav-item .icon { color: var(--muted); }
.nav-item:hover { background: var(--surface-2); color: var(--brand); }
.nav-item:hover .icon { color: var(--brand); }
.nav-item.active {
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-brand);
}
.nav-item.active .icon { color: #fff; }
.nav-count {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.nav-item.active .nav-count { color: rgba(255, 255, 255, .75); }

.social-card { padding: 12px; }
.social-row { display: flex; align-items: center; gap: 6px; }
.social {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--muted);
  transition: .18s;
}
.social:hover { background: var(--brand-soft); color: var(--brand); }

.cta-card { padding: 16px; text-align: center; }
.cta-card .btn { width: 100%; margin-top: 10px; }

/* 主列 */
.main-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.editor-box { padding: 16px 18px; }
.editor-box__input {
  width: 100%;
  min-height: 56px;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.7;
}
.editor-box__input::placeholder { color: var(--faint); }
.editor-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  margin-top: 4px;
}
.editor-tools { display: flex; align-items: center; gap: 2px; }
.tool {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: var(--r-xs);
  background: transparent; color: var(--faint);
}
.tool:hover { background: var(--surface-2); color: var(--brand); }

.tabbar {
  display: flex; align-items: center; gap: 4px;
  padding: 4px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  position: sticky;
  top: calc(var(--header-h) + 4px);
  z-index: 20;
}
.tab {
  height: 32px;
  padding: 0 14px;
  display: inline-flex; align-items: center;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  color: var(--muted);
  transition: .18s;
}
.tab:hover { color: var(--brand); }
.tab.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 500;
}
.tab .count { margin-left: 5px; font-size: 11.5px; opacity: .7; }

.note-card { padding: 18px 20px; transition: .2s; }
.note-card:hover { box-shadow: var(--shadow-hover); }
.note-head { display: flex; align-items: flex-start; gap: 10px; }
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  flex: none;
  background: linear-gradient(135deg, #cfdcff, #8fb0ff);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 600;
}
.note-head__name { font-size: 13.5px; font-weight: 500; color: var(--text); }
.note-head__sub { font-size: 12px; color: var(--faint); }
.note-more { margin-left: auto; border: none; background: none; color: var(--faint); padding: 2px; }
.note-more:hover { color: var(--brand); }

.note-body { margin-top: 10px; font-size: 14.5px; line-height: 1.85; color: var(--text-2); }
.note-body p + p { margin-top: 8px; }
.note-body .tag-inline { color: var(--brand); }

.thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.thumb {
  aspect-ratio: 4 / 3;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, #e8eefc, #cfd9f5);
  position: relative;
  overflow: hidden;
}
.thumb::after {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.75), transparent 45%),
    radial-gradient(circle at 70% 70%, rgba(51,102,255,.25), transparent 55%);
}

.article-card { display: flex; gap: 16px; align-items: flex-start; }
.article-card__title {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
}
.article-card__desc {
  margin-top: 6px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.75;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card__cover {
  width: 118px; height: 86px;
  border-radius: var(--r-sm);
  flex: none;
  background: linear-gradient(135deg, #dfe8fb, #b9cbf7);
}
.note-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px;
  font-size: 12px;
  color: var(--faint);
}
.note-stats { display: flex; align-items: center; gap: 14px; }
.note-stat { display: inline-flex; align-items: center; gap: 5px; }
.note-stat:hover { color: var(--brand); }
.read-more { display: inline-flex; align-items: center; gap: 4px; color: var(--faint); }
.read-more:hover { color: var(--brand); }

/* 右栏 */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); padding: 14px 8px; text-align: center; }
.stat__num { font-size: 19px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.stat__label { font-size: 10.5px; letter-spacing: .08em; color: var(--faint); text-transform: uppercase; }

.panel { padding: 14px 16px; }
.panel__title {
  font-size: 12px;
  font-weight: 500;
  color: var(--faint);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.heatmap { display: grid; grid-template-columns: repeat(14, 1fr); gap: 3px; }
.heatmap i {
  aspect-ratio: 1;
  border-radius: 2px;
  background: var(--line);
  display: block;
}
.heatmap i[data-l="1"] { background: #c9d8ff; }
.heatmap i[data-l="2"] { background: #89a9ff; }
.heatmap i[data-l="3"] { background: #3366ff; }
html[data-theme="dark"] .heatmap i[data-l="1"] { background: #2c3d66; }
html[data-theme="dark"] .heatmap i[data-l="2"] { background: #3f66c4; }

.topic-row {
  display: flex; align-items: center; justify-content: space-between;
  height: 30px;
  font-size: 13px;
  color: var(--text-2);
}
.topic-row:hover { color: var(--brand); }
.topic-row em { font-style: normal; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.topic-bar {
  height: 3px; border-radius: 2px; background: var(--line); overflow: hidden;
  margin-bottom: 10px;
}
.topic-bar span { display: block; height: 100%; background: var(--brand); border-radius: 2px; }

.site-footer {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 8px 16px 40px;
  text-align: center;
  font-size: 12px;
  color: var(--faint);
}
.site-footer a { color: var(--faint); }
.site-footer a:hover { color: var(--brand); }

.fab { position: fixed; right: 22px; bottom: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 35; }

/* 分页 */
.pager { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 18px 0 4px; }
.pager a {
  min-width: 34px; height: 34px;
  padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  box-shadow: var(--shadow-card);
}
.pager a:hover { color: var(--brand); }
.pager a.active { background: var(--brand); color: #fff; box-shadow: var(--shadow-brand); }

/* 通用按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  transition: .18s;
  white-space: nowrap;
}
.btn:hover { background: var(--line); color: var(--text); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-brand); }
.btn-primary:hover { background: var(--brand-hover); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line-2); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); background: transparent; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 12.5px; }
.btn-lg { height: 42px; padding: 0 22px; font-size: 14.5px; border-radius: var(--r-md); }
.btn-block { width: 100%; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: #fdeee6; color: var(--danger); }

/* 标签 */
.tag {
  display: inline-flex; align-items: center;
  height: 22px; padding: 0 9px;
  border-radius: var(--r-xs);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
}
.tag-grey { background: var(--surface-2); color: var(--muted); }
.tag-ok { background: #e9f8ec; color: var(--ok); }
.tag-warn { background: #fff6e0; color: #b98300; }
.tag-danger { background: #fdeee6; color: var(--danger); }

/* =========================================================
   页面级：文章详情
   ========================================================= */
.post-head { padding: 26px 28px 20px; }
.post-title { font-size: 24px; line-height: 1.45; font-weight: 600; color: var(--text); letter-spacing: -.01em; }
.post-meta { display: flex; align-items: center; gap: 12px; margin-top: 14px; font-size: 12.5px; color: var(--faint); flex-wrap: wrap; }

.prose { padding: 4px 28px 28px; font-size: 15px; line-height: 1.95; color: var(--text-2); }
.prose h2 { font-size: 18px; font-weight: 600; color: var(--text); margin: 26px 0 10px; }
.prose h3 { font-size: 15.5px; font-weight: 600; color: var(--text); margin: 20px 0 8px; }
.prose p { margin: 12px 0; }
.prose ul { margin: 12px 0; padding-left: 20px; list-style: disc; }
.prose li { margin: 6px 0; }
.prose blockquote {
  margin: 16px 0;
  padding: 10px 16px;
  border-left: 3px solid var(--brand);
  background: var(--brand-soft);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  color: var(--muted);
  font-size: 14px;
}
.prose code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
}
.prose pre {
  margin: 16px 0;
  padding: 14px 16px;
  background: #22272f;
  border-radius: var(--r-sm);
  overflow: auto;
}
.prose pre code { background: none; border: none; color: #d7e0ee; padding: 0; }
.prose figure { margin: 18px 0; }
.prose figure .thumb { aspect-ratio: 16 / 9; }
.prose figcaption { margin-top: 6px; font-size: 12px; color: var(--faint); text-align: center; }

.toc { padding: 14px 16px; }
.toc a { display: block; font-size: 13px; color: var(--muted); padding: 5px 0 5px 12px; border-left: 2px solid var(--line); }
.toc a:hover { color: var(--brand); }
.toc a.active { color: var(--brand); border-left-color: var(--brand); font-weight: 500; }

.author-card { padding: 18px 16px; text-align: center; }
.author-card .avatar { width: 56px; height: 56px; margin: 0 auto 10px; font-size: 18px; }
.author-card__name { font-size: 14.5px; font-weight: 600; }
.author-card__bio { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.7; }

.comment { padding: 16px 0; border-bottom: 1px solid var(--line); }
.comment:last-child { border-bottom: none; }
.comment__head { display: flex; align-items: center; gap: 8px; }
.comment__name { font-size: 13px; font-weight: 600; }
.comment__time { font-size: 11.5px; color: var(--faint); }
.comment__body { margin-top: 6px; font-size: 13.5px; color: var(--text-2); line-height: 1.8; padding-left: 42px; }
.comment__reply { margin-top: 10px; margin-left: 42px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--r-sm); font-size: 13px; }

/* 归档 */
.year-group { padding: 6px 0; }
.year-title {
  font-size: 15px; font-weight: 600; color: var(--text);
  padding: 6px 0 10px;
  display: flex; align-items: center; gap: 8px;
}
.year-title span { font-size: 12px; color: var(--faint); font-weight: 400; }
.archive-item {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 0 10px 4px;
  border-left: 2px solid var(--line);
  margin-left: 4px;
  padding-left: 18px;
  position: relative;
  font-size: 13.5px;
  color: var(--text-2);
}
.archive-item::before {
  content: "";
  position: absolute; left: -5px; top: 18px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--line-2);
  border: 2px solid var(--surface);
}
.archive-item:hover { color: var(--brand); }
.archive-item:hover::before { background: var(--brand); }
.archive-item time { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; width: 44px; flex: none; }

/* 关于 */
.about-hero { padding: 30px 28px; display: flex; gap: 22px; align-items: center; }
.about-hero .avatar { width: 84px; height: 84px; font-size: 26px; }
.about-hero h2 { font-size: 20px; font-weight: 600; }
.about-hero p { margin-top: 8px; font-size: 13.5px; color: var(--muted); line-height: 1.8; }
.skill { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* 友链 */
.link-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.link-card { display: flex; gap: 12px; align-items: center; padding: 14px 16px; }
.link-logo {
  width: 40px; height: 40px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, #e8eefc, #c6d5f7);
  display: flex; align-items: center; justify-content: center;
  color: var(--brand); font-weight: 700; font-size: 14px;
}
.link-card__name { font-size: 14px; font-weight: 600; color: var(--text); }
.link-card__desc { font-size: 12px; color: var(--faint); margin-top: 3px; }

/* =========================================================
   管理后台
   ========================================================= */
.admin {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 100vh;
}
.admin-side {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 18px 12px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 10px 16px;
  font-size: 16px; font-weight: 600; color: var(--text);
}
.admin-brand__logo {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  box-shadow: var(--shadow-brand);
}
.admin-brand small { display: block; font-size: 11px; color: var(--faint); font-weight: 400; letter-spacing: .04em; }

.menu-label {
  padding: 14px 12px 6px;
  font-size: 11px;
  color: var(--faint);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.menu-link {
  display: flex; align-items: center; gap: 10px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 13.5px;
  transition: .16s;
}
.menu-link .icon { color: var(--faint); }
.menu-link:hover { background: var(--surface-2); color: var(--brand); }
.menu-link:hover .icon { color: var(--brand); }
.menu-link.active { background: var(--brand-soft); color: var(--brand); font-weight: 500; }
.menu-link.active .icon { color: var(--brand); }
.menu-badge {
  margin-left: auto;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  display: inline-flex; align-items: center; justify-content: center;
}
.admin-side__foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }

.admin-top {
  position: sticky; top: 0; z-index: 30;
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 0 22px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.crumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--faint); }
.crumb b { font-size: 15px; color: var(--text); font-weight: 600; }
.admin-top__right { display: flex; align-items: center; gap: 10px; }
.admin-search {
  display: flex; align-items: center; gap: 8px;
  height: 34px; width: 210px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--faint);
  font-size: 13px;
}
.admin-search input {
  flex: 1; min-width: 0;
  border: none; outline: none; background: none;
  color: var(--text); font-size: 13px; font-family: inherit;
}
.admin-user { display: flex; align-items: center; gap: 8px; padding-left: 6px; }
.admin-user .avatar { width: 30px; height: 30px; font-size: 12px; }

.admin-body { padding: 20px 22px 40px; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.page-head h2 { font-size: 18px; font-weight: 600; color: var(--text); }
.page-head p { margin-top: 5px; font-size: 12.5px; color: var(--muted); }

/* 统计卡 */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat-card { padding: 16px 18px; }
.stat-card__top { display: flex; align-items: center; justify-content: space-between; }
.stat-card__label { font-size: 12.5px; color: var(--muted); }
.stat-card__icon {
  width: 30px; height: 30px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-soft); color: var(--brand);
}
.stat-card__num {
  margin-top: 8px;
  font-size: 24px; font-weight: 600; color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.stat-card__foot { margin-top: 6px; font-size: 12px; color: var(--faint); display: flex; align-items: center; gap: 4px; }
.trend-up { color: var(--ok); }
.trend-down { color: var(--danger); }

/* 内容卡 */
.panel-card { background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-card); }
.panel-card__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.panel-card__head h3 { font-size: 14px; font-weight: 600; color: var(--text); }
.panel-card__body { padding: 18px; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }

/* 柱状图 */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 132px; padding-top: 8px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar {
  width: 100%;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, #5b83ff, #3366ff);
  opacity: .9;
  transition: .2s;
}
.bar:hover { opacity: 1; transform: translateY(-2px); }
.bar-col small { font-size: 11px; color: var(--faint); }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table thead th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
  font-size: 12.5px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table tbody td { padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--text-2); vertical-align: middle; }
.table tbody tr:hover td { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: none; }
.cell-title { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); }
.cell-sub { font-size: 11.5px; color: var(--faint); margin-top: 2px; }
.row-actions { display: flex; align-items: center; gap: 4px; }
.link-btn {
  border: none; background: none; padding: 4px 6px;
  border-radius: var(--r-xs);
  color: var(--brand); font-size: 12.5px;
}
.link-btn:hover { background: var(--brand-soft); }
.link-btn.is-danger { color: var(--danger); }
.link-btn.is-danger:hover { background: #fdeee6; }

.checkbox {
  width: 15px; height: 15px; border-radius: 4px;
  border: 1.5px solid var(--line-2);
  display: inline-block; vertical-align: middle;
  background: var(--surface);
}

/* 筛选栏 */
.filterbar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.pill-tabs { display: flex; align-items: center; gap: 2px; background: var(--surface-2); padding: 3px; border-radius: var(--r-sm); }
.pill-tab {
  height: 28px; padding: 0 12px;
  display: inline-flex; align-items: center;
  border-radius: 6px;
  font-size: 12.5px; color: var(--muted);
}
.pill-tab.active { background: var(--surface); color: var(--brand); font-weight: 500; box-shadow: 0 1px 3px rgba(48,55,66,.12); }
.pill-tab .count { margin-left: 4px; color: var(--faint); }

.input, .select, .textarea {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: .16s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.input::placeholder { color: var(--faint); }
.textarea { height: auto; padding: 10px; line-height: 1.7; resize: vertical; }
.select { padding-right: 26px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--faint) 50%), linear-gradient(135deg, var(--faint) 50%, transparent 50%); background-position: calc(100% - 14px) 14px, calc(100% - 9px) 14px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.input-icon { position: relative; display: inline-flex; align-items: center; }
.input-icon .icon { position: absolute; left: 10px; color: var(--faint); }
.input-icon .input { padding-left: 32px; width: 190px; }

/* 表单 */
.form-row { margin-bottom: 16px; }
.form-label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.form-label i { color: var(--danger); font-style: normal; }
.form-control { width: 100%; }
.form-hint { margin-top: 5px; font-size: 11.5px; color: var(--faint); }

.switch {
  width: 38px; height: 21px; border-radius: var(--r-pill);
  background: var(--line-2); position: relative; display: inline-block;
  transition: .2s; flex: none;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 17px; height: 17px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: .2s;
}
.switch.on { background: var(--brand); }
.switch.on::after { left: 19px; }

/* 后台编辑器 */
.edit-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.edit-title {
  width: 100%;
  border: none; outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 22px; font-weight: 600; color: var(--text);
  padding: 4px 0 12px;
}
.edit-title::placeholder { color: var(--faint); }
.toolbar {
  display: flex; align-items: center; gap: 2px;
  padding: 8px 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  flex-wrap: wrap;
}
.toolbar .sep { width: 1px; height: 18px; background: var(--line-2); margin: 0 6px; }
.edit-area {
  width: 100%;
  min-height: 380px;
  border: none; outline: none; resize: vertical;
  padding: 18px;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.9;
  color: var(--text-2);
  background: transparent;
}
.edit-foot { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-top: 1px solid var(--line); }

.side-panel { padding: 16px 18px; }
.side-panel + .side-panel { border-top: 1px solid var(--line); }
.side-panel h4 { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.side-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; font-size: 13px; color: var(--text-2); }
.side-row + .side-row { border-top: 1px dashed var(--line); }

.upload-box {
  border: 1px dashed var(--line-2);
  border-radius: var(--r-sm);
  padding: 20px;
  text-align: center;
  color: var(--faint);
  font-size: 12.5px;
  background: var(--surface-2);
  transition: .18s;
}
.upload-box:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.upload-box .icon { margin: 0 auto 6px; width: 22px; height: 22px; }

/* 分类树 */
.tree-row {
  display: flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 10px;
  border-radius: var(--r-sm);
  font-size: 13.5px; color: var(--text-2);
}
.tree-row:hover { background: var(--surface-2); }
.tree-row.child { padding-left: 34px; }
.tree-row .count { margin-left: auto; font-size: 12px; color: var(--faint); }

/* 登录页 */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: var(--bg);
}
.login-visual {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, #3366ff 0%, #1a3fd6 55%, #12246e 100%);
  color: #fff;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-visual::after {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 78% 18%, rgba(255,255,255,.22), transparent 42%),
    radial-gradient(circle at 12% 82%, rgba(120,255,235,.22), transparent 45%);
}
.login-visual > * { position: relative; z-index: 1; }
.login-visual h1 { font-size: 30px; line-height: 1.4; font-weight: 600; letter-spacing: -.01em; }
.login-visual p { margin-top: 14px; font-size: 14px; color: rgba(255,255,255,.72); line-height: 1.9; max-width: 380px; }
.login-quote {
  border-left: 2px solid rgba(255,255,255,.4);
  padding-left: 14px;
  font-size: 13px;
  color: rgba(255,255,255,.66);
  line-height: 1.9;
}
.login-quote b { display: block; color: #fff; font-weight: 500; margin-bottom: 4px; }
.login-form-wrap { display: flex; align-items: center; justify-content: center; padding: 32px; }
.login-card { width: 100%; max-width: 356px; }
.login-card h2 { font-size: 22px; font-weight: 600; color: var(--text); }
.login-card > p { margin-top: 8px; font-size: 13px; color: var(--muted); }
.login-tabs { display: flex; gap: 18px; margin: 26px 0 4px; border-bottom: 1px solid var(--line); }
.login-tabs a { padding: 0 0 10px; font-size: 13.5px; color: var(--muted); position: relative; }
.login-tabs a.active { color: var(--text); font-weight: 500; }
.login-tabs a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--brand); border-radius: 2px; }
.login-field { margin-top: 16px; }
.login-field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 7px; }
.login-field .input { height: 40px; width: 100%; }
.login-extra { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.login-card .btn-lg { margin-top: 20px; }
.login-foot { margin-top: 24px; font-size: 11.5px; color: var(--faint); text-align: center; line-height: 1.9; }

/* 设计稿说明浮层 */
.spec-badge {
  position: fixed; left: 16px; bottom: 16px; z-index: 60;
  display: flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 12px;
  border-radius: var(--r-pill);
  background: rgba(48,55,66,.86);
  color: #fff; font-size: 11.5px;
  backdrop-filter: blur(6px);
}

/* 响应式 */
@media (max-width: 1080px) {
  .layout { grid-template-columns: 176px minmax(0, 1fr); }
  .layout > .side--right { display: none; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .layout > .side--left { display: none; }
  .site-header__inner { padding: 0 12px; }
  .search { width: 132px; }
  .admin { grid-template-columns: minmax(0, 1fr); }
  .admin-side { display: none; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .edit-grid { grid-template-columns: minmax(0, 1fr); }
  .login-page { grid-template-columns: minmax(0, 1fr); }
  .login-visual { display: none; }
  .link-grid { grid-template-columns: minmax(0, 1fr); }
  .post-head, .prose { padding-left: 18px; padding-right: 18px; }
}

/* =========================================================
   站点应用层（P0）
   ========================================================= */

/* Pjax 顶部进度条 */
#pjax-progress {
  position: fixed; top: 0; left: 0; z-index: 9999;
  height: 2px; width: 0;
  background: linear-gradient(90deg, #3366ff, #8fb0ff);
  box-shadow: 0 0 8px rgba(51, 102, 255, .55);
  transition: width .18s ease, opacity .3s ease;
  pointer-events: none;
}
#pjax-progress.done { opacity: 0; }

/* Pjax 切换中的内容淡出 */
#pjax-container { transition: opacity .18s ease; }
body.pjax-loading #pjax-container { opacity: .45; }

/* 移动端抽屉 */
.drawer-mask {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(24, 28, 36, .45);
  opacity: 0; visibility: hidden; transition: .22s;
}
.drawer-mask.open { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 51;
  width: 268px; padding: 16px;
  background: var(--bg);
  transform: translateX(-102%);
  transition: transform .26s cubic-bezier(.4, 0, .2, 1);
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
}
.drawer.open { transform: none; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 4px 4px 10px; }

/* 底部 tab（移动端） */
.bottom-tabs {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  height: 54px;
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.bottom-tab {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  font-size: 10.5px; color: var(--faint);
}
.bottom-tab .icon { width: 19px; height: 19px; }
.bottom-tab.active { color: var(--brand); }

/* 空状态 */
.empty {
  padding: 48px 20px; text-align: center; color: var(--faint); font-size: 13.5px;
}
.empty .icon { display: block; width: 30px; height: 30px; margin: 0 auto 12px; opacity: .6; }

/* 提示条 */
.alert {
  padding: 10px 14px; border-radius: var(--r-sm);
  font-size: 13px; line-height: 1.7;
  background: var(--brand-soft); color: var(--brand);
}
.alert-ok { background: #e9f8ec; color: #2a8f45; }
.alert-error { background: #fdeee6; color: var(--danger); }

/* 表单补充 */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.input-block { width: 100%; height: 40px; }
.checkbox-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }

/* 详情正文 */
.prose img { border-radius: var(--r-sm); margin: 16px 0; }
.prose hr { border: none; border-top: 1px solid var(--line); margin: 24px 0; }
.prose ol { margin: 12px 0; padding-left: 22px; }
.prose ol li { margin: 6px 0; }
.prose strong { color: var(--text); }
.prose a { border-bottom: 1px solid var(--brand-line); }

/* 文章卡片标题链接悬停 */
.article-card__title:hover { color: var(--brand); }

/* 点赞 / 收藏激活态 */
.note-stat.is-active { color: var(--brand); font-weight: 500; }
.note-stat.is-active .icon { stroke: var(--brand); }

/* 笔记正文里的图片网格（单图/多图） */
.note-media { margin-top: 12px; display: grid; gap: 8px; }
.note-media.cols-1 { grid-template-columns: 1fr; }
.note-media.cols-2 { grid-template-columns: repeat(2, 1fr); }
.note-media.cols-3 { grid-template-columns: repeat(3, 1fr); }
.note-media img { width: 100%; border-radius: var(--r-sm); object-fit: cover; }

/* 正文封面 */
.post-cover { margin: 0 0 4px; }
.post-cover img { width: 100%; border-radius: var(--r-sm); }

/* 页面级标题条 */
.page-hero { padding: 22px 24px; }
.page-hero h1 { font-size: 21px; font-weight: 600; margin-top: 8px; }

@media (max-width: 860px) {
  .bottom-tabs { display: flex; }
  body { padding-bottom: calc(54px + env(safe-area-inset-bottom)); }
  .fab { bottom: 70px; right: 14px; }
  .site-header__inner { padding: 0 14px; }
  .search { width: 40px; }
  .search input { padding: 0; width: 0; opacity: 0; }
  .search .icon { position: static; }
}

/* =========================================================
   媒体库
   ========================================================= */
.dropzone {
  border: 1px dashed var(--line-2);
  border-radius: var(--r-md);
  padding: 26px;
  text-align: center;
  color: var(--faint);
  cursor: pointer;
  background: var(--surface-2);
  transition: .18s;
}
.dropzone:hover, .dropzone.is-over {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}
.dropzone .icon { margin: 0 auto 8px; width: 22px; height: 22px; }

.media-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.media-card {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface);
  display: flex;
  flex-direction: column;
}
.media-card__thumb {
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  background-color: var(--surface-2);
}
.media-card__info { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.media-card__name {
  font-size: 12.5px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.media-card__actions { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px 8px 8px; margin-top: auto; }

/* 弹层与裁剪 */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal__mask { position: absolute; inset: 0; background: rgba(24, 28, 36, .5); }
.modal__body {
  position: relative;
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-pop);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.modal__head h3 { font-size: 14px; font-weight: 600; }
.modal__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap;
}
.crop-stage {
  position: relative;
  background: #22272f;
  display: flex; align-items: center; justify-content: center;
  padding: 12px;
  overflow: hidden;
  user-select: none;
}
.crop-stage img { max-width: 100%; max-height: 56vh; display: block; cursor: crosshair; }
.crop-box {
  position: absolute;
  border: 1px solid #fff;
  background: rgba(51, 102, 255, .18);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .35);
  pointer-events: none;
}

@media (max-width: 1080px) {
  .media-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* =========================================================
   统一弹窗（替代原生 confirm / alert）
   ========================================================= */
.ui-dialog { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 20px; }
.ui-dialog[hidden] { display: none; }
.ui-dialog__mask { position: absolute; inset: 0; background: rgba(24, 28, 36, .45); backdrop-filter: blur(2px); }
.ui-dialog__body {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-pop);
  padding: 20px;
  animation: ui-dialog-in .18s ease;
}
@keyframes ui-dialog-in {
  from { opacity: 0; transform: translateY(6px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.ui-dialog__head { display: flex; align-items: center; gap: 10px; }
.ui-dialog__icon {
  width: 30px; height: 30px; border-radius: 9px;
  background: #fdeee6; color: var(--danger);
  display: flex; align-items: center; justify-content: center;
  flex: none;
}
.ui-dialog__title { font-size: 14.5px; font-weight: 600; color: var(--text); }
.ui-dialog__text { margin-top: 12px; font-size: 13px; color: var(--muted); line-height: 1.8; word-break: break-word; white-space: pre-line; }
.ui-dialog__foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.btn-solid-danger { background: var(--danger); color: #fff; box-shadow: 0 4px 12px rgba(232, 86, 0, .28); }
.btn-solid-danger:hover { background: #cf4a00; color: #fff; }

/* =========================================================
   点赞 / 收藏操作按钮
   ========================================================= */
.note-stat {
  padding: 4px 9px;
  margin: -4px -5px;
  border: none;
  background: transparent;
  border-radius: var(--r-pill);
  font-size: 12px;
  color: var(--faint);
  cursor: pointer;
  transition: background-color .18s, color .18s;
}
.note-stat:hover { background: var(--brand-soft); color: var(--brand); }
.note-stat.is-active { color: var(--danger); background: #fdeee6; }
.note-stat.is-active .icon { fill: currentColor; stroke: currentColor; }
.note-stat[data-action="favorite"].is-active { color: #b98300; background: #fff6e0; }

/* 详情页操作条 */
.action-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px 0 13px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  transition: transform .18s, box-shadow .18s, border-color .18s, background-color .18s, color .18s;
}
.action-btn .icon { width: 18px; height: 18px; color: var(--faint); transition: color .18s, fill .18s; }
.action-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}
.action-btn:hover .icon { color: var(--brand); }
.action-btn:active { transform: translateY(0) scale(.98); }

.action-btn__count {
  font-variant-numeric: tabular-nums;
  color: var(--faint);
  font-weight: 500;
  padding-left: 1px;
}
.action-btn:hover .action-btn__count { color: inherit; }

/* 已点赞：暖橙 */
.action-btn.is-active[data-action="like"] {
  background: #fdeee6;
  border-color: #f6cbb4;
  color: var(--danger);
}
.action-btn.is-active[data-action="like"] .icon,
.action-btn.is-active[data-action="like"] .action-btn__count {
  color: var(--danger);
}
.action-btn.is-active[data-action="like"] .icon { fill: currentColor; stroke: currentColor; }

/* 已收藏：暖金 */
.action-btn.is-active[data-action="favorite"] {
  background: #fff6e0;
  border-color: #f2dda4;
  color: #a87600;
}
.action-btn.is-active[data-action="favorite"] .icon,
.action-btn.is-active[data-action="favorite"] .action-btn__count {
  color: #a87600;
}
.action-btn.is-active[data-action="favorite"] .icon { fill: currentColor; stroke: currentColor; }

/* 点击反馈 */
.action-btn.is-bump { animation: action-bump .34s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes action-bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.09); }
  100% { transform: scale(1); }
}

html[data-theme="dark"] .note-stat.is-active { background: #3a231a; color: #ff9a63; }
html[data-theme="dark"] .note-stat[data-action="favorite"].is-active { background: #3a2f14; color: #ffc94d; }
html[data-theme="dark"] .action-btn.is-active[data-action="like"] { background: #3a231a; border-color: #5a3527; color: #ff9a63; }
html[data-theme="dark"] .action-btn.is-active[data-action="like"] .icon,
html[data-theme="dark"] .action-btn.is-active[data-action="like"] .action-btn__count { color: #ff9a63; }
html[data-theme="dark"] .action-btn.is-active[data-action="favorite"] { background: #3a2f14; border-color: #5a4a1e; color: #ffc94d; }
html[data-theme="dark"] .action-btn.is-active[data-action="favorite"] .icon,
html[data-theme="dark"] .action-btn.is-active[data-action="favorite"] .action-btn__count { color: #ffc94d; }

/* 模态框遮罩：点击不关闭，仅拦截穿透 */
.ui-dialog__mask, .modal__mask { cursor: default; }

/* 拖拽排序 */
.drag-cell { white-space: nowrap; }
.drag-handle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; margin-right: 6px;
  border-radius: 6px; color: var(--faint); cursor: grab;
}
.drag-handle:hover { background: var(--brand-soft); color: var(--brand); }
tr[draggable="true"] { cursor: default; }
tr.is-dragging { opacity: .45; background: var(--brand-soft) !important; }
tr.is-dragging td { background: var(--brand-soft) !important; }

/* 开关可点击 */
.switch { cursor: pointer; }
.switch:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* 友链说明（来自页面正文） */
.links-note ul { margin: 0; padding-left: 18px; list-style: disc; }
.links-note li { margin: 4px 0; line-height: 1.8; }
.links-note p { margin: 6px 0; line-height: 1.8; }
.links-note blockquote {
  margin: 8px 0;
  padding: 8px 12px;
  border-left: 3px solid var(--brand);
  background: var(--brand-soft);
  border-radius: 0 6px 6px 0;
  color: var(--muted);
}

.apply-note { display: none; }
@media (max-width: 1080px) {
  .apply-note { display: block; }
}

/* 封面选择器 */
.cover-picker {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-sm);
  background-color: var(--surface-2);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  text-align: center;
  transition: border-color .18s, background-color .18s;
}
.cover-picker:hover { border-color: var(--brand); background-color: var(--brand-soft); }
.cover-picker:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.cover-picker__empty {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  color: var(--faint); font-size: 12.5px; line-height: 1.4;
}
.cover-picker__empty .icon { width: 22px; height: 22px; }
.cover-picker__empty em { font-style: normal; font-size: 11px; opacity: .85; }
.cover-picker__tip {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12.5px;
  background: rgba(24, 28, 36, .34);
  opacity: 0; transition: opacity .18s;
  pointer-events: none;
}
.cover-picker.has-image { border-style: solid; border-color: transparent; }
.cover-picker.has-image .cover-picker__empty { display: none; }
.cover-picker.has-image:hover .cover-picker__tip { opacity: 1; }

/* 侧栏导航拖拽排序（管理员） */
.nav-card.has-sort .nav-item { position: relative; padding-right: 26px; }
.nav-card.has-sort .nav-count { margin-right: 12px; }
.nav-drag {
  position: absolute; right: 6px; top: 50%;
  transform: translateY(-50%);
  font-size: 13px; line-height: 1;
  color: var(--faint);
  opacity: 0; cursor: grab;
  transition: opacity .15s;
  user-select: none;
}
.nav-item:hover .nav-drag { opacity: .7; }
.nav-drag:active { cursor: grabbing; }
.nav-item.is-dragging { opacity: .45; background: var(--brand-soft); }

/* 右栏卡片拖拽（管理员） */
.side--right.has-sort .card { position: relative; }
.aside-drag {
  position: absolute; top: 8px; right: 8px;
  font-size: 13px; line-height: 1;
  color: var(--faint);
  opacity: 0; cursor: grab;
  transition: opacity .15s;
  user-select: none;
  z-index: 2;
}
.side--right.has-sort .card:hover .aside-drag { opacity: .7; }
.aside-drag:active { cursor: grabbing; }
.side--right.has-sort .card.is-dragging { opacity: .5; }
.side--right.has-sort .cta-card .aside-drag { color: rgba(255, 255, 255, .85); }

/* 头部用户按钮（PC） */
.header-user {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px 0 8px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  transition: .18s;
  white-space: nowrap;
}
.header-user:hover {
  border-color: var(--brand);
  color: var(--brand);
  transform: translateY(-1px);
  box-shadow: var(--shadow-card);
}
.header-user .icon { color: var(--faint); }
.header-user:hover .icon { color: var(--brand); }
.header-user__avatar {
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  flex: none;
}
.header-user__avatar img { width: 100%; height: 100%; object-fit: cover; }

/* 菜单按钮仅移动端显示 */
.menu-toggle { display: none; }

@media (max-width: 860px) {
  .menu-toggle { display: inline-flex; }

  /* 移动端也保留登录 / 头像入口（与旧站一致） */
  .header-user { display: inline-flex; }
  .header-user__label { display: none; }
}

@media (max-width: 1080px) and (min-width: 861px) {
  .header-user__label { display: none; }
  .header-user { padding: 0 8px; }
}

/* 头像图片 */
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

/* 登录按钮：仅图标 */
.header-user--icon { padding: 0 11px; gap: 0; }
.header-user--icon .icon { width: 17px; height: 17px; }

/* 登录按钮：圆形图标按钮 */
.header-user--icon {
  width: 34px;
  padding: 0;
  gap: 0;
  justify-content: center;
  border-radius: 50%;
}

/* 登录态：纯头像圆形按钮 */
.header-user--avatar {
  width: 34px;
  height: 34px;
  padding: 0;
  gap: 0;
  justify-content: center;
  border-radius: 50%;
}
.header-user--avatar .header-user__avatar {
  width: 28px;
  height: 28px;
  font-size: 12.5px;
}

/* 搜索图标按钮：可点击 + 垂直居中 */
.search__btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--faint);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color .18s, color .18s;
  z-index: 2;
}
.search__btn:hover { background: var(--brand-soft); color: var(--brand); }
.search__btn .icon { position: static; transform: none; color: inherit; }

@media (max-width: 860px) {
  .search { width: 40px; transition: width .22s ease; }
  .search input { width: 0; padding: 0; opacity: 0; }
  .search__btn { right: 0; width: 40px; height: 36px; border-radius: var(--r-pill); }
  .search.is-open { width: min(62vw, 240px); }
  .search.is-open input { width: 100%; padding: 0 40px 0 14px; opacity: 1; }
}

/* 卡片右上角「更多」菜单 */
.card-more { margin-left: auto; position: relative; }
.card-more .note-more { margin-left: 0; }
.card-more__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 118px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-pop);
  z-index: 30;
}
.card-more__menu[hidden] { display: none; }
.card-more__item {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  background: none;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text-2);
  text-align: left;
  cursor: pointer;
}
.card-more__item:hover { background: var(--surface-2); color: var(--brand); }
.card-more__item.is-danger { color: var(--danger); }
.card-more__item.is-danger:hover { background: #fdeee6; color: var(--danger); }

/* 删除时的卡片淡出 */
.note-card.is-removing { opacity: 0; transform: scale(.98); transition: opacity .2s, transform .2s; }


/* 发布框内联编辑状态 */
.editor-box.is-editing { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* 评论回复提示 */
#reply-hint[hidden] { display: none !important; }

/* 评论回复按钮：悬停当条评论时显示 */
.comment__head .reply-btn,
.comment__reply .reply-btn {
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s ease;
}
.comment__head:hover .reply-btn,
.comment__reply:hover .reply-btn {
  opacity: 1;
  visibility: visible;
}
.comment__reply {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.comment__reply .grow { min-width: 0; }

@media (hover: none) {
  .comment__head .reply-btn,
  .comment__reply .reply-btn { opacity: .8; visibility: visible; }
}

/* 多级评论缩进 */
.comment--child {
  border-bottom: none;
  padding: 8px 0 8px 12px;
  border-left: 2px solid var(--line-2);
  margin-top: 4px;
}
.comment--child .comment__body { margin-top: 4px; }
.comment--child:last-child { border-bottom: none; }

/* 移动端抽屉：底部按钮与导航拉开间距 */
.drawer .side { position: static; top: auto; }
.drawer > .btn-block { margin-top: 4px; }

/* 详情页右上角编辑按钮 */
.post-head { position: relative; }
.post-edit { position: absolute; right: 20px; top: 20px; }
@media (max-width: 620px) {
  .post-edit { right: 14px; top: 14px; }
}

/* hidden 属性优先于 flex 布局（取消按钮等） */
.btn[hidden] { display: none !important; }

/* 发布框：允许评论开关 */
.mini-switch {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--muted);
  cursor: pointer; user-select: none;
}
.mini-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.mini-switch__track {
  position: relative; flex: none;
  width: 34px; height: 20px;
  border-radius: 999px;
  background: var(--line-2);
  transition: background-color .18s;
}
.mini-switch__track::after {
  content: '';
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
  transition: transform .18s;
}
.mini-switch input:checked + .mini-switch__track { background: var(--brand); }
.mini-switch input:checked + .mini-switch__track::after { transform: translateX(14px); }
.mini-switch input:focus-visible + .mini-switch__track { outline: 2px solid var(--brand); outline-offset: 2px; }
.mini-switch__text { line-height: 1; }


@media (max-width: 480px) {
  .editor-bar { flex-wrap: wrap; gap: 8px; }
  .editor-bar .mini-switch { order: 3; }
}

/* 登录 / 注册弹窗 */
.auth-tabs { display: flex; align-items: center; gap: 18px; }
.auth-tab {
  position: relative;
  border: none; background: none; padding: 2px 0;
  font-family: inherit; font-size: 15px; font-weight: 600;
  color: var(--faint); cursor: pointer;
}
.auth-tab.active { color: var(--text); }
.auth-tab.active::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -5px;
  height: 2px; border-radius: 2px; background: var(--brand);
}
.auth-body { padding: 18px; }
.auth-form[hidden] { display: none !important; }
.header-user { font-family: inherit; }

/* 底部 tab 使用 button 时的样式重置 */
button.bottom-tab { border: none; background: none; font-family: inherit; cursor: pointer; }

/* 站点设置：Tab 栏 */
.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 14px;
  padding: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.settings-tab {
  border: none;
  background: transparent;
  padding: 7px 16px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: background-color .16s, color .16s;
  white-space: nowrap;
}
.settings-tab:hover { color: var(--text); }
.settings-tab.active {
  background: var(--surface);
  color: var(--brand);
  font-weight: 600;
  box-shadow: var(--shadow-card);
}
.settings-tab-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.settings-tab-panel[hidden] { display: none !important; }

/* 编辑工具栏按钮 */
.tool { cursor: pointer; }

/* 编辑工具栏文字按钮 */
.tool--text { font-size: 12px; font-weight: 600; letter-spacing: -.02em; color: var(--muted); }
.tool--text:hover { color: var(--brand); }

/* 正文高亮 */
mark { background: #fff3b0; color: inherit; padding: 0 3px; border-radius: 3px; }
[data-theme="dark"] mark { background: #7a5b00; color: #ffe9a8; }

/* 批量操作栏 */
.bulkbar {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.bulkbar .checkbox-line { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }

/* 后台右上角用户入口 */
a.admin-user { color: inherit; text-decoration: none; border-radius: var(--r-sm); }
a.admin-user:hover .bold { color: var(--brand); }

/* 登录弹窗第三方登录分隔 */
.auth-or { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; }
.auth-or span { flex: 1; height: 1px; background: var(--line); }
.auth-or em { font-style: normal; font-size: 12px; color: var(--faint); }

/* 侧栏话题/相关推荐：标题单行省略 */
.topic-row span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topic-row em { flex: none; margin-left: 8px; }

/* 工具下载独立页 */
.tool-list { display: flex; flex-direction: column; }
.tool-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px dashed var(--line); }
.tool-row:first-child { border-top: 0; }
.tool-row__ext {
  flex: none; width: 46px; height: 46px; border-radius: 10px;
  background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
}

/* 工具下载：附件选择区 */
label.file-picker,
.file-picker {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; min-height: 132px; padding: 20px 16px;
  border: 1.5px dashed var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  text-align: center; cursor: pointer;
  transition: border-color .18s, background-color .18s;
}
.file-picker:hover,
.file-picker.is-drag {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.file-picker__icon { width: 26px; height: 26px; color: var(--brand); }
.file-picker__label { font-size: 13.5px; color: var(--text); word-break: break-all; line-height: 1.5; }
.file-picker__hint { font-style: normal; font-size: 11.5px; color: var(--faint); line-height: 1.6; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* 文件选择区：已选中态 */
.file-picker.is-selected {
  border-style: solid;
  border-color: var(--brand);
  background: var(--brand-soft);
}
.file-picker.is-selected .file-picker__label {
  color: var(--brand);
  font-weight: 600;
}
.file-picker.is-selected .file-picker__hint { color: var(--muted); }

/* 分段切换（上传 / 外链） */
.segmented {
  display: flex; gap: 4px; padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.segmented .seg {
  flex: 1; border: none; background: transparent;
  padding: 7px 10px; border-radius: 6px;
  font-family: inherit; font-size: 12.5px; color: var(--muted);
  cursor: pointer; transition: background-color .16s, color .16s;
}
.segmented .seg:hover { color: var(--text); }
.segmented .seg.active {
  background: var(--surface); color: var(--brand);
  font-weight: 600; box-shadow: var(--shadow-card);
}

/* ============ 登录弹窗（新版排版） ============ */
.auth-form--login, .auth-form--panel { display: flex; flex-direction: column; padding: 8px 6px 4px; }

.auth-hero { margin: 4px 0 20px; }
.auth-hero h3 { margin: 0 0 7px; font-size: 22px; font-weight: 700; letter-spacing: .3px; color: var(--text); }
.auth-hero p { margin: 0; font-size: 13px; color: var(--faint); }

.auth-field {
  display: flex; align-items: center; gap: 10px;
  height: 46px; padding: 0 14px; margin-bottom: 12px;
  border: 1px solid transparent; border-radius: 10px;
  background: var(--bg);
  transition: background-color .16s, border-color .16s, box-shadow .16s;
}
.auth-field .icon { color: var(--faint); transition: color .16s; }
.auth-field input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0;
  background: transparent; color: var(--text); font-family: inherit; font-size: 14px;
}
.auth-field input::placeholder { color: var(--faint); }
.auth-field:focus-within {
  background: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
.auth-field:focus-within .icon { color: var(--brand); }

.auth-row { display: flex; align-items: center; justify-content: space-between; margin: 4px 2px 18px; }
.auth-check { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; }
.auth-check input { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; margin: 0; }
.auth-link { font-size: 13px; color: var(--muted); text-decoration: none; }
.auth-link:hover { color: var(--brand); }

.auth-submit {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 46px; border: 0; border-radius: 10px;
  color: #fff; font-family: inherit; font-size: 15px; font-weight: 600; letter-spacing: .5px;
  cursor: pointer;
  background-image: linear-gradient(90deg, #2f8bfd 0%, #6a5cff 52%, #a24bff 100%);
  box-shadow: 0 10px 22px -10px rgba(94, 92, 255, .9);
  transition: filter .16s, transform .12s, box-shadow .16s;
}
.auth-submit:hover { filter: brightness(1.05); box-shadow: 0 12px 26px -10px rgba(94, 92, 255, 1); }
.auth-submit:active { transform: translateY(1px); }
.auth-submit .icon { color: #fff; }

.auth-switch { margin-top: 16px; text-align: center; font-size: 13px; color: var(--faint); }
.auth-switch a { color: var(--brand); font-weight: 500; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

.auth-dashed { position: relative; margin: 24px 0 18px; text-align: center; }
.auth-dashed::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%;
  border-top: 1px dashed var(--line);
}
.auth-dashed span {
  position: relative; padding: 0 12px; background: var(--surface);
  font-size: 12px; color: var(--faint);
}

.auth-socials { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 2px 0 6px; }
.auth-social {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  background-color: #12b7f5; color: #fff; cursor: pointer;
  box-shadow: 0 8px 16px -8px rgba(18, 183, 245, .9);
  transition: transform .12s, filter .16s;
}
.auth-social:hover { transform: translateY(-1px); filter: brightness(1.06); }
.auth-social--wechat { background-color: #07c160; box-shadow: 0 8px 16px -8px rgba(7, 193, 96, .9); }
.auth-social--github { background-color: #24292f; box-shadow: 0 8px 16px -8px rgba(36, 41, 47, .9); }
.auth-social .auth-logo { width: 22px; height: 22px; }
.auth-social .icon { width: 20px; height: 20px; color: #fff; }

.auth-field .auth-code-btn {
  flex: none; height: 30px; padding: 0 11px; border: 0; border-radius: 7px;
  background: var(--brand-soft); color: var(--brand);
  font-family: inherit; font-size: 12.5px; font-weight: 500; white-space: nowrap;
  cursor: pointer; transition: filter .16s, opacity .16s;
}
.auth-field .auth-code-btn:hover { filter: brightness(.96); }
.auth-field .auth-code-btn:disabled { opacity: .55; cursor: not-allowed; }

/* ============ 后台登录页（新版） ============ */
.alogin-body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  display: flex;
  padding: 32px 18px; box-sizing: border-box;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background:
    radial-gradient(880px 480px at 10% -10%, rgba(47, 139, 253, .12), transparent 62%),
    radial-gradient(760px 460px at 92% 108%, rgba(162, 75, 255, .12), transparent 64%),
    var(--bg);
}

.alogin { position: relative; width: 100%; max-width: 412px; margin: auto; }

.alogin__glow {
  position: absolute; border-radius: 50%; filter: blur(48px); opacity: .5; pointer-events: none;
}
.alogin__glow--a { width: 180px; height: 180px; left: -58px; top: -34px; background: rgba(47, 139, 253, .38); }
.alogin__glow--b { width: 190px; height: 190px; right: -64px; bottom: -46px; background: rgba(162, 75, 255, .34); }

.alogin__card {
  position: relative;
  background: var(--surface);
  border-radius: 18px;
  padding: 28px 26px 20px;
  box-shadow: 0 26px 60px -30px rgba(31, 45, 90, .42), 0 0 0 1px var(--line);
}

.alogin__brand { display: flex; align-items: center; gap: 9px; margin-bottom: 22px; }
.alogin__logo {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; font-weight: 700;
  background-image: linear-gradient(135deg, #2f8bfd, #a24bff);
}
.alogin__site { font-size: 14px; font-weight: 600; color: var(--text); letter-spacing: .2px; }
.alogin__badge {
  margin-left: auto; padding: 2px 8px; border-radius: var(--r-pill);
  font-size: 11px; color: var(--brand); background: var(--brand-soft); border: 1px solid var(--brand-line);
}

.alogin__title { margin: 0 0 8px; font-size: 26px; font-weight: 700; letter-spacing: .5px; color: var(--text); }
.alogin__sub { margin: 0 0 20px; font-size: 13px; color: var(--faint); }

.alogin__error {
  display: flex; align-items: flex-start; gap: 7px;
  margin-bottom: 16px; padding: 10px 12px; border-radius: 10px;
  background: rgba(232, 86, 0, .08); color: var(--danger);
  font-size: 13px; line-height: 1.55;
}
.alogin__error .icon { margin-top: 2px; }

.alogin__form { display: flex; flex-direction: column; }

.alogin__eye {
  flex: none; width: 28px; height: 28px; margin-right: -6px;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 7px; background: transparent;
  color: var(--faint); cursor: pointer; transition: color .16s, background-color .16s;
}
.alogin__eye:hover { color: var(--brand); background: var(--surface); }
.alogin__eye.is-on { color: var(--brand); }

.alogin__dashed { margin: 22px 0 4px; }
.alogin__hint { margin: 0; text-align: center; font-size: 12px; line-height: 1.7; color: var(--faint); }
.alogin__hint a { color: var(--brand); text-decoration: none; }
.alogin__hint a:hover { text-decoration: underline; }

.alogin__foot {
  margin-top: 18px; padding-top: 14px;
  border-top: 1px solid var(--line);
  text-align: center; font-size: 12px; color: var(--faint);
}

/* 移动端：卡片铺满、输入框 16px 防 iOS 聚焦缩放、去掉光斑避免横向溢出 */
@media (max-width: 480px) {
  .alogin-body { padding: 20px 14px calc(20px + env(safe-area-inset-bottom)); }
  .alogin__glow { display: none; }
  .alogin__card { padding: 22px 16px 16px; border-radius: 16px; }
  .alogin__brand { margin-bottom: 18px; }
  .alogin__title { font-size: 22px; }
  .alogin__sub { margin-bottom: 16px; }
  .auth-field { height: 48px; }
  .auth-field input { font-size: 16px; }
  .auth-row { margin-bottom: 16px; }
  .auth-submit { height: 48px; font-size: 15px; }
}

/* ============ 个人中心顶部卡片 ============ */
.me-hero { padding: 22px 24px; }
.me-hero__top { display: flex; align-items: flex-start; gap: 18px; }
.me-hero__avatar { width: 62px; height: 62px; font-size: 22px; }
.me-hero__info { flex: 1; min-width: 0; }
.me-hero__name { margin: 2px 0 0; font-size: 20px; font-weight: 700; color: var(--text); }
.me-hero__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-top: 7px; font-size: 12.5px; color: var(--faint);
}
.me-hero__email { word-break: break-all; }
.me-hero__sep { opacity: .55; }
.me-hero__bio {
  margin: 12px 0 0; font-size: 13.5px; line-height: 1.75;
  color: var(--muted); word-break: break-word;
}
.me-hero__actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line);
}
.me-hero__btn { justify-content: center; }
.me-hero__tag { align-self: center; }
@media (min-width: 621px) {
  .me-hero__logout { margin-left: auto; }
}

@media (max-width: 620px) {
  .me-hero { padding: 18px 16px; }
  .me-hero__top { gap: 12px; }
  .me-hero__avatar { width: 50px; height: 50px; font-size: 18px; }
  .me-hero__name { font-size: 17px; }
  .me-hero__meta { margin-top: 6px; font-size: 12px; }
  .me-hero__bio { margin-top: 10px; font-size: 13px; line-height: 1.7; }
  .me-hero__actions { gap: 8px; margin-top: 16px; padding-top: 14px; }
  .me-hero__actions .me-hero__btn {
    flex: 1 1 0; min-width: 0; padding-left: 6px; padding-right: 6px;
  }
}
/* 悬浮按钮：进入后台（登录且有后台权限时显示） */
.fab__admin { color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand-line), var(--shadow-card); }
.fab__admin:hover { color: #fff; background-image: linear-gradient(135deg, #2f8bfd 0%, #a24bff 100%); box-shadow: 0 8px 18px -8px rgba(80, 60, 255, .85); }
/* ============ 发布框 emoji 面板 ============ */
.editor-box { position: relative; }

.emoji-pop {
  position: absolute;
  left: 12px;
  top: calc(100% + 6px);
  z-index: 30;
  width: min(330px, calc(100vw - 60px));
  max-height: 216px;
  overflow-y: auto;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(30px, 1fr));
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-pop);
}
.emoji-pop[hidden] { display: none; }

.emoji-pop__item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.emoji-pop__item:hover { background: var(--surface-2); }

@media (max-width: 620px) {
  .emoji-pop {
    left: 8px;
    right: 8px;
    width: auto;
    max-height: 190px;
    grid-template-columns: repeat(auto-fill, minmax(32px, 1fr));
  }
}
/* 正文里的话题标签：和 emoji、文字在同一行混排 */
.chip--inline {
  height: 20px;
  padding: 0 8px;
  margin: 0 2px;
  font-size: 12px;
  line-height: 1;
  vertical-align: middle;
  text-decoration: none;
}
/* 目录锚点：滚到标题时避开吸顶导航 */
.prose h1, .prose h2, .prose h3, .prose h4 { scroll-margin-top: calc(var(--header-h) + 8px); }
/* 正文卡片：常驻遮罩，滚动后让卡片上沿保持圆角（无需 JS） */
.prose-cap {
  position: sticky;
  top: 0;
  z-index: 6;
  display: block;
  height: calc(var(--header-h) + 8px);
  /* 负上边距把它放到卡片顶部之上：页面未滚动时不遮内容，滚动后正好贴住导航下方 */
  margin-top: calc(-1 * (var(--header-h) + 8px));
  /* 它是 .main-col 的第一个 flex 子项，减掉一个 gap 才不会把下面的卡片顶下去 */
  margin-bottom: -14px;
  /* 左右各多盖 14px，把卡片投影（卡片边缘外侧那条竖线）一起盖住 */
  margin-left: -14px;
  margin-right: -14px;
  background: var(--bg);
  pointer-events: none;
}

/* 上沿圆角：遮罩下缘两侧补四分之一圆，让卡片顶角向上弯 */
.prose-cap::before,
.prose-cap::after {
  content: '';
  position: absolute;
  top: 100%;
  width: var(--r-md);
  height: var(--r-md);
}
.prose-cap::before {
  left: 14px;
  background: radial-gradient(circle at 100% 100%, transparent calc(var(--r-md) - .5px), var(--bg) var(--r-md));
}
.prose-cap::after {
  right: 14px;
  background: radial-gradient(circle at 0 100%, transparent calc(var(--r-md) - .5px), var(--bg) var(--r-md));
}
/* ============ 程序更新 ============ */
.alert-warn { background: #fff6e5; color: #a66a00; }
.update-steps { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.update-step {
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
}
.update-changelog { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: var(--text-2); }
.update-changelog li { margin: 3px 0; list-style: disc; }

/* ===== nbblog 补充：账号 / 评论 / 个人中心（沿用默认主题结构）===== */


/* ==========================================================================
   账号页 / 评论 / 个人中心（M1 收尾）
   ========================================================================== */

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }

/* 登录注册 */
.auth-body { background: var(--bg-soft); }
.auth-wrap {
    max-width: 420px;
    margin: 0 auto;
    padding: 8vh 20px 40px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.auth-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    color: var(--text);
    font-size: 18px;
}
.auth-brand:hover { text-decoration: none; }
.auth-card { padding: 28px; }
.auth-title { font-size: 22px; margin-bottom: 4px; }
.auth-tip { font-size: 13px; margin: 0 0 20px; }
.auth-switch { margin: 16px 0 0; font-size: 13px; text-align: center; }
.auth-foot { text-align: center; font-size: 13px; }
.validation-ok { color: var(--ok); font-size: 12px; }

/* 评论 */
.comments { margin-top: 18px; }
.comments-title { font-size: 16px; margin-bottom: 16px; }
.comments-empty { font-size: 14px; }
.comment-list, .comment-replies { list-style: none; margin: 0; padding: 0; }
.comment { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px dashed var(--border); }
.comment:last-child { border-bottom: 0; }
.comment-avatar {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--bg-soft);
    color: var(--accent);
    font-weight: 600;
    overflow: hidden;
}
.comment-avatar.is-sm { flex-basis: 30px; width: 30px; height: 30px; border-radius: 10px; font-size: 12px; }
.comment-avatar img { width: 100%; height: 100%; object-fit: cover; }
.comment-main { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.comment-name { color: var(--text); font-weight: 600; }
.comment-head time { font-size: 12px; }
.comment-body { font-size: 14px; margin: 6px 0 4px; word-break: break-word; }
.comment-actions { font-size: 13px; }
.comment-replies { margin-top: 8px; padding-left: 10px; border-left: 2px solid var(--border); }

.link-btn {
    border: 0;
    background: none;
    color: var(--accent);
    font-size: 13px;
    padding: 0;
    cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }

.comment-form { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.comment-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
.comment-submit { display: flex; align-items: center; gap: 12px; }
.comment-submit .muted { font-size: 12px; }
.comment-as { font-size: 13px; margin-bottom: 12px; }
.reply-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--muted);
    background: var(--bg-soft);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 12px;
}

/* 个人中心 */
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 18px; }
.my-comments { list-style: none; margin: 0; padding: 0; }
.my-comments li { padding: 12px 0; border-bottom: 1px dashed var(--border); }
.my-comments li:last-child { border-bottom: 0; }
.my-comments__head { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.my-comments__head .muted { font-size: 12px; }
.my-comments__body { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

@media (max-width: 760px) {
    .grid-2, .grid-3, .comment-fields { grid-template-columns: 1fr; }
}


/* ==========================================================================
   nbblog 主题 Pjax · 补充（PJAX 加载态 / 移动端底部导航 / 两列 / 分页 / 评论）
   ========================================================================== */

#pjax-container { transition: opacity .16s ease; }
html.is-pjax-loading #pjax-container { opacity: .55; }

.layout--no-right { grid-template-columns: 196px minmax(0, 1fr); }

/* 分页：旧站用 .pager a，这里补齐 span 状态 */
.pager span,
.pager .active,
.pager .is-disabled,
.pager .pager-gap {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
    box-shadow: var(--shadow-card);
}
.pager .active { background: var(--brand); color: #fff; box-shadow: var(--shadow-brand); }
.pager .is-disabled { opacity: .45; }
.pager .pager-gap { box-shadow: none; background: none; color: var(--faint); }

/* 卡片内评论区 */
.note-card .comments { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 16px; }
.note-card .comments-title { font-size: 15px; }

/* 筛选栏数量 */
.tab .count { margin-left: 4px; font-size: 11.5px; color: var(--faint); }
.tab.active .count { color: rgba(255, 255, 255, .8); }

@media (max-width: 1080px) {
    .layout { grid-template-columns: 196px minmax(0, 1fr); }
    .layout > .side--right { display: none; }
}

@media (max-width: 820px) {
    .layout,
    .layout--no-right { grid-template-columns: minmax(0, 1fr); padding: 8px 12px 32px; }
    .layout > .side--left { display: none; }
    .bottom-tabs { display: flex; }
    body { padding-bottom: 58px; }
}
/* 防止移动端横向溢出 */
/* 用 clip 而不是 hidden：hidden 会让 html 变成滚动容器，导致侧栏 sticky 失效 */
html { overflow-x: clip; }
body { max-width: 100%; overflow-x: clip; }
.main-col, .note-card, .prose, .note-body { min-width: 0; }
.note-head__name, .note-head__sub, .article-card__title, .article-card__desc { overflow-wrap: anywhere; }
/* 移动端：头部搜索保持圆形图标，点击展开（与旧站一致） */
@media (max-width: 820px) {
  /* 顶栏自己裁剪，谁都不许把页面撑宽 */
  .site-header { overflow: hidden; }
  .site-header__inner { gap: 8px; min-width: 0; }
  .site-header__inner > .logo { flex: 0 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; }
  .header-actions { flex: 0 1 auto; min-width: 0; gap: 6px; }

  .search { flex: 0 1 auto; min-width: 0; }

  /* 右侧图标不许被搜索框挤没 */
  .header-user,
  .icon-btn,
  .search__btn { flex: 0 0 auto; }

  /* 展开宽度按可用空间收，避免把 logo 和右侧按钮挤出屏幕 */
  .search.is-open { width: min(44vw, 172px); }
  .search.is-open input { padding: 0 38px 0 12px; }
}

/* 移动端宽度兜底：任何元素都不允许超出视口 */
@media (max-width: 820px) {
  .layout, .layout--no-right { grid-template-columns: minmax(0, 1fr); width: 100%; max-width: 100vw; box-sizing: border-box; }
  .main-col, .tabbar, .note-card, .article-card, .site-header, .site-footer { max-width: 100%; box-sizing: border-box; }
  .note-card { overflow: hidden; }
  .article-card__cover { flex: 0 0 96px; height: 76px; }
}
/* 移动端改为块级布局，彻底避免网格溢出 */
@media (max-width: 820px) {
  .layout, .layout--no-right { display: block; padding: 8px 12px 32px; }
  .layout > .side { display: none; }
  .main-col { display: flex; flex-direction: column; gap: 12px; }
}
/* ------------------------------------------------------------------
   nbblog additions: editor toolbar, like button, card edit shortcut
   ------------------------------------------------------------------ */
.note-editor__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.note-editor__tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tool-btn {
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
.tool-btn:hover { color: var(--brand); border-color: var(--brand); }

.note-stat.is-active,
.note-stat.is-active .icon { color: var(--brand); }
.note-stat.is-active { font-weight: 600; }

.note-more {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--faint);
  flex: 0 0 auto;
}
.note-more:hover { background: var(--surface-2); color: var(--brand); }
/* ------------------------------------------------------------------
   弹窗报错提示（旧站没有这个元素，仅本项目使用）
   其余的 .modal / .auth-* 样式直接沿用上面移植自旧站的规则
   ------------------------------------------------------------------ */
.auth-error {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  background: rgba(220, 38, 38, .1);
  color: #dc2626;
  font-size: 13px;
}
.auth-submit:disabled { opacity: .6; cursor: default; }
/* ------------------------------------------------------------------
   nbblog additions: drag sorting handles
   ------------------------------------------------------------------ */
.is-dragging { opacity: .45; }

.nav-drag {
  margin-left: 6px;
  color: var(--faint);
  font-size: 12px;
  line-height: 1;
  cursor: grab;
  opacity: 0;
  transition: opacity .15s;
}
.nav-item:hover .nav-drag { opacity: .85; }

.rail-stack { display: flex; flex-direction: column; gap: 14px; }
.rail-block { position: relative; }
.rail-drag {
  position: absolute;
  left: -16px;
  top: 12px;
  color: var(--faint);
  font-size: 12px;
  line-height: 1;
  cursor: grab;
  opacity: 0;
  transition: opacity .15s;
}
.rail-block:hover .rail-drag { opacity: .85; }
/* ------------------------------------------------------------------
   nbblog additions: me page
   ------------------------------------------------------------------ */
.me-title { font-size: 15px; margin: 0 0 16px; }
.me-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.me-grid--3 { grid-template-columns: repeat(3, 1fr); }
.me-field { display: block; margin-bottom: 12px; }
.me-label { display: block; font-size: 12px; color: var(--faint); margin-bottom: 5px; }
.me-input {
  width: 100%;
  box-sizing: border-box;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
.me-input:focus { border-color: var(--brand); background: var(--surface); }
.me-actions { display: flex; align-items: center; gap: 12px; margin-top: 4px; }

.me-comments { list-style: none; margin: 0; padding: 0; }
.me-comments li { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.me-comments li:last-child { border-bottom: 0; }
.me-comments__head { display: flex; align-items: center; gap: 10px; font-size: 14px; flex-wrap: wrap; }
.me-comments__body { margin: 4px 0 0; font-size: 13px; color: var(--muted); }

@media (max-width: 820px) {
  .me-grid, .me-grid--3 { grid-template-columns: 1fr; }
}
/* ------------------------------------------------------------------
   nbblog additions: emoji picker
   ------------------------------------------------------------------ */
.emoji-pop {
  position: absolute;
  top: 34px;
  left: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: min(324px, calc(100vw - 32px));
  max-height: min(320px, 62vh);
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-hover);
}
.emoji-pop[hidden] { display: none; }

.emoji-tabs {
  flex: 0 0 auto;
  display: flex;
  gap: 2px;
  padding-bottom: 6px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.emoji-tabs::-webkit-scrollbar { display: none; }
.emoji-tab {
  flex: 0 0 auto;
  border: 0;
  background: none;
  padding: 3px 9px;
  font-size: 12px;
  font-family: inherit;
  color: var(--faint);
  border-radius: 6px;
  cursor: pointer;
}
.emoji-tab:hover { color: var(--brand); }
.emoji-tab.is-active { background: var(--brand-soft); color: var(--brand); }

.emoji-grid {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  overflow-y: auto;
  min-height: 0;
  padding-right: 2px;
}
.emoji-grid::-webkit-scrollbar { width: 6px; }
.emoji-grid::-webkit-scrollbar-thumb {
  background: var(--line-2, rgba(0, 0, 0, .15));
  border-radius: 3px;
}

.emoji-item {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: none;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  border-radius: 7px;
  cursor: pointer;
  font-family: inherit;
}
.emoji-item:hover { background: var(--surface-2); }
.emoji-item:active { transform: scale(.94); }

/* 颜文字：单列、整行可读、不截断 */
.emoji-grid--text {
  grid-template-columns: 1fr;
  gap: 1px;
}
.emoji-grid--text .emoji-item {
  height: auto;
  justify-content: flex-start;
  padding: 6px 8px;
  font-size: 12.5px;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* 笔记正文里的表情 / 图片排版 */
.note-body { line-height: 1.8; word-break: break-word; }
.note-body p { margin: 0 0 .55em; }
.note-body p:last-child { margin-bottom: 0; }
.note-body img { max-width: 100%; border-radius: 8px; display: block; margin: 8px 0; }

[data-editor-status] { margin-left: 4px; }
.note-stat[data-favorite].is-active { color: #f5a524; }
/* 右栏统计卡：保持一行三列 */
.side--right .side-stats {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.side--right .stat-cell { flex: 1; min-width: 0; }
/* 拖拽手柄放卡片内部（侧栏外翻会被页面横向裁切） */
.rail-drag { left: auto; right: 8px; top: 10px; z-index: 2; }
/* ------------------------------------------------------------------
   右栏：文章目录模块
   ------------------------------------------------------------------ */
.rail-toc { list-style: none; margin: 0; padding: 0; }
.rail-toc li { padding: 4px 0; font-size: 13px; line-height: 1.5; }
.rail-toc li a { color: var(--text-2); }
.rail-toc li a:hover { color: var(--brand); }
.rail-toc__l3 { padding-left: 12px; font-size: 12.5px; }
.rail-toc__l4 { padding-left: 24px; font-size: 12.5px; }
/* 未滚动时不显示遮罩补角，避免卡片顶部出现多余弧线；滚动后才出现 */
.prose-cap::before,
.prose-cap::after {
  opacity: 0;
  transition: opacity .14s ease;
}
body.is-scrolled .prose-cap::before,
body.is-scrolled .prose-cap::after { opacity: 1; }
/* 所有带 id 的标题：原生锚点跳转也预留顶栏高度 */
.prose [id], .note-body [id] {
  scroll-margin-top: calc(var(--header-h) + 16px);
}
/* 导航卡片小标题 */
.nav-card__label {
  padding: 6px 12px 4px;
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--faint);
  text-transform: uppercase;
}

/* 拖拽中的占位观感：留出虚线框，减少"错位"感 */
.nav-item.is-dragging,
.rail-block.is-dragging {
  opacity: .5;
  outline: 1px dashed var(--brand);
  outline-offset: -1px;
  border-radius: var(--r-sm);
}
/* ------------------------------------------------------------------
   卡片右上角「更多」菜单（编辑 / 删除）
   ------------------------------------------------------------------ */
.note-menu { position: relative; flex: 0 0 auto; }
.note-menu__pop {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 96px;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-hover);
  z-index: 30;
}
.note-menu__pop[hidden] { display: none; }
.note-menu__item {
  display: block;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--text-2);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.note-menu__item:hover { background: var(--surface-2); color: var(--text); }
.note-menu__item.is-danger { color: #e5484d; }
.note-menu__item.is-danger:hover { background: rgba(229, 72, 77, .1); }
/* 卡片右上角「⋯」：略微上移，与作者名首行对齐 */
.note-head .note-menu { margin-top: -4px; }
.note-head .note-more { padding: 0; }
/* 笔记卡片底部：左评论/点赞/收藏，右相对时间 */
.note-foot--mini {
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}
.note-foot--mini .note-stats { margin-left: 0; }
.note-ago {
  font-size: 12px;
  color: var(--faint);
  white-space: nowrap;
}
/* 笔记卡片：Markdown 渲染后的正文，文本截断但图片完整显示 */
.note-body__excerpt {
  max-height: 460px;
  overflow: hidden;
  position: relative;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-2);
}
.note-body__excerpt p,
.note-body__excerpt li {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.note-body__excerpt p { margin: 0 0 .35em; }
.note-body__excerpt p:last-child { margin-bottom: 0; }
.note-body__excerpt h1,
.note-body__excerpt h2,
.note-body__excerpt h3,
.note-body__excerpt h4 {
  font-size: 14.5px;
  font-weight: 600;
  margin: 0 0 .35em;
  line-height: 1.6;
  color: var(--text);
}
.note-body__excerpt ul,
.note-body__excerpt ol { margin: 0 0 .35em; padding-left: 18px; }
.note-body__excerpt img {
  max-height: 340px;
  max-width: 100%;
  width: auto;
  height: auto;
  border-radius: 10px;
  margin: 6px 0;
  display: block;
}
.note-body__excerpt blockquote {
  margin: 0 0 .35em;
  padding-left: 10px;
  border-left: 2px solid var(--line-2);
  color: var(--faint);
}
.note-body__excerpt code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-2);
  font-size: 12.5px;
}
.note-body__excerpt pre {
  margin: 0 0 .35em;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  overflow: hidden;
}
.note-body__excerpt a { color: var(--brand); }
/* 归档页：笔记条目不可点击 */
.archive-item--static { cursor: default; }
.archive-item--static:hover { color: inherit; }

/* ------------------------------------------------------------------
   站内对话框（替代浏览器原生 alert / confirm）
   ------------------------------------------------------------------ */
.nb-dialog {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  padding: 20px;
}
.nb-dialog__mask {
  position: absolute;
  inset: 0;
  background: rgba(20, 26, 38, .42);
  animation: nb-fade .12s ease;
}
.nb-dialog__body {
  position: relative;
  width: 100%;
  max-width: 380px;
  padding: 22px;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-hover);
  animation: nb-dialog-pop .14s ease;
}
.nb-dialog__title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.nb-dialog__text {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
  white-space: pre-line;
  word-break: break-word;
}
.nb-dialog__foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
@keyframes nb-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes nb-dialog-pop { from { transform: translateY(6px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
/* ------------------------------------------------------------------
   卡片话题标签
   ------------------------------------------------------------------ */
.note-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.topic-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12.5px;
  line-height: 1.7;
  white-space: nowrap;
  transition: background-color .16s, color .16s;
}
.topic-chip:hover {
  background: var(--brand);
  color: #fff;
}
/* 正文里行内话题：#话题 */
.chip--inline {
  display: inline;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: .94em;
  line-height: 1.7;
  white-space: nowrap;
  text-decoration: none;
}
.chip--inline:hover { background: var(--brand); color: #fff; }
/* 移动端兜底：卡片与顶栏不许超出视口宽度 */
@media (max-width: 820px) {
  .card, .site-header, .site-header__inner, .header-actions { max-width: 100%; box-sizing: border-box; }
  .card { min-width: 0; }
}
/* 左栏拖拽：不显示 ⠿ 手柄，整行可拖（超管） */
.nav-item[draggable="true"] { cursor: grab; }
.nav-item[draggable="true"]:active { cursor: grabbing; }
.nav-item.is-dragging { cursor: grabbing; }
.nav-drag { display: none !important; }

/* ------------------------------------------------------------------
   发布笔记框（复刻 pjax.cn：.editor-box）
   ------------------------------------------------------------------ */
.editor-box {
  position: relative;
  padding: 16px 18px;
}
.editor-box.is-editing {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.editor-box__notice {
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--faint);
}
.editor-box__notice a { color: var(--brand); margin-left: 6px; }

.editor-box__input {
  width: 100%;
  min-height: 56px;
  border: none;
  outline: none;
  resize: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.7;
}
.editor-box__input::placeholder { color: var(--faint); }

.editor-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  margin-top: 4px;
  gap: 10px;
}
.editor-tools {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}
.editor-tools .tool {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--faint);
  cursor: pointer;
  transition: background-color .16s, color .16s;
}
.editor-tools .tool:hover { background: var(--surface-2); color: var(--brand); }
.editor-tools .tool .icon { width: 17px; height: 17px; }
.editor-submit {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 16px;
}


/* ---------------------------------------------------------------- 个人中心：头像上传 */
.me-avatar { display: flex; align-items: flex-start; gap: 12px; }
.me-avatar__preview {
  width: 56px; height: 56px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; overflow: hidden;
  background: var(--surface-2, #f3f6fc);
  border: 1px solid var(--line, #eef1f7);
  color: var(--muted, #8b93a4);
  font-size: 20px; font-weight: 600;
}
.me-avatar__preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.me-avatar__empty { font-size: 20px; font-weight: 600; }
.me-avatar__body { flex: 1; min-width: 0; }
.me-avatar__actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.me-avatar__tip { font-size: 12px; line-height: 1.7; }
.me-avatar__tip[hidden] { display: none; }

/* ---------------------------------------------------------------- 个人中心：第三方账号绑定 */
.me-bind { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.me-bind__item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line, #eef1f7); border-radius: 10px;
  transition: border-color .16s, background-color .16s;
}
.me-bind__item:hover { border-color: var(--brand-line, #dbe3ff); background: var(--surface-2, #f7f9fc); }
.me-bind__item form { margin: 0; }
.me-bind__icon {
  width: 34px; height: 34px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px;
  background: var(--surface-2, #f3f6fc);
}
.me-bind__icon svg { width: 18px; height: 18px; flex: 0 0 auto; }
.me-bind__icon--qq { color: #12b7f5; background: rgba(18, 183, 245, .1); }
.me-bind__icon--wechat { color: #07c160; background: rgba(7, 193, 96, .1); }
.me-bind__icon--github { color: #24292f; background: rgba(36, 41, 47, .08); }
.me-bind__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.me-bind__body strong { font-size: 13.5px; font-weight: 600; }

/* 头部登录态占位（PJAX 时整体替换，display:contents 不影响布局） */
.header-user-slot { display: contents; }


/* ---------------------------------------------------------------- 评论：表情面板 + 验证 */
.comment-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.comment-tool {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color .16s, color .16s, background-color .16s;
}

.comment-tool:hover {
  border-color: var(--brand-line);
  color: var(--brand);
}

.comment-tool[aria-expanded="true"] {
  border-color: var(--brand-line);
  background: var(--brand-soft);
  color: var(--brand);
}

.emoji-panel {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  max-height: 214px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.emoji-panel[hidden] { display: none; }

.emoji-panel__group { margin-bottom: 10px; }
.emoji-panel__group:last-child { margin-bottom: 0; }

.emoji-panel__title {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  color: var(--faint);
}

.emoji-panel__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.emoji-item {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background-color .14s, transform .14s;
}

.emoji-item:hover {
  background: var(--surface-2);
  transform: scale(1.14);
}

.comment-captcha {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.comment-captcha .input {
  max-width: 110px;
  text-align: center;
  letter-spacing: .08em;
}