:root {
    --bg: #0b1020;
    --bg-soft: #121a31;
    /* 深色模式：卡片/面板为半透明毛玻璃深色，文字为浅色；
       亮色模式由 body.theme-light 覆盖回白卡深字。 */
    --surface: rgba(255, 255, 255, 0.06);
    --surface-strong: rgba(255, 255, 255, 0.1);
    --border: rgba(255, 255, 255, 0.12);
    --text: #e5e7eb;
    --text-soft: #94a3b8;
    --primary: #4f46e5;
    --primary-2: #7c3aed;
    --danger: #dc2626;
    --success: #16a34a;
    --radius: 18px;
    --site-header-height: calc(68px + env(safe-area-inset-top, 0px));
    /* Stacking (fixed scale; avoid ad-hoc z-* utilities) */
    --z-bg-decor: 0;
    --z-sticky-header: 20;
    --z-front-drawer: 48;
    --z-console-topbar: 10;
    --z-editor-sticky: 11;
    --z-editor-topbar: 12;
    --z-row-menu: 30;
    --z-console-scrim: 30;
    --z-console-drawer: 40;
    --z-floating-widget: 50;
    --z-modal-backdrop: 90;
    --z-modal-panel: 91;
    --z-combobox-menu: 95;
}

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

html {
    overflow-x: clip;
}

body {
    margin: 0;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--text);
    background-color: var(--bg);
    background-image: radial-gradient(
        ellipse 120% 70% at 50% -15%,
        color-mix(in srgb, var(--primary) 24%, transparent) 0%,
        transparent 58%
    );
    min-height: 100vh;
    min-height: 100dvh;
    line-height: 1.7;
    position: relative;
    display: flex;
    flex-direction: column;
}

.main-wrap p,
.site-footer p,
.result-tip,
.panel-meta,
.comment-body-text,
.post-meta {
    text-wrap: pretty;
}

.hero h1,
.hero-copy h1,
.archive-hero h1,
.post-article h1,
.card h2,
.console-hero h1,
.empty-card h1 {
    text-wrap: balance;
}

.bg-orb {
    position: fixed;
    border-radius: 999px;
    filter: blur(48px);
    opacity: 0.18;
    pointer-events: none;
    z-index: var(--z-bg-decor);
}

.orb-1 {
    width: 320px;
    height: 320px;
    background: #6366f1;
    top: -80px;
    left: -80px;
}

.orb-2 {
    width: 360px;
    height: 360px;
    background: #a855f7;
    right: -100px;
    top: 20%;
}

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

.site-header,
.main-wrap,
.site-footer,
.login-card {
    position: relative;
    z-index: 1;
}

.site-header {
    display: none;
}

.nav-wrap,
.main-wrap,
.site-footer {
    width: min(1100px, 92vw);
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.nav-wrap {
    min-height: 68px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.nav-search-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex: 1 1 auto;
    min-width: 0;
}

.nav-search-row .search-form {
    flex: 1 1 auto;
    min-width: 0;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    color: #f8fafc;
    font-weight: 600;
    padding: 0.25rem 0;
}

.logo-mark {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: inline-grid;
    place-items: center;
    font-weight: 700;
    background: var(--primary);
    color: #fff;
}

.site-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    display: inline-block;
    vertical-align: middle;
}

.logo-text {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    vertical-align: middle;
    padding-left: 0.5rem;
}

.logo-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.logo-subtitle {
    font-size: 0.78rem;
    color: #94a3b8;
    line-height: 1.4;
    font-weight: 400;
}

body.theme-light .logo-title {
    color: #1e293b;
}

body.theme-light .logo-subtitle {
    color: #64748b;
}

.main-nav {
    display: inline-flex;
    align-items: stretch;
    gap: 0.3rem;
    padding: 0.28rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.main-nav a {
    box-sizing: border-box;
    flex: 1 1 0;
    min-width: 4.8rem;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.18rem;
    text-align: center;
    white-space: nowrap;
    color: #cbd5e1;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.15;
    padding: 0.45rem 0.5rem 0.38rem;
    border-radius: 999px;
    transition: color 0.18s ease, background-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
    position: relative;
}

.main-nav a svg {
    width: 18px;
    height: 18px;
    display: block;
    flex-shrink: 0;
}

/* 桌面端：导航组相对顶栏水平居中 */
@media (min-width: 861px) {
    .site-header {
        display: none;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: var(--z-sticky-header);
        width: 320px;
        display: flex;
        flex-direction: column;
        background: color-mix(in srgb, var(--bg) 35%, transparent);
        backdrop-filter: blur(8px) saturate(1.2);
        -webkit-backdrop-filter: blur(8px) saturate(1.2);
        border-right: 1px solid rgba(255, 255, 255, 0.05);
    }

    .sidebar-panel {
        display: flex;
        flex-direction: column;
        height: 100%;
        padding: 1.5rem 1.2rem 1rem;
        box-sizing: border-box;
        gap: 0.5rem;
    }

    .sidebar-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 0.2rem;
        flex-shrink: 0;
        position: relative;
        z-index: 1;
        min-height: 48px;
        overflow: visible;
        padding: 0.25rem 0;
    }

    .sidebar-head .logo {
        font-size: 1rem;
        color: #f8fafc;
        display: inline-flex;
        align-items: center;
    }

    .sidebar-head .theme-toggle {
        position: relative;
        z-index: 2;
    }

    .sidebar-search {
        flex-shrink: 0;
        margin: 0.3rem 0 0.5rem;
    }

    .sidebar-search-form {
        display: flex;
        align-items: center;
        gap: 0;
        border-radius: 12px;
        border: 1px solid rgba(255, 255, 255, 0.5);
        background: rgba(255, 255, 255, 0.50);
        overflow: hidden;
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }

    .sidebar-search-form:focus-within {
        border-color: rgba(59, 130, 246, 0.45);
        box-shadow: 0 0 0 2.5px rgba(59, 130, 246, 0.12);
    }

    .sidebar-search-submit {
        flex: 0 0 auto;
        width: 36px;
        height: 36px;
        border: none;
        background: rgba(59, 130, 246, 0.08);
        color: #3b82f6;
        cursor: pointer;
        display: inline-grid;
        place-items: center;
        padding: 0;
        border-radius: 0;
        outline: none;
        transition: background 0.18s ease, color 0.18s ease;
    }

    .sidebar-search-submit:hover {
        background: rgba(59, 130, 246, 0.16);
        color: #2563eb;
    }

    .sidebar-search-submit:focus-visible {
        outline: 2px solid rgba(59, 130, 246, 0.5);
        outline-offset: -2px;
    }

    .sidebar-search-submit svg {
        width: 16px;
        height: 16px;
        display: block;
    }

    .sidebar-search-form input {
        flex: 1;
        min-width: 0;
        border: none;
        background: transparent;
        padding: 0.55rem 0.6rem 0.55rem 0.35rem;
        font-size: 0.88rem;
        color: #1e293b;
        outline: none;
        box-shadow: none;
        border-radius: 0;
        -webkit-appearance: none;
        appearance: none;
    }

    .sidebar-search-form input::placeholder {
        color: #94a3b8;
    }

    .sidebar-nav {
        display: flex;
        flex-direction: row;
        justify-content: flex-start;
        gap: 0.35rem;
        flex-shrink: 0;
        padding: 0.25rem 0;
    }

    .sidebar-nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.3rem;
        padding: 0.6rem 0.5rem;
        border-radius: 12px;
        color: #94a3b8;
        font-size: 0.72rem;
        font-weight: 500;
        text-decoration: none;
        transition: all 0.2s ease;
        min-width: 70px;
        flex: 1;
        max-width: 90px;
    }

    .sidebar-nav a:hover {
        color: var(--primary);
        background: rgba(255, 255, 255, 0.05);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .sidebar-nav a.is-active {
        color: var(--primary);
        background: transparent;
        border-bottom: 2px solid var(--primary);
        border-radius: 0;
        padding-bottom: calc(0.6rem - 2px);
    }

    .sidebar-nav a svg {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
        display: block;
    }

    .sidebar-hot {
        margin-top: 0.5rem;
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
    }

    .sidebar-hot-head {
        font-size: 0.8rem;
        font-weight: 600;
        color: #64748b;
        letter-spacing: 0.03em;
        margin-bottom: 0.5rem;
        padding: 0 0.2rem;
    }

    .sidebar-hot .mobile-drawer-hot-link {
        display: flex;
        align-items: baseline;
        gap: 0.5rem;
        padding: 0.5rem 0.6rem;
        margin: 0.15rem 0;
        border-radius: 6px;
        text-decoration: none;
        transition: all 0.2s ease;
        color: inherit;
    }

    .sidebar-hot .mobile-drawer-hot-link:hover {
        background: rgba(255, 255, 255, 0.05);
        color: var(--primary);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .sidebar-hot .mobile-drawer-hot-title {
        flex: 1 1 auto;
        min-width: 0;
        font-size: 0.85rem;
        font-weight: 500;
        color: #94a3b8;
        line-height: 1.5;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .sidebar-hot .mobile-drawer-hot-meta {
        flex: 0 0 auto;
        font-size: 0.72rem;
        color: #64748b;
        white-space: nowrap;
    }

    .sidebar-hot .mobile-drawer-hot-empty {
        font-size: 0.8rem;
        color: #64748b;
        text-align: center;
        padding: 0.3rem 0;
    }

    .sidebar-links {
        margin-top: 0.6rem;
        padding-top: 0.5rem;
        border-top: 1px solid rgba(148,163,184,0.2);
    }

    .sidebar-links-head {
        font-size: 0.8rem;
        font-weight: 600;
        color: #64748b;
        letter-spacing: 0.03em;
        margin-bottom: 0.4rem;
        padding: 0 0.2rem;
    }

    .sidebar-links-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.2rem;
    }

    .sidebar-link-item {
        display: block;
        padding: 0.3rem 0.4rem;
        border-radius: 6px;
        text-decoration: none;
        font-size: 0.78rem;
        color: #94a3b8;
        text-align: center;
        transition: all 0.15s;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .sidebar-link-item:hover {
        background: rgba(255,255,255,0.05);
        color: var(--primary);
    }

    .sidebar-links-empty {
        font-size: 0.78rem;
        text-align: center;
        padding: 0.3rem 0;
    }

    .main-nav {
        display: none;
    }

    .nav-search-row {
        display: none;
    }

    .nav-wrap {
        min-height: auto;
    }

    .content-wrapper {
        display: flex;
        min-height: 100dvh;
        padding-left: 290px;
        box-sizing: border-box;
    }

    .main-wrap {
        flex: 1;
        padding: 2rem 2.5rem 3rem;
    }

    .site-footer {
        margin-left: 290px;
        margin-right: 220px;
        width: auto;
        padding: 1.25rem 2.5rem;
    }

    .right-sidebar {
        width: 280px;
        flex-shrink: 0;
        position: sticky;
        top: 0;
        align-self: start;
        max-height: 100dvh;
        overflow-y: auto;
        padding: 1.5rem 1rem 1.5rem 0.5rem;
        box-sizing: border-box;
        scrollbar-width: thin;
        scrollbar-color: color-mix(in srgb, var(--primary) 28%, rgba(148, 163, 184, 0.45)) transparent;
    }

    .right-sidebar .right-sidebar-section {
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        border: none;
        border-radius: 0;
        padding: 0;
        margin-bottom: 1.5rem;
    }

    .right-sidebar::-webkit-scrollbar {
        width: 4px;
    }

    .right-sidebar::-webkit-scrollbar-thumb {
        border-radius: 999px;
        background: color-mix(in srgb, var(--primary) 28%, rgba(148, 163, 184, 0.45));
    }

    .right-sidebar .archive-sidebar-head {
        margin-bottom: 0.5rem;
    }

    .right-sidebar .archive-sidebar-head h3 {
        margin: 0;
        font-size: 0.85rem;
        font-weight: 600;
        color: #94a3b8;
        letter-spacing: 0.03em;
    }

    .right-sidebar .archive-sidebar-hint {
        display: none;
    }

    .right-sidebar .category-cloud-tag {
        font-size: 0.82rem;
        padding: 0.35rem 0.55rem;
        border-radius: 6px;
    }

    .right-sidebar .archive-calendar-toolbar {
        margin-bottom: 0.5rem;
    }

    .right-sidebar .archive-year-select {
        font-size: 0.82rem;
        padding: 0.25rem 0.5rem;
        border-radius: 6px;
    }

    .right-sidebar .archive-calendar-grid {
        gap: 0.3rem;
    }

    .right-sidebar .archive-calendar-cell {
        font-size: 0.8rem;
        padding: 0.3rem 0;
        border-radius: 6px;
    }

    .right-sidebar .archive-calendar-all {
        font-size: 0.82rem;
        padding: 0.25rem 0.55rem;
        border-radius: 6px;
    }

    .hero-banner {
        padding: 1rem;
    }

    .hero,
    .result-tip,
    .card,
    .post-article,
    .comment-section,
    .table-wrap,
    .empty-card {
        padding: 1.5rem;
    }

    .hero-banner + .result-tip {
        margin-top: -0.25rem;
    }

    .card-cover {
        margin: -1.5rem -1.5rem 0.75rem;
    }

    .card-cover img {
        height: 145px;
    }
}

.post-back-to-home {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: calc(var(--z-floating-widget) + 1);
}

.back-to-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(32px) saturate(2.0);
    -webkit-backdrop-filter: blur(32px) saturate(2.0);
    border: none;
    border-radius: 14px;
    color: #3b82f6;
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    box-shadow:
        0 4px 16px rgba(59, 130, 246, 0.08),
        0 2px 6px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        inset 0 -1px 0 rgba(0, 0, 0, 0.04);
    transition: all 0.22s ease;
}

.back-to-home-btn:hover {
    background: rgba(255, 255, 255, 0.40);
    color: #2563eb;
    transform: translateY(-2px);
    box-shadow:
        0 8px 24px rgba(59, 130, 246, 0.12),
        0 4px 10px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        inset 0 -1px 0 rgba(0, 0, 0, 0.04);
}

.back-to-home-btn:active {
    background: rgba(255, 255, 255, 0.18);
    transform: scale(0.95);
}

.back-to-home-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.main-nav a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.main-nav a:active {
    transform: translateY(0);
}

.main-nav a:focus-visible {
    outline: 2px solid rgba(129, 140, 248, 0.7);
    outline-offset: 2px;
}

.main-nav a.is-active {
    color: #ffffff;
    background: color-mix(in srgb, var(--primary) 92%, #1e1b4b);
    box-shadow: 0 6px 14px color-mix(in srgb, var(--primary) 28%, transparent);
}

.theme-toggle {
    width: 36px;
    height: 36px;
    display: inline-grid;
    place-items: center;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.12);
    color: #f8fafc;
    box-shadow: none;
    padding: 0;
}

.theme-toggle:hover {
    box-shadow: none;
}

.mobile-theme-toggle {
    display: none;
}

/* 顶栏筛选按钮：桌面隐藏；移动端显示 */
.archive-nav-btn {
    display: none;
}

.home-hot-drawer[hidden],
.side-drawer[hidden] {
    display: none !important;
}


.archive-hero-desc-mobile {
    display: none;
}

.glass-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    backdrop-filter: blur(8px);
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.2);
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.search-form {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    padding: 0.24rem 0.28rem 0.24rem 0.5rem;
    min-width: 240px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.34);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
}

.search-form input,
input,
textarea,
select {
    width: 100%;
    border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
    border-radius: 10px;
    padding: 0.52rem 0.75rem;
    background: #fff;
    font: inherit;
    color: #1f2937;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-form input {
    border: 0;
    background: transparent;
    box-shadow: none;
    font-size: 0.88rem;
    padding: 0.34rem 0.2rem;
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
}

.search-form input:focus {
    box-shadow: none;
}

.search-submit {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    font-size: 0.86rem;
    background: var(--primary);
    box-shadow: 0 6px 14px color-mix(in srgb, var(--primary) 30%, transparent);
}

.search-submit:hover {
    transform: translateY(-1px) scale(1.02);
}

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

input:focus,
textarea:focus,
select:focus {
    outline: 0;
    border-color: color-mix(in srgb, var(--primary) 55%, #ffffff);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}

button,
.btn {
    border: 0;
    border-radius: 10px;
    padding: 0.55rem 0.82rem;
    font: inherit;
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    color: #fff;
    background: var(--primary);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

button:hover,
.btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.02);
    box-shadow: 0 10px 24px color-mix(in srgb, var(--primary) 35%, transparent);
}

.btn.outline {
    color: #334155;
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.38);
    box-shadow: none;
}

.btn.outline:hover {
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.btn.outline.danger {
    color: #b91c1c;
    background: #fff5f5;
    border-color: color-mix(in srgb, var(--danger) 42%, rgba(148, 163, 184, 0.38));
}

.btn.outline.danger:hover {
    filter: none;
    color: #991b1b;
    border-color: color-mix(in srgb, var(--danger) 55%, rgba(148, 163, 184, 0.28));
    box-shadow: 0 8px 18px color-mix(in srgb, var(--danger) 16%, transparent);
}

.main-wrap {
    min-width: 0;
}

/* HTML 原生页：无站点导航/评论区，仅展示内嵌正文 */
body.html-native-page {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: #fff;
}

body.html-native-page .html-native-main {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.html-iframe-wrapper {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    border: none;
    overflow: hidden;
}

.html-native-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

body.html-native-page .post-back-to-home {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
}

body.html-native-page .back-to-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(59, 130, 246, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 14px;
    color: #3b82f6;
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.1);
    transition: all 0.22s ease;
}

body.html-native-page .back-to-home-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
}

body.html-native-page .back-to-home-btn:active {
    background: rgba(59, 130, 246, 0.15);
    transform: scale(0.95);
}

body.html-native-page .back-to-home-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

@media (max-width: 860px) {
    body.html-native-page .post-back-to-home {
        bottom: 170px;
        right: 18px;
    }

    body.html-native-page .back-to-home-btn {
        display: block;
        width: 44px;
        height: 44px;
        padding: 0;
        font-size: 0;
        border-radius: 12px;
        box-sizing: border-box;
        text-align: center;
        line-height: 44px;
    }

    body.html-native-page .back-to-home-btn svg {
        display: inline-block;
        width: 22px;
        height: 22px;
        vertical-align: middle;
        margin-top: -2px;
    }
}

.post-html-native pre,
.post-html-native table {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

.post-html-native table {
    display: block;
    width: max-content;
    min-width: 100%;
}

.post-html-native ul,
.post-html-native ol,
.post-html-native li,
.post-html-native blockquote {
    word-break: break-word;
    overflow-wrap: anywhere;
}

.hero,
.result-tip,
.card,
.post-article,
.comment-section,
.table-wrap,
.editor-wrap,
.empty-card,
.console-tools {
    margin-bottom: 1rem;
    padding: 1.35rem;
}

.empty-card.empty-state {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
}

.empty-card.empty-state p {
    margin: 0;
    max-width: 42ch;
}

.hero-banner {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 0.7rem;
    margin-bottom: 0.75rem;
    padding: 0.72rem;
}

.hero-media img {
    width: 100%;
    height: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: 12px;
}

.hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    padding: 0.2rem 0.3rem;
}

.hero-copy h1 {
    margin: 0.24rem 0 0.45rem;
    font-size: clamp(1.25rem, 2.5vw, 1.65rem);
    line-height: 1.25;
}

.hero-copy p {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    line-height: 1.45;
}

