:root {
    /* 品牌色：墨绿到薄荷的渐变用于按钮、链接和高亮；其余色阶支撑边框、悬停与选中态。 */
    --brand-50: #ecfdf5;
    --brand-100: #d1fae5;
    --brand-300: #6ee7b7;
    --brand-400: #34d399;
    --brand-500: #14b8a6;
    --brand-600: #0d9488;
    --brand-700: #0f766e;
    --brand-800: #115e59;
    --brand-gradient: linear-gradient(135deg, #14b8a6 0%, #0f766e 100%);

    --nav-bg: rgba(255, 255, 255, .82);
    --nav-border: rgba(18, 40, 34, .08);
    --page-bg: #f6f9f8;
    --panel-bg: #ffffff;
    --panel-muted: #f1f6f4;
    --panel-border: #e3ebe8;
    --input-bg: #f8fbfa;
    --text-main: #1a2a25;
    --text-muted: #61726c;
    --link-color: #0f766e;
    --link-hover: #115e59;
    --avatar-bg: #d7eee8;
    --avatar-text: #0f766e;
    --focus-ring: rgba(15, 118, 110, .18);
    --panel-shadow: 0 1px 2px rgba(18, 40, 34, .04), 0 12px 32px rgba(18, 40, 34, .06);
    --panel-shadow-lg: 0 6px 16px rgba(18, 40, 34, .08), 0 24px 48px rgba(18, 40, 34, .12);
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-pill: 999px;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", Arial,
        sans-serif;
}

[data-bs-theme="dark"] {
    --nav-bg: rgba(15, 23, 20, .82);
    --nav-border: rgba(255, 255, 255, .08);
    --page-bg: #0f1714;
    --panel-bg: #16211d;
    --panel-muted: #1d2b26;
    --panel-border: #2b3a35;
    --input-bg: #121c18;
    --text-main: #e9f2ef;
    --text-muted: #93a6a0;
    --link-color: #5eead4;
    --link-hover: #99f6e4;
    --avatar-bg: #24403a;
    --avatar-text: #7ce4cf;
    --focus-ring: rgba(94, 234, 212, .2);
    --panel-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .28);
    --panel-shadow-lg: 0 8px 20px rgba(0, 0, 0, .4), 0 28px 56px rgba(0, 0, 0, .4);
}

html { scroll-behavior: smooth; }

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text-main);
    /* 页面底色叠加极淡的品牌渐变光晕，弱化纯白/纯黑的单调感。 */
    background:
        radial-gradient(60rem 40rem at 12% -10%, rgba(20, 184, 166, .08), transparent 60%),
        radial-gradient(50rem 36rem at 100% 0%, rgba(15, 118, 110, .06), transparent 55%),
        var(--page-bg);
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    transition: color 180ms ease, background-color 180ms ease;
}

a { transition: color 150ms ease, opacity 150ms ease; }

.blog-navbar {
    position: sticky;
    z-index: 1030;
    top: 0;
    min-height: 62px;
    padding: 8px 0;
    border-bottom: 1px solid var(--nav-border);
    background: var(--nav-bg);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
}

.blog-navbar .navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-right: 34px;
    color: var(--text-main);
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: -.01em;
}

.brand-mark {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    overflow: hidden;
    border-radius: 9px;
    color: #10201c;
    background: var(--brand-gradient);
    box-shadow: 0 2px 6px rgba(15, 118, 110, .28);
    font-size: .9rem;
    font-weight: 800;
}
.brand-mark img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: inherit;
}

.blog-navbar .nav-link {
    position: relative;
    padding: 8px 12px;
    color: var(--text-muted);
    font-weight: 600;
}
.blog-navbar .nav-link::after {
    position: absolute;
    right: 12px;
    bottom: 4px;
    left: 12px;
    height: 2px;
    border-radius: 2px;
    background: var(--brand-gradient);
    content: "";
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 220ms ease;
}
.blog-navbar .nav-link:hover,
.blog-navbar .nav-link:focus { color: var(--text-main); }
.blog-navbar .nav-link:hover::after,
.blog-navbar .nav-link:focus::after,
.blog-navbar .nav-link.active::after { transform: scaleX(1); }
.blog-navbar .nav-link.active { color: var(--text-main); }
.blog-navbar .navbar-toggler { border-color: var(--panel-border); }
.blog-navbar .navbar-toggler-icon { filter: none; }
[data-bs-theme="dark"] .blog-navbar .navbar-toggler-icon { filter: invert(1); }

