*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:      #0d1117;
  --bg2:     #161b22;
  --bg3:     #21262d;
  --green:   #39d353;
  --green2:  #26a641;
  --green3:  #006d32;
  --dim:     #8b949e;
  --dim2:    #484f58;
  --amber:   #d29922;
  --blue:    #58a6ff;
  --red:     #f85149;
  --white:   #e6edf3;
  --border:  #30363d;
  --rule-fade: rgba(72, 79, 88, 0.55);
  --rule-dash: rgba(0, 109, 50, 0.45);
  /* TOC 点击落点：增大则标题停在更靠下的位置（scroll-margin-top） */
  --article-scroll-nudge: 2px;
  /* 仅影响手动滚动时 TOC 高亮判定，不改变点击落点 */
  --article-scroll-detect-slack: 40px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "Cascadia Mono", "SFMono-Regular", "SF Mono", Consolas, "Liberation Mono", Menlo, Monaco, "Courier New", monospace;
  /* FIGlet / 框线字符：优先 Cascadia Mono，避免回退到无框线字形的字体 */
  --font-ascii: "Cascadia Mono", "Cascadia Code", Consolas, "Courier New", monospace;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--dim2) var(--bg);
}

/* 全局滚动条 — 终端风格 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--dim2);
}
::-webkit-scrollbar-corner {
  background: var(--bg);
}
body {
  background: var(--bg);
  color: var(--green);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100%;
}

/* 终端壳层与代码：系统等宽字体 */
.titlebar,
.nav-tab,
.prompt,
.search-prompt,
.search-input,
.ls-filter-prompt,
.ls-cmd,
.list-cmd,
.stat-label,
.article-prompt,
.article-meta-row,
code,
pre,
.highlight,
.copy-code-button,
.back-to-top {
  font-family: var(--font-mono);
}

@keyframes blink { 0%,49%{opacity:1} 50%,100%{opacity:0} }
.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.1em;
  background: var(--green);
  vertical-align: text-bottom;
  animation: blink 1.1s step-end infinite;
  margin-left: 2px;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,.03) 2px, rgba(0,0,0,.03) 4px);
  pointer-events: none;
  z-index: 1000;
}

