/* ==========================================================================
   小岩笔记 · Emlog Pro 主题
   纸感 / 索引 / 留白
   ========================================================================== */

:root {
    --paper: #f3efe6;
    --paper-2: #eae4d8;
    --paper-3: #faf7f0;
    --ink: #1c1b18;
    --ink-2: #4f4a40;
    --muted: #8a8374;
    --line: rgba(28, 27, 24, 0.13);
    --line-2: rgba(28, 27, 24, 0.28);
    --dot: rgba(28, 27, 24, 0.045);
    --accent: #b8432a;
    --accent-soft: #ead4c9;
    --font-sans: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    --font-serif: "Iowan Old Style", "Palatino Linotype", "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
    --font-mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, "Liberation Mono", monospace;
    --max: 1160px;
    --shadow: 0 24px 70px rgba(28, 27, 24, 0.08);
}

html[data-theme="dark"] {
    --paper: #161513;
    --paper-2: #1b1916;
    --paper-3: #201e1a;
    --ink: #ebe6da;
    --ink-2: #b8b0a1;
    --muted: #7f786b;
    --line: rgba(235, 230, 218, 0.13);
    --line-2: rgba(235, 230, 218, 0.28);
    --dot: rgba(235, 230, 218, 0.045);
    --accent-soft: #4a2c23;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    scrollbar-gutter: stable;
    color-scheme: light;
}

html[data-theme="dark"] {
    color-scheme: dark;
}

body {
    margin: 0;
    min-height: 100vh;
    background-color: var(--paper);
    background-image: radial-gradient(var(--dot) 0.55px, transparent 0.7px);
    background-size: 5px 5px;
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
    text-rendering: optimizeLegibility;
    transition: background-color 0.35s ease, color 0.35s ease;
}

body.xy-lock {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    color: var(--accent);
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
textarea,
select {
    font: inherit;
    color: inherit;
}

button {
    border: 0;
    background: none;
    cursor: pointer;
}

::selection {
    background: var(--accent);
    color: #faf7f0;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

[hidden] {
    display: none !important;
}

.xy-sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.xy-skip {
    position: fixed;
    top: -80px;
    left: 18px;
    z-index: 300;
    padding: 10px 16px;
    background: var(--ink);
    color: var(--paper);
    font-size: 0.8rem;
    transition: top 0.2s ease;
}

.xy-skip:focus {
    top: 16px;
    color: var(--paper);
}

/* --------------------------------------------------------------------------
   阅读进度
   ----------------------------------------------------------------------- */

.xy-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    z-index: 200;
    pointer-events: none;
}

.xy-progress span {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: 0 50%;
    transition: transform 0.12s linear;
}

/* --------------------------------------------------------------------------
   整体骨架
   ----------------------------------------------------------------------- */

.xy-app {
    display: flex;
    min-height: 100vh;
}

.xy-rail {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 70;
    width: 280px;
    padding: 38px 32px 26px;
    display: flex;
    flex-direction: column;
    background: var(--paper-2);
    border-right: 1px solid var(--line);
    overflow-y: auto;
    scrollbar-width: thin;
    transition: background-color 0.35s ease, border-color 0.35s ease;
}

.xy-stage {
    width: calc(100% - 280px);
    min-height: 100vh;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
}

.xy-main {
    flex: 1;
    width: 100%;
    max-width: var(--max);
    margin: 0 auto;
    padding: 64px 64px 100px;
}

/* --------------------------------------------------------------------------
   品牌与印章
   ----------------------------------------------------------------------- */

.xy-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--ink);
}

.xy-brand:hover {
    color: var(--ink);
}

.xy-seal {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: #faf7f0;
    font-family: var(--font-serif);
    font-size: 22px;
    line-height: 1;
    letter-spacing: 0;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
    transform: rotate(-2deg);
    user-select: none;
}

.xy-seal-sm {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    font-size: 15px;
}

.xy-seal-lg {
    width: 58px;
    height: 58px;
    flex-basis: 58px;
    font-size: 27px;
}

.xy-brand-logo {
    width: 46px;
    height: 46px;
    object-fit: cover;
    flex: 0 0 auto;
}

.xy-topbar-brand img {
    width: 32px;
    height: 32px;
    object-fit: cover;
    flex: 0 0 auto;
}

.xy-footer-logo img {
    width: 42px;
    height: 42px;
    object-fit: cover;
    flex: 0 0 auto;
}

.xy-brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.xy-brand-text strong {
    font-family: var(--font-serif);
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    line-height: 1.4;
}

.xy-brand-text small {
    margin-top: 4px;
    max-width: 160px;
    color: var(--muted);
    font-size: 0.67rem;
    line-height: 1.55;
    letter-spacing: 0.01em;
}

.xy-rail-rule {
    width: 42px;
    height: 1px;
    margin: 32px 0 26px;
    background: var(--line-2);
}

/* --------------------------------------------------------------------------
   侧栏导航
   ----------------------------------------------------------------------- */