.navbar-actions { display: flex; align-items: center; gap: 8px; }
.navbar-actions .btn { min-height: 38px; padding-inline: 14px; }
.navbar-search-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    border: 1px solid var(--panel-border);
    background: var(--panel-bg);
}
.navbar-search-trigger:hover, .navbar-search-trigger:focus {
    color: var(--link-color);
    border-color: color-mix(in srgb, var(--link-color) 45%, var(--panel-border));
    background: var(--panel-muted);
}
.navbar-search-trigger kbd {
    padding: 2px 6px;
    color: var(--text-muted);
    border: 1px solid var(--panel-border);
    border-radius: 5px;
    background: var(--panel-muted);
    font-family: inherit;
    font-size: .67rem;
    font-weight: 600;
}
.theme-toggle-button {
    display: inline-grid; flex: 0 0 38px; width: 38px; height: 38px; padding: 0;
    place-items: center; border: 1px solid transparent; border-radius: 50%;
    color: var(--text-muted); background: transparent;
}
.theme-toggle-button:hover, .theme-toggle-button:focus-visible {
    color: var(--text-main); border-color: var(--panel-border); background: var(--panel-muted); outline: none;
}
.theme-icon { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-icon-sun { display: none; }
html[data-bs-theme="dark"] .theme-icon-moon { display: none; }
html[data-bs-theme="dark"] .theme-icon-sun { display: block; }
.theme-toggle-on-nav { color: var(--text-muted); }
.theme-toggle-on-nav:hover, .theme-toggle-on-nav:focus-visible {
    color: var(--text-main); border-color: var(--panel-border); background: var(--panel-muted);
}

.user-avatar-trigger {
    display: block; width: 40px; height: 40px; padding: 0; overflow: hidden;
    border: 2px solid var(--panel-border); border-radius: 50%; background: transparent;
    transition: border-color 150ms ease, transform 150ms ease;
}
.user-avatar-trigger:hover, .user-avatar-trigger:focus-visible {
    border-color: var(--brand-400); transform: scale(1.04);
}
.user-avatar-trigger img, .user-popover-header img, .admin-topbar img, .admin-user-cell img {
    width: 100%; height: 100%; object-fit: cover;
}
.user-popover { width: 292px; margin-top: 10px !important; padding: 0; overflow: hidden; border-radius: 8px; }
.user-popover-header { display: flex; align-items: center; gap: 13px; padding: 20px; border-bottom: 1px solid var(--panel-border); }
.user-popover-header img { flex: 0 0 52px; width: 52px; height: 52px; border-radius: 50%; }
.user-popover-header div { display: grid; min-width: 0; }
.user-popover-header strong { overflow: hidden; font-size: 1.02rem; text-overflow: ellipsis; white-space: nowrap; }
.user-popover-header span { color: var(--text-muted); font-size: .84rem; }
.user-activity-shortcuts {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    border-bottom: 1px solid var(--panel-border);
}
.user-activity-shortcuts a {
    padding: 13px 6px; color: var(--text-muted); font-size: .84rem;
    text-align: center; text-decoration: none;
}
.user-activity-shortcuts a + a { border-left: 1px solid var(--panel-border); }
.user-activity-shortcuts a:hover { color: var(--link-color); background: var(--panel-muted); }
.user-popover-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; padding: 10px; }
.user-popover-link {
    display: flex; width: 100%; min-height: 44px; padding: 10px; align-items: center; gap: 9px;
    border: 0; border-radius: 5px; color: var(--text-main); background: transparent;
    font-size: .88rem; font-weight: 400; text-align: left; text-decoration: none;
}
.user-popover-link svg {
    flex: 0 0 18px; width: 18px; height: 18px; fill: none; stroke: currentColor;
    stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.user-popover-link:hover { color: var(--link-color); background: var(--panel-muted); }
.user-popover-logout { width: 100%; padding: 13px 20px; border: 0; border-top: 1px solid var(--panel-border); color: #b42318; background: transparent; text-align: left; }
.user-popover-logout:hover { background: var(--panel-muted); }

/* authState 在 head 中同步写入，确保首屏不会短暂绘制错误的登录状态。 */
html[data-auth-state="user"] [data-auth-guest],
html[data-auth-state="guest"] [data-auth-user] { display: none !important; }
html[data-auth-state="user"] [data-auth-user] { display: inline-flex !important; }
[data-auth-admin] { display: none !important; }
html[data-auth-state="user"][data-admin-state="true"] [data-auth-admin] {
    display: inline-flex !important;
}

.page-content { min-height: calc(100vh - 147px); padding-top: 36px; padding-bottom: 56px; }

.site-footer {
    color: var(--text-muted);
    background: var(--panel-bg);
    border-top: 1px solid var(--panel-border);
    font-size: .875rem;
}
.site-footer .container-xl {
    padding-top: 30px;
    padding-bottom: 30px;
}
.site-footer-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 18px;
}
.site-footer-brand {
    color: var(--text-main);
    font-size: .98rem;
    font-weight: 800;
}
.site-footer-tagline { color: var(--text-muted); }
.site-footer-filing {
    padding-top: 16px;
    border-top: 1px solid var(--panel-border);
    color: var(--text-muted);
    text-align: center;
}
.site-footer-filing a {
    color: var(--link-color);
    text-decoration: none;
}
.site-footer-filing a:hover,
.site-footer-filing a:focus-visible {
    color: var(--link-hover);
    text-decoration: underline;
}

.page-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}
.page-heading h1 { margin: 3px 0 0; font-size: 1.75rem; line-height: 1.25; }
.page-heading p { max-width: 360px; margin: 0; color: var(--text-muted); text-align: right; }
.eyebrow { color: var(--link-color); font-size: .74rem; font-weight: 800; }

.post-card, .sidebar-panel, .auth-card, .profile-summary, .settings-panel, .editor-panel,
.error-panel, .modal-content {
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-md);
    background: var(--panel-bg);
    box-shadow: var(--panel-shadow);
}

.post-card {
    position: relative;
    display: flex; gap: 20px; margin-bottom: 18px; padding: 24px 26px;
    overflow: hidden;
    transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}
