@font-face {
    font-family: 'Comic Sans MS Local';
    src: url('/static/fonts/ComicSansMS.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Fluid Archive system */
:root {
    --bg: #f9f8f7;
    --card: #ffffff;
    --accent: #4a675f;
    --text-main: #2d2d2d;
    --text-sub: #86868b;
    --border: #e5e5e1;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

body {
    background-color: var(--bg);
    color: var(--text-main);
    transition: var(--transition);
}

.fade-in-up {
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pill-button {
    background: var(--text-main);
    color: #fff;
    padding: 10px 24px;
    border-radius: 40px;
    border: none;
    box-shadow: none;
    transition: var(--transition);
}

.pill-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 103, 95, 0.1);
    background: var(--accent);
}

.writing-track {
    backdrop-filter: blur(14px);
}

.track-item {
    transition: var(--transition), filter 0.35s ease, opacity 0.35s ease;
}

.writing-track:hover .track-item {
    filter: blur(1.5px);
    opacity: 0.45;
}

.writing-track:hover .track-item:hover {
    filter: blur(0);
    opacity: 1;
    background: rgba(255, 255, 255, 0.72);
}

.view-panels {
    position: relative;
}

.view-panel {
    display: block;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateX(18px);
    pointer-events: none;
    transition: opacity 0.45s ease, transform 0.45s ease, max-height 0.55s ease;
}

.view-panel.is-active {
    max-height: 5000px;
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.article-toc-content a.is-active {
    transform: translateX(4px);
}

.load-more-wrap {
    display: flex;
    justify-content: center;
    padding: 2rem 0 1rem;
}

.load-more-btn {
    padding: 12px 36px;
    border-radius: 40px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text-main);
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
}

.load-more-btn:hover {
    background: var(--text-main);
    color: #fff;
    border-color: var(--text-main);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 103, 95, 0.1);
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.load-more-done {
    color: var(--text-sub);
    font-size: 0.9rem;
    padding: 12px 0;
}

.article-share-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.article-share-label {
    font-size: 0.82rem;
    color: var(--text-sub);
    margin-right: 4px;
}

.article-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text-sub);
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
}

.article-share-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 103, 95, 0.1);
}

.wechat-share-guide-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
}

.wechat-share-guide-overlay.is-visible {
    display: flex;
}

.wechat-share-guide-arrow {
    position: absolute;
    top: 16px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
    animation: wechat-guide-bounce 1.5s ease-in-out infinite;
}

