@font-face {
  font-family: "Noto Serif SC";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/noto-serif-sc-lede.woff2") format("woff2");
}
:root {
  color-scheme: light;
  --page: #fdfdfe;
  --ink: #15171d;
  --muted: #56606e;
  --surface: #f3f6fa;
  --surface-hover: #edf3fc;
  --surface-active: #e5edfb;
  --selected: #171b24;
  --on-ink: #fcfdff;
  --reader-prose: #303641;
  --accent: #2659bb;
  --accent-hover: #174aaa;
  --accent-soft: #ebf3ff;
  --accent-on-soft: #2051a0;
  --warm: #a7422e;
  --warm-soft: #fff1eb;
  --chip: #f0f3f8;
  --chip-text: #475164;
  --focus: #2d62ca;
  --elevated: #ffffff;
  --feature: #fff;
  --feature-shadow: 0 4px 24px #243d6610, 0 1px 4px #19356508;
  --key-shadow: #c1d3ed;
  --popover-shadow: 0 9px 32px #23467b16, 0 2px 6px #142b4d0c;
  --backdrop: #18294348;
  --code-bg: #f3f7fe;
  --code-text: #1e304b;
  --code-muted: #526480;
  --code-control: #e3edfd;
  --code-control-hover: #d4e5ff;
  --syntax-key: #274fbb;
  --syntax-string: #9a3e23;
  --syntax-number: #834194;
  --syntax-comment: #53687e;
  --sans: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: "Noto Serif SC", "Songti SC", SimSun, serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #1d1e22;
  --ink: #cdd1d8;
  --muted: #999faa;
  --surface: #26282d;
  --surface-hover: #30333b;
  --surface-active: #363b45;
  --selected: #394253;
  --on-ink: #d0d8e5;
  --reader-prose: #b8bdc6;
  --accent: #98afcf;
  --accent-hover: #b2c3dc;
  --accent-soft: #2b3442;
  --accent-on-soft: #b1c0d5;
  --warm: #bea28f;
  --warm-soft: #332d2a;
  --chip: #2b2e35;
  --chip-text: #aeb5c1;
  --focus: #a6bad5;
  --elevated: #2a2c32;
  --feature: #27292f;
  --feature-shadow: 0 5px 22px #10111418;
  --key-shadow: #454d5d;
  --popover-shadow: 0 10px 28px #10111455;
  --backdrop: #10111499;
  --code-bg: #191b20;
  --code-text: #b9c0cb;
  --code-muted: #969fab;
  --code-control: #2d323b;
  --code-control-hover: #3a404c;
  --syntax-key: #a3b7d0;
  --syntax-string: #c1ad97;
  --syntax-number: #b6a6bd;
  --syntax-comment: #919ba6;
}
::selection { background: var(--accent-on-soft); color: var(--page); }
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.7 var(--sans);
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { color: inherit; font: inherit; min-height: 44px; min-width: 0; max-width: 100%; }
button { background: transparent; border: 0; cursor: pointer; min-width: 44px; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
/* Route changes focus this reading container; only interactive controls need a ring. */
main:focus { outline: none; }
.sr, .skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.skip:focus { position: fixed; top: 12px; left: 12px; z-index: 10; max-width: calc(100% - 24px); background: var(--elevated); padding: 10px 16px; border-radius: 6px; }
.head-inner, main, .site-foot { width: min(896px, calc(100% - 64px)); margin-inline: auto; }
.head-inner, .brand, nav, .hello, .section-top, .chips, .card-head,
.row-meta, .site-foot, .read-link { display: flex; align-items: center; }
.head-inner { min-height: 76px; gap: 9px; }
.brand { gap: 9px; min-height: 44px; min-width: 44px; font-size: 21px; font-weight: 630; letter-spacing: .03em; }
.brand img { display: block; }
.brand, .brand span, nav a { white-space: nowrap; }
nav { margin-left: auto; gap: 2px; }
.site-head nav a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; }
nav a { padding: 6px 13px; color: var(--muted); border-radius: 10px; font-size: 14px; }
nav a[aria-current], nav a:hover { background: var(--surface); color: var(--accent); }
nav a[aria-current] { font-weight: 600; }
.search-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  min-width: 44px;
  width: auto;
  padding: 0 8px 0 10px;
  border-radius: 11px;
  flex: none;
}
.search-kbd {
  display: inline-grid;
  place-items: center;
  height: 20px;
  padding: 0 5px;
  border-radius: 5px;
  background: var(--elevated);
  color: var(--accent);
  font: 11px/1 var(--mono);
  box-shadow: 0 2px 0 var(--key-shadow);
}
.search-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.search-button:hover { background: var(--surface-hover); }