.titlebar {
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  padding: 0.4rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--dim);
  position: sticky; top: 0; z-index: 100;
}
.dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.dot.red   { background: #ff5f57; }
.dot.amber { background: #febc2e; }
.dot.green { background: #28c840; }
.titlebar-name { margin-left: 0.75rem; flex: 1; text-align: center; }
.titlebar-name a { color: inherit; text-decoration: none; }

.nav-bar {
  display: flex;
  gap: 0;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  overflow-x: auto;
  max-width: 100%;
  position: sticky;
  top: var(--titlebar-h, 2rem);
  z-index: 99;
}
.nav-tab {
  font-size: 0.72rem;
  padding: 0.5rem 1.1rem;
  color: var(--dim);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-bar .nav-tab.active { color: var(--green); border-bottom-color: var(--green); }
.nav-tab:hover { color: var(--white); }


.ascii-header {
  font-family: var(--font-ascii);
  font-size: clamp(0.58rem, 1.05vw, 0.7rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
  color: var(--green2);
  padding: 1.5rem 1.5rem 0.5rem;
  margin: 0;
  white-space: pre;
  overflow-x: auto;
  max-width: 100%;
  -webkit-font-smoothing: antialiased;
}
.tagline { color: var(--dim); font-size: 0.78rem; padding: 0 1.5rem 1rem; }
.tagline span { color: var(--green); }

.stats {
  display: flex;
  gap: 0;
  border-top: 1px dashed var(--rule-fade);
  border-bottom: 1px dashed var(--rule-fade);
  margin: 0 0 1.5rem;
  flex-wrap: wrap;
}
.stat {
  flex: 1;
  min-width: 0;
  padding: 0.55rem 0.85rem;
  border-right: 1px solid var(--border);
  font-size: 0.72rem;
}
.stat:last-child { border-right: none; }
.stat-label {
  color: var(--dim);
  margin-bottom: 0.15rem;
  line-height: 1.35;
  word-break: break-all;
}
.stat-val { color: var(--white); font-weight: 500; font-size: 1rem; }

.shell { padding: 1.5rem 1.5rem 0; }
.prompt { color: var(--dim); font-size: 0.82rem; }
.prompt .user { color: var(--green); }
.prompt .host { color: var(--blue); }
.prompt .path { color: var(--amber); }
.prompt .sym  { color: var(--green); }
.cmd-output { margin-top: 0.2rem; padding-bottom: 0.75rem; font-size: 0.8rem; line-height: 2; color: var(--dim); }
.home-recent-list { padding-bottom: 0.75rem; }
.home-recent-item {
  display: grid;
  grid-template-columns: 118px 14px minmax(0, 1fr);
  gap: 0 0.65rem;
  align-items: baseline;
  padding: 0.15rem 0;
}
.home-recent-date { color: var(--dim); white-space: nowrap; }
.home-recent-arrow { color: var(--green2); }
.home-recent-title {
  color: var(--white);
  line-height: 1.45;
  text-decoration: none;
  justify-self: start;
  align-self: baseline;
  width: max-content;
  max-width: 100%;
}
.home-recent-title:hover { color: var(--green); }
.prompt-cursor-line { padding-bottom: 1.5rem; }

.search-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.5rem;
  border-bottom: 1px dashed var(--rule-fade);
  background: var(--bg2);
}
.search-prompt { color: var(--green); font-size: 0.82rem; flex-shrink: 0; }
.search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--white);
  font-size: 0.82rem;
}
.search-input::placeholder { color: var(--dim2); }
.search-hint { color: var(--dim2); font-size: 0.7rem; }

.search-results {
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  max-height: 16rem;
  overflow-y: auto;
}
.search-results.hidden { display: none; }
.search-result-item {
  display: grid;
  grid-template-columns: 118px 14px minmax(140px, 1fr) 108px;
  gap: 0 0.65rem;
  align-items: center;
  padding: 0.45rem 1.5rem;
  font-size: 0.82rem;
  color: inherit;
  text-decoration: none;
  border-left: 2px solid transparent;
}
.search-result-item:hover,
.search-result-item.active {
  background: var(--bg3);
  border-left-color: var(--green);
}
.search-result-date { color: var(--dim); white-space: nowrap; }
.search-result-arrow { color: var(--green2); }
.search-result-title { color: var(--white); min-width: 0; }
.search-result-item:hover .search-result-title,
.search-result-item.active .search-result-title { color: var(--green); }
.search-result-cat { color: var(--amber); font-size: 0.75rem; }
.search-result-empty {
  padding: 0.65rem 1.5rem;
  font-size: 0.78rem;
  color: var(--dim2);
}

.ls-filter {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  padding: 0.55rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
}
.ls-filter-prompt {
  font-size: 0.72rem;
  color: var(--green);
  flex-shrink: 0;
  margin-right: 0.15rem;
}
.ls-cmd {
  font-size: 0.72rem;
  color: var(--dim);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.35rem 0.15rem;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
}
.ls-cmd:hover { color: var(--white); }
.ls-cmd.active {
  color: var(--green);
  border-bottom-color: var(--green);
}

.list-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px dashed var(--rule-fade);
  font-size: 0.72rem;
  color: var(--dim);
}
.list-cmd { color: var(--dim); }
.list-meta { color: var(--green); flex-shrink: 0; }

.post-list { padding: 0 1.5rem 1.5rem; }
.post-row {
  display: grid;
  grid-template-columns: 118px 14px minmax(140px, 1.2fr) 108px minmax(200px, 1.8fr) 4.5rem;
  gap: 0 0.65rem;
  align-items: start;
  padding: 0.45rem 0.75rem;
  border-radius: 3px;
  transition: background .15s;
  font-size: 0.82rem;
  color: inherit;
}
.post-row:hover { background: var(--bg2); }
.post-row.header {
  color: var(--dim);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.25rem;
  padding-bottom: 0.4rem;
  border-radius: 0;
  pointer-events: none;
  align-items: baseline;
}
.post-row.header:hover { background: none; }
.post-date { color: var(--dim); white-space: nowrap; }
.post-arrow { color: var(--green2); padding-top: 0.1rem; }
.post-title {
  color: var(--white);
  text-decoration: none;
  line-height: 1.45;
  min-width: 0;
}
.post-row:hover .post-title { color: var(--green); }
.post-cat {
  color: var(--green2);
  font-size: 0.72rem;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.45;
}
.post-cat:hover { color: var(--green); text-decoration: underline; }
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.35rem;
  align-content: flex-start;
  min-width: 0;
}
.tag-chip {
  font-family: var(--font-sans);
  font-size: 0.62rem;
  padding: 1px 6px;
  border: 1px solid var(--border);
  color: var(--dim);
  white-space: nowrap;
  line-height: 1.45;
  border-radius: 2px;
}
.post-row.header > :last-child,
.post-time {
  justify-self: end;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.post-time { color: var(--dim); font-size: 0.72rem; padding-top: 0.1rem; }

.article-header {
  position: relative;
  padding: 1.5rem;
  border-bottom: 1px dashed var(--rule-fade);
  background: var(--bg);
}
.article-prompt { font-size: 0.78rem; color: var(--dim); margin-bottom: 0.75rem; }
.article-prompt .green { color: var(--green); }
.article-title {
  font-family: var(--font-sans);
  color: var(--white);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}
.article-meta-row {
  display: flex;
  gap: 1.5rem;
  font-size: 0.72rem;
  color: var(--dim);
  flex-wrap: wrap;
  align-items: center;
}
.article-meta-row .val { color: var(--amber); }
.article-meta-row a { color: var(--amber); text-decoration: none; }
.article-meta-row a:hover { text-decoration: underline; }
.article-meta-tags {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.article-meta-label { flex-shrink: 0; }
.article-meta-tag-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.35rem;
  align-items: center;
}
.article-tag-chip {
  font-family: var(--font-sans);
  font-size: 0.62rem;
  padding: 1px 6px;
  border: 1px solid rgba(210, 153, 34, 0.35);
  color: var(--amber);
  background: rgba(210, 153, 34, 0.06);
  white-space: nowrap;
  line-height: 1.45;
  border-radius: 2px;
}

.article-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  grid-template-areas: "toc body";
  border-bottom: 1px dashed var(--rule-fade);
}
.article-layout--no-toc {
  grid-template-columns: 1fr;
  grid-template-areas: "body";
}
.article-toc {
  grid-area: toc;
  border-right: 1px solid var(--border);
  padding: 1.5rem;
  font-size: 0.75rem;
  position: sticky;
  top: var(--site-header-h, 4.5rem);
  align-self: start;
  max-height: calc(100vh - var(--site-header-h, 4.5rem) - 1rem);
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  background: var(--bg);
}
.article-toc::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
.toc-title {
  color: var(--dim);
  font-size: 0.72rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed var(--rule-fade);
}
.article-toc .toc ul { list-style: none; padding: 0; margin: 0; }
.article-toc .toc > ul > li { margin: 0.15rem 0; }
.article-toc .toc > ul > li > a {
  color: var(--dim);
  text-decoration: none;
  display: block;
  padding: 0.2rem 0 0.2rem 0.5rem;
  transition: color .15s, border-color .15s;
  font-size: 0.75rem;
  line-height: 1.45;
  border-left: 2px solid transparent;
}
.article-toc .toc > ul > li > a:hover { color: var(--green); }
.article-toc .toc > ul > li > a.active {
  color: var(--green);
  border-left-color: var(--green);
}
.article-toc .toc ul ul {
  padding-left: 0.65rem;
  margin: 0.1rem 0 0.25rem 0.5rem;
  border-left: 1px dashed var(--rule-fade);
}
.article-toc .toc ul ul li { margin: 0.1rem 0; }
.article-toc .toc ul ul a {
  color: var(--dim2);
  text-decoration: none;
  display: block;
  padding: 0.15rem 0 0.15rem 0.45rem;
  font-size: 0.68rem;
  line-height: 1.4;
  transition: color .15s;
}
.article-toc .toc ul ul a:hover,
.article-toc .toc ul ul a.active { color: var(--green); }