@keyframes wechat-guide-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.wechat-share-guide-content {
    background: var(--card);
    border-radius: 16px;
    padding: 32px 28px 24px;
    max-width: 320px;
    width: 85%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.wechat-share-guide-content p {
    font-size: 1rem;
    color: var(--text);
    line-height: 1.7;
    margin: 0 0 20px;
}

.wechat-share-guide-content strong {
    color: var(--accent);
    font-size: 1.2em;
}

.wechat-share-guide-close {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 32px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.wechat-share-guide-close:hover {
    opacity: 0.85;
}

.switch-summary {
    display: block;
    color: var(--text-sub);
    font-size: 0.92rem;
    line-height: 1.6;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.switch-box:hover .switch-summary {
    max-height: 5rem;
    opacity: 1;
}

.archive-page {
    max-width: 800px;
    margin: 4rem auto;
    padding: 0 2rem;
}

.archive-year-nav {
    display: flex;
    gap: 10px;
    margin: 2rem 0 4rem;
    overflow-x: auto;
    padding-bottom: 10px;
}

.archive-year-link {
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    color: var(--text-sub);
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}

.archive-year-link.is-active,
.archive-year-link:hover {
    background: var(--text-main);
    color: #fff;
    border-color: var(--text-main);
}

.archive-year-group {
    margin-bottom: 4rem;
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 2rem;
}

.archive-year-title {
    position: sticky;
    top: 2rem;
    height: fit-content;
}

.archive-year-title h2 {
    font-family: "Noto Serif SC", serif;
    font-size: 2.5rem;
    margin: 0;
    color: var(--accent);
}

.archive-row {
    position: relative;
    display: flex;
    align-items: baseline;
    gap: 18px;
    padding: 12px 20px 12px 0;
    border-bottom: 1px solid transparent;
    text-decoration: none;
    color: var(--text-main);
    transition: var(--transition);
}

.archive-row::after {
    content: "\2192";
    position: absolute;
    right: 0;
    opacity: 0;
    transform: translateX(-6px);
    transition: var(--transition);
}

.archive-row:hover {
    padding-left: 10px;
    color: var(--accent);
    background: rgba(0, 0, 0, 0.015);
    border-bottom-color: var(--border);
}

.archive-row:hover::after {
    opacity: 1;
    transform: translateX(0);
}

.archive-row-date {
    font-family: "Courier New", Courier, monospace;
    width: 60px;
    color: var(--text-sub);
}

.archive-row-title {
    flex: 1;
}

.archive-row-meta {
    text-align: right;
    color: var(--text-sub);
}

.auth-shell {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
}

.auth-card {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(10px);
    padding: 3.25rem 2.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 460px;
    border: 1px solid var(--border);
}

.auth-card h1 {
    margin: 0 0 0.85rem;
    font-size: 2rem;
}

.auth-description {
    margin: 0 0 2rem;
    color: var(--text-sub);
    line-height: 1.8;
}

.input-block {
    display: block;
    margin-bottom: 1.1rem;
}

.input-block span {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 8px;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: color 0.25s ease;
}

.glass-input {
    width: 100%;
    min-height: 52px;
    padding: 13px 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg);
    transition: var(--transition);
}

.glass-input:focus {
    outline: none;
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(74, 103, 95, 0.1);
}

.editor-shell {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.editor-title-input {
    width: 100%;
    font-size: 3rem;
    font-family: "Noto Serif SC", serif;
    border: none;
    background: transparent;
    margin-bottom: 2rem;
    padding: 10px 0;
    border-bottom: 2px solid var(--border);
    outline: none;
    transition: var(--transition);
}

.editor-title-input:focus {
    border-bottom-color: var(--accent);
}

.editor-form {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(10px);
}

.editor-textarea {
    min-height: 500px;
    font-size: 1.1rem;
    line-height: 1.8;
    resize: vertical;
}

.editor-actions {
    position: sticky;
    bottom: 2rem;
    display: flex;
    justify-content: flex-end;
    padding: 1rem 0;
    background: linear-gradient(transparent, var(--bg));
}

.auth-form {
    display: grid;
    gap: 0.65rem;
}

.auth-submit {
    width: 100%;
    min-height: 52px;
    margin-top: 0.75rem;
}

.auth-footnote {
    margin: 1.5rem 0 0;
    text-align: center;
}

@media (max-width: 850px) {
    .archive-year-group {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .archive-year-title {
        position: static;
    }
}

/* Clean theme refinements */
.archive-hero {
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.82fr);
    gap: 22px;
    align-items: start;
}

.archive-hero-copy {
    padding: 34px 36px !important;
    border-radius: 24px 48px 24px 24px;
}

.archive-hero-copy h1 {
    font-size: clamp(2.1rem, 4vw, 3.4rem) !important;
    line-height: 1.14;
}

.archive-hero-text {
    max-width: 34rem;
    margin-top: 16px;
}

.archive-hero-panel {
    gap: 14px;
    padding: 18px !important;
    border-radius: 22px !important;
}

.identity-card {
    padding-bottom: 14px;
}

.identity-card-link {
    color: inherit;
    text-decoration: none;
}

.identity-card-link:hover .identity-name {
    color: var(--accent);
}

.featured-note {
    padding: 16px;
    border-radius: 16px;
}

.archive-info-block {
    padding: 24px 26px;
}

.archive-inline-link {
    display: inline-flex;
    align-items: center;
    margin-top: 14px;
    color: var(--accent);
}

.timeline-card,
.constellation-node,
.archive-info-block,
.featured-note,
.auth-card,
.editor-form,
.switch-box,
.article-comments-block .comment-item {
    box-shadow: 0 10px 24px rgba(74, 103, 95, 0.06);
}

.about-page-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 4rem;
    max-width: 1300px;
    margin: 0 auto;
    padding: 5rem 2rem 4rem;
    align-items: start;
}

body.about-body-mode {
    font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.about-body-mode .narrative-main,
body.about-body-mode .identity-aside,
body.about-body-mode .prose-content,
body.about-body-mode .tag-item,
body.about-body-mode .moment-caption,
body.about-body-mode .moment-date,
body.about-body-mode .social-links a {
    font-family: "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.about-body-mode .identity-aside h1,
body.about-body-mode .narrative-main h2 {
    font-family: "Noto Serif SC", serif;
}

.identity-aside {
    position: sticky;
    top: 5rem;
    background: var(--card);
    padding: 2.5rem 2rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    text-align: center;
}

.avatar-wrapper {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto 1.75rem;
}

.avatar-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.avatar-wrapper:hover .avatar-image {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(74, 103, 95, 0.2);
}

.identity-aside h1 {
    margin: 0 0 0.5rem;
    font-size: 2rem;
    font-family: "Noto Serif SC", serif;
}

.typing-kicker {
    min-height: 1.2em;
    margin: 0 0 1.5rem;
    font-size: 0.9rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.typing-kicker::after {
    content: "|";
    animation: blink 1s infinite;
}

.identity-about-note {
    margin: 0;
    color: var(--text-sub);
    font-size: 0.95rem;
}

.social-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.9rem;
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
    margin-top: 1.75rem;
}

.social-links a {
    color: var(--text-sub);
}

.narrative-main .narrative-section {
    margin-bottom: 4.5rem;
}

.narrative-main h2 {
    margin: 0 0 1.75rem;
    display: inline-block;
    padding-bottom: 0.9rem;
    border-bottom: 2px solid var(--border);
    font-family: "Noto Serif SC", serif;
    font-size: 2.4rem;
}

.prose-content {
    max-width: 720px;
    font-size: 1.08rem;
    line-height: 1.85;
    color: #333;
}

.prose-content p {
    margin-bottom: 1.5rem;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.75rem;
}

.tag-item {
    background: var(--card);
    padding: 8px 20px;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: 0.95rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
    transition: var(--transition);
}

.tag-item:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(74, 103, 95, 0.1);
}

.moments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 2rem;
    margin-top: 2.5rem;
}

.moment-card {
    background: var(--card);
    padding: 10px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.moment-card:nth-child(odd) {
    transform: rotate(-1.5deg);
}

.moment-card:nth-child(even) {
    transform: rotate(1deg) translateY(10px);
}

.moment-card:hover {
    transform: rotate(0) scale(1.03);
    z-index: 10;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.moment-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.moment-card h3 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    color: var(--text-main);
}

.moment-caption {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-sub);
}

.moment-date {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-sub);
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

@media (max-width: 900px) {
    .archive-hero {
        grid-template-columns: 1fr;
    }

    .about-page-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding-top: 3rem;
    }

    .identity-aside {
        position: relative;
        top: 0;
    }

    .narrative-main h2 {
        font-size: 2rem;
    }
}

/* Fluid Archive polish overrides */
body,
body.home-body-mode,
body.article-body-mode {
    background: var(--bg) !important;
    color: var(--text-main);
}

body::before,
body.home-body-mode::before,
body.article-body-mode::before {
    display: none !important;
    background: none !important;
}

body {
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.fade-in-up,
.view-panel,
.view-panel.is-active {
    animation: none !important;
}

.fade-in-up {
    opacity: 1 !important;
    transform: none !important;
}

.view-panel {
    transform: none;
}

.site-header,
body.article-body-mode .site-header {
    background: rgba(249, 248, 247, 0.96) !important;
    border-bottom: 1px solid var(--border) !important;
    box-shadow: none;
}

html[data-theme="dark"] {
    --bg: #151717;
    --card: #1d2020;
    --accent: #88a79d;
    --text-main: #f1efe8;
    --text-sub: #a7aba6;
    --border: #313534;
    --shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

html[data-theme="dark"] body,
html[data-theme="dark"] body.home-body-mode,
html[data-theme="dark"] body.article-body-mode,
html[data-theme="dark"] body.about-body-mode {
    background: var(--bg) !important;
    color: var(--text-main);
}

html[data-theme="dark"] .site-header,
html[data-theme="dark"] body.article-body-mode .site-header {
    background: rgba(21, 23, 23, 0.94) !important;
    border-bottom-color: var(--border) !important;
}

html[data-theme="dark"] .archive-hero-copy,
html[data-theme="dark"] .archive-hero-panel,
html[data-theme="dark"] .archive-workbench,
html[data-theme="dark"] .archive-info-block,
html[data-theme="dark"] .auth-card,
html[data-theme="dark"] .editor-form,
html[data-theme="dark"] .featured-note,
html[data-theme="dark"] .switch-box,
html[data-theme="dark"] .timeline-card,
html[data-theme="dark"] .constellation-node,
html[data-theme="dark"] .comment-item,
html[data-theme="dark"] .comment-reply,
html[data-theme="dark"] .identity-aside,
html[data-theme="dark"] .moment-card,
html[data-theme="dark"] .writing-track {
    background: var(--card) !important;
    border-color: var(--border) !important;
    color: var(--text-main) !important;
    box-shadow: var(--shadow) !important;
}

html[data-theme="dark"] .track-item,
html[data-theme="dark"] .archive-row,
html[data-theme="dark"] .view-switch-btn,
html[data-theme="dark"] .archive-year-link,
html[data-theme="dark"] .glass-input,
html[data-theme="dark"] .article-comment-textarea,
html[data-theme="dark"] .article-comment-submit {
    color: var(--text-main);
    border-color: var(--border) !important;
}

html[data-theme="dark"] .track-item:hover,
html[data-theme="dark"] .timeline-card:hover,
html[data-theme="dark"] .archive-row:hover,
html[data-theme="dark"] .view-switch-btn:hover,
html[data-theme="dark"] .archive-year-link:hover,
html[data-theme="dark"] .article-comment-submit:hover,
html[data-theme="dark"] body.article-body-mode .pill-button:hover {
    background: #222727 !important;
}

html[data-theme="dark"] .view-switch-btn.is-active,
html[data-theme="dark"] .pill-button,
html[data-theme="dark"] .archive-year-link.is-active {
    background: var(--text-main) !important;
    color: #161919 !important;
    border-color: var(--text-main) !important;
}

html[data-theme="dark"] .glass-input,
html[data-theme="dark"] .article-comment-textarea {
    background: #171919 !important;
    color: var(--text-main) !important;
}

html[data-theme="dark"] .track-date,
html[data-theme="dark"] .archive-inline-link,
html[data-theme="dark"] .typing-kicker,
html[data-theme="dark"] .comment-reply-toggle,
html[data-theme="dark"] .category-tag:hover,
html[data-theme="dark"] a:hover {
    color: var(--accent) !important;
}

html[data-theme="dark"] body.about-body-mode .identity-aside,
html[data-theme="dark"] body.about-body-mode .moment-card,
html[data-theme="dark"] body.about-body-mode .tag-item {
    background: var(--card) !important;
    border-color: var(--border) !important;
    color: var(--text-main) !important;
    box-shadow: var(--shadow) !important;
}

html[data-theme="dark"] body.about-body-mode .identity-about-note,
html[data-theme="dark"] body.about-body-mode .moment-caption,
html[data-theme="dark"] body.about-body-mode .moment-date,
html[data-theme="dark"] body.about-body-mode .social-links a,
html[data-theme="dark"] body.about-body-mode .prose-content,
html[data-theme="dark"] body.about-body-mode .section-kicker {
    color: var(--text-sub) !important;
}

html[data-theme="dark"] body.about-body-mode .narrative-main h2,
html[data-theme="dark"] body.about-body-mode .identity-aside h1,
html[data-theme="dark"] body.about-body-mode .moment-card h3 {
    color: var(--text-main) !important;
}

html[data-theme="dark"] body.about-body-mode .avatar-image {
    border-color: #262b2a;
}

html[data-theme="dark"] body.about-body-mode .typing-kicker::after {
    color: var(--accent);
}

.archive-hero-copy,
.archive-hero-panel,
.archive-workbench,
.archive-info-block,
.auth-card,
.editor-form {
    background: var(--card) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow) !important;
    backdrop-filter: none !important;
}

.article-comments-block .comment-item,
.article-comments-block .comment-reply,
.switch-box,
.writing-track,
.archive-year-link,
.glass-input,
.article-comment-textarea,
.article-comment-submit {
    border-color: var(--border) !important;
}

.glass-input,
.article-comment-textarea {
    background: #fcfbf9 !important;
    color: var(--text-main) !important;
}

.article-comment-submit,
body.article-body-mode .pill-button {
    background: var(--card) !important;
    color: var(--text-main) !important;
}

.article-comment-submit:hover,
body.article-body-mode .pill-button:hover {
    background: #f2f0eb !important;
    color: var(--text-main) !important;
    box-shadow: var(--shadow);
}

.archive-page-header,
.article-detail-header,
.article-comments-block,
.auth-card,
.editor-shell,
.archive-workbench,
.archive-footer-grid,
.article-switch-nav {
    margin-top: 0;
}

.archive-hero,
.archive-home,
.archive-page,
.auth-shell,
.editor-shell,
.article-detail-page {
    color: var(--text-main);
}

.workbench-kicker,
.archive-page-kicker,
.section-kicker,
.article-detail-meta,
.archive-info-copy,
.login-tip,
.auth-description,
.timeline-stamp,
.archive-row-meta,
.archive-row-date,
.switch-summary,
.comment-topline span {
    color: var(--text-sub) !important;
}

.archive-hero-copy h1,
.archive-page-header h1,
.article-detail-header h1,
.auth-card h1,
.editor-shell h1,
.workbench-head h2,
.archive-info-block h3 {
    color: var(--text-main) !important;
}

.writing-track:hover .track-item {
    filter: none;
    opacity: 1;
}

.track-item:hover,
.archive-row:hover,
.switch-box:hover,
.view-switch-btn:hover,
.archive-year-link:hover {
    box-shadow: 0 8px 20px rgba(74, 103, 95, 0.08);
}

:root {
    --bg-color: #f7f7ff;
    --text-color: #09141a;
    --muted-color: #6e7883;
    --text-color-70: #4c4c4c;
    --link-color: #0d5f96;
    --line-color: rgba(52, 73, 94, 0.15);
    --surface-color: rgba(255, 255, 255, 0.72);
    --surface-strong: rgba(255, 255, 255, 0.86);
    --shadow-color: rgba(33, 52, 74, 0.12);
    --avatar-shadow: rgba(0, 0, 0, 0.15);
    --danger-color: #b34747;
    --danger-bg: rgba(179, 71, 71, 0.12);
    --button-hover-color: #eeeeee;
    --button-border-color: #d6d6d6;
    --header-width: min(1024px, 90vw);
    --page-width: min(776px, 90vw);
    --paper-white: #ffffff;
    --archive-bg: #fdfcf8;
    --ink-black: #1a1a1a;
    --sub-text: #8c8c8c;
    --accent-teal: #4a675f;
    --border-color: #e8e6df;
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.04);
}

html[data-theme="dark"] {
    --bg-color: #031116;
    --text-color: #eef7fb;
    --muted-color: #aab7c4;
    --text-color-70: #b5b5b5;
    --link-color: #67b7ef;
    --line-color: rgba(255, 255, 255, 0.12);
    --surface-color: rgba(16, 25, 33, 0.72);
    --surface-strong: rgba(20, 32, 42, 0.88);
    --shadow-color: rgba(0, 0, 0, 0.3);
    --avatar-shadow: rgba(103, 183, 239, 0.28);
    --danger-color: #ff9b9b;
    --danger-bg: rgba(255, 108, 108, 0.12);
    --button-hover-color: #262626;
    --button-border-color: #3d3d3d;
    --paper-white: #121212;
    --archive-bg: #161616;
    --ink-black: #f5f5f5;
    --sub-text: #9c9c9c;
    --accent-teal: #7ea79b;
    --border-color: #2a2a2a;
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.22);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Noto Serif SC", "EB Garamond", "Comic Sans MS Local", serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.4s ease, color 0.4s ease;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 15% 25%, #adc4d4 0%, transparent 70%),
        radial-gradient(circle at 75% 75%, #dfd6db 0%, transparent 65%),
        radial-gradient(circle at 40% 10%, #dbcab5 0%, transparent 40%),
        radial-gradient(circle at 90% 40%, #c1d2c1 0%, transparent 45%);
    filter: blur(120px);
    opacity: 0.95;
    transition: opacity 0.4s ease, background 0.4s ease;
}

body.article-body-mode,
body.home-body-mode,
body.about-body-mode {
    background: var(--bg);
}

body.article-body-mode::before,
body.home-body-mode::before,
body.about-body-mode::before {
    display: none;
}


@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translate(var(--parallax-x, 0px), calc(var(--parallax-y, 0px) + 20px)) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(var(--parallax-x, 0px), var(--parallax-y, 0px)) scale(1);
    }
}

@keyframes drift {
    from { transform: translate(0, 0); }
    to { transform: translate(100px, 50px); }
}

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

html[data-theme="dark"] body::before {
    background:
        radial-gradient(circle at 20% 80%, #2d5b8f 0%, transparent 75%),
        radial-gradient(circle at 80% 20%, #5a589f 0%, transparent 60%),
        radial-gradient(circle at 5% 50%, #8e8ef8 0%, transparent 45%),
        radial-gradient(circle at 95% 5%, #1d2e55 0%, transparent 50%);
    opacity: 0.82;
}

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

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

.site-shell {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

body.article-body-mode .site-shell {
    width: 100%;
    max-width: none;
}

body.article-body-mode .page-wrap,
body.article-body-mode .site-footer {
    width: 100%;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 28px max(20px, calc((100vw - var(--header-width)) / 2)) 20px;
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(18px);
    width: auto;
    max-width: none;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    background: rgba(253, 252, 248, 0.92);
    border-bottom: 1px solid color-mix(in srgb, var(--border-color) 88%, transparent);
}

body.article-body-mode .site-header {
    box-sizing: border-box;
    padding-top: 1rem;
    padding-bottom: 1rem;
    display: grid;
    grid-template-columns: 220px 1fr 220px;
    align-items: center;
    position: sticky;
    top: 0;
    width: auto;
    max-width: none;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding-left: max(20px, calc((100vw - var(--header-width)) / 2));
    padding-right: max(20px, calc((100vw - var(--header-width)) / 2));
    background: #fbfbfb;
    z-index: 40;
    border-bottom: 1px solid color-mix(in srgb, var(--border-color) 90%, transparent);
    backdrop-filter: blur(12px);
}

html[data-theme="dark"] body.article-body-mode .site-header {
    background: #0a0a0a;
}

body.article-body-mode .site-nav {
    justify-content: center;
}

body.article-body-mode .header-actions {
    justify-content: flex-end;
}

.brand {
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.header-brand-wrap {
    padding: 0.5rem 1rem 0.5rem 0;
}

.site-nav,
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.site-nav a,
.header-link {
    padding: 9px 14px;
    border-radius: 0.5rem;
    color: var(--text-color-70);
    transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.site-nav a:hover,
.header-link:hover {
    background: var(--button-hover-color);
    color: var(--text-color);
    transform: translateY(-1px);
}

.theme-toggle {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--button-border-color);
    border-radius: 0.5rem;
    background: transparent;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.theme-toggle:hover {
    background: var(--button-hover-color);
    box-shadow: none;
    transform: none;
}

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

.theme-toggle .sun,
.theme-toggle .moon {
    fill: var(--link-color);
}

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

html:not([data-theme="dark"]) .theme-toggle .moon {
    display: none;
}

.header-tool-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--button-border-color);
    border-radius: 0.5rem;
    color: var(--text-color);
    transition: all 0.25s ease;
}

.header-tool-button:hover {
    background: var(--button-hover-color);
}

.archive-home {
    width: min(1160px, calc(100% - 48px));
    margin: 0 auto;
    padding: 2rem 0 4rem;
}

.archive-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
    gap: 28px;
    align-items: stretch;
}

.archive-hero-copy,
.archive-hero-panel,
.archive-workbench,
.archive-info-block {
    border: 1px solid rgba(31, 38, 44, 0.14);
    background: rgba(255, 252, 246, 0.82);
    backdrop-filter: blur(16px);
    box-shadow: 0 18px 40px rgba(30, 32, 35, 0.08);
}

.archive-hero-copy {
    padding: 42px 44px;
    border-radius: 28px 80px 28px 28px;
}

.archive-hero-kicker,
.workbench-kicker {
    margin: 0 0 10px;
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-color-70);
}

.archive-hero-copy h1 {
    margin: 0;
    font-size: clamp(2.5rem, 5vw, 4.2rem);
    line-height: 1.08;
}

.archive-hero-text {
    max-width: 38rem;
    margin: 18px 0 0;
    color: var(--text-color-70);
    line-height: 1.9;
    font-size: 1.02rem;
}

.archive-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 28px;
}

.archive-primary-link,
.archive-secondary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid rgba(31, 38, 44, 0.16);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.archive-primary-link {
    background: #151515;
    color: #fff;
}

.archive-secondary-link {
    background: rgba(255,255,255,0.55);
}

.archive-primary-link:hover,
.archive-secondary-link:hover {
    transform: translateY(-1px);
}

.archive-hero-panel {
    display: grid;
    gap: 18px;
    padding: 24px;
    border-radius: 28px;
}

.identity-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(31, 38, 44, 0.12);
}

.identity-avatar {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: 18px;
}

.identity-name {
    font-size: 1.45rem;
    font-weight: 700;
}

.identity-note {
    margin: 6px 0 0;
    color: var(--text-color-70);
}

.featured-note {
    display: grid;
    gap: 10px;
    padding: 18px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(254, 248, 233, 0.9), rgba(240, 233, 220, 0.9));
    border: 1px solid rgba(31, 38, 44, 0.08);
    transition: transform 0.22s ease;
}

.featured-note-cover,
.timeline-card-cover,
.constellation-cover {
    width: 100%;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid rgba(31, 38, 44, 0.08);
}

.featured-note-cover {
    aspect-ratio: 16 / 9;
}

.featured-note:hover {
    transform: translateY(-2px);
}

.featured-label,
.featured-date {
    color: var(--text-color-70);
    font-size: 0.88rem;
}

.featured-note strong {
    font-size: 1.2rem;
    line-height: 1.4;
}

.featured-note p {
    margin: 0;
    color: var(--text-color-70);
    line-height: 1.75;
}

.writing-track {
    overflow: hidden;
    background: var(--paper-white);
    border: 1px solid var(--border-color);
    margin: 2rem 0;
    padding: 15px 0;
    position: relative;
}

.track-rail {
    display: flex;
    width: 200%;
    overflow: hidden;
}

.track-line {
    display: flex;
    white-space: nowrap;
    animation: track-scroll 30s linear infinite;
}

.track-line:hover {
    animation-play-state: paused;
}

.track-item {
    flex-shrink: 0;
    padding: 0 40px;
    text-decoration: none;
    color: var(--text-main, var(--ink-black));
    display: flex;
    align-items: center;
    gap: 10px;
    border-right: 1px solid var(--border-color);
    transition: background 0.3s;
}

.track-item:hover {
    background: var(--archive-bg);
    color: var(--accent-teal);
}

.track-date {
    font-family: monospace;
    color: var(--accent-teal);
    font-weight: bold;
}

@keyframes track-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.archive-workbench {
    background: var(--paper-white);
    border: 1px solid var(--border-color);
    padding: 40px;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    overflow: visible;
}

.workbench-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 40px;
    border-bottom: 2px solid var(--text-main, var(--ink-black));
    padding-bottom: 20px;
}

