/* Studio 宋韵 — restrained, neutral typography for essays and long-form reading. */
:root {
  --link: #343330;
  --link-hover: #050505;
  --text: #252421;
  --muted: #74716b;
  --line: #d9d6cf;
  --line-strong: #bbb7ae;
  --surface: #fbfaf7;
  --surface-soft: #efede7;
  --page: #f5f3ee;
  --nav-bg: #20201e;
  --shadow: 0 14px 36px rgba(28, 27, 24, .07);
  --studio-serif: "Songti SC", STSong, "Source Han Serif SC", "Source Han Serif CN", "Noto Serif CJK SC", SimSun, Georgia, serif;
  --studio-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

:root[data-theme="dark"] {
  --link: #d8d5cf;
  --link-hover: #fff;
  --text: #e3e0da;
  --muted: #9b9891;
  --line: #3c3b37;
  --line-strong: #5c5a54;
  --surface: #211f1c;
  --surface-soft: #2a2824;
  --page: #181715;
  --nav-bg: #111110;
  --shadow: 0 16px 42px rgba(0, 0, 0, .28);
}

body {
  background: var(--page);
  color: var(--text);
  font-family: var(--studio-serif);
  text-rendering: optimizeLegibility;
}
::selection { background: #d9d5cc; color: #171614; }
:focus-visible { outline-color: color-mix(in srgb, var(--text) 32%, transparent); }

/* A quiet, typographic masthead that reads as part of the essay page. */
.navbar {
  min-height: 76px;
  margin-bottom: 44px;
  border-bottom: 1px solid var(--line);
  background: var(--page);
}
.nav-shadow { box-shadow: none; }
.navbar > .container { min-height: 76px; }
.navbar-item, .navbar-link, .nav-group-label {
  color: var(--muted);
  font-family: var(--studio-serif);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: .055em;
}
.navbar-item.site-brand {
  display: inline-flex;
  align-items: center;
  color: var(--text) !important;
  font-family: var(--studio-serif);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: .045em;
}
.navbar-item:hover, .navbar-link:hover, .navbar-item:focus, .navbar-link:focus,
.navbar-item.has-dropdown:hover .navbar-link { background: transparent !important; color: var(--text) !important; }
.navbar-start > .navbar-item:not(.has-dropdown):hover,
.navbar-start > .navbar-item:not(.has-dropdown):focus,
.nav-group-label:hover,
.nav-group-label:focus { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .32em; }
/* Keep the dropdown cue as quiet as the masthead, including dark/hover states. */
.nav-group-label.navbar-link:not(.is-arrowless)::after {
  width: .4em;
  height: .4em;
  margin-top: -.3em;
  border-width: 0 0 1px 1px;
  border-radius: 0;
  border-color: currentColor;
}
.navbar-dropdown { border: 1px solid var(--line); border-radius: 2px; background: var(--surface); box-shadow: var(--shadow); }
.navbar-dropdown .navbar-item, .navbar-burger { color: var(--muted); }
.navbar-dropdown .navbar-item:hover, .navbar-dropdown .navbar-item:focus { background: var(--surface-soft) !important; }
.theme-toggle { border-color: var(--line-strong); background: transparent; color: var(--muted); }
.theme-toggle:hover { border-color: var(--text); background: transparent; color: var(--text); }

#content-wrap { padding-bottom: 6rem; }
#content-wrap > .container { max-width: 1160px; }
.index-layout { gap: 42px; }
.page-card-list { display: block; margin: 0; }
.index-page-box {
  margin: 0 !important;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 28px 4px 30px;
}
.index-page-box:hover { border-color: var(--line-strong); box-shadow: none; transform: none; }
.box article.index-page-media { background: transparent; padding: 0; }
.content h2.page-card-title {
  max-width: 30em;
  margin: 0 0 9px;
  font-family: var(--studio-serif);
  font-size: 1.42rem;
  font-weight: 600;
  letter-spacing: .015em;
  line-height: 1.48;
}
.page-card-title a, .page-card-title a:hover { color: var(--text); }
.page-card-title a:hover { text-decoration: underline !important; text-decoration-thickness: 1px !important; text-underline-offset: .2em; }
.page-card-meta { gap: 8px; }
.tag:not(body), .page-card-meta .tag {
  height: auto;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  color: var(--muted) !important;
  padding: 0;
  font-family: var(--studio-sans);
  font-size: .7rem;
  font-weight: 400;
  letter-spacing: .025em;
}
.page-card-meta .tag + .tag::before { content: "·"; margin-right: 8px; color: var(--line-strong); }
.page-card-text {
  max-width: 44em;
  margin-top: 15px;
  color: var(--muted);
  font-family: var(--studio-serif);
  font-size: .96rem;
  line-height: 1.85;
}

.index-sidebar { margin-top: 0; }
.index-sidebar .card, .notice {
  overflow: visible;
  border: 0;
  border-top: 2px solid var(--text);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.sidebar-title { border-bottom: 1px solid var(--line); background: transparent; color: var(--text); font-family: var(--studio-serif); font-size: .98rem; font-weight: 600; }
.sidebar-content, .notice { color: var(--muted); font-family: var(--studio-serif); font-size: .9rem; line-height: 1.85; }
.sidebar-content { padding: 15px 0 0; }
.brand-image { margin-top: 16px; border-radius: 2px; filter: saturate(.72) contrast(.96); }
.notice { margin-top: 34px; padding: 18px 0 0; }
.notice .notice-image-fallback { border-left-color: var(--line-strong); background: transparent; color: var(--muted); font-family: var(--studio-sans); letter-spacing: .015em; }
.profile-card-content { padding: 24px 0 2px; }
.profile-header { align-items: center; gap: 16px; }
.profile-avatar { width: 76px; height: 76px; flex-basis: 76px; border-color: var(--line); border-radius: 50%; background: var(--surface-soft); font-family: var(--studio-serif); filter: saturate(.82) contrast(.98); }
.profile-identity { display: grid; gap: 4px; }
.profile-site { margin: 0; font-family: var(--studio-sans); font-size: .64rem; letter-spacing: .14em; line-height: 1.45; }
.profile-name { font-family: var(--studio-serif); font-size: 1.32rem; font-weight: 600; letter-spacing: .035em; line-height: 1.35; }
.profile-bio { margin-top: 22px; color: var(--muted); font-family: var(--studio-serif); font-size: .92rem; letter-spacing: .015em; line-height: 1.95; }

/* Reading pages keep the text measure and type scale deliberately narrow. */
.article-container { line-height: 1.9; }
.article-container.article-container-wide { max-width: 1120px; }
#article { max-width: 740px; }
article { color: var(--text); font-family: var(--studio-serif); font-size: 16.5px; line-height: 1.9; }
.title.page-title {
  max-width: 18em;
  margin-bottom: .7rem;
  color: var(--text);
  font-family: var(--studio-serif);
  font-size: clamp(1.85rem, 3.2vw, 2.48rem);
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.45;
}
.article-summary {
  max-width: 42em;
  margin-bottom: 17px;
  color: var(--muted);
  font-family: var(--studio-serif);
  font-size: .98rem;
  line-height: 1.85;
}
.info { margin-bottom: 38px; border-bottom: 1px solid var(--line); padding-bottom: 18px; font-family: var(--studio-sans); font-size: .7rem; line-height: 1.8; }
.article-content, .protected-content { color: var(--text); font-family: var(--studio-serif); font-size: 16.5px; line-height: 1.95; }
.article-content p, .protected-content p { margin-bottom: 1.35em; }
.article-content h1, .article-content h2, .article-content h3, .article-content h4, .article-content h5, .article-content h6,
.protected-content h1, .protected-content h2, .protected-content h3, .protected-content h4, .protected-content h5, .protected-content h6 {
  color: var(--text);
  font-family: var(--studio-serif);
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.55;
}
.article-content h2, .protected-content h2 { border: 0; padding-bottom: 0; font-size: 1.45em; }
.article-content h3, .protected-content h3 { font-size: 1.2em; }
.article-content a, .protected-content a { color: var(--link); text-decoration: underline; text-decoration-color: var(--line-strong); text-decoration-thickness: 1px; text-underline-offset: .22em; }
.article-content a:hover, .protected-content a:hover { color: var(--link-hover); text-decoration-color: currentColor; }
.article-content strong, .protected-content strong { color: var(--text); }
.article-content blockquote, .protected-content blockquote {
  border-left: 2px solid var(--line-strong);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: .15em 0 .15em 1.35em;
}
.article-content hr, .protected-content hr { width: 5em; height: 1px; margin: 3em auto; background: var(--line-strong); }
.article-content :not(pre) > code, .protected-content :not(pre) > code { background: var(--surface-soft); color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.article-content pre, .protected-content pre { border: 1px solid #3a3936; border-radius: 3px; background: #1d1d1b; color: #ddd9d2; }
.article-content pre code, .protected-content pre code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.article-content table th, .protected-content table th { background: var(--surface-soft); color: var(--text); }
.article-content table th, .article-content table td, .protected-content table th, .protected-content table td { border-color: var(--line); }
.code-copy-button { border-color: #56544f; border-radius: 2px; background: #292825; color: #cbc7bf; }
.copyright { border-left: 2px solid var(--line-strong); border-radius: 0; background: transparent; color: var(--muted); font-family: var(--studio-serif); }

.toc { top: 88px; border: 0; border-top: 2px solid var(--text); border-radius: 0; background: transparent; padding: 18px 0; }
.toc-title { color: var(--text); font-family: var(--studio-serif); }
.related-container a, #toc a { color: var(--muted); font-family: var(--studio-serif); font-size: .78rem; }
.related-container a.is-current { background: var(--surface-soft); color: var(--text); }
.pagination:not(.article-pagination) a {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font-family: var(--studio-serif);
}
.pagination:not(.article-pagination) a:hover { background: transparent; color: var(--text); text-decoration: underline !important; text-underline-offset: .25em; }
.article-pagination { gap: 28px; margin-top: 42px; }
.article-pagination .pagination-previous, .article-pagination .pagination-next {
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 12px 2px;
}
.article-pagination a:hover { background: transparent; }
.article-pagination a:hover .page-nav-title { color: var(--text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .22em; }
.article-pagination .page-nav-title { font-family: var(--studio-serif); }

.archive-container { max-width: 980px; margin: 0 auto; }
.archive-title { color: var(--text); font-family: var(--studio-serif); font-size: 1.9rem; font-weight: 600; }
.archive-container .table-container { overflow: hidden; border: 1px solid var(--line); border-radius: 2px; background: transparent; box-shadow: none; }
.archive-container .table { background: transparent; color: var(--text); }
.archive-container .table th { background: var(--surface-soft); color: var(--muted); font-family: var(--studio-sans); font-size: .68rem; letter-spacing: .06em; }
.archive-container .table td { border-color: var(--line); font-family: var(--studio-serif); }
.archive-container .table.is-hoverable tbody tr:not(.is-selected):hover { background: var(--surface-soft); }
.message-panel, .notification.is-light { border: 1px solid var(--line); border-radius: 2px; background: transparent; color: var(--text); }

.microblog-page { max-width: 640px; }
.microblog-header .title { color: var(--text); font-family: var(--studio-serif); font-size: 2rem; }
.microblog-header .subtitle { font-family: var(--studio-serif); font-size: .95rem; }
.microblog-stream { gap: 0; border-top: 1px solid var(--line); }
.micro-post { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; padding: 26px 2px; }
.micro-post-content { color: var(--text); font-family: var(--studio-serif); font-size: 16.5px; line-height: 1.95; }
.micro-post footer { border-top: 0; padding-top: 4px; font-family: var(--studio-sans); }
.microblog-new-button { background: #262522; color: #fff; }
.microblog-loader .button { border: 1px solid var(--line); border-radius: 2px; background: transparent; color: var(--text); box-shadow: none; }

.link-entry { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; box-shadow: none; }
.link-entry-title { color: var(--text); font-family: var(--studio-serif); }
.protected-page { border-color: var(--line); border-radius: 2px; background: var(--surface); }
.input, .button { border-radius: 2px; }
.button { font-family: var(--studio-sans); font-weight: 500; }

#footer { border-top: 1px solid var(--line); background: transparent; }
#footer p { color: var(--muted); font-family: var(--studio-serif); font-size: .72rem; }

:root[data-theme="dark"] .box,
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .table,
:root[data-theme="dark"] .notification,
:root[data-theme="dark"] .protected-page { background: transparent; color: var(--text); }
:root[data-theme="dark"] .article-content blockquote,
:root[data-theme="dark"] .protected-content blockquote { background: transparent; color: var(--muted); }
:root[data-theme="dark"] .article-content :not(pre) > code,
:root[data-theme="dark"] .protected-content :not(pre) > code { background: var(--surface-soft); color: var(--text); }

@media screen and (max-width: 1023px) {
  .navbar, .navbar > .container { min-height: 68px; }
  .navbar-menu { border-top: 1px solid var(--line); background: var(--page); box-shadow: 0 18px 30px rgba(28, 27, 24, .08); }
  .navbar-dropdown { border: 0; box-shadow: none; }
  .index-layout { gap: 16px; }
  .index-sidebar { padding-top: 36px; }
  .toc { position: static; border-top: 1px solid var(--line); padding: 20px 0 0; }
}

@media screen and (min-width: 1024px) {
  .index-layout > .index-sidebar { width: 280px; flex-basis: 280px; }
}

@media screen and (max-width: 768px) {
  .navbar { margin-bottom: 22px; }
  .site-brand { padding-left: 14px; }
  .index-layout > .column { padding-inline: 18px; }
  .index-page-box { padding: 23px 0 25px; }
  .content h2.page-card-title { font-size: 1.3rem; line-height: 1.5; }
  .page-card-text { font-size: .94rem; }
  .article-container { padding-inline: 20px; }
  .title.page-title { font-size: 1.8rem; line-height: 1.48; }
  .article-summary { font-size: .95rem; }
  .article-content, .protected-content, article { font-size: 16px; line-height: 1.92; }
  .article-content pre, .protected-content pre { margin-inline: -4px; }
  .archive-title { font-size: 1.65rem; }
  .microblog-header .title { font-size: 1.75rem; }
  .micro-post { padding: 23px 0; }
  .micro-post-content { font-size: 16px; }
  .article-pagination { gap: 14px; margin-top: 34px; }
}