main { min-height: 60vh; min-width: 0; }
.hello { justify-content: space-between; gap: 24px; padding: 46px 12px 51px 0; }
.hello h1, .page-title {
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: -.025em;
}
.cursor { display: inline-block; width: .18em; height: .69em; margin-left: .16em; background: var(--accent); vertical-align: -.02em; }
.hello p { font: 17px/1.9 var(--serif); margin-top: 13px; color: var(--reader-prose); }
.hello img { flex: none; width: clamp(154px, 19vw, 214px); height: auto; }
.section-top { justify-content: space-between; flex-wrap: wrap; gap: 16px; margin: 14px 0 18px; }
.section-top h2 { font-size: 20px; letter-spacing: .02em; font-weight: 600; }
.featured-section { margin: 0 0 32px; }
.featured-section > h2 { margin-bottom: 18px; font-size: 20px; font-weight: 600; }
.featured-posts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 16px; list-style: none; margin: 0; padding: 0; }
.featured-posts > li { min-width: 0; }
.featured-card { display: block; height: 100%; padding: 18px; border-radius: 12px; background: var(--surface); overflow-wrap: anywhere; }
.featured-card:hover { background: var(--surface-hover); }
.featured-card h3 { margin-top: 6px; font-size: 18px; line-height: 1.55; }
.featured-card p { margin-top: 8px; color: var(--reader-prose); font-size: 14px; line-height: 1.8; }
.chips { padding: 2px; gap: 3px; border-radius: 24px; }
.chips button { border-radius: 20px; font-size: 13px; color: var(--muted); padding: 5px 14px; line-height: 1.55; }
.chips button:hover { color: var(--ink); background: var(--surface-hover); }
.chips button[aria-pressed=true] { color: var(--on-ink); background: var(--selected); }
#posts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 28px; list-style: none; margin: 0; padding: 0; }
#posts > li { display: flex; min-width: 0; }
#posts > li.latest { grid-column: 1 / -1; }
#posts > li > .post-row { flex: 1; width: 100%; }
.post-row {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 20px 17px;
  border-radius: 15px;
  background: transparent;
  transition: transform .16s;
}
.post-link::after { content: ""; position: absolute; inset: 0; border-radius: 15px; }
.post-link:focus-visible::after { outline: 3px solid var(--focus); outline-offset: 3px; }
.post-tags { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; min-width: 0; }
.post-tag { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; max-width: 100%; position: relative; z-index: 1; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.post-tag:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.row-meta { min-width: 0; flex-wrap: wrap; }
.tag-filter { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: 12px 0 20px; color: var(--muted); font-size: 14px; }
.tag-filter[hidden] { display: none; }
.current-tag { color: var(--ink); overflow-wrap: anywhere; }
.tag-filter a { color: var(--accent); text-decoration: underline; text-underline-offset: 4px; }
.list-pagination { justify-content: center; flex-wrap: wrap; gap: 12px; margin: 24px 0 0; font-size: 13px; }
.list-pagination[hidden] { display: none; }
.list-pagination a { background: var(--surface); color: var(--accent); }
.list-pagination a, .tag-filter a, .site-foot a { display: inline-flex; align-items: center; min-height: 44px; }
.site-foot a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.list-page-info { color: var(--muted); }
.tags-intro { margin-top: 10px; color: var(--reader-prose); }
.tags-status { margin-top: 24px; color: var(--muted); font-size: 13px; }
.tag-cloud { display: flex; align-items: baseline; flex-wrap: wrap; gap: 16px 22px; margin-top: 24px; }
.tag-cloud-link { min-height: 44px; min-width: 44px; max-width: 100%; padding: 5px 8px; border-radius: 8px; background: var(--surface); color: var(--accent); overflow-wrap: anywhere; }
.tag-cloud-link:hover { background: var(--surface-hover); }
.tag-cloud-link[data-weight="1"] { font-size: 14px; }
.tag-cloud-link[data-weight="2"] { font-size: 17px; }
.tag-cloud-link[data-weight="3"] { font-size: 20px; font-weight: 500; }
.tag-cloud-link[data-weight="4"] { font-size: 23px; font-weight: 550; }
.tag-cloud-link[data-weight="5"] { font-size: 26px; font-weight: 600; }
.tag-count { color: var(--muted); font-size: 12px; font-weight: 400; white-space: nowrap; }
@media (hover:hover) {
  .post-row:hover { background: var(--surface-hover); transform: translateY(-2px); }
}
.card-head { justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.row-meta { gap: 8px; font-size: 12px; color: var(--muted); }
.type-chip, .latest-label, .pinned-label {
  display: inline-block;
  border-radius: 5px;
  font: 500 11px/1.6 var(--sans);
  letter-spacing: .03em;
  padding: 2px 7px;
}
.type-chip { background: var(--accent-soft); color: var(--accent-on-soft); }
.pinned-label { background: var(--accent-soft); color: var(--accent-on-soft); }
.latest-label { display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); color: var(--accent-on-soft); }
.latest-label::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.row-date { flex: none; font: 12px/1.4 var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.card-copy h3 { font-size: clamp(18px, 1.45vw, 20px); line-height: 1.55; font-weight: 600; text-wrap: balance; }
.card-copy p { color: var(--reader-prose); font-size: 14px; line-height: 1.8; margin-top: 6px; }
.post-row.latest { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 26px; margin-bottom: 10px; padding: 25px 28px 27px; background: var(--feature); box-shadow: var(--feature-shadow); }
.latest .card-head { grid-column: 1/-1; }
.latest .read-link { align-self: center; white-space: nowrap; }
.post-row.latest:hover { background: var(--feature); }
.latest h3 { font-size: clamp(21px, 2vw, 27px); font-weight: 600; letter-spacing: -.018em; }
.read-link { color: var(--accent); align-self: flex-start; gap: 8px; margin-top: 3px; font-size: 13px; font-weight: 550; }
.enter-key {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 20px;
  border-radius: 5px;
  background: var(--elevated);
  color: var(--accent);
  font: 16px/1 var(--mono);
  box-shadow: 0 2px 0 var(--key-shadow);
}
.latest:active .enter-key { transform: translateY(2px); box-shadow: none; }
.site-foot { padding: 32px 0; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--muted); }
.site-foot i { font-style: normal; padding: 0 4px; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; }

/* Reading, archive and search share the same neutral surfaces. */
.inner { max-width: 740px; margin: 52px auto 64px; }
.inner .lede { margin: 12px 0 34px; color: var(--muted); }
.back { display: inline-flex; align-items: center; min-height: 44px; background: var(--surface); border-radius: 9px; padding: 6px 12px; font-size: 14px; margin-bottom: 22px; }
.back:hover, .search-result:hover { background: var(--surface-hover); }
.inner h2 { font-size: 22px; font-weight: 580; margin: 32px 0 10px; }
.about p { font-size: 17px; line-height: 1.95; color: var(--reader-prose); margin-block: 12px; }
.about { max-width: 660px; }
.about .page-title { margin-bottom: 23px; }
.now-updated { margin: 12px 0 28px; color: var(--muted); font-size: 14px; }
.now-page .markdown { margin-top: 28px; }
.now-page .markdown p { margin-block: 16px; color: var(--reader-prose); }
.now-page .markdown a { color: var(--accent); text-decoration: underline; text-underline-offset: .2em; }
.now-page .markdown pre { max-width: 100%; overflow-x: auto; padding: 16px; border-radius: 10px; background: var(--code-bg); font: 13px/1.8 var(--mono); overscroll-behavior-x: contain; }
.now-page .now-source { white-space: pre-wrap; overflow-wrap: anywhere; }
.series-status, .series-updated { color: var(--muted); font-size: 14px; }
.series-status { margin: 12px 0 24px; }
.series-list, .series-posts { list-style: none; padding: 0; }
.series-list li, .series-posts li { padding: 18px 0; border-bottom: 1px solid var(--surface-active); overflow-wrap: anywhere; }
.series-link, .series-post-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 18px; }
.series-name, .series-post-link { font-weight: 600; }
.series-count { color: var(--muted); font-size: 14px; }
.series-updated { display: block; }
.series-posts p { color: var(--muted); margin: 6px 0 0; }
.series-link:hover, .series-post-link:hover { color: var(--accent); }
.links-intro { margin: 12px 0 28px; color: var(--muted); }
.links-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; padding: 0; list-style: none; }
.links-list li { min-width: 0; }
.link-card { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 14px; height: 100%; padding: 20px; border: 1px solid var(--surface-active); border-radius: 14px; background: var(--feature); }
.link-card:hover { background: var(--surface-hover); }
.link-avatar { position: relative; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-on-soft); font-size: 22px; }
.link-avatar img { position: absolute; inset: 0; width: 48px; height: 48px; border-radius: inherit; object-fit: cover; background: var(--accent-soft); }
.link-copy { min-width: 0; }
.link-name { display: block; font-size: 18px; font-weight: 600; }
.link-description { display: block; margin-top: 6px; color: var(--muted); font-size: 14px; }