.workbench-head h2,
.archive-info-block h3 {
    margin: 5px 0 0;
    font-family: var(--font-serif, "Noto Serif SC", serif);
    font-size: 2rem;
}

.view-switch {
    display: inline-flex;
    gap: 0;
}

.view-switch-btn {
    background: none;
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    cursor: pointer;
    transition: 0.3s;
    font-family: inherit;
    color: var(--text-main, var(--ink-black));
}

.view-switch-btn + .view-switch-btn {
    border-left: 0;
}

.view-switch-btn.is-active {
    background: var(--text-main, var(--ink-black));
    color: #fff;
}

.view-panel {
    display: none;
}

.view-panel.is-active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.timeline-list {
    position: relative;
    padding: 0 0 0 20px;
    overflow: visible;
}

.timeline-card-copy {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.timeline-card-cover {
    height: 100%;
    min-height: 120px;
    max-height: 140px;
    object-fit: cover;
    border-radius: 6px;
}

.timeline-list::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border-color);
}

.timeline-entry {
    position: relative;
    margin-bottom: 40px;
    padding-left: 30px;
    display: block;
    overflow: visible;
}

.timeline-entry::before {
    content: '';
    position: absolute;
    left: -4.5px;
    top: 8px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-teal);
    border: 4px solid var(--archive-bg);
}