.hero-foot {
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.hero-cta {
    margin-top: 0;
    align-self: flex-end;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.8rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
    color: #ffffff;
    background: color-mix(in srgb, var(--primary) 94%, #1e1b4b);
    box-shadow: 0 10px 22px color-mix(in srgb, var(--primary) 30%, transparent);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.hero-cta:hover {
    transform: translateY(-1px);
    filter: brightness(1.02);
    box-shadow: 0 14px 26px color-mix(in srgb, var(--primary) 32%, transparent);
}

.hero-cta span {
    display: inline-block;
    transform: translateX(0);
    transition: transform 0.18s ease;
}

.hero-cta:hover span {
    transform: translateX(2px);
}

.featured-content {
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text);
    max-height: 7.2rem;
    overflow: hidden;
    position: relative;
    mask-image: linear-gradient(to bottom, #000 60%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent 100%);
    margin-bottom: 0.3rem;
}

.featured-content p {
    margin: 0.35rem 0;
}

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

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

.featured-content code {
    font-size: 0.8rem;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    background: rgba(100,116,139,0.12);
}

.featured-content pre {
    display: none;
}

.featured-content img {
    display: none;
}

@media (max-width: 860px) {
    .hero-foot {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .hero-cta {
        width: 100%;
        justify-content: center;
    }
}

.hero {
    text-align: center;
    padding: 2rem 1.5rem;
}

.hero-kicker {
    margin: 0 0 0.35rem;
    color: #4338ca;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.hero h1 {
    margin: 0 0 0.7rem;
    font-size: clamp(1.8rem, 4vw, 2.7rem);
    line-height: 1.2;
}

.hero p,
.result-tip,
.post-meta,
.site-footer,
.text-link {
    color: var(--text-soft);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.stat-card {
    padding: 1rem;
}

.stat-card p {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.9rem;
}

.stat-card h3 {
    margin: 0.35rem 0 0;
    font-size: 1.4rem;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 1rem;
}

.two-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.content-layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
}

.content-layout-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pagination-wrap.content-layout-pagination {
    justify-content: center;
    margin-top: 0;
}

.right-panel {
    height: fit-content;
    padding: 1rem;
}

.content-layout .right-panel {
    padding: 0.85rem 0.75rem;
}

.content-layout .right-panel h3 {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
    line-height: 1.3;
}

.content-layout .panel-link {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.22rem;
    margin-top: 0.5rem;
    padding: 0.5rem 0.58rem;
}

.content-layout .panel-title {
    width: 100%;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.35;
    font-size: 0.84rem;
    font-weight: 600;
}

.content-layout .panel-meta {
    font-size: 0.74rem;
    white-space: normal;
}

/* 首页热点 / 归档侧栏：桌面端 sticky 悬浮，滚动时始终停在视口内 */
@media (min-width: 861px) {
    .home-hot-sidebar--float,
    .archive-right--float {
        position: sticky;
        top: calc(4.35rem + env(safe-area-inset-top, 0px) + 0.65rem);
        max-height: calc(100dvh - 5.5rem - env(safe-area-inset-top, 0px) - 1.25rem);
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        z-index: 15;
        scrollbar-width: thin;
        scrollbar-color: color-mix(in srgb, var(--primary) 35%, transparent) transparent;
    }

    .home-hot-sidebar--float {
        box-shadow:
            0 20px 48px rgba(15, 23, 42, 0.14),
            0 0 0 1px color-mix(in srgb, var(--primary) 14%, rgba(148, 163, 184, 0.22));
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    .archive-right--float {
        align-self: start;
        padding-right: 2px;
    }

    .archive-right--float .archive-calendar-panel,
    .archive-right--float .archive-categories-panel {
        box-shadow:
            0 16px 40px rgba(15, 23, 42, 0.12),
            0 0 0 1px color-mix(in srgb, var(--primary) 12%, rgba(148, 163, 184, 0.2));
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .home-hot-sidebar--float::-webkit-scrollbar,
    .archive-right--float::-webkit-scrollbar {
        width: 5px;
    }

    .home-hot-sidebar--float::-webkit-scrollbar-thumb,
    .archive-right--float::-webkit-scrollbar-thumb {
        border-radius: 999px;
        background: color-mix(in srgb, var(--primary) 28%, rgba(148, 163, 184, 0.45));
    }
}

.panel-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.6rem;
    padding: 0.55rem 0.65rem;
    border-radius: 10px;
    color: #3730a3;
    background: #eef2ff;
    gap: 0.6rem;
}

.panel-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.panel-meta {
    color: #64748b;
    font-size: 0.82rem;
    white-space: nowrap;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.hot-tabs {
    display: flex;
    gap: 0.45rem;
    margin-bottom: 0.65rem;
}

.hot-tab {
    flex: 1;
    background: #e2e8f0;
    color: #334155;
    border-radius: 10px;
    padding: 0.45rem 0.5rem;
    font-weight: 600;
}

.hot-tab.is-active {
    background: var(--primary);
    color: #fff;
}

.hidden {
    display: none;
}

.card {
    transition: transform 0.18s ease-out, box-shadow 0.18s ease-out;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 35px rgba(30, 41, 59, 0.18);
}

.card h2 {
    margin: 0.22rem 0 0.1rem;
    font-size: 1.02rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-entry-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.18s ease;
}

.card-entry-link:hover {
    color: var(--primary);
}

.card h2 .card-entry-link {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-copy .card-entry-link {
    color: inherit;
}

.hero-copy .card-entry-summary {
    display: block;
}

.card-cover {
    margin: -1.35rem -1.35rem 0.65rem;
}

.card-cover img {
    width: 100%;
    height: 132px;
    object-fit: cover;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
}

.pin-badge {
    display: inline-flex;
    padding: 0.08rem 0.38rem;
    border-radius: 999px;
    background: #fee2e2;
    color: #991b1b;
    font-size: 0.66rem;
    font-weight: 700;
}

.card p {
    margin: 0 0 0.2rem;
    color: var(--text-soft);
    line-height: 1.35;
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card p .card-entry-summary {
    color: var(--text-soft);
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card p .card-entry-summary:hover {
    color: var(--primary);
}

.card-body {
    display: grid;
    gap: 0.12rem;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.56rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #312e81;
    background: #e0e7ff;
}

.meta,
.tool-actions,
.actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.meta span {
    color: #64748b;
    font-size: 0.8rem;
}

.muted-row {
    margin-top: 0.45rem;
    font-size: 0.86rem;
}

.card-bottom {
    margin-top: 0.08rem;
    padding-top: 0.24rem;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.card-meta-line {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 0.32rem;
    color: #64748b;
    font-size: 0.74rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-variant-numeric: tabular-nums;
}

.card-meta-line .tag,
.card-meta-line .pin-badge {
    flex-shrink: 0;
}

.card-meta-line span {
    line-height: 1.2;
}

.card .meta .link-arrow {
    font-size: 0.82rem;
}

.link-arrow::after {
    content: "→";
    margin-left: 0.35rem;
    transition: margin-left 0.2s ease;
}

.link-arrow:hover::after {
    margin-left: 0.5rem;
}

.post-article {
    min-width: 0;
    max-width: 100%;
    overflow-x: clip;
    box-sizing: border-box;
}

.post-article h1 {
    margin: 0.55rem 0;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    overflow-wrap: anywhere;
}

.post-content {
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.post-content pre {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    box-sizing: border-box;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    word-break: normal;
    white-space: pre;
    overflow-wrap: normal;
}

.post-content pre code {
    word-break: normal;
    white-space: pre;
}

.post-content blockquote {
    margin: 1rem 0;
    padding-left: 1rem;
    border-left: 3px solid #a5b4fc;
    color: #475569;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.post-content ul,
.post-content ol {
    margin: 0.5rem 0 0.85rem;
    padding-left: 1.35rem;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.post-content li {
    margin: 0.28rem 0;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.post-content li > p {
    margin: 0.25rem 0;
}

.post-content table {
    display: block;
    max-width: 100%;
    width: max-content;
    min-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-collapse: collapse;
    font-size: 0.92rem;
    margin: 0.65rem 0;
}

.post-content th,
.post-content td {
    border: 1px solid rgba(148, 163, 184, 0.45);
    padding: 0.4rem 0.55rem;
    white-space: normal;
    vertical-align: top;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.post-content code:not(pre code) {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.post-content img,
.post-content video,
.post-content iframe {
    max-width: 100%;
    height: auto;
}

.post-content img {
    border-radius: 12px;
}

.post-content th {
    background: rgba(241, 245, 249, 0.95);
    font-weight: 600;
}

.post-content del {
    text-decoration: line-through;
    opacity: 0.82;
}

.post-content .task-list {
    list-style: none;
    padding-left: 0;
    margin-left: 0;
}

.post-content .task-list-item {
    position: relative;
    padding-left: 1.55rem;
    list-style: none;
}

.post-content .task-list .task-list {
    margin-top: 0.3rem;
    margin-bottom: 0.35rem;
    padding-left: 1.35rem;
}

.post-content .task-list-control {
    position: absolute;
    left: 0;
    top: 0.2em;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: default;
}

.post-content .task-list-control input[type="checkbox"] {
    margin: 0;
    width: 1rem;
    height: 1rem;
    accent-color: var(--primary);
}

.post-content .task-list-indicator {
    display: none;
}

.form-stack {
    display: grid;
    gap: 0.85rem;
}

/* —— 文章页评论区（紧凑） —— */

.comment-section {
    padding: 1rem 1.15rem 1.05rem;
    min-width: 0;
    max-width: 100%;
    overflow-x: clip;
    box-sizing: border-box;
}

.comment-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    margin-bottom: 0.85rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    min-width: 0;
    max-width: 100%;
}

.comment-section-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

.comment-count-pill {
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    color: color-mix(in srgb, var(--primary) 85%, #1e1b4b);
    background: color-mix(in srgb, var(--primary) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent);
}

.comment-compose {
    margin-bottom: 0.85rem;
}

.comment-compose-row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.55rem 0.7rem;
    min-width: 0;
    max-width: 100%;
}

.comment-field {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    margin: 0;
}

.comment-field-nick {
    flex: 0 0 140px;
    width: 140px;
    max-width: 100%;
}

.comment-field-body {
    flex: 1 1 0;
    min-width: 0;
}

.comment-compose-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.28rem;
    flex: 0 0 auto;
    align-self: stretch;
}

.comment-actions-label-spacer {
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.25;
    color: transparent;
    user-select: none;
    pointer-events: none;
    white-space: nowrap;
}

.comment-field-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #64748b;
    line-height: 1.25;
}

.comment-compose input.comment-control {
    box-sizing: border-box;
    width: 100%;
    height: 2.625rem;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 400;
    color: #1f2937;
    padding: 0.42rem 0.55rem;
    line-height: 1.45;
}

.comment-compose textarea.comment-control {
    box-sizing: border-box;
    width: 100%;
    min-height: 2.625rem;
    height: auto;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 400;
    color: #1f2937;
    padding: 0.42rem 0.55rem;
    line-height: 1.45;
    resize: none;
    overflow-y: hidden;
    white-space: pre-wrap;
    word-break: break-word;
    vertical-align: top;
}

.comment-compose .comment-control::placeholder {
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 400;
    line-height: 1.45;
    color: #9ca3af;
    opacity: 1;
}

.comment-compose-hint {
    margin: 0.45rem 0 0;
    font-size: 0.72rem;
    color: #94a3b8;
    line-height: 1.4;
}

.comment-submit-btn {
    min-height: 2.625rem;
    height: 2.625rem;
    padding: 0 1rem;
    font-size: 0.82rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    margin-top: auto;
    flex-shrink: 0;
}

/* 评论区窄屏布局见 @media (max-width: 860px) */

.comment-thread {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.comment-thread-item {
    display: flex;
    gap: 0.62rem;
    padding: 0.58rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    scroll-margin-top: 5rem;
}

.comment-thread-item:last-child {
    border-bottom: 0;
    padding-bottom: 0.15rem;
}

.comment-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-grid;
    place-items: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
    background: var(--primary);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 25%, transparent);
}

.comment-thread-body {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
}

.comment-thread-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.comment-author-name {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text);
}

.comment-time {
    font-size: 0.72rem;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
}

.comment-body-text {
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.55;
    color: var(--text-soft);
    white-space: pre-wrap;
    word-break: break-word;
}

.comment-empty-tip {
    margin: 0.35rem 0 0;
    padding: 0.75rem 0.65rem;
    text-align: center;
    font-size: 0.84rem;
    color: #64748b;
    background: rgba(248, 250, 252, 0.85);
    border-radius: 12px;
    border: 1px dashed rgba(148, 163, 184, 0.35);
}

body.theme-light .comment-thread-item {
    border-bottom-color: rgba(148, 163, 184, 0.28);
}

body.theme-light .comment-empty-tip {
    background: rgba(241, 245, 249, 0.95);
    color: #64748b;
}

.admin-filter {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr auto;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.admin-post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.85rem;
}

.admin-post-card {
    padding: 1rem;
}

.admin-post-head,
.admin-post-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
}

.admin-post-card h3 {
    margin: 0.65rem 0 0.5rem;
}

.admin-post-card p {
    margin: 0 0 0.75rem;
    color: var(--text-soft);
}

.format-chip {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    background: #ede9fe;
    color: #5b21b6;
}

.admin-list-wrap {
    display: grid;
    gap: 0.65rem;
}

.admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.55rem;
}

.admin-toolbar-left {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.admin-select-all {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    font-size: 0.82rem;
    color: #64748b;
    user-select: none;
    white-space: nowrap;
}

.admin-search {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.admin-toolbar-filters {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: nowrap;
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-end;
}

.admin-toolbar-filter-fields {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
}

.admin-toolbar-search {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 22rem;
}

.admin-list-filter-select,
.admin-category-filter {
    min-width: 6.5rem;
    max-width: 9.5rem;
    padding: 0.42rem 0.55rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.92);
    font-size: 0.82rem;
    color: #334155;
}

.admin-search input[type="search"] {
    flex: 1 1 auto;
    width: 100%;
    min-width: 7rem;
    max-width: none;
    padding: 0.42rem 0.6rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
}

.admin-toolbar-search .btn {
    flex-shrink: 0;
}

.import-file-queue {
    margin-top: 0.25rem;
}

.import-file-queue-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.65rem;
}

.import-file-add-btn {
    padding: 0.32rem 0.62rem;
    font-size: 0.82rem;
    flex-shrink: 0;
}

.import-file-empty {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.35;
    flex: 1 1 10rem;
    min-width: 0;
}

.import-file-list {
    list-style: none;
    margin: 0.35rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.22rem;
}

.import-file-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    padding: 0.32rem 0.45rem;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    background: rgba(255, 255, 255, 0.5);
}

.import-file-name {
    min-width: 0;
    flex: 1;
    font-size: 0.84rem;
    line-height: 1.35;
    text-wrap: pretty;
    overflow-wrap: anywhere;
}

.import-file-row .btn {
    padding: 0.22rem 0.45rem;
    font-size: 0.76rem;
    flex-shrink: 0;
}

.import-file-feedback {
    margin: 0.35rem 0 0;
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
}

.import-file-limit-hint {
    margin: 0.25rem 0 0;
    font-size: 0.78rem;
    line-height: 1.35;
}

/* 后台「导入文章」：选择文件 + 分类同一行；发布状态两项同一行 */
.import-posts-form.form-stack {
    gap: 0.65rem;
}

.import-form-row--files-category {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(10.5rem, 15rem);
    gap: 0.5rem 0.85rem;
    align-items: start;
}

.import-files-field,
.import-category-field {
    min-width: 0;
}

.import-category-field .editor-combobox {
    width: 100%;
}

.import-category-field .editor-input {
    width: 100%;
    box-sizing: border-box;
}

.import-publish-fieldset {
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
}

.import-publish-fieldset .import-publish-legend {
    padding: 0;
    margin: 0 0 0.32rem;
}

.import-publish-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.45rem;
    align-items: stretch;
}

.import-publish-option {
    margin: 0;
    flex: 1 1 0;
    min-width: 0;
    align-items: flex-start;
    padding: 0.42rem 0.5rem;
    font-size: 0.8rem;
}

.import-publish-option span {
    text-wrap: balance;
    line-height: 1.35;
}

@media (max-width: 760px) {
    .import-form-row--files-category {
        grid-template-columns: 1fr;
    }
}

/* —— 后台「导入文章」：2×2 网格（导入|导出 / 记录|记录） —— */
.import-page-duo {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto minmax(17rem, 1fr);
    gap: 1rem;
    align-items: stretch;
}

.import-page-module--import {
    grid-column: 1;
    grid-row: 1;
}

.import-page-module--export {
    grid-column: 2;
    grid-row: 1;
}

.import-audit-panel--import {
    grid-column: 1;
    grid-row: 2;
}

.import-audit-panel--export {
    grid-column: 2;
    grid-row: 2;
}

.import-page-module {
    padding: 1rem 1.1rem 1.1rem;
    min-width: 0;
    height: 100%;
    box-sizing: border-box;
}

.import-page-module--import,
.import-page-module--export {
    display: flex;
    flex-direction: column;
}

.import-module-head {
    flex-shrink: 0;
    margin-bottom: 0.85rem;
}

.import-page-module--import .import-posts-form {
    flex: 1;
    min-height: 0;
}

.import-page-module-body--export {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.import-page-module--export .import-export-desc {
    margin-top: 0;
}

.import-export-all-form {
    margin-top: auto;
    padding-top: 0.65rem;
}

.import-page-panel-kicker {
    margin: 0 0 0.18rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary);
}

.import-page-panel-title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.25;
    text-wrap: balance;
}

.import-export-desc {
    margin: 0 0 0.7rem;
    font-size: 0.83rem;
    line-height: 1.55;
}

.import-export-all-form {
    margin: 0;
}

.import-export-submit-btn {
    width: 100%;
    justify-content: center;
}

.import-export-empty {
    margin: 0;
    font-size: 0.83rem;
    line-height: 1.45;
}

.import-page-form-actions {
    margin-top: 0.35rem;
}

@media (max-width: 960px) {
    .import-page-duo {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .import-page-module--import,
    .import-page-module--export,
    .import-audit-panel--import,
    .import-audit-panel--export {
        grid-column: 1;
        grid-row: auto;
    }

    .import-page-module--import,
    .import-page-module--export {
        height: auto;
    }

    .import-audit-panel {
        min-height: 12rem;
    }
}

.import-audit-panel {
    margin-top: 0;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.import-audit-table-scroll {
    flex: 1 1 auto;
    min-height: 0;
    max-height: min(50vh, 480px);
}

.import-audit-panel .import-log-detail-cell {
    max-width: min(22rem, 100%);
}

@media (max-width: 960px) {
    .import-audit-table-scroll {
        max-height: none;
    }
}

.import-log-empty {
    margin: 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 8rem;
}

.import-log-time {
    white-space: nowrap;
}

.import-log-count {
    font-variant-numeric: tabular-nums;
}

.import-log-detail-cell {
    min-width: 10rem;
    max-width: min(28rem, 42vw);
}

.import-log-details {
    margin: 0.25rem 0 0;
    font-size: 0.82rem;
}

.import-log-details:first-child {
    margin-top: 0;
}

.import-log-details summary {
    cursor: pointer;
    color: #475569;
    font-weight: 600;
}

.import-log-cell-list {
    margin: 0.35rem 0 0;
    padding-left: 1.15rem;
    text-wrap: pretty;
}

.admin-console-list-wrap {
    padding: 1rem 1.1rem 1.15rem;
}

.admin-list-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 0.75rem;
}

.admin-list-toolbar--batch {
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.65rem;
}

.admin-interaction-batch-form {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
}

.admin-interaction-batch-form .admin-toolbar-left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
}

.admin-mark-read-form {
    margin: 0;
    flex-shrink: 0;
}

.admin-col-check {
    width: 2.35rem;
    padding-left: 0.45rem;
    padding-right: 0.35rem;
    vertical-align: middle;
}

.admin-col-check input[type="checkbox"] {
    margin: 0;
}

.admin-data-table-scroll {
    overflow-x: auto;
}

.admin-data-table {
    min-width: 640px;
}

.admin-data-table.admin-comments-table {
    min-width: 880px;
}

.admin-data-table td.admin-cell-wrap,
.admin-data-table th:nth-child(4) {
    white-space: normal;
    max-width: min(380px, 42vw);
    vertical-align: top;
}

.admin-comment-snippet {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    line-height: 1.45;
    font-size: 0.88rem;
    color: var(--text);
}

.console-nav-label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}

.console-nav-badge {
    font-size: 0.68rem;
    font-weight: 700;
    min-width: 1.28rem;
    height: 1.28rem;
    padding: 0 0.38rem;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    display: inline-grid;
    place-items: center;
    line-height: 1;
    box-shadow: 0 4px 10px color-mix(in srgb, var(--danger) 35%, transparent);
}

.admin-comment-alert {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    margin-bottom: 0.85rem;
    border: 1px solid rgba(251, 191, 36, 0.45);
    background: #fef3c7;
}

.admin-comment-alert-title {
    margin: 0 0 0.25rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: #92400e;
}

.admin-comment-alert-desc {
    margin: 0;
    font-size: 0.86rem;
    color: #78350f;
    line-height: 1.55;
    max-width: 52rem;
}

.admin-comment-alert-form {
    flex-shrink: 0;
}

.admin-comment-row-new {
    background: rgba(99, 102, 241, 0.08);
}

.admin-comment-row-new td {
    border-bottom-color: rgba(99, 102, 241, 0.18);
}

.admin-comment-filter {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.admin-comment-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem 1rem;
    align-items: end;
}

.admin-comment-filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
}

.admin-comment-filter-field input,
.admin-comment-filter-field select {
    padding: 0.42rem 0.55rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.92);
    font-size: 0.88rem;
}

.admin-comment-filter-check {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    color: #475569;
    padding-bottom: 0.15rem;
}

.admin-comment-filter-check input {
    width: auto;
    accent-color: #6366f1;
}

.admin-comment-filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

/* 评论 / 留言板：独立筛选模块 + 列表模块 */
.admin-interaction-filter-wrap {
    padding: 1rem 1.15rem 1.1rem;
}

.admin-module-head {
    margin: 0 0 0.85rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.admin-module-head--compact {
    margin-bottom: 0.65rem;
    padding-bottom: 0.5rem;
}

.admin-page-panel-kicker {
    margin: 0 0 0.2rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #94a3b8;
}

.admin-module-title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
}

.admin-interaction-filter {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.admin-interaction-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem 1rem;
    align-items: end;
}

.admin-interaction-filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.32rem;
    min-width: 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: #64748b;
}

.admin-interaction-filter-field--wide {
    grid-column: span 2;
}

.admin-interaction-filter-field--check {
    justify-content: flex-end;
}

.admin-interaction-filter-field input,
.admin-interaction-filter-field select {
    width: 100%;
    padding: 0.44rem 0.58rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.92);
    font-size: 0.88rem;
    font-weight: 400;
    color: var(--text);
}

.admin-interaction-filter-check {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 2.35rem;
    padding: 0.35rem 0.55rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(248, 250, 252, 0.75);
    font-size: 0.82rem;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
}

.admin-interaction-filter-check input {
    width: auto;
    accent-color: #6366f1;
    flex-shrink: 0;
}

.admin-interaction-filter-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding-top: 0.15rem;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.admin-interaction-filter-wrap--row {
    padding: 0.75rem 1rem;
}

.admin-interaction-filter--row {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.65rem 0.75rem;
}

.admin-interaction-filter--row .admin-interaction-filter-field--grow {
    flex: 1 1 12rem;
    min-width: 10rem;
}

.admin-interaction-filter--row .admin-interaction-filter-field--post {
    flex: 0 1 11rem;
    min-width: 9rem;
}

.admin-interaction-filter--row .admin-interaction-filter-field--date {
    flex: 0 0 auto;
    min-width: 9.5rem;
}

.admin-interaction-filter--row .admin-interaction-filter-field--status {
    flex: 0 1 8.5rem;
    min-width: 7.5rem;
}

.admin-interaction-filter-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
    margin-left: auto;
    padding-bottom: 0.05rem;
}

