﻿/* ============================================================
   blogctfvin 鈥?monochrome terminal 脳 minimalism theme
   ============================================================ */

/* ---- 瀛椾綋 & 鍙橀噺 ---------------------------------------------------- */
:root {
  --font-mono: "JetBrains Mono", "Fira Code", "SFMono-Regular", Menlo, Consolas,
               "DejaVu Sans Mono", "Liberation Mono", monospace;
  --font-cjk: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
              "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  --font-prose: var(--font-mono), var(--font-cjk);

  --maxw: 46rem;
  --gutter: 1.25rem;
  --radius: 0px;                 /* 鍏ㄧ珯鏍囧噯鐭╁舰锛屾棤鍦嗚 */

  --layout-w: 1320px;
  --col-side: 13.5rem;
  --col-gap: 2.25rem;
}

html[data-theme="dark"] {
  --bg: #141416;
  --bg-alt: #1b1b1e;
  --bg-sunk: #0e0e10;
  --border: #2e2e32;
  --border-soft: #242428;

  --text: #c9c9c9;
  --dim: #8a8a8a;
  --faint: #585858;

  --accent: #f2f2f2;             /* 涓诲己璋冿細杩戠櫧 */
  --accent-2: #a8a8a8;           /* 娆″己璋?*/
  --accent-fg: #0e0e10;

  --bar-bg: #000000;             /* tmux 鐘舵€佹爮锛氱函榛?*/
  --bar-fg: #b9b9b9;

  --link: #d8d8d8;
  --link-hover: #ffffff;
  --head: #f2f2f2;

  --code-bg: #1b1b1e;
  --inline-fg: #b8b8b8;
  --inline-bg: #26262a;
  --quote-fg: #9a9a9a;
  --quote-bd: #4a4a4a;
  --select: rgba(255, 255, 255, .18);
  --shadow: 0 12px 32px rgba(0, 0, 0, .5);
  --row-hover: rgba(255, 255, 255, .04);
}

html[data-theme="light"] {
  --bg: #fafafa;
  --bg-alt: #f2f2f2;
  --bg-sunk: #e8e8e8;
  --border: #d0d0d0;
  --border-soft: #e2e2e2;

  --text: #2a2a2a;
  --dim: #6a6a6a;
  --faint: #9a9a9a;

  --accent: #111111;             /* 涓诲己璋冿細杩戦粦 */
  --accent-2: #4a4a4a;
  --accent-fg: #fafafa;

  --bar-bg: #111111;
  --bar-fg: #d9d9d9;

  --link: #1a1a1a;
  --link-hover: #000000;
  --head: #111111;

  --code-bg: #f4f4f4;
  --inline-fg: #333333;
  --inline-bg: #e8e8e8;
  --quote-fg: #555555;
  --quote-bd: #b0b0b0;
  --select: rgba(0, 0, 0, .12);
  --shadow: 0 12px 32px rgba(0, 0, 0, .10);
  --row-hover: rgba(0, 0, 0, .03);
}

/* ---- 璇█鍒囨崲锛圕SS 椹卞姩锛岄浂 JS 閫昏緫锛?------------------------------ */
html[lang="en"] [data-i="zh"] { display: none; }
html[lang="zh"] [data-i="en"] { display: none; }

/* ---- reset ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

/* 鍏滃簳锛氶槻姝㈢粍浠剁殑 display 鏍峰紡瑕嗙洊 HTML hidden 灞炴€?*/
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 3.5rem;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-prose);
  font-size: 15.5px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

h1, h2, h3, h4, h5, h6 { font-weight: 600; line-height: 1.35; }
img, svg, video { max-width: 100%; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--select); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* 婊氬姩鏉★紙鐭╁舰锛?*/
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-sunk); }
::-webkit-scrollbar-thumb { background: var(--border); }
::-webkit-scrollbar-thumb:hover { background: var(--faint); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--accent); color: var(--accent-fg); padding: .5rem 1rem;
}
.skip-link:focus { left: .5rem; top: .5rem; }

/* ---- 涓夋爮甯冨眬 ------------------------------------------------------- */
.layout {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--layout-w);
  margin: 0 auto;
  padding: 2.5rem var(--gutter) 4rem;
  position: relative;
}
.container { min-width: 0; }
.aside { display: none; }