.timeline-stamp {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 8px;
    text-align: left;
    font-family: 'Courier New', Courier, monospace;
}

.timeline-card {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 20px;
    border: 1px solid transparent;
    transition: 0.3s;
    background: transparent;
    box-shadow: none;
    position: relative;
    z-index: 2;
}

.timeline-card:hover {
    border-color: var(--border-color);
    background: var(--archive-bg);
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(74, 103, 95, 0.08);
}

.timeline-card.timeline-card-rich {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px;
    grid-template-rows: 1fr auto;
    gap: 12px 18px;
    align-items: start;
}

.timeline-card.timeline-card-rich .timeline-card-copy {
    grid-column: 1;
    grid-row: 1;
}

.timeline-card.timeline-card-rich .timeline-card-cover {
    grid-column: 2;
    grid-row: 1 / 3;
    align-self: stretch;
}

.timeline-card.timeline-card-rich .timeline-card-meta {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: end;
}

.timeline-card h3 {
    margin: 0 0 0.8rem 0;
    font-size: 1.25rem;
    color: var(--ink-black);
}

.timeline-card p,
.constellation-node p,
.archive-info-copy {
    margin: 0;
    color: var(--text-color-70);
    line-height: 1.75;
}

.timeline-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-color-70);
    font-size: 0.92rem;
    margin-top: 0.75rem;
}

.timeline-readmore {
    margin-left: auto;
}

.constellation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 30px;
    padding: 20px;
}

.constellation-node {
    background: var(--archive-bg);
    padding: 20px;
    border: 1px dashed var(--border-color);
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
    position: relative;
}

.constellation-cover {
    aspect-ratio: 16 / 9;
}

.constellation-node:nth-child(odd) { transform: rotate(-1.5deg) translateY(10px); }
.constellation-node:nth-child(even) { transform: rotate(1deg) translateY(-5px); }

.constellation-node:hover {
    transform: rotate(0) scale(1.05);
    border-style: solid;
    z-index: 10;
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.constellation-date {
    font-size: 0.7rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-color-70);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.archive-footer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 24px;
}

.archive-info-block {
    background: var(--paper-white);
    border: 1px solid var(--border-color);
    padding: 24px;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
}

.archive-link-cluster {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.archive-link-cluster a {
    padding: 9px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(31, 38, 44, 0.1);
}

.archive-empty-state {
    padding: 40px 18px;
    text-align: center;
}

.archive-empty-icon {
    margin-bottom: 12px;
    color: var(--sub-text, #8c8c8c);
    font-size: 1.6rem;
}

.archive-empty-state h3 {
    margin: 0 0 10px;
}

.page-wrap {
    flex: 1;
    padding-bottom: 48px;
}

.flash-stack {
    display: grid;
    gap: 12px;
    margin: 12px 0 24px;
}

.flash {
    padding: 14px 18px;
    border-radius: 18px;
    backdrop-filter: blur(18px);
    background: var(--surface-strong);
    border: 1px solid var(--line-color);
    box-shadow: 0 12px 30px var(--shadow-color);
}

.flash-success {
    color: #1d6b44;
}

.flash-danger {
    color: #a53b3b;
}

.flash-info {
    color: #205d88;
}

.auth-card,
.editor-form {
    background: var(--surface-color);
    border: 1px solid var(--line-color);
    box-shadow: 0 18px 60px var(--shadow-color);
    backdrop-filter: blur(20px);
    border-radius: 32px;
}

.hero-avatar-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.hero-avatar {
    width: 112px;
    height: 112px;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 10px 28px var(--avatar-shadow);
}

.hero-name {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.hero-tagline {
    margin: 0;
    color: var(--muted-color);
}

.hero-links {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--line-color);
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.hero-links a {
    position: relative;
    min-width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: var(--surface-strong);
    border: 1px solid var(--line-color);
    color: var(--link-color);
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.hero-links a::after {
    content: attr(data-title);
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(19, 29, 39, 0.9);
    color: #fff;
    font-size: 0.8rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    white-space: nowrap;
}

.hero-links a:hover {
    transform: translateY(-3px);
}

.hero-links a:hover::after {
    opacity: 1;
}

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

.section-head.compact {
    margin-bottom: 18px;
}

.section-kicker {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.78rem;
    color: var(--muted-color);
}

.section-head h1,
.section-head h2,
.auth-card h1 {
    margin: 0;
    line-height: 1.15;
}

.section-desc,
.info-copy,
.auth-description,
.login-tip {
    color: var(--muted-color);
    line-height: 1.75;
}

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

.post-meta-top,
.post-meta-bottom,
.article-meta-row,
.comment-topline {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted-color);
    font-size: 0.92rem;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 52px 28px;
    border-radius: 24px;
    border: 1px dashed var(--line-color);
}

.pill-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 20px;
    border: 1px solid var(--line-color);
    border-radius: 999px;
    background: var(--surface-strong);
    color: var(--text-color);
    cursor: pointer;
    transition: transform 0.25s ease, background-color 0.25s ease;
}

.pill-button:hover {
    transform: translateY(-2px);
}

.pill-danger {
    color: var(--danger-color);
    background: var(--danger-bg);
}

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

.friend-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.friend-links a {
    padding: 10px 14px;
    border-radius: 999px;
    background: var(--surface-strong);
    border: 1px solid var(--line-color);
    color: var(--link-color);
}

.category-tag {
    display: inline-block;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.3s ease;
}

.category-tag:hover {
    color: var(--link-color);
    background-color: var(--button-hover-color);
    text-shadow: 0.5px 0 0 currentColor, -0.5px 0 0 currentColor;
}

.article-detail-page {
    display: flex;
    justify-content: center;
    max-width: 1100px;
    margin: 4rem auto;
    padding: 0 2rem;
    align-items: flex-start;
    gap: clamp(32px, 4vw, 64px);
}

.article-detail-main {
    flex: 1 1 0;
    min-width: 0;
    max-width: 760px;
    width: 100%;
    margin: 0;
}

.article-top-hero {
    margin: -4rem -2rem 3rem;
    overflow: hidden;
    height: 40vh;
    min-height: 260px;
    max-height: 420px;
    border-radius: 0 0 8px 8px;
}

.article-top-hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: brightness(0.92);
    transition: transform 0.5s ease;
}

.article-top-hero:hover .article-top-hero-image {
    transform: scale(1.02);
}

.article-detail-header {
    margin-bottom: 3rem;
}

.article-detail-header h1 {
    margin: 0 0 1.5rem;
    font-family: "Noto Serif SC", serif;
    font-size: clamp(2.15rem, 4vw, 2.75rem);
    line-height: 1.3;
    color: var(--ink-black);
}

.article-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: var(--sub-text);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2rem;
    margin: 0;
}

