:root {
  color-scheme: light;
  --link: #3273dc;
  --link-hover: #2366d1;
  --text: #24292f;
  --muted: #738292;
  --line: #e7e9ec;
  --surface: #ffffff;
  --surface-soft: #f6f7f8;
  --page: #fafafa;
  --nav-bg: rgba(255, 255, 255, .96);
  --shadow: 0 .5em 1em -.125em rgba(10, 10, 10, .08), 0 0 0 1px rgba(10, 10, 10, .02);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --link: #78a9ff;
  --link-hover: #a8c7ff;
  --text: #dce4ec;
  --muted: #97a5b4;
  --line: #303945;
  --surface: #181d23;
  --surface-soft: #20262e;
  --page: #101419;
  --nav-bg: rgba(18, 23, 29, .96);
  --shadow: 0 .5em 1.4em -.125em rgba(0, 0, 0, .38), 0 0 0 1px rgba(255, 255, 255, .025);
}

html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: Verdana, Candara, Arial, Helvetica, "Microsoft YaHei", sans-serif;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: none !important; }
img { max-width: 100%; max-height: 100%; height: auto; }
code { font-family: "JetBrains Mono", "Cascadia Code", Consolas, "Microsoft YaHei", monospace; }
::selection { background: #dbe8fb; color: #1b3d6f; }
:focus-visible { outline: 3px solid rgba(50, 115, 220, .28); outline-offset: 2px; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  transform: translateY(-150%);
  border-radius: 5px;
  background: #363636;
  color: #fff;
  padding: 8px 12px;
}
.skip-link:focus { transform: none; color: #fff; }
.site-brand { font-size: larger; font-weight: bolder; letter-spacing: -.01em; }
.navbar { margin-bottom: 16px; background: var(--nav-bg); }
.nav-shadow { box-shadow: 0 2px 8px rgba(26, 26, 26, .07); }
.navbar-item { transition: background-color .15s ease, color .15s ease; }
.nav-group-label { width: 100%; border: 0; background: transparent; color: inherit; cursor: pointer; font: inherit; text-align: left; }
.theme-toggle { align-self: center; width: 38px; height: 38px; display: grid; flex: 0 0 38px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--muted); cursor: pointer; padding: 8px; transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease; }
.theme-toggle-item { padding-inline: .75rem; }
.theme-toggle-mobile { display: none; margin-left: auto; }
.theme-toggle:hover { border-color: #b7c5d5; color: var(--link); transform: translateY(-1px); }
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.theme-icon-sun { display: none; }
[data-theme="dark"] .theme-icon-moon { display: none; }
[data-theme="dark"] .theme-icon-sun { display: block; }

#page-container { position: relative; min-height: 100vh; display: flex; flex-direction: column; }
#content-wrap { flex: 1; padding-bottom: 4rem; }
#footer { min-height: 4rem; padding: 1.25rem 1rem; border-top: 1px solid var(--line); background: var(--surface); }
#footer .content { margin-bottom: 0; }
#footer p { color: #68717b; font-size: .86rem; }

.wrapper { max-width: 960px; margin: 0 auto; }
.page-card-list { margin: 8px; }
.index-page-box { padding-top: 16px; border: 1px solid transparent; border-radius: 8px; box-shadow: var(--shadow); transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.index-page-box:hover { border-color: #e0e6ef; box-shadow: 0 .7em 1.4em -.15em rgba(10, 10, 10, .1); transform: translateY(-1px); }
.box article.index-page-media { padding: 8px; }
.box article { overflow-wrap: break-word; word-break: break-word; line-height: 1.65; background-color: #fff; }
.page-card-title { margin-bottom: 4px; color: #000; font-size: x-large; font-weight: 500; line-height: 1.5; text-decoration: none; }
.content h2.page-card-title { margin: 0 0 4px; border-bottom: 0; padding: 0; font-size: x-large; font-weight: 500; line-height: 1.5; }
.page-card-title a, .page-card-title a:hover { color: #368ccb; text-decoration: none; }
.page-card-title a:hover { color: #246fa8; }
.page-card-meta { display: flex; flex-wrap: wrap; gap: 4px; }
.page-card-text { margin-top: 16px; color: #4d5661; line-height: 1.7; }
.index-sidebar { margin-top: 8px; }
.index-sidebar .card, .notice { border-radius: 8px; box-shadow: var(--shadow); }
.sidebar-title { padding-bottom: 4px; font-size: larger; }
.sidebar-content { padding: 0 16px 16px; }
.brand-image { margin-top: 12px; border-radius: 6px; }
.notice { margin-top: 32px; }
.profile-card { overflow: visible; }
.profile-card-content { padding: 24px; }
.profile-header { display: flex; align-items: center; gap: 16px; }
.profile-avatar {
  width: 72px;
  height: 72px;
  display: grid;
  flex: 0 0 72px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--muted);
  font-family: Georgia, "Songti SC", serif;
  font-size: 1.45rem;
  font-weight: 600;
}
.profile-avatar img { width: 100%; height: 100%; max-height: none; object-fit: cover; }
.profile-identity { min-width: 0; display: grid; gap: 3px; }
.profile-site { margin: 0; overflow: hidden; color: var(--muted); font-size: .68rem; letter-spacing: .1em; line-height: 1.45; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.profile-name { margin: 0; overflow-wrap: anywhere; color: var(--text); font-size: 1.3rem; font-weight: 600; line-height: 1.35; }
.profile-bio { margin: 20px 0 0; color: var(--muted); font-size: .92rem; line-height: 1.85; }
.profile-social { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 20px; border-top: 1px solid var(--line); padding-top: 14px; }
.profile-social-link {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  padding: 6px 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-size: .76rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}
.profile-social-link:hover, .profile-social-link:focus-visible { border-color: #b7c5d5; background: var(--surface-soft); color: var(--text); }
.profile-social-link svg { width: 14px; height: 14px; flex: 0 0 14px; fill: currentColor; }
.profile-social-mark { width: 14px; height: 14px; display: inline-grid; flex: 0 0 14px; place-items: center; font-size: .68rem; font-weight: 700; line-height: 1; }
.profile-wechat { position: relative; }
.profile-wechat > summary { list-style: none; }
.profile-wechat > summary::-webkit-details-marker { display: none; }
.profile-wechat-cue { margin-left: 1px; color: var(--muted); font-size: .9rem; transition: transform .15s ease; }
.profile-wechat[open] .profile-wechat-cue { transform: rotate(45deg); }
.profile-wechat-panel { width: 100%; margin-top: 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); padding: 12px; text-align: center; }
.profile-wechat-panel img { display: block; width: min(100%, 180px); height: auto; max-height: none; margin: 0 auto; border-radius: 4px; background: #fff; padding: 5px; }
.profile-wechat-panel p { margin: 9px 0 0; color: var(--muted); font-size: .72rem; line-height: 1.55; }
.profile-wechat-panel strong { color: var(--text); font-size: .78rem; font-weight: 600; }
.profile-wechat:only-child, .profile-wechat:last-child { flex-basis: auto; }
.profile-wechat[open] { flex-basis: 100%; }
.archive-title { margin-top: 24px; }
.archive-container { padding: 0 16px 40px; }
.archive-container .table-container { border-radius: 7px; background: #fff; box-shadow: var(--shadow); }
.archive-container .table { margin-bottom: 0; }
.message-panel { margin: 24px 16px; border-radius: 8px; }
.message-home { margin-top: 14px; }
.pagination { margin: 18px 4px; }
.pagination a { overflow: hidden; border: 0; background: #fff; }
.shadow { box-shadow: var(--shadow); }
.is-broken-image { display: none !important; }
.image-fallback { display: flex; min-height: 56px; align-items: center; justify-content: center; border: 1px dashed #d8dde3; border-radius: 6px; background: #f7f8f9; color: #7a8490; padding: 12px; font-size: .78rem; line-height: 1.45; text-align: center; }
.notice .notice-image-fallback { min-height: 0; justify-content: flex-start; border: 0; border-left: 2px solid var(--line); border-radius: 0; background: var(--surface-soft); padding: 7px 10px; font-size: .7rem; line-height: 1.45; text-align: left; }
.notice img { width: 100%; max-height: none; display: block; }
.notice p:has(.notice-image-fallback) { margin-bottom: 7px; }
.notice p:has(.notice-image-fallback):last-child { margin-bottom: 0; }
.media-left .image-fallback { width: 48px; min-height: 48px; padding: 4px; font-size: .65rem; }

.article-container { max-width: 960px; margin: auto; padding: 16px; overflow-wrap: break-word; word-break: break-word; line-height: 1.65; }
.article-container.article-container-wide { max-width: 1200px; }
article { color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 16px; line-height: 1.65; word-wrap: break-word; }
article p, article blockquote, article ul, article ol, article dl, article table, article pre, article details { margin-top: 0; margin-bottom: 16px; }
article ul, article ol { padding-left: 2em; }
article ul ul, article ul ol, article ol ol, article ol ul { margin-top: 0; margin-bottom: 0; }
article .tag { font-family: Verdana, Candara, Arial, Helvetica, "Microsoft YaHei", sans-serif; }
article a { color: var(--link); text-decoration: none; }
article a:hover { color: #2366d1; text-decoration: underline; text-underline-offset: .15em; }
article h1 { font-size: 2em; }
article h2, article h3, article h4, article h5, article h6 { margin-top: 1.65em; margin-bottom: .55em; font-weight: 600; line-height: 1.45; }
article h2 { font-size: 1.5em; }
article h3, article h4 { font-size: 1.25em; }
article h5 { font-size: 1.1em; }
article h6 { font-size: 1em; font-weight: bold; }
article li + li { margin-top: .25em; }
article table { min-width: 66%; margin: auto; border-spacing: 0; border-collapse: collapse; text-align: left; vertical-align: middle; }
article table td, article table th { border: 1px solid #d3d7dc; padding: 7px 10px; }
article table th { background: #f6f7f8; }
article blockquote { margin-left: 0; border-left: .25em solid #d5d9de; background: #f8f9fa; padding: .8em 1em; color: #4f5964; }
article pre { display: block; max-width: 960px; overflow: auto; margin: 12px 0 16px; border-radius: 7px; padding: 0; }
article pre code { font-size: 14px; }
article code { border-radius: 5px; background-color: rgba(175, 184, 193, .2); color: var(--text); padding: .065em .4em; font-family: "JetBrains Mono", "Cascadia Code", Consolas, "Microsoft YaHei", monospace; }
article img { border-radius: 4px; }
article .copyright { display: none; }
.info { margin-bottom: 24px; color: var(--muted); font-size: 14px; line-height: 28px; text-align: left; }
.info a { color: inherit; text-decoration: none; }
span.line { display: inline-block; margin-right: 4px; }

.toc { position: sticky; top: 24px; }
.toc .menu-list li ul { margin: .5em 0 0; border-left: 0; padding-left: 0; }
.toc-title { margin-bottom: 8px; font-size: 1.05rem; font-weight: bold; }
.related-container { margin-bottom: 28px; }
.related-container .toc-title { color: var(--text); font-size: 1.08rem; }
.related-container .menu-list, .related-container ul { display: grid; gap: 2px; }
.related-container a { overflow: hidden; color: var(--muted); font-size: .86rem; line-height: 1.45; text-overflow: ellipsis; }
.related-container a:hover { color: var(--link); }
.related-container a.is-current { background: var(--surface-soft); color: var(--text); font-weight: 600; }
.toc-level-1, .toc-level-2 { list-style-type: none; }
.toc-level-3 { list-style-type: disc; }
.toc-level-4 { list-style-type: circle; }
.toc-level-5, .toc-level-6 { list-style-type: square; }
#toc a { color: #657180; font-size: .88rem; line-height: 1.45; }
#toc a:hover { color: var(--link); }
.protected-content { margin-top: 24px; }
.protected-page { max-width: 620px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 20px; }
.protected-controls { margin-top: 12px; }

.code-page { margin-top: 32px; padding: 0 16px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif; }
.code-page code { width: 100%; height: 100%; font-size: 16px; }
.code-page pre { overflow-x: auto; margin-top: 27px; background: transparent; padding: 0; font-size: 16px; }
.code-page .control-panel { display: flex; justify-content: flex-end; gap: 8px; width: 100%; }
.code-focus-mode #footer, .code-focus-mode .navbar { visibility: hidden; }
#code-display { padding: 16px 24px; }
.raw { padding: 16px; }
.raw-page { margin: 16px; }
.raw-frame { display: block; width: 100%; min-height: 75vh; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.raw .raw-content { overflow-x: scroll; overflow-y: hidden; }
.links { margin: 16px; }
.link-entry { margin-bottom: 16px; border-radius: 8px; box-shadow: var(--shadow); }
.link-entry-title { color: #363636; }

.microblog-page { max-width: 600px; padding-top: 18px; padding-bottom: 56px; }
.microblog-header { margin: 0 6px 26px; }
.microblog-header .title { margin-bottom: .35rem; font-weight: 600; }
.microblog-header .title + .subtitle { margin-top: 0; }
.microblog-header .subtitle { margin-bottom: 0; color: var(--muted); line-height: 1.6; }
.microblog-stream { display: grid; gap: 24px; }
.micro-post { margin-bottom: 0 !important; border-top: 6px solid var(--link); border-radius: 5px; padding: 20px 22px; box-shadow: 0 .5em 1em -.125em rgba(10, 10, 10, .1), 0 0 0 1px rgba(10, 10, 10, .02); }
.micro-post[data-micro-accent="0"] { border-top-color: #0074d9; }
.micro-post[data-micro-accent="1"] { border-top-color: #7fdbff; }
.micro-post[data-micro-accent="2"] { border-top-color: #39cccc; }
.micro-post[data-micro-accent="3"] { border-top-color: #b10dc9; }
.micro-post[data-micro-accent="4"] { border-top-color: #f012be; }
.micro-post[data-micro-accent="5"] { border-top-color: #ff4136; }
.micro-post[data-micro-accent="6"] { border-top-color: #ff851b; }
.micro-post[data-micro-accent="7"] { border-top-color: #2ecc40; }
.micro-post[data-micro-accent="8"] { border-top-color: #01b86b; }
.micro-post-content { overflow-wrap: break-word; font-family: Verdana, Candara, Arial, Helvetica, "Microsoft YaHei", sans-serif; font-size: 17px; line-height: 1.8; }
.micro-post-content > :last-child { margin-bottom: 0; }
.micro-post-content blockquote { border-left-color: #d9dde2; background: transparent; color: inherit; padding-block: 0; }
.micro-post-content pre { overflow: auto; border-radius: 6px; background: #f5f5f5; padding: 12px 14px; }
.micro-post footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 15px; color: #a2a8ae; font-family: Verdana, Candara, Arial, Helvetica, "Microsoft YaHei", sans-serif; font-size: .78rem; }
.micro-post footer a { color: var(--muted); }
.micro-post footer a:hover { color: var(--link); }
.microblog-loader { display: grid; place-items: center; gap: 8px; min-height: 88px; color: var(--muted); font-size: .82rem; }
.microblog-loader .button { min-width: 112px; border: 0; box-shadow: var(--shadow); }
.microblog-loader.is-complete { min-height: 64px; }
.microblog-end { margin: 28px 0 0; color: var(--muted); font-size: .82rem; text-align: center; }
.microblog-new-button { position: fixed; right: 30px; bottom: 24px; z-index: 30; display: block; width: 50px; height: 50px; border-radius: 50%; background: #fff; color: #4a4a4a; box-shadow: 0 5px 18px rgba(10, 10, 10, .16); transition: color .15s ease, transform .15s ease; }
.microblog-new-button:hover { color: var(--link); transform: translateY(-2px); }
.microblog-new-button svg { display: block; width: 100%; height: 100%; }

/* Markdown reading surface. This intentionally stays close to the original
   Node.js/Bulma theme: restrained, compact, and free of decorative dividers. */
#article { min-width: 0; max-width: 860px; margin: 0 auto; }
.title.page-title { margin-bottom: .45rem; color: #24292f; font-size: 2rem; font-weight: 600; line-height: 1.35; }
.article-summary { max-width: 760px; margin: 0 0 14px; overflow-wrap: anywhere; color: #5f6b77; font-size: 1rem; line-height: 1.6; word-break: break-word; }
.article-content, .protected-content { color: #24292f; font-size: 16px; line-height: 1.65; }
.article-content > :first-child, .protected-content > :first-child { margin-top: 0; }
.article-content > :last-child, .protected-content > :last-child { margin-bottom: 0; }
.article-content p, .protected-content p { margin-bottom: 16px; }
.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 {
  scroll-margin-top: 24px;
  color: #24292f;
}
.article-content h1, .protected-content h1 { margin-top: 1.35em; font-size: 2em; }
.article-content h2, .protected-content h2 { margin-top: 1.45em; margin-bottom: .45em; font-size: 1.5em; }
.article-content h3, .protected-content h3 { margin-top: 1.35em; margin-bottom: .4em; font-size: 1.25em; }
.article-content h4, .protected-content h4 { margin-top: 1.25em; margin-bottom: .35em; font-size: 1.25em; }
.article-content a, .protected-content a { color: #007bff; text-decoration: none; }
.article-content a:hover, .protected-content a:hover { color: #007bff; text-decoration: none; }
.article-content strong, .protected-content strong { color: #24292f; font-weight: 700; }
.article-content ul, .protected-content ul { margin-bottom: 1.25rem; padding-left: 2em; list-style: disc outside; }
.article-content ol, .protected-content ol { margin-bottom: 1.25rem; padding-left: 2em; list-style: decimal outside; }
.article-content :is(ul, ol) :is(ul, ol), .protected-content :is(ul, ol) :is(ul, ol) { margin-top: .25em; margin-bottom: 0; }
.article-content :is(ul, ol) ul, .protected-content :is(ul, ol) ul { list-style-type: circle; }
.article-content :is(ul, ol) :is(ul, ol) ul, .protected-content :is(ul, ol) :is(ul, ol) ul { list-style-type: square; }
.article-content li + li, .protected-content li + li { margin-top: .25em; }
.article-content .task-list-item, .protected-content .task-list-item { list-style: none; }
.article-content .task-list-item input, .protected-content .task-list-item input { width: 1em; height: 1em; margin: 0 .55em 0 -1.45em; accent-color: var(--link); vertical-align: -.08em; }
.article-content blockquote, .protected-content blockquote {
  margin: 0 0 16px;
  border-left: .25em solid #ddd;
  background: transparent;
  color: #4f5964;
  padding: 0 1em;
}
.article-content blockquote > :last-child, .protected-content blockquote > :last-child { margin-bottom: 0; }
.article-content hr, .protected-content hr { height: 1px; margin: 24px 0; border: 0; background: #e7e9ec; }
.article-content img, .protected-content img { display: inline-block; margin: 0; border-radius: 4px; box-shadow: none; vertical-align: middle; }
.article-content p > img:only-child, .article-content p > a:only-child > img:only-child,
.protected-content p > img:only-child, .protected-content p > a:only-child > img:only-child,
.article-content figure > img, .protected-content figure > img {
  display: block;
  margin: 1.5em auto;
  border-radius: 4px;
  box-shadow: none;
}
.article-content figure, .protected-content figure { margin: 1.5em 0; }
.article-content figure img, .protected-content figure img { margin-bottom: .7em; }
.article-content figcaption, .protected-content figcaption { color: #7b858f; font-size: .82rem; text-align: center; }
.article-content :not(pre) > code, .protected-content :not(pre) > code {
  border: 0;
  border-radius: 6px;
  background: rgba(175, 184, 193, .2);
  color: #24292f;
  padding: .065em .4em;
  font-size: .875em;
  white-space: break-spaces;
}
.article-content pre, .protected-content pre {
  position: relative;
  max-width: 100%;
  margin: 12px 0 16px;
  overflow: auto;
  border: 0;
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.6;
  tab-size: 4;
}
.article-content pre code, .protected-content pre code { display: block; min-width: max-content; border: 0; background: transparent; color: inherit; padding: 0; font-size: inherit; white-space: pre; }
.article-content .code-block, .protected-content .code-block { padding-top: 38px; }
.code-copy-button {
  position: absolute;
  top: 8px;
  right: 8px;
  min-height: 32px;
  border: 1px solid #d9dde1;
  border-radius: 5px;
  background: rgba(255, 255, 255, .92);
  color: #59636e;
  cursor: pointer;
  padding: 3px 9px;
  font-family: Verdana, Candara, Arial, sans-serif;
  font-size: 12px;
  line-height: 1;
}
.code-copy-button:hover { border-color: #b9c8d8; color: var(--link); }
.article-content table, .protected-content table {
  display: block;
  width: max-content;
  max-width: 100%;
  min-width: 66%;
  margin: 1.25em auto;
  overflow-x: auto;
  border: 0;
  border-radius: 0;
  font-size: 1em;
  -webkit-overflow-scrolling: touch;
}
.article-content table:focus, .protected-content table:focus { outline: 3px solid rgba(50, 115, 220, .12); }
.article-content table th, .protected-content table th { background: transparent; color: #24292f; font-weight: 700; }
.article-content table th, .article-content table td, .protected-content table th, .protected-content table td { border: 1px solid #bbb; padding: 5px 8px; }
.article-content details, .protected-content details { margin: 1.25em 0; }
.article-content summary, .protected-content summary { cursor: pointer; font-weight: 600; }
.article-content details > :last-child, .protected-content details > :last-child { margin-bottom: 0; }
.article-content .footnotes, .protected-content .footnotes { margin-top: 2.5em; color: #65707b; font-size: .88em; }
.article-content .footnote-backref, .protected-content .footnote-backref { text-decoration: none; }
.toc-level-3 { margin-left: 11px; list-style: none; }
.toc-level-3 a { font-size: .82rem !important; }

.article-pagination { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 12px; margin: 26px 0 8px; }
.article-pagination.is-next-only .pagination-next { grid-column: 2; }
.article-pagination .pagination-previous, .article-pagination .pagination-next { min-width: 0; height: auto; min-height: 76px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; margin: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 12px 15px; line-height: 1.35; white-space: normal; }
.article-pagination .pagination-next { align-items: flex-end; text-align: right; }
.article-pagination .page-nav-label, .article-pagination .page-nav-title { flex-shrink: 0; max-width: 100%; overflow-wrap: anywhere; }
.article-pagination .page-nav-label { color: var(--muted); font-size: .72rem; }
.article-pagination .page-nav-title { display: -webkit-box; overflow: hidden; color: var(--text); font-size: .94rem; font-weight: 600; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.article-pagination a:hover { border-color: #b7c5d5; background: var(--surface-soft); }
.article-pagination a:hover .page-nav-title { color: var(--link); }

/* Dark mode keeps Bulma's component surfaces and the Markdown reading area in
   the same restrained palette instead of merely inverting the page. */
[data-theme="dark"] ::selection { background: #31527d; color: #f4f8ff; }
[data-theme="dark"] :focus-visible { outline-color: rgba(120, 169, 255, .5); }
[data-theme="dark"] .navbar-menu,
[data-theme="dark"] .navbar-dropdown,
[data-theme="dark"] .box,
[data-theme="dark"] .card,
[data-theme="dark"] .notification,
[data-theme="dark"] .table,
[data-theme="dark"] .pagination-link,
[data-theme="dark"] .pagination-previous,
[data-theme="dark"] .pagination-next,
[data-theme="dark"] .button,
[data-theme="dark"] .button.is-light,
[data-theme="dark"] .input,
[data-theme="dark"] .textarea,
[data-theme="dark"] .select select { background-color: var(--surface); color: var(--text); }
[data-theme="dark"] .navbar-item,
[data-theme="dark"] .navbar-link,
[data-theme="dark"] .card-header-title,
[data-theme="dark"] .title,
[data-theme="dark"] .subtitle,
[data-theme="dark"] .label,
[data-theme="dark"] .table td,
[data-theme="dark"] .table th { color: var(--text); }
[data-theme="dark"] .navbar-item:hover,
[data-theme="dark"] .navbar-link:hover,
[data-theme="dark"] .navbar-item.has-dropdown:hover .navbar-link,
[data-theme="dark"] .navbar-item.has-dropdown.is-active .navbar-link { background-color: var(--surface-soft); color: var(--link); }
[data-theme="dark"] .navbar-divider { background-color: var(--line); }
[data-theme="dark"] .navbar-burger { color: var(--muted); }
[data-theme="dark"] .card-header { box-shadow: 0 1px 0 var(--line); }
[data-theme="dark"] .tag:not(body).is-light { background-color: #252d36; color: #b8c5d1; }
[data-theme="dark"] .index-page-box:hover { border-color: #3a4653; box-shadow: var(--shadow); }
[data-theme="dark"] .box article.index-page-media,
[data-theme="dark"] .box article { background-color: transparent; }
[data-theme="dark"] .page-card-title,
[data-theme="dark"] .title.page-title,
[data-theme="dark"] .article-content,
[data-theme="dark"] .protected-content,
[data-theme="dark"] .article-content h1,
[data-theme="dark"] .article-content h2,
[data-theme="dark"] .article-content h3,
[data-theme="dark"] .article-content h4,
[data-theme="dark"] .article-content h5,
[data-theme="dark"] .article-content h6,
[data-theme="dark"] .protected-content h1,
[data-theme="dark"] .protected-content h2,
[data-theme="dark"] .protected-content h3,
[data-theme="dark"] .protected-content h4,
[data-theme="dark"] .protected-content h5,
[data-theme="dark"] .protected-content h6,
[data-theme="dark"] .article-content strong,
[data-theme="dark"] .protected-content strong { color: var(--text); }
[data-theme="dark"] .page-card-text,
[data-theme="dark"] .article-summary,
[data-theme="dark"] .article-content figcaption,
[data-theme="dark"] .protected-content figcaption,
[data-theme="dark"] #footer p { color: var(--muted); }
[data-theme="dark"] article a:hover { color: var(--link-hover); }
[data-theme="dark"] article blockquote,
[data-theme="dark"] .article-content blockquote,
[data-theme="dark"] .protected-content blockquote { border-left-color: #485563; background: #171c22; color: #b5c0ca; }
[data-theme="dark"] .article-content hr,
[data-theme="dark"] .protected-content hr { background: var(--line); }
[data-theme="dark"] article code,
[data-theme="dark"] .article-content :not(pre) > code,
[data-theme="dark"] .protected-content :not(pre) > code { background: #252d36; color: #e5edf5; }
[data-theme="dark"] .article-content pre,
[data-theme="dark"] .protected-content pre,
[data-theme="dark"] .micro-post-content pre,
[data-theme="dark"] #code-display { background: #171c22 !important; color: #dce4ec; }
[data-theme="dark"] .code-copy-button { border-color: #3b4652; background: rgba(32, 38, 46, .94); color: #b5c1cd; }
[data-theme="dark"] article table td,
[data-theme="dark"] article table th,
[data-theme="dark"] .article-content table td,
[data-theme="dark"] .article-content table th,
[data-theme="dark"] .protected-content table td,
[data-theme="dark"] .protected-content table th { border-color: #44505d; color: var(--text); }
[data-theme="dark"] article table th { background: var(--surface-soft); }
[data-theme="dark"] .table.is-bordered td,
[data-theme="dark"] .table.is-bordered th { border-color: var(--line); }
[data-theme="dark"] .table.is-striped tbody tr:not(.is-selected):nth-child(even) { background-color: #1d232a; }
[data-theme="dark"] .table.is-hoverable tbody tr:not(.is-selected):hover { background-color: #252d36; }
[data-theme="dark"] .archive-container .table-container,
[data-theme="dark"] .protected-page,
[data-theme="dark"] .raw-frame,
[data-theme="dark"] .microblog-new-button { background: var(--surface); }
[data-theme="dark"] .image-fallback { border-color: #3b4652; background: var(--surface-soft); color: var(--muted); }
[data-theme="dark"] .link-entry-title { color: var(--text); }
[data-theme="dark"] .microblog-new-button { color: #b9c4cf; box-shadow: 0 5px 18px rgba(0, 0, 0, .42); }
[data-theme="dark"] .micro-post-content blockquote { background: transparent; }

@media screen and (max-width: 960px) {
  article h1 { font-size: 1.5em; }
  article h2 { font-size: 1.35em; }
  article h3 { font-size: 1.3em; }
  article h4 { font-size: 1.2em; }
  .toc { border-left: 0; padding-left: 0; }
}

@media screen and (min-width: 1024px) {
  .index-layout > section.column { min-width: 0; flex: 1 1 auto; }
  .index-layout > .index-sidebar { width: 300px; flex: 0 0 300px; }
}

/* Bulma's columns use negative outer margins. On the stacked home layout that
   cancels the column gutter and makes cards look flush against mobile screens. */
@media screen and (max-width: 1023px) {
  .navbar-brand { width: 100%; }
  .theme-toggle-mobile { display: grid; }
  .theme-toggle-desktop { display: none; }
  .navbar-burger { margin-left: 0; }
  .navbar-menu.is-active { max-height: calc(100dvh - 52px); overflow-y: auto; overscroll-behavior: contain; }
  .nav-group .navbar-dropdown { display: none; }
  .nav-group.is-open .navbar-dropdown { display: block; }
  .nav-group-label { justify-content: space-between; padding-right: 2.5em; }
  .index-layout { margin-inline: 0; }
  .index-layout > .column { padding-inline: 12px; }
  .index-layout .page-card-list { margin-inline: 0; }
  .index-layout .index-sidebar { margin-top: 8px; }
  .profile-card { max-width: 520px; }
}

@media screen and (max-width: 768px) {
  .index-page-box { border-radius: 6px; }
  .index-page-box:hover { transform: none; }
  .content h2.page-card-title { font-size: 1.3rem; line-height: 1.4; }
  .index-layout .page-card-text { margin-top: 14px; line-height: 1.65; }
  .article-container { padding-inline: 14px; }
  .archive-container { padding-inline: 8px; }
  .pagination { gap: 8px; }
  .pagination-previous, .pagination-next { min-width: 0; white-space: normal; }
  .title.page-title { font-size: 1.5rem; }
  .article-summary { font-size: .95rem; }
  .article-content, .protected-content { font-size: 16px; line-height: 1.65; }
  .article-content h2, .protected-content h2 { margin-top: 1.4em; }
  .article-content pre, .protected-content pre { margin-inline: -6px; border-radius: 6px; padding-inline: 14px; }
  .article-content .code-block, .protected-content .code-block { padding-top: 40px; }
  .article-content table, .protected-content table { font-size: .84em; }
  .microblog-page { padding-inline: 12px; }
  .microblog-header { margin-inline: 4px; }
  .microblog-stream { gap: 18px; }
  .micro-post { padding: 17px 16px; }
  .micro-post-content { font-size: 16px; }
  .microblog-new-button { right: 18px; bottom: 18px; width: 46px; height: 46px; }

  .archive-container .table-container { overflow: visible; }
  .archive-table, .archive-table tbody, .archive-table tr, .archive-table td { display: block; width: 100%; }
  .archive-table thead { display: none; }
  .archive-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 14px; border-top: 1px solid var(--line); padding: 13px 14px; }
  .archive-table tr:first-child { border-top: 0; }
  .archive-table td { border: 0 !important; padding: 0 !important; }
  .archive-table td:first-child { grid-column: 1 / -1; font-size: .98rem; line-height: 1.45; }
  .archive-table td:not(:first-child) { color: var(--muted); font-size: .78rem; }
  .archive-table td:not(:first-child)::before { content: attr(data-label); display: block; margin-bottom: 1px; color: var(--muted); font-size: .66rem; opacity: .76; }
}

@media screen and (max-width: 560px) {
  .article-pagination { grid-template-columns: 1fr; gap: 9px; }
  .article-pagination.is-next-only .pagination-next { grid-column: 1; }
  .article-pagination .pagination-previous, .article-pagination .pagination-next { min-height: 68px; align-items: flex-start; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media print {
  .navbar, .toc, .pagination, #footer, .theme-toggle { display: none !important; }
  body { background: #fff; }
  .article-container { max-width: none; padding: 0; }
}
