/* ==========================================================================
   妙想之地 · Quiet theme
   Monochrome surfaces, hairline structure, one accent, typography first.
   ========================================================================== */

@font-face {
  font-family: "JBM";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("/_astro/jetbrains-mono-latin-wght-normal.B9CIFXIH.woff2") format("woff2-variations"), url("/_astro/jetbrains-mono-latin-wght-normal.B9CIFXIH.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Tokens ---------- */
:root {
  --font-sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Hiragino Sans", sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-mono: "JBM", "JetBrains Mono", ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --nav-h: 56px;
  --nav-top: 12px;
  --content-max: 1200px;
  --gutter: 32px;
}

:root[data-theme="dark"],
.home-stage {
  color-scheme: dark;
  --bg: #0c0c0e;
  --bg-elev: #141417;
  --card: #131316;
  --card-hover: #18181c;
  --surface: rgba(255, 255, 255, .035);
  --surface-2: rgba(255, 255, 255, .065);
  --surface-3: rgba(255, 255, 255, .1);
  --glass: rgba(12, 12, 14, .78);
  --sheet: #141417;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);
  --text: #ededf0;
  --prose: #cfcfd6;
  --muted: #a0a0aa;
  --faint: #6c6c77;
  --accent: #e8a084;
  --accent-strong: #e8a084;
  --accent-soft: rgba(232, 160, 132, .12);
  --on-primary: #0c0c0e;
  --green: #7cc89b;
  --amber: #e3b65c;
  --danger: #f08484;
  --shadow: none;
  --shadow-pop: 0 24px 60px -20px rgba(0, 0, 0, .7);
  --banner-opacity: .26;
  --code-bg: #101013;
  --c-text: #dcdce2;
  --c-comment: #6c6c77;
  --c-keyword: #c9a3dc;
  --c-string: #a9cc8f;
  --c-number: #e6b07c;
  --c-function: #8fb9df;
  --c-builtin: #e8a084;
  --c-type: #d9c47e;
  --c-operator: #9aa6b2;
  --c-punct: #8a8a95;
  --c-tag: #e8a084;
}

:root {
  color-scheme: light;
  --bg: #f7f6f3;
  --bg-elev: #ffffff;
  --card: #ffffff;
  --card-hover: #ffffff;
  --surface: rgba(20, 20, 24, .03);
  --surface-2: rgba(20, 20, 24, .055);
  --surface-3: rgba(20, 20, 24, .09);
  --glass: rgba(247, 246, 243, .82);
  --sheet: #ffffff;
  --line: rgba(20, 20, 24, .08);
  --line-strong: rgba(20, 20, 24, .16);
  --text: #141416;
  --prose: #2c2c31;
  --muted: #5d5d66;
  --faint: #8f8f98;
  --accent: #b4552f;
  --accent-strong: #b4552f;
  --accent-soft: rgba(180, 85, 47, .08);
  --on-primary: #f7f6f3;
  --green: #2f8a57;
  --amber: #a8741a;
  --danger: #c93c3c;
  --shadow: 0 1px 2px rgba(20, 20, 24, .04);
  --shadow-pop: 0 24px 60px -24px rgba(20, 20, 24, .25);
  --banner-opacity: .32;
  --code-bg: #f9f8f5;
  --c-text: #2b2b31;
  --c-comment: #9b9ba3;
  --c-keyword: #8a3ea6;
  --c-string: #4c7a2b;
  --c-number: #b0601d;
  --c-function: #2b6299;
  --c-builtin: #b4552f;
  --c-type: #876b0e;
  --c-operator: #4f5b66;
  --c-punct: #6b6b74;
  --c-tag: #b4552f;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color-scheme: light; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + var(--nav-top) + 24px); -webkit-text-size-adjust: 100%; }
:root[data-theme="dark"] { color-scheme: dark; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); font-family: var(--font-sans); font-size: 15.5px; line-height: 1.7; letter-spacing: 0; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body.no-scroll { overflow: hidden; }
::selection { background: var(--accent-soft); color: var(--text); }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; letter-spacing: 0; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.icon { width: 1.05rem; height: 1.05rem; display: inline-block; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
kbd { display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; padding: 0 .4em; border: 1px solid var(--line-strong); border-radius: 5px; color: var(--faint); font: 500 .66rem/1 var(--font-mono); }
.skip-link { position: fixed; z-index: 100; left: 16px; top: -60px; padding: 8px 14px; border-radius: var(--radius-sm); background: var(--text); color: var(--on-primary); font-weight: 600; transition: top .2s var(--ease); }
.skip-link:focus { top: 16px; }
.text-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .88rem; font-weight: 500; transition: color .2s; }
.text-link:hover { color: var(--text); }
.text-link .icon { width: .95rem; height: .95rem; transition: transform .25s var(--ease); }
.text-link:hover .icon { transform: translateX(3px); }

/* ---------- Page banner ---------- */
.page-banner { position: absolute; z-index: 0; top: 0; left: 0; right: 0; height: min(60vh, 540px); overflow: hidden; pointer-events: none; -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .5) 45%, transparent 100%); mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .5) 45%, transparent 100%); }
.page-banner picture, .page-banner img { display: block; width: 100%; height: 100%; }
.page-banner img { object-fit: cover; object-position: center 30%; opacity: var(--banner-opacity); filter: saturate(.85); transition: opacity 1s var(--ease); }
html.js .page-banner img:not(.is-loaded) { opacity: 0; }

/* ---------- View transitions ---------- */
@view-transition { navigation: auto; }
::view-transition-group(*) { animation-duration: .5s; animation-timing-function: var(--ease); }
::view-transition-old(root) { animation: vt-out .22s cubic-bezier(.4, 0, 1, 1) both; }
::view-transition-new(root) { animation: vt-in .5s var(--ease) .06s both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(12px); } }
.site-nav { view-transition-name: site-nav; }
.mobile-dock { view-transition-name: mobile-dock; }
.article-cover img { view-transition-name: post-cover; }
::view-transition-group(post-cover) { border-radius: var(--radius-lg); overflow: clip; animation-duration: .6s; }
::view-transition-old(post-cover), ::view-transition-new(post-cover) { width: 100%; height: 100%; object-fit: cover; animation-duration: .6s; }
html.theme-transition .site-nav, html.theme-transition .mobile-dock, html.theme-transition .article-cover img { view-transition-name: none; }
html.theme-transition::view-transition-old(root) { animation: theme-out .45s ease both; }
html.theme-transition::view-transition-new(root) { animation: theme-in .45s ease both; }
@keyframes theme-out { to { opacity: 0; } }
@keyframes theme-in { from { opacity: 0; } }

/* ---------- Navigation ---------- */
.site-nav { position: fixed; z-index: 60; top: var(--nav-top); left: 0; right: 0; display: flex; justify-content: center; pointer-events: none; }
.site-nav-inner { pointer-events: auto; width: min(var(--content-max), calc(100% - var(--gutter))); height: var(--nav-h); display: flex; align-items: center; gap: 8px; padding: 0 8px 0 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--glass); -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4); transition: border-color .3s, background .3s; }
html.is-scrolled .site-nav-inner { border-color: var(--line-strong); }
.nav-brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; min-width: 0; }
.brand-mark { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: var(--accent); }
.workspace-brand-title { font-weight: 700; font-size: .98rem; letter-spacing: .04em; white-space: nowrap; }
.nav-links { position: relative; display: flex; align-items: center; gap: 2px; margin: 0 auto; }
.nav-links a { position: relative; z-index: 1; height: 34px; display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; border-radius: 9px; color: var(--muted); font-size: .86rem; font-weight: 500; white-space: nowrap; transition: color .2s; }
.nav-links a .icon { width: .95rem; height: .95rem; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links:not(.has-indicator) a.active { background: var(--surface-2); }
.nav-indicator { position: absolute; z-index: 0; top: 50%; left: 0; height: 34px; width: var(--w, 0); margin-top: -17px; transform: translateX(var(--x, 0)); border-radius: 9px; background: var(--surface-2); opacity: 0; transition: transform .35s var(--ease), width .35s var(--ease), opacity .2s; }
.nav-links.has-indicator .nav-indicator { opacity: 1; }
.nav-links.is-instant .nav-indicator { transition: none; }
.nav-actions { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.icon-button { width: 36px; height: 36px; display: inline-grid; place-items: center; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--muted); transition: background .2s, color .2s; }
.icon-button:hover { background: var(--surface-2); color: var(--text); }
.theme-toggle { position: relative; }
.theme-toggle .icon { position: absolute; transition: opacity .2s, transform .3s var(--ease); }
.theme-icon-moon { opacity: 0; transform: rotate(-45deg); }
:root:not([data-theme="dark"]) .theme-icon-sun { opacity: 0; transform: rotate(45deg); }
:root:not([data-theme="dark"]) .theme-icon-moon { opacity: 1; transform: none; }
.theme-toggle-wide .theme-icon-moon { display: none; }
:root:not([data-theme="dark"]) .theme-toggle-wide .theme-icon-sun { display: none; }
:root:not([data-theme="dark"]) .theme-toggle-wide .theme-icon-moon { display: inline-block; opacity: 1; transform: none; }
.nav-search { height: 34px; display: inline-flex; align-items: center; gap: 8px; padding: 0 6px 0 11px; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--faint); font-size: .84rem; transition: border-color .2s, color .2s; }
.nav-search:hover { color: var(--text); border-color: var(--line-strong); }
.nav-search .icon { width: .95rem; height: .95rem; }
.nav-search span { min-width: 3em; text-align: left; }
.topbar-avatar { display: block; flex: 0 0 auto; margin-left: 4px; padding: 0; border: 0; border-radius: 50%; background: transparent; }
.topbar-avatar img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line-strong); transition: border-color .2s; }
.topbar-avatar:hover img { border-color: var(--text); }
.sidebar-trigger, .article-toc-top-trigger { display: none; }
.language-switch { height: 30px; display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 8px; background: var(--surface); }
.language-switch a { height: 26px; min-width: 28px; display: grid; place-items: center; padding: 0 7px; border-radius: 6px; color: var(--faint); font: 600 .7rem/1 var(--font-sans); transition: color .2s, background .2s; }
.language-switch a:hover { color: var(--text); }
.language-switch a.active { color: var(--text); background: var(--surface-3); }

/* Mobile sheet + dock */
.workspace-sidebar { position: fixed; z-index: 90; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); max-height: calc(100dvh - 20px); display: flex; flex-direction: column; gap: 12px; padding: 14px; overflow: auto; border: 1px solid var(--line-strong); border-radius: 20px; background: var(--sheet); box-shadow: var(--shadow-pop); transform: translateY(calc(100% + 30px)); visibility: hidden; transition: transform .35s var(--ease), visibility 0s linear .35s; }
body.sidebar-open .workspace-sidebar { transform: none; visibility: visible; transition: transform .4s var(--ease), visibility 0s; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 0 10px; }
.sheet-title { font: 500 .7rem/1 var(--font-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--faint); }
.workspace-nav { display: grid; }
.workspace-nav a { display: grid; grid-template-columns: 28px 22px minmax(0, 1fr) 16px; align-items: center; gap: 10px; min-height: 52px; padding: 0 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 1rem; font-weight: 500; transition: color .2s; }
.workspace-nav a:first-child { border-top: 0; }
.workspace-nav a small { font: 500 .7rem/1 var(--font-mono); color: var(--faint); }
.workspace-nav a:hover, .workspace-nav a.active { color: var(--text); }
.workspace-nav a.active small { color: var(--accent); }
.workspace-nav .nav-tail { width: .85rem; height: .85rem; color: var(--faint); }
.sheet-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.sheet-foot .button { flex: 1; }
.sidebar-backdrop { position: fixed; z-index: 85; inset: 0; background: rgba(0, 0, 0, .5); opacity: 0; pointer-events: none; transition: opacity .3s var(--ease); }
body.sidebar-open .sidebar-backdrop { opacity: 1; pointer-events: auto; }
.mobile-dock { display: none; }