.xy-nav {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.xy-nav-item {
    position: relative;
}

.xy-nav-link {
    position: relative;
    display: flex;
    align-items: baseline;
    gap: 13px;
    padding: 9px 0;
    color: var(--ink-2);
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    transition: color 0.25s ease;
}

.xy-nav-link::after {
    content: "";
    position: absolute;
    left: 32px;
    right: 0;
    bottom: 0;
    height: 1px;
    background: var(--line);
    transform: scaleX(0);
    transform-origin: 0 50%;
    transition: transform 0.35s ease;
}

.xy-nav-link:hover,
.xy-nav-link[aria-current="page"] {
    color: var(--accent);
}

.xy-nav-link:hover::after,
.xy-nav-link[aria-current="page"]::after {
    transform: scaleX(1);
}

.xy-nav-index {
    width: 19px;
    flex: 0 0 19px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.58rem;
    letter-spacing: 0.06em;
}

.xy-nav-text {
    min-width: 0;
}

.xy-nav-arrow {
    margin-left: auto;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1;
    transition: transform 0.25s ease;
}

.xy-nav-item:hover .xy-nav-arrow {
    transform: rotate(45deg);
}

.xy-nav-sub {
    display: none;
    padding: 1px 0 8px 32px;
    flex-direction: column;
    gap: 2px;
}

.xy-nav-item:hover .xy-nav-sub,
.xy-nav-item:focus-within .xy-nav-sub {
    display: flex;
}

.xy-nav-sub a {
    padding: 3px 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.xy-nav-sub a:hover {
    color: var(--accent);
}

.xy-rail-foot {
    margin-top: auto;
    padding-top: 34px;
}

.xy-rail-tools {
    display: flex;
    gap: 9px;
    margin-bottom: 22px;
}

.xy-icon-btn {
    width: 36px;
    height: 36px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--ink-2);
    transition: color 0.25s ease, border-color 0.25s ease, transform 0.25s ease, background-color 0.25s ease;
}

.xy-icon-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.xy-icon-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.55;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.xy-theme-sun {
    display: none;
}

html[data-theme="dark"] .xy-theme-sun {
    display: block;
}

html[data-theme="dark"] .xy-theme-moon {
    display: none;
}

.xy-rail-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.58rem;
    letter-spacing: 0.08em;
}

.xy-rail-meta a:hover {
    color: var(--accent);
}

/* --------------------------------------------------------------------------
   移动端顶栏 / 抽屉
   ----------------------------------------------------------------------- */

.xy-topbar {
    display: none;
    position: sticky;
    top: 0;
    z-index: 75;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 22px;
    background: rgba(243, 239, 230, 0.86);
    background: color-mix(in srgb, var(--paper) 86%, transparent);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

html[data-theme="dark"] .xy-topbar {
    background: rgba(22, 21, 19, 0.86);
    background: color-mix(in srgb, var(--paper) 86%, transparent);
}

.xy-topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: var(--ink);
}

.xy-topbar-brand strong {
    overflow: hidden;
    font-family: var(--font-serif);
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.xy-topbar-actions {
    display: flex;
    gap: 6px;
    flex: 0 0 auto;
}

.xy-topbar .xy-icon-btn {
    width: 34px;
    height: 34px;
}

.xy-drawer {
    position: fixed;
    inset: 0;
    z-index: 95;
    display: flex;
    flex-direction: column;
    padding: 24px 24px 30px;
    overflow-y: auto;
    background: var(--paper);
    animation: xyFadeIn 0.25s ease both;
}

.xy-drawer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
}

.xy-drawer .xy-nav {
    gap: 4px;
}

.xy-nav-drawer .xy-nav-link {
    padding: 13px 0;
    font-family: var(--font-serif);
    font-size: 1.35rem;
}

.xy-nav-drawer .xy-nav-index {
    width: 26px;
    flex-basis: 26px;
}

.xy-nav-drawer .xy-nav-sub {
    display: flex;
    padding-bottom: 10px;
}

.xy-nav-drawer .xy-nav-sub a {
    font-size: 0.85rem;
}

.xy-drawer-foot {
    display: flex;
    flex-direction: column;
    gap: 11px;
    margin-top: auto;
    padding-top: 26px;
    border-top: 1px solid var(--line);
}

.xy-text-btn {
    align-self: flex-start;
    padding: 0;
    color: var(--ink-2);
    font-size: 0.8rem;
    text-align: left;
}

.xy-text-btn:hover {
    color: var(--accent);
}

.xy-drawer-copy {
    margin-top: 12px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.58rem;
    letter-spacing: 0.05em;
}

/* --------------------------------------------------------------------------
   搜索层
   ----------------------------------------------------------------------- */

.xy-search {
    position: fixed;
    inset: 0;
    z-index: 110;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: rgba(243, 239, 230, 0.9);
    background: color-mix(in srgb, var(--paper) 90%, transparent);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: xyFadeIn 0.25s ease both;
}

html[data-theme="dark"] .xy-search {
    background: rgba(22, 21, 19, 0.92);
    background: color-mix(in srgb, var(--paper) 90%, transparent);
}

.xy-search-panel {
    width: min(820px, 100%);
    border-top: 1px solid var(--line-2);
    border-bottom: 1px solid var(--line-2);
    padding: 32px 0 38px;
    animation: xyRiseIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.xy-search-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.xy-search h2 {
    margin: 28px 0 36px;
    font-family: var(--font-serif);
    font-size: clamp(2.1rem, 5vw, 3.7rem);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.xy-search h2 em {
    color: var(--accent);
    font-style: normal;
}

.xy-search-form {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ink);
}

.xy-search-form input {
    flex: 1;
    min-width: 0;
    padding: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--ink);
    font-family: var(--font-serif);
    font-size: clamp(1.25rem, 3vw, 2rem);
}

.xy-search-form input::placeholder {
    color: var(--muted);
}

.xy-search-form button {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border: 1px solid var(--line-2);
    border-radius: 50%;
    color: var(--ink);
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.xy-search-form button:hover {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--paper);
}

.xy-search-form button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.xy-search-hint {
    margin: 18px 0 0;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.03em;
}

.xy-search-hint kbd {
    display: inline-block;
    padding: 1px 5px;
    border: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 0.9em;
}

/* --------------------------------------------------------------------------
   通用文字与按钮
   ----------------------------------------------------------------------- */

.xy-kicker {
    margin: 0 0 17px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.63rem;
    font-weight: 400;
    letter-spacing: 0.19em;
    line-height: 1.6;
    text-transform: uppercase;
}

.xy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    line-height: 1.4;
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.xy-btn:hover {
    transform: translateY(-1px);
}

.xy-btn svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.xy-btn-solid {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--paper);
}

.xy-btn-solid:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #faf7f0;
}