@media (min-width: 1360px) {
  .layout {
    display: grid;
    grid-template-columns: var(--col-side) minmax(0, var(--maxw)) var(--col-side);
    gap: var(--col-gap);
    align-items: start;
  }
  .aside { display: block; }
  .aside-left, .aside-right {
    position: sticky;
    top: 3.2rem;
    max-height: calc(100vh - 4.5rem);
    overflow-y: auto;
  }
  .aside-left { grid-column: 1; grid-row: 1; }
  .container { grid-column: 2; grid-row: 1; }
  .aside-right { grid-column: 3; grid-row: 1; }
  /* 瀹藉睆涓嬬獎灞忕洰褰曟姌鍙犻殣钘忥紝鍙暀渚ф爮 */
  .toc-inline { display: none; }
}

/* ---- 浣滆€呭崱鐗囷紙宸︽爮锛?----------------------------------------------- */
.author-card {
  border: 1px solid var(--border);
  background: var(--bg-alt);
  padding: 1.3rem 1rem;
}
.author-avatar {
  width: 56px; height: 56px; display: block; margin: 0 auto .7rem;
  border: 1px solid var(--border);
}
.author-name { text-align: center; font-weight: 700; color: var(--head); font-size: 1.05em; }
.author-bio { text-align: center; color: var(--dim); font-size: .8em; margin: .35rem 0 .85rem; line-height: 1.5; }
.author-links {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: .25rem .95rem; font-size: .8em;
  border-top: 1px dashed var(--border-soft); padding-top: .7rem;
}
.author-links a { color: var(--dim) !important; text-decoration: none !important; }
.author-links a:hover { color: var(--head) !important; text-decoration: underline !important; }

/* ---- 渚ф爮鐩綍锛堝彸鏍忥級 ----------------------------------------------- */
.toc-side { font-size: .82rem; }
.toc-side-head {
  font-weight: 700; color: var(--head); margin-bottom: .6rem; font-size: .95em;
  border-bottom: 1px solid var(--border); padding-bottom: .35rem;
}
.toc-side .toc { margin: 0; padding: 0; border: none; background: none; }
.toc-side ul { margin: 0; padding-left: .85rem; list-style: none; }
.toc-side ul ul { padding-left: .8rem; }
.toc-side li { margin: .3rem 0; }
.toc-side a { color: var(--dim) !important; text-decoration: none !important; }
.toc-side a:hover { color: var(--head) !important; }
.toc-side a.toc-active { color: var(--head) !important; font-weight: 600; }

/* 绐勫睆鍙姌鍙犵洰褰曪紙姝ｆ枃椤堕儴锛?*/
.toc-inline { margin: 0 0 1.6rem; border: 1px solid var(--border-soft); background: var(--bg-alt); }
.toc-inline details { padding: .8rem 1rem; }
.toc-inline summary {
  cursor: pointer; font-weight: 700; color: var(--head); font-size: .92em;
  list-style: none;
}
.toc-inline summary::before { content: "鈻?"; color: var(--faint); }
.toc-inline details[open] summary::before { content: "鈻?"; }
.toc-inline summary::-webkit-details-marker { display: none; }
.toc-inline .toc { margin: .7rem 0 0; padding: 0; border: none; background: none; }
.toc-inline ul { margin: 0; padding-left: 1rem; }
.toc-inline ul ul { padding-left: .9rem; }
.toc-inline li { margin: .25rem 0; }
.toc-inline a { color: var(--dim) !important; text-decoration: none !important; }
.toc-inline a:hover { color: var(--head) !important; }
.toc-inline a.toc-active { color: var(--head) !important; font-weight: 600; }

/* ---- tmux 鐘舵€佹爮 ---------------------------------------------------- */
.statusbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: .75rem;
  min-height: 30px;
  padding: 0 .6rem;
  background: var(--bar-bg);
  color: var(--bar-fg);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .02em;
  user-select: none;
  border-bottom: 1px solid var(--border);
}
.sb-left { flex: 1 1 auto; min-width: 0; }
.sb-center { flex: 0 0 auto; opacity: .8; }
.sb-right {
  flex: 0 0 auto; display: flex; align-items: center; gap: .6rem;
  margin-left: auto;
}

.tabs { display: flex; align-items: center; gap: 1px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }

.tab {
  display: inline-flex; align-items: center; gap: 1px;
  padding: 4px 6px;
  color: inherit !important;
  text-decoration: none !important;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s, color .15s;
}
.tab:hover { background: rgba(128, 128, 128, .18); }
.tab.active { background: var(--bg); color: var(--head); }
.tab.active:hover { background: var(--bg); }
.tab .bracket { opacity: .5; }
.tab-mark { margin-left: 1px; }