.admin-console-list-wrap .admin-list-toolbar--batch {
    margin-top: 0;
}

@media (max-width: 1100px) {
    .admin-interaction-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-interaction-filter-field--wide {
        grid-column: span 2;
    }
}

@media (max-width: 640px) {
    .admin-interaction-filter-grid {
        grid-template-columns: 1fr;
    }

    .admin-interaction-filter-field--wide {
        grid-column: span 1;
    }

    .admin-interaction-filter--row .admin-interaction-filter-field,
    .admin-interaction-filter--row .admin-interaction-filter-actions {
        flex: 1 1 100%;
        min-width: 0;
        margin-left: 0;
    }
}

body.theme-light .admin-interaction-filter-check {
    background: rgba(255, 255, 255, 0.9);
}

body.theme-light .admin-comment-row-new {
    background: rgba(79, 70, 229, 0.06);
}

body.theme-light .admin-comment-alert {
    border-color: rgba(245, 158, 11, 0.4);
}

.admin-batch-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.admin-batch-actions .btn {
    padding: 0.34rem 0.55rem;
    font-size: 0.75rem;
}

.console-dashboard-page,
.console-overview-page,
.console-admin-page {
    width: min(1400px, calc(100vw - 280px - 1rem));
}

.console-overview-page,
.console-admin-page {
    display: grid;
    gap: 0.75rem;
}

.overview-page-head {
    padding: 0.15rem 0.1rem 0.05rem;
}

.overview-page-head h1 {
    margin: 0.12rem 0 0.28rem;
    font-size: 1.35rem;
    line-height: 1.2;
}

.overview-page-head .hero-kicker {
    margin: 0;
}

.overview-page-head .muted {
    margin: 0;
    font-size: 0.84rem;
}

.overview-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
}

.overview-kpi-card {
    padding: 0.9rem 1rem;
    border-radius: 16px;
    min-height: 6.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.overview-kpi-label {
    margin: 0;
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 600;
}

.overview-kpi-value {
    margin: 0.3rem 0 0.18rem;
    font-size: 1.65rem;
    line-height: 1.05;
    font-weight: 800;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}

.overview-kpi-hint {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.45;
    color: #64748b;
}

.overview-kpi-alert {
    color: #dc2626;
    font-weight: 700;
}

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

.overview-period-card {
    padding: 0.95rem 1rem 1rem;
    border-radius: 16px;
    min-width: 0;
}

.overview-period-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.overview-period-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.overview-period-range {
    margin: 0;
    font-size: 0.78rem;
    white-space: nowrap;
}

.overview-period-metrics {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
}

.overview-period-metrics li {
    padding: 0.55rem 0.6rem;
    border: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.28rem;
    min-width: 0;
}

.overview-period-metrics span {
    font-size: 0.74rem;
    font-weight: 600;
    color: #64748b;
}

.overview-period-metrics strong {
    font-size: 1.2rem;
    font-weight: 800;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}

.overview-period-note {
    margin: 0.65rem 0 0;
    font-size: 0.74rem;
    line-height: 1.45;
}

/* 主面板区：统一 2 列网格，同行等高 */
.overview-board {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    align-items: stretch;
}

.overview-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    padding: 0;
    overflow: hidden;
}

.overview-panel--content,
.overview-panel--ranks {
    min-height: 0;
}

.overview-panel--list {
    min-height: 16.5rem;
}

.overview-rank-duo {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    flex: 1;
    min-height: 0;
    height: 100%;
}

.overview-rank-col {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.overview-rank-col .overview-subtitle {
    margin: 0 0 0.15rem;
}

.overview-rank-col .overview-rank-list {
    flex: 1;
}

.overview-rank-col .overview-empty-state {
    min-height: 5.5rem;
    flex: 1;
}

.overview-subtitle--spaced {
    margin-top: 0.85rem;
}

.overview-category-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
    gap: 0.45rem;
    max-height: 9.5rem;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.overview-category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.45rem;
    padding: 0.4rem 0.55rem;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(255, 255, 255, 0.58);
    font-size: 0.8rem;
}

.overview-category-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #334155;
    font-weight: 600;
}

.overview-category-item strong {
    flex-shrink: 0;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}

.overview-panel--recent {
    min-height: 0;
}

.overview-feed-duo {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    min-height: 0;
}

.overview-feed-col {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.overview-feed-col .overview-subtitle {
    margin: 0 0 0.15rem;
}

.overview-feed-col .overview-feed-list {
    flex: 1;
}

.overview-feed-col .overview-empty-state {
    min-height: 5.5rem;
    flex: 1;
}

.overview-panel-head {
    flex-shrink: 0;
    margin: 0;
    padding: 0.85rem 1rem 0.7rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.overview-panel-head h2 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
}

.overview-panel-body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0.85rem 1rem;
    display: flex;
    flex-direction: column;
}

.overview-panel-body--scroll {
    overflow-y: auto;
    overscroll-behavior: contain;
}

.overview-panel-foot {
    flex-shrink: 0;
    margin-top: auto;
    padding: 0.65rem 1rem 0.85rem;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.9rem;
    background: color-mix(in srgb, var(--primary) 3%, rgba(248, 250, 252, 0.65));
}

.overview-panel-foot .text-link {
    font-size: 0.82rem;
    font-weight: 600;
}

.overview-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
}

.overview-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.32rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.72);
    font-size: 0.78rem;
    color: #64748b;
    white-space: nowrap;
}

.overview-chip strong {
    color: #0f172a;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.overview-split-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    flex: 1;
}

.overview-split-block--categories .overview-stat-list--scroll {
    max-height: 11.5rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 0.15rem;
}

.overview-split-block--categories .overview-stat-list li > span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.overview-split-block--categories .overview-empty-state {
    min-height: 6.5rem;
    margin: 0;
}

.overview-split-block {
    padding: 0.75rem 0.8rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.58);
    min-width: 0;
}

.overview-split-title {
    margin: 0 0 0.5rem;
    font-size: 0.84rem;
    font-weight: 700;
    color: #334155;
}

.overview-stat-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.38rem;
}

.overview-stat-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 0.75rem;
    font-size: 0.82rem;
    color: #64748b;
}

.overview-stat-list li > span:first-child {
    min-width: 0;
}

.overview-stat-list strong {
    color: #0f172a;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.overview-stat-warn {
    color: #dc2626 !important;
}

.overview-stat-text {
    max-width: 9.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.overview-tag-stats--grow {
    max-height: none;
    flex: 1;
    align-content: flex-start;
}

.overview-subtitle {
    margin: 0.65rem 0 0.45rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569;
}

.overview-tag-stats {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    max-height: 5.5rem;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.overview-tag-stats li {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.overview-tag-stats strong {
    font-size: 0.76rem;
    color: #64748b;
    font-variant-numeric: tabular-nums;
}

.overview-empty-state {
    flex: 1;
    display: grid;
    place-items: center;
    min-height: 7.5rem;
    margin: 0;
    padding: 1rem;
    text-align: center;
    font-size: 0.84rem;
    border-radius: 12px;
    border: 1px dashed rgba(148, 163, 184, 0.35);
    background: rgba(248, 250, 252, 0.65);
}

.overview-rank-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.5rem;
}

.overview-rank-item {
    display: grid;
    grid-template-columns: 1.65rem minmax(0, 1fr);
    gap: 0.55rem;
    align-items: start;
    padding: 0.5rem 0.55rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.overview-rank-num {
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 0.72rem;
    font-weight: 800;
    color: #fff;
    background: color-mix(in srgb, var(--primary) 88%, #312e81);
}

.overview-rank-main {
    min-width: 0;
}

.overview-rank-main a {
    display: block;
    color: #0f172a;
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.overview-rank-meta {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.74rem;
    color: #64748b;
}

.overview-feed-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.5rem;
}

.overview-feed-item {
    padding: 0.55rem 0.65rem;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.58);
}

.overview-feed-head {
    margin: 0 0 0.28rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    font-size: 0.8rem;
}

.overview-feed-head time {
    font-size: 0.74rem;
}

.overview-feed-body {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.5;
    color: #334155;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.overview-feed-ref {
    margin: 0.3rem 0 0;
    font-size: 0.76rem;
}

.overview-feed-ref a {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

body.theme-light .overview-panel-foot {
    background: rgba(248, 250, 252, 0.92);
}

body.theme-light .overview-chip,
body.theme-light .overview-split-block,
body.theme-light .overview-rank-item,
body.theme-light .overview-feed-item {
    background: #fff;
}

.admin-summary-line {
    margin-bottom: 0.55rem;
    padding: 0.65rem 0.9rem;
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 0.55rem;
}

.admin-summary-item {
    padding: 0.55rem 0.7rem;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.66);
    font-size: 0.8rem;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
}

.admin-summary-item strong {
    color: #0f172a;
    font-size: 1.02rem;
    margin-left: 0;
    font-variant-numeric: tabular-nums;
}

.admin-flat-list {
    display: grid;
    gap: 0.25rem;
}

.admin-flat-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto auto 230px;
    align-items: center;
    column-gap: 0.75rem;
    row-gap: 0.35rem;
    padding: 0.52rem 0.4rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.admin-flat-row:last-child {
    border-bottom: 0;
}

.admin-flat-check input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #6366f1;
}

.admin-flat-main h3 {
    margin: 0 0 0.16rem;
    font-size: 0.95rem;
}

.admin-flat-main h3 a {
    color: #0f172a;
}

.admin-flat-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.65rem;
    font-size: 0.76rem;
}

.admin-flat-publish {
    display: flex;
    align-items: center;
    justify-self: start;
}

.admin-flat-time {
    justify-self: start;
    margin-left: 1.25rem;
    padding-left: 0.35rem;
    font-size: 0.78rem;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.publish-switch-form {
    margin: 0;
}

.publish-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
}

.publish-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.publish-slider {
    width: 34px;
    height: 20px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.45);
    position: relative;
    transition: background-color 0.2s ease;
}

.publish-slider::after {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    background: #ffffff;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
}

.publish-switch input:checked + .publish-slider {
    background: rgba(79, 70, 229, 0.85);
}

.publish-switch input:checked + .publish-slider::after {
    transform: translateX(14px);
}

.publish-label {
    font-size: 0.74rem;
    color: #64748b;
    white-space: nowrap;
}

.admin-flat-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.35rem;
}

.admin-flat-actions .btn,
.admin-flat-actions .danger {
    font-size: 0.72rem;
    padding: 0.3rem 0.48rem;
}

.row-more-menu {
    position: relative;
}

.row-more-menu summary {
    list-style: none;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    display: inline-grid;
    place-items: center;
    color: #334155;
    font-weight: 700;
    background: #fff;
}

.row-more-menu summary::-webkit-details-marker {
    display: none;
}

.row-more-menu[open] summary {
    border-color: rgba(99, 102, 241, 0.45);
}

.row-more-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: var(--z-row-menu);
    min-width: 126px;
    padding: 0.3rem;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: #ffffff;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.14);
    display: grid;
    gap: 0.25rem;
}

.row-more-menu.is-up .row-more-panel {
    top: auto;
    bottom: calc(100% + 6px);
}

.row-more-panel .btn,
.row-more-panel .danger {
    width: 100%;
    justify-content: center;
}

.admin-list-head,
.admin-list-row {
    display: grid;
    grid-template-columns: 40px minmax(220px, 2fr) minmax(90px, 0.7fr) 80px 80px 95px 100px 128px minmax(260px, 1.6fr);
    align-items: center;
    gap: 0.7rem;
}

.admin-list-head {
    padding: 0 0.35rem 0.12rem;
    color: #64748b;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
}

.admin-list-row {
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.8);
    padding: 0.58rem 0.72rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.admin-list-row:hover {
    border-color: rgba(99, 102, 241, 0.24);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.admin-list-main h3 {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.3;
}

.admin-list-title-line {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.admin-list-col {
    color: #334155;
    font-weight: 600;
    font-size: 0.8rem;
}

.admin-list-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.admin-list-check input[type="checkbox"],
.admin-list-head input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #6366f1;
}

.mini-chip {
    display: inline-block;
    padding: 0.1rem 0.42rem;
    border-radius: 999px;
    font-size: 0.7rem;
    background: rgba(99, 102, 241, 0.14);
    color: #4338ca;
}

.mini-chip.hot {
    background: rgba(236, 72, 153, 0.14);
    color: #be185d;
}

.admin-list-time {
    white-space: nowrap;
    text-align: left;
    font-variant-numeric: tabular-nums;
}

.admin-list-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.42rem;
}

.admin-list-actions .btn,
.admin-list-actions .danger {
    padding: 0.34rem 0.54rem;
    font-size: 0.75rem;
}

.pagination-wrap {
    margin-top: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
}

.pagination-info {
    font-size: 0.8rem;
    color: #64748b;
}

.pagination-wrap--jump {
    flex-wrap: wrap;
    row-gap: 0.55rem;
}

.pagination-jump {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.pagination-jump-label {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    margin: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
}

.pagination-jump-text {
    font: inherit;
    color: inherit;
}

.pagination-jump-input {
    width: 4rem;
    min-width: 3.25rem;
    padding: 0.38rem 0.42rem;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.38);
    background: rgba(255, 255, 255, 0.95);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: center;
    color: #0f172a;
}

.pagination-jump-submit {
    padding-inline: 0.65rem;
}

.pagination-per-page {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
}

.pagination-per-page-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
}

.pagination-per-page-select {
    min-width: 5.5rem;
    padding: 0.38rem 0.5rem;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.38);
    background: rgba(255, 255, 255, 0.95);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    color: #0f172a;
    cursor: pointer;
}

/* 含「每页条数」时：翻页/跳转居中，每页条数靠右 */
.pagination-wrap--split {
    display: grid;
    grid-template-columns: 1fr minmax(0, max-content) 1fr;
    align-items: center;
    column-gap: 0.75rem;
    row-gap: 0.55rem;
}

.pagination-wrap--split .pagination-wrap-main {
    grid-column: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}

.pagination-wrap--split .pagination-per-page {
    grid-column: 3;
    justify-self: end;
    flex-shrink: 0;
}