.xy-btn-ghost {
    border-color: var(--line-2);
    color: var(--ink-2);
}

.xy-btn-ghost:hover {
    border-color: var(--ink);
    color: var(--ink);
}

/* --------------------------------------------------------------------------
   首页 / 列表页头
   ----------------------------------------------------------------------- */

.xy-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 46px;
    padding: 42px 0 70px;
    border-bottom: 1px solid var(--line);
}

.xy-hero-copy {
    min-width: 0;
}

.xy-hero h1 {
    max-width: 12em;
    margin: 0 0 28px;
    font-family: var(--font-serif);
    font-size: clamp(3.2rem, 6.4vw, 6.1rem);
    font-weight: 400;
    line-height: 1.02;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.xy-hero-desc {
    max-width: 54ch;
    margin: 0 0 32px;
    color: var(--ink-2);
    font-size: 1.02rem;
    line-height: 1.9;
}

.xy-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.xy-hero-meta {
    margin: 38px 0 0;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.06em;
}

.xy-hero-meta a {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.xy-hero-aside {
    position: relative;
    min-height: 290px;
}

.xy-hero-orbit {
    position: absolute;
    top: 16px;
    right: 0;
    width: 224px;
    height: 224px;
    border: 1px solid var(--line-2);
    border-radius: 50%;
}

.xy-hero-orbit-2 {
    top: 54px;
    right: 36px;
    width: 152px;
    height: 152px;
    border-color: var(--accent);
    opacity: 0.28;
}

.xy-hero-seal {
    position: absolute;
    top: 90px;
    right: 64px;
    width: 96px;
    height: 96px;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: #faf7f0;
    font-family: var(--font-serif);
    font-size: 2.6rem;
    line-height: 1;
    transform: rotate(3deg);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.xy-hero-vertical {
    position: absolute;
    right: -8px;
    bottom: 2px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 0.38em;
    writing-mode: vertical-rl;
}

.xy-hero-compact {
    grid-template-columns: minmax(0, 1fr) 190px;
    padding: 18px 0 52px;
}

.xy-hero-compact h1 {
    max-width: 14em;
    margin-bottom: 20px;
    font-size: clamp(2.5rem, 4.8vw, 4.7rem);
}

.xy-hero-compact .xy-hero-desc {
    margin-bottom: 20px;
}

.xy-hero-compact .xy-hero-aside {
    min-height: 210px;
}

.xy-hero-compact .xy-hero-orbit {
    width: 174px;
    height: 174px;
}

.xy-hero-compact .xy-hero-orbit-2 {
    top: 40px;
    right: 28px;
    width: 118px;
    height: 118px;
}

.xy-hero-compact .xy-hero-seal {
    top: 64px;
    right: 48px;
    width: 76px;
    height: 76px;
    font-size: 2rem;
}

.xy-hero-compact .xy-hero-vertical {
    display: none;
}

/* --------------------------------------------------------------------------
   分类索引
   ----------------------------------------------------------------------- */

.xy-sorts {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 20px 0;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
    scrollbar-width: none;
}

.xy-sorts::-webkit-scrollbar {
    display: none;
}

.xy-sort {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    flex: 0 0 auto;
    padding: 7px 13px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--ink-2);
    font-size: 0.8rem;
    white-space: nowrap;
    transition: border-color 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}

.xy-sort small {
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 0.03em;
}

.xy-sort:hover {
    border-color: var(--line);
    background: var(--paper-3);
    color: var(--ink);
}

.xy-sort.is-active {
    border-color: var(--ink);
    color: var(--ink);
}

.xy-sort.is-active small {
    color: var(--accent);
}

/* --------------------------------------------------------------------------
   笔记列表
   ----------------------------------------------------------------------- */

.xy-notes {
    padding-top: 52px;
}

.xy-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 4px;
}

.xy-section-head h2 {
    margin: 0;
    font-family: var(--font-serif);
    font-size: clamp(1.8rem, 3vw, 2.55rem);
    font-weight: 400;
    line-height: 1.25;
}

.xy-section-count {
    flex: 0 0 auto;
    padding-bottom: 7px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.06em;
}

.xy-note-list {
    margin-top: 14px;
    border-top: 1px solid var(--line);
}

.xy-note {
    position: relative;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 24px;
    padding: 32px 0;
    border-bottom: 1px solid var(--line);
}

.xy-note.has-cover {
    grid-template-columns: 58px minmax(0, 1fr) 188px;
    gap: 34px;
}

.xy-note-index {
    padding-top: 8px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.61rem;
    letter-spacing: 0.08em;
}

.xy-note-body {
    min-width: 0;
}

.xy-note-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 11px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.06em;
}

.xy-note-cat {
    color: var(--accent);
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.xy-note-title {
    margin: 0 0 11px;
    font-family: var(--font-serif);
    font-size: clamp(1.42rem, 2.25vw, 2rem);
    font-weight: 400;
    line-height: 1.32;
    letter-spacing: -0.01em;
    text-wrap: balance;
}

.xy-note-title a {
    background-image: linear-gradient(var(--accent), var(--accent));
    background-position: 0 100%;
    background-repeat: no-repeat;
    background-size: 0 1px;
    transition: color 0.25s ease, background-size 0.4s ease;
}

.xy-note:hover .xy-note-title a {
    color: var(--accent);
    background-size: 100% 1px;
}

.xy-note-excerpt {
    max-width: 64ch;
    margin: 0 0 17px;
    color: var(--ink-2);
    font-size: 0.92rem;
    line-height: 1.82;
}

.xy-note-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.xy-note-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-width: 0;
}

.xy-tag {
    display: inline-block;
    padding: 3px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.56rem;
    letter-spacing: 0.02em;
    line-height: 1.5;
    transition: color 0.25s ease, border-color 0.25s ease;
}

.xy-tag:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.xy-note-stats {
    display: flex;
    flex: 0 0 auto;
    gap: 13px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.58rem;
}