.lang-switch { font-size: 12px; font-weight: 600; }
.lang-switch a { color: inherit !important; text-decoration: none !important; opacity: .55; }
.lang-switch a.on { opacity: 1; text-decoration: underline !important; }
.lang-switch .sep { opacity: .4; margin: 0 1px; }

#theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  border: 1px solid currentColor;
  background: transparent; color: inherit; cursor: pointer;
  font-size: 12px; line-height: 1; padding: 0;
  opacity: .8; transition: opacity .15s;
}
#theme-toggle:hover { opacity: 1; }
html[data-theme="dark"] [data-th="dark"] { display: none; }
html[data-theme="light"] [data-th="light"] { display: none; }

.clock { font-variant-numeric: tabular-nums; opacity: .7; font-size: 12px; }

/* ---- 鎻愮ず琛?prompt -------------------------------------------------- */
.prompt-line {
  font-size: .95em;
  margin: 0 0 1.1rem;
  color: var(--dim);
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.prompt-line::-webkit-scrollbar { display: none; }
.prompt { color: var(--accent-2); font-weight: 700; }
.command { color: var(--dim); }

/* ---- 棣栭〉 hero ------------------------------------------------------ */
.hero { margin-bottom: 2rem; }
.hero-title {
  font-size: clamp(1.9rem, 6vw, 2.75rem);
  margin: 0 0 .35rem;
  color: var(--head);
  letter-spacing: -.01em;
}
.hero-sub { color: var(--accent-2); margin: 0 0 .8rem; font-size: 1.05em; }
.hero-bio { color: var(--dim); margin: 0 0 1.1rem; max-width: 36rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

.btn {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .35rem .8rem;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text) !important;
  text-decoration: none !important;
  font-size: .9em;
  transition: border-color .15s, background .15s;
}
.btn:hover { border-color: var(--accent); background: var(--bg-sunk); }

.cursor {
  display: inline-block; width: .55ch; height: 1.05em;
  background: var(--accent); vertical-align: -.16em;
  margin-left: .12em;
  animation: blink 1.05s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---- 缁熻鏉?--------------------------------------------------------- */
.stats {
  display: flex; gap: 2rem; flex-wrap: wrap;
  padding: .9rem 1.1rem; margin-bottom: 2.2rem;
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--accent);
  background: var(--bg-alt);
}
.stat b { color: var(--accent); font-size: 1.2em; margin-right: .3rem; }
.stat span { color: var(--dim); font-size: .9em; }

/* ---- 鏂囩珷鍒楄〃鏉＄洰 --------------------------------------------------- */
.entry {
  padding: 1.1rem 0 1.15rem;
  border-bottom: 1px dashed var(--border-soft);
}
.entry:last-child { border-bottom: none; }
.entry-line { display: flex; align-items: baseline; gap: .55rem; flex-wrap: wrap; }
.entry-date {
  color: var(--faint); font-size: .85em; flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}
.entry-arrow { color: var(--accent-2); font-size: .9em; }
.entry-title { font-size: 1.06em; font-weight: 600; color: var(--head); }
.entry-title:hover { color: var(--link); }
.entry-summary { color: var(--dim); margin: .45rem 0 .55rem; font-size: .94em; }
.entry-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; }
.entry-rt { color: var(--faint); font-size: .8em; margin-left: auto; }

.chip {
  display: inline-flex; align-items: center;
  padding: .1rem .45rem; font-size: .76em;
  border: 1px solid var(--border);
  color: var(--dim) !important; text-decoration: none !important;
  transition: color .15s, border-color .15s, background .15s;
}
.chip:hover { color: var(--head) !important; border-color: var(--accent); background: var(--row-hover); }

.more-link { margin: 1.6rem 0 0; font-size: 1em; }
.more-link a { color: var(--accent); font-weight: 600; text-decoration: none; }
.more-link a:hover { text-decoration: underline; }

/* ---- 椤甸潰鏍囬 ------------------------------------------------------- */
.page-title { font-size: 1.6rem; margin: 0 0 .3rem; color: var(--head); }
.page-sub { color: var(--dim); margin: 0 0 1.6rem; font-size: .92em; }
.page-title .count, .archive-year-head .count { color: var(--faint); font-size: .6em; font-weight: 400; }
.page-title .hash { color: var(--accent-2); }

/* ---- 褰掓。 ----------------------------------------------------------- */
.archive-year { margin-bottom: 2rem; }
.archive-year-head {
  font-size: 1.25rem; margin: 0 0 .5rem; padding-bottom: .35rem;
  border-bottom: 1px solid var(--border);
}
.archive-year-head .year { color: var(--accent); }