.guestbook-messages .pagination-wrap {
    margin-top: 1.15rem;
    padding-top: 0.95rem;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.guestbook-messages .pagination-wrap--split {
    width: 100%;
}

/* 留言板：窄屏紧凑留言 + 分页两行 */
@media (max-width: 860px) {
    .guestbook-messages {
        padding: 0.65rem 0.72rem 0.75rem;
    }

    .guestbook-messages-head {
        margin-bottom: 0.5rem;
        padding-bottom: 0.5rem;
        gap: 0.5rem;
    }

    .guestbook-messages-title {
        font-size: 1rem;
    }

    .guestbook-messages-sub {
        margin-top: 0.12rem;
        font-size: 0.76rem;
    }

    .guestbook-count-pill {
        font-size: 0.72rem;
        padding: 0.18rem 0.45rem;
    }

    .guestbook-message-list {
        gap: 0.38rem;
    }

    .guestbook-message-card {
        border-radius: 10px;
        box-shadow: 0 3px 10px color-mix(in srgb, var(--gb-accent) 5%, rgba(15, 23, 42, 0.04));
    }

    .guestbook-message-card:hover {
        transform: none;
        box-shadow: 0 3px 10px color-mix(in srgb, var(--gb-accent) 5%, rgba(15, 23, 42, 0.04));
    }

    .guestbook-message-meta {
        padding: 0.38rem 0.55rem 0.22rem;
        gap: 0.3rem;
        flex-wrap: nowrap;
    }

    .guestbook-message-author {
        gap: 0.4rem;
        min-width: 0;
    }

    .guestbook-message-avatar {
        width: 28px;
        height: 28px;
        border-radius: 8px;
        font-size: 0.78rem;
        box-shadow: 0 3px 8px color-mix(in srgb, var(--gb-accent) 24%, transparent);
    }

    .guestbook-message-name {
        font-size: 0.84rem;
        line-height: 1.25;
    }

    .guestbook-message-time {
        font-size: 0.66rem;
        flex-shrink: 0;
    }

    .guestbook-message-content {
        margin: 0 0.5rem 0.42rem;
        padding: 0.42rem 0 0.42rem 0.55rem;
        border-radius: 0;
        border-left-width: 2px;
        background: transparent;
        box-shadow: none;
    }

    body.theme-light .guestbook-message-content {
        background: transparent;
    }

    .guestbook-message-text {
        font-size: 0.86rem;
        line-height: 1.48;
    }

    .guestbook-messages .pagination-wrap--guestbook.pagination-wrap--split {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr) minmax(0, 1fr);
        grid-template-rows: auto auto;
        align-items: center;
        column-gap: 0.35rem;
        row-gap: 0.5rem;
        margin-top: 0.55rem;
        padding-top: 0.55rem;
    }

    .guestbook-messages .pagination-wrap--guestbook .pagination-wrap-main {
        display: contents;
    }

    .guestbook-messages .pagination-wrap--guestbook .pagination-wrap-main > a.btn {
        padding: 0.36rem 0.45rem;
        font-size: 0.78rem;
        min-width: 0;
        justify-self: stretch;
        text-align: center;
    }

    .guestbook-messages .pagination-wrap--guestbook .pagination-wrap-main > a:nth-child(1) {
        grid-column: 1;
        grid-row: 1;
    }

    .guestbook-messages .pagination-wrap--guestbook .pagination-info {
        grid-column: 2;
        grid-row: 1;
        justify-self: center;
        text-align: center;
        font-size: 0.72rem;
        line-height: 1.35;
        max-width: 100%;
    }

    .guestbook-messages .pagination-wrap--guestbook .pagination-wrap-main > a:nth-child(3) {
        grid-column: 3;
        grid-row: 1;
    }

    .guestbook-messages .pagination-wrap--guestbook .pagination-jump {
        grid-column: 1 / 3;
        grid-row: 2;
        justify-self: stretch;
        justify-content: center;
        flex-wrap: nowrap;
        gap: 0.32rem;
        min-width: 0;
    }

    .guestbook-messages .pagination-wrap--guestbook .pagination-jump-label {
        font-size: 0.76rem;
        gap: 0.22rem;
    }

    .guestbook-messages .pagination-wrap--guestbook .pagination-jump-input {
        width: 2.75rem;
        min-width: 2.5rem;
        padding: 0.32rem 0.28rem;
        font-size: 0.82rem;
    }

    .guestbook-messages .pagination-wrap--guestbook .pagination-jump-submit {
        padding-inline: 0.5rem;
        font-size: 0.78rem;
    }

    .guestbook-messages .pagination-wrap--guestbook .pagination-per-page {
        grid-column: 3;
        grid-row: 2;
        justify-self: end;
        gap: 0.28rem;
        min-width: 0;
    }

    .guestbook-messages .pagination-wrap--guestbook .pagination-per-page-label {
        font-size: 0.76rem;
        gap: 0.25rem;
    }

    .guestbook-messages .pagination-wrap--guestbook .pagination-per-page-select {
        min-width: 4.6rem;
        padding: 0.32rem 0.35rem;
        font-size: 0.82rem;
    }
}

.console-body .pagination-jump-input {
    background: rgba(255, 255, 255, 0.92);
}

.admin-posts-wrap .pagination-wrap,
.pagination-wrap.admin-list-pagination {
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
    justify-content: flex-end;
    flex-wrap: wrap;
}

.btn.is-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.muted {
    color: #64748b;
    font-size: 0.88rem;
}

.archive-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.9rem;
}

.archive-layout {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    align-items: stretch;
}

.archive-right {
    display: grid;
    gap: 0.75rem;
    min-width: 0;
}

.square-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 72px);
    gap: 0.42rem;
    margin-top: 0.45rem;
    justify-content: start;
}

.square-card {
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: #f1f5f9;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 0.38rem;
    gap: 0.12rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.square-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.10);
}

.square-title {
    font-weight: 700;
    font-size: 0.84rem;
    color: #1e1b4b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

.square-sub {
    font-size: 0.72rem;
    color: rgba(71, 85, 105, 0.88);
}

/* 分类卡片循环配色（柔和底色） */
.square-card:nth-child(6n + 1) {
    background: #dbeafe;
}
.square-card:nth-child(6n + 2) {
    background: #ede9fe;
}
.square-card:nth-child(6n + 3) {
    background: #d1fae5;
}
.square-card:nth-child(6n + 4) {
    background: #fef9c3;
}
.square-card:nth-child(6n + 5) {
    background: #ffe4e6;
}
.square-card:nth-child(6n) {
    background: #e0e7ff;
}

.archive-hero,
.guestbook-hero {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.8rem;
    padding: 0.85rem 1rem;
    margin-bottom: 0.65rem;
}

.guestbook-hero {
    flex-direction: column;
    align-items: flex-start;
}

.guestbook-hero h1 {
    margin: 0.1rem 0 0;
    font-size: 1.2rem;
    line-height: 1.2;
}

.guestbook-hero-desc {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.55;
}

.guestbook-section {
    margin-bottom: 1rem;
}

.guestbook-section .pagination-wrap {
    margin-top: 1rem;
}

/* —— 留言板：留言墙 + 发表区上下分栏 —— */

.guestbook-messages {
    margin-bottom: 1rem;
    padding: 1.15rem 1.2rem 1.2rem;
}

.guestbook-messages-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.guestbook-search-tip {
    margin: 0 0 0.75rem;
    padding: 0.55rem 0.65rem;
    font-size: 0.84rem;
    line-height: 1.5;
    border-radius: 10px;
    background: color-mix(in srgb, var(--primary) 6%, rgba(248, 250, 252, 0.9));
    border: 1px solid color-mix(in srgb, var(--primary) 14%, rgba(148, 163, 184, 0.25));
}

.guestbook-messages-title {
    margin: 0;
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--text);
}

.guestbook-messages-sub {
    margin: 0.28rem 0 0;
    font-size: 0.82rem;
    line-height: 1.45;
}

.guestbook-count-pill {
    flex-shrink: 0;
}

.guestbook-message-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.guestbook-message-card {
    --gb-accent: var(--primary);
    border-radius: 14px;
    border: 1px solid color-mix(in srgb, var(--gb-accent) 22%, rgba(148, 163, 184, 0.32));
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--gb-accent) 9%, rgba(255, 255, 255, 0.94)) 0%,
        rgba(255, 255, 255, 0.9) 58%
    );
    box-shadow: 0 10px 28px color-mix(in srgb, var(--gb-accent) 8%, rgba(15, 23, 42, 0.06));
    overflow: hidden;
    scroll-margin-top: 5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.guestbook-message-card:nth-child(4n + 2) {
    --gb-accent: #0d9488;
}

.guestbook-message-card:nth-child(4n + 3) {
    --gb-accent: #7c3aed;
}

.guestbook-message-card:nth-child(4n) {
    --gb-accent: #e11d48;
}

.guestbook-message-card:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--gb-accent) 38%, rgba(148, 163, 184, 0.35));
    box-shadow: 0 14px 32px color-mix(in srgb, var(--gb-accent) 18%, rgba(15, 23, 42, 0.1));
}

.guestbook-message-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    flex-wrap: wrap;
    padding: 0.65rem 0.9rem 0.5rem;
}

.guestbook-message-author {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.guestbook-message-avatar {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-grid;
    place-items: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(
        145deg,
        var(--gb-accent),
        color-mix(in srgb, var(--gb-accent) 62%, #1e293b)
    );
    box-shadow: 0 6px 16px color-mix(in srgb, var(--gb-accent) 32%, transparent);
}

.guestbook-message-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text);
}