.xy-note-stats span,
.xy-note-stats a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.xy-note-stats svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.xy-note-cover {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--paper-2);
}

.xy-note-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(0.82);
    transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.5s ease;
}

.xy-note:hover .xy-note-cover img {
    transform: scale(1.045);
    filter: saturate(1);
}

.xy-pin {
    display: inline-block;
    margin-right: 8px;
    padding: 2px 6px;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.52rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    line-height: 1.5;
    vertical-align: 0.25em;
}

/* --------------------------------------------------------------------------
   空状态
   ----------------------------------------------------------------------- */

.xy-empty {
    margin: 18px 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.8;
}

.xy-empty a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.xy-empty-state {
    margin-top: 24px;
    padding: 66px 30px;
    border: 1px dashed var(--line-2);
    text-align: center;
}

.xy-empty-mark {
    display: inline-grid;
    place-items: center;
    width: 62px;
    height: 62px;
    margin-bottom: 22px;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-family: var(--font-serif);
    font-size: 1.5rem;
    transform: rotate(-3deg);
}

.xy-empty-state h3 {
    margin: 0 0 10px;
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 400;
}

.xy-empty-state p {
    max-width: 42ch;
    margin: 0 auto 26px;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.8;
}

.xy-empty-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 9px;
}

/* --------------------------------------------------------------------------
   分页
   ----------------------------------------------------------------------- */

.xy-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 54px;
    font-family: var(--font-mono);
    font-size: 0.66rem;
}

.xy-pagination a,
.xy-pagination span,
.xy-pagination em {
    min-width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border: 1px solid var(--line);
    color: var(--ink-2);
    font-style: normal;
    transition: color 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.xy-pagination span {
    border-color: var(--ink);
    background: var(--ink);
    color: var(--paper);
}

.xy-pagination a:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.xy-pagination em {
    border-color: transparent;
    color: var(--muted);
}

/* --------------------------------------------------------------------------
   文章页
   ----------------------------------------------------------------------- */

.xy-crumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 38px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.6rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.xy-crumb a:hover {
    color: var(--accent);
}

.xy-article {
    width: 100%;
}

.xy-article-head {
    max-width: 900px;
    padding-bottom: 34px;
    border-bottom: 1px solid var(--line);
}

.xy-article-title {
    margin: 0 0 22px;
    font-family: var(--font-serif);
    font-size: clamp(2.55rem, 5vw, 4.9rem);
    font-weight: 400;
    line-height: 1.1;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.xy-article-deck {
    max-width: 56ch;
    margin: 0 0 27px;
    color: var(--ink-2);
    font-family: var(--font-serif);
    font-size: clamp(1.05rem, 1.55vw, 1.3rem);
    line-height: 1.82;
}

.xy-article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px 19px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.61rem;
    letter-spacing: 0.04em;
}

.xy-article-meta a:hover {
    color: var(--accent);
}

.xy-meta-author {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--ink-2);
}

.xy-meta-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
}

.xy-edit {
    padding: 3px 7px;
    border: 1px solid var(--line);
    color: var(--muted);
}

.xy-edit:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.xy-article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 17px;
}

.xy-article-cover {
    margin: 40px 0 0;
    aspect-ratio: 16 / 7;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--paper-2);
}

.xy-article-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.xy-article-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 70px;
    align-items: start;
    padding-top: 52px;
}

.xy-article-grid.xy-no-toc {
    grid-template-columns: minmax(0, 1fr);
}

.xy-article-grid:has(.xy-toc[hidden]) {
    grid-template-columns: minmax(0, 1fr);
}

.xy-article-body {
    min-width: 0;
    max-width: 770px;
}

/* --------------------------------------------------------------------------
   正文排版
   ----------------------------------------------------------------------- */

.xy-prose {
    color: var(--ink);
    font-family: var(--font-serif);
    font-size: 1.08rem;
    line-height: 1.96;
    overflow-wrap: break-word;
}

.xy-prose > *:first-child {
    margin-top: 0;
}

.xy-prose > *:last-child {
    margin-bottom: 0;
}

.xy-prose p {
    margin: 0 0 1.45em;
}

.xy-prose h2,
.xy-prose h3,
.xy-prose h4,
.xy-prose h5 {
    position: relative;
    scroll-margin-top: 92px;
    font-family: var(--font-serif);
    font-weight: 500;
    line-height: 1.4;
}

.xy-prose h2 {
    margin: 2.4em 0 0.85em;
    padding-top: 0.15em;
    font-size: 1.72rem;
}

.xy-prose h2::before {
    content: "";
    display: block;
    width: 28px;
    height: 1px;
    margin-bottom: 17px;
    background: var(--accent);
}

.xy-prose h3 {
    margin: 2em 0 0.7em;
    font-size: 1.34rem;
}

.xy-prose h4 {
    margin: 1.8em 0 0.6em;
    font-size: 1.12rem;
}

.xy-prose a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.xy-prose strong {
    font-weight: 600;
}

.xy-prose ul,
.xy-prose ol {
    margin: 0 0 1.5em;
    padding-left: 1.35em;
}

.xy-prose li {
    margin: 0.35em 0;
}

.xy-prose li > ul,
.xy-prose li > ol {
    margin-top: 0.35em;
    margin-bottom: 0.35em;
}

.xy-prose blockquote {
    margin: 2em 0;
    padding: 4px 0 4px 26px;
    border-left: 2px solid var(--accent);
    color: var(--ink-2);
    font-size: 1.04em;
}

.xy-prose blockquote p:last-child {
    margin-bottom: 0;
}

.xy-prose img {
    height: auto;
    margin: 2em auto;
    border: 1px solid var(--line);
    cursor: zoom-in;
}

.xy-prose figure {
    margin: 2em 0;
}

.xy-prose figcaption {
    margin-top: 9px;
    color: var(--muted);
    font-family: var(--font-sans);
    font-size: 0.74rem;
    text-align: center;
}