.post-card::before {
    position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--brand-gradient);
    content: ""; transform: scaleY(0); transform-origin: top; transition: transform 220ms ease;
}
.post-card:hover {
    border-color: color-mix(in srgb, var(--link-color) 35%, var(--panel-border));
    box-shadow: var(--panel-shadow-lg);
    transform: translateY(-3px);
}
.post-card:hover::before { transform: scaleY(1); }
.post-card-cover {
    order: 3; flex: 0 0 190px; align-self: center; overflow: hidden;
    aspect-ratio: 16 / 9; border-radius: 6px; background: var(--input-bg);
}
.post-card-cover img, .post-detail-cover, .post-preview-cover {
    display: block; width: 100%; height: 100%; object-fit: cover;
}
.post-body { min-width: 0; flex: 1; }
.author-avatar {
    display: grid; flex: 0 0 48px; width: 48px; height: 48px; place-items: center;
    border-radius: 50%; color: var(--avatar-text); background: var(--avatar-bg); font-weight: 750;
}
.post-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; color: var(--text-muted); font-size: .86rem; }
.post-meta time::before { margin-right: 12px; color: var(--panel-border); content: "•"; }
.post-meta a, .post-card h2 a { color: var(--link-color); text-decoration: none; }
.post-view-stat { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.post-view-stat svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.post-card h2 { margin: 6px 0 8px; font-size: 1.42rem; line-height: 1.35; }
.post-card h2 a { color: var(--text-main); }
.post-card h2 a:hover { color: var(--link-color); }
.post-excerpt { display: -webkit-box; margin: 0 0 10px; overflow: hidden; color: var(--text-muted); font-size: .96rem; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.post-read-more, .sidebar-link, .back-link { color: var(--link-color); font-size: .9rem; font-weight: 700; text-decoration: none; }
.post-read-more:hover, .sidebar-link:hover, .back-link:hover { color: var(--link-hover); }

/* 顶部导航栏内的分类横向导航：空间不足时水平滚动，隐藏滚动条保持干净。 */
.blog-category-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
}
.blog-category-nav::-webkit-scrollbar { display: none; }
.post-category {
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--panel-muted);
    font-size: .78rem;
    font-weight: 650;
}
.post-category-picker { min-width: 0; margin: 0; padding: 0; border: 0; }
.post-category-picker legend { float: none; width: auto; margin-bottom: 8px; font-size: 1rem; }
.post-category-options { display: flex; flex-wrap: wrap; gap: 9px; }
.post-category-option {
    display: inline-flex; min-height: 40px; padding: 8px 12px; align-items: center; gap: 8px;
    border: 1px solid var(--panel-border); border-radius: 6px; background: var(--panel-bg); cursor: pointer;
}
.post-category-option:has(input:checked) {
    color: var(--link-color); border-color: var(--link-color);
    background: color-mix(in srgb, var(--link-color) 7%, var(--panel-bg));
}
.post-category-option:focus-within { box-shadow: 0 0 0 3px var(--focus-ring); }
.form-control, .form-select { min-height: 42px; border-color: var(--panel-border); border-radius: 8px; background-color: var(--panel-bg); }
.form-control:focus, .form-select:focus { border-color: var(--link-color); box-shadow: 0 0 0 3px var(--focus-ring); }
.btn { border-radius: 8px; font-weight: 650; transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease, border-color 150ms ease, color 150ms ease; }
.btn:active { transform: translateY(1px); }
.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: #0f766e;
    --bs-btn-border-color: #0f766e;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #115e59;
    --bs-btn-hover-border-color: #115e59;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #0d5043;
    --bs-btn-active-border-color: #0d5043;
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: #0f766e;
    --bs-btn-disabled-border-color: #0f766e;
    background-image: var(--brand-gradient);
    border: 0;
    box-shadow: 0 6px 16px rgba(15, 118, 110, .22);
}
.btn-primary:hover { box-shadow: 0 8px 22px rgba(15, 118, 110, .3); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

.empty-state { padding: 52px 24px; border: 1px dashed var(--panel-border); border-radius: 8px; color: var(--text-muted); text-align: center; }
.empty-state h2 { color: var(--text-main); font-size: 1.3rem; }

.sidebar-panel { padding: 24px; }
.sidebar-sticky { position: sticky; top: 24px; }
.sidebar-panel h2 { margin: 5px 0 10px; font-size: 1.35rem; }
.sidebar-panel p { margin-bottom: 20px; color: var(--text-muted); font-size: .94rem; }
.sidebar-note { display: grid; gap: 2px; margin-bottom: 20px; padding: 14px 16px; border-radius: 6px; background: var(--panel-muted); }
.sidebar-note strong { font-size: .9rem; }
.sidebar-note span { color: var(--text-muted); font-size: .82rem; }
.sidebar-panel .list-group-item { color: var(--text-main); background: var(--panel-muted); border-color: var(--panel-border); }

.post-detail { margin-bottom: 0; padding: 32px; }
.post-detail h1 { margin: 12px 0 18px; font-size: 2.35rem; line-height: 1.25; }
.post-author { color: var(--link-color); font-weight: 650; }
.post-content p { font-size: 1.05rem; line-height: 1.8; }
.post-interactions { display: flex; gap: 10px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--panel-border); }
.post-interaction-button {
    display: inline-flex; min-height: 40px; padding: 8px 13px; align-items: center; gap: 7px;
    border: 1px solid var(--panel-border); border-radius: 6px; color: var(--text-muted);
    background: transparent; font-size: .88rem;
}
.post-interaction-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.post-interaction-button:hover, .post-interaction-button.active {
    color: var(--link-color); border-color: color-mix(in srgb, var(--link-color) 55%, var(--panel-border));
    background: color-mix(in srgb, var(--link-color) 8%, transparent);
}