.guestbook-message-time {
    font-size: 0.74rem;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.guestbook-message-content {
    margin: 0 0.75rem 0.85rem;
    padding: 0.95rem 1rem 1rem;
    border-radius: 12px;
    border-left: 4px solid var(--gb-accent);
    background: color-mix(in srgb, var(--gb-accent) 4%, rgba(255, 255, 255, 0.82));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.guestbook-message-text {
    margin: 0;
    font-size: 0.98rem;
    line-height: 1.72;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.guestbook-messages-empty {
    text-align: center;
    padding: 2rem 1rem;
    border-radius: 14px;
    border: 1px dashed color-mix(in srgb, var(--primary) 22%, rgba(148, 163, 184, 0.4));
    background: color-mix(in srgb, var(--primary) 5%, rgba(248, 250, 252, 0.9));
}

.guestbook-messages-empty-title {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.guestbook-compose-panel {
    margin-bottom: 1rem;
    padding: 1.1rem 1.2rem 1.15rem;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.94) 0%,
        color-mix(in srgb, var(--primary) 4%, rgba(248, 250, 252, 0.95)) 100%
    );
}

.guestbook-compose-head {
    margin-bottom: 0.85rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.guestbook-compose-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

.guestbook-compose-sub {
    margin: 0.3rem 0 0;
    font-size: 0.82rem;
    line-height: 1.45;
}

.guestbook-compose-panel .comment-compose {
    margin-bottom: 0;
}

body.theme-light .guestbook-message-card {
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--gb-accent) 7%, #fff) 0%,
        #f8fafc 60%
    );
}

body.theme-light .guestbook-message-content {
    background: color-mix(in srgb, var(--gb-accent) 3%, #fff);
}

body.theme-light .guestbook-compose-panel {
    background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
}

.admin-guestbook-row-hidden {
    opacity: 0.72;
    background: rgba(148, 163, 184, 0.08);
}

.archive-hero h1 {
    margin: 0.1rem 0 0;
    font-size: 1.2rem;
    line-height: 1.2;
}

.archive-hero .hero-kicker {
    margin-bottom: 0.15rem;
    font-size: 0.72rem;
}

.archive-hero-desc {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.88rem;
    white-space: nowrap;
}

.square-card.is-active {
    border-color: color-mix(in srgb, var(--primary) 55%, transparent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 22%, transparent);
}

.square-card.is-active .square-title {
    color: var(--primary);
}

.category-wordcloud {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.42rem 0.55rem;
    margin-top: 0.35rem;
    padding: 0.15rem 0.05rem 0.25rem;
    line-height: 1.2;
}

.archive-categories-panel {
    padding: 0.72rem 0.68rem 0.78rem;
}

.archive-dates-panel,
.archive-calendar-panel {
    padding: 0.72rem 0.68rem 0.78rem;
}

.archive-calendar-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.42rem;
}

.archive-year-form {
    flex: 1;
    min-width: 0;
}

.archive-year-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.archive-year-label > span {
    flex-shrink: 0;
}

.archive-year-select {
    flex: 1;
    min-width: 0;
    width: auto;
    margin: 0;
    padding: 0.34rem 0.4rem;
    border-radius: 9px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    background: rgba(255, 255, 255, 0.95);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    color: #0f172a;
    cursor: pointer;
}

.archive-calendar-all {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    flex-shrink: 0;
    padding: 0.32rem 0.46rem;
    border-radius: 9px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(248, 250, 252, 0.95);
    color: #334155;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.archive-calendar-all:hover {
    border-color: rgba(79, 70, 229, 0.28);
    background: #fff;
}

.archive-calendar-all.is-active {
    border-color: color-mix(in srgb, var(--primary) 55%, transparent);
    background: color-mix(in srgb, var(--primary) 10%, #fff);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 16%, transparent);
    color: var(--primary);
}

.archive-calendar-all-count {
    min-width: 1.45rem;
    padding: 0.08rem 0.36rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #64748b;
    font-size: 0.76rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.archive-calendar-all.is-active .archive-calendar-all-count {
    background: color-mix(in srgb, var(--primary) 14%, #fff);
    color: var(--primary);
}

.archive-calendar {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 16rem;
    overflow-y: auto;
    padding-right: 0.08rem;
    scrollbar-width: thin;
}

.archive-calendar-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.32rem;
}

.archive-calendar-month {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.08rem;
    min-height: 2.55rem;
    padding: 0.2rem 0.1rem;
    border-radius: 8px;
    border: 1px solid transparent;
    text-align: center;
    text-decoration: none;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.archive-calendar-month.has-posts {
    border-color: rgba(148, 163, 184, 0.22);
    background: rgba(248, 250, 252, 0.95);
    color: #334155;
}

.archive-calendar-month.has-posts:hover {
    transform: translateY(-1px);
    border-color: rgba(79, 70, 229, 0.28);
    background: #fff;
    box-shadow: 0 6px 12px rgba(15, 23, 42, 0.06);
}

.archive-calendar-month.is-active {
    border-color: color-mix(in srgb, var(--primary) 55%, transparent);
    background: color-mix(in srgb, var(--primary) 10%, #fff);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 16%, transparent);
}

.archive-calendar-month.is-active .archive-calendar-month-label,
.archive-calendar-month.is-active .archive-calendar-month-count {
    color: var(--primary);
}

.archive-calendar-month.is-empty {
    background: rgba(241, 245, 249, 0.55);
    color: #94a3b8;
    pointer-events: none;
}

.archive-calendar-month-label {
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
}

.archive-calendar-month-count {
    font-size: 0.7rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    color: #64748b;
}

.archive-calendar-empty {
    margin: 0;
    font-size: 0.8rem;
    text-align: center;
}

.archive-sidebar-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.4rem;
    margin-bottom: 0.32rem;
    line-height: 1.2;
}

.archive-sidebar-head h3 {
    margin: 0;
    flex-shrink: 0;
    font-size: 0.95rem;
    line-height: 1.15;
}

.archive-sidebar-hint {
    margin: 0;
    font-size: 0.74rem;
    line-height: 1.25;
    text-align: right;
    white-space: nowrap;
}

.archive-category-cloud {
    justify-content: flex-start;
    gap: 0.34rem 0.4rem;
    padding: 0.06rem 0 0.08rem;
}

.archive-category-cloud .category-cloud-tag {
    padding: 0.16rem 0.34rem 0.16rem 0.38rem;
    gap: 0.24rem;
}

.archive-category-cloud .category-cloud-name {
    max-width: 9rem;
    font-size: 0.92rem;
}

.archive-category-cloud .category-cloud-count {
    font-size: 0.72em;
    min-width: 1.2rem;
    padding: 0.06rem 0.26rem;
}

.archive-category-cloud .category-cloud-tag--all {
    font-size: 0.98rem;
}

.archive-category-cloud .category-cloud-tag--lvl-1 { font-size: 0.86rem; }
.archive-category-cloud .category-cloud-tag--lvl-2 { font-size: 0.9rem; }
.archive-category-cloud .category-cloud-tag--lvl-3 { font-size: 0.94rem; }
.archive-category-cloud .category-cloud-tag--lvl-4 { font-size: 0.99rem; }
.archive-category-cloud .category-cloud-tag--lvl-5 { font-size: 1.04rem; }

.archive-categories-panel .category-wordcloud {
    margin-top: 0;
    padding: 0;
    gap: 0;
}

.category-wordcloud-empty {
    width: 100%;
    margin: 0;
    text-align: center;
}

.category-cloud-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    max-width: 100%;
    padding: 0.18rem 0.42rem 0.18rem 0.5rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(241, 245, 249, 0.92);
    color: #312e81;
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.category-cloud-tag:nth-child(3n + 1) { transform: rotate(-1.5deg); }
.category-cloud-tag:nth-child(3n + 2) { transform: rotate(1deg); }
.category-cloud-tag:nth-child(3n) { transform: rotate(-0.5deg); }

.category-cloud-tag:hover {
    transform: translateY(-1px) scale(1.03) rotate(0deg);
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
}

.category-cloud-tag.is-active {
    border-color: color-mix(in srgb, var(--primary) 58%, transparent);
    background: color-mix(in srgb, var(--primary) 12%, #fff);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 18%, transparent);
}

.category-cloud-tag.is-active .category-cloud-name {
    color: var(--primary);
}

.category-cloud-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 9.5rem;
}

.category-cloud-count {
    flex-shrink: 0;
    min-width: 1.35rem;
    padding: 0.08rem 0.34rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    color: #64748b;
    font-size: 0.68em;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.25;
}

.category-cloud-tag.is-active .category-cloud-count {
    background: color-mix(in srgb, var(--primary) 16%, #fff);
    color: var(--primary);
}

.category-cloud-tag--all {
    font-size: 0.92rem;
}

.category-cloud-tag--lvl-1 { font-size: 0.78rem; }
.category-cloud-tag--lvl-2 { font-size: 0.84rem; }
.category-cloud-tag--lvl-3 { font-size: 0.9rem; }
.category-cloud-tag--lvl-4 { font-size: 0.98rem; }
.category-cloud-tag--lvl-5 { font-size: 1.08rem; }

.category-cloud-tag:nth-child(6n + 1) { background: #dbeafe; }
.category-cloud-tag:nth-child(6n + 2) { background: #ede9fe; }
.category-cloud-tag:nth-child(6n + 3) { background: #d1fae5; }
.category-cloud-tag:nth-child(6n + 4) { background: #fef9c3; }
.category-cloud-tag:nth-child(6n + 5) { background: #ffe4e6; }
.category-cloud-tag:nth-child(6n) { background: #e0e7ff; }

.archive-hero-desc strong {
    color: var(--primary);
    font-weight: 700;
}

.archive-card {
    padding: 0.85rem;
}

.archive-card h3 {
    margin: 0 0 0.35rem;
    font-size: 1rem;
}

.archive-card ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.archive-card li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.45rem 0.55rem;
    align-items: center;
    padding: 0.32rem 0;
    border-bottom: 1px dashed rgba(148, 163, 184, 0.35);
}

.archive-card li span {
    flex-shrink: 0;
    color: #64748b;
    white-space: nowrap;
    font-size: 0.82rem;
}

.archive-card li a {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 0.8rem;
}

.chip-card {
    padding: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
}

.chip-card span {
    color: #1e1b4b;
}

.console-bg {
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.check-row input {
    width: auto;
}

.login-card {
    width: min(460px, 90vw);
    padding: 1.6rem;
}

.table-wrap {
    overflow-x: auto;
}

.admin-posts-wrap {
    overflow: visible;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

th,
td {
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    text-align: left;
    padding: 0.85rem 0.55rem;
    white-space: nowrap;
}

thead th {
    color: #475569;
    font-weight: 600;
    font-size: 0.92rem;
}

.danger {
    background: var(--danger);
}

.flash-wrap {
    display: grid;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.flash {
    padding: 0.72rem 0.85rem;
    border-left: 4px solid transparent;
    transition: opacity 0.28s ease, transform 0.28s ease, margin 0.28s ease, padding 0.28s ease;
}

.flash.success {
    border-left-color: var(--success);
    color: #14532d;
    background: #dcfce7;
}

.flash.error {
    border-left-color: var(--danger);
    color: #7f1d1d;
    background: #fee2e2;
}

.flash.is-dismissing {
    opacity: 0;
    transform: translateY(-6px);
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.site-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 1rem 0 calc(2rem + env(safe-area-inset-bottom, 0px));
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
    color: #cbd5e1;
    text-align: center;
    margin-top: auto;
}

.qa-widget {
    position: fixed;
    right: max(18px, env(safe-area-inset-right, 0px));
    bottom: max(18px, env(safe-area-inset-bottom, 0px));
    z-index: var(--z-floating-widget);
}

.qa-toggle {
    width: 56px;
    height: 56px;
    border-radius: 999px;
    padding: 0;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(148, 163, 184, 0.28);
    box-shadow: 0 14px 26px rgba(15, 23, 42, 0.18);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
    position: relative;
}

.qa-hint {
    position: absolute;
    left: 0;
    top: 0;
    transform: translate(-92%, -92%);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.28);
    color: #334155;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.22rem 0.4rem;
    border-radius: 10px;
    box-shadow: 0 10px 16px rgba(15, 23, 42, 0.12);
    pointer-events: none;
    white-space: nowrap;
}

.qa-hint::after {
    content: "";
    position: absolute;
    right: 12px;
    bottom: -5px;
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.92);
    border-right: 1px solid rgba(148, 163, 184, 0.28);
    border-bottom: 1px solid rgba(148, 163, 184, 0.28);
    rotate: 45deg;
}

.qa-widget:hover .qa-hint {
    opacity: 0.95;
}

.qa-panel.is-open ~ .qa-hint {
    display: none;
}

.qa-toggle img {
    width: 34px;
    height: 34px;
    display: block;
}

.qa-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.22);
}

.qa-toggle:active {
    transform: translateY(0);
}

.qa-panel {
    width: min(360px, 92vw);
    max-height: min(560px, 72vh);
    max-height: min(560px, 72dvh);
    margin-bottom: 0.6rem;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 14px;
    box-shadow: 0 20px 42px rgba(15, 23, 42, 0.2);
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(10px) scale(0.98);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.qa-panel.is-open {
    display: flex;
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.qa-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.qa-head button {
    border: 0;
    background: transparent;
    color: #475569;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 0.2rem;
}

.qa-head button:focus-visible,
.qa-history-head button:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--primary) 45%, transparent);
    outline-offset: 2px;
    border-radius: 6px;
}

.qa-field textarea {
    width: 100%;
    resize: vertical;
    min-height: 78px;
    max-height: 130px;
}

.qa-submit {
    margin-top: 0.55rem;
    width: 100%;
}

.qa-answer {
    margin-top: 0.55rem;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: #f8fafc;
    border-radius: 10px;
    padding: 0.65rem;
    color: #334155;
    font-size: 0.86rem;
    line-height: 1.4;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    flex: 1;
    min-height: 110px;
    max-height: 260px;
    overflow-y: auto;
}

.qa-history-head {
    margin-top: 0.55rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #334155;
    font-size: 0.84rem;
}

.qa-history-head button {
    border: 0;
    background: transparent;
    color: #6366f1;
    cursor: pointer;
    font-size: 0.8rem;
}

.qa-history {
    margin-top: 0.35rem;
    max-height: 160px;
    overflow-y: auto;
    display: grid;
    gap: 0.35rem;
}

.qa-history-item {
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 9px;
    background: #f8fafc;
    text-align: left;
    padding: 0.48rem 0.55rem;
    display: grid;
    gap: 0.2rem;
    color: #334155;
    box-shadow: none;
}

.qa-history-item:hover {
    transform: none;
    box-shadow: none;
    background: #eef2ff;
}

.qa-history-q {
    font-size: 0.82rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qa-history-a {
    font-size: 0.76rem;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qa-empty {
    margin: 0;
    font-size: 0.8rem;
    color: #64748b;
}

.reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.45s ease, transform 0.45s ease;
}

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

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

/* Console layout */
.console-body .main-wrap,
.console-body .site-header,
.console-body .site-footer {
    display: none;
}

.console-layout {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
}

.console-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    padding: 1rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    background: rgba(11, 16, 32, 0.55);
    backdrop-filter: blur(16px);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.console-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.console-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: #f8fafc;
    font-weight: 700;
    text-decoration: none;
}

.console-brand .site-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

.console-brand .logo-text {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.console-brand .logo-title {
    font-size: 0.95rem;
    color: #f8fafc;
    font-weight: 600;
    line-height: 1.2;
}

.console-brand .logo-subtitle {
    font-size: 0.72rem;
    color: #94a3b8;
    line-height: 1.3;
}

body.theme-light .console-brand .logo-title {
    color: #1e293b;
}

body.theme-light .console-brand .logo-subtitle {
    color: #64748b;
}

.icon-btn:focus-visible,
.theme-toggle:focus-visible,
.qa-toggle:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--primary) 55%, #ffffff);
    outline-offset: 2px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    display: inline-grid;
    place-items: center;
    padding: 0;
    transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.icon-btn:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.24);
}

.console-nav {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.console-nav-item {
    display: grid;
    grid-template-columns: 34px 1fr;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.7rem;
    border-radius: 14px;
    color: rgba(226, 232, 240, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.06);
    transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.console-nav-item:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.12);
}

.console-nav-item.is-active {
    color: #ffffff;
    background: color-mix(in srgb, var(--primary) 92%, #1e1b4b);
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 10px 24px color-mix(in srgb, var(--primary) 26%, transparent);
}

.console-nav-icon {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: inline-grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.08);
}

.console-nav-item.is-active .console-nav-icon {
    background: rgba(255, 255, 255, 0.18);
}

.console-sidebar-foot {
    margin-top: auto;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.console-sidebar-foot .text-link {
    color: rgba(226, 232, 240, 0.8);
}

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

.console-topbar {
    position: sticky;
    top: 0;
    z-index: var(--z-console-topbar);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: calc(0.85rem + env(safe-area-inset-top, 0px)) 1.1rem 0.85rem;
    background: rgba(11, 16, 32, 0.42);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.console-topbar-title {
    color: rgba(248, 250, 252, 0.92);
    font-weight: 700;
}

.console-topbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.console-content {
    width: min(1400px, calc(100vw - 280px - 1rem));
    margin: 0 auto;
    padding: 1rem 0.6rem 2rem;
}

.console-hero {
    text-align: left;
    padding: 0.95rem 1.1rem;
    margin-bottom: 0.7rem;
}

.console-hero h1 {
    margin: 0.15rem 0 0.25rem;
    font-size: clamp(1.2rem, 2.2vw, 1.5rem);
}

.console-hero .hero-kicker {
    margin-bottom: 0.2rem;
    font-size: 0.72rem;
}

.console-panel {
    padding: 1.35rem;
}

.console-content .stats-grid {
    gap: 0.6rem;
    margin-bottom: 0.65rem;
}

.console-content .stat-card {
    padding: 0.72rem 0.9rem;
}

.console-content .stat-card h3 {
    margin: 0.1rem 0 0;
}

.admin-comment-content {
    white-space: pre-wrap;
}

/* Console editor (topbar + full canvas) */
.editor-shell {
    background: transparent;
}

/* 编辑 / 新建：整页一屏高度，正文过长时在编辑区与预览区内滚动 */
.console-layout:has(.editor-shell--fill) {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
}

.console-layout:has(.editor-shell--fill) .console-main {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.console-content:has(.editor-shell--fill) {
    flex: 1;
    min-height: 0;
    width: min(1400px, calc(100vw - 280px - 1rem));
    margin: 0 auto;
    padding: 0.65rem 0.6rem calc(0.65rem + env(safe-area-inset-bottom, 0px));
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.console-layout.is-collapsed:has(.editor-shell--fill) .console-content:has(.editor-shell--fill) {
    width: min(1400px, calc(100vw - 84px - 1rem));
}

.console-content:has(.editor-shell--fill) > .flash-wrap {
    flex-shrink: 0;
}

.editor-shell.editor-shell--fill {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor-shell.editor-shell--fill .editor-form {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    overflow: hidden;
}

.editor-shell.editor-shell--fill .editor-topbar {
    position: relative;
    top: auto;
    flex-shrink: 0;
}

.editor-shell.editor-shell--fill .md-toolbar {
    position: relative;
    top: auto;
    flex-shrink: 0;
}

.editor-shell.editor-shell--fill .editor-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    align-items: stretch;
}

.editor-shell.editor-shell--fill .editor-textarea {
    min-height: 0;
    height: 100%;
    max-height: none;
    resize: none;
    overflow: auto;
}

.editor-shell.editor-shell--fill .editor-form:not(.is-html) .editor-preview:not([hidden]) {
    min-height: 0;
    max-height: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor-shell.editor-shell--fill .editor-preview-content {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

@media (max-width: 980px) {
    .console-content:has(.editor-shell--fill) {
        width: min(1400px, calc(100vw - 1rem));
    }
}

.editor-form {
    display: grid;
    gap: 0.6rem;
}

.editor-topbar {
    position: sticky;
    top: 0;
    z-index: var(--z-editor-topbar);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.6rem 0.8rem;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(14px);
}

.md-toolbar {
    position: sticky;
    top: 72px;
    z-index: var(--z-editor-sticky);
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.5rem 0.6rem;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(14px);
}

.md-toolbar[hidden] {
    display: none !important;
}

.md-btn {
    height: 32px;
    width: 36px;
    padding: 0;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.92);
    color: #0f172a;
    font-size: 0.8rem;
    font-weight: 600;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
    display: inline-grid;
    place-items: center;
}

.md-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.md-divider {
    width: 1px;
    height: 18px;
    background: rgba(148, 163, 184, 0.35);
    margin: 0 0.2rem;
}

.md-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 16px rgba(15, 23, 42, 0.08);
    border-color: rgba(99, 102, 241, 0.25);
}

body.theme-light .md-toolbar {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(148, 163, 184, 0.22);
}

.editor-left {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

.editor-title {
    font-weight: 800;
    color: #0f172a;
    white-space: nowrap;
}

.editor-right {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

.editor-input {
    border-radius: 12px;
    padding: 0.45rem 0.65rem;
}

.editor-left .editor-input {
    width: min(560px, 46vw);
}

.editor-select {
    width: auto;
    padding: 0.42rem 0.6rem;
    border-radius: 12px;
}

.editor-format-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.42rem 0.65rem;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid rgba(148, 163, 184, 0.32);
    background: rgba(255, 255, 255, 0.72);
}

.editor-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.8rem;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.72);
}

.editor-meta .editor-input {
    width: min(420px, 38vw);
}

.editor-upload {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.36rem 0.6rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(255, 255, 255, 0.9);
    color: #475569;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.editor-upload input[type="file"] {
    display: none;
}

/* Native <dialog> confirm (destructive / batch actions) */
.confirm-dialog {
    width: min(420px, calc(100vw - 2rem - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
    max-width: 100%;
    margin: auto;
    border: 0;
    padding: 0;
    background: transparent;
}

.confirm-dialog::backdrop {
    background: rgba(15, 23, 42, 0.5);
}

.confirm-dialog-panel {
    padding: 1.2rem 1.25rem;
}

.confirm-dialog-title {
    margin: 0 0 0.65rem;
    font-size: 1.08rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.25;
    text-wrap: balance;
}

.confirm-dialog-desc {
    margin: 0 0 1.1rem;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text-soft);
    text-wrap: pretty;
}

.confirm-dialog-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
}

body.theme-light .confirm-dialog::backdrop {
    background: rgba(15, 23, 42, 0.35);
}

.editor-settings-modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal-backdrop);
    pointer-events: none;
}

.editor-settings-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.38);
    backdrop-filter: blur(2px);
    pointer-events: auto;
}

.editor-settings-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    width: min(560px, 92vw);
    transform: translate(-50%, -50%);
    border-radius: 16px;
    overflow: hidden;
    z-index: var(--z-modal-panel);
    pointer-events: auto;
}

.editor-settings-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(248, 250, 252, 0.9);
}

.editor-settings-body {
    display: grid;
    gap: 0.6rem;
    padding: 0.8rem;
}

.editor-settings-body .tool-actions {
    justify-content: center;
}

.editor-field {
    display: grid;
    gap: 0.28rem;
}

.editor-field-label {
    display: inline-block;
    width: max-content;
    font-size: 0.82rem;
    font-weight: 600;
    color: #334155;
}

.editor-settings-toggles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.editor-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.52rem 0.62rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(248, 250, 252, 0.86);
    color: #334155;
    font-size: 0.84rem;
    font-weight: 600;
}

.editor-toggle input {
    width: 15px;
    height: 15px;
    accent-color: #6366f1;
}

.editor-combobox {
    position: relative;
}

.editor-combobox .editor-input {
    padding-right: 2.2rem;
}

.editor-combobox-toggle {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(255, 255, 255, 0.92);
    color: #334155;
    padding: 0;
    display: inline-grid;
    place-items: center;
}

.editor-combobox-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: var(--z-combobox-menu);
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.14);
    max-height: 210px;
    overflow-y: auto;
    padding: 0.25rem;
    display: grid;
    gap: 0.18rem;
}

.editor-combobox-menu[hidden] {
    display: none !important;
}

.editor-combobox-option {
    width: 100%;
    text-align: left;
    background: transparent;
    color: #0f172a;
    border: 0;
    border-radius: 8px;
    padding: 0.42rem 0.5rem;
    font-size: 0.86rem;
    font-weight: 500;
}

.editor-combobox-option:hover {
    background: rgba(99, 102, 241, 0.1);
}

.editor-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
}

.editor-textarea {
    min-height: calc(100vh - 340px);
    min-height: calc(100dvh - 340px);
    resize: vertical;
    border-radius: 14px;
    padding: 0.9rem 1rem;
    line-height: 1.65;
}

.editor-preview {
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(255, 255, 255, 0.9);
    overflow: hidden;
}

.editor-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding: 0.55rem 0.7rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.editor-preview-content {
    padding: 0.8rem 0.9rem;
}

@media (min-width: 980px) {
    .editor-body {
        grid-template-columns: 1fr 0.9fr;
        align-items: start;
    }
    .editor-preview[hidden] {
        display: none;
    }

    .editor-shell.editor-shell--fill .editor-body {
        align-items: stretch;
    }
}

/* Editor mode switching */
.editor-form.is-html .editor-body {
    grid-template-columns: 1fr;
}

.editor-form.is-html .editor-preview {
    display: none;
}

.editor-form.is-html [data-editor-preview] {
    opacity: 0.6;
    pointer-events: none;
}

body.theme-light .editor-topbar,
body.theme-light .editor-meta {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(148, 163, 184, 0.22);
}

/* Sidebar collapsed (desktop) */
.console-layout.is-collapsed {
    grid-template-columns: 84px 1fr;
}

.console-layout.is-collapsed .console-brand-text,
.console-layout.is-collapsed .console-nav-text {
    display: none;
}

.console-layout.is-collapsed .console-nav-item {
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0.55rem;
}

.console-layout.is-collapsed .console-nav-icon {
    background: rgba(255, 255, 255, 0.1);
}

.console-layout.is-collapsed .console-nav-item.is-active {
    background: color-mix(in srgb, var(--primary) 92%, #1e1b4b);
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 8px 18px color-mix(in srgb, var(--primary) 22%, transparent);
}

.console-layout.is-collapsed .console-nav-item.is-active .console-nav-icon {
    background: rgba(255, 255, 255, 0.22);
}

.console-layout.is-collapsed .console-content {
    width: min(1400px, calc(100vw - 84px - 1rem));
}

/* Mobile drawer */
.console-scrim {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(2px);
    z-index: var(--z-console-scrim);
}

@media (max-width: 980px) {
    .console-layout {
        grid-template-columns: 1fr;
    }

    .console-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: min(320px, 86vw);
        transform: translateX(-110%);
        transition: transform 0.22s ease;
        z-index: var(--z-console-drawer);
        padding-top: calc(1rem + env(safe-area-inset-top, 0px));
    }

    .console-layout.is-open .console-sidebar {
        transform: translateX(0);
    }

    .console-sidebar-close {
        display: inline-grid;
    }

    .console-content {
        width: min(1100px, 92vw);
        padding: 1.2rem 0 2.5rem;
    }
}

@media (min-width: 981px) {
    .console-sidebar-close {
        display: none;
    }

    .console-sidebar-toggle {
        display: none;
    }
}

body.theme-light {
    /* 亮色模式：覆盖回白卡深字（深色模式 :root 已改为深卡浅字） */
    --surface: rgba(255, 255, 255, 0.9);
    --surface-strong: #ffffff;
    --border: rgba(148, 163, 184, 0.25);
    --text: #111827;
    --text-soft: #475569;
    background-color: #f8fafc;
    background-image: radial-gradient(
        ellipse 115% 65% at 50% -12%,
        color-mix(in srgb, var(--primary) 16%, transparent) 0%,
        transparent 56%
    );
}