.category-tag {
    display: inline-flex;
    align-items: center;
    padding: 0;
    border-radius: 0;
    color: inherit;
    transition: color 0.3s ease;
}

.category-tag:hover {
    color: var(--accent-teal);
    background: transparent;
    text-shadow: none;
}

.article-detail-prose {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
}

.article-detail-prose h2,
.article-detail-prose h3,
.article-detail-prose h4,
.article-detail-prose h5 {
    font-family: "Noto Serif SC", serif;
    color: var(--ink-black);
}

.article-detail-prose h2 {
    margin-top: 3rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--archive-bg);
}

.article-detail-prose h5 {
    margin: 1.4rem 0 0.6rem;
    font-size: 1rem;
    line-height: 1.5;
}

.article-detail-prose p {
    margin-bottom: 1.2rem;
}

.article-detail-prose blockquote {
    margin: 2rem 0;
    padding: 0.6rem 0 0.6rem 1.25rem;
    border-left: 3px solid var(--accent-teal);
    color: var(--sub-text);
    background: transparent;
    border-radius: 0;
}

.article-detail-prose figure,
.article-detail-prose img {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.article-detail-prose img {
    max-width: 100%;
    border-radius: 6px;
}

.article-detail-prose .article-media-shell {
    margin: 2.2rem 0;
    padding: 1rem;
    border: 1px solid rgba(35, 49, 66, 0.08);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(250, 247, 241, 0.98) 0%, rgba(243, 237, 227, 0.98) 100%);
    box-shadow: 0 20px 42px rgba(30, 41, 59, 0.08);
}

.article-detail-prose .article-media-frame {
    overflow: hidden;
    border-radius: 18px;
    background: #101720;
}

.article-detail-prose .article-media-shell video,
.article-detail-prose > video,
.article-detail-prose p > video {
    width: 100%;
    display: block;
    max-height: min(70vh, 560px);
    background: #0d1117;
    border-radius: 18px;
}

.article-detail-prose .article-media-shell audio,
.article-detail-prose > audio,
.article-detail-prose p > audio {
    width: 100%;
    display: block;
}

.article-detail-prose .article-media-caption {
    margin-top: 0.85rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--sub-text);
}

.article-detail-prose .article-media-shell--audio {
    padding-bottom: 1.05rem;
}

.article-switch-nav {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

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

.switch-box {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-height: 110px;
    padding: 1.1rem 1.2rem;
    border: 1px solid var(--border-color);
    background: var(--paper-white);
    color: inherit;
    text-decoration: none;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.switch-box.next {
    text-align: right;
}

.switch-box:hover {
    transform: translateY(-3px);
    border-color: var(--accent-teal);
    box-shadow: var(--shadow-soft);
}

.switch-box .dir {
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    color: var(--sub-text);
}

.switch-box .title {
    font-family: "Noto Serif SC", serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--ink-black);
}

.article-admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.article-detail-aside {
    position: sticky;
    top: 6rem;
    height: fit-content;
}

.article-detail-toc h3 {
    margin: 0 0 1rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-teal);
}

.article-comments-block {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.article-comments-head h2 {
    margin: 0 0 1.25rem;
    font-family: "Noto Serif SC", serif;
    font-size: 1.8rem;
}

.article-comment-form {
    display: grid;
    gap: 0.9rem;
    margin-bottom: 1.5rem;
}

.article-comment-textarea {
    width: 100%;
    min-height: 120px;
    padding: 1rem 1.1rem;
    border: 1px solid var(--border-color);
    background: var(--paper-white);
    color: var(--ink-black);
    font: inherit;
    resize: vertical;
    outline: none;
}

.article-comment-textarea:focus {
    border-color: var(--accent-teal);
}

.article-comment-submit {
    width: fit-content;
    padding: 0.65rem 1.2rem;
    border: 1px solid var(--border-color);
    background: var(--paper-white);
    color: var(--ink-black);
    cursor: pointer;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.article-comment-submit:hover {
    background: var(--archive-bg);
    border-color: var(--accent-teal);
    transform: translateY(-1px);
}

.article-comments-block .comment-item {
    background: var(--paper-white);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.article-comments-block .comment-reply {
    margin-top: 1rem;
    margin-left: 1rem;
    padding: 1rem 1.1rem;
    border-left: 2px solid var(--border-color);
    background: var(--archive-bg);
}

.comment-text {
    margin: 0.9rem 0 0;
}

.comment-reply-toggle {
    margin-top: 0.9rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent-teal);
    cursor: pointer;
}

.reply-form.hidden {
    display: none;
    opacity: 0;
}

.reply-form {
    margin-top: 1rem;
    animation: slideDown 0.3s ease forwards;
}

@keyframes slideDown {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

body.article-body-mode .pill-button {
    background: #fff;
    border-color: var(--border-color);
    box-shadow: none;
}

body.article-body-mode .pill-danger {
    background: #f3eded;
}

.archive-year-card {
    padding: 24px;
}

.archive-year-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 18px;
    margin-bottom: 16px;
}

.archive-year-head h2 {
    margin: 0;
    font-size: 2rem;
}

.archive-year-head span {
    color: var(--muted-color);
}

.article-body {
    line-height: 1.9;
    font-size: 1.02rem;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
    margin: 1.8em 0 0.7em;
    line-height: 1.25;
}

.prose p,
.prose ul,
.prose ol,
.prose pre,
.prose blockquote,
.prose table {
    margin: 0 0 1.2em;
}

.prose img {
    border-radius: 18px;
    margin: 1.5em auto;
}

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

.prose blockquote {
    padding: 14px 18px;
    border-left: 3px solid var(--link-color);
    background: var(--surface-strong);
    border-radius: 0 16px 16px 0;
    color: var(--muted-color);
}

.prose pre,
.prose code {
    font-family: Consolas, Monaco, monospace;
}

.prose pre {
    overflow: auto;
    padding: 18px;
    border-radius: 18px;
    background: #141b22;
    color: #edf6ff;
}

.article-admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 32px 0;
}

.article-admin-actions form {
    margin: 0;
}

.glass-input {
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    border-radius: 18px;
    border: 1px solid var(--line-color);
    background: var(--surface-strong);
    color: var(--text-color);
    font: inherit;
    outline: none;
}

.glass-input:focus {
    border-color: rgba(65, 141, 199, 0.55);
    box-shadow: 0 0 0 3px rgba(65, 141, 199, 0.12);
}

.glass-textarea,
.editor-textarea {
    resize: vertical;
    min-height: 140px;
}

.comment-list {
    margin-top: 18px;
    display: grid;
    gap: 16px;
}

.comment-item,
.comment-reply {
    padding: 18px;
    border-radius: 22px;
    border: 1px solid var(--line-color);
    background: var(--surface-strong);
}

.comment-reply {
    margin-top: 12px;
    margin-left: 18px;
}

.comment-text {
    margin: 10px 0 0;
    line-height: 1.75;
}

.comment-reply-toggle {
    margin-top: 12px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--link-color);
    cursor: pointer;
    font: inherit;
}

