﻿:root {
    --page: #efefff;
    --surface: #ffffff;
    --sidebar: #f7f7ff;
    --line: #e8e9f6;
    --text: #202545;
    --muted: #858aa8;
    --primary: #4c4cff;
    --primary-soft: #eeeeff;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none;
}

[data-damped-scroll] {
    scroll-behavior: auto;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    background: var(--page);
    color: var(--text);
    font-family: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.65;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: auto;
}

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

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

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

.book-stage {
    width: min(1080px, calc(100% - 48px));
    margin: 40px auto;
    position: relative;
    perspective: none;
}

.book-stage.is-book-open {
    perspective: 1800px;
}

.site-shell {
    position: relative;
    z-index: 2;
    width: 100%;
    margin: 0;
    overflow: hidden;
    background: var(--surface);
    border-radius: 20px;
    box-shadow: 0 24px 70px rgba(64, 64, 140, 0.1);
    transition: border-radius 320ms ease, box-shadow 320ms ease;
}

.book-stage.is-book-open .site-shell {
    border-radius: 2px;
    box-shadow: 0 18px 48px rgba(53, 55, 126, 0.12);
}

.book-panel {
    display: none;
}

.book-panel {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 1;
    width: clamp(220px, calc((100vw - 1080px) / 2 - 20px), 360px);
    overflow: hidden;
    border: 1px solid rgba(102, 109, 175, 0.14);
    background: var(--sidebar);
    box-shadow: 0 28px 65px rgba(53, 55, 126, 0.14);
    opacity: 0;
    visibility: hidden;
    backface-visibility: hidden;
    transition:
        transform 720ms cubic-bezier(0.22, 0.8, 0.24, 1),
        opacity 240ms ease,
        visibility 0s linear 720ms;
}

.book-panel::after {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 22px;
    pointer-events: none;
    content: "";
}

.book-panel::before {
    position: absolute;
    z-index: 2;
    inset: 7px;
    border: 1px solid rgba(112, 117, 169, 0.09);
    pointer-events: none;
    content: "";
}

.book-panel-left {
    right: calc(100% - 2px);
    border-radius: 22px 0 0 22px;
    transform: rotateY(88deg) scaleX(0.98);
    transform-origin: right center;
}

.book-panel-left::before {
    border-right: 0;
    border-radius: 15px 0 0 15px;
}

.book-panel-left::after {
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(42, 45, 105, 0.15));
}

.book-panel-right {
    left: calc(100% - 2px);
    border-radius: 0 22px 22px 0;
    transform: rotateY(-88deg) scaleX(0.98);
    transform-origin: left center;
}

.book-panel-right::before {
    border-left: 0;
    border-radius: 0 15px 15px 0;
}

.book-panel-right::after {
    left: 0;
    background: linear-gradient(90deg, rgba(42, 45, 105, 0.15), transparent);
}

.book-stage.is-book-open .book-panel {
    opacity: 1;
    visibility: visible;
    transform: rotateY(0deg) scaleX(1);
    transition:
        transform 720ms cubic-bezier(0.22, 0.8, 0.24, 1),
        opacity 240ms ease,
        visibility 0s;
}

.book-stage.is-book-open .book-panel-left {
    box-shadow: -18px 24px 48px rgba(53, 55, 126, 0.12), inset -12px 0 18px rgba(54, 58, 115, 0.05);
}

.book-stage.is-book-open .book-panel-right {
    box-shadow: 18px 24px 48px rgba(53, 55, 126, 0.12), inset 12px 0 18px rgba(54, 58, 115, 0.05);
}

.book-page-inner {
    position: relative;
    height: 100%;
    padding: 42px 34px;
    overflow-y: auto;
    scrollbar-width: none;
}

.book-page-inner::-webkit-scrollbar {
    display: none;
}

.book-comments-page {
    padding: 18px 16px;
}

.book-comments-page-left {
    overflow: hidden;
}

.book-comments-page-right {
    overflow-y: auto;
}

.book-comments-page .book-comment-list li {
    margin: 0 0 18px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.book-comments-page .book-comment-list li li {
    margin: 18px 0 0 40px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.book-comment-list .comment-author {
    display: inline;
    color: #a5a4a0;
    font-size: 13px;
    font-weight: 400;
}

.book-comment-list .comment-author .avatar {
    width: 30px;
    height: 30px;
    margin-right: 8px;
}

.book-comment-list .comment-author .fn {
    font-style: normal;
}

.book-comment-list .comment-meta {
    display: inline;
    margin-left: 6px;
    color: #aaa9a4;
    font-size: 12px;
}

.book-comment-list .comment-content {
    margin: 4px 0 0 31px;
    color: #33332f;
    font-size: 14px;
    line-height: 1.65;
}

.book-comment-list .comment-content p {
    margin: 0;
}

.book-comment-list .comment-reply {
    margin: 5px 0 0 31px;
    color: #b0afaa;
    font-size: 11px;
}

.book-comment-list .comment-reply a {
    position: relative;
    z-index: 3;
    display: inline-block;
    cursor: pointer;
    pointer-events: auto;
}

.book-comment-list .comment-reply a:hover {
    color: var(--primary);
}

.book-comments-page .page-navigator {
    display: flex;
    gap: 8px;
    margin: 10px 0 0 31px;
    font-size: 11px;
}

.book-page-number {
    position: absolute;
    top: 26px;
    right: 28px;
    color: #c8cada;
    font-family: Georgia, serif;
    font-size: 13px;
}

.book-eyebrow {
    margin: 0 0 8px;
    color: var(--primary);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.18em;
}

.book-page-inner h2 {
    margin: 0;
    font-family: Georgia, "Songti SC", serif;
    font-size: 26px;
    font-weight: 500;
}

.book-intro {
    margin: 12px 0 34px;
    color: #737895;
    font-size: 12px;
}

.book-section {
    margin-top: 30px;
}

.book-section h3 {
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(106, 111, 163, 0.16);
    color: #878ba6;
    font-size: 11px;
    letter-spacing: 0.08em;
}

.book-section ul,
.book-recent {
    margin: 0;
    padding: 0;
    list-style: none;
}

.book-section li {
    margin: 10px 0;
    color: #454b70;
    font-size: 13px;
}

.book-section li a::before {
    margin-right: 8px;
    color: #b1b5cc;
    content: "—";
}

.book-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.book-tags a {
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(76, 76, 255, 0.08);
    color: #626895;
    font-size: 11px;
}

.site-header {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 26px;
    height: 78px;
    padding: 0 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.mobile-nav-toggle,
.mobile-nav-heading,
.mobile-nav-footer,
.mobile-nav-backdrop {
    display: none;
}

.top-nav {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: flex-start;
    gap: 22px;
    min-width: 0;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}

.top-nav::-webkit-scrollbar {
    display: none;
}

.top-nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 500;
}

.nav-icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.nav-icon {
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    fill: currentColor;
}

.nav-category-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-category-grid-icon {
    display: grid;
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    grid-template-columns: repeat(2, 5px);
    grid-template-rows: repeat(2, 5px);
    place-content: center;
    gap: 2px;
}

.nav-category-grid-icon i {
    display: block;
    width: 5px;
    height: 5px;
    border: 1px solid currentColor;
    border-radius: 1px;
    box-sizing: border-box;
}

.nav-category-group {
    flex: 0 0 auto;
}

.nav-category-toggle {
    display: flex;
    width: 100%;
    padding: 0;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
}

.nav-category-arrow {
    display: grid;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    place-items: center;
    border-radius: 5px;
    background: rgba(92, 85, 255, 0.06);
    color: var(--muted);
    transition: color 180ms ease, background-color 180ms ease;
}

.nav-category-arrow::before {
    width: 5px;
    height: 5px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    content: "";
    transform: translateY(-1px) rotate(45deg);
    transition: transform 180ms ease;
}

.nav-category-toggle:hover .nav-category-arrow,
.nav-category-toggle.is-current .nav-category-arrow {
    background: rgba(92, 85, 255, 0.11);
    color: var(--primary);
}

.nav-category-group.is-open .nav-category-arrow::before {
    transform: translateY(1px) rotate(225deg);
}

.nav-category-list {
    display: flex;
    flex-direction: column;
}

.top-nav .is-current,
.nav-category-toggle.is-current {
    color: var(--primary);
}

.header-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
}

.search-form {
    display: flex;
    align-items: center;
}

.search-form input {
    width: 0;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    transition: width 0.2s ease, padding 0.2s ease;
}

.search-form:focus-within input,
.search-form.is-open input {
    width: 100px;
    padding: 6px 8px;
    border-bottom: 1px solid var(--line);
}

.search-form button,
.theme-toggle,
.admin-link {
    display: grid;
    width: 34px;
    height: 34px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #3d466c;
    font-size: 20px;
    cursor: pointer;
}

.admin-link svg,
.theme-toggle svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.search-form .search-icon {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 1.8;
}

.theme-toggle {
    display: flex;
    width: 42px;
    height: 26px;
    padding: 3px 7px;
    justify-content: flex-start;
    border: 1px solid #e2e4eb;
    border-radius: 999px;
    background: #f4f5f7;
    color: #626874;
    transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.theme-toggle svg {
    width: 13px;
    height: 13px;
}

.theme-toggle .theme-icon-moon {
    fill: none;
    stroke: currentColor;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

.theme-toggle .theme-icon-sun {
    display: none;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-width: 1.8;
}

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

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

.search-form button:hover,
.admin-link:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.theme-toggle:hover {
    border-color: rgba(76, 76, 255, 0.24);
    background: #eeeefe;
    color: var(--primary);
}

.theme-toggle:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--primary) 45%, transparent);
    outline-offset: 2px;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    align-items: stretch;
}

.main-column {
    min-width: 0;
    background: var(--surface);
}

.hero {
    position: relative;
    min-height: 310px;
    background: #263553;
}

.hero::before,
.hero::after {
    position: absolute;
    inset: 0;
    pointer-events: none;
    content: "";
}

.hero::before {
    z-index: 1;
    background: linear-gradient(180deg, rgba(6, 24, 57, 0.02) 30%, rgba(3, 13, 33, 0.72) 100%);
}