.xy-prose hr {
    height: 1px;
    margin: 3em 0;
    border: 0;
    background: var(--line);
}

.xy-prose code {
    padding: 0.16em 0.38em;
    border: 1px solid var(--line);
    border-radius: 2px;
    background: var(--paper-2);
    font-family: var(--font-mono);
    font-size: 0.84em;
}

.xy-prose pre {
    position: relative;
    margin: 2em 0;
    padding: 22px 22px 20px;
    overflow-x: auto;
    border: 1px solid #2b2924;
    background: #1d1c19;
    color: #e9e3d6;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 1.7;
    tab-size: 4;
}

.xy-prose pre code {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font-size: inherit;
}

.xy-prose table {
    width: 100%;
    margin: 2em 0;
    border-collapse: collapse;
    font-family: var(--font-sans);
    font-size: 0.84rem;
    line-height: 1.6;
}

.xy-prose th,
.xy-prose td {
    padding: 9px 11px;
    border: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.xy-prose th {
    background: var(--paper-2);
    font-weight: 600;
}

.xy-prose iframe,
.xy-prose video {
    max-width: 100%;
    border: 1px solid var(--line);
}

.xy-prose .xy-anchor-link {
    position: absolute;
    top: 0.1em;
    left: -1.15em;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.66em;
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.xy-prose h2:hover .xy-anchor-link,
.xy-prose h3:hover .xy-anchor-link,
.xy-prose h2:focus-within .xy-anchor-link,
.xy-prose h3:focus-within .xy-anchor-link {
    opacity: 1;
}

.xy-copy {
    position: absolute;
    top: 9px;
    right: 9px;
    padding: 3px 8px;
    border: 1px solid rgba(235, 230, 218, 0.25);
    color: rgba(235, 230, 218, 0.7);
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 0.05em;
    opacity: 0;
    transition: opacity 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.xy-prose pre:hover .xy-copy,
.xy-copy:focus-visible {
    opacity: 1;
}

.xy-copy:hover {
    border-color: rgba(235, 230, 218, 0.6);
    color: #fff;
}

@media (hover: none) {
    .xy-copy {
        opacity: 0.78;
    }
}

/* --------------------------------------------------------------------------
   正文结束 / 作者卡 / 相邻文章
   ----------------------------------------------------------------------- */

.xy-endmark {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 58px 0 38px;
    color: var(--muted);
}

.xy-endmark span {
    flex: 1;
    height: 1px;
    background: var(--line);
}

.xy-endmark em {
    padding: 3px 7px;
    border: 1px solid var(--line-2);
    font-family: var(--font-serif);
    font-size: 0.74rem;
    font-style: normal;
    transform: rotate(-2deg);
}

.xy-author-card {
    display: flex;
    align-items: center;
    gap: 17px;
    margin-bottom: 44px;
    padding: 22px;
    border: 1px solid var(--line);
    background: var(--paper-3);
}

.xy-author-card-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.xy-author-card-text .xy-kicker {
    margin-bottom: 5px;
    font-size: 0.54rem;
}

.xy-author-card-text strong {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.xy-author-card-text p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.6;
}

.xy-author-rss {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex: 0 0 auto;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.58rem;
}

.xy-author-rss:hover {
    color: var(--accent);
}

.xy-author-rss svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
}

.xy-neighbors {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    margin-bottom: 48px;
    border: 1px solid var(--line);
    background: var(--line);
}

.xy-neighbor {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-height: 98px;
    padding: 22px;
    background: var(--paper-3);
}

.xy-neighbor-next {
    align-items: flex-end;
    text-align: right;
}

.xy-neighbor-label {
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.56rem;
    letter-spacing: 0.1em;
}

.xy-neighbor strong {
    font-family: var(--font-serif);
    font-size: 0.98rem;
    font-weight: 400;
    line-height: 1.45;
}

.xy-neighbor:hover strong {
    color: var(--accent);
}

.xy-neighbor-empty {
    background: var(--paper-2);
    opacity: 0.3;
}

/* --------------------------------------------------------------------------
   文章目录
   ----------------------------------------------------------------------- */

.xy-toc {
    position: sticky;
    top: 92px;
}

.xy-toc-inner {
    padding-top: 16px;
    border-top: 1px solid var(--line-2);
}

.xy-toc-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.xy-toc-head .xy-kicker {
    margin: 0;
    font-size: 0.53rem;
    white-space: nowrap;
}

.xy-toc-rule {
    flex: 1;
    height: 1px;
    background: var(--line);
}

.xy-toc-nav {
    display: flex;
    flex-direction: column;
    gap: 1px;
    max-height: 58vh;
    overflow-y: auto;
    scrollbar-width: thin;
}

.xy-toc-link {
    display: block;
    padding: 5px 0 5px 12px;
    border-left: 1px solid transparent;
    color: var(--muted);
    font-size: 0.74rem;
    line-height: 1.5;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.xy-toc-link.xy-depth-3 {
    padding-left: 23px;
    font-size: 0.69rem;
}

.xy-toc-link:hover,
.xy-toc-link.is-active {
    border-left-color: var(--accent);
    color: var(--accent);
}

.xy-toc-top {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 18px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.56rem;
    letter-spacing: 0.06em;
}

.xy-toc-top:hover {
    color: var(--accent);
}

/* --------------------------------------------------------------------------
   评论
   ----------------------------------------------------------------------- */

.xy-comments {
    margin-top: 16px;
    padding-top: 44px;
    border-top: 1px solid var(--line);
    scroll-margin-top: 90px;
}

.xy-comments-head {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 26px;
}

.xy-comments-head .xy-kicker {
    margin-bottom: 6px;
}

.xy-comments-head h2 {
    margin: 0;
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 400;
    line-height: 1.25;
}

.xy-count {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    vertical-align: super;
}

.xy-comments-mark {
    color: var(--accent);
    font-family: var(--font-serif);
    font-size: 4rem;
    line-height: 0.8;
    opacity: 0.22;
}

.xy-comment {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 15px;
    padding: 20px 0;
    border-bottom: 1px solid var(--line);
    scroll-margin-top: 90px;
}

.xy-comment-child {
    margin-left: 38px;
    padding-left: 14px;
    border-left: 1px solid var(--line);
}

.xy-comment-avatar {
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 50%;
    object-fit: cover;
    filter: grayscale(0.15);
}

.xy-comment-main {
    min-width: 0;
}

.xy-comment-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 4px;
}

.xy-comment-head strong {
    color: var(--ink);
    font-size: 0.86rem;
    font-weight: 500;
}

.xy-comment-head time {
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.55rem;
}

.xy-comment-content {
    color: var(--ink-2);
    font-size: 0.9rem;
    line-height: 1.78;
    overflow-wrap: anywhere;
}

.xy-comment-content p:first-child {
    margin-top: 0;
}

.xy-comment-content p:last-child {
    margin-bottom: 0;
}

.xy-comment-actions {
    margin-top: 4px;
}

.xy-reply {
    padding: 2px 0;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 0.04em;
}

.xy-reply:hover {
    color: var(--accent);
}

.xy-empty-comment {
    padding: 24px 0;
    border-top: 1px solid var(--line);
}

.xy-respond {
    margin-bottom: 42px;
    padding: 30px;
    border: 1px solid var(--line);
    background: var(--paper-3);
    scroll-margin-top: 90px;
}

.xy-respond-head {
    margin-bottom: 24px;
}

.xy-respond-head .xy-kicker {
    margin-bottom: 5px;
}

.xy-respond-head h2 {
    margin: 0;
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 400;
}

.xy-field {
    margin-bottom: 17px;
}

.xy-field label {
    display: block;
    margin-bottom: 7px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.58rem;
    letter-spacing: 0.06em;
}

.xy-field label span {
    color: var(--accent);
}

.xy-field input,
.xy-field textarea {
    width: 100%;
    padding: 9px 0;
    border: 0;
    border-bottom: 1px solid var(--line-2);
    border-radius: 0;
    outline: none;
    background: transparent;
    color: var(--ink);
    font-size: 0.92rem;
    transition: border-color 0.25s ease;
}

.xy-field textarea {
    min-height: 140px;
    padding: 13px;
    border: 1px solid var(--line-2);
    background: var(--paper);
    line-height: 1.75;
    resize: vertical;
}

.xy-field input:focus,
.xy-field textarea:focus {
    border-color: var(--accent);
}

.xy-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.xy-captcha {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 14px 0;
}

.xy-captcha img {
    height: 36px;
    border: 1px solid var(--line);
}

.xy-captcha input {
    width: 130px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    outline: none;
    background: var(--paper);
}

.xy-form-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 20px;
}

.xy-form-tip {
    margin: 0;
    color: var(--muted);
    font-size: 0.68rem;
    line-height: 1.6;
}

.xy-form-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.xy-cancel-reply {
    color: var(--muted);
    font-size: 0.68rem;
}

.xy-pagination-comments {
    margin-top: 28px;
}

/* --------------------------------------------------------------------------
   404
   ----------------------------------------------------------------------- */

.xy-main-404 {
    display: flex;
    align-items: center;
    min-height: 72vh;
}

.xy-404 {
    position: relative;
    isolation: isolate;
    max-width: 780px;
    padding: 20px 0;
}

.xy-404-number {
    position: absolute;
    top: -50px;
    right: -10px;
    z-index: -1;
    color: transparent;
    font-family: var(--font-serif);
    font-size: clamp(9rem, 21vw, 17rem);
    line-height: 0.8;
    -webkit-text-stroke: 1px var(--line-2);
    opacity: 0.75;
    pointer-events: none;
    user-select: none;
}

.xy-404 h1 {
    margin: 0 0 20px;
    font-family: var(--font-serif);
    font-size: clamp(2.6rem, 5vw, 4.5rem);
    font-weight: 400;
    line-height: 1.12;
    letter-spacing: -0.02em;
}

.xy-404 h1 em {
    color: var(--accent);
    font-style: normal;
}

.xy-404-desc {
    max-width: 46ch;
    margin: 0 0 30px;
    color: var(--ink-2);
    font-size: 0.98rem;
    line-height: 1.85;
}

.xy-404-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

/* --------------------------------------------------------------------------
   加密文章
   ----------------------------------------------------------------------- */

.xy-pw-body {
    min-height: 100vh;
    display: flex;
}

.xy-pw {
    width: min(700px, 100%);
    margin: auto;
    padding: 46px 30px;
}

.xy-pw-brand {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 72px;
    color: var(--ink);
}

.xy-pw-brand > span:last-child {
    display: flex;
    flex-direction: column;
}

.xy-pw-brand strong {
    font-family: var(--font-serif);
    font-size: 1.02rem;
    font-weight: 500;
    letter-spacing: 0.1em;
}

.xy-pw-brand small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.66rem;
}