/* ---------- Shell ---------- */
.site-shell { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }
.workspace-content { flex: 1; min-width: 0; }
.content-page { position: relative; width: min(var(--content-max), calc(100% - var(--gutter) * 2)); margin: 0 auto; padding: calc(var(--nav-h) + var(--nav-top) + 72px) 0 32px; }

/* Footer */
.site-footer { margin-top: 112px; padding: 0 0 40px; color: var(--faint); font-size: .82rem; }
.footer-inner { width: min(var(--content-max), calc(100% - var(--gutter) * 2)); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px 40px; padding-top: 36px; border-top: 1px solid var(--line); }
.footer-brand { display: flex; align-items: baseline; gap: 12px; max-width: 440px; }
.footer-brand .brand-mark { transform: translateY(-1px); }
.footer-brand strong { display: block; color: var(--text); font-size: .95rem; }
.footer-brand p { margin: 6px 0 0; line-height: 1.7; }
.footer-links { display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: flex-end; gap: 6px 22px; }
.footer-links a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); transition: color .2s; }
.footer-links a:hover { color: var(--text); }
.footer-links .icon { width: .85rem; height: .85rem; }
.footer-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-family: var(--font-mono); font-size: .72rem; }
.footer-meta a { transition: color .2s; }
.footer-meta a:hover { color: var(--text); }
.footer-dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .5; }

/* ---------- Primitives ---------- */
.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 10px; background: transparent; color: var(--text); font-weight: 600; font-size: .88rem; white-space: nowrap; transition: background .2s, border-color .2s, color .2s, opacity .2s; }
.button .icon { width: .95rem; height: .95rem; transition: transform .25s var(--ease); }
.button:hover { background: var(--surface-2); }
.button:disabled { opacity: .45; cursor: not-allowed; }
.button-primary { border-color: var(--text); background: var(--text); color: var(--on-primary); }
.button-primary:hover { background: var(--text); opacity: .86; }
.button-primary:hover .icon:last-child { transform: translateX(3px); }
.button-ghost { background: transparent; }
.button-danger { color: var(--danger); border-color: color-mix(in oklab, var(--danger) 40%, transparent); }
.button.full { width: 100%; }
.button kbd { margin-left: 2px; }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); font-size: .76rem; font-weight: 500; transition: color .2s, border-color .2s; }
a.badge:hover { color: var(--text); border-color: var(--line-strong); }
.badge .icon { width: .8rem; height: .8rem; }
.badge-accent { color: var(--accent); border-color: color-mix(in oklab, var(--accent) 40%, transparent); }
.empty-state { padding: 56px 24px; text-align: center; color: var(--faint); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); }

/* Headings */
.page-heading, .section-heading { position: relative; margin-bottom: 44px; }
.page-heading p, .section-heading p { margin: 0; color: var(--accent); font: 500 .72rem/1.2 var(--font-mono); letter-spacing: .18em; text-transform: uppercase; }
.page-heading h1 { margin: 14px 0 0; font-family: var(--font-display); font-size: clamp(2.3rem, 4.8vw, 3.6rem); line-height: 1.1; font-weight: 750; letter-spacing: -.03em; overflow-wrap: anywhere; }
.heading-hash { margin-right: .06em; color: var(--faint); font-weight: 500; }
.section-heading h2 { margin: 12px 0 0; font-family: var(--font-display); font-size: clamp(1.8rem, 3.4vw, 2.5rem); line-height: 1.15; font-weight: 750; letter-spacing: -.025em; }
.page-heading > span, .page-heading > div > span, .section-heading > div > span { display: block; max-width: 60ch; margin-top: 12px; color: var(--muted); font-size: 1rem; }
.page-heading-row, .section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.page-heading > *, .page-heading > div > *, .page-heading-row > .button { animation: rise-in .6s var(--ease) both; }
.page-heading > :nth-child(2), .page-heading > div > :nth-child(2) { animation-delay: .05s; }
.page-heading > :nth-child(3), .page-heading > div > :nth-child(3), .page-heading-row > .button { animation-delay: .1s; }
@keyframes rise-in { from { opacity: 0; transform: translateY(10px); } }

/* Reveal + card motion */
html.js [data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease) var(--reveal-delay, 0ms), transform .6s var(--ease) var(--reveal-delay, 0ms); }
html.js [data-reveal].is-visible { opacity: 1; transform: none; }
[data-fade-card] { opacity: 0; }
[data-fade-card][data-card-motion="visible"] { animation: card-rise .6s var(--ease) var(--card-fade-delay, 0ms) both; }
[data-fade-card][data-card-motion="done"] { opacity: 1; }
@keyframes card-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   Home
   ========================================================================== */