.reply-form {
    margin-top: 12px;
}

.hidden {
    display: none;
}

.toc-content ul {
    list-style: none;
    margin: 0;
    padding-left: 14px;
    border-left: 1px solid var(--line-color);
}

.toc-content li + li {
    margin-top: 8px;
}

.toc-content a {
    color: var(--muted-color);
    line-height: 1.6;
}

.editor-shell {
    max-width: 920px;
    margin: 0 auto;
}

.editor-form {
    padding: 28px;
}

.editor-title-input {
    width: 100%;
    margin-bottom: 20px;
    border: 0;
    background: transparent;
    color: var(--text-color);
    font: inherit;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.1;
    outline: none;
}

.editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.input-block {
    display: grid;
    gap: 8px;
}

.input-block span {
    color: var(--muted-color);
    font-size: 0.92rem;
}

.editor-actions {
    margin-top: 18px;
    display: flex;
    justify-content: flex-end;
}

.auth-shell {
    min-height: calc(100vh - 220px);
    display: grid;
    place-items: center;
}

.auth-card {
    width: min(480px, 100%);
    padding: 32px;
}

.auth-form {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

.auth-submit {
    width: 100%;
}

.auth-footnote {
    margin: 18px 0 0;
    color: var(--muted-color);
    text-align: center;
}

.auth-footnote a,
.login-tip a,
.site-footer a {
    color: var(--link-color);
}

.site-footer {
    padding: 28px 0 24px;
}

.site-footer-text {
    text-align: center;
    color: var(--muted-color);
    font-size: 0.92rem;
    line-height: 1.8;
}

.beian-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--muted-color);
    text-decoration: none;
    font-size: 0.85rem;
}

.beian-link:hover {
    color: var(--link-color);
}

.beian-icon {
    vertical-align: middle;
}

@media (max-width: 960px) {
    .archive-hero,
    .archive-footer-grid,
    .constellation-grid,
    .timeline-entry {
        grid-template-columns: 1fr;
    }

    .archive-home {
        width: min(100% - 24px, 1160px);
    }

    .workbench-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .article-layout,
    .post-layout,
    .info-columns,
    .editor-grid,
    .article-grid,
    .archive-overview {
        grid-template-columns: 1fr;
    }

    .article-page {
        grid-template-columns: 1fr;
        gap: 24px;
        max-width: min(776px, 90vw);
    }

    .article-detail-page {
        flex-direction: column;
        gap: 2rem;
        max-width: min(776px, 90vw);
        margin: 2.5rem auto;
        padding: 0;
    }

    body.article-body-mode .site-header {
        grid-template-columns: 1fr;
        justify-items: center;
        padding-left: 20px;
        padding-right: 20px;
    }

    body.article-body-mode .header-actions {
        justify-content: center;
    }

    .article-detail-aside {
        display: none;
    }

}

@media (max-width: 850px) {
    .article-detail-page {
        flex-direction: column;
    }

    .article-detail-aside {
        display: none;
    }

    .article-top-hero {
        height: 25vh;
        min-height: 180px;
        margin: -2rem 0 2rem;
    }
}

@media (max-width: 720px) {
    .site-shell {
        width: min(100% - 24px, 1120px);
    }

    .site-header,
    body.article-body-mode .site-header {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "brand actions"
            "nav nav";
        align-items: center;
        gap: 14px;
        padding-top: 18px;
        padding-bottom: 14px;
        padding-left: 16px;
        padding-right: 16px;
    }

    .header-brand-wrap {
        grid-area: brand;
        padding: 0;
    }

    .header-actions {
        grid-area: actions;
        justify-content: flex-end;
    }

    .site-nav {
        grid-area: nav;
        width: 100%;
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 2px;
        justify-content: flex-start;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

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

    .archive-hero-copy,
    .archive-hero-panel,
    .archive-workbench,
    .archive-info-block {
        border-radius: 22px;
    }

    .archive-hero-copy {
        padding: 28px 22px;
    }

    .archive-hero-copy h1 {
        font-size: 2.3rem;
    }

    .timeline-list {
        padding-left: 16px;
    }

    .timeline-entry {
        padding-left: 22px;
    }

    .constellation-node:nth-child(odd),
    .constellation-node:nth-child(even) {
        transform: none;
    }

    .view-switch {
        width: 100%;
        justify-content: space-between;
    }

    .view-switch-btn {
        flex: 1;
    }

    .auth-card,
    .editor-form {
        border-radius: 24px;
    }

    .section-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .archive-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .archive-row-meta {
        text-align: left;
    }

    .article-toc {
        position: static;
        max-width: none;
    }

    .article-detail-toc {
        position: static;
        width: 100%;
    }

    .article-switch-grid {
        flex-direction: column;
    }

    .article-switch-col-next {
        text-align: left;
    }

    .comment-reply {
        margin-left: 0;
    }
}

@media (max-width: 560px) {
    .auth-shell {
        padding: 2rem 0.75rem;
    }

    .auth-card {
        padding: 2.35rem 1.35rem;
        max-width: none;
    }

    .auth-card h1 {
        font-size: 1.65rem;
    }

    .archive-workbench {
        padding: 26px 18px;
    }

    .timeline-card {
        padding: 16px;
    }
}

/* Archives redesign */
.archive-page {
    max-width: 980px;
    margin: 3.4rem auto 4.2rem;
    padding: 0 1.5rem;
}

.archive-page-header {
    margin-bottom: 1.7rem;
}

.archive-main-title {
    margin: 0;
    font-family: "Noto Serif SC", "EB Garamond", serif;
    font-size: clamp(2rem, 4.8vw, 3.4rem);
    line-height: 1.06;
    letter-spacing: 0.02em;
    color: var(--ink-black, var(--text-main));
}

.archive-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
    margin-bottom: 1.35rem;
}

.stat-item {
    position: relative;
    overflow: hidden;
    padding: 1rem 1.1rem 0.95rem;
    border: 1px solid var(--border-color, var(--border));
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(74, 103, 95, 0.08), rgba(74, 103, 95, 0.015)),
        var(--paper-white, var(--card));
    box-shadow: var(--shadow-soft, var(--shadow));
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.stat-item::after {
    content: "";
    position: absolute;
    inset: auto -10% 0 auto;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(74, 103, 95, 0.18) 0%, rgba(74, 103, 95, 0) 72%);
    transform: translate(20%, 30%);
    pointer-events: none;
}

.stat-item:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--accent-teal, var(--accent)) 38%, var(--border-color, var(--border)));
    box-shadow: 0 12px 22px rgba(74, 103, 95, 0.08);
}

.stat-item .section-kicker {
    margin-bottom: 0.45rem;
}

.stat-value {
    display: block;
    margin-bottom: 0.18rem;
    font-family: "EB Garamond", "Noto Serif SC", serif;
    font-size: clamp(1.7rem, 3vw, 2.35rem);
    line-height: 1;
    color: var(--accent-teal, var(--accent));
}

.stat-label {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted-color, var(--text-sub));
}

.archive-year-nav {
    position: sticky;
    top: 5.1rem;
    z-index: 8;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 2rem;
    padding: 0.65rem 0 0.8rem;
    background: transparent;
    backdrop-filter: none;
}

.archive-year-link {
    position: relative;
    padding: 0.46rem 0.82rem;
    border-radius: 999px;
    border: 1px solid var(--border-color, var(--border));
    background: rgba(255, 255, 255, 0.55);
    color: var(--muted-color, var(--text-sub));
    text-decoration: none;
    white-space: nowrap;
    font-size: 0.88rem;
    transition: transform 0.25s ease, border-color 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}

html[data-theme="dark"] .archive-year-link {
    background: rgba(255, 255, 255, 0.04);
}

.archive-year-link:hover,
.archive-year-link.is-active {
    transform: translateY(-1px);
    color: var(--ink-black, var(--text-main));
    border-color: color-mix(in srgb, var(--accent-teal, var(--accent)) 45%, var(--border-color, var(--border)));
    background: color-mix(in srgb, var(--paper-white, var(--card)) 84%, var(--accent-teal, var(--accent)) 16%);
}

.archive-timeline {
    position: relative;
}

.archive-timeline::before {
    content: "";
    position: absolute;
    left: 146px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, rgba(74, 103, 95, 0.12), rgba(74, 103, 95, 0.04) 18%, rgba(74, 103, 95, 0.14) 52%, rgba(74, 103, 95, 0.05));
    pointer-events: none;
}