body.theme-light .site-header {
    background: rgba(255, 255, 255, 0.68);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

body.theme-light .logo {
    color: #111827;
}

body.theme-light .main-nav a {
    color: #475569;
}

body.theme-light .main-nav a:hover {
    color: #111827;
    background: rgba(99, 102, 241, 0.1);
}

body.theme-light .main-nav {
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(148, 163, 184, 0.22);
}

body.theme-light .main-nav a.is-active {
    color: #ffffff;
    background: color-mix(in srgb, var(--primary) 92%, #1e1b4b);
    box-shadow: 0 6px 14px color-mix(in srgb, var(--primary) 28%, transparent);
}

body.theme-light .sidebar {
    background: rgba(248, 250, 252, 0.85);
    border-right-color: rgba(148, 163, 184, 0.12);
}

body.theme-light .sidebar-head .logo {
    color: #111827;
}

body.theme-light .sidebar-nav a {
    color: #64748b;
}

body.theme-light .sidebar-nav a:hover {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

body.theme-light .sidebar-nav a.is-active {
    color: var(--primary);
    background: transparent;
}

body.theme-light .sidebar-hot-head {
    color: #64748b;
}

body.theme-light .sidebar-hot .mobile-drawer-hot-link:hover {
    background: rgba(255, 255, 255, 0.6);
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

body.theme-light .sidebar-hot .mobile-drawer-hot-title {
    color: #64748b;
}

body.theme-light .sidebar-hot .mobile-drawer-hot-meta {
    color: #94a3b8;
}

body.theme-light .sidebar-links-head {
    color: #64748b;
}

body.theme-light .sidebar-link-item {
    color: #64748b;
}

body.theme-light .sidebar-link-item:hover {
    background: rgba(255, 255, 255, 0.6);
    color: var(--primary);
}

body.theme-light .right-sidebar .right-sidebar-section {
    background: transparent;
    border-color: transparent;
}

body.theme-light .right-sidebar .archive-sidebar-head h3 {
    color: #64748b;
}

body.theme-light .right-sidebar .archive-calendar-cell {
    color: #64748b;
}

body.theme-light .right-sidebar .archive-calendar-cell.is-active {
    background: transparent;
    color: var(--primary);
}

body.theme-light .right-sidebar {
    scrollbar-color: rgba(148, 163, 184, 0.4) transparent;
}

body.theme-light .sidebar-search-form {
    border-color: rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.6);
}

body.theme-light .sidebar-search-form:focus-within {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 2.5px rgba(59, 130, 246, 0.12);
}

body.theme-light .sidebar-search-form input {
    color: #1e293b;
}

body.theme-light .sidebar-search-submit {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

body.theme-light .sidebar-search-submit:hover {
    background: rgba(59, 130, 246, 0.18);
    color: #2563eb;
}

body.theme-light .sidebar-search-form input::placeholder {
    color: #94a3b8;
}

body.theme-light .sidebar-search-submit {
    color: #94a3b8;
}

body.theme-light .sidebar-search-submit:hover {
    color: #3b82f6;
}

body.theme-light .theme-toggle {
    border-color: rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.86);
    color: #1e293b;
}

body.theme-light .mobile-theme-toggle {
    background: rgba(255, 255, 255, 0.38);
    color: #64748b;
    box-shadow:
        0 4px 16px rgba(148, 163, 184, 0.12),
        0 2px 6px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        inset 0 -1px 0 rgba(0, 0, 0, 0.04);
}

body.theme-light .mobile-theme-toggle:hover {
    background: rgba(255, 255, 255, 0.55);
    color: #3b82f6;
    box-shadow:
        0 8px 24px rgba(59, 130, 246, 0.15),
        0 4px 10px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        inset 0 -1px 0 rgba(0, 0, 0, 0.04);
}

body.theme-light .mobile-theme-toggle:active {
    background: rgba(255, 255, 255, 0.28);
    color: #3b82f6;
}

body.theme-light .site-footer {
    color: #64748b;
    border-top-color: rgba(148, 163, 184, 0.25);
}

body.theme-light .console-sidebar {
    background: rgba(255, 255, 255, 0.72);
    border-right: 1px solid rgba(148, 163, 184, 0.22);
}

body.theme-light .console-topbar {
    background: rgba(255, 255, 255, 0.68);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

body.theme-light .console-brand,
body.theme-light .console-topbar-title {
    color: #0f172a;
}

body.theme-light .icon-btn {
    border-color: rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.86);
    color: #1e293b;
}

body.theme-light .icon-btn:hover {
    background: rgba(248, 250, 252, 0.95);
    border-color: rgba(99, 102, 241, 0.3);
}

body.theme-light .console-nav-item {
    color: #475569;
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(148, 163, 184, 0.22);
}

body.theme-light .console-nav-item:hover {
    color: #111827;
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.2);
}

body.theme-light .console-nav-icon {
    background: rgba(148, 163, 184, 0.16);
}

body.theme-light .console-nav-item.is-active {
    color: #ffffff;
    background: color-mix(in srgb, var(--primary) 92%, #1e1b4b);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 8px 18px color-mix(in srgb, var(--primary) 28%, transparent);
}

body.theme-light .console-nav-item.is-active .console-nav-icon {
    background: rgba(255, 255, 255, 0.2);
}

body.theme-light .console-sidebar-foot {
    border-top-color: rgba(148, 163, 184, 0.24);
}

body.theme-light .console-sidebar-foot .text-link {
    color: #64748b;
}

body.theme-light .console-scrim {
    background: rgba(15, 23, 42, 0.28);
}

body.theme-light .admin-list-row {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(148, 163, 184, 0.28);
}

body.theme-light .admin-summary-item strong {
    color: #111827;
}

body.theme-light .admin-summary-item {
    background: rgba(255, 255, 255, 0.86);
    border-color: rgba(148, 163, 184, 0.24);
}

body.theme-light .row-more-menu summary {
    background: #f8fafc;
}

@media (max-width: 860px) {
    body {
        overflow-x: clip;
        max-width: 100vw;
    }

    .site-header {
        padding-left: max(4vw, env(safe-area-inset-left, 0px));
        padding-right: max(4vw, env(safe-area-inset-right, 0px));
        box-sizing: border-box;
        max-width: 100vw;
    }

    .nav-wrap,
    .main-wrap,
    .site-footer {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .main-wrap {
        padding: 1.5rem max(4vw, env(safe-area-inset-left, 0px)) 2.5rem max(4vw, env(safe-area-inset-right, 0px));
        box-sizing: border-box;
        overflow-x: clip;
    }

    .main-wrap > * {
        max-width: 100%;
        min-width: 0;
    }

    .glass-card,
    .hero,
    .card,
    .post-article,
    .comment-section,
    .guestbook-section,
    .flash-wrap,
    .flash,
    .empty-card,
    .result-tip {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .search-form {
        min-width: 0;
        max-width: 100%;
    }

    .comment-section-head {
        flex-wrap: wrap;
        min-width: 0;
    }

    .comment-compose-row {
        flex-direction: column;
        align-items: stretch;
    }

    .comment-field-nick,
    .comment-field-body {
        flex: 1 1 auto;
        width: 100%;
    }

    .comment-compose-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .comment-actions-label-spacer {
        display: none;
    }

    .comment-submit-btn {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .post-article,
    .comment-section {
        padding: 1rem 0.85rem;
        max-width: 100%;
        overflow-x: clip;
    }

    .post-content {
        font-size: 0.94rem;
    }

    .post-content ul,
    .post-content ol {
        padding-left: 1.1rem;
    }

    .post-content table {
        font-size: 0.82rem;
    }

    .post-content th,
    .post-content td {
        padding: 0.35rem 0.45rem;
    }

    .post-content pre {
        padding: 0.75rem;
        font-size: 0.8rem;
    }

    .nav-wrap {
        min-height: auto;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        column-gap: 0.5rem;
        row-gap: 0.6rem;
        padding: 0.65rem 0 0.8rem;
    }

    .nav-actions {
        display: contents;
    }

    .logo {
        grid-column: 1;
        grid-row: 1;
        min-width: 0;
    }

    .theme-toggle {
        grid-column: 2;
        grid-row: 1;
        align-self: center;
        justify-self: end;
        width: 36px;
        height: 36px;
    }

    .main-nav {
        position: static;
        transform: none;
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        display: flex;
        justify-content: center;
        padding: 0.32rem 0.35rem;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.14);
        border: 1px solid rgba(255, 255, 255, 0.16);
    }

    .main-nav a {
        flex: 1 1 0;
        width: auto;
        min-width: 0;
        max-width: none;
        flex-direction: column;
        gap: 0.16rem;
        font-size: 0.8rem;
        padding: 0.4rem 0.35rem 0.34rem;
    }

    .nav-search-row {
        grid-column: 1 / -1;
        grid-row: 3;
        display: flex;
        align-items: center;
        gap: 0;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.92);
        border: 1px solid rgba(148, 163, 184, 0.34);
        backdrop-filter: blur(8px);
        box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
        overflow: hidden;
    }

    .nav-search-row .search-form {
        flex: 1 1 0;
        min-width: 0;
        width: auto;
        max-width: none;
        border: none;
        background: transparent;
        backdrop-filter: none;
        box-shadow: none;
        padding: 0.24rem 0.28rem 0.24rem 0.5rem;
    }

    .nav-search-row .search-form input {
        min-width: 0;
        width: auto;
    }

    .logo > span:last-child {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .archive-nav-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        align-self: stretch;
        min-width: 3.1rem;
        padding: 0 0.65rem;
        border: none;
        border-left: 1px solid rgba(148, 163, 184, 0.28);
        border-radius: 0;
        background: transparent;
        color: var(--primary);
        font-size: 0.76rem;
        font-weight: 700;
        cursor: pointer;
        box-shadow: none;
        transition: background 0.18s ease, color 0.18s ease;
    }

    .archive-nav-btn:hover {
        background: rgba(148, 163, 184, 0.1);
        color: color-mix(in srgb, var(--primary) 80%, black);
        transform: none;
        box-shadow: none;
    }

    .archive-nav-btn:active {
        background: rgba(148, 163, 184, 0.16);
    }

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

    .home-hot-sidebar {
        display: none !important;
    }

    .archive-right {
        display: none !important;
    }

    .archive-hero-desc-mobile {
        display: inline;
    }

    .archive-hero-desc-desktop {
        display: none;
    }

    .archive-layout,
    .archive-left,
    .archive-grid,
    .archive-card {
        min-width: 0;
        max-width: 100%;
    }

    .hero {
        padding: 1.45rem 1rem;
    }

    .two-cols,
    .hero-banner {
        grid-template-columns: 1fr;
    }

    .admin-filter {
        grid-template-columns: 1fr;
    }

    .admin-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-toolbar-left {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-toolbar-filters {
        flex-wrap: wrap;
        width: 100%;
    }

    .admin-toolbar-filter-fields,
    .admin-toolbar-search {
        width: 100%;
        max-width: none;
    }

    .admin-toolbar-filter-fields {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.45rem;
    }

    .admin-list-filter-select,
    .admin-category-filter {
        width: 100%;
        max-width: none;
    }

    .admin-search input[type="search"] {
        width: 100%;
    }

    .console-dashboard-page,
    .console-overview-page,
    .console-admin-page {
        width: 100%;
    }

    .overview-kpi-grid {
        grid-template-columns: 1fr 1fr;
    }

    .overview-period-grid {
        grid-template-columns: 1fr;
    }

    .overview-period-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .overview-board {
        grid-template-columns: 1fr;
    }

    .overview-rank-duo,
    .overview-feed-duo {
        grid-template-columns: 1fr;
    }

    .overview-category-grid {
        grid-template-columns: 1fr 1fr;
        max-height: none;
    }

    .overview-split-stats {
        grid-template-columns: 1fr;
    }

    .admin-summary-line {
        grid-template-columns: 1fr;
    }

    .admin-flat-row {
        grid-template-columns: 1fr;
        gap: 0.45rem;
    }

    .admin-flat-publish,
    .admin-flat-time,
    .admin-flat-actions {
        justify-self: start;
    }

    .admin-flat-time {
        margin-left: 0;
        padding-left: 0;
    }

    .row-more-panel {
        right: auto;
        left: 0;
    }

    .admin-list-head {
        display: none;
    }

    .admin-list-row {
        grid-template-columns: 1fr;
        gap: 0.48rem;
    }

    .admin-list-main h3 {
        font-size: 0.95rem;
    }

    .admin-list-col {
        font-size: 0.8rem;
    }

    .admin-list-time {
        white-space: normal;
    }

    .admin-list-actions {
        justify-content: flex-start;
    }

    .pagination-wrap:not(.content-layout-pagination):not(.admin-list-pagination) {
        justify-content: space-between;
    }

    .pagination-wrap--split {
        grid-template-columns: 1fr;
    }

    .pagination-wrap--split .pagination-wrap-main {
        grid-column: 1;
        width: 100%;
    }

    .pagination-wrap--split .pagination-per-page {
        grid-column: 1;
        justify-self: end;
        width: 100%;
    }

    .archive-hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
        min-width: 0;
        padding: 0.85rem 0.9rem;
    }

    .archive-hero-desc {
        white-space: normal;
        word-break: break-word;
        overflow-wrap: anywhere;
        line-height: 1.55;
    }

    .archive-layout,
    .archive-left,
    .archive-grid,
    .archive-card {
        min-width: 0;
        max-width: 100%;
    }

    .archive-card li span {
        font-size: 0.78rem;
    }

    .square-grid {
        grid-template-columns: repeat(auto-fill, 84px);
    }

    /* ── Mobile nav: hide desktop nav, show floating button + left drawer ── */
    .main-nav {
        display: none !important;
    }

    .nav-search-row {
        display: none !important;
    }

    .sidebar {
        display: none !important;
    }

    .right-sidebar {
        display: none !important;
    }

    .content-wrapper {
        display: block;
        width: 100%;
        padding-left: 0;
    }

    /* ── Floating action button group ── */
    .mobile-nav-btn-group {
        position: fixed;
        bottom: 110px;
        right: 18px;
        z-index: calc(var(--z-floating-widget) + 2);
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    .mobile-nav-btn {
        display: inline-flex;
        width: 50px;
        height: 50px;
        border-radius: 0;
        border: none;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.28);
        color: #3b82f6;
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.9),
            inset 0 -1px 0 rgba(0, 0, 0, 0.04);
        backdrop-filter: blur(32px) saturate(2.0);
        -webkit-backdrop-filter: blur(32px) saturate(2.0);
        cursor: pointer;
        padding: 0;
        transition: background 0.22s ease;
    }

    .mobile-nav-btn:first-child {
        border-radius: 14px 14px 0 0;
        box-shadow:
            0 2px 8px rgba(0, 0, 0, 0.08),
            inset 0 1px 0 rgba(255, 255, 255, 0.9),
            inset 0 -1px 0 rgba(0, 0, 0, 0.04);
    }

    .mobile-nav-btn:last-child {
        border-radius: 0 0 14px 14px;
        box-shadow:
            0 2px 8px rgba(0, 0, 0, 0.08),
            0 0 0 1px rgba(255, 255, 255, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.9);
    }

    .mobile-nav-btn:hover {
        background: rgba(255, 255, 255, 0.40);
    }

    .mobile-nav-btn:active {
        background: rgba(255, 255, 255, 0.18);
    }

    .mobile-nav-btn.mobile-right-btn {
        color: #64748b;
    }

    .mobile-nav-btn.mobile-right-btn:hover {
        color: #3b82f6;
    }

    .mobile-nav-btn svg {
        width: 22px;
        height: 22px;
    }

    /* ── Mobile nav drawer ── */
    .mobile-nav-drawer {
        position: fixed;
        inset: 0;
        z-index: calc(var(--z-front-drawer) + 4);
        display: block;
        visibility: hidden;
        pointer-events: none;
        transition: visibility 0s 0.3s;
    }

    .mobile-nav-drawer[hidden] {
        display: block;
    }

    .mobile-nav-drawer.is-open {
        visibility: visible;
        pointer-events: auto;
        transition: visibility 0s;
    }

    /* Backdrop overlay */
    .mobile-nav-drawer::before {
        content: "";
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.20);
        backdrop-filter: blur(2px);
        opacity: 0;
        transition: opacity 0.3s ease;
        pointer-events: none;
    }

    .mobile-nav-drawer.is-open::before {
        opacity: 1;
        pointer-events: auto;
    }

    /* Glass panel */
    .mobile-nav-drawer-panel {
        position: fixed;
        top: 12px;
        left: 12px;
        bottom: 12px;
        width: 272px;
        max-width: calc(80vw - 24px);
        display: flex;
        flex-direction: column;
        transform: translateX(-110%);
        transition: transform 0.3s ease-in-out;
        overflow-y: auto;
        background: rgba(255, 255, 255, 0.38);
        backdrop-filter: blur(36px) saturate(2.0);
        -webkit-backdrop-filter: blur(36px) saturate(2.0);
        border-radius: 20px;
        box-shadow:
            inset 1px 0 0 rgba(255, 255, 255, 0.9),
            inset 0 0 0 1px rgba(255, 255, 255, 0.5),
            8px 0 48px rgba(59, 130, 246, 0.06),
            0 0 0 1px rgba(255, 255, 255, 0.4);
    }

    .mobile-nav-drawer.is-open .mobile-nav-drawer-panel {
        transform: translateX(0);
    }

    .mobile-right-drawer .mobile-nav-drawer-panel {
        left: auto;
        right: 12px;
        transform: translateX(110%);
    }

    .mobile-right-drawer.is-open .mobile-nav-drawer-panel {
        transform: translateX(0);
    }

    .mobile-nav-drawer-footer {
        display: flex;
        flex-direction: column;
        padding: 1rem;
        flex-shrink: 0;
        margin-top: auto;
    }

    .mobile-nav-drawer-footer .mobile-theme-toggle {
        align-self: flex-end;
    }

    .mobile-theme-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        font-size: 1.25rem;
        border-radius: 14px;
        border: none;
        background: rgba(255, 255, 255, 0.28);
        color: #64748b;
        box-shadow:
            0 4px 16px rgba(59, 130, 246, 0.08),
            0 2px 6px rgba(0, 0, 0, 0.04),
            inset 0 1px 0 rgba(255, 255, 255, 0.9),
            inset 0 -1px 0 rgba(0, 0, 0, 0.04);
        backdrop-filter: blur(32px) saturate(2.0);
        -webkit-backdrop-filter: blur(32px) saturate(2.0);
        outline: 1.5px solid rgba(255, 255, 255, 0.5);
        outline-offset: 2px;
        cursor: pointer;
        transition: all 0.22s ease;
    }

    .mobile-theme-toggle:hover {
        background: rgba(255, 255, 255, 0.40);
        color: #3b82f6;
        box-shadow:
            0 8px 24px rgba(59, 130, 246, 0.12),
            0 4px 10px rgba(0, 0, 0, 0.06),
            inset 0 1px 0 rgba(255, 255, 255, 0.9),
            inset 0 -1px 0 rgba(0, 0, 0, 0.04);
        transform: translateY(-2px);
    }

    .mobile-theme-toggle:active {
        background: rgba(255, 255, 255, 0.18);
        color: #3b82f6;
        transform: scale(0.95);
        box-shadow:
            0 4px 12px rgba(59, 130, 246, 0.06),
            0 1px 4px rgba(0, 0, 0, 0.04),
            inset 0 1px 0 rgba(255, 255, 255, 0.7),
            inset 0 -1px 0 rgba(0, 0, 0, 0.04);
    }

    /* Header */
    .mobile-nav-drawer-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 1.1rem 1rem 0.7rem;
        flex-shrink: 0;
    }

    .mobile-nav-drawer-head .logo {
        font-size: 1rem;
        color: #1e293b;
    }

    .mobile-nav-drawer-head .logo-text {
        gap: 0.25rem;
        padding-left: 0.5rem;
    }

    .mobile-nav-drawer-head .logo-title {
        font-size: 1rem;
        color: #1e293b;
        font-weight: 600;
    }

    .mobile-nav-drawer-title {
        font-size: 1rem;
        font-weight: 600;
        color: #1e293b;
    }

    .mobile-nav-drawer-section-head {
        font-size: 0.85rem;
        font-weight: 600;
        color: #64748b;
        margin: 0 0 0.5rem;
        padding: 0 0.5rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .mobile-nav-drawer-toc {
        padding: 0.5rem;
        border-bottom: 1px solid rgba(148, 163, 184, 0.15);
        margin-bottom: 0.5rem;
    }

    .mobile-nav-drawer-toc-nav {
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }

    .mobile-nav-drawer-toc-item {
        display: block;
        padding: 0.4rem 0.6rem;
        border-radius: 8px;
        font-size: 0.88rem;
        color: #475569;
        text-decoration: none;
        transition: background 0.18s ease, color 0.18s ease;
    }

    .mobile-nav-drawer-toc-item:hover {
        background: rgba(59, 130, 246, 0.08);
        color: #3b82f6;
    }

    .mobile-nav-drawer-toc-item.is-active {
        background: rgba(59, 130, 246, 0.12);
        color: #3b82f6;
        font-weight: 600;
    }

    .mobile-nav-drawer-toc-item.toc-level-2 {
        padding-left: 1.2rem;
    }

    .mobile-nav-drawer-toc-item.toc-level-3 {
        padding-left: 1.8rem;
        font-size: 0.82rem;
    }

    .mobile-nav-drawer-right-content {
        flex: 1;
        overflow-y: auto;
        padding: 0 0.5rem 0.5rem;
    }

    .mobile-nav-drawer-section {
        margin-bottom: 1rem;
        padding: 0.75rem;
        background: rgba(255, 255, 255, 0.3);
        border-radius: 12px;
        border: 1px solid rgba(255, 255, 255, 0.4);
    }

    .mobile-nav-drawer-head .logo-subtitle {
        font-size: 0.72rem;
        color: #64748b;
    }

    .mobile-nav-drawer-head .site-avatar {
        width: 48px;
        height: 48px;
    }

    .mobile-nav-drawer-close {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        border: none;
        background: rgba(255, 255, 255, 0.45);
        color: #64748b;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        padding: 0;
        backdrop-filter: blur(12px);
        transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
    }

    .mobile-nav-drawer-close svg {
        width: 16px;
        height: 16px;
        display: block;
    }

    .mobile-nav-drawer-close:hover {
        background: rgba(255, 255, 255, 0.70);
        color: #3b82f6;
        transform: rotate(90deg);
    }

    /* Navigation links — horizontal row */
    .mobile-nav-drawer-links {
        display: flex;
        flex-direction: row;
        gap: 0.35rem;
        padding: 0 0.75rem 0.75rem;
        flex-shrink: 0;
    }

    .mobile-nav-drawer-links a {
        flex: 1 1 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.2rem;
        padding: 0.5rem 0.2rem 0.42rem;
        border-radius: 12px;
        color: #334155;
        font-size: 0.78rem;
        font-weight: 500;
        letter-spacing: 0.01em;
        background: rgba(255, 255, 255, 0.35);
        border: 1px solid rgba(255, 255, 255, 0.4);
        transition:
            background 0.2s ease,
            color 0.2s ease;
    }

    .mobile-nav-drawer-links a svg {
        width: 18px;
        height: 18px;
        display: block;
        flex-shrink: 0;
    }

    .mobile-nav-drawer-links a::before {
        display: none;
    }

    /* Hot posts section inside mobile drawer */
    .mobile-nav-drawer-hot {
        padding: 0.5rem 0.75rem 0.6rem;
    }

    .mobile-nav-drawer-hot-head {
        font-size: 0.78rem;
        font-weight: 700;
        color: #3b82f6;
        letter-spacing: 0.04em;
        margin-bottom: 0.35rem;
    }

    .mobile-links-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.2rem;
    }

    .mobile-nav-drawer-flinks {
        margin-bottom: 0.5rem;
    }

    .mobile-nav-drawer-flinks-head {
        font-size: 0.78rem;
        font-weight: 700;
        color: #3b82f6;
        letter-spacing: 0.04em;
        margin-bottom: 0.3rem;
    }

    .mobile-link-item {
        display: block;
        padding: 0.38rem 0.5rem;
        border-radius: 8px;
        text-decoration: none;
        font-size: 0.84rem;
        font-weight: 500;
        color: #1e293b;
        text-align: center;
        transition: all 0.15s;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-link-item:hover {
        background: rgba(255,255,255,0.06);
        color: var(--primary);
    }

    .mobile-drawer-hot-link {
        display: flex;
        align-items: baseline;
        gap: 0.4rem;
        padding: 0.38rem 0.5rem;
        margin: 0.12rem 0;
        border-radius: 10px;
        text-decoration: none;
        transition: background 0.18s ease;
        color: inherit;
    }

    .mobile-drawer-hot-link:hover {
        background: rgba(255, 255, 255, 0.38);
    }

    .mobile-drawer-hot-title {
        flex: 1 1 auto;
        min-width: 0;
        font-size: 0.84rem;
        font-weight: 500;
        color: #1e293b;
        line-height: 1.4;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-drawer-hot-meta {
        flex: 0 0 auto;
        font-size: 0.72rem;
        color: #94a3b8;
        white-space: nowrap;
    }

    .mobile-drawer-hot-empty {
        font-size: 0.8rem;
        color: #94a3b8;
        text-align: center;
        padding: 0.4rem 0;
    }

    .mobile-nav-drawer-links a:hover {
        background: rgba(255, 255, 255, 0.60);
        color: #1e293b;
    }

    .mobile-nav-drawer-links a.is-active {
        color: #3b82f6;
        background: rgba(255, 255, 255, 0.70);
        border-color: rgba(59, 130, 246, 0.25);
        box-shadow: 0 2px 8px rgba(59, 130, 246, 0.08);
    }

    /* Search area */
    .mobile-nav-drawer-search {
        flex-shrink: 0;
        padding: 0.45rem 0.75rem 0.4rem;
    }

    .mobile-nav-search-form {
        display: flex;
        align-items: center;
        gap: 0;
        border-radius: 12px;
        border: 1px solid rgba(255, 255, 255, 0.5);
        background: rgba(255, 255, 255, 0.50);
        overflow: hidden;
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }

    .mobile-nav-search-form:focus-within {
        border-color: rgba(59, 130, 246, 0.45);
        box-shadow: 0 0 0 2.5px rgba(59, 130, 246, 0.12);
    }

    .mobile-nav-search-submit {
        flex: 0 0 auto;
        width: 36px;
        height: 36px;
        border: none;
        background: rgba(59, 130, 246, 0.08);
        color: #3b82f6;
        cursor: pointer;
        display: inline-grid;
        place-items: center;
        padding: 0;
        border-radius: 0;
        transition: background 0.18s ease, color 0.18s ease;
    }

    .mobile-nav-search-submit:hover {
        background: rgba(59, 130, 246, 0.16);
        color: #2563eb;
    }

    .mobile-nav-search-submit:focus-visible {
        outline: 2px solid rgba(59, 130, 246, 0.5);
        outline-offset: -2px;
    }

    .mobile-nav-search-submit svg {
        width: 16px;
        height: 16px;
        display: block;
    }

    .mobile-nav-search-form input {
        flex: 1;
        min-width: 0;
        border: none;
        background: transparent;
        padding: 0.55rem 0.6rem 0.55rem 0.35rem;
        font-size: 0.88rem;
        color: #1e293b;
        outline: none;
        box-shadow: none;
    }

    .mobile-nav-search-form input::placeholder {
        color: #94a3b8;
    }
}

@media (min-width: 861px) {
    .home-hot-drawer,
    .side-drawer {
        display: none !important;
    }

    .mobile-nav-btn,
    .mobile-nav-drawer {
        display: none !important;
    }
}

body.home-hot-drawer-open,
body.side-drawer-open {
    overflow: hidden;
}

body.home-hot-drawer-open .site-header,
body.side-drawer-open .site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: calc(var(--z-front-drawer) + 2);
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
}

.toc-header {
    margin-bottom: 0.75rem;
}

.toc-header h3 {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: 0.03em;
}

.toc-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.toc-item {
    display: block;
    padding: 0.4rem 0.6rem;
    font-size: 0.82rem;
    color: #64748b;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    line-height: 1.5;
}

.toc-item:hover {
    color: var(--primary);
    background: transparent;
}

.toc-item.is-active {
    color: var(--primary);
    background: transparent;
    font-weight: 600;
    border-left: 2px solid var(--primary);
    padding-left: calc(0.6rem - 2px);
}

.toc-level-2 {
    padding-left: 0.6rem;
}

.toc-level-3 {
    padding-left: 1.2rem;
    font-size: 0.8rem;
}

.toc-level-4,
.toc-level-5,
.toc-level-6 {
    padding-left: 1.8rem;
    font-size: 0.78rem;
}

body.home-hot-drawer-open .main-wrap,
body.side-drawer-open .main-wrap {
    padding-top: var(--site-header-height);
}

.home-hot-drawer:not([hidden]),
.side-drawer:not([hidden]) {
    display: flex !important;
    position: fixed;
    top: var(--site-header-height);
    right: 0;
    bottom: 0;
    left: 0;
    z-index: var(--z-front-drawer);
    align-items: stretch;
    justify-content: flex-end;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    box-sizing: border-box;
}

.home-hot-drawer-backdrop,
.side-drawer-backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;
    border: 0;
    padding: 0;
    margin: 0;
    background: rgba(15, 23, 42, 0.35);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.35s ease;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.home-hot-drawer.is-open .home-hot-drawer-backdrop,
.side-drawer.is-open .side-drawer-backdrop {
    opacity: 1;
}

.home-hot-drawer-panel,
.side-drawer-panel {
    position: relative;
    z-index: 1;
    width: min(360px, 85vw);
    max-height: calc(100dvh - var(--site-header-height) - 0.75rem);
    margin: auto 0.375rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: calc(var(--radius) * 1.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(22, 30, 46, 0.72);
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
    backdrop-filter: blur(24px) saturate(1.3);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.06) inset,
        -8px 0 48px rgba(0, 0, 0, 0.28),
        0 8px 32px rgba(0, 0, 0, 0.12);
    transform: translate3d(120%, 0, 0) scale(0.96);
    transition:
        transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.3s ease;
    will-change: transform, opacity;
    opacity: 0;
}

.home-hot-drawer.is-open .home-hot-drawer-panel,
.side-drawer.is-open .side-drawer-panel {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
    .home-hot-drawer-backdrop,
    .side-drawer-backdrop,
    .home-hot-drawer-panel,
    .side-drawer-panel {
        transition: none !important;
    }
}

.home-hot-drawer-head,
.side-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.85rem 1rem 0.7rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.03);
}