.article-body {
  grid-area: body;
  padding: 1.5rem 2rem;
  font-size: 0.9rem;
  min-width: 0;
  color: var(--dim);
  line-height: 1.8;
  font-family: var(--font-sans);
}
.article-toc {
  font-family: var(--font-sans);
}
.article-body h1.post-title { display: none; }
.article-body .post-date-info { font-size: 0.72rem; color: var(--dim); margin-bottom: 1rem; }
.article-body h2 {
  color: var(--green);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 1.75rem 0 0.6rem;
  padding-bottom: 0.5rem;
  border-bottom: none;
  scroll-margin-top: calc(var(--site-header-h, 4.5rem) + 1rem + var(--article-scroll-nudge));
}
.article-body h2::after {
  content: '';
  display: block;
  height: 1px;
  margin-top: 0.45rem;
  background: repeating-linear-gradient(
    to right,
    var(--rule-dash) 0,
    var(--rule-dash) 5px,
    transparent 5px,
    transparent 9px
  );
  opacity: 0.75;
}
.article-body hr {
  border: none;
  margin: 1.75rem 0;
  height: 0;
  overflow: hidden;
  background: none;
}
.article-body hr::before {
  content: '# ───────────────────────────────────────────────────────────────────────────';
  display: block;
  font-size: 0.68rem;
  line-height: 1.3;
  color: #6a9955;
  white-space: nowrap;
  overflow: hidden;
  opacity: 0.8;
}
.article-body h3 {
  color: var(--amber);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
  scroll-margin-top: calc(var(--site-header-h, 4.5rem) + 1rem + var(--article-scroll-nudge));
}
.article-body p { margin-bottom: 0.9rem; }
.article-body ul,
.article-body ol { margin: 0.5rem 0 0.9rem; padding-left: 1.5rem; }
.article-body li { margin-bottom: 0.35rem; }
.article-body li > p { margin-bottom: 0.35rem; }
.article-body strong,
.article-body strong em,
.article-body em strong {
  color: var(--white);
  font-weight: 600;
  font-style: normal;
}
.article-body em { font-style: italic; }
.article-body a { color: var(--blue); }
.article-body code {
  background: var(--bg3);
  color: var(--green);
  padding: 2px 6px;
  border: 1px solid var(--border);
  font-size: 0.85em;
}
.article-body pre {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--green3);
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  overflow-x: auto;
  max-width: 100%;
  font-size: 0.8rem;
  line-height: 1.7;
}
.article-body .highlight {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--green3);
  margin: 1rem 0;
  overflow-x: auto;
  max-width: 100%;
  font-size: 0.8rem;
  line-height: 1.7;
}
.article-body .highlight pre {
  background: transparent;
  border: none;
  border-left: none;
  padding: 1rem 1.25rem;
  margin: 0;
}
.article-body pre code,
.article-body .highlight code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  color: var(--white);
}