.home-stage { position: relative; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; overflow: hidden; isolation: isolate; background: var(--bg); color: var(--text); }
.home-backdrop { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.home-backdrop img { width: 100%; height: 100%; object-fit: cover; object-position: center 35%; filter: saturate(.85); animation: fade-in 1.2s var(--ease) both; }
@keyframes fade-in { from { opacity: 0; } }
.home-stage::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, var(--bg) 0%, rgba(12, 12, 14, 0) 24%), linear-gradient(90deg, rgba(12, 12, 14, .92) 0%, rgba(12, 12, 14, .78) 45%, rgba(12, 12, 14, .8) 100%); }
:root:not([data-theme="dark"]) .home-stage::before { background: linear-gradient(0deg, #f7f6f3 0%, rgba(247, 246, 243, .7) 7%, rgba(247, 246, 243, 0) 24%), linear-gradient(90deg, rgba(12, 12, 14, .92) 0%, rgba(12, 12, 14, .78) 45%, rgba(12, 12, 14, .8) 100%); }
.home-grid { position: relative; width: min(var(--content-max), calc(100% - var(--gutter) * 2)); margin: 0 auto; padding: calc(var(--nav-h) + var(--nav-top) + 56px) 0 112px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(48px, 7vw, 112px); align-items: center; }
.home-profile { min-width: 0; text-align: left; }
.home-profile > * { animation: rise-in .8s var(--ease) both; }
.home-profile > :nth-child(2) { animation-delay: .1s; }
.home-profile > :nth-child(3) { animation-delay: .16s; }
.home-profile > :nth-child(4) { animation-delay: .22s; }
.home-profile > :nth-child(5) { animation-delay: .28s; }
.profile-avatar-stage { position: relative; width: 112px; height: 112px; margin: 0 0 36px; border-radius: 50%; isolation: isolate; }
.profile-avatar-stage::after { content: ""; position: absolute; inset: -7px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 50%; pointer-events: none; }
.profile-particles, .profile-avatar { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; }
.profile-particles { z-index: 2; pointer-events: none; transition: opacity .65s ease, filter .65s ease; }
.profile-avatar { z-index: 1; object-fit: cover; opacity: 0; backface-visibility: hidden; will-change: transform; transition: opacity .65s ease; }
.profile-avatar-stage.is-assembled .profile-particles { opacity: 0; filter: blur(5px); }
.profile-avatar-stage.is-assembled .profile-avatar { opacity: 1; }
.profile-avatar-stage.is-ready .profile-particles { display: none; }
.avatar-style-switch { position: absolute; z-index: 5; left: calc(100% + 24px); top: 50%; min-height: 30px; display: inline-flex; align-items: center; gap: 7px; padding: 0 12px 0 10px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; background: rgba(12, 12, 14, .5); transform: translateY(-50%); white-space: nowrap; color: rgba(237, 237, 240, .85); font-size: .74rem; font-weight: 500; transition: border-color .2s, color .2s, opacity .25s, transform .25s; }
.avatar-style-switch .icon, .avatar-style-switch .archlinux-logo { width: .85rem; height: .85rem; color: #8fb9df; }
.avatar-style-switch .archlinux-logo { fill: currentColor; }
.avatar-style-switch:hover { border-color: rgba(255, 255, 255, .45); color: #fff; }
.desktop-transitioning .avatar-style-switch { opacity: 0; pointer-events: none; }
.desktop-transitioning .profile-avatar, .desktop-transitioning .profile-particles { opacity: 0 !important; }
.profile-overline { margin: 0 0 14px; color: rgba(237, 237, 240, .55); font: 500 .72rem/1.2 var(--font-mono); letter-spacing: .28em; }
.profile-name { margin: 0 0 20px; font-family: var(--font-display); font-size: clamp(3.2rem, 7vw, 6rem); line-height: 1; font-weight: 800; letter-spacing: -.045em; color: #fff; }
.profile-name span { display: inline-block; }
.profile-name-em { margin: 0 .05em 0 .02em; font-family: Georgia, "Times New Roman", serif; font-style: italic; font-weight: 400; letter-spacing: -.02em; color: var(--accent); }
.profile-bio { max-width: 540px; min-height: 1.8em; margin: 0 0 36px; color: rgba(237, 237, 240, .72); font-size: 1.1rem; line-height: 1.65; }
.profile-bio.is-typing::after { content: ""; display: inline-block; width: 1px; height: 1em; margin-left: 4px; background: var(--accent); vertical-align: -.14em; animation: typewriter-caret .9s step-end infinite; }
@keyframes typewriter-caret { 0%, 45% { opacity: 1; } 46%, 100% { opacity: 0; } }
.profile-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.profile-actions .button { min-height: 44px; padding: 0 20px; }
.home-left { min-width: 0; display: grid; align-content: center; animation: rise-in .9s .3s var(--ease) both; }
.home-kicker { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; color: rgba(237, 237, 240, .5); font: 500 .72rem/1.2 var(--font-mono); letter-spacing: .22em; }
.kicker-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.home-doc-list { display: grid; }
.home-doc-item { position: relative; min-width: 0; border-top: 1px solid rgba(255, 255, 255, .12); }
.home-doc-item > .home-card-content { padding: 22px 0; }
.panel-eyebrow { display: block; margin-bottom: 10px; color: rgba(237, 237, 240, .45); font: 500 .7rem/1 var(--font-mono); letter-spacing: .16em; text-transform: uppercase; }
.visitor-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.visitor-strip > .visitor-values { padding: 22px 0; }
.visitor-values > div { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "dot label" "value value"; align-items: center; column-gap: 8px; row-gap: 10px; }
.visitor-values > div + div { padding-left: 20px; border-left: 1px solid rgba(255, 255, 255, .1); }
.visitor-strip small { grid-area: label; color: rgba(237, 237, 240, .55); font-size: .76rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.visitor-strip strong { grid-area: value; font: 600 1.75rem/1 var(--font-mono); letter-spacing: -.04em; font-variant-numeric: tabular-nums; color: #fff; }
.visitor-dot { grid-area: dot; width: 5px; height: 5px; border-radius: 50%; background: rgba(237, 237, 240, .35); }
.visitor-dot.online { background: var(--green); }
.status-panel h2 { margin: 0 0 6px; font-size: 1.2rem; line-height: 1.45; font-weight: 650; color: #fff; }
.status-panel p { margin: 0; color: rgba(237, 237, 240, .62); }
.status-line { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; color: rgba(237, 237, 240, .7); font: 500 .76rem/1 var(--font-mono); font-variant-numeric: tabular-nums; }
.status-line span { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.status-panel .site-uptime { margin: 10px 0 0; color: rgba(237, 237, 240, .55); font-size: .8rem; }
.site-uptime strong { color: #fff; font-family: var(--font-mono); font-weight: 600; font-variant-numeric: tabular-nums; }
.site-uptime small { font-family: var(--font-mono); opacity: .8; }
.contact-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.contact-links > a { min-width: 0; min-height: 60px; display: grid; grid-template-columns: 22px minmax(0, 1fr) 14px; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid rgba(255, 255, 255, .12); border-radius: var(--radius); transition: border-color .2s, background .2s; }
.contact-links > a:hover { border-color: rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .04); }
.contact-links > a > .icon:first-child { width: 1.15rem; height: 1.15rem; color: #fff; }
.contact-links span { min-width: 0; display: grid; }
.contact-links strong, .contact-links small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-links strong { font-size: .86rem; font-weight: 600; color: #fff; }
.contact-links small { color: rgba(237, 237, 240, .5); font: .7rem/1.4 var(--font-mono); }
.contact-links .contact-tail { width: .8rem; height: .8rem; color: rgba(237, 237, 240, .4); transition: color .2s, transform .25s var(--ease); }
.contact-links > a:hover .contact-tail { color: #fff; transform: translate(2px, -2px); }
.home-scroll-cue { position: absolute; z-index: 2; left: 50%; bottom: 28px; display: inline-flex; align-items: center; gap: 8px; color: rgba(237, 237, 240, .45); font: 500 .66rem/1 var(--font-mono); letter-spacing: .24em; text-transform: uppercase; transform: translateX(-50%); transition: color .2s; }
.home-scroll-cue:hover { color: rgba(237, 237, 240, .85); }
.home-scroll-cue .icon { width: .85rem; height: .85rem; }
:root:not([data-theme="dark"]) .home-scroll-cue { color: rgba(20, 20, 22, .45); }
html.from-hypr-desktop body[data-section="home"] .site-shell { animation: classic-shell-return .78s cubic-bezier(.22, .8, .26, 1) both; }
@keyframes classic-shell-return { from { opacity: 0; transform: scale(1.025); filter: blur(12px); } 55% { opacity: 1; filter: blur(1px); } to { opacity: 1; transform: none; filter: none; } }

/* Home sections */
.home-section { position: relative; width: min(var(--content-max), calc(100% - var(--gutter) * 2)); margin: 0 auto; padding-top: 120px; }
.home-latest { padding-top: 72px; }
.latest-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 16px; }
.latest-card { position: relative; min-width: 0; display: grid; grid-template-columns: 38% minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--card); box-shadow: var(--shadow); overflow: hidden; transition: border-color .2s; }
.latest-card:hover { border-color: var(--line-strong); }
.latest-card.is-lead { grid-row: 1 / span 3; grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
.latest-cover { display: block; position: relative; overflow: hidden; background: var(--surface-2); min-height: 124px; }
.latest-card.is-lead .latest-cover { aspect-ratio: 16 / 9; }
.latest-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.latest-card:hover .latest-cover img { transform: scale(1.03); }
.latest-body { min-width: 0; display: flex; flex-direction: column; padding: 18px 20px; }
.latest-card.is-lead .latest-body { padding: 24px 26px 26px; }
.latest-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--faint); font: 500 .72rem/1.4 var(--font-mono); }
.latest-meta span { color: var(--muted); }
.latest-card h3 { margin: 8px 0 6px; font-size: 1rem; line-height: 1.5; font-weight: 650; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.latest-card.is-lead h3 { font-size: clamp(1.3rem, 2vw, 1.6rem); line-height: 1.35; margin: 12px 0 10px; letter-spacing: -.015em; font-weight: 700; }
.latest-card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.latest-card p { margin: 0; color: var(--muted); font-size: .9rem; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.latest-card:not(.is-lead) p { display: none; }
.latest-locked { display: flex; align-items: center; gap: 8px; }
.latest-locked .icon { width: .9rem; height: .9rem; }
.latest-read { margin-top: auto; padding-top: 14px; color: var(--faint); font: 500 .72rem/1 var(--font-mono); }

/* Explore grid */
.explore-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--line); overflow: hidden; }
.explore-card { position: relative; min-width: 0; min-height: 250px; display: flex; flex-direction: column; padding: 28px; background: var(--bg); transition: background .25s; }
.explore-card:hover { background: var(--card-hover); }
.explore-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 36px; color: var(--faint); }
.explore-head span { font: 500 .72rem/1 var(--font-mono); letter-spacing: .1em; }
.explore-head .icon { width: 1.15rem; height: 1.15rem; color: var(--muted); transition: color .25s; }
.explore-card:hover .explore-head .icon { color: var(--accent); }
.explore-card h3 { margin: 0 0 8px; font-size: 1.15rem; font-weight: 650; letter-spacing: -.01em; }
.explore-card p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.7; }
.explore-figure { display: flex; align-items: baseline; gap: 10px; min-width: 0; margin-top: auto; padding-top: 28px; }
.explore-figure strong { font: 600 2.2rem/1 var(--font-mono); letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.explore-figure span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--faint); font-size: .8rem; }
.explore-arrow { margin-left: auto; width: 1rem; height: 1rem; color: var(--faint); transition: transform .25s var(--ease), color .25s; }
.explore-card:hover .explore-arrow { color: var(--text); transform: translate(2px, -2px); }

/* Classic workspace -> HyDE desktop transition */
.desktop-transition-overlay { position: fixed; z-index: 3000; inset: 0; overflow: hidden; background: rgba(5, 7, 10, 0); pointer-events: all; isolation: isolate; animation: desktop-transition-shade 3.2s ease both; }
.desktop-transition-canvas { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; }
.desktop-transition-loading { position: absolute; z-index: 4; left: 50%; top: 50%; display: grid; justify-items: center; gap: 14px; opacity: 0; transform: translate(-50%, -50%) scale(.9); transition: opacity .35s ease, transform .45s cubic-bezier(.22, .88, .25, 1); }
.desktop-transition-overlay.is-loading .desktop-transition-loading { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.desktop-transition-overlay.is-barrage .desktop-transition-loading { opacity: 0; transform: translate(-50%, -50%) scale(1.08); }
.desktop-transition-loader { position: relative; width: 62px; height: 62px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 50%; }
.desktop-transition-loader::before, .desktop-transition-loader::after { content: ""; position: absolute; border-radius: 50%; inset: 6px; border: 2px solid transparent; border-top-color: #e8a084; animation: desktop-loader-spin .9s linear infinite; }
.desktop-transition-loader::after { inset: 15px; border-top-color: transparent; border-right-color: #cf8063; animation-direction: reverse; animation-duration: .65s; }
.desktop-transition-loading strong { font: 700 .7rem/1 var(--font-mono); letter-spacing: .2em; color: #f5f3ef; }
.desktop-transition-loading small { color: #9b9a98; font-size: .68rem; }
.desktop-transition-progress { width: 180px; height: 2px; overflow: hidden; border-radius: 2px; background: rgba(255, 255, 255, .12); }
.desktop-transition-progress span { display: block; width: 100%; height: 100%; background: #e8a084; transform: scaleX(var(--transition-progress, 0)); transform-origin: left; transition: transform .1s linear; }
.desktop-transition-barrage { position: absolute; z-index: 3; inset: 0; overflow: hidden; opacity: 0; transition: opacity .22s ease; pointer-events: none; }
.desktop-transition-overlay.is-barrage .desktop-transition-barrage { opacity: 1; }
.desktop-transition-barrage span { --barrage-y: 20%; --barrage-delay: 0s; position: absolute; top: var(--barrage-y); left: 100%; width: max-content; padding: 7px 16px; border: 1px solid rgba(255, 255, 255, .13); border-radius: 20px; background: rgba(14, 18, 24, .7); color: rgba(239, 247, 255, .84); font: 600 clamp(.68rem, 1.2vw, .88rem)/1 var(--font-mono); letter-spacing: .13em; }
.desktop-transition-overlay.is-barrage .desktop-transition-barrage span { animation: desktop-barrage 1.35s var(--barrage-delay) cubic-bezier(.16, .78, .26, 1) both; }
.desktop-transition-barrage span:nth-child(2) { --barrage-y: 32%; --barrage-delay: .08s; }
.desktop-transition-barrage span:nth-child(3) { --barrage-y: 44%; --barrage-delay: .16s; }
.desktop-transition-barrage span:nth-child(4) { --barrage-y: 56%; --barrage-delay: .04s; }
.desktop-transition-barrage span:nth-child(5) { --barrage-y: 68%; --barrage-delay: .2s; }
.desktop-transition-barrage span:nth-child(6) { --barrage-y: 80%; --barrage-delay: .12s; }
@keyframes desktop-transition-shade { 0%, 12% { background: rgba(5, 7, 10, 0); backdrop-filter: blur(0); } 48% { background: rgba(5, 7, 10, .6); backdrop-filter: blur(5px); } 75%, 100% { background: #070b11; backdrop-filter: blur(12px); } }
@keyframes desktop-loader-spin { to { transform: rotate(360deg); } }
@keyframes desktop-barrage { 0% { transform: translateX(5vw); opacity: 0; } 12% { opacity: 1; } 100% { transform: translateX(calc(-100vw - 100%)); opacity: .18; } }

/* ==========================================================================
   Blog & lists
   ========================================================================== */
.taxonomy-strip { display: flex; gap: 6px; overflow-x: auto; padding: 0 0 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.taxonomy-strip::-webkit-scrollbar { display: none; }
.taxonomy-strip a, .taxonomy-strip button { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); font-size: .85rem; white-space: nowrap; transition: color .2s, background .2s, border-color .2s; }
.taxonomy-strip a:hover, .taxonomy-strip button:hover { color: var(--text); background: var(--surface-2); }
.taxonomy-strip a.active, .taxonomy-strip button.active { color: var(--text); border-color: var(--line-strong); background: var(--surface-2); }
.taxonomy-strip span { color: var(--faint); font: 500 .68rem/1 var(--font-mono); }
.blog-layout { display: grid; grid-template-columns: minmax(0, 1fr) 248px; gap: 32px; align-items: start; }
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.post-card { position: relative; min-width: 0; height: 100%; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--card); box-shadow: var(--shadow); overflow: hidden; transition: border-color .2s; }
.post-card:hover { border-color: var(--line-strong); }
.post-card.is-progressive-hidden { display: none !important; }
.post-card.is-card-entering { animation: card-rise .6s var(--ease) both; }
.post-media { position: relative; flex: 0 0 auto; overflow: hidden; aspect-ratio: 16 / 10; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.post-cover { display: block; width: 100%; height: 100%; }
.post-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.post-card:hover .post-cover img { transform: scale(1.03); }
.post-cover img:not([src]) { opacity: 0; }
.post-chip, .post-pin, .post-lock { position: absolute; z-index: 3; display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px; background: rgba(12, 12, 14, .62); color: #fff; font-size: .7rem; font-weight: 500; }
.post-chip { left: 10px; top: 10px; transition: background .2s; }
.post-chip:hover { background: rgba(12, 12, 14, .85); }
.post-pin { right: 10px; top: 10px; background: var(--accent); color: #fff; }
.post-pin .icon, .post-lock .icon { width: .75rem; height: .75rem; }
.post-lock { right: 10px; bottom: 10px; width: 24px; padding: 0; justify-content: center; }
.post-card-body { min-width: 0; flex: 1; display: flex; flex-direction: column; padding: 16px 18px 16px; }
.post-card-top { display: flex; align-items: center; gap: 8px; color: var(--faint); font: 500 .72rem/1.4 var(--font-mono); }
.post-card-top > * + *::before { content: "/"; margin-right: 8px; opacity: .6; }
.post-card-top a { color: var(--muted); }
.post-card h2 { min-width: 0; margin: 8px 0 6px; font-size: 1.04rem; line-height: 1.5; font-weight: 650; }
.post-card h2 a { display: flex; align-items: flex-start; gap: 7px; min-width: 0; }
.post-card h2 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.post-card h2 a span { min-width: 0; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.post-card h2 .icon { width: .9rem; height: .9rem; color: var(--accent); margin-top: .34rem; }
.post-card p { margin: 0; color: var(--muted); font-size: .85rem; line-height: 1.7; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; overflow-wrap: anywhere; }
.post-card-foot { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 14px; }
.post-card-foot > div { display: flex; gap: 10px; min-width: 0; overflow: hidden; }
.post-card-foot > div a { color: var(--faint); font: 500 .72rem/1.4 var(--font-mono); white-space: nowrap; transition: color .2s; }
.post-card-foot > div a:hover { color: var(--text); }
.post-open { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 auto; color: var(--faint); transition: color .2s; }
.post-open .icon { width: .95rem; height: .95rem; transition: transform .25s var(--ease); }
.post-card:hover .post-open { color: var(--text); }
.post-card:hover .post-open .icon { transform: translate(2px, -2px); }
.post-load-sentinel { height: 48px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.post-load-sentinel[hidden] { display: none; }
.post-load-sentinel span { width: 4px; height: 4px; border-radius: 50%; background: var(--faint); animation: post-load-pulse 1.15s ease-in-out infinite; }
.post-load-sentinel span:nth-child(2) { animation-delay: .14s; }
.post-load-sentinel span:nth-child(3) { animation-delay: .28s; }
@keyframes post-load-pulse { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

/* Pagination */
.hugo-pagination { margin-top: 44px; display: grid; grid-template-columns: 40px minmax(0, auto) 40px; justify-content: center; align-items: center; gap: 8px; }
.pagination-pages { display: flex; align-items: center; justify-content: center; gap: 2px; }
.pagination-control, .pagination-page { width: 36px; height: 36px; display: inline-grid; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--muted); font: 500 .84rem/1 var(--font-mono); transition: background .2s, color .2s, border-color .2s; }
.pagination-control { width: 40px; height: 40px; border-color: var(--line); }
.pagination-control:hover, .pagination-page:hover { background: var(--surface-2); color: var(--text); }
.pagination-control .icon { width: .95rem; height: .95rem; }
.pagination-control.disabled { opacity: .35; pointer-events: none; }
.pagination-page.active { background: var(--text); color: var(--on-primary); }
.pagination-gap { width: 20px; text-align: center; color: var(--faint); }
.pagination-summary { grid-column: 1 / -1; margin-top: 6px; color: var(--faint); font: 500 .7rem/1 var(--font-mono); text-align: center; }

/* Blog aside */
.blog-aside { position: sticky; top: calc(var(--nav-h) + var(--nav-top) + 24px); display: grid; gap: 28px; }
.blog-aside section { padding-top: 16px; border-top: 1px solid var(--line); }
.section-title { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; color: var(--muted); font: 500 .7rem/1 var(--font-mono); letter-spacing: .16em; text-transform: uppercase; }
.section-title .icon { display: none; }
.year-chart { list-style: none; display: flex; align-items: flex-end; gap: 10px; height: 120px; margin: 0; padding: 0; }
.year-chart li { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; }
.year-chart b { font: 500 .66rem/1 var(--font-mono); color: var(--faint); }
.year-chart span { width: 100%; max-width: 22px; height: var(--h); min-height: 3px; border-radius: 3px; background: var(--surface-3); transform-origin: bottom; animation: bar-rise .8s var(--ease) both; }
.year-chart li:last-child span { background: var(--accent); }
.year-chart li:last-child b { color: var(--text); }
@keyframes bar-rise { from { transform: scaleY(0); } }
.year-chart small { font: 500 .66rem/1 var(--font-mono); color: var(--faint); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.tag-cloud a { color: var(--muted); font-size: .82rem; transition: color .2s; }
.tag-cloud a:hover { color: var(--text); }
.tag-cloud sup { margin-left: 2px; color: var(--faint); font: 500 .6rem/1 var(--font-mono); }

/* Taxonomy index */
.term-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--line); overflow: hidden; }
.term-card { position: relative; min-height: 88px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: space-between; gap: 14px 10px; padding: 16px 18px; background: var(--bg); transition: background .2s; }
.term-card:hover { background: var(--card-hover); }
.term-name { min-width: 0; font-weight: 600; font-size: .98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.term-count { font: 500 .78rem/1.6 var(--font-mono); color: var(--faint); }
.term-bar { grid-column: 1 / -1; height: 2px; border-radius: 2px; background: var(--surface-2); overflow: hidden; position: relative; }
.term-bar::after { content: ""; position: absolute; inset: 0; width: calc(var(--weight, 0) * 100%); min-width: 4%; background: var(--muted); }
.term-card:hover .term-bar::after { background: var(--accent); }

/* ==========================================================================
   Article
   ========================================================================== */
.reading-progress { position: fixed; z-index: 70; top: 0; left: 0; right: 0; height: 2px; pointer-events: none; }
.reading-progress span { display: block; height: 100%; background: var(--accent); transform: scaleX(var(--progress, 0)); transform-origin: left; }
.article-shell { position: relative; width: min(1040px, calc(100% - var(--gutter) * 2)); margin: 0 auto; padding: calc(var(--nav-h) + var(--nav-top) + 64px) 0 24px; }
.article-header { max-width: 760px; margin: 0 auto 44px; text-align: center; }
.article-header > * { animation: rise-in .6s var(--ease) both; }
.article-header > :nth-child(n+3) { animation-delay: .06s; }
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 28px; color: var(--faint); font-size: .82rem; transition: color .2s; }
.back-link:hover { color: var(--text); }
.back-link .icon { width: .9rem; height: .9rem; transition: transform .25s var(--ease); }
.back-link:hover .icon { transform: translateX(-3px); }
.article-labels { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 18px; }
.article-labels:empty { display: none; }
.article-header h1 { margin: 0; font-family: var(--font-display); font-size: clamp(2rem, 4.2vw, 3rem); line-height: 1.22; font-weight: 750; letter-spacing: -.025em; text-wrap: balance; overflow-wrap: anywhere; }
.article-meta { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 8px 18px; margin-top: 22px; color: var(--faint); font: 500 .76rem/1.4 var(--font-mono); }
.article-meta span { display: inline-flex; align-items: center; gap: 6px; }
.article-meta .icon { width: .85rem; height: .85rem; }
.article-author { color: var(--muted); font-family: var(--font-sans); font-weight: 600; font-size: .84rem; }
.article-author img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.tag-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 14px; margin-top: 14px; }
.tag-row a { color: var(--faint); font: 500 .76rem/1.6 var(--font-mono); transition: color .2s; }
.tag-row a:hover { color: var(--text); }
.article-cover { margin: 0 auto 56px; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); }
.article-cover img { width: 100%; max-height: 520px; object-fit: cover; border-radius: var(--radius-lg); }
.article-layout { display: grid; grid-template-columns: minmax(0, 720px) 200px; justify-content: center; gap: 72px; align-items: start; }
.article-main { min-width: 0; }
.article-toc { position: sticky; top: calc(var(--nav-h) + var(--nav-top) + 32px); max-height: calc(100vh - var(--nav-h) - var(--nav-top) - 64px); display: flex; flex-direction: column; font-size: .8rem; color: var(--muted); }
.article-toc > span { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; color: var(--faint); font: 500 .7rem/1 var(--font-mono); letter-spacing: .16em; text-transform: uppercase; }
.article-toc > span .icon { display: none; }
.article-toc > div[data-article-toc-nav], .article-toc > nav { min-height: 0; overflow: auto; scrollbar-width: none; }
.article-toc nav ul { list-style: none; margin: 0; padding: 0; }
.article-toc nav ul ul { padding-left: 12px; }
.article-toc nav a, .generated-article-toc a { display: block; padding: 5px 0 5px 12px; border-left: 1px solid var(--line); color: var(--faint); line-height: 1.5; transition: color .2s, border-color .2s; }
.generated-article-toc { display: grid; }
.generated-article-toc .toc-level-2 { padding-left: 24px; font-size: .76rem; }
.article-toc nav a:hover, .generated-article-toc a:hover { color: var(--text); }
.generated-article-toc a.active { color: var(--text); border-left-color: var(--accent); }
.toc-progress { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.toc-progress span { flex: 1; height: 2px; background: var(--line); overflow: hidden; }
.toc-progress i { display: block; height: 100%; background: var(--text); transform: scaleX(var(--progress, 0)); transform-origin: left; }
.toc-progress b { min-width: 3ch; font: 500 .68rem/1 var(--font-mono); color: var(--faint); text-align: right; }

/* Prose */
.markdown-content { color: var(--prose); font-size: 1.03rem; line-height: 1.9; overflow-wrap: anywhere; }
.markdown-content > *:first-child { margin-top: 0; }
.markdown-content h1, .markdown-content h2, .markdown-content h3, .markdown-content h4, .markdown-content h5 { color: var(--text); line-height: 1.4; font-weight: 700; letter-spacing: -.01em; margin: 2.2em 0 .8em; scroll-margin-top: calc(var(--nav-h) + var(--nav-top) + 24px); }
.markdown-content h1 { font-size: 1.7rem; padding-bottom: .45em; border-bottom: 1px solid var(--line); }
.markdown-content h2 { font-size: 1.4rem; }
.markdown-content h3 { font-size: 1.16rem; }
.markdown-content h4 { font-size: 1.04rem; }
.markdown-content p { margin: 1.15em 0; }
.markdown-content strong { color: var(--text); font-weight: 650; }
.markdown-content a { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 4px; transition: color .2s; }
.markdown-content a:hover { color: var(--accent); }
.markdown-content ul, .markdown-content ol { padding-left: 1.4em; }
.markdown-content li { margin: .35em 0; }
.markdown-content li::marker { color: var(--faint); }
.markdown-content img, .markdown-content video { max-width: 100%; height: auto; margin: 1.8em auto; border-radius: var(--radius); border: 1px solid var(--line); }
.markdown-content img { cursor: zoom-in; }
.markdown-content code { font-family: var(--font-mono), "Microsoft YaHei UI", monospace; font-size: .86em; }
.markdown-content :not(pre) > code { padding: .14em .4em; border-radius: 5px; background: var(--surface-2); color: var(--text); overflow-wrap: anywhere; word-break: break-word; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.markdown-content blockquote { margin: 1.6em 0; padding: 2px 0 2px 20px; border-left: 2px solid var(--line-strong); color: var(--muted); }
.markdown-content blockquote > :first-child { margin-top: 0; }
.markdown-content blockquote > :last-child { margin-bottom: 0; }
.markdown-content table { width: 100%; display: block; overflow: auto; margin: 1.6em 0; border-collapse: collapse; font-size: .9rem; }
.markdown-content th, .markdown-content td { padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; text-align: left; }
.markdown-content th { color: var(--text); font-weight: 650; border-bottom-color: var(--line-strong); }
.markdown-content table[border], .markdown-content table[border] :is(th, td) { border: 0; border-bottom: 1px solid var(--line); }
.markdown-content table[border] th { border-bottom-color: var(--line-strong); }
.markdown-content table caption { caption-side: top; padding: 0 0 10px; color: var(--faint); font: 500 .74rem/1.4 var(--font-mono); text-align: left; letter-spacing: .06em; }
.markdown-content hr { height: 1px; margin: 3em 0; border: 0; background: var(--line); }
.markdown-content mark { padding: 0 .15em; border-radius: 3px; background: var(--accent-soft); color: var(--text); }
.markdown-content iframe { max-width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.markdown-content .katex-display { overflow-x: auto; overflow-y: hidden; padding: 6px 0; }
.markdown-content .katex { font-size: 1.08em; }
.markdown-content .math-error { color: var(--danger); }
.post-card p.post-locked { color: var(--faint); font-style: italic; }
.web-page-embed { margin: 1.6rem 0; }
.web-page-embed iframe { width: 100%; min-height: 320px; }
.web-page-embed-open { display: inline-block; margin-top: 8px; font-size: .8rem; }
.hugo-link-card { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 1.2em 0; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none !important; color: var(--text) !important; transition: border-color .2s; }
.hugo-link-card:hover { border-color: var(--line-strong); }

/* Code blocks */
.markdown-content .highlight { margin: 1.6em 0; }
.code-block-shell { position: relative; margin: 1.6em 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--code-bg); overflow: hidden; }
.highlight .code-block-shell { margin: 0; }
.code-block-head { height: 36px; display: flex; align-items: center; gap: 12px; padding: 0 6px 0 16px; border-bottom: 1px solid var(--line); }
.code-lang { color: var(--faint); font: 500 .68rem/1 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.code-block-shell pre, .markdown-content pre { margin: 0; overflow: auto; padding: 16px 18px; background: transparent; color: var(--c-text); font-size: .86rem; line-height: 1.75; tab-size: 4; scrollbar-width: thin; }
.markdown-content pre:not(.code-block-shell pre) { border: 1px solid var(--line); border-radius: var(--radius); background: var(--code-bg); }
.code-copy-button, .code-expand-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: transparent; color: var(--faint); font: 500 .72rem/1 var(--font-sans); transition: color .2s, background .2s; }
.code-copy-button { margin-left: auto; height: 26px; padding: 0 9px; border-radius: 6px; }
.code-copy-button:hover, .code-expand-button:hover { color: var(--text); background: var(--surface-2); }
.code-copy-button .icon, .code-expand-button .icon { width: .82rem; height: .82rem; }
.code-block-shell.is-collapsible.is-collapsed pre { max-height: 460px; overflow: hidden; }
.code-block-shell.is-collapsible.is-collapsed::after { content: ""; position: absolute; z-index: 1; left: 0; right: 0; bottom: 38px; height: 90px; pointer-events: none; background: linear-gradient(180deg, transparent, var(--code-bg)); }
.code-expand-button { position: relative; z-index: 2; width: 100%; height: 38px; border-top: 1px solid var(--line); border-radius: 0; }

/* Chroma tokens */
.chroma { color: var(--c-text); background: transparent; }
.chroma .line { display: block; }
.chroma .hl { display: block; margin: 0 -18px; padding: 0 18px; background: var(--surface-2); }
.chroma .ln, .chroma .lnt { margin-right: 1em; color: var(--faint); user-select: none; }
.chroma .lntable { border-spacing: 0; }
.chroma .lntd { padding: 0; vertical-align: top; }
.chroma .err { color: var(--danger); }
.chroma :is(.k, .kc, .kd, .kn, .kp, .kr, .ow) { color: var(--c-keyword); }
.chroma .kt { color: var(--c-type); }
.chroma :is(.n, .nx, .nv, .vc, .vg, .vi, .vm, .py) { color: var(--c-text); }
.chroma :is(.na, .nd) { color: var(--c-type); }
.chroma :is(.nb, .bp, .ne, .nl) { color: var(--c-builtin); }
.chroma :is(.nc, .nn, .no) { color: var(--c-type); }
.chroma :is(.nf, .fm) { color: var(--c-function); }
.chroma .nt { color: var(--c-tag); }
.chroma :is(.s, .sa, .sb, .sc, .dl, .sd, .s1, .s2, .sh, .sx, .ss) { color: var(--c-string); }
.chroma :is(.se, .si, .sr) { color: var(--c-operator); }
.chroma :is(.m, .mb, .mf, .mh, .mi, .il, .mo, .l, .ld) { color: var(--c-number); }
.chroma .o { color: var(--c-operator); }
.chroma .p { color: var(--c-punct); }
.chroma :is(.c, .ch, .cm, .c1, .cs) { color: var(--c-comment); font-style: italic; }
.chroma :is(.cp, .cpf) { color: var(--c-keyword); }
.chroma .gd { color: var(--danger); }
.chroma .gi { color: var(--green); }
.chroma .ge { font-style: italic; }
.chroma .gs { font-weight: 700; }
.chroma :is(.gh, .gu) { color: var(--c-function); font-weight: 700; }

/* Article footer */
.article-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--line); }
.article-signature { display: flex; align-items: center; gap: 12px; min-width: 0; }
.article-signature img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.article-signature div { display: grid; min-width: 0; }
.article-signature strong { color: var(--text); font-size: .92rem; }
.article-signature span { color: var(--faint); font-size: .78rem; }
.article-neighbors { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; }
.article-neighbors a { min-width: 0; display: grid; gap: 4px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .2s; }
.article-neighbors a:hover { border-color: var(--line-strong); }
.article-neighbors .neighbor-next { text-align: right; }
.article-neighbors small { display: inline-flex; align-items: center; gap: 6px; color: var(--faint); font: 500 .72rem/1.4 var(--font-mono); }
.article-neighbors .neighbor-next small { justify-content: flex-end; }
.article-neighbors small .icon { width: .78rem; height: .78rem; }
.article-neighbors strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: .92rem; }
.article-comments { width: min(992px, 100%); margin: 72px auto 0; padding-top: 28px; border-top: 1px solid var(--line); }
.article-comments > * { max-width: 720px; }
.article-comments h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 20px; color: var(--faint); font: 500 .72rem/1 var(--font-mono); letter-spacing: .16em; text-transform: uppercase; }
.article-comments h2 .icon { display: none; }
.article-float-controls { position: fixed; z-index: 38; right: 24px; bottom: 28px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity .25s var(--ease), transform .25s var(--ease); }
.article-float-controls.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.article-float-button { position: relative; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--card); color: var(--muted); box-shadow: var(--shadow); transition: color .2s, border-color .2s; }
.article-float-button:hover { color: var(--text); border-color: var(--line-strong); }
.article-float-button .icon { width: 1rem; height: 1rem; }
.float-ring { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); transform: rotate(-90deg); pointer-events: none; }
.float-ring circle { fill: none; stroke-width: 1.5; }
.float-ring circle:first-child { stroke: transparent; }
.float-ring circle:last-child { stroke: var(--accent); stroke-dasharray: 138.2; stroke-dashoffset: calc(138.2 * (1 - var(--progress, 0))); }
.mobile-article-actions, .article-actions-toggle { display: none; }
.hugo-password-protection { padding: 32px 0; }
.hugo-password-container { max-width: 400px; margin: 0 auto; padding: 32px 24px; text-align: center; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.hugo-password-container h2 { margin: 12px 0 6px; font-size: 1.2rem; }
.hugo-password-lock { font-size: 1.6rem; }
.hugo-password-description, .hugo-password-hint { margin: 6px 0; color: var(--muted); font-size: .88rem; }
.hugo-password-form { display: grid; gap: 10px; margin: 20px auto 0; }
.hugo-password-input { min-height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: transparent; color: var(--text); outline: 0; transition: border-color .2s; }
.hugo-password-input:focus { border-color: var(--text); }
.hugo-password-submit { min-height: 44px; border: 0; border-radius: 10px; background: var(--text); color: var(--on-primary); font-weight: 600; }
.hugo-password-error { min-height: 1.4em; color: var(--danger); font-size: .84rem; }

/* ==========================================================================
   Dialogs
   ========================================================================== */
dialog { color: var(--text); }
dialog::backdrop { background: rgba(0, 0, 0, .55); transition: opacity .2s; }
.search-dialog, .article-toc-dialog, .modal { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; }
:is(.search-panel, .account-dialog, .article-toc-dialog > section, .friends-apply-dialog) { transition: opacity .2s var(--ease), transform .25s var(--ease); }
@starting-style {
  dialog[open] :is(.search-panel, .article-toc-dialog > section), dialog.account-dialog[open], dialog.friends-apply-dialog[open] { opacity: 0; transform: translateY(8px); }
  dialog[open]::backdrop { opacity: 0; }
}
.search-panel { width: min(640px, calc(100% - 28px)); margin: 12vh auto 0; display: flex; flex-direction: column; max-height: 74vh; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--sheet); box-shadow: var(--shadow-pop); overflow: hidden; }
.search-input-row { height: 58px; display: flex; align-items: center; gap: 12px; padding: 0 10px 0 18px; border-bottom: 1px solid var(--line); }
.search-input-row > .icon { color: var(--faint); }
.search-input-row input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 1.02rem; }
.search-input-row input::placeholder { color: var(--faint); }
.search-input-row input::-webkit-search-cancel-button { display: none; }
.search-hint { padding: 12px 20px 6px; color: var(--faint); font: 500 .72rem/1.4 var(--font-mono); }
.search-results { flex: 1; min-height: 0; overflow: auto; padding: 0 8px 8px; scrollbar-width: thin; }
.search-result { display: block; padding: 12px 14px; border-radius: 10px; transition: background .15s; }
.search-result:hover, .search-result.is-active { background: var(--surface-2); }
.search-result strong { display: block; font-size: .95rem; font-weight: 600; }
.search-result p { margin: 4px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.65; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.search-result mark { padding: 0 1px; background: transparent; color: var(--accent); }
.search-pagination { min-height: 52px; display: grid; grid-template-columns: 36px minmax(92px, auto) 36px; align-items: center; justify-content: center; gap: 12px; padding: 8px 16px; border-top: 1px solid var(--line); color: var(--faint); font: 500 .72rem/1 var(--font-mono); }
.search-pagination .pagination-control { width: 36px; height: 36px; }
.search-pagination button:disabled { opacity: .35; pointer-events: none; }
.search-keys { display: flex; justify-content: flex-end; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--line); color: var(--faint); font-size: .72rem; }
.search-keys span { display: inline-flex; align-items: center; gap: 5px; }

.account-dialog { width: min(420px, calc(100% - 28px)); max-height: calc(100dvh - 28px); padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--sheet); color: var(--text); box-shadow: var(--shadow-pop); overflow: auto; }
.account-panel { padding: 24px; }
.account-panel > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.account-panel > header small { color: var(--faint); font: 500 .7rem/1 var(--font-mono); letter-spacing: .12em; }
.account-panel h2 { margin: 8px 0 0; font-size: 1.35rem; }
.account-warning { margin: 18px 0; padding: 0 0 0 14px; border-left: 2px solid var(--amber); color: var(--muted); font-size: .8rem; line-height: 1.7; }
.account-tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px; margin-bottom: 18px; padding: 2px; border-radius: 10px; background: var(--surface-2); }
.account-tabs button { min-height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-weight: 500; transition: background .2s, color .2s; }
.account-tabs button[aria-selected="true"] { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.account-form { display: grid; gap: 14px; }
.account-form label { display: grid; gap: 6px; color: var(--muted); font-size: .8rem; }
.account-form input { width: 100%; min-height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: transparent; color: var(--text); outline: 0; transition: border-color .2s; }
.account-form input:focus { border-color: var(--text); }
.account-hint { margin: 0; color: var(--faint); font-size: .74rem; }
.account-message { min-height: 1.3em; margin: 12px 0 0; color: var(--muted); font-size: .78rem; }
.account-message.error { color: var(--danger); }
.account-signed-in { display: grid; gap: 14px; }
.account-signed-in p { margin: 4px 0; color: var(--muted); }
.account-signed-in strong { color: var(--text); }

.article-toc-dialog > section { width: min(420px, calc(100% - 28px)); max-height: min(72vh, 620px); margin: 14vh auto 0; display: flex; flex-direction: column; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--sheet); box-shadow: var(--shadow-pop); overflow: hidden; }
.article-toc-dialog header { height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 8px 0 18px; border-bottom: 1px solid var(--line); }
.article-toc-dialog header strong { font-size: .92rem; }
.article-toc-dialog > section > nav { overflow: auto; padding: 14px 18px; }
.article-toc-dialog .generated-article-toc a { padding: 9px 0 9px 14px; }
.article-toc-dialog .generated-article-toc .toc-level-2 { padding-left: 28px; }

.lightbox-dialog { width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 4vmin; border: 0; background: transparent; display: grid; place-items: center; cursor: zoom-out; }
.lightbox-dialog:not([open]) { display: none; }
.lightbox-dialog::backdrop { background: rgba(0, 0, 0, .86); }
.lightbox-dialog img { max-width: 100%; max-height: 92vh; object-fit: contain; border-radius: var(--radius-sm); }

/* ==========================================================================
   Tools
   ========================================================================== */
.tool-category + .tool-category { margin-top: 56px; }
.tool-category-heading { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.tool-category-heading > span { color: var(--faint); font: 500 .78rem/1 var(--font-mono); }
.tool-category-heading h2 { margin: 0; font-size: 1.2rem; font-weight: 650; }
.tool-category-heading p { margin: 4px 0 0; color: var(--faint); font-size: .84rem; }
.tool-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tool-card { position: relative; overflow: hidden; isolation: isolate; min-width: 0; min-height: 144px; display: grid; grid-template-columns: 48px minmax(0, 1fr) 18px; align-items: start; gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--card); box-shadow: var(--shadow); transition: border-color .2s; }
.tool-card:hover { border-color: var(--line-strong); }
.tool-card-cover { position: absolute; z-index: -1; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .08; filter: grayscale(.4); -webkit-mask-image: linear-gradient(100deg, transparent 30%, #000 100%); mask-image: linear-gradient(100deg, transparent 30%, #000 100%); transition: opacity .4s var(--ease); }
.tool-card:hover .tool-card-cover { opacity: .18; }
.tool-card-cover.is-missing { display: none; }
.tool-card-icon { width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.tool-card-icon img { width: 100%; height: 100%; object-fit: cover; }
.tool-card h3 { margin: 2px 0 6px; font-size: 1rem; font-weight: 650; }
.tool-card p { margin: 0; color: var(--muted); font-size: .84rem; line-height: 1.65; }
.tool-card small { display: block; margin-top: 12px; color: var(--faint); font: 500 .7rem/1.4 var(--font-mono); }
.tool-card-arrow { align-self: center; color: var(--faint); transition: transform .25s var(--ease), color .2s; }
.tool-card:hover .tool-card-arrow { transform: translateX(3px); color: var(--text); }
.tool-back { margin-bottom: 20px; }
.tool-detail-heading { margin-bottom: 32px; }
.tool-workspace { padding: clamp(18px, 3vw, 28px); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--card); box-shadow: var(--shadow); animation: rise-in .6s .1s var(--ease) both; }
.tool-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.tool-panel-head h2 { margin: 0; font-size: 1.08rem; font-weight: 650; }
.tool-panel-head p { margin: 4px 0 0; color: var(--muted); font-size: .86rem; }
.tool-panel-head > div:last-child { display: flex; gap: 8px; }
.tool-workspace textarea { width: 100%; min-height: 340px; resize: vertical; padding: 16px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--code-bg); color: var(--c-text); outline: 0; font: .88rem/1.7 var(--font-mono), "Microsoft YaHei UI", monospace; transition: border-color .2s; }
.tool-workspace textarea:focus, .tool-workspace input:focus { border-color: var(--text); }
.tool-message { min-height: 1.4em; margin: 10px 0 0; color: var(--green); font: 500 .8rem/1.5 var(--font-mono); }
.tool-message.error { color: var(--danger); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid label, .tool-split label, .uuid-control label, .beast-dictionary label { display: grid; gap: 8px; color: var(--muted); font-size: .8rem; }
.form-grid input, .uuid-control input, .beast-dictionary input { min-width: 0; height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: transparent; color: var(--text); outline: 0; font-family: var(--font-mono); transition: border-color .2s; }
.tool-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.text-stats { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 14px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.text-stats div { padding: 18px; text-align: center; }
.text-stats div + div { border-left: 1px solid var(--line); }
.text-stats strong, .text-stats span { display: block; }
.text-stats strong { font: 600 1.6rem/1.2 var(--font-mono); }
.text-stats span { color: var(--faint); font-size: .76rem; }
.tool-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tool-split textarea { min-height: 310px; }
.uuid-control { display: flex; align-items: end; gap: 10px; margin-bottom: 16px; }
.uuid-control label { width: 160px; }
.beast-dictionary { display: flex; align-items: end; gap: 12px; margin-bottom: 18px; }
.beast-dictionary label { width: min(320px, 100%); }
.beast-dictionary small { color: var(--faint); padding-bottom: 12px; }
.tool-source { margin: 20px 0 0; color: var(--faint); font-size: .76rem; }
.tool-source a { color: var(--text); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.embed-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.embed-toolbar > div { display: grid; }
.embed-toolbar strong { font-family: var(--font-mono); font-weight: 600; }
.embed-toolbar span { color: var(--muted); font-size: .8rem; }
.tool-service-frame { display: block; width: 100%; height: 72vh; min-height: 620px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }

/* ==========================================================================
   Friends
   ========================================================================== */
.friends-apply-panel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 32px; border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.friends-apply-panel > div { min-width: 0; display: flex; align-items: baseline; gap: 12px; padding: 16px 18px; }
.friends-apply-panel > div + div { border-left: 1px solid var(--line); }
.friends-apply-panel span { color: var(--accent); font: 500 .74rem/1 var(--font-mono); }
.friends-apply-panel p { margin: 0; color: var(--muted); font-size: .84rem; }
.friends-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.friends-search { height: 42px; width: min(420px, 100%); display: flex; align-items: center; gap: 10px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 10px; transition: border-color .2s; }
.friends-search:focus-within { border-color: var(--text); }
.friends-search .icon { color: var(--faint); }
.friends-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--text); }
.friends-toolbar > a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .82rem; transition: color .2s; }
.friends-toolbar > a:hover { color: var(--text); }
.friends-toolbar > a .icon { width: .85rem; height: .85rem; }
.friends-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.friend-card { position: relative; min-width: 0; display: grid; grid-template-columns: 56px minmax(0, 1fr); grid-template-areas: "avatar copy" "tags tags" "visit visit"; gap: 16px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--card); box-shadow: var(--shadow); transition: border-color .2s; }
.friend-card:hover { border-color: var(--line-strong); }
.friend-avatar { grid-area: avatar; position: relative; width: 56px; height: 56px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: 1.2rem; font-weight: 600; overflow: hidden; }
.friend-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.friend-card-copy { grid-area: copy; min-width: 0; align-self: center; }
.friend-card-copy h2 { margin: 0 0 2px; font-size: 1rem; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.friend-card-copy > a { display: block; color: var(--faint); font: 500 .72rem/1.5 var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .2s; }
.friend-card-copy > a:hover { color: var(--text); }
.friend-card-copy p { margin: 8px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.friend-tags { grid-area: tags; display: flex; flex-wrap: wrap; gap: 6px 12px; }
.friend-tags span { color: var(--faint); font: 500 .72rem/1.4 var(--font-mono); }
.friend-tags span::before { content: "#"; }
.friend-visit { grid-area: visit; min-height: 38px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); border-radius: 10px; font-size: .82rem; font-weight: 500; transition: border-color .2s, background .2s; }
.friend-visit:hover { border-color: var(--line-strong); background: var(--surface-2); }
.friend-visit .icon { width: .82rem; height: .82rem; }
.friends-empty { padding: 50px 20px; text-align: center; color: var(--faint); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); }
.friends-apply-dialog { width: min(680px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line-strong); border-radius: var(--radius-lg); background: var(--sheet); color: var(--text); box-shadow: var(--shadow-pop); overflow: auto; }
.friends-dialog-panel { padding: 24px; }
.friends-dialog-panel > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.friends-dialog-panel > header > div { min-width: 0; }
.friends-dialog-panel > header p { margin: 0 0 8px; color: var(--accent); font: 500 .7rem/1.2 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; }
.friends-dialog-panel > header h2 { margin: 0; font-size: 1.3rem; line-height: 1.35; }
.friends-dialog-panel > header span { display: block; margin-top: 8px; color: var(--muted); font-size: .84rem; line-height: 1.65; }
.friends-template-shell { border: 1px solid var(--line); border-radius: var(--radius); background: var(--code-bg); overflow: hidden; }
.friends-template-head { height: 40px; display: flex; align-items: center; justify-content: space-between; padding: 0 6px 0 16px; border-bottom: 1px solid var(--line); color: var(--faint); font: 500 .7rem/1 var(--font-mono); letter-spacing: .1em; }
.friends-template-head button { height: 28px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: .74rem; transition: color .2s, background .2s; }
.friends-template-head button:hover { background: var(--surface-2); color: var(--text); }
.friends-template-head button .icon { width: .82rem; height: .82rem; }
.friends-template-shell pre { max-height: 330px; margin: 0; padding: 16px 18px; overflow: auto; background: transparent; color: var(--c-text); font: 500 .82rem/1.75 var(--font-mono); white-space: pre; }
.friends-unique-note { display: flex; align-items: flex-start; gap: 9px; margin: 16px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.6; }
.friends-unique-note .icon { width: .92rem; height: .92rem; margin-top: .22rem; color: var(--faint); }
.friends-dialog-panel > footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
.friends-dialog-panel > footer .button { min-width: 112px; }

/* ==========================================================================
   Guestbook
   ========================================================================== */
.guestbook-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 40px; align-items: start; }
.guestbook-note { position: sticky; top: calc(var(--nav-h) + var(--nav-top) + 24px); padding-top: 16px; border-top: 1px solid var(--line); }
.guestbook-note > .icon { width: 1.2rem; height: 1.2rem; color: var(--faint); }
.guestbook-note h2 { margin: 12px 0 12px; font-size: 1rem; font-weight: 650; }
.guestbook-note p { margin: 10px 0; color: var(--muted); font-size: .82rem; line-height: 1.7; }
.guestbook-main { display: grid; gap: 24px; }
.guestbook-form, .guestbook-messages { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--card); box-shadow: var(--shadow); }
.guestbook-form { display: grid; gap: 16px; }
.guestbook-form label, .guestbook-turnstile-field { display: grid; gap: 8px; color: var(--muted); font-size: .8rem; }
.guestbook-form input, .guestbook-form textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 10px; background: transparent; color: var(--text); outline: 0; padding: 11px 14px; transition: border-color .2s; }
.guestbook-form textarea { resize: vertical; min-height: 128px; line-height: 1.7; }
.guestbook-form input:focus, .guestbook-form textarea:focus { border-color: var(--text); }
.guestbook-turnstile { width: min(100%, 300px); min-height: 65px; display: flex; align-items: center; border-radius: 10px; overflow: hidden; color: var(--faint); }
.guestbook-turnstile[data-turnstile-state="loading"] { padding: 0 16px; border: 1px dashed var(--line-strong); }
.guestbook-turnstile[data-turnstile-state="error"] { padding: 0 16px; border: 1px solid color-mix(in oklab, var(--danger) 40%, transparent); color: var(--danger); font-size: .84rem; }
.turnstile-visual-mock { width: 300px; height: 65px; display: flex; align-items: center; padding: 0 16px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); }
.guestbook-submit-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.guestbook-submit-row p { margin: 0; color: var(--muted); font-size: .8rem; }
.guestbook-submit-row p.success { color: var(--green); }
.guestbook-submit-row p.error { color: var(--danger); }
.guestbook-messages > header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; }
.guestbook-messages > header h2 { margin: 0; font-size: 1rem; font-weight: 650; }
.guestbook-messages > header span { color: var(--faint); font: 500 .76rem/1 var(--font-mono); }
.guestbook-message { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; padding: 18px 0; }
.guestbook-message + .guestbook-message { border-top: 1px solid var(--line); }
.guestbook-message-avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: .86rem; font-weight: 600; }
.guestbook-message > div { min-width: 0; }
.guestbook-message header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.guestbook-message header strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; font-weight: 600; }
.guestbook-message time { white-space: nowrap; color: var(--faint); font: 500 .68rem/1 var(--font-mono); }
.guestbook-message p { margin: 6px 0 0; color: var(--prose); font-size: .88rem; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.guestbook-list-state { margin: 0; padding: 44px 10px; text-align: center; color: var(--faint); }
.guestbook-list-state.error { color: var(--danger); }

/* 404 */
.not-found { min-height: 70vh; display: grid; place-items: center; text-align: center; }
.not-found-code { margin: 0; color: var(--faint); font: 600 clamp(5rem, 16vw, 9rem)/1 var(--font-mono); letter-spacing: -.06em; animation: rise-in .6s var(--ease) both; }
.not-found h1 { margin: 20px 0 10px; font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; animation: rise-in .6s .05s var(--ease) both; }
.not-found p { max-width: 44ch; margin: 0 auto 28px; color: var(--muted); animation: rise-in .6s .1s var(--ease) both; }
.not-found .profile-actions { justify-content: center; animation: rise-in .6s .15s var(--ease) both; }

/* ==========================================================================
   Motion — quiet, choreographed, always purposeful
   ========================================================================== */
:root { --ease-out-soft: cubic-bezier(.22, 1, .36, 1); --lift: translateY(-3px); --shadow-hover: 0 14px 34px -18px rgba(20, 20, 24, .22); }
:root[data-theme="dark"] { --shadow-hover: 0 14px 34px -18px rgba(0, 0, 0, .7); }

/* Entrances */
@keyframes rise-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes card-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.page-heading > *, .page-heading > div > *, .page-heading-row > .button { animation: rise-in .75s var(--ease-out-soft) both; }
.page-heading > :nth-child(2), .page-heading > div > :nth-child(2) { animation-delay: .07s; }
.page-heading > :nth-child(3), .page-heading > div > :nth-child(3), .page-heading-row > .button { animation-delay: .14s; }
html.js [data-reveal] { transform: translateY(20px); transition-duration: .8s; transition-timing-function: var(--ease-out-soft); }
.taxonomy-strip, .trending-period-nav, .arena-track-tabs, .friends-apply-panel { animation: rise-in .75s .18s var(--ease-out-soft) both; }
.post-card.is-card-entering { animation: card-rise .7s var(--ease-out-soft) both; }
[data-fade-card][data-card-motion="visible"] { animation: card-rise .7s var(--ease-out-soft) var(--card-fade-delay, 0ms) both; }
.home-doc-item { animation: rise-in .8s var(--ease-out-soft) both; }
.home-doc-item:nth-child(1) { animation-delay: .38s; }
.home-doc-item:nth-child(2) { animation-delay: .46s; }
.home-doc-item:nth-child(3) { animation-delay: .54s; }
.home-left { animation: none; }
.home-kicker { animation: rise-in .8s .3s var(--ease-out-soft) both; }
.home-backdrop img { animation: hero-settle 1.8s var(--ease-out-soft) both; }
@keyframes hero-settle { from { opacity: 0; transform: scale(1.06); } }
.article-main { animation: rise-in .8s .12s var(--ease-out-soft) both; }
.article-toc { animation: rise-in .8s .24s var(--ease-out-soft) both; }

/* Hero follows the scroll: content drifts and dims, image eases back */
.home-grid { transform: translate3d(0, calc(var(--hero-p, 0) * 72px), 0); opacity: calc(1 - var(--hero-p, 0) * 1.15); will-change: transform, opacity; }
.home-backdrop { transform: scale(calc(1 + var(--hero-p, 0) * .05)); transform-origin: center top; }
.home-scroll-cue { opacity: calc(1 - var(--hero-p, 0) * 4); }
.home-scroll-cue .icon { animation: cue-drift 2.4s var(--ease) infinite; }
@keyframes cue-drift { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }

/* Hover: a small lift, a firmer edge, nothing more */
.post-card, .latest-card, .tool-card, .friend-card, .article-neighbors a, .contact-links > a, .hugo-link-card { transition: transform .45s var(--ease-out-soft), border-color .25s, box-shadow .45s var(--ease-out-soft), background .25s; }
.post-card:hover, .latest-card:hover, .tool-card:hover, .friend-card:hover, .article-neighbors a:hover { transform: var(--lift); box-shadow: var(--shadow-hover); }
.post-cover img, .latest-cover img { transition: transform .9s var(--ease-out-soft), opacity .6s ease; }
.post-card:hover .post-cover img, .latest-card:hover .latest-cover img { transform: scale(1.04); }
.button { transition: background .2s, border-color .2s, color .2s, opacity .2s, transform .2s var(--ease); }
.button:active, .icon-button:active, .pagination-page:active, .pagination-control:active { transform: scale(.96); }
.icon-button, .pagination-page, .pagination-control { transition: background .2s, color .2s, border-color .2s, transform .2s var(--ease); }

/* Images arrive softly instead of popping in */
html.js .post-cover img:not(.is-loaded), html.js .latest-cover img:not(.is-loaded), html.js .markdown-content img:not(.is-loaded) { opacity: 0; }
.markdown-content img { transition: opacity .6s ease; }

/* Links: underline draws in from the left */
.markdown-content a { text-decoration: none; background-image: linear-gradient(var(--accent), var(--accent)), linear-gradient(var(--line-strong), var(--line-strong)); background-size: 0 1px, 100% 1px; background-position: 0 100%, 0 100%; background-repeat: no-repeat; padding-bottom: 2px; transition: background-size .4s var(--ease-out-soft), color .2s; }
.markdown-content a:hover { background-size: 100% 1px, 100% 1px; }
.markdown-content a.hugo-link-card { padding: 14px 18px; background-image: none; }
.markdown-content a:has(img), .markdown-content a.web-page-embed-open { padding-bottom: 0; background-image: none; }
.footer-links a, .back-link { background-image: linear-gradient(currentColor, currentColor); background-size: 0 1px; background-position: 0 100%; background-repeat: no-repeat; transition: background-size .35s var(--ease-out-soft), color .2s; }
.footer-links a:hover, .back-link:hover { background-size: 100% 1px; }

/* Sliding TOC marker */
.generated-article-toc { position: relative; }
.generated-article-toc a.active { border-left-color: var(--line); }
.generated-article-toc::after { content: ""; position: absolute; left: 0; top: 0; width: 1px; height: var(--toc-h, 0); background: var(--accent); opacity: 0; transform: translateY(var(--toc-y, 0)); transition: transform .4s var(--ease-out-soft), height .4s var(--ease-out-soft), opacity .3s; }
.generated-article-toc.has-marker::after { opacity: 1; }
.generated-article-toc a { transition: color .25s, padding-left .35s var(--ease-out-soft), border-color .2s; }
.generated-article-toc a.active { padding-left: 16px; }
.generated-article-toc .toc-level-2.active { padding-left: 28px; }

/* Navigation sheet: items settle in sequence */
.workspace-nav a { opacity: 0; transform: translateY(10px); transition: opacity .4s var(--ease-out-soft) calc(var(--i, 0) * 35ms + 80ms), transform .5s var(--ease-out-soft) calc(var(--i, 0) * 35ms + 80ms), color .2s; }
body.sidebar-open .workspace-nav a { opacity: 1; transform: none; }
.workspace-sidebar { transition: transform .45s var(--ease-out-soft), visibility 0s linear .45s; }
body.sidebar-open .workspace-sidebar { transition: transform .5s var(--ease-out-soft), visibility 0s; }

/* Dialogs: open and close both animate */
:is(.search-panel, .account-dialog, .article-toc-dialog > section, .friends-apply-dialog) { transition: opacity .25s ease, transform .35s var(--ease-out-soft); }
@starting-style {
  dialog[open] :is(.search-panel, .article-toc-dialog > section), dialog.account-dialog[open], dialog.friends-apply-dialog[open] { opacity: 0; transform: translateY(10px) scale(.985); }
  .lightbox-dialog[open] img { opacity: 0; transform: scale(.97); }
}
.lightbox-dialog img { transition: opacity .3s ease, transform .4s var(--ease-out-soft); }
dialog[data-closing] :is(.search-panel, .article-toc-dialog > section), dialog.account-dialog[data-closing], dialog.friends-apply-dialog[data-closing], .lightbox-dialog[data-closing] img { animation: dialog-out .18s ease forwards; }
dialog[data-closing]::backdrop { animation: backdrop-out .18s ease forwards; }
@keyframes dialog-out { to { opacity: 0; transform: translateY(6px) scale(.985); } }
@keyframes backdrop-out { to { opacity: 0; } }
.search-result { animation: rise-in .4s var(--ease-out-soft) both; }
.search-result:nth-child(2) { animation-delay: .025s; }
.search-result:nth-child(3) { animation-delay: .05s; }
.search-result:nth-child(4) { animation-delay: .075s; }
.search-result:nth-child(n+5) { animation-delay: .1s; }
.search-result { transition: background .15s, transform .25s var(--ease-out-soft); }
.search-result.is-active { transform: translateX(3px); }

/* Toast */
.site-toast { position: fixed; z-index: 120; left: 50%; bottom: 28px; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; background: var(--text); color: var(--on-primary); font-size: .84rem; font-weight: 500; box-shadow: var(--shadow-pop); opacity: 0; transform: translate(-50%, 14px); pointer-events: none; transition: opacity .3s ease, transform .45s var(--ease-out-soft); }
.site-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.site-toast .icon { width: .95rem; height: .95rem; }
@media (hover: none) {
  .post-card:hover, .latest-card:hover, .tool-card:hover, .friend-card:hover, .article-neighbors a:hover { transform: none; box-shadow: var(--shadow); }
  .post-card:hover .post-cover img, .latest-card:hover .latest-cover img { transform: none; }
}
@media (max-width: 760px) {
  .mobile-dock { transition: transform .45s var(--ease-out-soft), opacity .3s ease; }
  html.is-scrolling-down .mobile-dock { transform: translate(-50%, calc(100% + 24px)); opacity: 0; }
  body.sidebar-open .mobile-dock { transform: translateX(-50%); opacity: 1; }
  .site-toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1180px) {
  .nav-links a { padding: 0 10px; }
  .nav-links a span { display: none; }
  .nav-search span, .nav-search kbd { display: none; }
  .nav-search { width: 36px; padding: 0; justify-content: center; border-color: transparent; }
}
@media (max-width: 1020px) {
  :root { --gutter: 24px; }
  .home-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; }
  .avatar-style-switch { left: calc(100% + 16px); }
  .blog-layout { grid-template-columns: minmax(0, 1fr); }
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .blog-aside { position: static; grid-template-columns: 1fr 1fr; gap: 32px; }
  .article-layout { grid-template-columns: minmax(0, 720px); }
  .article-toc { display: none; }
  .friends-grid, .tool-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .friends-apply-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .friends-apply-panel > div:nth-child(3) { border-left: 0; }
  .friends-apply-panel > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .latest-grid { grid-template-columns: 1fr; grid-template-rows: none; }
  .latest-card.is-lead { grid-row: auto; }
  .explore-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guestbook-layout { grid-template-columns: 1fr; gap: 24px; }
  .guestbook-note { position: static; }
}
@media(max-width:760px){
  :root { --nav-h: 52px; --nav-top: 10px; --gutter: 16px; }
  body { font-size: 15px; padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .site-nav-inner { width: calc(100% - 20px); padding: 0 4px 0 14px; gap: 2px; border-radius: 12px; }
  .nav-links, .nav-actions > .language-switch { display: none; }
  .nav-actions { margin-left: auto; gap: 0; }
  .sidebar-trigger, .article-toc-top-trigger { display: inline-grid; }
  .topbar-avatar { margin: 0 2px; }
  .topbar-avatar img { width: 28px; height: 28px; }
  .mobile-dock { position: fixed; z-index: 55; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom)); width: min(420px, calc(100% - 20px)); height: 58px; display: grid; grid-template-columns: repeat(5, 1fr); padding: 5px; border: 1px solid var(--line-strong); border-radius: 16px; background: var(--glass); -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4); transform: translateX(-50%); }
  .mobile-dock a, .mobile-dock button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 0; border: 0; border-radius: 11px; background: transparent; color: var(--faint); font-size: .64rem; font-weight: 500; transition: color .2s, background .2s; }
  .mobile-dock .icon { width: 1.15rem; height: 1.15rem; }
  .mobile-dock a.active { color: var(--text); background: var(--surface-2); }
  .mobile-dock span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .content-page, .article-shell { padding-top: calc(var(--nav-h) + var(--nav-top) + 40px); }
  .page-heading, .section-heading { margin-bottom: 30px; }
  .page-heading h1 { font-size: clamp(2.1rem, 10vw, 2.7rem); }
  .page-heading-row, .section-heading { align-items: flex-start; flex-direction: column; gap: 16px; }
  .page-heading-row > .button { width: 100%; }
  .page-banner { height: 42vh; }
  .home-stage { min-height: auto; }
  .home-stage::before { background: linear-gradient(180deg, rgba(12, 12, 14, .8) 0%, rgba(12, 12, 14, .72) 35%, rgba(12, 12, 14, .9) 65%, var(--bg) 100%); }
  :root:not([data-theme="dark"]) .home-stage::before { background: linear-gradient(180deg, rgba(12, 12, 14, .8) 0%, rgba(12, 12, 14, .72) 35%, rgba(12, 12, 14, .9) 72%, rgba(12, 12, 14, .94) 94%, #f7f6f3 100%); }
  .home-grid{display:flex;flex-direction:column;gap:36px;width:calc(100% - 32px);min-height:auto;padding:calc(var(--nav-h) + var(--nav-top) + 40px) 0 64px;align-items:stretch}
  .home-profile{order:-1;width:100%;min-width:0;text-align:center}
  .home-left{order:0}
  .profile-avatar-stage { width: 96px; height: 96px; margin: 0 auto 44px; }
  .avatar-style-switch { left: 50%; top: auto; bottom: -26px; transform: translateX(-50%); font-size: .68rem; }
  .profile-overline { font-size: .64rem; }
  .profile-name { font-size: clamp(2.7rem, 14vw, 3.6rem); margin-bottom: 14px; }
  .profile-bio { width: 100%; min-width: 0; height: 3.3em; min-height: 3.3em; margin: 0 auto 26px; overflow: hidden; overflow-wrap: anywhere; font-size: .98rem; }
  .profile-actions { justify-content: center; }
  .home-kicker { justify-content: center; }
  .visitor-values > div + div { padding-left: 14px; }
  .visitor-strip small { font-size: .66rem; }
  .visitor-strip strong { font-size: 1.3rem; }
  .status-panel h2 { font-size: 1.08rem; }
  .home-scroll-cue { display: none; }
  .home-section { padding-top: 80px; }
  .home-latest { padding-top: 32px; }
  .latest-card { grid-template-columns: 112px minmax(0, 1fr); }
  .latest-cover { min-height: 104px; }
  .latest-body { padding: 14px 16px; }
  .latest-card.is-lead .latest-body { padding: 18px; }
  .explore-grid { grid-template-columns: 1fr; }
  .explore-card { min-height: 0; padding: 22px; }
  .explore-head { margin-bottom: 20px; }
  .post-grid { grid-template-columns: 1fr; gap: 14px; }
  [data-responsive-post-list]:not(.responsive-pagination-ready) .post-grid > .post-card:nth-child(n+11) { display: none; }
  .post-media { aspect-ratio: 2 / 1; }
  .post-card-body { padding: 14px 16px; }
  .post-card p { -webkit-line-clamp: 2; font-size: .84rem; }
  .post-card-foot > div a:nth-child(n+3) { display: none; }
  .hugo-pagination { grid-template-columns: 38px minmax(0, auto) 38px; gap: 6px; }
  .pagination-control { width: 38px; height: 38px; }
  .pagination-page { width: 32px; height: 32px; }
  .pagination-gap { width: 14px; }
  .blog-aside { grid-template-columns: 1fr; }
  .article-header { margin-bottom: 32px; }
  .article-header h1 { font-size: clamp(1.7rem, 7.5vw, 2.1rem); }
  .article-meta { gap: 6px 14px; font-size: .72rem; }
  .article-cover { margin-bottom: 36px; border-radius: var(--radius); }
  .markdown-content { font-size: 1rem; line-height: 1.85; }
  .markdown-content h1 { font-size: 1.45rem; }
  .markdown-content h2 { font-size: 1.25rem; }
  .markdown-content h3 { font-size: 1.08rem; }
  .code-block-shell pre { padding: 14px 16px; font-size: .8rem; }
  .article-footer { flex-direction: column; align-items: stretch; }
  .article-neighbors { grid-template-columns: 1fr; }
  .article-neighbors .neighbor-next { text-align: left; }
  .article-neighbors .neighbor-next small { justify-content: flex-start; }
  .article-comments { margin-top: 56px; }
  .tool-card-grid, .friends-grid { grid-template-columns: 1fr; }
  .tool-card { min-height: 0; }
  .tool-panel-head { flex-direction: column; }
  .tool-panel-head > div:last-child { width: 100%; }
  .tool-panel-head .button { flex: 1; }
  .tool-workspace textarea { min-height: 280px; }
  .form-grid, .tool-split { grid-template-columns: 1fr; }
  .tool-split textarea { min-height: 220px; }
  .text-stats { grid-template-columns: 1fr 1fr; }
  .text-stats div:nth-child(3) { border-left: 0; }
  .text-stats div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .uuid-control { align-items: stretch; flex-wrap: wrap; }
  .uuid-control label { width: 100%; }
  .uuid-control .button { flex: 1; }
  .beast-dictionary { align-items: start; flex-direction: column; }
  .embed-toolbar { align-items: stretch; flex-direction: column; }
  .embed-toolbar .button { width: 100%; }
  .tool-service-frame { height: 70vh; min-height: 520px; }
  .friends-toolbar { align-items: stretch; flex-direction: column; }
  .friends-search { width: 100%; }
  .guestbook-form, .guestbook-messages { padding: 18px; }
  .guestbook-turnstile { width: 100%; }
  .guestbook-submit-row { align-items: stretch; flex-direction: column; }
  .guestbook-submit-row .button { width: 100%; }
  .friends-dialog-panel { padding: 20px; }
  .friends-dialog-panel > header h2 { font-size: 1.15rem; }
  .friends-template-shell pre { padding: 14px; font-size: .72rem; }
  .friends-dialog-panel > footer { display: grid; grid-template-columns: 1fr; }
  .friends-dialog-panel > footer .button { width: 100%; }
  .search-panel { margin-top: 8vh; max-height: 80vh; }
  .search-keys { display: none; }
  .article-float-controls { right: 14px; bottom: calc(82px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
  .desktop-back-to-top { display: none; }
  .article-actions-toggle { display: grid; }
  .mobile-article-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; opacity: 0; transform: translateY(6px); pointer-events: none; transition: opacity .2s var(--ease), transform .2s var(--ease); }
  .mobile-article-action { width: auto; min-width: 92px; height: 40px; display: flex; padding: 0 14px; border-radius: 999px; gap: 8px; font-size: .76rem; }
  .mobile-article-actions-open .mobile-article-actions { opacity: 1; transform: none; pointer-events: auto; }
  .article-actions-toggle .icon { transition: transform .25s var(--ease); }
  .mobile-article-actions-open .article-actions-toggle .icon { transform: rotate(180deg); }
  .code-copy-button { font-size: 0; width: 30px; padding: 0; gap: 0; }
  .site-footer { margin-top: 72px; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-links { justify-content: flex-start; }
}
@media (max-width: 430px) {
  .profile-actions { flex-direction: column; align-items: center; }
  .profile-actions .button { width: min(100%, 260px); }
  .latest-card { grid-template-columns: 1fr; }
  .latest-cover { aspect-ratio: 2 / 1; min-height: 0; }
  .visitor-values > div + div { padding-left: 10px; }
  .visitor-strip strong { font-size: 1.12rem; }
  .contact-links { grid-template-columns: 1fr; }
}
@media (max-width: 360px) {
  .workspace-brand-title { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .profile-avatar { animation: none !important; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html.js [data-reveal] { opacity: 1; transform: none; }
  @view-transition { navigation: none; }
}