@media (max-width: 660px) {
  .head-inner, main, .site-foot { width: calc(100% - 36px); }
  .head-inner { min-height: 64px; gap: 5px; }
  nav a { padding: 5px 9px; font-size: 13px; }
  .brand { font-size: 19px; gap: 6px; }
  .brand img { width: 28px; height: 28px; }
  .search-button { width: 44px; height: 44px; padding: 0; gap: 0; }
  .search-kbd { display: none; }
  .hello { padding: 33px 0 30px; gap: 10px; }
  .hello h1 { font-size: clamp(21px, 5.8vw, 28px); }
  .hello p { font-size: 14px; line-height: 1.85; margin-top: 10px; }
  .hello p br { display: none; }
  .hello img { width: 25%; max-width: 120px; }
  .section-top { margin: 9px 0 14px; }
  .section-top h2 { font-size: 18px; }
  .chips button { padding: 5px 10px; }
  #posts { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .post-row { gap: 9px; padding: 14px 4px; }
  .post-row.latest { display: flex; align-items: stretch; gap: 10px; padding: 18px; margin: 0 0 3px; }
  .latest .read-link { align-self: flex-start; }
  .card-copy p { font-size: 13px; }
  .row-date { font-size: 11px; }
  .site-foot { font-size: 11px; }
  .inner { margin: 35px auto 45px; }
  .about p { font-size: 16px; }
}
.post-row[data-category="随笔"] .type-chip, .reader-meta[data-category="随笔"] .type-chip {
  background: var(--warm-soft);
  color: var(--warm);
}
.post-row:hover h3, .search-result:hover { color: var(--accent-hover); }
.theme-picker { position: relative; }
.theme-trigger {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 11px;
}
.theme-trigger svg { width: 18px; height: 18px; }
.theme-trigger:hover, .theme-trigger[aria-expanded="true"] { color: var(--accent); background: var(--accent-soft); }
.theme-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 5;
  padding: 7px;
  width: 156px;
  border-radius: 14px;
  background: var(--elevated);
  box-shadow: var(--popover-shadow);
}
.theme-menu[hidden] { display: none; }
.theme-caption { margin: 3px 9px 5px; font-size: 12px; color: var(--muted); }
.theme-option { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border-radius: 8px; text-align: left; font-size: 14px; }
.theme-option[aria-checked="true"] { background: var(--accent-soft); color: var(--accent-on-soft); }
.theme-option:hover { background: var(--surface-hover); }
.theme-check { margin-left: auto; color: var(--accent); }
.theme-option[aria-checked="false"] .theme-check { visibility: hidden; }
@media (max-width: 660px) {
  .head-inner { column-gap: 4px; }
}
@media (max-width: 540px) {
  .head-inner { flex-wrap: wrap; padding-block: 8px; }
  .brand { margin-right: auto; }
  .site-head nav { order: 3; width: 100%; margin-left: 0; gap: 0; flex-wrap: wrap; }
  .site-head nav a { flex: 1; padding-inline: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .post-row { transition: none; }
  .post-row:hover { transform: none; }
}