.activity-page { max-width: 880px; margin: 0 auto; }
.activity-page-header { margin-bottom: 20px; }
.activity-page-header h1 { margin: 4px 0 0; font-size: 1.8rem; }
.activity-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--panel-border); }
.activity-tabs button {
    position: relative; padding: 10px 2px 12px; border: 0; color: var(--text-muted);
    background: transparent; font-weight: 650;
}
.activity-tabs button.active { color: var(--text-main); }
.activity-tabs button.active::after { position: absolute; right: 0; bottom: -1px; left: 0; height: 2px; background: var(--link-color); content: ""; }
.activity-list { margin-top: 10px; }
.activity-item { padding: 18px 2px; border-bottom: 1px solid var(--panel-border); }
.activity-item a { color: var(--text-main); font-size: 1rem; font-weight: 700; text-decoration: none; }
.activity-item a:hover { color: var(--link-color); }
.activity-item p { display: -webkit-box; margin: 6px 0 0; overflow: hidden; color: var(--text-muted); -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.activity-empty { padding: 52px 0; color: var(--text-muted); text-align: center; }

.auth-shell, .editor-shell { display: grid; width: 100%; min-width: 0; min-height: calc(100vh - 180px); place-items: center; }
.auth-card { width: min(100%, 500px); padding: 38px; }
.auth-card-wide { width: min(100%, 720px); }
.auth-card-header { margin-bottom: 26px; text-align: center; }
.auth-card-header h1, .section-heading h1, .section-heading h2 { margin: 4px 0 8px; }
.auth-card-header p, .section-heading p { margin: 0; color: var(--text-muted); }
.stacked-form { display: grid; gap: 19px; }
.button-is-loading { position: relative; box-sizing: border-box; white-space: nowrap; }
.button-loading-content {
    position: absolute;
    inset: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    pointer-events: none;
}
.button-loading-content .spinner-border { flex: 0 0 auto; }
.form-label { color: var(--text-main); font-weight: 650; }
.form-label-row, .section-heading, .form-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.form-actions { flex-wrap: nowrap; }
.form-actions > .btn { flex: 0 0 auto; white-space: nowrap; }
.form-actions > .form-label { flex: 1 1 auto; min-width: 0; margin-bottom: 0; }
.form-actions > .verification-code-button {
    display: inline-flex;
    flex: 0 0 124px;
    width: 124px;
    min-height: 42px;
    padding: 8px 14px;
    align-items: center;
    justify-content: center;
    border: 1px solid color-mix(in srgb, var(--link-color) 42%, var(--panel-border));
    border-radius: 7px;
    color: var(--link-color);
    background: color-mix(in srgb, var(--link-color) 8%, var(--panel-bg));
    font-size: .86rem;
    font-weight: 700;
    letter-spacing: .01em;
    white-space: nowrap;
    transition: color 150ms ease, border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}
.form-actions > .verification-code-button:hover:not(:disabled) {
    border-color: var(--link-color);
    color: #fff;
    background: var(--link-color);
}
.form-actions > .verification-code-button:focus-visible {
    border-color: var(--link-color);
    color: var(--link-color);
    background: color-mix(in srgb, var(--link-color) 8%, var(--panel-bg));
    box-shadow: 0 0 0 3px var(--focus-ring);
    outline: none;
}
.form-actions > .verification-code-button[aria-busy="true"] {
    color: var(--link-color);
    background: color-mix(in srgb, var(--link-color) 12%, var(--panel-bg));
    cursor: wait;
    opacity: .82;
}
.form-label-row .form-label { margin-bottom: .5rem; }
.form-label-row a, .auth-switch a { color: var(--link-color); }
.auth-switch { margin: 24px 0 0; color: var(--text-muted); text-align: center; }
.third-party-login { display: grid; gap: 14px; margin-top: 22px; }
.modal-third-party-login { margin: 0 22px 22px; }
.third-party-divider { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: .78rem; }
.third-party-divider::before, .third-party-divider::after { height: 1px; flex: 1; background: var(--panel-border); content: ""; }
.qq-login-button {
    display: inline-flex;
    width: 100%;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px solid color-mix(in srgb, #12b7f5 48%, var(--panel-border));
    color: color-mix(in srgb, #0a8fc4 82%, var(--text-main));
    background: color-mix(in srgb, #12b7f5 7%, var(--panel-bg));
}
.qq-login-button:hover, .qq-login-button:focus-visible {
    border-color: #12b7f5;
    color: #fff;
    background: #12b7f5;
    box-shadow: 0 0 0 3px color-mix(in srgb, #12b7f5 22%, transparent);
}
.qq-login-mark {
    display: inline-grid; width: 22px; height: 22px; place-items: center; border-radius: 50%;
    color: #fff; background: #12b7f5; font-size: .75rem; font-weight: 850;
}
.qq-login-button:hover .qq-login-mark, .qq-login-button:focus-visible .qq-login-mark { color: #12b7f5; background: #fff; }
.modal-header { padding: 18px 22px; border-color: var(--panel-border); }
.modal-body { padding: 22px; }
.search-modal .modal-content { overflow: hidden; }
.search-modal-header { align-items: flex-start; }
.search-modal-body { min-height: 260px; padding: 20px 22px 24px; }
.search-input-wrap { position: relative; }
.search-input-wrap > svg {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 15px;
    color: var(--text-muted);
    transform: translateY(-50%);
    pointer-events: none;
}
.search-input-wrap .form-control {
    min-height: 50px;
    padding: 10px 16px 10px 46px;
    font-size: 1.04rem;
}
.search-status { margin: 12px 2px 10px; color: var(--text-muted); font-size: .84rem; }
.search-result-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.search-result-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 7px;
    color: var(--text-main);
    background: var(--panel-muted);
    font-weight: 650;
    text-decoration: none;
}
.search-result-link:hover, .search-result-link:focus {
    color: var(--link-color);
    border-color: var(--link-color);
    outline: none;
}
.search-result-hint { flex: 0 0 auto; color: var(--text-muted); font-size: .78rem; font-weight: 500; }

.profile-summary { padding: 30px 24px; text-align: center; }
.profile-avatar-editor {
    position: relative; display: block; width: 112px; height: 112px; margin: 0 auto 8px;
    overflow: hidden; border: 2px solid var(--panel-bg); border-radius: 50%;
    background: var(--avatar-bg); box-shadow: 0 0 0 1px var(--panel-border); cursor: pointer;
}
.profile-avatar-editor > img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-overlay {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    flex-direction: column; gap: 4px; color: #fff; background: rgba(15, 25, 22, .68);
    font-size: .76rem; font-weight: 650; opacity: 0; transition: opacity 160ms ease;
}
.profile-avatar-overlay svg {
    width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7;
    stroke-linecap: round; stroke-linejoin: round;
}
.profile-avatar-editor:hover .profile-avatar-overlay,
.profile-avatar-editor:focus-within .profile-avatar-overlay,
.profile-avatar-editor[aria-busy="true"] .profile-avatar-overlay { opacity: 1; }
.profile-avatar-editor:focus-within { box-shadow: 0 0 0 4px var(--focus-ring); }
.profile-avatar-editor[aria-busy="true"] { cursor: wait; }
.profile-avatar-feedback { min-height: 20px; margin: 0 0 8px; color: var(--text-muted); font-size: .78rem; }
.profile-avatar-feedback.is-success { color: var(--link-color); }
.profile-avatar-feedback.is-error { color: #b42318; }
.profile-readonly-field[readonly] {
    color: var(--text-muted); border-color: var(--panel-border); background: var(--panel-muted);
    cursor: not-allowed; box-shadow: none;
}
.profile-summary h1 { margin: 10px 0 2px; font-size: 1.7rem; }
.profile-summary p { margin: 0; color: var(--text-muted); }
.profile-email { margin-top: 8px !important; overflow-wrap: anywhere; }
.role-badge, .status-pill { display: inline-flex; padding: 4px 9px; border-radius: 999px; color: var(--link-color); background: color-mix(in srgb, var(--link-color) 12%, transparent); font-size: .76rem; font-weight: 700; }

.settings-panel, .editor-panel { padding: 34px; }
.section-heading { margin-bottom: 26px; padding-bottom: 18px; border-bottom: 1px solid var(--panel-border); }
.editor-panel { width: min(100%, 1080px); min-width: 0; }
.editor-heading { align-items: flex-start; }
.post-editor { width: 100%; min-width: 0; min-height: 360px; overflow: hidden; }
.post-editor .toastui-editor-defaultUI { width: 100%; min-width: 0; overflow: hidden; border-color: var(--panel-border); border-radius: 6px; }
/* Toast UI 的 Markdown 模式是 flex 双栏。覆盖其内部最小宽度，避免编辑区把外层卡片撑开。 */
.post-editor .toastui-editor-main,
.post-editor .toastui-editor-md-container,
.post-editor .toastui-editor-md-preview,
.post-editor .toastui-editor-ww-container { min-width: 0; }
.post-editor .toastui-editor-md-container,
.post-editor .toastui-editor-md-preview { max-width: 100%; }
.post-editor .toastui-editor-toolbar { overflow-x: auto; overflow-y: hidden; }
.post-editor-fallback { min-height: 360px; font-family: var(--bs-font-monospace); line-height: 1.65; }
.post-content .toastui-editor-contents { color: var(--text-main); font-size: 1rem; }
/* Toast UI 默认给正文元素写死深色（#222/#999），暗黑模式下会显示成黑字；这里统一跟随主题变量。 */
.post-content .toastui-editor-contents p,
.post-content .toastui-editor-contents h1,
.post-content .toastui-editor-contents h2,
.post-content .toastui-editor-contents h3,
.post-content .toastui-editor-contents h4,
.post-content .toastui-editor-contents h5,
.post-content .toastui-editor-contents h6,
.post-content .toastui-editor-contents ul,
.post-content .toastui-editor-contents ol,
.post-content .toastui-editor-contents menu,
.post-content .toastui-editor-contents dir,
.post-content .toastui-editor-contents table { color: var(--text-main); }
.post-content .toastui-editor-contents del,
.post-content .toastui-editor-contents blockquote,
.post-content .toastui-editor-contents blockquote p,
.post-content .toastui-editor-contents blockquote ul,
.post-content .toastui-editor-contents blockquote ol { color: var(--text-muted); }
.post-content .toastui-editor-contents a { color: var(--link-color); }
/* 行内代码（非 pre 内）：浅底深字适配两种主题；代码块由下方 pre code 规则单独控制。 */
.post-content .toastui-editor-contents :not(pre) > code {
    color: var(--link-color);
    background: color-mix(in srgb, var(--link-color) 12%, transparent);
    padding: 2px 5px;
    border-radius: 4px;
}
/* 表格表头保持白色文字，避免上面的 p 覆盖把它改成主题文字后在浅色模式下对比度下降。 */
.post-content .toastui-editor-contents th p { color: #fff; }
.post-content .toastui-editor-contents img { max-width: 100%; height: auto; border-radius: 6px; }
.post-content .toastui-editor-contents pre { position: relative; margin: 1.25rem 0; padding: 42px 18px 18px; overflow-x: auto; border: 1px solid #303942; border-radius: 7px; color: #e6edf3; background: #161b22; }
.post-content .toastui-editor-contents pre::before { position: absolute; inset: 0 0 auto; display: block; height: 30px; padding: 6px 14px; border-bottom: 1px solid #303942; color: #9aa4ae; background: #21262d; content: attr(data-language); font-family: var(--bs-font-monospace); font-size: .72rem; font-weight: 700; }
.post-content .toastui-editor-contents pre code { color: inherit; background: transparent; }
.post-content .toastui-editor-contents .code-copy-button {
    position: absolute; z-index: 1; top: 0; right: 8px;
    display: inline-grid; width: 30px; height: 30px; padding: 0; place-items: center;
    border: 0; border-radius: 0 0 6px 6px; color: #9aa4ae; background: transparent; cursor: pointer;
    transition: color 150ms ease, background-color 150ms ease;
}
.post-content .toastui-editor-contents .code-copy-button:hover,
.post-content .toastui-editor-contents .code-copy-button:focus-visible {
    color: #e6edf3; background: rgba(255, 255, 255, .1); outline: none;
}
.post-content .toastui-editor-contents .code-copy-icon {
    width: 16px; height: 16px; fill: none; stroke: currentColor;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.post-content .toastui-editor-contents .code-copy-icon-check { display: none; }
.post-content .toastui-editor-contents .code-copy-button.is-copied { color: #83d6c1; }
.post-content .toastui-editor-contents .code-copy-button.is-copied .code-copy-icon { display: none; }
.post-content .toastui-editor-contents .code-copy-button.is-copied .code-copy-icon-check { display: block; }
.post-content .toastui-editor-contents .code-copy-button:disabled { cursor: wait; opacity: .86; }
.post-content .toastui-editor-contents pre code.language-javascript, .post-content .toastui-editor-contents pre code.lang-javascript { color: #f0db4f; }
.post-viewer-fallback { white-space: pre-wrap; font-family: var(--bs-font-monospace); }
.editor-actions { padding-top: 4px; }
.editor-primary-actions { display: flex; gap: 10px; }
.editor-primary-actions > .btn { min-height: 42px; }
.editor-preview-button {
    display: inline-flex; padding-inline: 15px; align-items: center; justify-content: center; gap: 8px;
    border: 1px solid var(--panel-border); color: var(--text-main); background: var(--panel-bg);
    font-weight: 600;
}
.editor-preview-button svg {
    width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7;
    stroke-linecap: round; stroke-linejoin: round;
}
.editor-preview-button:hover, .editor-preview-button:focus-visible {
    color: var(--link-color); border-color: color-mix(in srgb, var(--link-color) 48%, var(--panel-border));
    background: color-mix(in srgb, var(--link-color) 7%, var(--panel-bg));
    box-shadow: 0 0 0 3px var(--focus-ring); outline: none;
}
.editor-preview-button:active {
    color: var(--link-hover); border-color: var(--link-color);
    background: color-mix(in srgb, var(--link-color) 12%, var(--panel-bg));
}
.post-preview-modal .modal-body { padding: 30px 34px 42px; }
.post-preview-heading { margin: 0 0 24px; padding-bottom: 18px; border-bottom: 1px solid var(--panel-border); font-size: 2rem; line-height: 1.3; }
.post-detail-cover, .post-preview-cover {
    /* 746px × 420px 是 16:9 的上限；大屏不再让横图随容器无限增高。 */
    width: 100%; max-width: 746px; height: auto; max-height: 420px; margin: 0 auto 22px;
    aspect-ratio: 16 / 9; border-radius: 6px; object-fit: cover;
}
.post-detail-cover-wrap { position: relative; width: 100%; max-width: 746px; margin: 0 auto 22px; }
.post-cover-zoom {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-grid;
    width: 42px;
    height: 42px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(15, 25, 22, .52);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    cursor: pointer;
    opacity: 0;
    transition: opacity 180ms ease, background-color 180ms ease, transform 180ms ease;
}
.post-cover-zoom svg {
    width: 20px; height: 20px; fill: none; stroke: currentColor;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.post-detail-cover-wrap:hover .post-cover-zoom,
.post-cover-zoom:focus-visible { opacity: 1; }
.post-cover-zoom:hover { background: rgba(15, 25, 22, .72); transform: scale(1.06); }
/* 触屏设备没有 hover，放大按钮始终保持可见，保证可用性。 */
@media (hover: none) {
    .post-cover-zoom { opacity: 1; }
}
.post-cover-preview-modal .modal-dialog { max-width: min(1140px, calc(100vw - 2rem)); }
.post-cover-preview-modal .modal-body {
    display: grid; min-height: 220px; padding: 16px; place-items: center; overflow: auto;
}
.post-cover-preview-image {
    display: block; width: auto; max-width: 100%; max-height: calc(100vh - 180px); height: auto;
    border-radius: 6px; object-fit: contain;
}
.post-cover-preview-status { margin: 0; color: var(--text-muted); text-align: center; }
.post-detail-summary, .post-preview-summary {
    margin: 0 0 24px; color: var(--text-muted); font-size: 1.06rem; line-height: 1.75;
}
.form-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.post-cover-uploader {
    position: relative; display: grid; width: min(100%, 640px); overflow: hidden;
    aspect-ratio: 16 / 9; place-items: center; border: 1px dashed var(--panel-border);
    border-radius: 7px; color: var(--text-muted); background: var(--input-bg); cursor: pointer;
}
.post-cover-uploader:hover { border-color: var(--link-color); color: var(--link-color); }
.post-cover-uploader img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.post-publish-switch { padding-block: 4px; }
.status-published { color: #176b58; background: color-mix(in srgb, #25a67f 13%, var(--panel-bg)); }
.status-unpublished { color: var(--text-muted); background: var(--input-bg); }
.preview-empty { margin: 0; padding: 52px 20px; border: 1px dashed var(--panel-border); border-radius: 7px; color: var(--text-muted); text-align: center; }
.preview-hint { margin-right: auto; color: var(--text-muted); font-size: .85rem; }

/* loading 状态由 ui.js 统一生成；固定间距并禁止再次点击。 */
.btn[aria-busy="true"] { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; }
.btn-primary[aria-busy="true"] { color: #fff; border-color: #19715f; background: #19715f; opacity: .78; }

.comments-section { margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--panel-border); }
.comments-heading, .comment-form-footer, .comment-meta { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.comments-heading h2 { margin: .2rem 0 0; font-size: 1.35rem; }
.comment-count, .comment-status, .comment-meta time { color: var(--text-muted); font-size: .86rem; }
.comment-list { margin-top: 1.25rem; }
.comment-item { display: flex; gap: .85rem; padding: 1.1rem 0; border-bottom: 1px solid var(--panel-border); }
.comment-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.comment-body { min-width: 0; flex: 1; }
.comment-meta { justify-content: flex-start; }
.comment-body p { margin: .45rem 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.comment-empty { margin: 1.5rem 0; color: var(--text-muted); }
.comment-form { margin-top: 1.5rem; }
.comment-form textarea { min-height: 96px; resize: vertical; }
.comment-form-footer { margin-top: .75rem; }
.comment-thread + .comment-thread { border-top: 1px solid var(--panel-border); }
.comment-thread > .comment-item { border-bottom: 0; }
.comment-replies { margin: 0 0 .75rem 3.1rem; padding: 0 .9rem; background: var(--panel-muted); }
.comment-replies .comment-item:last-child { border-bottom: 0; }
.comment-actions { margin-top: .35rem; }
.comment-reply-button, .comment-reply-cancel { padding: 0; border: 0; color: var(--text-muted); background: transparent; font-size: .86rem; }
.comment-reply-button:hover, .comment-reply-cancel:hover { color: var(--link-color); }
.comment-mention { color: var(--link-color); }
.comment-replying { display: flex; justify-content: space-between; margin-bottom: .55rem; color: var(--text-muted); font-size: .9rem; }

.error-panel { max-width: 680px; margin: 64px auto 0; padding: 52px 42px; text-align: center; }
.error-code { color: var(--link-color); font-size: 6rem; font-weight: 800; line-height: 1; }
.error-panel h1 { margin: 18px 0 10px; font-size: 2rem; }
.error-panel p { max-width: 520px; margin: 0 auto 26px; color: var(--text-muted); }

/* 管理后台使用独立的固定导航和工作区布局，保持信息密度而不套用前台卡片。 */
.admin-body { min-height: 100vh; background: var(--page-bg); }
.admin-shell { display: grid; min-height: 100vh; grid-template-columns: 236px minmax(0, 1fr); }
.admin-sidebar { position: sticky; top: 0; display: flex; height: 100vh; padding: 22px 16px; flex-direction: column; color: #fff; background: #15231f; }
.admin-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 24px; color: #fff; font-weight: 750; text-decoration: none; }
.admin-nav { display: grid; gap: 4px; }
.admin-nav a, .admin-return { padding: 10px 12px; border-radius: 6px; color: rgba(255,255,255,.7); text-decoration: none; }
.admin-nav a:hover, .admin-nav a.active, .admin-return:hover { color: #fff; background: rgba(255,255,255,.1); }
.admin-return { margin-top: auto; }
.admin-main { min-width: 0; }
.admin-topbar { display: flex; min-height: 68px; padding: 10px 28px; align-items: center; gap: 14px; border-bottom: 1px solid var(--panel-border); background: var(--panel-bg); }
.admin-topbar-heading { display: grid; margin-right: auto; }
.admin-topbar span { color: var(--text-muted); font-size: .78rem; }
.admin-topbar img { width: 38px; height: 38px; border-radius: 50%; }
.admin-theme-toggle { border-color: var(--panel-border); background: var(--panel-bg); }
.admin-editor-shell { min-height: auto; place-items: start center; }
.admin-menu-toggle { display: none; border: 0; color: var(--text-main); background: transparent; font-size: 1.3rem; }
.admin-content { padding: 32px; }
.admin-access-state { margin: 60px auto; color: var(--text-muted); text-align: center; }
.admin-page-heading { display: flex; margin-bottom: 24px; align-items: end; justify-content: space-between; gap: 18px; }
.admin-page-heading h1 { margin: 3px 0 0; font-size: 1.65rem; }
.admin-metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.admin-metric-grid a { display: grid; padding: 24px; border: 1px solid var(--panel-border); border-radius: 8px; color: var(--text-main); background: var(--panel-bg); text-decoration: none; }
.admin-metric-grid strong { margin: 8px 0 2px; font-size: 2rem; }
.admin-metric-grid small { color: var(--text-muted); }
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--panel-border); border-radius: 8px; background: var(--panel-bg); }
.admin-table { width: 100%; min-width: 720px; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 14px 16px; border-bottom: 1px solid var(--panel-border); text-align: left; vertical-align: middle; }
.admin-table th { color: var(--text-muted); background: var(--panel-muted); font-size: .78rem; text-transform: uppercase; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table a:not(.btn) { color: var(--text-main); font-weight: 650; text-decoration: none; }
.admin-user-cell { display: flex; align-items: center; gap: 10px; }
.admin-user-cell img { width: 38px; height: 38px; border-radius: 50%; }
.admin-user-cell div { display: grid; }
.admin-user-cell span { color: var(--text-muted); font-size: .8rem; }
.admin-row-actions { display: flex; gap: 7px; white-space: nowrap; }
.admin-empty { margin: 0; padding: 40px; color: var(--text-muted); text-align: center; }
.admin-page-help { margin: -10px 0 20px; color: var(--text-muted); }
.admin-delete-modal { max-width: 460px; margin-inline: auto; }
.admin-delete-modal .modal-header { min-height: 32px; padding: 16px 20px 0; }
.admin-delete-modal .modal-body { padding-inline: 28px; }
.admin-delete-modal .modal-footer { padding: 12px 28px 26px; }
.admin-delete-modal .modal-title { margin: 5px 0 10px; font-size: 1.35rem; }
.delete-modal-message { margin: 0; color: var(--text-muted); line-height: 1.65; }

@media (max-width: 767.98px) {
    .blog-navbar .navbar-collapse { padding: 10px 0 4px; }
    .navbar-actions { flex-wrap: wrap; padding-top: 8px; }
    .page-content { padding-top: 26px; }
    .page-heading { display: block; }
    .page-heading p { margin-top: 6px; text-align: left; }
    .post-card { gap: 14px; padding: 19px; }
    .post-card-cover { flex-basis: 150px; }
    .post-detail { padding: 24px 20px; }
    .post-detail h1 { font-size: 1.85rem; }
    .author-avatar { flex-basis: 42px; width: 42px; height: 42px; font-size: .9rem; }
    .navbar-search-trigger kbd { display: none; }
    .search-modal-body { min-height: 220px; padding-inline: 16px; }
    .search-result-link { align-items: flex-start; flex-direction: column; gap: 2px; }
    .section-heading { align-items: stretch; flex-direction: column; }
    .editor-actions > .btn { width: 100%; }
    .editor-primary-actions { width: 100%; }
    .editor-primary-actions .btn { flex: 1; }
    .post-preview-modal .modal-body { padding: 24px 20px 34px; }
    .post-editor { min-height: 280px; }
    /* 窄屏下 Markdown 编辑和预览由 Toast UI 的标签切换展示，不强行并排压缩。 */
    .post-editor .toastui-editor-md-container,
    .post-editor .toastui-editor-md-preview { width: 100%; }
    .comment-replies { margin-left: 1.25rem; padding: 0 .65rem; }
    .site-footer-main { flex-direction: column; gap: 3px; text-align: center; }
    .user-popover { width: min(292px, calc(100vw - 28px)); }
    .admin-shell { display: block; }
    .admin-sidebar { position: fixed; z-index: 1050; width: 236px; transform: translateX(-100%); transition: transform 180ms ease; }
    .admin-sidebar.open { transform: translateX(0); box-shadow: 10px 0 30px rgba(0,0,0,.18); }
    .admin-menu-toggle { display: block; }
    .admin-topbar { padding-inline: 16px; }
    .admin-content { padding: 24px 16px; }
    .admin-metric-grid { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
    .post-card { display: block; }
    .post-card-cover { display: block; width: 100%; margin-bottom: 16px; }
    .author-avatar { margin-bottom: 12px; }
    .auth-card, .settings-panel, .editor-panel { padding: 24px 18px; }
    .error-panel { margin-top: 28px; padding: 36px 20px; }
    .error-code { font-size: 4.5rem; }
}

/* ============================================================
   现代视觉增强层：Hero、链接动效、滚动渐显与组件微交互。
   这层覆盖在上面的基础样式之后，只负责观感提升，不改变布局语义。
   ============================================================ */

/* 品牌描边按钮：用于浅色导航栏上的“登录”等次要与主按钮区分。 */
.btn-outline-primary {
    --bs-btn-color: var(--link-color);
    --bs-btn-border-color: color-mix(in srgb, var(--link-color) 45%, var(--panel-border));
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--link-color);
    --bs-btn-hover-border-color: var(--link-color);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--link-hover);
    --bs-btn-active-border-color: var(--link-hover);
    background: transparent;
}

/* 全局键盘焦点：让键盘用户也能看到清晰的焦点环，不覆盖组件自身的 focus 样式。 */
a:focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
    border-radius: 3px;
}

/* 首页 Hero：博客的“门面”，用品牌渐变色块和留白营造欢迎氛围。 */
.hero {
    position: relative;
    margin-bottom: 34px;
    padding: clamp(30px, 5vw, 52px) clamp(22px, 5vw, 48px);
    overflow: hidden;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(120% 150% at 100% 0%, color-mix(in srgb, var(--brand-400) 16%, transparent), transparent 56%),
        var(--panel-bg);
    box-shadow: var(--panel-shadow);
}
.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}
.hero-eyebrow::before {
    width: 26px;
    height: 2px;
    border-radius: 2px;
    background: var(--brand-gradient);
    content: "";
}
.hero-title {
    max-width: 640px;
    margin: 0 0 16px;
    font-size: clamp(1.9rem, 4.5vw, 3rem);
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.02em;
}
.hero-accent {
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero-subtitle {
    max-width: 560px;
    margin: 0 0 26px;
    color: var(--text-muted);
    font-size: 1.08rem;
    line-height: 1.75;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* “阅读全文 / 浏览全部 / 返回”链接：悬停时用下划线从左到右展开。 */
.post-read-more, .sidebar-link, .back-link {
    background-image: linear-gradient(currentColor, currentColor);
    background-position: 0 100%;
    background-repeat: no-repeat;
    background-size: 0% 1px;
    padding-bottom: 2px;
    transition: background-size 220ms ease, color 150ms ease;
}
.post-read-more:hover, .sidebar-link:hover, .back-link:hover { background-size: 100% 1px; }

/* 文章分类小标签：从灰底改为品牌色浅底，让分类一眼可辨。 */
.post-category {
    padding: 2px 10px;
    border: 1px solid color-mix(in srgb, var(--link-color) 22%, transparent);
    border-radius: var(--radius-pill);
    color: var(--link-color);
    background: color-mix(in srgb, var(--link-color) 9%, transparent);
    font-size: .76rem;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 150ms ease, border-color 150ms ease;
}
.post-category:hover, .post-category:focus-visible {
    border-color: color-mix(in srgb, var(--link-color) 45%, transparent);
    background: color-mix(in srgb, var(--link-color) 18%, transparent);
}

/* 标题排版：加大字重并轻微收紧字距，让标题更有力量感。 */
.eyebrow { letter-spacing: .14em; }
.page-heading h1, .activity-page-header h1 { font-weight: 800; letter-spacing: -.01em; }
.post-card h2 { font-weight: 750; letter-spacing: -.012em; }
.post-detail h1 { font-weight: 800; letter-spacing: -.02em; }

/* 后台概览卡片：悬停浮起，弱化纯静态表格感。 */
.admin-metric-grid a {
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.admin-metric-grid a:hover {
    border-color: color-mix(in srgb, var(--link-color) 35%, var(--panel-border));
    box-shadow: var(--panel-shadow-lg);
    transform: translateY(-3px);
}

/* 滚动渐显：reveal.js 在 <html> 上加 reveal-ready，进入视口时加 is-visible。 */
.reveal {
    transition: opacity .55s ease, transform .55s ease;
    transition-delay: var(--reveal-delay, 0ms);
}
html.reveal-ready .reveal { opacity: 0; transform: translateY(18px); }
html.reveal-ready .reveal.is-visible { opacity: 1; transform: none; }

@media (max-width: 767.98px) {
    .hero { margin-bottom: 26px; }
}

/* 尊重系统“减少动态效果”偏好：关闭位移渐显与平滑滚动，避免晕动。 */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
    .reveal, html.reveal-ready .reveal { opacity: 1 !important; transform: none !important; }
}