.hero::after {
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-image {
    position: absolute;
    z-index: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-profile {
    position: absolute;
    z-index: 3;
    bottom: -9px;
    right: 28px;
    display: flex;
    flex-direction: row-reverse;
    align-items: flex-end;
    gap: 8px;
    color: #fff;
}

.hero-copy {
    max-width: 360px;
    padding-bottom: 31px;
    text-align: right;
}

.hero h1 {
    margin: 0;
    font-family: Georgia, "Songti SC", "STSong", "Noto Serif CJK SC", serif;
    font-size: 23px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 0.015em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9), 0 0 1px rgba(0, 0, 0, 0.75);
}

.hero-avatar {
    display: grid;
    width: 68px;
    height: 68px;
    flex: 0 0 68px;
    place-items: center;
    border: 4px solid #fff;
    border-radius: 12px;
    background: linear-gradient(145deg, #ffb344, #ff674d);
    color: #fff;
    font-size: 30px;
    font-weight: 800;
    text-shadow: none;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}

.hero-avatar-image {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    object-fit: cover;
    object-position: center;
}

.hero-avatar-frame {
    padding: 4px;
    overflow: hidden;
    border: 0;
    background: #fff;
}

.hero-bio {
    position: relative;
    z-index: 2;
    min-height: 88px;
    flex: 0 0 auto;
    margin-top: -14px;
    padding: 41px 28px 14px;
    border-radius: 14px 14px 0 0;
    background: var(--surface);
}

.hero-bio p {
    width: fit-content;
    max-width: 100%;
    margin: 0 0 0 auto;
    color: #737895;
    font-size: 13px;
    text-align: right;
}

.topic-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 64px;
    padding: 12px 24px;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.topic-strip a {
    padding: 5px 12px;
    border-radius: 4px;
    background: #f0f0f2;
    color: #9599b8;
    font-size: 12px;
    line-height: 1.4;
}

.topic-strip a:hover,
.topic-strip .is-active {
    background: #4343ff;
    color: #fff;
    box-shadow: 0 3px 8px rgba(67, 67, 255, 0.18);
}

.post-list {
    padding: 14px 32px 30px;
    transition: opacity 140ms ease;
}

.post-list.is-filtering {
    opacity: 0.55;
    pointer-events: none;
}

.post-card {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 18px;
    padding: 24px 0;
    border-bottom: 1px solid var(--line);
}

.post-cover {
    display: grid;
    width: 150px;
    height: 120px;
    overflow: hidden;
    flex: 0 0 150px;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(145deg, #d9edff, #7fb2ff 52%, #5066dd);
    color: rgba(255, 255, 255, 0.92);
    font-size: 40px;
    font-weight: 800;
    letter-spacing: -0.08em;
}

.post-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.post-card:nth-child(2n) .post-cover {
    background: linear-gradient(145deg, #fff1bc, #ffb874 52%, #eb6d72);
}

.post-content {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: space-between;
}

.post-content h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.45;
}

.post-content h2 a {
    color: #2c2f48;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    color: #8e93b0;
    font-size: 12px;
}

.post-author {
    color: #6c7294;
    font-weight: 500;
}

.post-excerpt {
    display: -webkit-box;
    margin-top: 8px;
    overflow: hidden;
    color: #6c7294;
    font-size: 13px;
    line-height: 1.7;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.post-excerpt p {
    margin: 0;
}

.post-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 38px;
    margin-top: 12px;
    padding: 7px 10px;
    gap: 12px;
    border-radius: 8px;
    background: #f4f5fc;
    color: #999eb6;
    font-size: 11px;
}

.post-stats,
.post-stats > span {
    display: flex;
    align-items: center;
}

.post-stats {
    gap: 12px;
    color: #435381;
    font-size: 11px;
}

.post-stats > span {
    gap: 4px;
}

.post-stats b {
    font-weight: 500;
}

.post-stat-icon {
    display: block;
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
    fill: currentColor;
}

.post-like {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
}

.post-like.is-liked {
    color: #ff8055;
}

.post-like.is-processing {
    opacity: 0.6;
    pointer-events: none;
}

.post-like svg {
    transition: transform 0.2s ease;
}

.post-like:active svg {
    transform: scale(1.15);
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px;
}

.post-tags a {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 5px;
    background: #e9eaf0;
    color: #858aa4;
    font-size: 11px;
}

.moment-card {
    padding: 26px 0 28px;
    border-bottom: 1px solid var(--line);
}

.moment-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.moment-avatar {
    display: block;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 10px;
    background: #fff;
    image-rendering: auto;
    object-fit: cover;
    object-position: center;
}

.moment-avatar-fallback {
    display: grid;
    place-items: center;
    background: #ff8055;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
}

.moment-header > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

.moment-header strong {
    color: #3d4675;
    font-size: 14px;
}

.moment-header time {
    color: #a0a4ba;
    font-size: 10px;
}

.moment-content {
    margin: 12px 0 0 54px;
    color: #353b57;
    font-size: 14px;
    line-height: 1.75;
}

.moment-content p {
    margin: 0 0 10px;
}

.moment-content a {
    color: var(--primary);
}

.moment-gallery {
    display: grid;
    width: min(100%, 430px);
    margin-top: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
}

.moment-gallery.is-count-1 {
    width: min(100%, 330px);
    grid-template-columns: 1fr;
}

.moment-gallery.is-count-2,
.moment-gallery.is-count-4 {
    width: min(100%, 360px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.moment-gallery > a,
.moment-gallery > img {
    display: block;
    min-width: 0;
    overflow: hidden;
    border-radius: 7px;
}

.moment-gallery img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 7px;
    object-fit: cover;
}

.moment-gallery.is-count-1 img {
    aspect-ratio: 4 / 3;
}

.moment-foot {
    display: flex;
    min-height: 38px;
    padding: 7px 10px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 14px 0 0 54px;
    border-radius: 8px;
    background: #f4f5fc;
    color: #999eb6;
    font-size: 10px;
}

.moment-stats,
.moment-stats > span {
    display: flex;
    align-items: center;
}

.moment-stats {
    gap: 10px;
    color: #435381;
}

.moment-stats > span {
    gap: 4px;
}

.moment-stats b {
    font-size: 10px;
    font-weight: 500;
}

.moment-icon-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.moment-stat-icon {
    display: block;
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
    fill: currentColor;
}

.moment-like {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
}

.moment-comment-toggle {
    cursor: pointer;
    user-select: none;
}

.moment-comment-toggle:hover,
.moment-comment-toggle:focus-visible {
    color: var(--primary);
    outline: none;
}

.moment-like.is-liked {
    color: #ff8055;
}

.moment-like.is-processing {
    opacity: 0.6;
    pointer-events: none;
}

.moment-like svg {
    transition: transform 0.2s ease;
}

.moment-like:active svg {
    transform: scale(1.15);
}

.moment-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px;
}

.moment-tags a {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 5px;
    background: #e9eaf0;
    color: #858aa4;
}

.moment-social,
.moment-comment-form {
    position: relative;
    margin: 6px 0 0 54px;
    border-radius: 5px;
    background: #f1f2f6;
    color: #30364f;
    font-size: 12px;
}

.moment-social::before {
    position: absolute;
    top: -6px;
    right: 15px;
    width: 0;
    height: 0;
    border-right: 7px solid transparent;
    border-bottom: 7px solid #f1f2f6;
    border-left: 7px solid transparent;
    content: "";
}

.moment-comments {
    padding: 6px 10px;
    border-top: 1px solid #e3e5ed;
}

.moment-comments:first-child {
    border-top: 0;
}

.moment-comment-list,
.moment-comment-list .moment-comment-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.moment-comments .comment-body,
.moment-comments .comment-body .comment-body {
    margin: 2px 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #30364f;
    cursor: pointer;
    line-height: 1.6;
}

.moment-comments .comment-author,
.moment-comments .comment-content,
.moment-reply-label {
    display: inline;
    margin: 0;
    color: inherit;
    font-size: 12px;
    font-weight: 400;
}

.moment-comments .comment-author .avatar,
.moment-comments .comment-author .comment-avatar-fallback,
.moment-comments .comment-meta,
.moment-comments .comment-reply {
    display: none !important;
}

.moment-comments .comment-author .fn {
    color: #576b95;
    font-style: normal;
    font-weight: 600;
}

.moment-comments .comment-parent > .comment-author .fn::after {
    color: #30364f;
    content: "：";
}

.moment-comments .comment-child > .comment-author .fn::after {
    content: "";
}

.moment-reply-label b {
    color: #576b95;
    font-weight: 600;
}

.moment-comments .comment-content p {
    display: inline;
    margin: 0;
}

.moment-comments .comment-children {
    margin: 0;
}

.moment-comment-form {
    padding: 8px;
}

.moment-comment-form[hidden] {
    display: none;
}

.moment-comment-identity {
    display: grid;
    margin-bottom: 7px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.moment-comment-identity input,
.moment-comment-compose textarea {
    min-width: 0;
    border: 1px solid #dfe2ea;
    border-radius: 4px;
    outline: 0;
    background: #fff;
    color: #30364f;
    font: inherit;
}

.moment-comment-identity input {
    padding: 6px 7px;
}

.moment-comment-compose {
    display: flex;
    align-items: center;
    gap: 6px;
}

.moment-comment-compose textarea {
    min-height: 30px;
    padding: 6px 8px;
    flex: 1;
    resize: vertical;
}

.moment-comment-identity input:focus,
.moment-comment-compose textarea:focus {
    border-color: #8a98b7;
}

.moment-comment-compose button {
    flex: 0 0 auto;
    padding: 6px 9px;
    border: 0;
    border-radius: 4px;
    background: #576b95;
    color: #fff;
    font-size: 11px;
    cursor: pointer;
}

.moment-comment-compose .moment-comment-cancel {
    background: transparent;
    color: #8d92a4;
}

.moment-comment-compose button:disabled {
    cursor: wait;
    opacity: 0.55;
}

.moment-comment-status {
    display: block;
    min-height: 0;
    margin-top: 4px;
    color: #69708f;
    font-size: 10px;
}

.moment-comment-status:empty {
    display: none;
}

.comment-form-status,
.moment-comment-status.is-error {
    width: fit-content;
    max-width: 100%;
    padding: 6px 10px;
    border: 1px solid rgba(76, 76, 255, 0.14);
    border-radius: 8px;
    background: #f0f0ff;
    color: #555bc0;
    font-size: 12px;
    line-height: 1.5;
    box-shadow: 0 5px 14px rgba(64, 64, 140, 0.08);
}

.comment-form-status::before,
.moment-comment-status.is-error::before {
    display: inline-grid;
    width: 16px;
    height: 16px;
    margin-right: 6px;
    place-items: center;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    content: "!";
    font-size: 10px;
    font-weight: 700;
    vertical-align: 1px;
}

.comment-form-status {
    margin: 10px 14px 0;
}

.comment-form-status[hidden] {
    display: none;
}

.comment-card :is(input, textarea).is-invalid,
.moment-comment-form :is(input, textarea).is-invalid {
    border-color: rgba(76, 76, 255, 0.55);
    background: #f8f8ff;
    box-shadow: inset 0 0 0 1px rgba(76, 76, 255, 0.08), 0 0 0 3px rgba(76, 76, 255, 0.06);
}

.post-list-end {
    display: flex;
    min-height: 52px;
    margin: 10px 0 0;
    padding: 14px 0 4px;
    align-items: center;
    justify-content: center;
    color: #a0a4bc;
    font-size: 11px;
    text-align: center;
}

.post-list-end.is-error {
    color: var(--primary);
    cursor: pointer;
}

.post-list-next {
    display: none;
}

.page-column {
    min-width: 0;
    padding: 42px 46px 54px;
    overflow-y: auto;
    background: var(--surface);
    scrollbar-width: none;
    overscroll-behavior: contain;
}

.page-column::-webkit-scrollbar {
    display: none;
}

.page-article {
    max-width: 720px;
    margin: 0 auto;
}

.page-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
}

.page-heading-mark {
    display: grid;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    place-items: center;
    border-radius: 14px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 20px;
}

.page-heading-mark svg {
    width: 23px;
    height: 23px;
    fill: currentColor;
}

.page-heading p {
    margin: 0 0 2px;
    color: #a1a5bd;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.16em;
}

.page-heading h1 {
    margin: 0;
    color: var(--text);
    font-size: 25px;
    line-height: 1.3;
}

.page-column.post-column {
    padding: 0;
}

.post-detail {
    max-width: none;
}

.post-detail-hero {
    position: relative;
    height: clamp(260px, 36vh, 340px);
    overflow: hidden;
    background: #263553;
}

.post-detail-hero::after {
    position: absolute;
    inset: 35% 0 0;
    background: linear-gradient(to bottom, transparent, rgba(10, 20, 38, 0.65));
    content: "";
    pointer-events: none;
}

.post-detail-hero > img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.post-detail-profile {
    position: absolute;
    right: 34px;
    bottom: 24px;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    color: #fff;
    text-align: right;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.post-detail-profile-copy {
    display: flex;
    padding-bottom: 4px;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.post-detail-profile-copy strong {
    font-size: 18px;
    line-height: 1.2;
}

.post-detail-profile-copy span {
    max-width: 310px;
    overflow: hidden;
    font-size: 11px;
    line-height: 1.5;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-detail-avatar {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    border: 3px solid #fff;
    border-radius: 12px;
    background: #fff;
    object-fit: cover;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.post-detail-avatar-fallback {
    display: grid;
    place-items: center;
    background: #ff8055;
    color: #fff;
    font-size: 25px;
    font-weight: 700;
}

.post-detail-body {
    max-width: 720px;
    margin: 0 auto;
    padding: 30px 42px 54px;
}

.post-detail-heading {
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.post-detail-heading h1 {
    margin: 0 0 14px;
    color: var(--text);
    font-size: 22px;
    line-height: 1.4;
}

.post-detail-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.post-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 14px;
    color: var(--muted);
    font-size: 11px;
}

.post-detail-meta a {
    color: inherit;
}

.post-detail-meta a:hover {
    color: var(--primary);
}

.post-detail-category {
    flex: 0 0 auto;
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 11px;
}

.post-detail-category a {
    color: inherit;
}

.post-detail .page-content {
    padding-top: 26px;
    color: #4f5673;
    font-size: 15px;
    line-height: 2;
}

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

.article-detail-layout .site-sidebar {
    display: none;
}

.article-detail-layout .post-detail-body {
    max-width: none;
}

.page-content {
    padding: 28px 2px 8px;
    color: #505779;
    font-size: 14px;
    line-height: 1.9;
}

.page-content h2,
.page-content h3 {
    margin: 28px 0 12px;
    color: var(--text);
}

.page-content p {
    margin: 0 0 18px;
}

.page-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
}

.moment-content img,
.page-content img {
    cursor: zoom-in;
}

.image-lightbox {
    position: fixed;
    z-index: 99999;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 32px;
    background: rgba(10, 12, 20, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.image-lightbox[hidden] {
    display: none;
}

.image-lightbox-figure {
    display: grid;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    place-items: center;
    gap: 12px;
    touch-action: pan-y pinch-zoom;
    user-select: none;
    will-change: transform, opacity;
}

.image-lightbox-image {
    display: block;
    width: auto;
    max-width: min(1180px, calc(100vw - 64px));
    height: auto;
    max-height: calc(100vh - 96px);
    border-radius: 14px;
    object-fit: contain;
    box-shadow: 0 24px 72px rgba(0, 0, 0, 0.38);
}

.image-lightbox-close {
    position: fixed;
    z-index: 1;
    top: max(20px, env(safe-area-inset-top));
    right: max(20px, env(safe-area-inset-right));
    display: grid;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font: 300 30px/1 Arial, sans-serif;
    cursor: pointer;
    place-items: center;
    transition: background 160ms ease, transform 160ms ease;
}

.image-lightbox-close:hover,
.image-lightbox-close:focus-visible {
    background: rgba(255, 255, 255, 0.22);
    outline: none;
    transform: scale(1.05);
}

.image-lightbox-counter {
    position: fixed;
    z-index: 1;
    top: max(30px, env(safe-area-inset-top));
    left: 50%;
    color: rgba(255, 255, 255, 0.78);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.08em;
    transform: translateX(-50%);
}

.image-lightbox-nav {
    position: fixed;
    z-index: 3;
    top: 50%;
    display: grid;
    width: 46px;
    height: 46px;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font: 200 32px/1 Arial, sans-serif;
    cursor: pointer;
    pointer-events: auto;
    transform: translateY(-50%);
}

.image-lightbox-prev {
    left: 20px;
}

.image-lightbox-next {
    right: 20px;
}

html.is-image-lightbox-open,
body.is-image-lightbox-open {
    overflow: hidden;
}

.page-content a {
    color: var(--primary);
}

.comments-area {
    margin-top: 34px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}

.comments-area h2 {
    margin: 0 0 18px;
    color: var(--text);
    font-size: 16px;
}

.comment-list,
.comment-list ol,
.page-navigator {
    margin: 0;
    padding: 0;
    list-style: none;
}

.comment-list li {
    margin: 0 0 14px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fbfbff;
}

.comment-list li li {
    margin: 12px 0 0;
    background: #fff;
}

.comment-author {
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
}

.comment-author .avatar {
    width: 30px;
    height: 30px;
    margin-right: 8px;
    border-radius: 50%;
    vertical-align: middle;
}

.comment-author .comment-avatar-fallback {
    display: inline-flex;
    width: 30px;
    height: 30px;
    margin-right: 8px;
    border-radius: 50%;
    background: #7d83ba;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    vertical-align: middle;
    align-items: center;
    justify-content: center;
}

.comment-meta,
.comment-reply {
    color: var(--muted);
    font-size: 10px;
}

.comment-content {
    margin-top: 9px;
    color: #555c7e;
    font-size: 13px;
}

.guestbook-layout {
    grid-template-columns: minmax(0, 1fr);
}

.guestbook-layout .site-sidebar {
    display: none;
}

.guestbook-layout .page-column {
    background: var(--surface);
}

.guestbook-layout .page-guestbook {
    max-width: none;
}

.guestbook-comments-area {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.guestbook-comments-area > h2 {
    margin-bottom: 24px;
    color: #62688c;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.guestbook-comments-area > .comment-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px 18px;
}

.guestbook-comments-area > .comment-list > li {
    position: relative;
    display: grid;
    width: 100%;
    min-height: 168px;
    margin: 0;
    padding: 36px 18px 16px;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "content content"
        "author meta"
        "children children";
    grid-template-rows: minmax(72px, auto) auto auto;
    align-content: start;
    break-inside: avoid;
    border: 0;
    border-radius: 2px;
    background: #eeeeff;
    box-shadow: 0 8px 18px rgba(64, 64, 140, 0.12);
    transform: none;
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.guestbook-comments-area > .comment-list > li:nth-child(6n + 2) {
    background: #e9edff;
}

.guestbook-comments-area > .comment-list > li:nth-child(6n + 3) {
    background: #f1ebff;
}

.guestbook-comments-area > .comment-list > li:nth-child(6n + 4) {
    background: #e8f3ff;
}

.guestbook-comments-area > .comment-list > li:nth-child(6n + 5) {
    background: #edf1ff;
}

.guestbook-comments-area > .comment-list > li:nth-child(6n) {
    background: #f4efff;
}

.guestbook-comments-area > .comment-list > li::before {
    position: absolute;
    top: 9px;
    left: 50%;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #b8b8ff 0 18%, #6262ee 48%, #3737a8 100%);
    content: "";
    transform: translateX(-50%);
    box-shadow: 0 2px 4px rgba(48, 48, 130, 0.38);
}

.guestbook-comments-area > .comment-list > li:hover {
    z-index: 2;
    box-shadow: 0 13px 26px rgba(64, 64, 140, 0.18);
    transform: translateY(-4px) rotate(0deg);
}

.guestbook-comments-area > .comment-list > li > .comment-content {
    grid-area: content;
    min-width: 0;
    margin: 0 0 13px;
    padding: 0 0 13px;
    border-bottom: 1px dashed rgba(76, 76, 255, 0.14);
    color: #3d4264;
    font-size: 14px;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

.guestbook-comments-area > .comment-list > li > .comment-content p {
    margin: 0;
}

.guestbook-comments-area > .comment-list > li > .comment-author {
    grid-area: author;
    min-width: 0;
    align-self: end;
    color: #50558b;
    font-size: 12px;
}

.guestbook-comments-area > .comment-list > li > .comment-author > span,
.guestbook-comments-area > .comment-list > li > .comment-author .avatar {
    display: none;
}

.guestbook-comments-area > .comment-list > li > .comment-author .fn {
    display: block;
    overflow: hidden;
    font-style: normal;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.guestbook-comments-area > .comment-list > li > .comment-meta {
    grid-area: meta;
    align-self: end;
    margin-left: 10px;
    color: #898eab;
    font-size: 10px;
    white-space: nowrap;
}

.guestbook-comments-area > .comment-list > li > .comment-reply {
    display: none;
}

.guestbook-comments-area > .comment-list > li > .comment-children,
.guestbook-comments-area > .comment-list > li > .respond {
    grid-area: children;
    min-width: 0;
}

.guestbook-comments-area .comment-children {
    margin-top: 13px;
    padding-top: 12px;
    border-top: 1px solid rgba(76, 76, 255, 0.1);
}

.guestbook-comments-area .comment-children li {
    min-height: 0;
    margin: 8px 0 0;
    padding: 10px 11px;
    border: 0;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.38);
    box-shadow: none;
    transform: none;
}

.guestbook-comments-area .comment-children .comment-content {
    margin-top: 6px;
    color: #5c6182;
    font-size: 11px;
}

.guestbook-comments-area > .respond {
    margin-top: 34px;
}

.neighbors-layout {
    grid-template-columns: minmax(0, 1fr);
}

.neighbors-layout .site-sidebar {
    display: none;
}

.neighbors-layout .page-neighbors {
    max-width: none;
}

.neighbors-page {
    color: var(--text);
    font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
    text-rendering: auto;
}

.neighbors-hero,
.guestbook-hero,
.about-hero,
.gallery-hero {
    margin-bottom: 28px;
}

.neighbors-hero h1,
.guestbook-hero h1,
.about-hero h1,
.gallery-hero h1 {
    margin: 0;
    color: #303657;
    font-size: 28px;
    line-height: 1.35;
}

.neighbors-hero span,
.guestbook-hero span,
.about-hero span,
.gallery-hero span {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-size: 13px;
}

/* 相册页 */
.gallery-layout .page-column {
    padding: 38px 38px 48px;
}

.gallery-layout .page-gallery {
    max-width: none;
}

.gallery-hero {
    position: relative;
    padding-right: 92px;
}

.gallery-count {
    position: absolute;
    right: 0;
    bottom: 0;
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
}

.gallery-count strong {
    margin-right: 2px;
    color: var(--text);
    font-size: 21px;
    font-weight: 600;
}

.gallery-source-content[hidden],
.gallery-filters[hidden],
.gallery-grid[hidden],
.gallery-empty[hidden],
.gallery-lightbox[hidden],
.gallery-lightbox-nav[hidden] {
    display: none !important;
}

.gallery-filters {
    display: flex;
    gap: 7px;
    margin: 24px 0 20px;
    padding-bottom: 2px;
    overflow-x: auto;
    scrollbar-width: none;
}

.gallery-filters::-webkit-scrollbar {
    display: none;
}

.gallery-filters button {
    display: inline-flex;
    min-height: 30px;
    padding: 6px 11px;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.gallery-filters button span {
    color: inherit;
    font-size: 9px;
    opacity: 0.7;
}

.gallery-filters button:hover {
    border-color: rgba(76, 76, 255, 0.28);
    color: var(--primary);
    transform: translateY(-1px);
}

.gallery-filters button.is-active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    box-shadow: 0 5px 13px rgba(76, 76, 255, 0.2);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-flow: dense;
    grid-auto-rows: clamp(118px, 15vw, 154px);
    gap: 9px;
}

.gallery-photo {
    position: relative;
    min-width: 0;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 11px;
    background: #e9eaf2;
    cursor: zoom-in;
    box-shadow: 0 8px 22px rgba(58, 61, 122, 0.07);
}

.gallery-photo-pattern-0,
.gallery-photo-pattern-6 {
    grid-row: span 2;
}

.gallery-photo-pattern-1,
.gallery-photo-pattern-4 {
    grid-column: span 2;
}

.gallery-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 420ms cubic-bezier(0.22, 0.8, 0.24, 1), filter 220ms ease;
}

.gallery-photo::after {
    position: absolute;
    inset: 38% 0 0;
    background: linear-gradient(180deg, transparent, rgba(16, 20, 38, 0.68));
    opacity: 0.82;
    content: "";
    pointer-events: none;
    transition: opacity 180ms ease;
}

.gallery-photo:hover img,
.gallery-photo:focus-visible img {
    transform: scale(1.035);
}

.gallery-photo:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent);
    outline-offset: 3px;
}

.gallery-photo-caption {
    position: absolute;
    z-index: 1;
    right: 12px;
    bottom: 10px;
    left: 12px;
    color: #fff;
    text-align: left;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.28);
    pointer-events: none;
}

.gallery-photo-caption strong,
.gallery-photo-caption small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery-photo-caption strong {
    font-size: 12px;
    font-weight: 600;
}

.gallery-photo-caption small {
    margin-top: 2px;
    font-size: 9px;
    opacity: 0.78;
}

.gallery-empty {
    display: grid;
    min-height: 310px;
    padding: 50px 24px;
    place-items: center;
    align-content: center;
    border: 1px dashed var(--line);
    border-radius: 14px;
    color: var(--muted);
    text-align: center;
}

.gallery-empty-icon {
    display: grid;
    width: 52px;
    height: 52px;
    margin-bottom: 14px;
    place-items: center;
    border-radius: 15px;
    background: var(--primary-soft);
    color: var(--primary);
}

.gallery-empty-icon svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.gallery-empty h2 {
    margin: 0;
    color: var(--text);
    font-size: 16px;
}

.gallery-empty p {
    max-width: 320px;
    margin: 7px 0 0;
    font-size: 12px;
}

.gallery-sidebar {
    position: relative;
}

.gallery-album-block {
    flex: 1 1 auto;
    min-height: 0;
    margin-bottom: 28px;
    overflow-y: auto;
    scrollbar-width: none;
}

.gallery-album-block::-webkit-scrollbar {
    display: none;
}

.gallery-album-list {
    display: grid;
    gap: 5px;
}

.gallery-album-loading {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
}

.gallery-album-row {
    display: grid;
    width: 100%;
    min-width: 0;
    padding: 7px;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 160ms ease, transform 160ms ease;
}

.gallery-album-row:hover,
.gallery-album-row.is-active {
    background: var(--primary-soft);
}

.gallery-album-row:hover {
    transform: translateX(2px);
}

.gallery-album-row > img {
    width: 44px;
    height: 36px;
    border-radius: 7px;
    object-fit: cover;
}

.gallery-album-row > span {
    min-width: 0;
}

.gallery-album-row strong,
.gallery-album-row small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery-album-row strong {
    font-size: 11px;
    font-weight: 600;
}

.gallery-album-row small {
    margin-top: 1px;
    color: var(--muted);
    font-size: 9px;
}

.gallery-album-row > b {
    color: var(--muted);
    font-size: 9px;
    font-weight: 500;
}

.gallery-sidebar-note {
    margin: auto 0 0;
    padding: 18px 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 10px;
    line-height: 1.8;
}

.gallery-lightbox {
    position: fixed;
    z-index: 99999;
    inset: 0;
    display: grid;
    padding: 34px 76px;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    align-items: center;
    gap: 20px;
    background: rgba(9, 11, 20, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.gallery-lightbox-figure {
    display: grid;
    width: 100%;
    min-width: 0;
    max-height: calc(100vh - 68px);
    margin: 0;
    grid-column: 2;
    place-items: center;
    gap: 12px;
}

.gallery-lightbox-image {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: calc(100vh - 120px);
    border-radius: 12px;
    object-fit: contain;
    box-shadow: 0 26px 80px rgba(0, 0, 0, 0.42);
}

.gallery-lightbox-caption {
    max-width: min(680px, 80vw);
    color: #fff;
    text-align: center;
}

.gallery-lightbox-caption strong,
.gallery-lightbox-caption span {
    display: block;
}

.gallery-lightbox-caption strong {
    font-size: 13px;
    font-weight: 600;
}

.gallery-lightbox-caption span {
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.64);
    font-size: 10px;
}

.gallery-lightbox-close,
.gallery-lightbox-nav {
    display: grid;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
    font-family: Arial, sans-serif;
    cursor: pointer;
    transition: background 160ms ease, transform 160ms ease;
}

.gallery-lightbox-close:hover,
.gallery-lightbox-nav:hover,
.gallery-lightbox-close:focus-visible,
.gallery-lightbox-nav:focus-visible {
    background: rgba(255, 255, 255, 0.18);
    outline: none;
    transform: scale(1.06);
}

.gallery-lightbox-nav {
    width: 48px;
    height: 48px;
    font-size: 32px;
    font-weight: 200;
}

.gallery-lightbox-prev {
    grid-column: 1;
}

.gallery-lightbox-next {
    grid-column: 3;
}

.gallery-lightbox-close {
    position: fixed;
    top: max(20px, env(safe-area-inset-top));
    right: max(20px, env(safe-area-inset-right));
    width: 42px;
    height: 42px;
    font-size: 26px;
    font-weight: 200;
}

.gallery-lightbox-counter {
    position: fixed;
    top: max(28px, env(safe-area-inset-top));
    left: 50%;
    color: rgba(255, 255, 255, 0.78);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.08em;
    transform: translateX(-50%);
}

html.is-gallery-lightbox-open,
body.is-gallery-lightbox-open {
    overflow: hidden;
}

.guestbook-hero {
    margin-bottom: 0;
}

.friend-self-card,
.friend-apply-notice,
.friend-apply-form {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fbfbff;
    box-shadow: 0 10px 24px rgba(64, 64, 140, 0.07);
}

.friend-self-card {
    padding: 22px 24px;
}

.friend-self-heading {
    display: flex;
    align-items: center;
    gap: 12px;
}

.friend-self-heading > div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 4px;
}

.friend-self-heading strong {
    color: #3d4264;
    font-size: 14px;
}

.friend-self-heading small {
    width: fit-content;
    padding: 2px 7px;
    border-radius: 5px;
    background: var(--primary-soft);
    color: #686e91;
    font-size: 11px;
}

.friend-copy-button {
    margin-left: auto;
    padding: 6px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: #555b7e;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.friend-copy-button:hover {
    border-color: rgba(76, 76, 255, 0.22);
    color: var(--primary);
}

.friend-avatar {
    position: relative;
    display: grid;
    width: 60px;
    height: 60px;
    flex: 0 0 60px;
    overflow: hidden;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(145deg, #eeeeff, #dfe5ff);
    color: #6e73a3;
    font-size: 20px;
    font-weight: 700;
}

.friend-avatar img {
    position: absolute;
    width: 100%;
    height: 100%;
    inset: 0;
    object-fit: cover;
}

.friend-self-avatar {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    border-radius: 10px;
    font-size: 16px;
}

.friend-self-details {
    display: grid;
    margin: 18px 0 0;
    padding: 15px 0 0;
    gap: 8px;
    border-top: 1px solid var(--line);
}

.friend-self-details > div {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 10px;
}

.friend-self-details dt,
.friend-self-details dd {
    margin: 0;
    font-size: 12px;
    line-height: 1.7;
}

.friend-self-details dt {
    color: #727895;
}

.friend-self-details dd {
    min-width: 0;
    color: #4d5375;
    overflow-wrap: anywhere;
}

.friend-self-details a:hover {
    color: var(--primary);
}

.friend-list-section,
.friend-apply-section {
    margin-top: 32px;
}

.friend-section-heading {
    display: flex;
    min-height: 38px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.friend-section-heading h2 {
    margin: 0;
    color: #3d4264;
    font-size: 16px;
}

.friend-section-heading h2 span {
    color: #8d91c0;
}

.friend-section-heading small {
    color: #858aa8;
    font-size: 12px;
}

.friend-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.friend-card {
    display: flex;
    min-width: 0;
    min-height: 102px;
    padding: 14px 15px;
    align-items: center;
    gap: 13px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(64, 64, 140, 0.06);
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.friend-card:hover {
    border-color: rgba(76, 76, 255, 0.2);
    color: inherit;
    box-shadow: 0 12px 24px rgba(64, 64, 140, 0.12);
    transform: translateY(-3px);
}

.friend-card-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 6px;
}

.friend-card-copy strong,
.friend-card-copy span {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
}

.friend-card-copy strong {
    color: #363c61;
    font-size: 14px;
    -webkit-line-clamp: 1;
}

.friend-card-copy span {
    color: #686e8f;
    font-size: 12px;
    line-height: 1.65;
    -webkit-line-clamp: 2;
}

.friend-empty {
    padding: 34px 20px;
    border: 1px dashed #dfe1f2;
    border-radius: 14px;
    background: #fafaff;
    color: #767c9d;
    font-size: 12px;
    text-align: center;
}

.friend-apply-notice {
    padding: 20px 22px;
}

.friend-apply-notice h3 {
    margin: 0 0 12px;
    color: #414668;
    font-size: 15px;
}

.friend-apply-notice ol {
    margin: 0;
    padding-left: 20px;
    color: #555c7f;
    font-size: 13px;
    line-height: 1.9;
}

.friend-apply-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 14px;
    padding: 20px 22px;
    gap: 13px 16px;
}

.friend-form-field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 5px;
}

.friend-form-field label {
    color: #484f72;
    font-size: 12px;
}

.friend-form-field label b {
    color: var(--primary);
}

.friend-form-field input,
.friend-captcha input {
    width: 100%;
    height: 34px;
    padding: 7px 9px;
    border: 1px solid #dfe1f0;
    border-radius: 7px;
    outline: 0;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-size: 13px;
}

.friend-form-field input:focus,
.friend-captcha input:focus {
    border-color: rgba(76, 76, 255, 0.42);
    box-shadow: 0 0 0 3px rgba(76, 76, 255, 0.07);
}

.friend-form-wide {
    grid-column: 1 / span 2;
}

.friend-captcha {
    display: grid;
    grid-template-columns: minmax(90px, 1fr) minmax(0, 1fr);
    align-items: end;
    gap: 8px;
}

.friend-captcha span {
    display: grid;
    height: 34px;
    place-items: center;
    border: 1px dashed #dfe1f0;
    border-radius: 7px;
    background: #f7f7ff;
    color: #484f72;
    font-size: 12px;
}

.friend-form-submit {
    display: flex;
    grid-column: 1 / -1;
    min-height: 34px;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.friend-form-submit button {
    min-width: 96px;
    height: 34px;
    padding: 0 14px;
    border: 0;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.friend-form-submit button:disabled {
    cursor: wait;
    opacity: 0.55;
}

.friend-apply-status {
    color: #666c8e;
    font-size: 12px;
}

.friend-apply-closed {
    color: var(--muted);
    font-size: 11px;
}

.respond {
    margin-top: 30px;
}

.cancel-comment-reply {
    text-align: right;
    font-size: 0;
    line-height: 0;
}

.cancel-comment-reply a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0 4px 8px 0;
    padding: 6px 11px;
    border: 1px solid rgba(76, 76, 255, 0.14);
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 11px;
    line-height: 1;
    transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.cancel-comment-reply a::before {
    content: "×";
    font-size: 15px;
    line-height: 0.8;
}

.cancel-comment-reply a:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-1px);
}

.comment-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    background: var(--surface);
}

.comment-fields {
    display: flex;
}

.comment-fields input {
    flex: 1;
    padding: 14px 18px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    min-width: 0;
}

.comment-fields input::placeholder {
    color: var(--muted);
}

.comment-fields input:focus {
    background: rgba(0,0,0,0.015);
}

.comment-textarea {
    padding: 0;
}

.comment-textarea textarea {
    width: 100%;
    padding: 14px 18px;
    border: 0;
    border-top: 1px solid var(--line);
    outline: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    resize: none;
    min-height: 80px;
}

.comment-textarea textarea::placeholder {
    color: var(--muted);
}

.comment-actions {
    display: flex;
    align-items: center;
    padding: 10px 14px;
}

.emoji-toggle {
    padding: 4px 8px;
    border: 0;
    background: transparent;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.45;
    transition: opacity 0.2s;
    line-height: 1;
}

.emoji-toggle:hover {
    opacity: 1;
}

.emoji-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 8px 14px 12px;
}

.emoji-picker span {
    font-size: 22px;
    cursor: pointer;
    padding: 3px;
    border-radius: 6px;
    transition: background 0.15s;
    line-height: 1.2;
}

.emoji-picker span:hover {
    background: var(--primary-soft);
}

.comment-submit {
    margin-left: auto;
    padding: 6px 16px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.comment-submit:hover {
    background: rgba(76,76,255,0.08);
}

.comment-logged-in {
    padding: 12px 18px;
    margin: 0;
    font-size: 14px;
    border-bottom: 1px solid var(--line);
}

.post-comment-card {
    min-height: 290px;
    border-color: var(--line);
    border-radius: 15px;
    padding-bottom: 12px;
    background: var(--sidebar);
}

.post-comment-card .comment-fields {
    height: 58px;
}

.post-comment-card .comment-fields input {
    width: 33.333%;
    padding: 0 15px;
    color: var(--text);
    font-size: 14px;
}

.post-comment-card .comment-fields input::placeholder {
    color: #b9bbca;
    opacity: 1;
}

.post-comment-card .comment-fields input:focus {
    background: transparent;
}

.post-comment-card .comment-textarea textarea {
    display: block;
    min-height: 98px;
    padding: 12px 15px 8px;
    border-top: 0;
    font-size: 14px;
    line-height: 1.7;
}

.post-comment-card .comment-textarea textarea::placeholder {
    color: #b9bbca;
    opacity: 1;
}

.post-comment-card .comment-actions {
    min-height: 44px;
    padding: 4px 14px 6px;
}

.post-comment-card .emoji-toggle {
    padding: 4px;
    color: #aeb1c0;
    font-family: Arial, sans-serif;
    font-size: 24px;
    font-weight: 400;
    opacity: 0.65;
}

.post-comment-card .comment-submit {
    padding: 5px 10px;
    color: #c8bfd8;
    font-size: 14px;
    font-weight: 500;
}

.post-comment-card .comment-submit:hover {
    color: var(--primary);
    background: transparent;
}

.post-comment-card .emoji-picker {
    display: grid;
    grid-template-columns: repeat(20, minmax(0, 1fr));
    gap: 2px 1px;
    padding: 0 14px;
}

.post-comment-card .emoji-picker[hidden] {
    display: none;
}

.post-comment-card .emoji-picker span {
    min-width: 0;
    padding: 0;
    font-size: 21px;
    line-height: 1.15;
    text-align: center;
}

.site-sidebar {
    min-width: 0;
    padding: 30px 26px;
    background: var(--sidebar);
}

.sidebar-block {
    margin-bottom: 52px;
}

.sidebar-block h2 {
    margin: 0 0 14px;
    color: #8e93af;
    font-size: 13px;
    font-weight: 600;
}

.sidebar-reserved-space {
    display: none;
}

.date-card {
    position: relative;
}

.date-line {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.date-line strong {
    color: #424d79;
    font-size: 36px;
    font-weight: 500;
    line-height: 1;
}

.date-line span,
.weekday {
    color: #757ca4;
    font-size: 11px;
}

.weekday {
    position: absolute;
    top: 4px;
    right: 0;
}

.date-card p,
.about-copy {
    margin: 18px 0 0;
    color: #505779;
    font-size: 12px;
}

.site-links,
.recent-list {
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}

.site-links li {
    margin: 7px 0;
    color: #596189;
    font-size: 12px;
}

.health-summary {
    position: relative;
}

.health-summary-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.health-summary .health-summary-head h2 {
    margin: 0;
}

.health-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
}

.health-metric {
    min-width: 0;
}

.health-metric + .health-metric {
    padding-left: 18px;
    border-left: 1px solid rgba(91, 96, 139, 0.12);
}

.health-metric-label {
    display: flex;
    margin-bottom: 8px;
    align-items: center;
    gap: 7px;
    color: #626989;
    font-size: 12px;
    font-weight: 500;
}

.health-metric-label span {
    width: 18px;
    font-size: 15px;
    line-height: 1;
    text-align: center;
}

.health-metric p {
    display: flex;
    margin: 0;
    align-items: baseline;
    gap: 4px;
    color: #757ca4;
}

.health-metric strong {
    color: #3f496f;
    font-size: 22px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.035em;
}

.health-metric p span {
    font-size: 10px;
}

.health-sync-time {
    display: inline-flex;
    align-items: center;
    color: #989db4;
    font-size: 10px;
}

.activity-block {
    position: relative;
}

.activity-calendar {
    --activity-cell: 10px;
    --activity-gap: 3px;
    width: max-content;
    max-width: 100%;
    color: #8f94aa;
    font-size: 9px;
}

.activity-months {
    display: grid;
    grid-template-columns: repeat(var(--activity-weeks), var(--activity-cell));
    gap: var(--activity-gap);
    height: 16px;
    margin-left: 22px;
}

.activity-months span {
    align-self: start;
    line-height: 1;
}

.activity-body {
    display: flex;
    gap: 8px;
}

.activity-weekdays {
    display: grid;
    grid-template-rows: repeat(7, var(--activity-cell));
    gap: var(--activity-gap);
    width: 14px;
    line-height: var(--activity-cell);
    text-align: right;
}

.activity-grid {
    display: grid;
    grid-template-rows: repeat(7, var(--activity-cell));
    grid-auto-flow: column;
    grid-auto-columns: var(--activity-cell);
    gap: var(--activity-gap);
}

.activity-day,
.activity-legend i {
    width: var(--activity-cell);
    height: var(--activity-cell);
    border: 0;
    border-radius: 2px;
    background: #eceef5;
}

button.activity-day {
    padding: 0;
    cursor: pointer;
    transition: outline-color 120ms ease, transform 120ms ease;
}

button.activity-day:hover,
button.activity-day:focus-visible {
    outline: 2px solid rgba(31, 156, 86, 0.35);
    outline-offset: 1px;
    transform: scale(1.08);
}

.activity-day.is-future {
    opacity: 0.35;
}

.activity-level-1 {
    background: #b8f1c9 !important;
}

.activity-level-2 {
    background: #76df9a !important;
}

.activity-level-3 {
    background: #45c978 !important;
}

.activity-level-4 {
    background: #249f5c !important;
}

.activity-level-5 {
    background: #13733e !important;
}

.activity-legend {
    display: flex;
    align-items: center;
    gap: 3px;
    margin: 8px 0 0 22px;
}

.activity-legend span:first-child {
    margin-right: 3px;
}

.activity-legend span:last-child {
    margin-left: 3px;
}

.activity-tooltip {
    position: fixed;
    z-index: 100;
    width: min(260px, calc(100vw - 16px));
    padding: 13px 15px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 13px;
    background: #24282c;
    color: #eef0f2;
    box-shadow: 0 12px 28px rgba(20, 22, 25, 0.28);
    font-size: 12px;
}

.activity-tooltip[hidden] {
    display: none;
}

.activity-tooltip > strong {
    display: block;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 13px;
}

.activity-tooltip ul {
    margin: 9px 0 0;
    padding: 0;
    list-style: none;
}

.activity-tooltip li {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 8px;
}

.activity-tooltip li b {
    min-width: 0;
    overflow: hidden;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.activity-type {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    border-radius: 5px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}

.activity-type-new {
    background: #16915a;
}

.activity-type-edit {
    background: #8a7310;
}

.recent-list li {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    margin: 12px 0;
}

.recent-list span {
    color: #bdc0d3;
    font-size: 11px;
    font-weight: 700;
}

.recent-list a {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: #4f5677;
    font-size: 12px;
    line-height: 1.5;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-list .recent-moment-title {
    font-weight: 400;
}

.site-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: auto;
    padding: 18px 0 0;
    background: transparent;
    color: #9a9eb7;
    font-size: 11px;
}

/* 桌面端固定页面框架，仅文章列表区域允许上下滚动 */
@media (min-width: 901px) {
    html,
    body {
        height: 100%;
        overflow: hidden;
    }

    .book-stage {
        margin-top: 16px;
        margin-bottom: 16px;
    }

    .site-shell {
        display: grid;
        grid-template-columns: 164px minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr);
        height: calc(100vh - 32px);
    }

    .site-header {
        grid-column: 1;
        grid-row: 1;
        width: 100%;
        height: auto;
        min-height: 0;
        padding: 24px 16px 18px;
        flex-direction: column;
        align-items: stretch;
        gap: 22px;
        overflow: hidden;
        background: var(--sidebar);
        border-right: 1px solid var(--line);
        border-bottom: 0;
    }

    .site-header .top-nav {
        width: 100%;
        min-height: 0;
        flex: 0 1 auto;
        flex-direction: column;
        align-items: stretch;
        gap: 5px;
        overflow-x: hidden;
        overflow-y: auto;
        white-space: normal;
    }

    .site-header .top-nav a,
    .site-header .nav-category-toggle {
        width: 100%;
        padding: 7px 10px;
        border-radius: 6px;
    }

    .site-header .top-nav a:hover,
    .site-header .top-nav .is-current,
    .site-header .nav-category-toggle:hover,
    .site-header .nav-category-toggle.is-current {
        background: var(--primary-soft);
    }

    .site-header .nav-category-group {
        width: 100%;
    }

    .site-header .nav-category-list {
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 220ms ease, opacity 160ms ease;
    }

    .site-header .nav-category-group.is-open .nav-category-list {
        max-height: 280px;
        opacity: 1;
    }

    .site-header .nav-category-list a {
        padding-left: 24px;
        color: #676d91;
        font-size: 12px;
    }

    .site-header .header-actions {
        width: 100%;
        margin-top: auto;
        justify-content: center;
    }

    .site-header .search-form:focus-within input,
    .site-header .search-form.is-open input {
        width: 66px;
    }

    .content-grid {
        grid-column: 2;
        grid-row: 1;
        min-height: 0;
        overflow: hidden;
    }

    .main-column {
        display: flex;
        min-height: 0;
        flex-direction: column;
    }

    .home-intro {
        min-height: 0;
        flex: 0 0 auto;
        overflow: hidden;
    }

    .home-intro-content {
        will-change: transform;
    }

    .hero {
        height: clamp(220px, 34vh, 310px);
        min-height: 0;
    }

    .topic-strip {
        flex: 0 0 auto;
    }

    .post-list {
        min-height: 0;
        flex: 1 1 auto;
        overflow-y: auto;
        overflow-anchor: none;
        overscroll-behavior: contain;
        will-change: transform;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .post-list::-webkit-scrollbar {
        display: none;
    }

    .site-sidebar {
        display: flex;
        min-height: 0;
        flex-direction: column;
        overflow: hidden;
        border-left: 1px solid var(--line);
    }

    .sidebar-reserved-space {
        display: block;
        flex: 0 0 clamp(76px, 10vh, 96px);
    }

    .page-column {
        min-height: 0;
    }
}

@media (min-width: 1520px) {
    .book-panel {
        display: block;
    }

    .post-comments-source {
        display: none;
    }
}

@media (max-width: 900px) {
    html {
        scroll-behavior: smooth;
    }

    body,
    .page-column,
    .post-list,
    .book-page-inner {
        -webkit-overflow-scrolling: touch;
    }

    .page-column {
        overflow-y: visible;
        overscroll-behavior: auto;
    }

    .book-stage {
        width: min(100% - 24px, 760px);
        margin: 12px auto;
    }

    .site-shell {
        border-radius: 16px;
    }

    .site-header {
        gap: 18px;
    }

    .nav-category-group {
        position: relative;
    }

    .nav-category-toggle {
        width: auto;
        white-space: nowrap;
    }

    .nav-category-list {
        position: absolute;
        top: calc(100% + 10px);
        left: 0;
        z-index: 8;
        min-width: 140px;
        padding: 7px;
        border: 1px solid var(--line);
        border-radius: 10px;
        background: var(--surface);
        box-shadow: 0 12px 28px rgba(53, 55, 126, 0.15);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-5px);
        transition: opacity 160ms ease, transform 160ms ease, visibility 160ms;
    }

    .nav-category-group.is-open .nav-category-list {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .nav-category-list a {
        padding: 6px 8px;
        border-radius: 6px;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .page-column {
        padding: 34px 28px 42px;
    }

    .friend-card-grid,
    .friend-apply-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .friend-form-wide {
        grid-column: 1 / -1;
    }

    .site-sidebar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 28px;
    }

    .site-sidebar .site-footer {
        grid-column: 1 / -1;
    }

    .sidebar-block {
        margin: 0;
    }
}

@media (max-width: 640px) {
    .book-stage {
        width: 100%;
        margin: 0;
    }

    .site-shell {
        border-radius: 0;
    }

    .site-header {
        display: grid;
        grid-template-columns: 36px minmax(0, 1fr) auto;
        height: auto;
        min-height: 64px;
        column-gap: 12px;
        padding: 10px 14px;
        align-items: center;
        box-shadow: 0 5px 18px rgba(51, 54, 112, 0.06);
    }

    .top-nav {
        order: initial;
        width: auto;
        flex-basis: auto;
        gap: 18px;
        padding-top: 0;
        border-top: 0;
    }

    .header-actions {
        margin-left: auto;
    }

    .hero {
        min-height: 250px;
    }

    .hero-profile {
        right: 20px;
    }

    .hero-avatar {
        width: 60px;
        height: 60px;
        flex-basis: 60px;
        font-size: 26px;
    }

    .hero-copy {
        padding-bottom: 22px;
    }

    .hero h1 {
        font-size: 18px;
    }

    .hero-bio {
        min-height: 80px;
        padding: 37px 20px 12px;
    }

    .topic-strip,
    .post-list {
        padding-right: 18px;
        padding-left: 18px;
    }

    .moment-content,
    .moment-foot,
    .moment-social,
    .moment-comment-form {
        margin-left: 0;
    }

    .moment-content {
        margin-top: 12px;
    }

    .page-column {
        padding: 28px 20px 36px;
    }

    .guestbook-comments-area > .comment-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px 14px;
    }

    .neighbors-hero h1,
    .guestbook-hero h1 {
        font-size: 23px;
    }

    .friend-self-card,
    .friend-apply-notice,
    .friend-apply-form {
        padding: 17px;
    }

    .friend-self-heading {
        flex-wrap: wrap;
    }

    .friend-copy-button {
        margin-left: 0;
    }

    .friend-self-details > div {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .friend-card-grid,
    .friend-apply-form {
        grid-template-columns: 1fr;
    }

    .friend-form-wide,
    .friend-form-submit {
        grid-column: 1;
    }

    .friend-captcha {
        grid-template-columns: 1fr 1fr;
    }

    .page-column.post-column {
        padding: 0;
    }

    .post-detail-hero {
        height: 230px;
    }

    .post-detail-profile {
        right: 18px;
        bottom: 18px;
    }

    .post-detail-profile-copy span {
        max-width: 190px;
    }

    .post-detail-avatar {
        width: 52px;
        height: 52px;
        flex-basis: 52px;
    }

    .post-detail-body {
        padding: 26px 20px 38px;
    }

    .post-detail-heading h1 {
        font-size: 19px;
    }

    .post-detail-heading-row {
        align-items: flex-start;
    }

    .post-detail .page-content {
        font-size: 14px;
        line-height: 1.9;
    }

    .comment-fields {
        grid-template-columns: 1fr;
    }

    .post-card {
        grid-template-columns: 96px minmax(0, 1fr);
        gap: 14px;
        padding: 18px 0;
    }

    .post-cover {
        width: 96px;
        height: 78px;
        font-size: 28px;
    }

    .post-content h2 {
        margin-top: 0;
        font-size: 15px;
    }

    .post-meta {
        font-size: 11px;
    }

    .post-excerpt {
        -webkit-line-clamp: 2;
        font-size: 12px;
    }

    .post-foot {
        min-height: 34px;
        margin-top: 10px;
        padding: 6px 8px;
        gap: 8px;
    }

    .post-stats {
        gap: 10px;
        font-size: 11px;
    }

    .post-stat-icon {
        width: 12px;
        height: 12px;
        flex: 0 0 12px;
    }

    .post-tags a {
        padding: 2px 7px;
        font-size: 10px;
    }

    .site-sidebar {
        display: block;
        padding: 18px 20px 20px;
        background: var(--surface);
    }

    .site-sidebar .sidebar-block {
        display: none;
    }

    .site-footer {
        padding-top: 0;
        gap: 8px;
        flex-direction: column;
        align-items: center;
    }

    html.is-mobile-nav-open,
    html.is-mobile-nav-open body {
        overflow: hidden;
    }

    .mobile-nav-toggle {
        display: grid;
        width: 36px;
        height: 36px;
        padding: 0;
        flex: 0 0 36px;
        place-items: center;
        border: 1px solid rgba(76, 76, 255, 0.08);
        border-radius: 11px;
        background: var(--primary-soft);
        color: var(--primary);
        cursor: pointer;
    }

    .mobile-nav-toggle svg {
        width: 19px;
        height: 19px;
        fill: none;
        stroke: currentColor;
        stroke-linecap: round;
        stroke-width: 1.8;
    }

    .site-header .top-nav {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 1002;
        display: flex;
        width: min(78vw, 288px);
        height: 100vh;
        height: 100dvh;
        padding: 104px 16px 18px;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 5px;
        overflow-x: hidden;
        overflow-y: auto;
        border-right: 1px solid var(--line);
        border-radius: 0 22px 22px 0;
        background:
            radial-gradient(circle at 15% 0, rgba(111, 108, 255, 0.1), transparent 190px),
            var(--surface);
        box-shadow: 20px 0 54px rgba(30, 32, 76, 0.2);
        white-space: normal;
        opacity: 1;
        visibility: hidden;
        transform: translateX(-105%);
        transition: transform 240ms cubic-bezier(0.22, 0.8, 0.24, 1), visibility 0s linear 240ms;
    }

    html.is-mobile-nav-open .site-header .top-nav {
        visibility: visible;
        transform: translateX(0);
        transition: transform 240ms cubic-bezier(0.22, 0.8, 0.24, 1), visibility 0s;
    }

    .mobile-nav-heading {
        position: absolute;
        top: 0;
        right: 0;
        left: 0;
        display: flex;
        height: 88px;
        padding: 0 16px;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px solid var(--line);
    }

    .mobile-nav-brand {
        display: flex;
        min-width: 0;
        align-items: center;
        gap: 11px;
    }

    .mobile-nav-brand img {
        display: block;
        width: 42px;
        height: 42px;
        flex: 0 0 42px;
        border-radius: 12px;
        background: #fff;
        object-fit: cover;
        box-shadow: 0 5px 14px rgba(48, 49, 112, 0.14);
    }

    .mobile-nav-brand > span {
        display: flex;
        min-width: 0;
        flex-direction: column;
        gap: 2px;
    }

    .mobile-nav-brand strong {
        overflow: hidden;
        color: var(--text);
        font-size: 14px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-nav-brand small {
        color: var(--muted);
        font-size: 10px;
        white-space: nowrap;
    }

    .mobile-nav-close {
        display: grid;
        width: 34px;
        height: 34px;
        padding: 0;
        flex: 0 0 34px;
        place-items: center;
        border: 1px solid var(--line);
        border-radius: 11px;
        background: color-mix(in srgb, var(--surface) 78%, transparent);
        color: var(--muted);
        cursor: pointer;
    }

    .mobile-nav-close:hover {
        border-color: rgba(76, 76, 255, 0.24);
        background: var(--primary-soft);
        color: var(--primary);
    }

    .mobile-nav-close svg {
        width: 16px;
        height: 16px;
        fill: none;
        stroke: currentColor;
        stroke-linecap: round;
        stroke-width: 1.8;
    }

    .site-header .top-nav > a,
    .site-header .nav-category-toggle {
        width: 100%;
        min-height: 46px;
        padding: 8px 10px;
        gap: 10px;
        border-radius: 12px;
        color: #555c7d;
        transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
    }

    .site-header .top-nav > a:hover,
    .site-header .top-nav > a.is-current,
    .site-header .nav-category-toggle:hover,
    .site-header .nav-category-toggle.is-current {
        background: linear-gradient(90deg, var(--primary-soft), rgba(76, 76, 255, 0.035));
        color: var(--primary);
    }

    .site-header .top-nav > a:active,
    .site-header .nav-category-toggle:active {
        transform: scale(0.985);
    }

    .site-header .top-nav > a .nav-icon {
        width: 30px;
        height: 30px;
        padding: 7px;
        flex: 0 0 30px;
        border-radius: 9px;
        background: #f3f4fa;
    }

    .site-header .nav-category-grid-icon {
        width: 30px;
        height: 30px;
        flex: 0 0 30px;
        border-radius: 9px;
        background: #f3f4fa;
    }

    .site-header .top-nav > a:hover .nav-icon,
    .site-header .top-nav > a.is-current .nav-icon,
    .site-header .nav-category-toggle:hover .nav-category-grid-icon,
    .site-header .nav-category-toggle.is-current .nav-category-grid-icon {
        background: rgba(76, 76, 255, 0.1);
    }

    .site-header .nav-category-group {
        position: static;
        width: 100%;
    }

    .site-header .nav-category-arrow {
        margin-left: auto;
    }

    .site-header .nav-category-list {
        position: static;
        min-width: 0;
        max-height: 0;
        padding: 0 9px;
        overflow: hidden;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: max-height 200ms ease, padding 200ms ease;
    }

    .site-header .nav-category-group.is-open .nav-category-list {
        max-height: 360px;
        padding-top: 4px;
        padding-bottom: 7px;
    }

    .site-header .nav-category-list a {
        padding: 8px 12px 8px 42px;
        border-radius: 9px;
        color: var(--muted);
    }

    .site-header .nav-category-list a:hover,
    .site-header .nav-category-list a.is-current {
        background: var(--primary-soft);
        color: var(--primary);
    }

    .mobile-nav-footer {
        display: flex;
        margin-top: auto;
        padding: 15px 10px 3px;
        flex-direction: column;
        gap: 2px;
        border-top: 1px solid var(--line);
    }

    .mobile-nav-footer span {
        color: var(--text);
        font-size: 12px;
        font-weight: 600;
    }

    .mobile-nav-footer small {
        color: var(--muted);
        font-size: 10px;
    }

    .mobile-nav-backdrop {
        position: fixed;
        inset: 0;
        z-index: 1001;
        display: block;
        padding: 0;
        border: 0;
        background: rgba(11, 13, 25, 0.48);
        backdrop-filter: blur(3px);
        cursor: default;
        opacity: 0;
        pointer-events: none;
        transition: opacity 200ms ease;
    }

    html.is-mobile-nav-open .mobile-nav-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .header-actions {
        grid-column: 3;
        margin-left: 0;
        padding: 3px;
        gap: 2px;
        justify-self: end;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: var(--sidebar);
    }

    .header-actions .search-form button,
    .header-actions .theme-toggle,
    .header-actions .admin-link {
        width: 32px;
        height: 32px;
        border: 0;
        border-radius: 10px;
        background: transparent;
        color: #465071;
    }

    .header-actions .theme-toggle {
        display: grid;
        padding: 0;
        place-items: center;
    }

    .header-actions .search-form button:hover,
    .header-actions .theme-toggle:hover,
    .header-actions .admin-link:hover {
        background: var(--primary-soft);
        color: var(--primary);
    }
}

@media (prefers-reduced-motion: reduce) {
    .book-panel {
        transition-duration: 0.01ms;
    }

    .post-list {
        transition: none;
    }

    .gallery-photo img,
    .gallery-photo,
    .gallery-filters button,
    .gallery-album-row,
    .gallery-lightbox-close,
    .gallery-lightbox-nav {
        transition: none;
    }

}

@media (max-width: 900px) {
    .gallery-layout .page-column {
        padding: 34px 28px 42px;
    }

    .gallery-layout .gallery-sidebar {
        display: none;
    }

    .gallery-grid {
        grid-auto-rows: clamp(128px, 25vw, 190px);
    }
}

@media (max-width: 640px) {
    .gallery-layout .page-column {
        padding: 28px 18px 34px;
    }

    .gallery-hero {
        margin-bottom: 22px;
        padding-right: 78px;
    }

    .gallery-hero h1 {
        font-size: 23px;
    }

    .gallery-count strong {
        font-size: 18px;
    }

    .gallery-filters {
        width: calc(100% + 18px);
        margin: 20px 0 17px;
        padding-right: 18px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: clamp(118px, 38vw, 175px);
        gap: 7px;
    }

    .gallery-photo-pattern-1 {
        grid-column: span 1;
    }

    .gallery-photo-pattern-4 {
        grid-column: span 2;
    }

    .gallery-photo-caption {
        right: 9px;
        bottom: 8px;
        left: 9px;
    }

    .gallery-photo-caption strong {
        font-size: 11px;
    }

    .gallery-lightbox {
        padding: 58px 14px 76px;
        grid-template-columns: 1fr;
    }

    .gallery-lightbox-figure {
        max-height: calc(100vh - 134px);
        grid-column: 1;
        touch-action: pan-y pinch-zoom;
        user-select: none;
        will-change: transform, opacity;
    }

    .gallery-lightbox-image {
        max-height: calc(100vh - 180px);
    }

    .gallery-lightbox-nav {
        position: fixed;
        bottom: max(18px, env(safe-area-inset-bottom));
        width: 44px;
        height: 44px;
    }

    .gallery-lightbox-prev {
        left: calc(50% - 54px);
    }

    .gallery-lightbox-next {
        right: calc(50% - 54px);
    }
}

:root[data-theme="dark"] {
    --page: #10121e;
    --surface: #191c2a;
    --sidebar: #202332;
    --line: #33374b;
    --text: #e8eaf4;
    --muted: #9da3bb;
    --primary: #8b89ff;
    --primary-soft: #2d2e50;
    color-scheme: dark;
}

html.is-theme-switching body,
html.is-theme-switching .site-shell,
html.is-theme-switching .site-header,
html.is-theme-switching .main-column,
html.is-theme-switching .site-sidebar,
html.is-theme-switching .page-column,
html.is-theme-switching .book-panel,
html.is-theme-switching .hero-bio {
    transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}

[data-theme="dark"] .site-shell {
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

[data-theme="dark"] .book-stage.is-book-open .site-shell {
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .book-panel {
    border-color: #34384d;
    box-shadow: 0 28px 65px rgba(0, 0, 0, 0.34);
}

[data-theme="dark"] .book-panel::before {
    border-color: rgba(163, 168, 211, 0.12);
}

[data-theme="dark"] .book-panel-left::after {
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.28));
}

[data-theme="dark"] .book-panel-right::after {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.28), transparent);
}

[data-theme="dark"] .book-stage.is-book-open .book-panel-left {
    box-shadow: -18px 24px 48px rgba(0, 0, 0, 0.3), inset -12px 0 18px rgba(0, 0, 0, 0.16);
}

[data-theme="dark"] .book-stage.is-book-open .book-panel-right {
    box-shadow: 18px 24px 48px rgba(0, 0, 0, 0.3), inset 12px 0 18px rgba(0, 0, 0, 0.16);
}

[data-theme="dark"] .book-comment-list .comment-author,
[data-theme="dark"] .book-comment-list .comment-meta,
[data-theme="dark"] .book-comment-list .comment-reply,
[data-theme="dark"] .book-page-number,
[data-theme="dark"] .book-intro,
[data-theme="dark"] .book-section h3,
[data-theme="dark"] .book-section li a::before {
    color: var(--muted);
}

[data-theme="dark"] .book-comment-list .comment-content,
[data-theme="dark"] .book-section li {
    color: #d6d9e7;
}

[data-theme="dark"] .book-section h3 {
    border-color: var(--line);
}

[data-theme="dark"] .book-tags a {
    background: var(--primary-soft);
    color: #bbbaff;
}

[data-theme="dark"] .search-form input {
    color: var(--text);
}

[data-theme="dark"] .search-form input::placeholder {
    color: var(--muted);
}

[data-theme="dark"] .search-form button,
[data-theme="dark"] .admin-link {
    color: #c7cadb;
}

[data-theme="dark"] .theme-toggle {
    justify-content: flex-end;
    border-color: #41465c;
    background: #2a2e40;
    color: #f1d47e;
}

[data-theme="dark"] .theme-toggle:hover {
    border-color: rgba(139, 137, 255, 0.46);
    background: #343852;
    color: #ffe195;
}

[data-theme="dark"] .nav-category-arrow {
    background: rgba(139, 137, 255, 0.1);
}

[data-theme="dark"] .nav-category-toggle:hover .nav-category-arrow,
[data-theme="dark"] .nav-category-toggle.is-current .nav-category-arrow {
    background: rgba(139, 137, 255, 0.18);
}

[data-theme="dark"] .hero-bio p,
[data-theme="dark"] .post-meta,
[data-theme="dark"] .post-author,
[data-theme="dark"] .post-excerpt,
[data-theme="dark"] .post-foot,
[data-theme="dark"] .moment-foot,
[data-theme="dark"] .moment-header time,
[data-theme="dark"] .post-list-end {
    color: var(--muted);
}

[data-theme="dark"] .topic-strip a,
[data-theme="dark"] .post-foot,
[data-theme="dark"] .moment-foot {
    background: #242737;
}

[data-theme="dark"] .topic-strip a {
    color: #aeb3c8;
}

[data-theme="dark"] .topic-strip a:hover,
[data-theme="dark"] .topic-strip .is-active {
    background: var(--primary);
    color: #141525;
    box-shadow: 0 3px 10px rgba(94, 91, 255, 0.3);
}

[data-theme="dark"] .post-content h2 a,
[data-theme="dark"] .moment-header strong,
[data-theme="dark"] .moment-content,
[data-theme="dark"] .moment-comments .comment-body,
[data-theme="dark"] .moment-comments .comment-parent > .comment-author .fn::after {
    color: var(--text);
}

[data-theme="dark"] .post-stats,
[data-theme="dark"] .moment-stats {
    color: #b8bee0;
}

[data-theme="dark"] .post-tags a,
[data-theme="dark"] .moment-tags a {
    background: #2b2e3e;
    color: #aeb3c6;
}

[data-theme="dark"] .moment-social,
[data-theme="dark"] .moment-comment-form {
    background: #252837;
    color: #d9dce9;
}

[data-theme="dark"] .moment-social::before {
    border-bottom-color: #252837;
}

[data-theme="dark"] .moment-comments {
    border-color: #363a4c;
}

[data-theme="dark"] .moment-comments .comment-author .fn,
[data-theme="dark"] .moment-reply-label b {
    color: #a8b8ee;
}

[data-theme="dark"] .moment-comment-identity input,
[data-theme="dark"] .moment-comment-compose textarea {
    border-color: #3c4156;
    background: #1b1e2c;
    color: var(--text);
}

[data-theme="dark"] .moment-comment-identity input::placeholder,
[data-theme="dark"] .moment-comment-compose textarea::placeholder {
    color: #81879f;
}

[data-theme="dark"] .moment-comment-compose .moment-comment-cancel,
[data-theme="dark"] .moment-comment-status {
    color: var(--muted);
}

[data-theme="dark"] .comment-form-status,
[data-theme="dark"] .moment-comment-status.is-error {
    border-color: rgba(139, 137, 255, 0.24);
    background: #292b48;
    color: #c2c1ff;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.18);
}

[data-theme="dark"] .comment-card :is(input, textarea).is-invalid,
[data-theme="dark"] .moment-comment-form :is(input, textarea).is-invalid {
    border-color: rgba(139, 137, 255, 0.65);
    background: #25263c;
    box-shadow: inset 0 0 0 1px rgba(139, 137, 255, 0.14), 0 0 0 3px rgba(139, 137, 255, 0.1);
}

[data-theme="dark"] .page-heading p,
[data-theme="dark"] .post-detail-meta,
[data-theme="dark"] .comment-meta,
[data-theme="dark"] .comment-reply,
[data-theme="dark"] .guestbook-comments-area > h2 {
    color: var(--muted);
}

[data-theme="dark"] .post-detail .page-content,
[data-theme="dark"] .page-content,
[data-theme="dark"] .comment-content {
    color: #c7cad9;
}

[data-theme="dark"] .page-content blockquote {
    border-left-color: var(--primary);
    background: #222536;
    color: #c9ccda;
}

[data-theme="dark"] .page-content :not(pre) > code,
[data-theme="dark"] .page-content pre {
    background: #11131d;
    color: #d9dceb;
}

[data-theme="dark"] .comment-list li {
    background: #212433;
}

[data-theme="dark"] .comment-list li li {
    background: #282b3b;
}

[data-theme="dark"] .guestbook-comments-area > .comment-list > li {
    background: #292b49;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
}

[data-theme="dark"] .guestbook-comments-area > .comment-list > li:nth-child(6n + 2) {
    background: #282d4a;
}

[data-theme="dark"] .guestbook-comments-area > .comment-list > li:nth-child(6n + 3) {
    background: #302a49;
}

[data-theme="dark"] .guestbook-comments-area > .comment-list > li:nth-child(6n + 4) {
    background: #243148;
}

[data-theme="dark"] .guestbook-comments-area > .comment-list > li:nth-child(6n + 5) {
    background: #292f48;
}

[data-theme="dark"] .guestbook-comments-area > .comment-list > li:nth-child(6n) {
    background: #322b47;
}

[data-theme="dark"] .guestbook-comments-area > .comment-list > li:hover {
    box-shadow: 0 13px 26px rgba(0, 0, 0, 0.32);
}

[data-theme="dark"] .guestbook-comments-area > .comment-list > li > .comment-content {
    border-color: rgba(139, 137, 255, 0.24);
    color: #e0e2ec;
}

[data-theme="dark"] .guestbook-comments-area > .comment-list > li > .comment-author {
    color: #bbbaff;
}

[data-theme="dark"] .guestbook-comments-area > .comment-list > li > .comment-meta {
    color: #969db6;
}

[data-theme="dark"] .guestbook-comments-area .comment-children {
    border-color: rgba(139, 137, 255, 0.18);
}

[data-theme="dark"] .guestbook-comments-area .comment-children li {
    background: rgba(15, 17, 29, 0.3);
}

[data-theme="dark"] .guestbook-comments-area .comment-children .comment-content {
    color: #c5c8d8;
}

[data-theme="dark"] .neighbors-hero h1,
[data-theme="dark"] .guestbook-hero h1,
[data-theme="dark"] .about-hero h1,
[data-theme="dark"] .gallery-hero h1,
[data-theme="dark"] .friend-self-heading strong,
[data-theme="dark"] .friend-section-heading h2,
[data-theme="dark"] .friend-card-copy strong,
[data-theme="dark"] .friend-apply-notice h3 {
    color: var(--text);
}

[data-theme="dark"] .friend-self-card,
[data-theme="dark"] .friend-apply-notice,
[data-theme="dark"] .friend-apply-form {
    background: #202332;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .friend-self-heading small {
    color: #b5b8d2;
}

[data-theme="dark"] .gallery-photo {
    background: #252837;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}

[data-theme="dark"] .gallery-filters button {
    border-color: var(--line);
}

[data-theme="dark"] .gallery-filters button:hover {
    border-color: rgba(139, 137, 255, 0.45);
}

[data-theme="dark"] .gallery-filters button.is-active {
    border-color: var(--primary);
    background: var(--primary);
    color: #141525;
}

[data-theme="dark"] .gallery-album-row.is-active,
[data-theme="dark"] .gallery-album-row:hover {
    background: var(--primary-soft);
}

[data-theme="dark"] .friend-copy-button,
[data-theme="dark"] .friend-card,
[data-theme="dark"] .friend-form-field input,
[data-theme="dark"] .friend-captcha input {
    border-color: var(--line);
    background: #252837;
    color: var(--text);
}

[data-theme="dark"] .friend-copy-button:hover,
[data-theme="dark"] .friend-card:hover {
    border-color: rgba(139, 137, 255, 0.4);
}

[data-theme="dark"] .friend-card {
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

[data-theme="dark"] .friend-card:hover {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] .friend-self-details dt,
[data-theme="dark"] .friend-section-heading small,
[data-theme="dark"] .friend-form-field label,
[data-theme="dark"] .friend-apply-status {
    color: var(--muted);
}

[data-theme="dark"] .friend-self-details dd,
[data-theme="dark"] .friend-card-copy span,
[data-theme="dark"] .friend-apply-notice ol {
    color: #c0c4d5;
}

[data-theme="dark"] .friend-empty,
[data-theme="dark"] .friend-captcha span {
    border-color: #3a3e52;
    background: #222535;
    color: #abb0c6;
}

[data-theme="dark"] .comment-fields input:focus {
    background: rgba(255, 255, 255, 0.025);
}

[data-theme="dark"] .post-comment-card {
    background: #202332;
}

[data-theme="dark"] .post-comment-card .comment-fields input::placeholder,
[data-theme="dark"] .post-comment-card .comment-textarea textarea::placeholder {
    color: #7f859d;
}

[data-theme="dark"] .post-comment-card .emoji-toggle,
[data-theme="dark"] .post-comment-card .comment-submit {
    color: #9da3bb;
}

[data-theme="dark"] .sidebar-block h2,
[data-theme="dark"] .date-line span,
[data-theme="dark"] .weekday,
[data-theme="dark"] .activity-calendar,
[data-theme="dark"] .site-footer {
    color: var(--muted);
}

[data-theme="dark"] .date-line strong,
[data-theme="dark"] .date-card p,
[data-theme="dark"] .about-copy,
[data-theme="dark"] .site-links li,
[data-theme="dark"] .recent-list a,
[data-theme="dark"] .recent-list .recent-moment-title {
    color: #c4c8d8;
}

[data-theme="dark"] .health-metric strong {
    color: #e1e4f0;
}

[data-theme="dark"] .health-metric-label,
[data-theme="dark"] .health-metric p,
[data-theme="dark"] .health-sync-time {
    color: #9298b0;
}

[data-theme="dark"] .health-metric + .health-metric {
    border-color: rgba(183, 188, 212, 0.1);
}

[data-theme="dark"] .activity-day,
[data-theme="dark"] .activity-legend i {
    background: #303445;
}

[data-theme="dark"] .recent-list span {
    color: #777e98;
}

@media (prefers-reduced-motion: reduce) {
    html.is-theme-switching body,
    html.is-theme-switching .site-shell,
    html.is-theme-switching .site-header,
    html.is-theme-switching .main-column,
    html.is-theme-switching .site-sidebar,
    html.is-theme-switching .page-column,
    html.is-theme-switching .book-panel,
    html.is-theme-switching .hero-bio {
        transition: none;
    }
}

@media (max-width: 640px) {
    [data-theme="dark"] .site-header {
        box-shadow: 0 5px 18px rgba(0, 0, 0, 0.18);
    }

    [data-theme="dark"] .header-actions {
        background: #252837;
    }

    [data-theme="dark"] .header-actions .theme-toggle {
        display: grid;
        padding: 0;
        place-items: center;
        justify-content: center;
        border: 0;
        background: transparent;
        color: #f1d47e;
    }

    [data-theme="dark"] .site-header .top-nav {
        box-shadow: 20px 0 54px rgba(0, 0, 0, 0.38);
    }

    [data-theme="dark"] .site-header .top-nav > a,
    [data-theme="dark"] .site-header .nav-category-toggle {
        color: #c3c7d9;
    }

    [data-theme="dark"] .site-header .top-nav > a .nav-icon,
    [data-theme="dark"] .site-header .nav-category-grid-icon {
        background: #292d3d;
    }

    [data-theme="dark"] .site-header .top-nav > a:hover .nav-icon,
    [data-theme="dark"] .site-header .top-nav > a.is-current .nav-icon,
    [data-theme="dark"] .site-header .nav-category-toggle:hover .nav-category-grid-icon,
    [data-theme="dark"] .site-header .nav-category-toggle.is-current .nav-category-grid-icon {
        background: rgba(139, 137, 255, 0.16);
    }
}

@media (max-width: 640px) {
    html,
    body {
        /* 禁止双击缩放，同时保留滚动和双指缩放。 */
        touch-action: manipulation;
    }

    input,
    textarea,
    select {
        /* iOS 会自动放大字号小于 16px 的已聚焦表单控件。 */
        font-size: 16px !important;
    }

    .image-lightbox {
        padding: 0;
        background: #000;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        overscroll-behavior: contain;
    }

    .image-lightbox-figure {
        width: 100vw;
        height: 100dvh;
        max-width: none;
        max-height: none;
        gap: 0;
    }

    .image-lightbox-image {
        width: 100vw;
        height: 100dvh;
        max-width: none;
        max-height: none;
        border-radius: 0;
        box-shadow: none;
    }

    .image-lightbox-close,
    .image-lightbox-counter,
    .image-lightbox-nav {
        display: none;
    }

    /* 主题按钮保持固定槽位，两枚图标在同一中心点完成交接。 */
    .header-actions .theme-toggle {
        position: relative;
        flex: 0 0 32px;
        overflow: hidden;
        isolation: isolate;
    }

    .header-actions .search-form input {
        width: 0;
        min-width: 0;
        padding: 6px 0;
        border-bottom-color: transparent;
        opacity: 0;
        transform: translateX(8px) scaleX(0.96);
        transform-origin: right center;
        pointer-events: none;
        transition:
            width 360ms cubic-bezier(0.22, 1, 0.36, 1),
            padding 360ms cubic-bezier(0.22, 1, 0.36, 1),
            border-color 220ms ease,
            opacity 220ms ease,
            transform 360ms cubic-bezier(0.22, 1, 0.36, 1);
    }

    .header-actions .search-form:focus-within input,
    .header-actions .search-form.is-open input {
        width: 112px;
        padding: 6px 8px;
        border-bottom-color: var(--line);
        opacity: 1;
        transform: translateX(0) scaleX(1);
        pointer-events: auto;
    }

    .header-actions .search-form .search-icon {
        width: 18px;
        height: 18px;
    }

    .header-actions .search-form button:hover,
    .header-actions .search-form button:active,
    .header-actions .admin-link:hover,
    .header-actions .admin-link:active {
        background: transparent;
        color: #465071;
    }

    .header-actions .theme-toggle:hover,
    .header-actions .theme-toggle:active {
        background: transparent;
        color: #465071;
    }

    [data-theme="dark"] .header-actions .theme-toggle:hover,
    [data-theme="dark"] .header-actions .theme-toggle:active {
        background: transparent;
        color: #f1d47e;
    }

    [data-theme="dark"] .header-actions .search-form button:hover,
    [data-theme="dark"] .header-actions .search-form button:active,
    [data-theme="dark"] .header-actions .admin-link:hover,
    [data-theme="dark"] .header-actions .admin-link:active {
        background: transparent;
        color: #c7cadb;
    }

    .header-actions .theme-toggle .theme-icon {
        position: absolute;
        top: 50%;
        left: 50%;
        display: block;
        width: 18px;
        height: 18px;
        transform-origin: center;
        pointer-events: none;
        transition:
            opacity 280ms ease,
            transform 360ms cubic-bezier(0.22, 1, 0.36, 1);
    }

    .header-actions .theme-toggle .theme-icon-moon {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
    }

    .header-actions .theme-toggle .theme-icon-sun {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(-105deg) scale(0.35);
    }

    [data-theme="dark"] .header-actions .theme-toggle .theme-icon-moon {
        display: block;
        opacity: 0;
        transform: translate(-50%, -50%) rotate(105deg) scale(0.35);
    }

    [data-theme="dark"] .header-actions .theme-toggle .theme-icon-sun {
        display: block;
        opacity: 1;
        transform: translate(-50%, -50%) rotate(0deg) scale(1);
    }

}

@media (max-width: 640px) and (prefers-reduced-motion: reduce) {
    .header-actions .search-form input,
    .header-actions .theme-toggle .theme-icon {
        transition: none;
    }
}