.archive-year-group {
    position: relative;
    display: grid;
    grid-template-columns: 126px minmax(0, 1fr);
    gap: 1.6rem;
    margin-bottom: 2.8rem;
}

.archive-year-sidebar {
    position: sticky;
    top: 9rem;
    height: fit-content;
    padding-top: 0.2rem;
}

.archive-year-sidebar::after {
    content: "";
    position: absolute;
    right: -1.95rem;
    top: 1rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-teal, var(--accent));
    box-shadow: 0 0 0 5px rgba(74, 103, 95, 0.09);
}

.archive-year-text {
    margin: 0;
    font-family: "EB Garamond", "Noto Serif SC", serif;
    font-size: clamp(2rem, 3.8vw, 3rem);
    line-height: 0.98;
    color: var(--ink-black, var(--text-main));
}

.archive-count-badge {
    margin-top: 0.45rem;
    font-size: 0.64rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-teal, var(--accent));
}

.archive-list-container {
    display: grid;
    gap: 0.55rem;
}

.archive-row-v2 {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.8rem;
    padding: 0.82rem 0.9rem 0.82rem 0.95rem;
    border: 1px solid transparent;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.5));
    color: var(--ink-black, var(--text-main));
    text-decoration: none;
    transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease, background-color 0.28s ease;
}

html[data-theme="dark"] .archive-row-v2 {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.02));
}

.archive-row-v2::before {
    content: "";
    position: absolute;
    left: -0.95rem;
    top: 50%;
    width: 0.55rem;
    height: 1px;
    background: rgba(74, 103, 95, 0.25);
    transform: translateY(-50%);
}

.archive-row-v2:hover {
    transform: translateX(6px);
    border-color: color-mix(in srgb, var(--accent-teal, var(--accent)) 35%, var(--border-color, var(--border)));
    background: var(--paper-white, var(--card));
    box-shadow: 0 10px 20px rgba(74, 103, 95, 0.08);
}

.archive-row-left,
.archive-row-right {
    display: flex;
    align-items: center;
}

.archive-row-left {
    min-width: 0;
    gap: 0.9rem;
}

.archive-row-main {
    min-width: 0;
    display: grid;
    gap: 0.38rem;
}

.archive-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.archive-tag-chip,
.archive-meta-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.24rem 0.58rem;
    border-radius: 999px;
    background: rgba(100, 116, 139, 0.12);
    color: var(--muted-color, var(--text-sub));
    font-size: 0.72rem;
    line-height: 1;
}

.archive-row-right {
    gap: 0.7rem;
    justify-self: end;
}

.archive-row-date {
    flex: 0 0 auto;
    min-width: 3.4rem;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.76rem;
    letter-spacing: 0.06em;
    color: var(--muted-color, var(--text-sub));
}

.archive-row-title {
    min-width: 0;
    font-size: 0.94rem;
    font-weight: 500;
    line-height: 1.45;
}

.archive-row-meta {
    font-size: 0.78rem;
    color: var(--muted-color, var(--text-sub));
    white-space: nowrap;
}