/* ---- 鏍囩浜?/ 鍒嗙被鍒楄〃 --------------------------------------------- */
.tag-cloud { display: flex; flex-wrap: wrap; gap: .55rem; line-height: 1.4; }
.cloud-tag {
  --n: 1;
  display: inline-flex; align-items: baseline; gap: .15rem;
  padding: .28rem .65rem;
  border: 1px solid var(--border);
  color: var(--text) !important;
  text-decoration: none !important;
  font-size: calc(.82em + min(var(--n), 6) * .045em);
  transition: border-color .15s, color .15s;
}
.cloud-tag sup { color: var(--faint); font-size: .7em; }
.cloud-tag:hover { border-color: var(--accent); color: var(--accent) !important; }

.cat-list { display: grid; gap: .7rem; }
.cat-item {
  display: grid; grid-template-columns: auto 1fr auto;
  align-items: center; gap: .15rem .8rem;
  padding: .8rem 1rem;
  border: 1px solid var(--border-soft);
  background: var(--bg-alt);
  color: var(--text) !important; text-decoration: none !important;
  transition: border-color .15s;
}
.cat-item:hover { border-color: var(--accent); }
.cat-name { font-weight: 600; color: var(--head); }
.cat-count { color: var(--accent-2); font-size: .85em; }
.cat-latest { grid-column: 1 / -1; color: var(--dim); font-size: .85em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- 鏂囩珷椤?--------------------------------------------------------- */
.post-head { margin-bottom: 1.6rem; }
.post-title { font-size: clamp(1.5rem, 4.5vw, 2.05rem); margin: 0 0 .55rem; color: var(--head); }
.post-meta { color: var(--dim); font-size: .88em; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.post-meta .sep { color: var(--faint); }
.post-meta a { color: var(--dim); }
.post-meta a:hover { color: var(--link); }

/* ---- 姝ｆ枃 prose ----------------------------------------------------- */
.prose { font-size: 1em; color: var(--text); }
.prose > *:first-child { margin-top: 0; }
.prose p { margin: 0 0 1.05em; }
.prose h2, .prose h3, .prose h4 { color: var(--head); margin: 1.9em 0 .7em; scroll-margin-top: 3.2rem; }
.prose h2 { font-size: 1.32em; padding-bottom: .25em; border-bottom: 1px solid var(--border-soft); }
.prose h2::before { content: "## "; color: var(--faint); font-weight: 400; }
.prose h3 { font-size: 1.1em; }
.prose h3::before { content: "### "; color: var(--faint); font-weight: 400; }
.prose h4 { font-size: 1em; color: var(--dim); }
.prose h4::before { content: "#### "; color: var(--faint); font-weight: 400; }

.prose ul, .prose ol { margin: 0 0 1.05em; padding-left: 1.4em; }
.prose li { margin: .3em 0; }
.prose ul ul, .prose ol ol, .prose ul ol, .prose ol ul { margin: .35em 0 .35em; }
.prose li.task { list-style: none; margin-left: -1.1em; }
.prose li.task .cb { display: inline-block; width: 1.1em; color: var(--accent-2); }

.prose blockquote {
  margin: 1.2em 0;
  padding: .55em 1em;
  border-left: 3px solid var(--quote-bd);
  background: var(--bg-alt);
  color: var(--quote-fg);
}
.prose blockquote p:last-child { margin-bottom: 0; }

.prose hr {
  border: none; border-top: 1px dashed var(--border);
  margin: 2em 0; position: relative;
}
.prose hr::after {
  content: "鈰?; position: absolute; left: 50%; top: -.72em; transform: translateX(-50%);
  background: var(--bg); color: var(--faint); padding: 0 .55em; font-size: .8em;
}

.prose a { color: var(--link); border-bottom: 1px solid var(--border); }
.prose a:hover { border-bottom-color: var(--link); }

.prose strong { color: var(--head); font-weight: 700; }
.prose em { color: var(--head); }
.prose del { color: var(--faint); }

.prose img[data-zoom] { cursor: zoom-in; }

/* 琛屽唴浠ｇ爜 */
.prose code, .prose .code-lang, kbd {
  font-family: var(--font-mono);
  font-size: .86em;
}
.prose :not(pre) > code {
  padding: .12em .36em;
  background: var(--inline-bg);
  color: var(--inline-fg);
  border: 1px solid var(--border-soft);
  white-space: nowrap;
}
kbd {
  padding: .1em .4em;
  background: var(--inline-bg); color: var(--inline-fg);
  border: 1px solid var(--border); border-bottom-width: 2px;
  font-size: .8em;
}

/* 浠ｇ爜鍧楀澹筹紙鐭╁舰锛?*/
.code-block {
  margin: 1.3em 0;
  border: 1px solid var(--border-soft);
  overflow: hidden;
  background: var(--code-bg);
  box-shadow: var(--shadow);
}
.code-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: .3rem .8rem;
  background: var(--bg-sunk);
  border-bottom: 1px solid var(--border-soft);
  font-size: .76em;
}
.code-lang { color: var(--dim); text-transform: uppercase; letter-spacing: .06em; }
.code-copy {
  border: 1px solid var(--border);
  background: var(--bg-alt); color: var(--dim);
  font-family: var(--font-mono); font-size: .76em;
  padding: .1rem .45rem; cursor: pointer;
  transition: color .15s, border-color .15s;
}
.code-copy:hover { color: var(--accent); border-color: var(--accent); }
.code-copy.copied { color: var(--accent); border-color: var(--accent); }

.highlight pre {
  margin: 0; padding: .9rem 1rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: .84em;
  line-height: 1.65;
  background: var(--code-bg);
  color: var(--text);
}
.highlight { background: var(--code-bg); }

/* ---- 鐏伴樁璇硶楂樹寒锛堣鐩?pygments 閰嶈壊锛?---------------------------- */
/* 鏆楄壊锛氫粠杩戠櫧鍒版繁鐏扮殑鏄庡害闃舵 */
/* ?????????? Pygments ????? */

/* 琛ㄦ牸 */
.prose table {
  display: block; overflow-x: auto;
  width: 100%; margin: 1.2em 0;
  border-collapse: collapse; border-spacing: 0;
  font-size: .92em;
}
.prose th, .prose td {
  padding: .5em .8em;
  border: 1px solid var(--border);
  text-align: left;
}
.prose th { background: var(--bg-alt); color: var(--head); font-weight: 600; }
.prose tr:nth-child(2n) { background: var(--row-hover); }

/* admonition (!!! note ...) */
.admonition {
  margin: 1.25em 0; padding: .7em 1em .8em;
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--accent-2);
  background: var(--bg-alt);
}
.admonition p.admonition-title {
  margin: 0 0 .4em; font-weight: 700; color: var(--head); font-size: .92em;
}
.admonition p:last-child { margin-bottom: 0; }
.admonition.tip, .admonition.note { border-left-color: var(--accent); }
.admonition.tip p.admonition-title,
.admonition.note p.admonition-title { color: var(--accent); }
.admonition.warning, .admonition.error, .admonition.danger { border-left-color: var(--text); }
.admonition.warning p.admonition-title,
.admonition.error p.admonition-title,
.admonition.danger p.admonition-title { color: var(--head); }