.home-hot-drawer-head h3,
.side-drawer-head h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.01em;
}

.home-hot-drawer-close,
.side-drawer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    flex-shrink: 0;
    box-sizing: border-box;
    font-size: 1.2rem;
    font-weight: 400;
    line-height: 1;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: none;
    transition:
        background 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.15s ease;
}

.home-hot-drawer-close:hover,
.side-drawer-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.home-hot-drawer-body,
.side-drawer-body {
    padding: 0.65rem 0.85rem max(0.85rem, env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.home-hot-drawer-body::-webkit-scrollbar,
.side-drawer-body::-webkit-scrollbar {
    width: 4px;
}

.home-hot-drawer-body::-webkit-scrollbar-track,
.side-drawer-body::-webkit-scrollbar-track {
    background: transparent;
}

.home-hot-drawer-body::-webkit-scrollbar-thumb,
.side-drawer-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.side-drawer-body .panel-link,
.home-hot-drawer-body .panel-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.75rem;
    margin: 0.35rem 0;
    border-radius: 12px;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        transform 0.15s ease;
    color: inherit;
}

.side-drawer-body .panel-link:hover,
.home-hot-drawer-body .panel-link:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateX(3px);
}

.side-drawer-body .panel-link .panel-title,
.home-hot-drawer-body .panel-link .panel-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    font-size: 0.92rem;
    line-height: 1.4;
}

.side-drawer-body .panel-link .panel-meta,
.home-hot-drawer-body .panel-link .panel-meta {
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.78rem;
    white-space: nowrap;
}

.archive-filter-drawer .side-drawer-panel {
    max-height: min(92vh, 720px);
}

.archive-filter-drawer-body {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.archive-filter-block + .archive-filter-block {
    padding-top: 1rem;
    border-top: none;
}

.archive-filter-block .archive-sidebar-head {
    margin-bottom: 0.75rem;
}

.archive-filter-block .archive-sidebar-head h4 {
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.home-hot-drawer-body > .panel-link {
    margin-top: 0.5rem;
}

.home-hot-drawer-body > .panel-link:first-child {
    margin-top: 0;
}

.home-hot-empty {
    margin: 0;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.4);
}

body.theme-light .home-hot-drawer-backdrop,
body.theme-light .side-drawer-backdrop {
    background: rgba(15, 23, 42, 0.2);
}

body.theme-light .home-hot-drawer-panel,
body.theme-light .side-drawer-panel {
    background: rgba(245, 247, 250, 0.78);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.5) inset,
        -8px 0 48px rgba(0, 0, 0, 0.1),
        0 8px 32px rgba(0, 0, 0, 0.06);
}

body.theme-light .home-hot-drawer-head,
body.theme-light .side-drawer-head {
    border-bottom-color: rgba(0, 0, 0, 0.06);
    background: rgba(255, 255, 255, 0.25);
}

body.theme-light .home-hot-drawer-head h3,
body.theme-light .side-drawer-head h3 {
    color: rgba(15, 23, 42, 0.85);
}

body.theme-light .home-hot-drawer-close,
body.theme-light .side-drawer-close {
    color: rgba(15, 23, 42, 0.5);
    border-color: rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.4);
}

body.theme-light .home-hot-drawer-close:hover,
body.theme-light .side-drawer-close:hover {
    background: rgba(255, 255, 255, 0.7);
    color: rgba(15, 23, 42, 0.85);
    border-color: rgba(0, 0, 0, 0.12);
}

body.theme-light .side-drawer-body .panel-link,
body.theme-light .home-hot-drawer-body .panel-link {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.5);
}

body.theme-light .side-drawer-body .panel-link:hover,
body.theme-light .home-hot-drawer-body .panel-link:hover {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(255, 255, 255, 0.8);
}

body.theme-light .side-drawer-body .panel-link .panel-title,
body.theme-light .home-hot-drawer-body .panel-link .panel-title {
    color: rgba(15, 23, 42, 0.85);
}

body.theme-light .side-drawer-body .panel-link .panel-meta,
body.theme-light .home-hot-drawer-body .panel-link .panel-meta {
    color: rgba(15, 23, 42, 0.45);
}

body.theme-light .home-hot-empty {
    color: rgba(15, 23, 42, 0.4);
}

body.theme-light .archive-filter-block + .archive-filter-block {
    border-top-color: rgba(0, 0, 0, 0.06);
}

body.theme-light .archive-filter-block .archive-sidebar-head h4 {
    color: #64748b;
}

/* 归档筛选浮层内日历 / 分类标签适配毛玻璃背景 */
.side-drawer-body .archive-calendar-toolbar {
    margin-bottom: 0.3rem;
}

.side-drawer-body .archive-year-label .muted {
    color: rgba(255, 255, 255, 0.5);
}

.side-drawer-body .archive-year-select {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.85);
}

.side-drawer-body .archive-calendar-all {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.75);
}

.side-drawer-body .archive-calendar-all:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
}

.side-drawer-body .archive-calendar-all.is-active {
    background: rgba(255, 255, 255, 0.12);
    border-color: color-mix(in srgb, var(--primary) 50%, rgba(255, 255, 255, 0.3));
    color: rgba(255, 255, 255, 0.95);
}

.side-drawer-body .archive-calendar-all-count {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.55);
}

.side-drawer-body .archive-calendar-all.is-active .archive-calendar-all-count {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.9);
}

.side-drawer-body .archive-calendar-month {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.06);
}

.side-drawer-body .archive-calendar-month.has-posts {
    color: rgba(255, 255, 255, 0.8);
}

.side-drawer-body .archive-calendar-month.has-posts:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.14);
}

.side-drawer-body .archive-calendar-month.is-active {
    background: rgba(255, 255, 255, 0.13);
    border-color: color-mix(in srgb, var(--primary) 45%, rgba(255, 255, 255, 0.25));
}

.side-drawer-body .archive-calendar-month.is-active .archive-calendar-month-label,
.side-drawer-body .archive-calendar-month.is-active .archive-calendar-month-count {
    color: rgba(255, 255, 255, 0.95);
}

.side-drawer-body .archive-calendar-month-label {
    color: rgba(255, 255, 255, 0.65);
}

.side-drawer-body .archive-calendar-month-count {
    color: rgba(255, 255, 255, 0.35);
}

.side-drawer-body .archive-calendar-month.is-empty {
    color: rgba(255, 255, 255, 0.2);
}

.side-drawer-body .category-cloud-tag {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
}

.side-drawer-body .category-cloud-tag:hover {
    background: rgba(255, 255, 255, 0.11);
    border-color: rgba(255, 255, 255, 0.14);
}

.side-drawer-body .category-cloud-tag--all {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.85);
}

.side-drawer-body .category-cloud-name {
    color: inherit;
}

.side-drawer-body .category-cloud-count {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
}

body.theme-light .side-drawer-body .archive-year-select {
    background: rgba(255, 255, 255, 0.55);
    border-color: rgba(0, 0, 0, 0.08);
    color: rgba(15, 23, 42, 0.8);
}

body.theme-light .side-drawer-body .archive-year-label .muted {
    color: rgba(15, 23, 42, 0.4);
}

body.theme-light .side-drawer-body .archive-calendar-all {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(0, 0, 0, 0.06);
    color: rgba(15, 23, 42, 0.7);
}

body.theme-light .side-drawer-body .archive-calendar-all:hover {
    background: rgba(255, 255, 255, 0.5);
}

body.theme-light .side-drawer-body .archive-calendar-all.is-active {
    background: rgba(255, 255, 255, 0.6);
    color: var(--primary);
}

body.theme-light .side-drawer-body .archive-calendar-all-count {
    background: rgba(0, 0, 0, 0.04);
    color: rgba(15, 23, 42, 0.5);
}

body.theme-light .side-drawer-body .archive-calendar-month {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(0, 0, 0, 0.04);
}

body.theme-light .side-drawer-body .archive-calendar-month.has-posts {
    color: rgba(15, 23, 42, 0.75);
}

body.theme-light .side-drawer-body .archive-calendar-month.has-posts:hover {
    background: rgba(255, 255, 255, 0.45);
}

body.theme-light .side-drawer-body .archive-calendar-month.is-active {
    background: rgba(255, 255, 255, 0.6);
}

body.theme-light .side-drawer-body .archive-calendar-month-label {
    color: rgba(15, 23, 42, 0.6);
}

body.theme-light .side-drawer-body .archive-calendar-month-count {
    color: rgba(15, 23, 42, 0.35);
}

body.theme-light .side-drawer-body .category-cloud-tag {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(0, 0, 0, 0.05);
    color: rgba(15, 23, 42, 0.7);
}

body.theme-light .side-drawer-body .category-cloud-tag:hover {
    background: rgba(255, 255, 255, 0.5);
}

body.theme-light .side-drawer-body .category-cloud-tag--all {
    background: rgba(255, 255, 255, 0.4);
    color: rgba(15, 23, 42, 0.85);
}

body.theme-light .side-drawer-body .category-cloud-count {
    background: rgba(0, 0, 0, 0.04);
    color: rgba(15, 23, 42, 0.45);
}

/* —— 站点主题色（后台「站点设置」theme_preset，由 body[data-theme-preset] 驱动） —— */

/* 仅覆盖强调色变量（--primary / --primary-2）与 orb 装饰色。
   背景色与渐变统一由全局 body{background: var(--bg) / var(--primary)} 驱动，
   避免在此重复声明 background-color/background-image：否则会因特异性与 body.theme-light
   相同却定义在后，把亮色模式的亮背景覆盖回深色，导致非 default 主题在亮色下整页发暗。 */

body[data-theme-preset="ocean"] {
    --primary: #06b6d4;
    --primary-2: #0284c7;
}

body[data-theme-preset="ocean"] .orb-1 {
    background: #22d3ee;
}

body[data-theme-preset="ocean"] .orb-2 {
    background: #0891b2;
}

body[data-theme-preset="forest"] {
    --primary: #10b981;
    --primary-2: #047857;
}

body[data-theme-preset="forest"] .orb-1 {
    background: #34d399;
}

body[data-theme-preset="forest"] .orb-2 {
    background: #22c55e;
}

body[data-theme-preset="sunset"] {
    --primary: #f97316;
    --primary-2: #e11d48;
}

body[data-theme-preset="sunset"] .orb-1 {
    background: #fb923c;
}

body[data-theme-preset="sunset"] .orb-2 {
    background: #f43f5e;
}

body[data-theme-preset="rose"] {
    --primary: #ec4899;
    --primary-2: #a855f7;
}

body[data-theme-preset="rose"] .orb-1 {
    background: #f472b6;
}

body[data-theme-preset="rose"] .orb-2 {
    background: #c084fc;
}

body[data-theme-preset="amber"] {
    --primary: #f59e0b;
    --primary-2: #b45309;
}

body[data-theme-preset="amber"] .orb-1 {
    background: #fbbf24;
}

body[data-theme-preset="amber"] .orb-2 {
    background: #d97706;
}

body[data-theme-preset="slate"] {
    --primary: #38bdf8;
    --primary-2: #64748b;
}

body[data-theme-preset="slate"] .orb-1 {
    background: #7dd3fc;
}

body[data-theme-preset="slate"] .orb-2 {
    background: #94a3b8;
}

body[data-theme-preset="ruby"] {
    --primary: #f43f5e;
    --primary-2: #9f1239;
}

body[data-theme-preset="ruby"] .orb-1 {
    background: #fb7185;
}

body[data-theme-preset="ruby"] .orb-2 {
    background: #e11d48;
}

/* —— 站点设置：横向标签页 —— */

.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;
}

.settings-tabs {
    position: relative;
}