.code-block-wrapper {
  position: relative;
  margin: 1rem 0;
  max-width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--green3);
  overflow-x: auto;
  font-size: 0.8rem;
  line-height: 1.7;
}
.code-block-wrapper > .highlight,
.code-block-wrapper > pre {
  background: transparent;
  border: none;
  margin: 0;
}
.code-block-wrapper pre {
  margin: 0 !important;
  background: transparent;
  border: none;
  border-left: none;
}
.copy-code-button {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  padding: 0.15rem 0.5rem;
  font-size: 0.68rem;
  line-height: 1.2;
  background: rgba(33, 38, 45, 0.92);
  color: var(--dim);
  border: 1px solid var(--border);
  cursor: pointer;
  opacity: 0;
  transition: opacity .2s, color .15s, border-color .15s, background .15s;
  z-index: 2;
  pointer-events: auto;
  white-space: nowrap;
}
.code-block-wrapper:hover .copy-code-button,
.copy-code-button:focus-visible {
  opacity: 1;
}
.copy-code-button:hover {
  color: var(--green);
  border-color: var(--green2);
  background: var(--bg2);
}

/* Pygments 语法高亮 — 终端深色主题 */
.highlight .hll { background: rgba(57, 211, 83, 0.12); }
.highlight .c,
.highlight .cm,
.highlight .c1,
.highlight .cs,
.highlight .ch { color: #6a9955; font-style: italic; }
.highlight .cp,
.highlight .gp { color: var(--dim); }
.highlight .k,
.highlight .kc,
.highlight .kd,
.highlight .kn,
.highlight .kr,
.highlight .kt { color: var(--green); font-weight: 600; }
.highlight .o,
.highlight .ow { color: var(--white); }
.highlight .p { color: var(--dim); }
.highlight .m,
.highlight .mb,
.highlight .mf,
.highlight .mh,
.highlight .mi,
.highlight .mo,
.highlight .il { color: var(--blue); }
.highlight .s,
.highlight .sa,
.highlight .sb,
.highlight .sc,
.highlight .dl,
.highlight .sd,
.highlight .s2,
.highlight .sh,
.highlight .s1,
.highlight .sr { color: var(--amber); }
.highlight .se { color: #e3b341; font-weight: 600; }
.highlight .si { color: #f0883e; font-weight: 600; }
.highlight .sx { color: var(--green2); }
.highlight .ss { color: #a5d6ff; }
.highlight .na { color: #7ee787; }
.highlight .nb,
.highlight .bp { color: var(--green2); }
.highlight .nc,
.highlight .nf,
.highlight .fm { color: var(--blue); }
.highlight .nn,
.highlight .ne { color: #ff7b72; font-weight: 600; }
.highlight .no { color: #ffa657; }
.highlight .nd { color: #d2a8ff; }
.highlight .ni { color: var(--dim); font-weight: 600; }
.highlight .nl { color: #e6edf3; }
.highlight .nt { color: var(--green); font-weight: 600; }
.highlight .nv,
.highlight .vc,
.highlight .vg,
.highlight .vi,
.highlight .vm { color: #79c0ff; }
.highlight .gd { color: var(--red); }
.highlight .gi { color: var(--green); }
.highlight .ge { font-style: italic; }
.highlight .gr { color: var(--red); }
.highlight .gh,
.highlight .gu { color: var(--blue); font-weight: 600; }
.highlight .go { color: var(--dim2); }
.highlight .gs { font-weight: 600; }
.highlight .gt { color: var(--blue); }
.highlight .w { color: transparent; }

.article-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.25rem auto;
  border: 1px solid var(--border);
}
.article-body p:has(> img:only-child) {
  text-align: center;
}

.article-body .table-scroll {
  overflow-x: auto;
  margin: 1rem 0;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}
.article-body .table-scroll table {
  margin: 0;
  min-width: 100%;
}

.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--green);
  z-index: 200;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(57, 211, 83, 0.45);
}

.back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: calc(100px + 1.25rem);
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--green);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.35rem);
  transition: opacity .2s, visibility .2s, transform .2s, border-color .15s, background .15s;
  z-index: 90;
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--bg3);
  border-color: var(--green2);
  color: var(--white);
}

.article-body blockquote {
  border-left: 2px dashed var(--rule-dash);
  padding: 0.5rem 1.25rem;
  margin: 1rem 0;
  color: var(--dim);
  font-style: italic;
  background: rgba(0, 109, 50, 0.04);
}
.article-body table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.82rem; }
.article-body th, .article-body td { border: 1px solid var(--border); padding: 0.5rem 0.75rem; }
.article-body td { color: var(--dim); }
.article-body th { background: var(--bg2); color: var(--white); font-weight: 600; }

.page-heading { padding: 1.25rem 1.5rem; border-bottom: 1px dashed var(--rule-fade); }
.page-heading h1 { color: var(--white); font-size: 1.2rem; font-weight: 600; margin-bottom: 0.35rem; }
.page-heading p { color: var(--dim); font-size: 0.75rem; }

.archive-year { padding: 1rem 1.5rem 0; }
.archive-year h2 { color: var(--green); font-size: 0.9rem; margin-bottom: 0.75rem; }
.archive-year h2 span { color: var(--dim); font-size: 0.72rem; font-weight: 300; }
.archive-month { margin-bottom: 1.25rem; }
.archive-month:last-child { margin-bottom: 0; }
.archive-month h3 {
  color: var(--dim);
  font-size: 0.78rem;
  font-weight: 400;
  margin: 0 0 0.35rem 0.5rem;
}
.archive-month h3 span { color: var(--border); font-size: 0.68rem; font-weight: 300; }
.archive-month-list { padding-top: 0; }

.page-heading--about .about-meta { margin-top: 0.15rem; }

.about-readme {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-bottom: 1px dashed var(--rule-fade);
}
.about-section {
  padding: 1.5rem;
  min-width: 0;
}
.about-section:first-child {
  border-right: 1px dashed var(--rule-fade);
}
.about-heading {
  color: var(--green);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.85rem;
}
.about-body p,
.about-desc {
  color: var(--dim);
  font-size: 0.85rem;
  line-height: 1.85;
  margin-bottom: 0.45rem;
}
.about-desc { margin-bottom: 0.65rem; }
.about-note {
  margin-top: 1.25rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--rule-fade);
  color: var(--dim2);
  font-size: 0.75rem;
  line-height: 1.65;
}
.about-note::before {
  content: "# ";
  color: var(--green3);
}
.about-contact { margin-top: 0.15rem; }
.about-contact-row {
  display: grid;
  grid-template-columns: 3.5rem 1rem minmax(0, 1fr);
  gap: 0 0.5rem;
  align-items: baseline;
  padding: 0.45rem 0;
  border-bottom: 1px dashed var(--rule-fade);
  font-size: 0.8rem;
}
.about-contact-row:last-child { border-bottom: none; }
.about-contact-key { color: var(--dim); white-space: nowrap; }
.about-contact-sep { color: var(--green2); text-align: center; }
.about-contact-val {
  color: var(--blue);
  text-decoration: none;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.about-contact-val:hover { text-decoration: underline; }

footer.site-footer {
  border-top: 1px dashed var(--rule-fade);
  padding: 1rem 1.5rem;
  font-size: 0.72rem;
  color: var(--dim2);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1.25rem;
  align-items: center;
}
footer.site-footer.site-footer--no-center {
  grid-template-columns: 1fr auto;
}
footer .footer-left {
  text-align: left;
  align-self: center;
}
footer .footer-center { text-align: center; }
footer .footer-right { text-align: right; }
footer a { color: var(--green); text-decoration: none; }
footer a:hover { text-decoration: underline; }

.footer-copy {
  color: var(--dim);
  line-height: 1.75;
  max-width: 36rem;
}
.footer-copy a { color: var(--dim); }
.footer-copy a:hover { color: var(--green); }
.footer-cc-icons {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  margin-left: 0.2rem;
  vertical-align: middle;
}
.footer-cc-icons img {
  width: 1.05em;
  height: 1.05em;
  opacity: 0.85;
  vertical-align: middle;
}
.footer-copy:hover .footer-cc-icons img { opacity: 1; }

.footer-links-block { line-height: 1.75; }
.footer-links-title {
  color: var(--dim);
  margin-bottom: 0.25rem;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  justify-content: center;
}
.footer-links a { color: var(--green); }

.footer-tech-lines {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  line-height: 1.55;
  color: var(--dim);
  white-space: nowrap;
}
.footer-tech-lines a { color: var(--dim); }
.footer-tech-lines a:hover { color: var(--green); }
#footer-online { color: var(--green); }

/* posts / archive：平板收紧表格列 */
@media (max-width: 1100px) {
  .post-row {
    grid-template-columns: 104px minmax(100px, 1.15fr) 96px minmax(140px, 1.6fr) 4.25rem;
    gap: 0 0.5rem;
    font-size: 0.78rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  .post-row.header > :nth-child(2),
  .post-arrow { display: none; }
  .list-header,
  .post-list,
  .archive-year { padding-left: 1.15rem; padding-right: 1.15rem; }
  .ls-filter { padding-left: 1.15rem; padding-right: 1.15rem; }
}

@media (max-width: 900px) {
  html { font-size: 14px; }

  .titlebar { padding: 0.35rem 1rem; font-size: 0.7rem; }
  .nav-bar { padding: 0 0.5rem; }
  .list-header,
  .post-list,
  .archive-year { padding-left: 1rem; padding-right: 1rem; }
  .post-list { padding-bottom: 1rem; }
  .nav-tab { padding: 0.45rem 0.75rem; font-size: 0.68rem; }
  .ascii-header {
    font-size: clamp(0.48rem, 2.8vw, 0.58rem);
    line-height: 1;
    padding: 1rem 1rem 0.35rem;
  }
  .tagline { padding: 0 1rem 0.75rem; font-size: 0.72rem; }
  .shell { padding: 1rem 1rem 0; }
  .stats {
    margin-bottom: 1rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stat {
    flex: none;
    padding: 0.5rem 0.65rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .stat:nth-child(odd) { border-right: 1px solid var(--border); }
  .stat:nth-last-child(-n+2) { border-bottom: none; }
  .home-recent-item {
    grid-template-columns: 96px 12px minmax(0, 1fr);
    gap: 0 0.45rem;
  }
  .search-bar { padding: 0.55rem 1rem; }
  .search-result-item {
    grid-template-columns: 96px 12px minmax(0, 1fr);
    padding: 0.45rem 1rem;
  }
  .search-result-cat { display: none; }
  .page-heading { padding: 1rem; }

  .article-header { padding: 1rem; }
  .article-title { font-size: 1.25rem; }
  .article-meta-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
  .article-layout,
  .article-layout--no-toc { grid-template-columns: 1fr; grid-template-areas: "body"; }
  .article-toc { display: none; }
  .article-body {
    padding: 1rem;
    font-size: 0.85rem;
  }
  .article-body h2 { font-size: 1.1rem; margin-top: 1.35rem; }
  .article-body h3 { font-size: 0.98rem; }
  .article-body pre,
  .article-body .highlight pre,
  .code-block-wrapper pre {
    padding: 0.75rem 0.85rem;
    font-size: 0.75rem;
  }
  .article-body p,
  .article-body li,
  .post-title,
  .post-cat,
  .footer-copy {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  .post-cat { white-space: normal; }
  .article-body code { font-size: 0.82em; }
  .article-body table { font-size: 0.75rem; }
  .article-body th,
  .article-body td { padding: 0.4rem 0.55rem; }

  .back-to-top {
    right: 0.85rem;
    bottom: calc(50px + 0.85rem);
    width: 1.9rem;
    height: 1.9rem;
    font-size: 0.9rem;
  }

  .list-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
  }
  .list-cmd { line-height: 1.45; }

  .ls-filter {
    gap: 0.2rem 0.55rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }
  .ls-cmd {
    font-size: 0.68rem;
    padding: 0.3rem 0.1rem;
  }

  .page-heading h1 {
    font-size: 1rem;
    line-height: 1.45;
  }
  .page-heading p { font-size: 0.72rem; }

  .archive-year {
    padding-left: 0;
    padding-right: 0;
    padding-top: 0.85rem;
  }
  .archive-year h2 {
    font-size: 0.85rem;
    padding: 0 1rem 0.35rem;
    margin-bottom: 0.5rem;
  }
  .archive-month { margin-bottom: 1rem; }
  .archive-month h3 {
    margin: 0 0 0.25rem;
    padding: 0 1rem;
    font-size: 0.74rem;
  }
  .archive-month-list {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .post-list { min-width: 0; }
  .post-row:not(.header) {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "date read"
      "title title"
      "cat cat"
      "tags tags";
    gap: 0.18rem 0.65rem;
    padding: 0.7rem 0.35rem;
    border-bottom: 1px dashed var(--rule-fade);
    border-radius: 0;
    max-width: 100%;
  }
  .post-row:not(.header):last-child { border-bottom: none; }
  .post-row:not(.header):hover { background: none; }
  .post-row:not(.header):active { background: var(--bg2); }
  .post-row:not(.header) .post-date { grid-area: date; font-size: 0.72rem; }
  .post-row:not(.header) .post-arrow { display: none; }
  .post-row:not(.header) .post-title {
    grid-area: title;
    font-size: 0.9rem;
    line-height: 1.4;
    padding: 0.1rem 0;
  }
  .post-row:not(.header) .post-cat {
    grid-area: cat;
    font-size: 0.68rem;
    opacity: 0.92;
  }
  .post-row:not(.header) .post-tags {
    grid-area: tags;
    margin-top: 0.1rem;
    gap: 0.2rem 0.3rem;
  }
  .post-row:not(.header) .post-time {
    grid-area: read;
    justify-self: end;
    align-self: baseline;
    padding-top: 0;
    font-size: 0.68rem;
  }
  .post-row.header { display: none; }
  .tag-chip { font-size: 0.58rem; padding: 1px 5px; }
  .about-readme { grid-template-columns: 1fr; }
  .about-section { padding: 1.25rem 1rem; }
  .about-section:first-child {
    border-right: none;
    border-bottom: 1px dashed var(--rule-fade);
  }
  .about-contact-row {
    grid-template-columns: 3.25rem 0.85rem minmax(0, 1fr);
    gap: 0 0.4rem;
  }
  footer.site-footer { grid-template-columns: 1fr; text-align: center; }
  footer.site-footer.site-footer--no-center { grid-template-columns: 1fr; }
  footer .footer-left,
  footer .footer-right { text-align: center; }
  .footer-copy { max-width: none; }
  .footer-tech-lines { white-space: normal; align-items: center; }
  .footer-links { justify-content: center; }
  .search-hint { display: none; }
}

@media (max-width: 600px) {
  .titlebar-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
  }
  .stats { grid-template-columns: 1fr; }
  .stat {
    border-right: none !important;
    border-bottom: 1px solid var(--border);
  }
  .stat:last-child { border-bottom: none; }
  .home-recent-item {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
  .home-recent-title {
    width: auto;
    min-width: 0;
  }
  .home-recent-date { font-size: 0.72rem; }
  .home-recent-arrow { display: none; }
  .article-title { font-size: 1.1rem; }

  .list-header,
  .post-list,
  .archive-month-list { padding-left: 0.85rem; padding-right: 0.85rem; }
  .page-heading,
  .archive-year h2,
  .archive-month h3 { padding-left: 0.85rem; padding-right: 0.85rem; }
  .ls-filter { padding-left: 0.85rem; padding-right: 0.85rem; }
  .search-bar { padding-left: 0.85rem; padding-right: 0.85rem; }

  .post-row:not(.header) {
    padding: 0.65rem 0.15rem;
    gap: 0.15rem 0.5rem;
  }
  .post-row:not(.header) .post-title { font-size: 0.86rem; }
}