.archive-arrow {
    opacity: 0;
    color: var(--accent-teal, var(--accent));
    font-size: 0.9rem;
    transform: translateX(-6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.archive-row-v2:hover .archive-arrow {
    opacity: 1;
    transform: translateX(0);
}

.archive-empty-state {
    padding: 2.8rem 1.2rem;
    border: 1px dashed var(--border-color, var(--border));
    border-radius: 18px;
    text-align: center;
    color: var(--muted-color, var(--text-sub));
    background: rgba(255, 255, 255, 0.45);
}

html[data-theme="dark"] .archive-empty-state {
    background: rgba(255, 255, 255, 0.02);
}

@media (max-width: 900px) {
    .archive-page {
        padding: 0 1.1rem;
    }

    .archive-timeline::before {
        display: none;
    }

    .archive-year-group {
        grid-template-columns: 1fr;
        gap: 0.8rem;
        margin-bottom: 2.1rem;
    }

    .archive-year-sidebar {
        position: relative;
        top: 0;
        padding: 0 0 0.85rem;
        border-bottom: 1px solid var(--border-color, var(--border));
    }

    .archive-year-sidebar::after {
        display: none;
    }
}

@media (max-width: 720px) {
    .archive-page {
        margin-top: 2.2rem;
        padding: 0 0.95rem;
    }

    .archive-stat-grid {
        grid-template-columns: 1fr;
    }

    .archive-year-nav {
        top: 4.5rem;
        margin-bottom: 1.35rem;
        padding: 0.55rem 0 0.75rem;
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .archive-row-v2 {
        grid-template-columns: 1fr;
        gap: 0.55rem;
        padding: 0.82rem 0.85rem;
    }

    .archive-row-v2::before {
        display: none;
    }

    .archive-row-left,
    .archive-row-right {
        width: 100%;
    }

    .archive-row-left {
        gap: 0.7rem;
        align-items: flex-start;
    }

    .timeline-card.timeline-card-rich {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }

    .timeline-card.timeline-card-rich .timeline-card-copy {
        grid-column: 1;
        grid-row: 1;
    }

    .timeline-card.timeline-card-rich .timeline-card-cover {
        grid-column: 1;
        grid-row: 2;
        max-height: 160px;
    }

    .timeline-card.timeline-card-rich .timeline-card-meta {
        grid-column: 1;
        grid-row: 3;
        justify-self: end;
    }

    .archive-row-right {
        justify-self: start;
    }

    .archive-row-meta {
        display: none;
    }

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

    .archive-year-text {
        font-size: 1.8rem;
    }
}

/* Comments Section */
.comments-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}

.comments-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.comments-icon {
    font-size: 1.3rem;
}

.comments-count {
    color: var(--text-sub);
    font-weight: 400;
    font-size: 1rem;
}

.comment-form {
    background: var(--card);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.comment-form textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
}

.comment-identity-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.comment-identity-grid input,
.reply-form input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    background: #fff;
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
    margin-top: 15px;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-small {
    background: var(--accent);
    color: #fff;
    padding: 6px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 10px;
}

.comment-login-prompt {
    text-align: center;
    padding: 30px;
    background: var(--card);
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.comment-login-prompt a {
    color: var(--accent);
    font-weight: 600;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.comment-item {
    display: flex;
    gap: 20px;
    background: var(--card);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.comment-item:hover {
    transform: translateX(5px);
}

.comment-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #fff;
    color: #111;
    border: 2px solid #111;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 600;
    flex-shrink: 0;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

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

.comment-time {
    color: var(--text-sub);
    font-size: 0.9rem;
}

.comment-body {
    line-height: 1.7;
    margin-bottom: 12px;
    white-space: pre-wrap;
    word-break: break-word;
}

.comment-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.reply-btn, .delete-btn {
    color: var(--text-sub);
    font-size: 0.9rem;
    background: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

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

.delete-btn:hover {
    color: #e74c3c;
}

.reply-form {
    margin-top: 15px;
    padding: 15px;
    background: var(--bg);
    border-radius: 8px;
}

.reply-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    resize: vertical;
    font-family: inherit;
    font-size: 0.95rem;
}

.reply-form .comment-identity-grid {
    margin-bottom: 10px;
}

.replies-list {
    margin-top: 15px;
    padding-left: 20px;
    border-left: 3px solid var(--border);
}

.reply-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    margin-bottom: 10px;
    background: var(--bg);
    border-radius: 8px;
}

.reply-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    color: #111;
    border: 2px solid #111;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    flex-shrink: 0;
}

.reply-content {
    flex: 1;
    font-size: 0.95rem;
}

.reply-author {
    font-weight: 600;
    margin-right: 8px;
}

.author-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: #111;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

html[data-theme="dark"] .article-detail-header h1 {
    color: #f3f7fb;
}

html[data-theme="dark"] .article-detail-meta {
    color: #b6c3d1;
    border-bottom-color: rgba(255, 255, 255, 0.14);
}

html[data-theme="dark"] .article-detail-summary {
    color: #d6deea;
}

html[data-theme="dark"] .article-detail-prose {
    color: #dde6f1;
}

html[data-theme="dark"] .article-detail-prose h1,
html[data-theme="dark"] .article-detail-prose h2,
html[data-theme="dark"] .article-detail-prose h3,
html[data-theme="dark"] .article-detail-prose h4,
html[data-theme="dark"] .article-detail-prose h5 {
    color: #f4f8fd;
}

html[data-theme="dark"] .article-detail-prose a {
    color: #6ec3ff;
}

html[data-theme="dark"] .article-detail-prose blockquote {
    color: #c6d3e3;
    border-left-color: #66bdf8;
    background: rgba(105, 150, 190, 0.12);
}

html[data-theme="dark"] .article-detail-prose code {
    color: #dff3ff;
    background: rgba(120, 156, 184, 0.18);
    border-radius: 6px;
    padding: 1px 6px;
}

html[data-theme="dark"] .article-detail-prose pre {
    background: #0f1722;
    color: #e8f2ff;
    border: 1px solid rgba(158, 182, 207, 0.22);
}

html[data-theme="dark"] .article-detail-prose .article-media-shell {
    border-color: rgba(154, 179, 202, 0.18);
    background: linear-gradient(180deg, rgba(19, 27, 38, 0.96) 0%, rgba(27, 36, 48, 0.96) 100%);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .article-detail-prose .article-media-caption {
    color: #c6d3e3;
}

html[data-theme="dark"] .comment-body,
html[data-theme="dark"] .reply-body {
    color: #e0e8f2;
}

html[data-theme="dark"] .comment-time,
html[data-theme="dark"] .reply-time {
    color: #aebacd;
}

html[data-theme="dark"] .comment-form,
html[data-theme="dark"] .reply-form {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .comment-form textarea,
html[data-theme="dark"] .reply-form textarea,
html[data-theme="dark"] .comment-identity-grid input,
html[data-theme="dark"] .reply-form input {
    background: rgba(14, 22, 32, 0.92);
    border-color: rgba(161, 180, 201, 0.32);
    color: #e6eef8;
}

html[data-theme="dark"] .comment-form textarea::placeholder,
html[data-theme="dark"] .reply-form textarea::placeholder,
html[data-theme="dark"] .comment-identity-grid input::placeholder,
html[data-theme="dark"] .reply-form input::placeholder {
    color: #9eb0c5;
}

html[data-theme="dark"] .comment-form textarea:focus,
html[data-theme="dark"] .reply-form textarea:focus,
html[data-theme="dark"] .comment-identity-grid input:focus,
html[data-theme="dark"] .reply-form input:focus {
    border-color: rgba(111, 193, 255, 0.66);
    box-shadow: 0 0 0 3px rgba(111, 193, 255, 0.18);
}

.reply-body {
    color: var(--text-main);
}

.reply-time {
    display: block;
    color: var(--text-sub);
    font-size: 0.85rem;
    margin-top: 5px;
}

@media (max-width: 720px) {
    .comments-section {
        margin-top: 34px;
        padding-top: 24px;
    }

    .comments-title {
        margin-bottom: 16px;
        font-size: 1.15rem;
    }

    .comment-form {
        padding: 14px;
        border-radius: 10px;
        margin-bottom: 16px;
    }

    .comment-form textarea,
    .reply-form textarea {
        font-size: 14px;
        line-height: 1.55;
    }

    .comment-item {
        gap: 10px;
        padding: 12px;
        border-radius: 10px;
        align-items: flex-start;
    }

    .comment-avatar {
        width: 34px;
        height: 34px;
        font-size: 1rem;
        border-width: 1.5px;
    }

    .comment-header {
        gap: 8px;
        flex-wrap: wrap;
        margin-bottom: 6px;
    }

    .comment-author {
        font-size: 14px;
    }

    .author-badge {
        padding: 3px 8px;
        font-size: 11px;
    }

    .comment-time {
        font-size: 12px;
    }

    .comment-body {
        font-size: 14px;
        line-height: 1.6;
        margin-bottom: 8px;
    }

    .comment-actions {
        gap: 10px;
        flex-wrap: wrap;
    }

    .reply-btn,
    .delete-btn {
        font-size: 12px;
        padding: 0;
    }

    .reply-form {
        margin-top: 10px;
        padding: 10px;
    }

    .replies-list {
        margin-top: 10px;
        padding-left: 10px;
        border-left-width: 2px;
    }

    .reply-item {
        gap: 8px;
        padding: 8px;
        border-radius: 8px;
        margin-bottom: 8px;
    }

    .reply-avatar {
        width: 24px;
        height: 24px;
        font-size: 0.78rem;
        border-width: 1.5px;
    }

    .reply-content {
        font-size: 13px;
        line-height: 1.55;
    }

    .reply-time {
        margin-top: 4px;
        font-size: 11px;
    }
}

.comments-empty {
    text-align: center;
    padding: 50px;
    color: var(--text-sub);
    font-size: 1.1rem;
}


html,
body,
body.home-body-mode {
    overflow-y: auto;
}

.writing-track-fallback {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 0 18px;
}

.archive-inline-link.is-static {
    color: var(--text-sub, #7b7b7b);
    cursor: default;
}

.archive-hero-panel {
    gap: 12px;
    padding: 18px;
}

.identity-card {
    gap: 12px;
    padding-bottom: 12px;
}

.identity-avatar {
    width: 58px;
    height: 58px;
    border-radius: 14px;
}

.identity-name {
    font-size: 1.2rem;
}

.featured-note {
    gap: 8px;
    padding: 14px;
    border-radius: 18px;
}

.featured-note-cover {
    aspect-ratio: 16 / 7;
}

.featured-note strong {
    font-size: 1.05rem;
}

.featured-note p {
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-reading-layout {
    display: block;
}

.article-reading-main {
    min-width: 0;
    max-width: 760px;
}

.article-detail-toc {
    flex: 0 0 220px;
    width: 220px;
    max-height: calc(100vh - clamp(100px, 14vh, 140px));
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    scrollbar-width: none;
}

.article-detail-toc::-webkit-scrollbar {
    display: none;
}

.article-detail-toc.is-pinned {
    position: fixed;
    top: clamp(80px, 12vh, 120px);
    width: 220px;
    max-height: calc(100vh - clamp(100px, 14vh, 140px));
}

.article-detail-toc h3 {
    margin: 0;
}

.article-detail-toc .toc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.toc-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border-color, #e5e5e1);
    background: transparent;
    color: var(--sub-text, #86868b);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.toc-toggle-btn:hover {
    background: rgba(0,0,0,0.04);
    color: var(--ink-black, #2d2d2d);
}

.toc-toggle-btn svg {
    transition: transform 0.25s ease;
}

.article-detail-toc.is-collapsed .toc-header {
    margin-bottom: 0;
}

.article-detail-toc.is-collapsed .article-toc-content {
    display: none;
}

.article-detail-toc.is-collapsed.is-pinned {
    max-height: none;
}

.article-toc-content ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.article-toc-content li + li {
    margin-top: 4px;
}

.article-toc-content a {
    display: block;
    color: var(--muted-color);
    padding: 4px 0 4px 12px;
    border-left: 2px solid transparent;
    line-height: 1.5;
    font-size: 0.85rem;
    transition: color 0.18s ease, border-color 0.18s ease;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.article-toc-content a:hover {
    color: var(--accent-teal);
    border-left-color: rgba(31, 92, 77, 0.3);
}

.article-toc-content a.is-active {
    color: var(--accent-teal);
    border-left-color: var(--accent-teal);
    font-weight: 600;
}

.article-reveal-page .article-reveal-hero,
.article-reveal-page .article-reveal-header,
.article-reveal-page .article-reveal-content,
.article-reveal-page .article-reveal-toc {
    opacity: 0;
    transform: translateY(18px);
    animation: article-fade-up 0.55s ease forwards;
}

.article-reveal-page .article-reveal-header {
    animation-delay: 0.08s;
}

.article-reveal-page .article-reveal-content {
    animation-delay: 0.16s;
}

.article-reveal-page .article-reveal-toc {
    animation-delay: 0.22s;
}

.article-motion-card {
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.article-motion-card:hover {
    transform: translateY(-2px);
    border-color: rgba(65, 141, 199, 0.24);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.05);
}

.article-section-reveal {
    opacity: 0;
    transform: translateY(14px);
    transition:
        opacity 0.45s ease var(--reveal-delay, 0ms),
        transform 0.45s ease var(--reveal-delay, 0ms);
}

.article-section-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes article-fade-up {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1280px) {
    .article-detail-page,
    .article-detail-page.has-toc {
        max-width: min(776px, 90vw);
        margin: 2.5rem auto;
        padding: 0;
    }

    .article-detail-main,
    .article-detail-toc {
        grid-column: auto;
    }

    .article-detail-toc {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .article-reveal-page .article-reveal-hero,
    .article-reveal-page .article-reveal-header,
    .article-reveal-page .article-reveal-content,
    .article-reveal-page .article-reveal-toc {
        opacity: 1;
        transform: none;
        animation: none;
    }

    .article-motion-card,
    .article-section-reveal,
    .article-toc-content a,
    .featured-note,
    .switch-box {
        transition: none;
    }

    .article-section-reveal {
        opacity: 1;
        transform: none;
    }
}