.xy-pw-card {
    padding: 36px 0;
    border-top: 1px solid var(--line-2);
    border-bottom: 1px solid var(--line-2);
}

.xy-pw-card h1 {
    margin: 0 0 20px;
    font-family: var(--font-serif);
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    font-weight: 400;
    line-height: 1.12;
    letter-spacing: -0.02em;
}

.xy-pw-card h1 em {
    color: var(--accent);
    font-style: normal;
}

.xy-pw-desc {
    max-width: 44ch;
    margin: 0 0 28px;
    color: var(--ink-2);
    font-size: 0.92rem;
    line-height: 1.85;
}

.xy-pw form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 410px;
}

.xy-pw input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line-2);
    outline: none;
    background: var(--paper-3);
    color: var(--ink);
    font-size: 0.92rem;
    transition: border-color 0.25s ease;
}

.xy-pw input:focus {
    border-color: var(--accent);
}

.xy-pw .xy-btn {
    width: 100%;
}

.xy-pw-back {
    display: inline-block;
    margin-top: 24px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.04em;
}

.xy-pw-back:hover {
    color: var(--accent);
}

.xy-pw-foot {
    margin: 34px 0 0;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.56rem;
    letter-spacing: 0.06em;
}

/* --------------------------------------------------------------------------
   页脚
   ----------------------------------------------------------------------- */