.settings-tab-state {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
    pointer-events: none;
}

.settings-tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.28);
}

.settings-tab {
    cursor: pointer;
    padding: 0.48rem 1.15rem;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-soft);
    border: 1px solid var(--border);
    background: var(--surface);
    transition:
        color 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease,
        transform 0.18s ease;
}

.settings-tab:hover {
    color: var(--text);
    border-color: color-mix(in srgb, var(--primary) 35%, var(--border));
    transform: translateY(-1px);
}

#settings-tab-basic:checked ~ .settings-tab-bar label[for="settings-tab-basic"],
#settings-tab-features:checked ~ .settings-tab-bar label[for="settings-tab-features"],
#settings-tab-ai:checked ~ .settings-tab-bar label[for="settings-tab-ai"],
#settings-tab-theme:checked ~ .settings-tab-bar label[for="settings-tab-theme"] {
    color: #ffffff;
    border-color: transparent;
    background: var(--primary);
    box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 28%, transparent);
}

.settings-panel {
    display: none;
}

#settings-tab-basic:checked ~ .settings-panel-basic,
#settings-tab-features:checked ~ .settings-panel-features,
#settings-tab-ai:checked ~ .settings-panel-ai,
#settings-tab-links:checked ~ .settings-panel-links,
#settings-tab-theme:checked ~ .settings-panel-theme {
    display: block;
}

.settings-field-hint {
    margin: 0.35rem 0 0;
    font-size: 0.82rem;
    line-height: 1.5;
}

.settings-panel-lead {
    margin: 0 0 0.9rem;
    font-size: 0.86rem;
    line-height: 1.5;
}

.settings-toggle-line {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0;
    font-size: 0.92rem;
    font-weight: 500;
}

.settings-toggle-line input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 2.75rem;
    height: 1.5rem;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.35);
    cursor: pointer;
    position: relative;
    transition: background 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0;
}

.settings-toggle-line input[type="checkbox"]::after {
    content: "";
    position: absolute;
    top: 0.15rem;
    left: 0.15rem;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    background: #ffffff;
    transition: left 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.settings-toggle-line input[type="checkbox"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.settings-toggle-line input[type="checkbox"]:checked::after {
    left: calc(100% - 1.25rem);
}

.fl-editor {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.fl-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.fl-row {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.fl-row input[type="text"] {
    padding: 0.4rem 0.55rem;
    border: 1px solid var(--border);
    border-radius: 7px;
    font-size: 0.85rem;
    background: #fff;
    color: var(--text);
}

.fl-name {
    flex: 2;
    min-width: 0;
}

.fl-url {
    flex: 3;
    min-width: 0;
}

.fl-row input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79,70,229,0.12);
}

.fl-del {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.8rem;
    height: 1.8rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--danger);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.12s;
    flex-shrink: 0;
}

.fl-del:hover {
    background: var(--danger);
    color: #fff;
}

.settings-subsection {
    margin-top: 1.35rem;
    padding-top: 1.15rem;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.settings-subsection-title {
    margin: 0 0 0.55rem;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

.settings-subsection-lead {
    margin: 0 0 0.75rem;
}

.settings-subsection-lead code {
    font-size: 0.8em;
    padding: 0.1rem 0.35rem;
    border-radius: 6px;
    background: rgba(148, 163, 184, 0.15);
}

.console-settings-form .tool-actions {
    margin-top: 0.35rem;
    padding-top: 1.05rem;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.settings-avatar-field {
    margin-bottom: 0.5rem;
}

.settings-field-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 500;
    color: #e2e8f0;
    margin-bottom: 0.5rem;
}

body.theme-light .settings-field-label {
    color: #1e293b;
}

.settings-avatar-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 2px dashed rgba(148, 163, 184, 0.3);
    margin-bottom: 0.75rem;
    overflow: hidden;
}

body.theme-light .settings-avatar-preview {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(148, 163, 184, 0.35);
}

.settings-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.settings-avatar-placeholder {
    font-size: 0.75rem;
    color: #64748b;
    text-align: center;
}

.settings-avatar-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.settings-avatar-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

body.theme-light .settings-tab {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(148, 163, 184, 0.42);
}

body.theme-light .settings-tab:hover {
    color: #0f172a;
}

.theme-preset-fieldset {
    border: 0;
    padding: 0;
    margin: 0;
}

.theme-preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
    gap: 0.65rem;
}

.theme-preset-card {
    position: relative;
    display: block;
    cursor: pointer;
    border-radius: 14px;
    border: 2px solid rgba(148, 163, 184, 0.35);
    padding: 0.65rem 0.72rem 0.58rem;
    background: rgba(255, 255, 255, 0.88);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.theme-preset-card:hover {
    border-color: color-mix(in srgb, var(--primary) 45%, transparent);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.theme-preset-card:has(input:checked) {
    border-color: color-mix(in srgb, var(--primary) 65%, transparent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}

.theme-preset-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.theme-preset-card-title {
    display: block;
    font-weight: 700;
    font-size: 0.86rem;
    color: #0f172a;
    margin-bottom: 0.2rem;
}

.theme-preset-card-desc {
    display: block;
    font-size: 0.72rem;
    color: #64748b;
    line-height: 1.35;
    margin-bottom: 0.45rem;
}

.theme-preset-swatches {
    display: flex;
    gap: 0.35rem;
}

.theme-preset-swatch {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    border: 1px solid rgba(15, 23, 42, 0.12);
}

body.theme-light .theme-preset-card {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(148, 163, 184, 0.4);
}

/* ── Dynamic interaction enhancements ── */
html.ux-smooth-scroll {
    scroll-behavior: smooth;
}

button:active,
.btn:active {
    transform: translateY(0) scale(0.98);
}

.btn.is-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.88;
    padding-left: 2rem;
}

.btn.is-loading::before {
    content: "";
    position: absolute;
    left: 0.72rem;
    top: 50%;
    width: 0.9rem;
    height: 0.9rem;
    margin-top: -0.45rem;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ux-spin 0.65s linear infinite;
}

.btn.outline.is-loading::before {
    border-color: rgba(100, 116, 139, 0.35);
    border-top-color: #6366f1;
}

@keyframes ux-spin {
    to {
        transform: rotate(360deg);
    }
}

.flash {
    cursor: pointer;
    user-select: none;
}

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

.reveal {
    transition-delay: var(--reveal-delay, 0ms);
}

/* 留言卡片不应使用 reveal（避免旧版 JS 误加 class 导致不可见） */
.guestbook-message-list .guestbook-message-card {
    opacity: 1;
    transform: none;
}

.code-block-wrap {
    position: relative;
}

.code-block-wrap pre {
    margin: 0;
}

.code-copy-btn {
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    z-index: 2;
    padding: 0.22rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(255, 255, 255, 0.92);
    color: #334155;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.code-block-wrap:hover .code-copy-btn,
.code-block-wrap:focus-within .code-copy-btn,
.code-copy-btn:focus-visible {
    opacity: 1;
    transform: translateY(0);
}

.code-copy-btn.is-copied {
    color: var(--success);
    border-color: color-mix(in srgb, var(--success) 45%, rgba(148, 163, 184, 0.35));
}

.editor-combobox [data-category-option].is-active {
    background: color-mix(in srgb, var(--primary) 14%, #ffffff);
    border-color: color-mix(in srgb, var(--primary) 35%, rgba(148, 163, 184, 0.28));
}

.editor-settings-modal[hidden] {
    display: none !important;
}

.editor-summary-error {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.78rem;
    color: #ef4444;
    font-weight: 500;
}

.editor-field input.is-error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
    animation: editor-shake 0.35s ease;
}

@keyframes editor-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

.editor-settings-modal.is-visible .editor-settings-backdrop,
.editor-settings-modal.is-opening .editor-settings-backdrop {
    opacity: 1;
}

.editor-settings-modal.is-visible .editor-settings-panel,
.editor-settings-modal.is-opening .editor-settings-panel {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.editor-settings-modal:not([hidden]):not(.is-visible):not(.is-opening) .editor-settings-backdrop {
    opacity: 0;
    transition: opacity 0.24s ease;
}

.editor-settings-modal:not([hidden]):not(.is-visible):not(.is-opening) .editor-settings-panel {
    opacity: 0;
    transform: translate(-50%, -48%) scale(0.96);
    transition: opacity 0.24s ease, transform 0.24s cubic-bezier(0.33, 1, 0.68, 1);
}

.editor-settings-modal.is-closing .editor-settings-backdrop,
.editor-settings-modal.is-closing .editor-settings-panel {
    opacity: 0;
}

.editor-settings-modal.is-closing .editor-settings-panel {
    transform: translate(-50%, -48%) scale(0.98);
}

.console-scrim {
    opacity: 0;
    transition: opacity 0.22s ease;
    pointer-events: none;
}

.console-scrim:not([hidden]) {
    pointer-events: auto;
}

.console-scrim.is-visible {
    opacity: 1;
}

body.theme-transitioning,
body.theme-transitioning * {
    transition:
        background-color 0.28s ease,
        color 0.28s ease,
        border-color 0.28s ease,
        box-shadow 0.28s ease !important;
}

.qa-submit.is-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.9;
}

.qa-submit.is-loading::after {
    content: "";
    display: inline-block;
    width: 0.85rem;
    height: 0.85rem;
    margin-left: 0.45rem;
    vertical-align: -0.12em;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ux-spin 0.65s linear infinite;
}

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

    .reveal {
        transition-delay: 0ms !important;
    }

    .editor-settings-modal:not([hidden]) .editor-settings-panel,
    .editor-settings-modal.is-closing .editor-settings-panel {
        transform: translate(-50%, -50%);
        transition: none;
    }

    .btn.is-loading::before,
    .qa-submit.is-loading::after {
        animation: none;
    }
}

/* —— 超小屏幕额外优化，防止列表/内容溢出 —— */
@media (max-width: 480px) {
    .post-content ul,
    .post-content ol {
        padding-left: 0.95rem;
    }

    .post-content ul ul,
    .post-content ol ol,
    .post-content ul ol,
    .post-content ol ul {
        padding-left: 0.85rem;
    }

    .post-content li {
        margin: 0.22rem 0;
    }

    .post-content blockquote {
        padding-left: 0.7rem;
        margin-left: 0;
    }

    .post-content table {
        font-size: 0.78rem;
    }

    .post-article {
        padding: 0.85rem 0.7rem;
    }
}

/* 整合页面样式：卡片式布局，一屏展示 */
.ix-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
    margin-top: 1.5rem;
}

.ix-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ix-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.ix-card-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.ix-badge {
    display: inline-flex;
    align-items: center;
    height: 1.45rem;
    padding: 0 0.6rem;
    background: var(--border);
    color: var(--text-soft);
    border-radius: 99px;
    font-size: 0.73rem;
    font-weight: 600;
}

.ix-badge.is-hot {
    background: var(--primary);
    color: #fff;
}

.ix-card-toolbar {
    padding: 0.6rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.ix-filter {
    display: flex;
    gap: 0.45rem;
    align-items: center;
    flex-wrap: wrap;
}

.ix-filter input,
.ix-filter select {
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 7px;
    font-size: 0.8rem;
    background: #fff;
    color: var(--text);
}

.ix-filter input[type="search"] {
    flex: 1;
    min-width: 120px;
}

.ix-filter input[type="date"],
.ix-filter select {
    max-width: 130px;
}

.ix-filter input:focus,
.ix-filter select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79,70,229,0.12);
}

.ix-filter .btn,
.ix-filter .btn.outline {
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.ix-card-batch {
    padding: 0.4rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.ix-card-batch .admin-list-toolbar {
    margin: 0;
    padding: 0;
}

.ix-card-batch .admin-interaction-batch-form .admin-toolbar-left {
    gap: 0.35rem;
}

.ix-card-batch .admin-batch-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.76rem;
}

.ix-card-body {
    flex: 1;
    overflow-y: auto;
    padding: 0.35rem;
    max-height: 540px;
}

.ix-item {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    padding: 0.55rem 0.7rem;
    border-radius: 8px;
    transition: background 0.12s;
}

.ix-item + .ix-item {
    margin-top: 2px;
}

.ix-item:hover {
    background: rgba(79,70,229,0.035);
}

.ix-item.is-new {
    background: rgba(79,70,229,0.07);
}

.ix-item.is-new:hover {
    background: rgba(79,70,229,0.1);
}

.ix-item.is-hidden {
    opacity: 0.4;
}

.ix-cb {
    flex-shrink: 0;
    padding-top: 0.25rem;
    display: flex;
}

.ix-cb input[type="checkbox"] {
    margin: 0;
    width: 0.95rem;
    height: 0.95rem;
    cursor: pointer;
}

.ix-info {
    flex: 1;
    min-width: 0;
}

.ix-line {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    line-height: 1.4;
}

.ix-author {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text);
    white-space: nowrap;
}

.ix-arrow {
    color: var(--text-soft);
    font-size: 0.78rem;
    opacity: 0.5;
}

.ix-post {
    font-size: 0.8rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 1;
}

.ix-post a {
    color: var(--primary);
    text-decoration: none;
}

.ix-post a:hover {
    text-decoration: underline;
}

.ix-dot {
    color: var(--text-soft);
    font-size: 0.7rem;
    opacity: 0.35;
}

.ix-tag {
    display: inline-flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.05rem 0.4rem;
    border-radius: 4px;
    line-height: 1.3;
}

.ix-tag-on {
    background: rgba(22,163,74,0.12);
    color: #16a34a;
}

.ix-tag-off {
    background: rgba(100,116,139,0.12);
    color: #64748b;
}

.ix-time {
    font-size: 0.75rem;
    color: var(--text-soft);
    white-space: nowrap;
    opacity: 0.7;
}

.ix-spacer {
    flex: 1;
    min-width: 0;
}

.ix-f {
    display: inline-flex;
    margin: 0;
}

.ix-act {
    display: inline-flex;
    align-items: center;
    padding: 0.12rem 0.45rem;
    font-size: 0.7rem;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.12s;
    line-height: 1.5;
    background: transparent;
}

.ix-act-read {
    color: var(--primary);
}

.ix-act-read:hover {
    background: var(--primary);
    color: #fff;
}

.ix-act-del {
    color: var(--danger);
}

.ix-act-del:hover {
    background: var(--danger);
    color: #fff;
}

.ix-text {
    margin: 0.15rem 0 0;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    opacity: 0.85;
}

.ix-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-soft);
    font-size: 0.9rem;
}

/* 分类管理页面：卡片式双栏布局 */
.cat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
    margin-top: 1.5rem;
}

.cat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cat-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.cat-card-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.cat-badge {
    display: inline-flex;
    align-items: center;
    height: 1.45rem;
    padding: 0 0.6rem;
    background: var(--border);
    color: var(--text-soft);
    border-radius: 99px;
    font-size: 0.73rem;
    font-weight: 600;
    white-space: nowrap;
}

.cat-create {
    padding: 0.7rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.cat-create-form {
    display: flex;
    gap: 0.45rem;
    align-items: center;
}

.cat-create-form input[type="text"] {
    flex: 1;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 7px;
    font-size: 0.85rem;
    background: #fff;
    color: var(--text);
    min-width: 0;
}

.cat-create-form input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79,70,229,0.12);
}

.cat-create-form .btn {
    padding: 0.4rem 0.7rem;
    font-size: 0.82rem;
    flex-shrink: 0;
}

.cat-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.35rem;
    max-height: 540px;
}

.cat-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.7rem;
    border-radius: 8px;
    transition: background 0.12s;
}

.cat-item:hover {
    background: rgba(79,70,229,0.035);
}

.cat-item + .cat-item {
    margin-top: 2px;
}

.cat-name {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text);
    white-space: nowrap;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cat-count {
    font-size: 0.75rem;
    color: var(--text-soft);
    white-space: nowrap;
    opacity: 0.7;
}

.cat-spacer {
    flex: 1;
    min-width: 0.3rem;
}

.cat-f {
    display: inline-flex;
    margin: 0;
    align-items: center;
    gap: 0.25rem;
}

.cat-rename {
    width: 6.5rem;
    padding: 0.2rem 0.4rem;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 0.78rem;
    color: var(--text);
    background: #fff;
}

.cat-rename:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79,70,229,0.12);
}

.cat-act {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.4rem;
    font-size: 0.7rem;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.12s;
    line-height: 1.5;
    background: transparent;
}

.cat-act-save {
    color: var(--primary);
}

.cat-act-save:hover {
    background: var(--primary);
    color: #fff;
}

.cat-act-del {
    color: var(--danger);
}

.cat-act-del:hover {
    background: var(--danger);
    color: #fff;
}

.cat-default {
    font-size: 0.72rem;
    color: var(--text-soft);
    opacity: 0.5;
    font-style: italic;
}

.cat-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-soft);
    font-size: 0.9rem;
}

/* 批量分配面板 */
.cat-batch-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.cat-batch-target {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.cat-batch-target label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.cat-batch-target select {
    flex: 1;
    padding: 0.38rem 0.55rem;
    border: 1px solid var(--border);
    border-radius: 7px;
    font-size: 0.82rem;
    background: #fff;
    color: var(--text);
}

.cat-batch-target select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(79,70,229,0.12);
}

.cat-batch-hd {
    padding: 0.55rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cat-select-all-cb {
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    user-select: none;
}

.cat-select-all-cb input[type="checkbox"] {
    margin: 0;
    width: 0.95rem;
    height: 0.95rem;
    cursor: pointer;
}

.cat-batch-count {
    font-size: 0.78rem;
    color: var(--text-soft);
    opacity: 0.7;
}

.cat-batch-posts {
    flex: 1;
    overflow-y: auto;
    padding: 0.35rem;
    max-height: 400px;
}

.cat-post-group + .cat-post-group {
    margin-top: 0.25rem;
}

.cat-post-group-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-soft);
    padding: 0.3rem 0.5rem 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.6;
}

.cat-post-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.5rem 0.35rem 0.7rem;
    border-radius: 6px;
    transition: background 0.12s;
    cursor: pointer;
}

.cat-post-item:hover {
    background: rgba(79,70,229,0.04);
}

.cat-post-item input[type="checkbox"] {
    margin: 0;
    width: 0.9rem;
    height: 0.9rem;
    flex-shrink: 0;
    cursor: pointer;
}

.cat-post-title {
    font-size: 0.8rem;
    color: var(--text);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

.cat-batch-act {
    padding: 0.7rem 1.25rem;
    border-top: 1px solid var(--border);
}

.cat-batch-act .btn {
    width: 100%;
    justify-content: center;
    padding: 0.5rem;
}

@media (max-width: 1100px) {
    .cat-grid {
        grid-template-columns: 1fr;
    }
    .cat-list {
        max-height: 380px;
    }
    .cat-batch-posts {
        max-height: 320px;
    }
}

@media (max-width: 600px) {
    .cat-create-form {
        flex-direction: column;
        align-items: stretch;
    }
    .cat-item {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
    .cat-f {
        flex-wrap: wrap;
    }
    .cat-rename {
        width: 100%;
    }
    .cat-batch-target {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 1200px) {
    .ix-grid {
        grid-template-columns: 1fr;
    }
    .ix-card-body {
        max-height: 420px;
    }
}

@media (max-width: 600px) {
    .ix-filter {
        flex-direction: column;
        align-items: stretch;
    }
    .ix-filter input[type="search"],
    .ix-filter input[type="date"],
    .ix-filter select {
        max-width: none;
        width: 100%;
    }
    .ix-filter .btn,
    .ix-filter .btn.outline {
        width: 100%;
        text-align: center;
    }
    .ix-line {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.15rem;
    }
    .ix-spacer {
        display: none;
    }
}