/* 鑴氭敞 */
.prose .footnote { font-size: .85em; color: var(--dim); border-top: 1px solid var(--border-soft); margin-top: 2em; }
.prose .footnote-ref { font-size: .75em; vertical-align: super; }

/* 鏍囬閿氱偣 */
.headerlink {
  color: var(--faint) !important; text-decoration: none !important;
  margin-left: .4em; opacity: 0; transition: opacity .15s;
}
.prose h2:hover .headerlink, .prose h3:hover .headerlink, .prose h4:hover .headerlink { opacity: 1; }
.headerlink:hover { color: var(--link) !important; opacity: 1; }

/* 鏂囩珷搴曢儴鏍囩 */
.post-tags { display: flex; flex-wrap: wrap; gap: .45rem; margin: 1.8rem 0 0; }

/* 涓婁竴绡?/ 涓嬩竴绡?*/
.post-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: .8rem;
  margin-top: 2.4rem; padding-top: 1.2rem;
  border-top: 1px dashed var(--border);
}
.post-nav a {
  display: flex; flex-direction: column; gap: .15rem;
  padding: .7rem .85rem;
  border: 1px solid var(--border-soft);
  background: var(--bg-alt);
  color: var(--text) !important; text-decoration: none !important;
  transition: border-color .15s;
}
.post-nav a:hover { border-color: var(--accent); }
.nav-next { text-align: right; }
.nav-label { font-size: .74em; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.nav-title { font-weight: 600; color: var(--head); font-size: .94em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) { .post-nav { grid-template-columns: 1fr; } .nav-next { text-align: left; } }

/* ---- 鎼滅储 ----------------------------------------------------------- */
.search-box {
  display: flex; align-items: center; gap: .55rem;
  padding: .65rem .9rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--bg-alt);
}
.search-box:focus-within { border-color: var(--accent); }
.search-prompt { color: var(--accent-2); font-weight: 700; font-size: .9em; }
#search-input {
  flex: 1 1 auto; min-width: 0;
  border: none; background: transparent; outline: none;
  color: var(--text); font-family: var(--font-prose); font-size: 1em;
  padding: .15rem 0;
}
#search-input::placeholder { color: var(--faint); }
.search-cursor {
  display: inline-block; width: .5ch; height: 1.1em;
  background: var(--accent); animation: blink 1.05s steps(1) infinite;
}
.search-hint { color: var(--faint); font-size: .82em; margin: .7rem 0 1.4rem; }
.search-hint kbd { font-size: .9em; }

