/* ================================================================
   细节层 · 在 main.css 之后加载，只做「提升质感」的叠加，不改结构
   ================================================================ */

/* ---------- 底色与选取 ---------- */
::selection { background: var(--accent); color: #fff; }
html { scrollbar-color: var(--rule2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--rule2); border: 3px solid var(--paper); border-radius: 10px; }
:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 3px; }

/* ---------- 排版细节：中文标点挤压、旧式数字、避免孤行 ---------- */
body { font-feature-settings: "palt" 1, "kern" 1; text-rendering: optimizeLegibility; }
.d, .stat, .foot-meta, .meta span, .meta b, .toc a { font-variant-numeric: oldstyle-nums tabular-nums; }
.home-head h1, .page-head h1, .head h1, article h2 { text-wrap: balance; }
article p { text-wrap: pretty; }
.mono, code, pre, kbd { font-feature-settings: "liga" 0; }

/* ---------- 深色（跟随系统 / 手动切换） ---------- */
html[data-theme="dark"] {
  --paper: #0F1113;
  --surf: #15181B;
  --ink: #E9E7E2;
  --sub: #B7B4AD;
  --faint: #7E7B75;
  --rule: #272B2F;
  --rule2: #1D2124;
  --accent: #F2733D;
  --code: #08090B;
  color-scheme: dark;
}
html[data-theme="dark"] img { filter: brightness(.92) contrast(1.02); }
html[data-theme="dark"] .preview { box-shadow: 0 20px 48px rgba(0, 0, 0, .65); }
html[data-theme="dark"] { --note: #16191C; --body: #D6D3CC; --codebg: #1B1F23; --hair: #23272B; --hover: #191C1F; }
html[data-theme="dark"] article { color: #DCD9D2; }
html[data-theme="dark"] article blockquote { color: #D3D0C9; background: #15181B; }
html[data-theme="dark"] article code { color: #E8C9A0; }
html[data-theme="dark"] article blockquote b { color: #D8786B; }
html[data-theme="dark"] article code { background: #1B1F23; color: #E8C9A0; }
html[data-theme="dark"] article hr { border-top-color: #24282C; }
html[data-theme="dark"] article th, html[data-theme="dark"] article td { border-bottom-color: #22262A; }

.theme-toggle {
  border: 0; background: none; padding: 0 0 0 4px; margin-left: 2px;
  font: inherit; color: var(--faint); cursor: pointer; line-height: 1;
  transition: color .2s ease;
}
.theme-toggle:hover { color: var(--ink); }

/* ---------- 双栏索引 ---------- */
.year-set { margin-bottom: 8px; }
.year-bar {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 40px 0 10px; border-bottom: 1px solid var(--ink);
}
.year-bar span { font: 12.5px/1 var(--sans); letter-spacing: .04em; color: var(--faint); font-variant-numeric: tabular-nums; }

ol.posts.two {
  display: grid; grid-template-columns: 1fr 1fr;
  column-gap: 64px; margin: 0; padding: 0; list-style: none;
}
ol.posts.two li { margin: 0; }
ol.posts.two a {
  display: grid; grid-template-columns: 58px minmax(0, 1fr);
  gap: 18px; align-items: baseline;
  padding: 13px 10px 13px 0; margin: 0;
  border-bottom: 1px solid var(--rule2);
  transition: background .16s ease, color .16s ease, padding .22s cubic-bezier(.2,.7,.2,1);
}
ol.posts.two a .d {
  font: 13px/1 var(--sans); letter-spacing: .02em; color: var(--faint);
  font-variant-numeric: tabular-nums;
}
ol.posts.two a .t { font-size: 17.5px; line-height: 1.55; }
ol.posts.two a:hover { background: var(--ink); color: var(--paper); padding-left: 12px; }
ol.posts.two a:hover .d { color: var(--paper); opacity: .55; }
ol.posts.two a.kb { background: var(--ink); color: var(--paper); padding-left: 12px; }
ol.posts.two a.kb .d { color: var(--paper); opacity: .55; }

@media (max-width: 900px) {
  ol.posts.two { grid-template-columns: 1fr; column-gap: 0; }
  .year-bar { padding-top: 32px; }
}
@media (max-width: 400px) {
  ol.posts.two a { grid-template-columns: 46px minmax(0, 1fr); gap: 12px; }
  ol.posts.two a .t { font-size: 16.5px; }
}

/* ---------- 文章正文：首段提要 + 首字下沉 ---------- */
article > p.is-lede { font-size: 17.5px; line-height: 1.92; color: var(--ink); }
.layout.alone { grid-template-columns: minmax(0, 1fr); }
.layout.alone { max-width: none; }
.layout.alone article { max-width: none; margin: 0; }
/* 正文列随屏幕伸缩：小屏贴边留白，大屏放开到 78vw / 62ch，字号同步微调 */
article { max-width: min(100%, 54em); }
article p, article li { font-size: clamp(16.5px, 1.18vw, 19.5px); line-height: 1.92; }
article figure.img { margin: 36px 0 40px; }
article figure.img figcaption { margin-top: 9px; font-size: 12.5px; color: var(--faint); letter-spacing: .01em; }
article table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
article th, article td { border-bottom: 1px solid var(--rule2); padding: 9px 14px 9px 0; text-align: left; vertical-align: top; }
article th { font-weight: 600; }

/* ---------- 键位提示 ---------- */
kbd {
  font: 12px/1 var(--mono); color: var(--sub);
  border: 1px solid var(--rule2); border-bottom-width: 2px; border-radius: 3px;
  padding: 2px 5px; margin: 0 2px;
}

/* ---------- 页面切换的过渡（Chrome 126+ 生效，其余忽略） ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .2s ease both; }
::view-transition-new(root) { animation: vt-in .3s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-3px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(7px); } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  ol.posts a, .preview { transition: none; }
}

/* ---------- 键盘选中态 ---------- */
ol.posts a.kb { background: var(--ink); color: var(--paper); padding-left: 20px; }
ol.posts a.kb .ph { border-color: var(--paper); }
ol.posts a.kb .d { color: var(--paper); opacity: .55; }


/* ---------- 字阶对比：报头、导航、年份 ---------- */
.home-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 28px;
  padding: 6px 0 26px; border-bottom: 1px solid var(--ink);
}
.home-head h1 {
  margin: 0; max-width: 15em;
  font-size: clamp(40px, 7.4vw, 104px); line-height: 1.06; letter-spacing: -.032em;
  text-wrap: balance;
}
.home-head .stat {
  padding-bottom: 12px; white-space: nowrap;
  font: 13px/1 var(--sans); letter-spacing: .04em; color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.year-bar b {
  font: 500 44px/1 var(--serif); letter-spacing: -.015em;
  color: var(--accent); font-variant-numeric: oldstyle-nums;
}


.bar .mark { font-size: 18px; letter-spacing: -.01em; }
nav.links { gap: 26px; }
nav.links a {
  position: relative; font: 13px/1 var(--sans); letter-spacing: .04em; color: var(--faint);
  transition: color .2s ease;
}
nav.links a:hover, nav.links a.on { color: var(--ink); }
nav.links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -7px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform .26s cubic-bezier(.2,.7,.2,1);
}
nav.links a:hover::after { transform: scaleX(1); }
nav.links a.on::after { transform: scaleX(1); background: var(--accent); }

/* ---------- 文章页：报头与正文的节奏 ---------- */
.post-head h1, .head h1 {
  letter-spacing: -.024em; line-height: 1.2;
  font-size: clamp(30px, 3.7vw, 54px); max-width: 22em; text-wrap: balance;
  margin: 14px 0 0;
}
.head .meta { margin-bottom: 0; }
.post-head .meta, .head .meta {
  font: 13px/1.7 var(--sans); letter-spacing: .02em; color: var(--sub);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 680px) {
  .home-head { flex-direction: column; align-items: flex-start; gap: 10px; padding-bottom: 20px; }
  .home-head .stat { padding-bottom: 0; }
}


/* ---------- 窄屏防溢出：grid 子项默认 min-width:auto 会被长代码/表格撑破 ---------- */
.layout { min-width: 0; }
.layout.alone article, article { min-width: 0; }
article > *, article p, article li, article blockquote, article td, article th { min-width: 0; }
article pre, article figure.highlight, article .highlight, article table {
  max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
article a { overflow-wrap: anywhere; }
article img { max-width: 100%; height: auto; }

/* 标题与信息行之间留出呼吸 */
.head h1 + .meta { margin-top: 14px; }


/* ---------- 纸面质感：极细噪点 + 微暗角，深色下把画面压住 ---------- */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: .05; mix-blend-mode: screen;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
  background-size: 160px 160px;
}
html[data-theme="light"] body::before { opacity: .035; mix-blend-mode: multiply; }
body::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(120% 80% at 50% 0%, transparent 55%, rgba(0,0,0,.28) 100%);
}
html[data-theme="light"] body::after { background: radial-gradient(120% 80% at 50% 0%, transparent 60%, rgba(0,0,0,.05) 100%); }
header.bar { position: relative; z-index: 40; }
.wrap { position: relative; z-index: 1; }

/* 标题悬停：下划线自左展开 */
ol.posts.two a .t { position: relative; transition: color .16s ease; }
ol.posts.two a:hover .t { color: var(--paper); }
article h2 { font-size: 26px; letter-spacing: -.018em; margin: 2.2em 0 .7em; }
article h3 { font-size: 19px; letter-spacing: -.01em; color: var(--ink); }

@media (max-width: 680px) {
  header.bar { position: relative; }
  .theme-toggle { position: absolute; top: 24px; right: 16px; font-size: 15px; }
  .home-head { padding: 26px 0 16px; }
  .home-head h1 { font-size: clamp(44px, 15vw, 64px); line-height: 1.1; letter-spacing: -.026em; }
}

/* ---------- 分类页：大类带子类，做成层级而非两块并列 ---------- */
.cat-tree {
  list-style: none; margin: 0; padding: 8px 0 120px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 72px;
}
.cat-tree > li { border-bottom: 1px solid var(--rule); }
.cat-tree .root {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 20px 0 2px; font-family: var(--serif); font-size: 20px;
  letter-spacing: -.01em; color: var(--ink);
}
.cat-tree .root span {
  font: 13px/1 var(--sans); color: var(--faint);
  font-variant-numeric: tabular-nums; letter-spacing: .02em;
}
.cat-tree .root:hover b, .cat-tree .root:hover { color: var(--accent); }
.cat-tree .kids {
  margin: 0 0 18px; font-size: 13.5px; line-height: 1.95; color: var(--sub);
}
.cat-tree .kids a { color: var(--sub); }
.cat-tree .kids a + a::before { content: "·"; margin: 0 9px; color: var(--faint); opacity: .55; }
.cat-tree .kids a:hover { color: var(--accent); }
.cat-tree .kids a span { font-size: 11.5px; color: var(--faint); margin-left: 3px; vertical-align: .12em; }

@media (max-width: 820px) {
  .cat-tree { grid-template-columns: 1fr; gap: 0; padding-bottom: 80px; }
}

/* ---------- 标签云：计数改成基线小字，不用上标 ---------- */
.tag-cloud { gap: 14px 22px; font-size: 15px; line-height: 1.6; }
.tag-cloud sup {
  font-size: 11.5px; vertical-align: baseline; top: 0;
  margin-left: 5px; color: var(--faint); letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}

/* 标题后的橙色句点：整页最克制的一处强调色 */
.home-head h1 .accent-dot {
  font-style: normal; color: var(--accent); margin-left: .06em;
}

/* ---------- 搜索：并入导航行，不再单独占一层弹窗 ---------- */
nav.links .find { position: relative; display: flex; align-items: center; margin-left: 6px; }
nav.links .find input {
  width: 74px; border: 0; border-bottom: 1px solid transparent; background: none;
  font: 13px/1.7 var(--sans); letter-spacing: .02em; color: var(--ink);
  padding: 2px 0 3px; transition: width .24s cubic-bezier(.2,.7,.2,1), border-color .2s ease;
}
nav.links .find input::placeholder { color: var(--faint); }
nav.links .find input:hover { border-bottom-color: var(--rule); }
nav.links .find input:focus { width: 196px; border-bottom-color: var(--ink); outline: none; }
nav.links .find input::-webkit-search-cancel-button { display: none; }

.find-res {
  position: absolute; top: calc(100% + 14px); right: 0; z-index: 60;
  width: min(430px, 74vw); max-height: 62vh; overflow: auto;
  margin: 0; padding: 4px 0; list-style: none;
  background: var(--paper); border: 1px solid var(--rule);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .10);
  display: none;
}
.find-res.open { display: block; }
.find-res li { margin: 0; }
.find-res li a { display: block; padding: 10px 16px 11px; color: var(--ink); }
.find-res li a:hover, .find-res li.on a { background: var(--hover); }
.find-res .ft { display: block; font-family: var(--serif); font-size: 15px; line-height: 1.45; }
.find-res .fd { display: block; margin-top: 2px; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.find-res .none { padding: 14px 16px; font-size: 13px; color: var(--faint); }

@media (max-width: 680px) {
  nav.links .find { margin-left: 0; }
  nav.links .find input { width: 64px; }
  nav.links .find input:focus { width: 132px; }
  .find-res { position: fixed; left: 16px; right: 16px; top: 108px; width: auto; }
}

/* 窄屏不再保留侧栏目录（正文自带的「目录」列表已够用） */
@media (max-width: 1080px) {
  .layout > aside.toc { display: none; }
}

/* 页脚与底边留出呼吸（.wrap 的 padding 会盖掉 main.css 里 footer 的上下内边距） */
footer.wrap { padding-top: 72px; padding-bottom: 112px; }
@media (max-width: 700px) { footer.wrap { padding-top: 56px; padding-bottom: 84px; } }

/* ---------- 表格：外层滚动容器 + 真正的表格布局（此前 display:block 会把表格压成内容宽度） ---------- */
.table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  margin: 30px 0 32px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--rule);
}
article .table-wrap table {
  display: table; width: 100%; min-width: 480px;
  border-collapse: collapse; font-size: 14.5px; margin: 0;
  overflow: visible;
}
article .table-wrap thead th {
  padding: 11px 14px 10px; text-align: left; vertical-align: bottom;
  font-family: var(--sans); font-size: 12.5px; font-weight: 500;
  letter-spacing: .06em; color: var(--sub);
  border-bottom: 1px solid var(--rule); background: var(--note);
}
article .table-wrap tbody td {
  padding: 11px 14px 12px; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--hair); background: none;
  line-height: 1.72; color: var(--ink);
}
article .table-wrap thead th + th,
article .table-wrap tbody td + td { border-left: 1px solid var(--hair); }
article .table-wrap tbody tr:last-child td { border-bottom: 0; }
article .table-wrap tbody tr:hover td { background: var(--hover); }
article td code, article th code { white-space: nowrap; }
article .table-wrap tbody td code {
  font-size: 13px; padding: 1px 5px; border-radius: 2px;
  background: var(--codebg); color: var(--codefg);
}

/* ---------- 标签云：按权重放大，重心在中部 ---------- */
.tag-cloud {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline;
  gap: 10px 28px; max-width: 1000px; margin: 0 auto; padding: 64px 0 72px;
}
.tag-cloud a {
  font-size: var(--sz, 15px); line-height: 1.1; color: var(--sub);
  padding: 2px 0; border-bottom: 1px solid transparent;
  transition: color .18s ease;
}
.tag-cloud a.big {
  font-family: var(--serif); color: var(--ink); letter-spacing: -.02em;
}
.tag-cloud a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.tag-cloud sup {
  font-size: max(9.5px, .4em); margin-left: .22em; vertical-align: super; color: var(--faint);
  font-variant-numeric: tabular-nums; letter-spacing: 0;
}
@media (max-width: 860px) {
  .tag-cloud { gap: 8px 18px; padding: 44px 0 56px; }
  .tag-cloud a { font-size: calc(var(--sz, 15px) * .68); }
}

/* ---------- 首页 hero：右侧一组元信息 ---------- */
.hero-meta {
  display: flex; flex-direction: column; align-items: flex-end; justify-content: flex-end;
  gap: 5px; padding-bottom: 10px;
  font-family: var(--sans); font-size: 12.5px; line-height: 1.5;
  color: var(--sub); letter-spacing: .03em; font-variant-numeric: tabular-nums;
}
.hero-meta b { font-family: var(--serif); font-weight: 400; font-size: 15px; color: var(--ink); }

/* ---------- 正文链接：细下划线，悬停转橙 ---------- */
article :not(pre) > a, article p a, article li a, article td a {
  color: var(--ink); text-decoration: none;
  border-bottom: 1px solid var(--rule2);
  transition: border-color .18s ease, color .18s ease;
}
article p a:hover, article li a:hover, article td a:hover {
  color: var(--accent); border-bottom-color: var(--accent);
}

/* ---------- 代码块语言标签 ---------- */
figure.highlight { position: relative; }
figure.highlight .lang {
  position: absolute; right: 12px; bottom: 8px;
  font: 10.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase;
  color: #5F6B73; opacity: .7; pointer-events: none;
}

/* ---------- 内容页（关于 / 设置）：说明式排版 ---------- */
.page-body { padding-top: 16px; }
.page-body .lede {
  max-width: 34em; margin: 4px 0 42px;
  font-family: var(--serif); font-size: clamp(19px, 1.75vw, 24px);
  line-height: 1.72; color: var(--ink);
}
.page-body > h2 {
  margin: 52px 0 0; padding-bottom: 12px;
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase; color: var(--sub);
  border-bottom: 1px solid var(--ink);
}
.page-body > h2:first-of-type { margin-top: 0; }
.about-list {
  display: grid; grid-template-columns: 132px minmax(0, 1fr);
  margin: 0; padding: 0; border-bottom: 1px solid var(--rule);
}
.about-list dt {
  padding: 16px 0 16px; font-size: 13.5px; color: var(--faint); letter-spacing: .02em;
  border-top: 1px solid var(--hair);
}
.about-list dd {
  margin: 0; padding: 15px 0 17px; font-size: 16px; line-height: 1.68; color: var(--ink);
  border-top: 1px solid var(--hair);
}
.about-list dt:first-of-type, .about-list dd:first-of-type { border-top: 0; }
.about-list dd a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule2); }
.about-list dd a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.page-body p { max-width: 40em; }
@media (max-width: 640px) {
  .about-list { grid-template-columns: 1fr; }
  .about-list dt { padding: 14px 0 2px; border-top: 1px solid var(--hair); }
  .about-list dd { padding: 0 0 14px; border-top: 0; }
}

/* ---------- 设置页 ---------- */
.settings { max-width: 760px; }
.set-block { margin-bottom: 56px; }
.set-block > h2 {
  margin: 0 0 4px; padding-bottom: 12px;
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase; color: var(--sub);
  border-bottom: 1px solid var(--ink);
}
.set-row {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 16px 0; border-bottom: 1px solid var(--hair);
}
.set-label { font-size: 15px; color: var(--ink); }
.set-opts { display: flex; gap: 6px; flex-wrap: wrap; }
.set-opts button {
  font: 13px/1 var(--sans); letter-spacing: .02em; color: var(--sub);
  background: none; border: 1px solid var(--rule); border-radius: 0;
  padding: 9px 14px; cursor: pointer;
  transition: color .16s ease, border-color .16s ease, background .16s ease;
}
.set-opts button:hover { color: var(--ink); border-color: var(--ink); }
.set-opts button.on { color: #fff; background: var(--ink); border-color: var(--ink); }
.set-row-end { margin-top: 18px; }

.rank { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; padding: 22px 0 6px; }
.rank > *, .rank ul, .rank li, .rank li a { min-width: 0; }
.rank h3 {
  margin: 0 0 10px; font-family: var(--sans); font-size: 12.5px; font-weight: 500;
  letter-spacing: .08em; color: var(--faint);
}
.rank ul { list-style: none; margin: 0; padding: 0; }
.rank li a {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 8px 0; border-bottom: 1px solid var(--hair);
  color: var(--ink); text-decoration: none; font-size: 14px; line-height: 1.55;
}
.rank li a:hover .rk-t { color: var(--accent); }
.rank .rk-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .rk-d { flex: 0 0 auto; color: var(--faint); font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* 字号档位 */
html[data-fs="s"] article p, html[data-fs="s"] article li { font-size: clamp(15.5px, 1.06vw, 17.5px); }
html[data-fs="l"] article p, html[data-fs="l"] article li { font-size: clamp(17.5px, 1.3vw, 21px); }
html[data-fs="xl"] article p, html[data-fs="xl"] article li { font-size: clamp(18.5px, 1.45vw, 23px); }
html[data-fs="s"] .page-body .lede { font-size: clamp(17px, 1.5vw, 21px); }
html[data-fs="l"] .page-body .lede { font-size: clamp(20px, 1.9vw, 26px); }

@media (max-width: 640px) {
  .set-row { flex-direction: column; align-items: flex-start; gap: 12px; }
  .rank { grid-template-columns: minmax(0, 1fr); gap: 22px; }
}

/* ---------- 观感：粘性报头 ---------- */
header.bar {
  position: sticky; top: 0; z-index: 45;
  width: 100%; box-sizing: border-box;
  background: var(--paper);
  padding-bottom: 14px;
  transition: box-shadow .25s ease;
}
header.bar.is-scrolled { box-shadow: 0 1px 0 var(--hair); }
header.bar .mark { letter-spacing: .02em; }

/* ---------- 观感：正文图片 ---------- */
figure.img img {
  border: 1px solid var(--hair);
  transition: transform .5s cubic-bezier(.22, .61, .36, 1), border-color .3s ease;
}
figure.img:hover img { border-color: var(--rule2); }
figure.img figcaption {
  margin-top: 10px; text-align: center; letter-spacing: .01em;
  font-size: 12.5px; color: var(--faint);
}

/* ---------- 观感：引用 ---------- */
article blockquote {
  border-left: 2px solid var(--accent);
  border-radius: 0;
  background: var(--note);
  padding: 20px 26px 20px 24px;
}
article blockquote p { font-size: 16px; line-height: 1.85; color: var(--body); }

/* ---------- 观感：目录当前项 ---------- */
.toc a { position: relative; }
.toc a.on { color: var(--ink); }
.toc a.on::before {
  content: ""; position: absolute; left: -14px; top: .62em;
  width: 4px; height: 4px; background: var(--accent);
}

/* ---------- 观感：索引行日期跟随 ---------- */
ol.posts.two a:hover .d { color: var(--paper); }

/* ---------- 看板娘：右下角，贴齐版心右缘 ---------- */
#waifu {
  right: 12px !important; left: auto !important; bottom: 0 !important;
  z-index: 55 !important;
  transform: scale(var(--waifu-scale, .82)) !important;
  transform-origin: bottom right !important;
}
#waifu #live2d { position: relative !important; transform: none !important; }
#waifu-toolbar { position: relative !important; transform: none !important; }
#waifu-toggle { display: none !important; }
#waifu-tips {
  font-family: var(--sans) !important; font-size: 13px !important;
  border-radius: 2px !important;
}
@media (max-width: 900px) {
  #waifu, #waifu-tips { display: none !important; }
}

/* ---------- 音乐播放器（APlayer 本地化） ---------- */
#music-player { position: fixed; left: 12px; bottom: 12px; z-index: 55; }
#music-player .aplayer {
  margin: 0; box-shadow: none; border-radius: 0;
  border: 1px solid var(--rule); background: var(--paper);
  font-family: var(--sans); width: 268px;
}
#music-player .aplayer .aplayer-info { border-top: 0; padding: 9px 10px 8px; }
#music-player .aplayer .aplayer-info .aplayer-music .aplayer-title { color: var(--ink); font-size: 12.5px; }
#music-player .aplayer .aplayer-info .aplayer-music .aplayer-author { color: var(--faint); font-size: 11.5px; }
#music-player .aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar { background: var(--hair); }
#music-player .aplayer .aplayer-info .aplayer-controller .aplayer-time { color: var(--faint); }
#music-player .aplayer .aplayer-list ol li { border-top: 1px solid var(--hair); font-size: 12.5px; color: var(--sub); }
#music-player .aplayer .aplayer-list ol li.aplayer-list-light { background: var(--note); }
#music-player .aplayer .aplayer-list ol li:hover { background: var(--note); }
#music-player .aplayer .aplayer-lrc:before,
#music-player .aplayer .aplayer-lrc:after { display: none; }
.set-row-col { flex-direction: column; align-items: stretch; gap: 14px; }
.song-form { display: flex; gap: 8px; flex-wrap: wrap; }
.song-form input {
  flex: 1 1 150px; min-width: 0; font: 13.5px/1 var(--sans); color: var(--ink);
  background: none; border: 1px solid var(--rule); padding: 10px 12px; border-radius: 0;
}
.song-form input:focus { outline: 0; border-color: var(--ink); }
.song-form button, .song-clear button {
  font: 13px/1 var(--sans); color: var(--ink); background: none;
  border: 1px solid var(--ink); padding: 10px 16px; cursor: pointer;
}
.song-form button:hover, .song-clear button:hover { background: var(--ink); color: var(--paper); }
.song-list { list-style: none; margin: 0; padding: 0; }
.song-list li {
  display: flex; align-items: baseline; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--hair); font-size: 13.5px; color: var(--ink);
}
.song-list .song-i { flex: 0 0 22px; color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.song-list .song-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.song-list .song-a { flex: 0 0 auto; color: var(--faint); font-size: 12.5px; }
.song-list .song-del {
  flex: 0 0 auto; font: 11.5px/1 var(--sans); color: var(--faint);
  background: none; border: 0; cursor: pointer; padding: 2px 0;
}
.song-list .song-del:hover { color: var(--accent); }
.song-empty { color: var(--faint); font-size: 13px; }
.song-clear { border-bottom: 0 !important; justify-content: flex-end; padding-top: 12px !important; }
@media (max-width: 900px) {
  #music-player { display: none; }
}
#music-player .aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-played { background: var(--accent) !important; }
#music-player .aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-thumb { background: var(--accent) !important; }
#music-player .aplayer .aplayer-info .aplayer-controller .aplayer-volume-wrap .aplayer-volume-bar-wrap .aplayer-volume-bar .aplayer-volume { background: var(--accent) !important; }
#music-player .aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon path { fill: var(--faint); }

/* ---------- 成就卡牌面板 ---------- */
#card-panel { font-family: var(--sans) !important; }
.card-panel-overlay { background: #0B0D0F !important; }
.card-panel-content { font-family: var(--sans) !important; }
.card-panel-header h2 { font-family: var(--serif) !important; font-size: 26px !important; letter-spacing: -.02em; }
.card-share-btn {
  background: transparent !important; border: 1px solid rgba(255,255,255,.5) !important;
  border-radius: 0 !important; color: #fff !important; font-size: 12.5px !important;
}
.card-share-btn:hover { background: #fff !important; color: var(--ink) !important; }
.card-close { font-size: 24px !important; opacity: .7; }
.card-close:hover { opacity: 1; }
.card-level-section { border-radius: 0 !important; background: rgba(255,255,255,.06) !important; border: 1px solid rgba(255,255,255,.12); }
.card-level-badge { border-radius: 0 !important; }
.level-progress-bar { border-radius: 0 !important; background: rgba(255,255,255,.14) !important; }
.level-progress-fill { border-radius: 0 !important; }
.card-panel-filters .card-filter {
  border-radius: 0 !important; border: 1px solid rgba(255,255,255,.28) !important;
  background: transparent !important; color: rgba(255,255,255,.75) !important; font-size: 12.5px !important;
}
.card-panel-filters .card-filter.active { background: #fff !important; color: var(--ink) !important; border-color: #fff !important; }
.card-panel-grid { gap: 1px !important; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.12); }
.card-item { border-radius: 0 !important; background: #14171A !important; }
.card-item:hover { background: #1B1F23 !important; }
.card-item .card-name { font-size: 13.5px !important; }
.card-item .card-desc, .card-item .card-flavor { color: rgba(255,255,255,.55) !important; }
.card-panel-stats, .card-counter { font-variant-numeric: tabular-nums; }
.card-level-badge { background: var(--accent) !important; }
.card-level-badge .level-icon { display: none !important; }
.card-level-progress .level-progress-fill { background: var(--accent) !important; }

/* ---------- admin 隐藏菜单 ---------- */
.admin-only { display: none; }
body.nav-admin-visible .admin-only { display: inline-flex; align-items: center; gap: 26px; }
body.nav-hidden .admin-only { display: none; }

/* ---------- 右键菜单 ---------- */
.custom-context-menu {
  position: fixed; display: none; min-width: 208px; padding: 4px 0;
  background: var(--paper); border: 1px solid var(--ink); z-index: 200;
  font-family: var(--sans); font-size: 13px;
}
.custom-context-menu.visible { display: block; }
.custom-context-menu .menu-item {
  display: flex; align-items: center; padding: 9px 14px; cursor: pointer; color: var(--ink);
  letter-spacing: .01em;
}
.custom-context-menu .menu-item:hover { background: var(--ink); color: var(--paper); }
.custom-context-menu .menu-divider { height: 1px; background: var(--hair); margin: 4px 0; }

.raw-payload-modal {
  position: fixed; inset: 0; z-index: 210; display: flex;
  align-items: center; justify-content: center;
}
.raw-payload-modal .modal-overlay { position: absolute; inset: 0; background: rgba(12,14,16,.9); }
.raw-payload-modal .modal-content {
  position: relative; width: min(760px, calc(100vw - 32px)); max-height: 80vh; overflow: auto;
  background: var(--paper); border: 1px solid var(--ink); padding: 22px 24px;
  font-family: var(--sans);
}
.raw-payload-modal .modal-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.raw-payload-modal .modal-header h3 { margin: 0; font-family: var(--serif); font-size: 20px; color: var(--ink); }
.raw-payload-modal .modal-close {
  background: none; border: 0; color: var(--faint); font-size: 20px; cursor: pointer; padding: 0; line-height: 1;
}
.raw-payload-modal .modal-close:hover { color: var(--ink); }
.raw-payload-modal .modal-body textarea {
  width: 100%; min-height: 200px; background: var(--codebg); color: var(--body);
  border: 1px solid var(--rule); padding: 12px; font: 12.5px/1.7 var(--mono); resize: vertical;
}
.raw-payload-modal .modal-body textarea:focus { outline: 0; border-color: var(--ink); }
.raw-payload-modal .modal-footer { margin-top: 14px; display: flex; justify-content: flex-end; gap: 8px; }
.raw-payload-modal .modal-footer button {
  font: 12.5px/1 var(--sans); padding: 9px 16px; border: 1px solid var(--ink);
  background: none; color: var(--ink); cursor: pointer;
}
.raw-payload-modal .modal-footer button:hover { background: var(--ink); color: var(--paper); }

/* ---------- 时钟：底部居中悬浮（用 #time-widget 提升优先级，压过插件内联样式） ---------- */
#time-widget {
  position: fixed !important;
  left: 50% !important;
  bottom: 16px !important;
  transform: translateX(-50%) !important;
  z-index: 54 !important;
  align-items: center;
  justify-content: center !important;
  gap: 12px;
  margin: 0 !important;
  padding: 7px 16px !important;
  font-family: var(--sans) !important;
  font-size: 12.5px;
  line-height: 1;
  color: var(--faint) !important;
  background: var(--paper);
  border: 1px solid var(--hair) !important;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  opacity: 1 !important;
  border-bottom: 1px solid var(--hair) !important;
}
#time-widget > * { opacity: 1 !important; }
#time-widget .footer-clock { color: var(--ink) !important; }
#time-widget .footer-stat { color: var(--faint) !important; }
#time-widget .footer-divider { color: var(--hair) !important; }
@media (max-width: 900px) {
  #time-widget { bottom: 12px !important; font-size: 11.5px; padding: 6px 13px !important; }
}

/* ---------- 成就通知：纸色方框，不用发光 ---------- */
.card-notification {
  background: var(--paper) !important;
  border: 1px solid var(--ink) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: var(--ink) !important;
  font-family: var(--sans) !important;
  min-width: 260px !important;
  top: auto !important;
  bottom: 24px !important;
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
  display: flex !important;
  align-items: center;
  gap: 12px;
}
.card-notification .card-glow { display: none !important; }
.card-notification .card-title { color: var(--faint) !important; font-size: 11.5px !important; letter-spacing: .06em; }
.card-notification .card-name { color: var(--ink) !important; font-size: 14px !important; font-weight: 400 !important; }
.card-notification .card-desc { color: var(--sub) !important; font-size: 12px !important; }
.card-notification .card-rarity { color: var(--faint) !important; }
.card-notification .card-icon { font-size: 22px !important; filter: none !important; }

/* ---------- 目录不被吸顶报头挡住 ---------- */
.toc { top: 104px; }
article h2, article h3, article h4 { scroll-margin-top: 112px; }
@media (max-width: 1080px) {
  article h2, article h3, article h4 { scroll-margin-top: 84px; }
}

/* ---------- 仅 admin 可见的设置区块 ---------- */
.admin-only-block { display: none; }
body.nav-admin-visible .admin-only-block { display: block; }

/* ---------- 归档：年月两层 ---------- */
.month-block { margin: 0 0 38px; }
.month-block:last-child { margin-bottom: 8px; }
.month-h {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 6px; font-size: 12px; color: var(--faint);
  letter-spacing: .08em;
}
.month-h span { flex: 0 0 auto; }
.month-h i { flex: 1 1 auto; height: 1px; background: var(--hair); }
.month-h em { flex: 0 0 auto; font-style: normal; font-size: 11.5px; color: var(--faint); }
.month-block ol.posts.two .d { color: var(--sub); }
.year-block .month-block:first-of-type .month-h i { background: var(--rule); }