.xy-footer {
    margin-top: auto;
    background: var(--paper-2);
    border-top: 1px solid var(--line);
    transition: background-color 0.35s ease, border-color 0.35s ease;
}

.xy-footer-inner {
    width: 100%;
    max-width: var(--max);
    margin: 0 auto;
    padding: 54px 64px 26px;
}

.xy-footer-main {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 56px;
    padding-bottom: 44px;
    border-bottom: 1px solid var(--line);
}

.xy-footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    color: var(--ink);
}

.xy-footer-logo > span:last-child {
    display: flex;
    flex-direction: column;
}

.xy-footer-logo strong {
    font-family: var(--font-serif);
    font-size: 1.08rem;
    font-weight: 500;
    letter-spacing: 0.1em;
}

.xy-footer-logo small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.66rem;
}

.xy-footer-note {
    max-width: 34ch;
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.8;
}

.xy-footer-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.xy-footer-col {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.xy-footer-label {
    margin-bottom: 6px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.55rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.xy-footer-col a,
.xy-footer-col p {
    margin: 0;
    color: var(--ink-2);
    font-size: 0.78rem;
    line-height: 1.75;
}

.xy-footer-col a {
    align-self: flex-start;
}

.xy-footer-mail {
    margin-top: 4px;
    color: var(--accent) !important;
}

.xy-footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding-top: 20px;
    color: var(--muted);
    font-size: 0.68rem;
    line-height: 1.7;
}

.xy-footer-copy p {
    margin: 0;
}

.xy-footer-legal {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.66rem;
}

.xy-footer-legal a {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.xy-footer-legal a:hover {
    color: var(--accent);
}

.xy-back-top {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.54rem;
    letter-spacing: 0.1em;
}

.xy-back-top:hover {
    color: var(--accent);
}

.xy-back-top svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* --------------------------------------------------------------------------
   图片灯箱
   ----------------------------------------------------------------------- */

.xy-lightbox {
    position: fixed;
    inset: 0;
    z-index: 240;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 26px;
    background: rgba(15, 14, 12, 0.92);
    animation: xyFadeIn 0.2s ease both;
}

.xy-lightbox img {
    max-width: 92vw;
    max-height: 88vh;
    object-fit: contain;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.xy-lightbox-close {
    position: absolute;
    top: 22px;
    right: 22px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 50%;
    color: #fff;
}

.xy-lightbox-close svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
}

/* --------------------------------------------------------------------------
   动效
   ----------------------------------------------------------------------- */

.xy-js .xy-reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.75s ease, transform 0.75s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.xy-js .xy-reveal.is-in {
    opacity: 1;
    transform: none;
}

@keyframes xyFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes xyRiseIn {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   响应式
   ----------------------------------------------------------------------- */

@media (max-width: 1180px) {
    .xy-main {
        padding: 54px 44px 84px;
    }

    .xy-footer-inner {
        padding: 48px 44px 24px;
    }

    .xy-article-grid {
        grid-template-columns: minmax(0, 1fr) 198px;
        gap: 44px;
    }
}

@media (max-width: 1320px) {
    .xy-hero,
    .xy-hero-compact {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .xy-hero-aside {
        display: none;
    }

    .xy-article-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .xy-toc {
        position: static;
        order: -1;
        margin-bottom: 30px;
    }

    .xy-toc-inner {
        padding: 16px 0;
        border-bottom: 1px solid var(--line);
    }

    .xy-toc-nav {
        max-height: 200px;
    }
}

@media (max-width: 980px) {
    .xy-rail {
        width: 240px;
        padding: 30px 24px 22px;
    }

    .xy-stage {
        width: calc(100% - 240px);
        margin-left: 240px;
    }

    .xy-main {
        padding: 44px 32px 72px;
    }

    .xy-brand-text small {
        max-width: 140px;
    }

    .xy-hero {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .xy-hero-orbit {
        width: 174px;
        height: 174px;
    }

    .xy-hero-orbit-2 {
        top: 46px;
        right: 28px;
        width: 118px;
        height: 118px;
    }

    .xy-hero-seal {
        top: 70px;
        right: 48px;
        width: 78px;
        height: 78px;
        font-size: 2rem;
    }

    .xy-hero-vertical {
        display: none;
    }

    .xy-note.has-cover {
        grid-template-columns: 48px minmax(0, 1fr) 148px;
        gap: 24px;
    }

    .xy-footer-inner {
        padding: 44px 32px 22px;
    }

    .xy-footer-main {
        grid-template-columns: 1fr 1fr;
        gap: 34px;
    }

    .xy-footer-cols {
        gap: 18px;
    }

    .xy-article-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .xy-toc {
        position: static;
        order: -1;
        margin-bottom: 30px;
    }

    .xy-toc-inner {
        padding: 16px 0;
        border-bottom: 1px solid var(--line);
    }

    .xy-toc-nav {
        max-height: 200px;
    }

    .xy-article-body {
        max-width: none;
    }
}

@media (max-width: 820px) {
    .xy-rail {
        display: none;
    }

    .xy-stage {
        width: 100%;
        margin-left: 0;
    }

    .xy-topbar {
        display: flex;
    }

    .xy-main {
        padding: 34px 22px 64px;
    }

    .xy-hero,
    .xy-hero-compact {
        grid-template-columns: minmax(0, 1fr);
        padding: 26px 0 46px;
    }

    .xy-hero-aside {
        display: none;
    }

    .xy-hero h1 {
        max-width: 11em;
        font-size: clamp(2.7rem, 10.5vw, 4.4rem);
    }

    .xy-hero-compact h1 {
        font-size: clamp(2.25rem, 8vw, 3.6rem);
    }

    .xy-hero-desc {
        font-size: 0.96rem;
    }

    .xy-note,
    .xy-note.has-cover {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
        padding: 28px 0;
    }

    .xy-note-index {
        display: none;
    }

    .xy-note.has-cover .xy-note-cover {
        grid-row: 1;
        aspect-ratio: 16 / 8;
    }

    .xy-note.has-cover .xy-note-body {
        grid-row: 2;
    }

    .xy-note-cover {
        aspect-ratio: 16 / 8;
    }

    .xy-section-head {
        align-items: flex-end;
    }

    .xy-footer-inner {
        padding: 38px 22px 22px;
    }

    .xy-footer-main {
        grid-template-columns: 1fr;
        gap: 30px;
        padding-bottom: 34px;
    }

    .xy-footer-cols {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }

    .xy-footer-bottom {
        align-items: flex-start;
    }

    .xy-article-head {
        padding-bottom: 26px;
    }

    .xy-article-title {
        font-size: clamp(2.2rem, 8.8vw, 3.4rem);
    }

    .xy-article-grid {
        padding-top: 32px;
    }

    .xy-article-cover {
        margin-top: 28px;
        aspect-ratio: 16 / 9;
    }

    .xy-form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .xy-neighbors {
        grid-template-columns: 1fr;
    }

    .xy-neighbor-next {
        align-items: flex-start;
        text-align: left;
    }

    .xy-comment-child {
        margin-left: 18px;
        padding-left: 12px;
    }

    .xy-respond {
        padding: 24px 18px;
    }

    .xy-main-404 {
        min-height: 68vh;
    }

    .xy-pw-brand {
        margin-bottom: 52px;
    }
}

@media (max-width: 560px) {
    .xy-main {
        padding: 24px 18px 54px;
    }

    .xy-topbar {
        padding: 11px 16px;
    }

    .xy-hero h1 {
        font-size: 2.55rem;
        line-height: 1.06;
    }

    .xy-hero-compact h1 {
        font-size: 2.1rem;
    }

    .xy-hero-actions {
        align-items: flex-start;
    }

    .xy-hero-meta {
        margin-top: 26px;
        font-size: 0.56rem;
        line-height: 1.8;
    }

    .xy-sorts {
        margin: 0 -18px;
        padding: 14px 18px;
    }

    .xy-sort {
        padding: 6px 11px;
        font-size: 0.76rem;
    }

    .xy-notes {
        padding-top: 38px;
    }

    .xy-section-head h2 {
        font-size: 1.75rem;
    }

    .xy-section-count {
        font-size: 0.56rem;
    }

    .xy-note-title {
        font-size: 1.44rem;
    }

    .xy-note-excerpt {
        font-size: 0.88rem;
    }

    .xy-note-stats {
        display: none;
    }

    .xy-footer-cols {
        grid-template-columns: 1fr;
    }

    .xy-footer-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .xy-article-meta {
        gap: 7px 13px;
        font-size: 0.56rem;
    }

    .xy-article-deck {
        font-size: 0.99rem;
    }

    .xy-crumb {
        margin-bottom: 26px;
        font-size: 0.54rem;
    }

    .xy-prose {
        font-size: 1rem;
        line-height: 1.9;
    }

    .xy-prose h2 {
        font-size: 1.48rem;
    }

    .xy-prose h3 {
        font-size: 1.22rem;
    }

    .xy-prose pre {
        margin-left: -18px;
        margin-right: -18px;
        padding: 18px;
        border-left: 0;
        border-right: 0;
    }

    .xy-comments-mark {
        display: none;
    }

    .xy-comment {
        grid-template-columns: 36px minmax(0, 1fr);
        gap: 11px;
    }

    .xy-comment-avatar {
        width: 36px;
        height: 36px;
    }

    .xy-respond {
        padding: 22px 16px;
    }

    .xy-author-card {
        align-items: flex-start;
        flex-wrap: wrap;
        padding: 18px;
    }

    .xy-author-rss {
        margin-left: 0;
    }

    .xy-404-number {
        top: -30px;
        right: 0;
    }

    .xy-404 h1 {
        font-size: 2.45rem;
    }

    .xy-search {
        padding: 18px;
    }

    .xy-search-panel {
        padding: 24px 0 28px;
    }

    .xy-search h2 {
        margin: 20px 0 26px;
        font-size: 2rem;
    }

    .xy-search-form input {
        font-size: 1.15rem;
    }

    .xy-pw {
        padding: 30px 20px;
    }

    .xy-pw-brand {
        margin-bottom: 40px;
    }

    .xy-pw-card h1 {
        font-size: 2.35rem;
    }

    .xy-empty-state {
        padding: 46px 20px;
    }

    .xy-field input,
    .xy-field textarea,
    .xy-pw input {
        font-size: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* --------------------------------------------------------------------------
   打印
   ----------------------------------------------------------------------- */

@media print {
    .xy-rail,
    .xy-topbar,
    .xy-footer,
    .xy-toc,
    .xy-progress,
    .xy-skip,
    .xy-search,
    .xy-drawer,
    .xy-lightbox,
    .xy-comments,
    .xy-respond,
    .xy-neighbors,
    .xy-author-card {
        display: none !important;
    }

    .xy-stage {
        width: 100%;
        margin: 0;
    }

    .xy-main {
        max-width: none;
        padding: 0;
    }

    .xy-article-grid {
        display: block;
        padding-top: 20px;
    }

    .xy-prose {
        font-size: 11pt;
        line-height: 1.7;
    }

    body {
        background: #fff;
        color: #000;
    }
}