.search-results .entry { padding-top: .9rem; }
.search-empty { color: var(--dim); padding: 1.2rem 0; }
.search-mark { background: var(--select); color: var(--head); padding: 0 .1em; }

/* ---- 404 ------------------------------------------------------------ */
.err404 { padding: 1rem 0; }
.err-msg {
  font-family: var(--font-mono); color: var(--dim); font-size: 1em;
  margin: 0 0 1rem; white-space: pre-wrap; word-break: break-all;
}
.err-hint { color: var(--dim); margin: 0 0 1.2rem; }
.err-art pre {
  font-family: var(--font-mono); font-size: clamp(.55rem, 2.4vw, .8rem);
  line-height: 1.3; color: var(--accent-2);
  overflow-x: auto; margin: 2rem 0;
}

/* ---- 椤佃剼 ----------------------------------------------------------- */
.site-footer {
  flex: 0 0 auto;
  border-top: 1px solid var(--border-soft);
  background: var(--bg-sunk);
  font-size: .88em;
}
.site-footer .container {
  max-width: var(--layout-w);
  margin: 0 auto;
  padding: 2rem var(--gutter) 2.5rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
  gap: 1.5rem 3rem;
  padding-top: .35rem;
}
.footer-copy { margin: 0 0 .35rem; color: var(--head); font-weight: 600; }
.footer-dim { margin: 0; color: var(--dim); font-size: .92em; }
.footer-links { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; }
.footer-links a { color: var(--dim) !important; text-decoration: none !important; }
.footer-links a:hover { color: var(--head) !important; text-decoration: underline !important; }
.footer-links.social { margin-top: .4rem; }
@media (max-width: 560px) {
  .site-footer .container { padding-left: .9rem; padding-right: .9rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.1rem; }
}

/* ---- 鍥炲埌椤堕儴锛堢煩褰級 ----------------------------------------------- */
#backtop {
  position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 90;
  width: 2.4rem; height: 2.4rem;
  border: 1px solid var(--border);
  background: var(--bg-alt); color: var(--accent);
  font-size: 1.1em; cursor: pointer;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, border-color .15s;
  box-shadow: var(--shadow);
}
#backtop.show { opacity: 1; pointer-events: auto; }
#backtop:hover { border-color: var(--accent); }

/* ---- 鍥剧墖鐏 ------------------------------------------------------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, .92);
  cursor: zoom-out; padding: 2rem;
}
.lightbox img { max-width: 92vw; max-height: 88vh; object-fit: contain; }
.lb-close {
  position: absolute; top: 1rem; right: 1.4rem;
  background: none; border: 1px solid rgba(255,255,255,.4); color: #fff;
  width: 2rem; height: 2rem;
  font-size: 1rem; cursor: pointer; line-height: 1;
}
.lb-close:hover { border-color: #fff; }

/* ---- 鍝嶅簲寮?--------------------------------------------------------- */
@media (max-width: 860px) {
  .sb-center { display: none; }
  .clock { display: none; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .layout { padding: 1.6rem .9rem 3rem; }
  .stats { gap: 1.2rem; padding: .7rem .85rem; }
  .entry-rt { margin-left: 0; }
  .lang-switch { font-size: 11px; }
}

/* ---- 鎵撳嵃 ----------------------------------------------------------- */
@media print {
  .statusbar, .site-footer, #backtop, .aside, .post-nav, .code-copy { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .layout, .container { max-width: 100%; }
  a { color: #000 !important; }
  .prose h2::before, .prose h3::before { content: ""; }
}

/* ---- 鍑忓皯鍔ㄦ晥 ------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

