/* ==========================================================================
   NanoPress 2 — 前台与共享样式
   ========================================================================== */

:root {
    --accent-color: #4d9fff;
    --accent-rgb: 77, 159, 255;
    --accent-hover: rgba(77, 159, 255, 0.82);
    --accent-soft: rgba(77, 159, 255, 0.12);
    --on-accent: #ffffff;
    --bg-primary: #f0f5f9;
    --bg-secondary: #ffffff;
    --text-primary: #212529;
    --text-secondary: #495057;
    --text-muted: #6b7785;
    --border-color: #dee2e6;
    --card-bg: #ffffff;
    --card-blur: 0px;
    --success: #16a34a;
    --success-soft: rgba(22, 163, 74, 0.12);
    --danger: #dc3545;
    --danger-soft: rgba(220, 53, 69, 0.12);
    --warning: #d97706;
    --warning-soft: rgba(217, 119, 6, 0.12);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 2px 8px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 8px 30px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 24px 70px rgba(15, 23, 42, 0.12);
    --radius-xl: 22px;
    --radius-lg: 18px;
    --radius: 14px;
    --radius-sm: 10px;
    --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    --header-h: 72px;
    --sidebar-w: 300px;
    --content-w: 1200px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="dark"] {
    --bg-primary: #0f1115;
    --bg-secondary: #171a21;
    --text-primary: #e6e9ef;
    --text-secondary: #b6bec9;
    --text-muted: #8b95a3;
    --border-color: #2a2f3a;
    --card-bg: rgba(23, 26, 33, 0.9);
    --card-blur: 0px;
    --success: #4ade80;
    --success-soft: rgba(74, 222, 128, 0.14);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, 0.14);
    --warning: #fbbf24;
    --warning-soft: rgba(251, 191, 36, 0.14);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 2px 10px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 12px 36px rgba(0, 0, 0, 0.38);
    --shadow-lg: 0 26px 80px rgba(0, 0, 0, 0.5);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.65;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    background-image: radial-gradient(circle at 12% 0%, rgba(var(--accent-rgb), 0.1), transparent 34%), radial-gradient(circle at 100% 0%, rgba(var(--accent-rgb), 0.05), transparent 28%);
    background-attachment: fixed;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.page-post {
    background-image: radial-gradient(circle at 50% -10%, rgba(var(--accent-rgb), 0.12), transparent 38%), radial-gradient(circle at 100% 0%, rgba(var(--accent-rgb), 0.04), transparent 30%);
}

::selection {
    background: rgba(var(--accent-rgb), 0.28);
}

img {
    max-width: 100%;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.18s ease;
}

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

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

button {
    cursor: pointer;
}

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

::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.35);
    border-radius: 99px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.55);
    background-clip: padding-box;
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, 0.4) transparent;
}

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

.icon {
    width: 1.15em;
    height: 1.15em;
    display: inline-block;
    vertical-align: -0.18em;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.skip-link {
    position: fixed;
    left: 16px;
    top: -80px;
    z-index: 9999;
    padding: 10px 16px;
    border-radius: 10px;
    background: var(--accent-color);
    color: var(--on-accent);
    transition: top 0.2s;
}

.skip-link:focus {
    top: 16px;
    color: var(--on-accent);
}

/* ---------- 布局 ---------- */
.container {
    width: 100%;
    max-width: var(--content-w);
    margin: 0 auto;
    padding: 0 24px;
}

.site-main {
    padding: 34px 0 70px;
    min-height: calc(100vh - var(--header-h) - 220px);
}

.page-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--sidebar-w);
    gap: 30px;
    align-items: start;
}

.content-col {
    min-width: 0;
}

.narrow-container {
    max-width: 840px;
}

/* ---------- 头部 ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-secondary);
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

html[data-theme="dark"] .site-header {
    border-bottom-color: var(--border-color);
    box-shadow: 0 1px 24px rgba(0, 0, 0, 0.25);
}

.header-inner {
    max-width: var(--content-w);
    margin: 0 auto;
    padding: 0 24px;
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 22px;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    color: var(--text-primary);
}

.site-brand:hover {
    color: var(--text-primary);
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-color), rgba(var(--accent-rgb), 0.62));
    color: var(--on-accent);
    font-weight: 800;
    font-size: 18px;
    letter-spacing: -0.02em;
    box-shadow: 0 6px 16px rgba(var(--accent-rgb), 0.3);
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}

.brand-title {
    font-size: 17px;
    font-weight: 750;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-sub {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 4px;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 13px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 550;
    color: var(--text-secondary);
    white-space: nowrap;
    transition: background 0.18s ease, color 0.18s ease;
}

.nav-link:hover {
    background: rgba(var(--accent-rgb), 0.08);
    color: var(--accent-color);
}

.nav-link.active {
    background: var(--accent-soft);
    color: var(--accent-color);
}

.header-search {
    position: relative;
    margin-left: auto;
    width: 220px;
    flex-shrink: 0;
}

.header-search .icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 16px;
    height: 16px;
    pointer-events: none;
}

.header-search input {
    width: 100%;
    height: 38px;
    padding: 0 14px 0 38px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.header-search input:focus {
    border-color: var(--accent-color);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.14);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.icon-button {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    transition: background 0.18s, color 0.18s, border-color 0.18s;
}

.icon-button:hover {
    background: rgba(var(--accent-rgb), 0.08);
    color: var(--accent-color);
}

.icon-button .icon {
    width: 19px;
    height: 19px;
}

.theme-icon-dark {
    display: none;
}

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

html[data-theme="dark"] .theme-icon-dark {
    display: inline-flex;
}

.menu-toggle {
    display: none;
}

.menu-toggle .menu-close {
    display: none;
}

body.nav-open .menu-toggle .menu-open {
    display: none;
}

body.nav-open .menu-toggle .menu-close {
    display: inline-flex;
}

.mobile-panel {
    display: none;
    padding: 14px 20px 20px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

body.nav-open .mobile-panel {
    display: block;
    animation: slide-down 0.22s var(--ease);
}

@keyframes slide-down {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.mobile-search {
    position: relative;
    margin-bottom: 12px;
}

.mobile-search .icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.mobile-search input {
    width: 100%;
    height: 42px;
    padding: 0 14px 0 40px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    outline: none;
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mobile-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 13px;
    border-radius: 10px;
    color: var(--text-secondary);
    font-weight: 550;
}

.mobile-nav a.active,
.mobile-nav a:hover {
    background: var(--accent-soft);
    color: var(--accent-color);
}

/* ---------- 页面标题 ---------- */
.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.eyebrow {
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-color);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.page-heading h1 {
    margin: 0;
    font-size: clamp(25px, 3vw, 32px);
    line-height: 1.25;
    letter-spacing: -0.03em;
    font-weight: 780;
}

.heading-prefix {
    color: var(--text-muted);
    font-weight: 500;
}

.heading-count {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    height: 30px;
    padding: 0 13px;
    border-radius: 999px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 12.5px;
    font-weight: 600;
}

/* ---------- 表面卡片 ---------- */
.surface,
.post-card,
.side-card,
.article,
.card,
.comment-form,
.search-panel,
.prev-next-item,
.archive-year {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(var(--card-blur));
    -webkit-backdrop-filter: blur(var(--card-blur));
}

/* ---------- 文章卡片 ---------- */
.post-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.post-card {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    overflow: hidden;
    transition: transform 0.24s var(--ease), box-shadow 0.24s var(--ease), border-color 0.24s;
}

.post-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: rgba(var(--accent-rgb), 0.3);
}

.post-card.is-hidden-post {
    border-style: dashed;
}

.post-card-cover {
    position: relative;
    display: block;
    min-height: 150px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.16), rgba(var(--accent-rgb), 0.04));
}

.post-card-cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s var(--ease), filter 0.3s;
}

.post-card:hover .post-card-cover img {
    transform: scale(1.045);
    filter: brightness(0.94);
}

.post-card-cover.is-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}

.cover-letter {
    width: 62px;
    height: 62px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--accent-rgb), 0.16);
    border: 1px solid rgba(var(--accent-rgb), 0.24);
    color: var(--accent-color);
    font-size: 26px;
    font-weight: 800;
    transform: rotate(-4deg);
}

.post-card-body {
    padding: 20px 24px 18px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.post-card-title {
    margin: 0 0 8px;
    font-size: 19px;
    line-height: 1.45;
    font-weight: 700;
    letter-spacing: -0.015em;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.post-card-title a {
    color: var(--text-primary);
}

.post-card-title a:hover {
    color: var(--accent-color);
}

.post-card-excerpt {
    margin: 0 0 14px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-meta {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    color: var(--text-muted);
    font-size: 12.5px;
}

.post-card-meta span,
.post-card-meta a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
}

.post-card-meta a:hover {
    color: var(--accent-color);
}

.post-card-meta .icon {
    width: 14px;
    height: 14px;
    opacity: 0.8;
}

/* ---------- 徽章与标签 ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 22px;
    padding: 0 8px;
    border-radius: 6px;
    background: rgba(100, 116, 139, 0.1);
    color: var(--text-muted);
    font-size: 11.5px;
    font-weight: 650;
    line-height: 1;
    vertical-align: middle;
    white-space: nowrap;
}

.badge .icon {
    width: 12px;
    height: 12px;
}

.badge-pin {
    background: var(--accent-soft);
    color: var(--accent-color);
}

.badge-draft {
    background: var(--warning-soft);
    color: var(--warning);
}

.badge-private {
    background: var(--danger-soft);
    color: var(--danger);
}

.badge-success {
    background: var(--success-soft);
    color: var(--success);
}

.badge-accent {
    background: var(--accent-soft);
    color: var(--accent-color);
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 999px;
    background: rgba(100, 116, 139, 0.08);
    color: var(--text-secondary);
    font-size: 12.5px;
    font-weight: 550;
    transition: background 0.18s, color 0.18s, transform 0.18s;
}

.tag-chip span {
    color: var(--text-muted);
    font-size: 10.5px;
    font-weight: 700;
}

.tag-chip:hover,
.tag-chip.is-active {
    background: var(--accent-color);
    color: var(--on-accent);
    transform: translateY(-1px);
}

.tag-chip:hover span,
.tag-chip.is-active span {
    color: rgba(255, 255, 255, 0.75);
}

.ghost-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 550;
    background: transparent;
}

.ghost-pill:hover {
    border-color: rgba(var(--accent-rgb), 0.45);
    background: var(--accent-soft);
    color: var(--accent-color);
}

/* ---------- 按钮 ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    padding: 0 17px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: rgba(100, 116, 139, 0.1);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 630;
    line-height: 1;
    white-space: nowrap;
    transition: transform 0.16s, background 0.16s, box-shadow 0.16s, color 0.16s, border-color 0.16s;
}

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

.btn:active {
    transform: translateY(0);
}

.btn .icon {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: var(--accent-color);
    color: var(--on-accent);
    box-shadow: 0 8px 20px rgba(var(--accent-rgb), 0.24);
}

.btn-primary:hover {
    background: var(--accent-color);
    filter: brightness(1.05);
    color: var(--on-accent);
    box-shadow: 0 10px 26px rgba(var(--accent-rgb), 0.32);
}

.btn-ghost {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-ghost:hover {
    border-color: rgba(var(--accent-rgb), 0.5);
    background: var(--accent-soft);
    color: var(--accent-color);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger-ghost {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: transparent;
}

.btn-danger-ghost:hover {
    background: var(--danger);
    color: #fff;
}

.btn-sm {
    min-height: 32px;
    padding: 0 12px;
    font-size: 12.5px;
    border-radius: 8px;
}

.btn-sm .icon {
    width: 14px;
    height: 14px;
}

.btn-block {
    width: 100%;
}

.btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    color: var(--accent-color);
}

.text-link .icon {
    width: 14px;
    height: 14px;
}

/* ---------- 侧边栏 ---------- */
.sidebar {
    position: sticky;
    top: calc(var(--header-h) + 24px);
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.side-card {
    padding: 19px 20px;
    border-radius: var(--radius-lg);
}

.side-title {
    margin: 0 0 13px;
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13.5px;
    font-weight: 750;
    letter-spacing: 0.02em;
}

.side-title .icon {
    width: 16px;
    height: 16px;
    color: var(--accent-color);
}

.category-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.category-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-radius: 8px;
    transition: background 0.16s;
}

.category-list li:hover {
    background: rgba(var(--accent-rgb), 0.06);
}

.category-list a {
    flex: 1;
    min-width: 0;
    padding: 7px 9px;
    color: var(--text-secondary);
    font-size: 13.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-list a.is-active {
    color: var(--accent-color);
    font-weight: 650;
}

.category-list .count {
    margin-right: 8px;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(100, 116, 139, 0.09);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 650;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.side-empty {
    color: var(--text-muted);
    font-size: 12.5px;
    padding: 4px 9px;
}

.toc-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 330px;
    overflow: auto;
    margin: -3px -6px;
}

.toc-nav a {
    display: block;
    padding: 6px 8px;
    border-radius: 7px;
    color: var(--text-secondary);
    font-size: 12.8px;
    line-height: 1.45;
    border-left: 2px solid transparent;
}

.toc-nav a:hover {
    background: var(--accent-soft);
    color: var(--accent-color);
}

.toc-nav a.is-active {
    background: var(--accent-soft);
    color: var(--accent-color);
    border-left-color: var(--accent-color);
    font-weight: 600;
}

.toc-nav .toc-level-3 {
    padding-left: 22px;
    color: var(--text-muted);
    font-size: 12.2px;
}

.side-about {
    text-align: center;
    padding: 24px 20px;
}

.side-about-avatar {
    width: 62px;
    height: 62px;
    margin: 0 auto 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 25px;
    font-weight: 800;
    color: var(--on-accent);
    background: linear-gradient(135deg, var(--accent-color), rgba(var(--accent-rgb), 0.62));
    box-shadow: 0 10px 26px rgba(var(--accent-rgb), 0.28);
}

.side-about h2 {
    margin: 0 0 5px;
    font-size: 15px;
    font-weight: 750;
}

.side-about p {
    margin: 0 0 14px;
    color: var(--text-muted);
    font-size: 12.5px;
    line-height: 1.6;
}

.side-stats {
    display: flex;
    justify-content: center;
    gap: 22px;
    padding: 11px 0;
    margin-bottom: 13px;
    border-top: 1px dashed var(--border-color);
    border-bottom: 1px dashed var(--border-color);
    color: var(--text-muted);
    font-size: 11.5px;
}

.side-stats strong {
    display: block;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 750;
    line-height: 1.3;
}

.side-about-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}

.side-about-links a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 9px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 12.5px;
}

.side-about-links a:hover {
    background: var(--accent-soft);
    color: var(--accent-color);
}

.side-about-links .icon {
    width: 14px;
    height: 14px;
}

/* ---------- 文章详情 ---------- */
.post-layout .content-col {
    min-width: 0;
}

.article {
    padding: 38px 42px 32px;
    border-radius: var(--radius-xl);
}

.article-header {
    margin-bottom: 26px;
}

.article-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 13px;
}

.article-title {
    margin: 0 0 16px;
    font-size: clamp(28px, 3.4vw, 38px);
    line-height: 1.32;
    font-weight: 800;
    letter-spacing: -0.035em;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 18px;
    color: var(--text-muted);
    font-size: 13px;
}

.article-meta span,
.article-meta a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
}

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

.article-meta .icon {
    width: 14.5px;
    height: 14.5px;
    opacity: 0.85;
}

.article-cover {
    margin: 0 0 30px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.article-cover img {
    width: 100%;
    max-height: 460px;
    object-fit: cover;
    display: block;
}

.article-content {
    font-size: 16.5px;
    line-height: 1.9;
    color: var(--text-primary);
    word-wrap: break-word;
}

.article-content > :first-child {
    margin-top: 0;
}

.article-content > :last-child {
    margin-bottom: 0;
}

.article-content p {
    margin: 0 0 1.15em;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    margin: 1.8em 0 0.72em;
    line-height: 1.38;
    font-weight: 760;
    letter-spacing: -0.02em;
    scroll-margin-top: calc(var(--header-h) + 20px);
}

.article-content h1 { font-size: 1.95em; }
.article-content h2 {
    font-size: 1.55em;
    padding-bottom: 0.36em;
    border-bottom: 1px solid var(--border-color);
}
.article-content h3 { font-size: 1.28em; }
.article-content h4 { font-size: 1.12em; }

.article-content a {
    color: var(--accent-color);
    text-decoration: underline;
    text-decoration-color: rgba(var(--accent-rgb), 0.35);
    text-underline-offset: 3px;
    text-decoration-thickness: 1.5px;
}

.article-content a:hover {
    text-decoration-color: var(--accent-color);
}

.article-content strong {
    font-weight: 700;
}

.article-content ul,
.article-content ol {
    margin: 0 0 1.2em;
    padding-left: 1.5em;
}

.article-content li {
    margin: 0.35em 0;
}

.article-content li > ul,
.article-content li > ol {
    margin: 0.35em 0 0.2em;
}

.article-content blockquote {
    margin: 1.5em 0;
    padding: 16px 20px;
    border-left: 4px solid var(--accent-color);
    border-radius: 0 12px 12px 0;
    background: var(--accent-soft);
    color: var(--text-secondary);
}

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

.article-content code {
    font-family: var(--font-mono);
    font-size: 0.87em;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(100, 116, 139, 0.12);
    border: 1px solid rgba(100, 116, 139, 0.1);
}

.article-content pre {
    position: relative;
    margin: 1.5em 0;
    padding: 20px 22px;
    border-radius: 14px;
    background: #0f172a;
    color: #e6edf7;
    overflow: auto;
    font-size: 13.5px;
    line-height: 1.7;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
}

.article-content pre code {
    padding: 0;
    border: none;
    background: transparent;
    color: inherit;
    font-size: inherit;
    white-space: pre;
}

.code-copy {
    position: absolute;
    top: 10px;
    right: 10px;
    height: 28px;
    padding: 0 10px;
    border-radius: 7px;
    border: 1px solid rgba(226, 232, 240, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
    font-size: 11px;
    opacity: 0;
    transition: opacity 0.18s, background 0.18s;
}

pre:hover .code-copy {
    opacity: 1;
}

.code-copy:hover {
    background: rgba(255, 255, 255, 0.14);
}

.article-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.6em auto;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.article-content hr {
    border: none;
    height: 1px;
    background: var(--border-color);
    margin: 2.2em 0;
}

.article-content mark {
    background: rgba(250, 204, 21, 0.32);
    color: inherit;
    padding: 1px 3px;
    border-radius: 4px;
}

.article-content .table-wrap {
    width: 100%;
    overflow-x: auto;
    margin: 1.5em 0;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-secondary);
}

.md-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 480px;
}

.md-table th {
    background: rgba(100, 116, 139, 0.07);
    color: var(--text-primary);
    font-weight: 650;
    text-align: left;
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.md-table td {
    padding: 11px 15px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.md-table tr:last-child td {
    border-bottom: none;
}

.md-table tr:hover td {
    background: rgba(var(--accent-rgb), 0.035);
}

.article-content .task-list {
    list-style: none;
    padding-left: 0.4em;
}

.article-content .task-list .task-item input {
    accent-color: var(--accent-color);
    margin-right: 7px;
    transform: translateY(1px);
}

.article-footer {
    margin-top: 34px;
    padding-top: 22px;
    border-top: 1px solid var(--border-color);
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin-bottom: 20px;
}

.tags-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
    font-size: 12.5px;
    margin-right: 3px;
}

.article-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.like-form {
    display: inline-flex;
}

.like-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 40px;
    padding: 0 17px;
    border-radius: 999px;
    border: 1px solid rgba(var(--accent-rgb), 0.25);
    background: var(--accent-soft);
    color: var(--accent-color);
    font-size: 13.5px;
    font-weight: 650;
    transition: transform 0.16s, background 0.16s, color 0.16s;
}

.like-button .icon {
    width: 17px;
    height: 17px;
}

.like-button:hover:not(:disabled) {
    transform: translateY(-1px);
    background: rgba(var(--accent-rgb), 0.2);
}

.like-button.is-liked {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--on-accent);
}

.like-button:disabled {
    cursor: default;
}

.like-count {
    min-width: 22px;
    height: 21px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(var(--accent-rgb), 0.14);
    font-size: 11.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.like-button.is-liked .like-count {
    background: rgba(255, 255, 255, 0.2);
}

.article-updated {
    margin: 16px 0 0;
    color: var(--text-muted);
    font-size: 12px;
}

.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 1200;
    background: transparent;
    pointer-events: none;
}

.reading-progress span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--accent-color), rgba(var(--accent-rgb), 0.55));
    box-shadow: 0 0 10px rgba(var(--accent-rgb), 0.4);
    transition: width 0.08s linear;
}

.preview-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    margin-bottom: 18px;
    border-radius: var(--radius);
    background: var(--warning-soft);
    border: 1px solid rgba(217, 119, 6, 0.24);
    color: var(--warning);
}

.preview-banner strong {
    display: block;
    font-size: 13.5px;
}

.preview-banner span {
    display: block;
    color: var(--text-secondary);
    font-size: 12.5px;
}

.preview-banner .btn {
    margin-left: auto;
    color: var(--warning);
    border-color: rgba(217, 119, 6, 0.3);
}

.prev-next {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 24px 0;
}

.prev-next-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 17px 19px;
    border-radius: var(--radius);
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.prev-next-item:hover {
    transform: translateY(-2px);
    border-color: rgba(var(--accent-rgb), 0.35);
    box-shadow: var(--shadow-md);
}

.prev-next-item.next {
    text-align: right;
    align-items: flex-end;
}

.prev-next.is-single {
    grid-template-columns: 1fr;
}

.prev-next.is-single .prev-next-item.next {
    margin-left: auto;
    width: min(100%, 420px);
}

.prev-next.is-single .prev-next-item.prev {
    width: min(100%, 420px);
}

.prev-next-item.is-empty {
    visibility: hidden;
}

.prev-next-label {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 11.5px;
    font-weight: 600;
}

.prev-next-item strong {
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-section {
    margin: 34px 0 0;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 16px;
}

.section-heading h2 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 19px;
    font-weight: 750;
    letter-spacing: -0.02em;
}

.section-heading h2 .icon {
    color: var(--accent-color);
}

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

.related-card {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 17px;
    border-radius: var(--radius);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.related-card:hover {
    transform: translateY(-3px);
    border-color: rgba(var(--accent-rgb), 0.35);
    box-shadow: var(--shadow-md);
}

.related-date {
    color: var(--text-muted);
    font-size: 11px;
    letter-spacing: 0.04em;
}

.related-card strong {
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-summary {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- 评论 ---------- */
.comments {
    margin-top: 38px;
}

.comments-heading h2 {
    font-size: 19px;
}

.count-bubble {
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-color);
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.muted-note {
    color: var(--text-muted);
    font-size: 12px;
}

.comments-empty {
    padding: 20px 22px;
    border-radius: var(--radius);
    border: 1px dashed var(--border-color);
    color: var(--text-muted);
    font-size: 13.5px;
    margin-bottom: 18px;
}

.comments-empty p {
    margin: 0;
}

.comment-list {
    display: flex;
    flex-direction: column;
}

.comment-item {
    display: flex;
    gap: 14px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}

.comment-item:first-child {
    padding-top: 4px;
}

.comment-avatar {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.18), rgba(var(--accent-rgb), 0.06));
    border: 1px solid rgba(var(--accent-rgb), 0.16);
    color: var(--accent-color);
    font-weight: 750;
    font-size: 16px;
}

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

.comment-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 5px;
}

.comment-meta strong {
    font-size: 13.5px;
    font-weight: 650;
}

.comment-meta time {
    color: var(--text-muted);
    font-size: 11.5px;
}

.comment-content {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.75;
    word-wrap: break-word;
}

.comment-form {
    margin-top: 24px;
    padding: 24px;
    border-radius: var(--radius);
}

.comment-form-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
}

.comment-form-head h3 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 15px;
    font-weight: 700;
}

.comment-form-head h3 .icon {
    color: var(--accent-color);
}

.comment-form .field {
    margin-bottom: 14px;
}

.comment-form-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.char-count {
    color: var(--text-muted);
    font-size: 12px;
}

.comments-closed {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 18px 20px;
    border-radius: var(--radius);
    background: rgba(100, 116, 139, 0.07);
    color: var(--text-muted);
    font-size: 13.5px;
}

.honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ---------- 归档 ---------- */
.archive-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

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

.archive-year-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.archive-year-head h2 {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.archive-year-head h2 span {
    font-size: 12px;
    color: var(--text-muted);
    margin-left: 4px;
    font-weight: 500;
}

.archive-count {
    color: var(--text-muted);
    font-size: 12px;
}

.archive-month {
    padding: 8px 0;
}

.archive-month h3 {
    margin: 0 0 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    text-transform: uppercase;
}

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

.archive-month li {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 8px 10px;
    margin: 0 -10px;
    border-radius: 8px;
    transition: background 0.16s;
}

.archive-month li:hover {
    background: rgba(var(--accent-rgb), 0.06);
}

.archive-day {
    width: 26px;
    flex-shrink: 0;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 12px;
}

.archive-title {
    font-size: 14.5px;
    color: var(--text-primary);
    font-weight: 550;
}

.archive-title:hover {
    color: var(--accent-color);
}

.archive-cat {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 11.5px;
    white-space: nowrap;
}

/* ---------- 搜索 ---------- */
.search-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 24px;
    border-radius: var(--radius);
}

.search-panel > .icon {
    margin-left: 6px;
    color: var(--text-muted);
    width: 18px;
    height: 18px;
}

.search-panel input {
    flex: 1;
    min-width: 0;
    height: 40px;
    border: none;
    background: transparent;
    outline: none;
    font-size: 15px;
}

.search-panel .btn {
    flex-shrink: 0;
}

/* ---------- 友链 ---------- */
.links-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.link-card {
    display: flex;
    gap: 14px;
    padding: 18px;
    border-radius: var(--radius);
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.link-card:hover {
    transform: translateY(-3px);
    border-color: rgba(var(--accent-rgb), 0.35);
    box-shadow: var(--shadow-md);
}

.link-avatar {
    width: 52px;
    height: 52px;
    border-radius: 15px;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.2), rgba(var(--accent-rgb), 0.06));
    color: var(--accent-color);
    font-size: 20px;
    font-weight: 800;
    border: 1px solid rgba(var(--accent-rgb), 0.14);
}

.link-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.link-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.link-body strong {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-primary);
    font-size: 14.5px;
    font-weight: 700;
}

.link-body strong .icon {
    width: 13px;
    height: 13px;
    color: var(--text-muted);
}

.link-desc {
    color: var(--text-secondary);
    font-size: 12.5px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.link-host {
    color: var(--text-muted);
    font-size: 11px;
    font-family: var(--font-mono);
}

.friend-apply {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    padding: 22px 24px;
    border-radius: var(--radius);
}

.friend-apply-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    color: var(--accent-color);
    flex-shrink: 0;
}

.friend-apply h2 {
    margin: 0 0 3px;
    font-size: 15px;
    font-weight: 700;
}

.friend-apply p {
    margin: 0;
    color: var(--text-muted);
    font-size: 12.5px;
    line-height: 1.6;
}

.friend-apply .btn {
    margin-left: auto;
    flex-shrink: 0;
}

/* ---------- 关于 ---------- */
.about-card {
    padding: 38px 42px;
}

.about-lead {
    margin: 0 0 22px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 15px;
}

.about-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid var(--border-color);
}

/* ---------- 分页 ---------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;
    margin: 28px 0 0;
}

.page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 9px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    transition: background 0.16s, color 0.16s, border-color 0.16s, transform 0.16s;
}

a.page-btn:hover {
    border-color: rgba(var(--accent-rgb), 0.5);
    color: var(--accent-color);
    background: var(--accent-soft);
    transform: translateY(-1px);
}

.page-btn.is-active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--on-accent);
    box-shadow: 0 6px 16px rgba(var(--accent-rgb), 0.25);
}

.page-btn.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.page-arrow .icon {
    width: 16px;
    height: 16px;
}

.page-ellipsis {
    color: var(--text-muted);
    padding: 0 3px;
    user-select: none;
}

/* ---------- 空状态 ---------- */
.empty-state {
    padding: 70px 24px;
    text-align: center;
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border-color);
    background: rgba(255, 255, 255, 0.35);
}

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

.empty-state.compact {
    padding: 46px 20px;
    border: none;
    background: transparent;
}

.empty-icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 14px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    color: var(--accent-color);
}

.empty-icon .icon {
    width: 26px;
    height: 26px;
}

.empty-state h2 {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 700;
}

.empty-state p {
    margin: 0 auto 16px;
    max-width: 420px;
    color: var(--text-muted);
    font-size: 13.5px;
    line-height: 1.7;
}

/* ---------- 页脚 ---------- */
.site-footer {
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    padding: 30px 0;
}

.footer-inner {
    max-width: var(--content-w);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 11px;
}

.footer-brand .brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 16px;
}

.footer-brand strong {
    display: block;
    font-size: 13.5px;
    font-weight: 700;
}

.footer-brand p {
    margin: 1px 0 0;
    color: var(--text-muted);
    font-size: 11.5px;
}

.footer-copy {
    margin: 0;
    color: var(--text-muted);
    font-size: 12px;
}

.footer-links {
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
    font-size: 12px;
}

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

.footer-links .icon {
    width: 14px;
    height: 14px;
}

.back-to-top {
    position: fixed;
    right: 22px;
    bottom: 24px;
    z-index: 90;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.24s var(--ease);
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    color: var(--accent-color);
    border-color: rgba(var(--accent-rgb), 0.45);
}

/* ---------- Toast ---------- */
.toast-stack {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: min(360px, calc(100vw - 40px));
}

.toast {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px 16px;
    border-radius: 11px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 13.5px;
    line-height: 1.5;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
    transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
    pointer-events: auto;
}

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

.toast-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--accent-color);
}

.toast-success .toast-dot { background: var(--success); }
.toast-error .toast-dot { background: var(--danger); }
.toast-info .toast-dot { background: var(--accent-color); }

/* ---------- 表单 ---------- */
.stack-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.field-label {
    font-size: 12.5px;
    font-weight: 650;
    color: var(--text-secondary);
}

.field-label small {
    color: var(--text-muted);
    font-weight: 400;
}

.field-hint {
    color: var(--text-muted);
    font-size: 11.5px;
    line-height: 1.6;
}

.input,
.select,
.textarea {
    width: 100%;
    min-height: 42px;
    padding: 10px 13px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.input:focus,
.select:focus,
.textarea:focus {
    border-color: var(--accent-color);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.13);
}

.textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.7;
}

.select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
    background-position: calc(100% - 17px) calc(50% - 2px), calc(100% - 12px) calc(50% - 2px);
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 34px;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.check-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 0;
    cursor: pointer;
}

.check-row input[type="checkbox"] {
    width: 17px;
    height: 17px;
    margin: 2px 0 0;
    accent-color: var(--accent-color);
    flex-shrink: 0;
}

.check-row strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
}

.check-row small {
    display: block;
    color: var(--text-muted);
    font-size: 11.5px;
    line-height: 1.55;
    margin-top: 1px;
}

.form-alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.65;
    margin-bottom: 18px;
}

.form-alert p {
    margin: 0;
}

.form-alert .icon {
    width: 16px;
    height: 16px;
    margin-top: 2px;
    flex-shrink: 0;
}

.form-alert-error {
    background: var(--danger-soft);
    color: var(--danger);
}

.form-alert-warning {
    background: var(--warning-soft);
    color: var(--warning);
}

.form-alert-success {
    background: var(--success-soft);
    color: var(--success);
}

/* ---------- 认证页 ---------- */
.auth-page {
    background-image: radial-gradient(circle at 15% 0%, rgba(var(--accent-rgb), 0.2), transparent 40%), radial-gradient(circle at 90% 10%, rgba(var(--accent-rgb), 0.08), transparent 34%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-main {
    width: 100%;
    max-width: 430px;
}

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 11px;
    margin-bottom: 22px;
    text-align: left;
}

.auth-brand .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 13px;
}

.auth-brand strong {
    display: block;
    font-size: 16px;
    font-weight: 750;
}

.auth-brand p {
    margin: 1px 0 0;
    color: var(--text-muted);
    font-size: 11.5px;
}

.auth-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 32px;
    backdrop-filter: blur(var(--card-blur));
    -webkit-backdrop-filter: blur(var(--card-blur));
}

.auth-head {
    margin-bottom: 22px;
}

.auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--accent-color);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.auth-head h1 {
    margin: 0 0 6px;
    font-size: 26px;
    font-weight: 780;
    letter-spacing: -0.03em;
}

.auth-head p {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.65;
}

.auth-note {
    margin: 18px 0 0;
    color: var(--text-muted);
    font-size: 11.5px;
    line-height: 1.65;
    text-align: center;
}

.auth-note code {
    background: rgba(100, 116, 139, 0.1);
    padding: 1px 5px;
    border-radius: 5px;
    font-size: 11px;
}

.auth-footer {
    margin: 18px 0 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
}

.auth-theme-toggle {
    position: fixed;
    top: 18px;
    right: 18px;
    background: var(--bg-secondary);
    border-color: var(--border-color);
    box-shadow: var(--shadow-sm);
}

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
    :root {
        --sidebar-w: 270px;
    }

    .header-search {
        width: 180px;
    }

    .article {
        padding: 32px 30px;
    }
}

@media (max-width: 920px) {
    .page-grid {
        grid-template-columns: minmax(0, 1fr);
    }

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

    .side-about {
        grid-column: span 2;
    }

    .toc-nav {
        max-height: none;
    }

    .site-nav {
        display: none;
    }

    .header-search {
        display: none;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .header-inner {
        gap: 14px;
    }

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

@media (max-width: 760px) {
    :root {
        --header-h: 64px;
    }

    .container {
        padding: 0 18px;
    }

    .site-main {
        padding: 24px 0 54px;
    }

    .header-inner {
        padding: 0 18px;
    }

    .brand-sub {
        display: none;
    }

    .brand-mark {
        width: 34px;
        height: 34px;
        border-radius: 10px;
        font-size: 16px;
    }

    .brand-title {
        font-size: 15.5px;
    }

    .post-card {
        grid-template-columns: 150px minmax(0, 1fr);
    }

    .post-card-body {
        padding: 16px 18px;
    }

    .post-card-title {
        font-size: 17px;
    }

    .post-card-meta {
        gap: 6px 12px;
    }

    .article {
        padding: 26px 22px;
        border-radius: var(--radius-lg);
    }

    .article-title {
        font-size: 26px;
    }

    .article-content {
        font-size: 15.5px;
    }

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

    .prev-next {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .prev-next-item.next {
        text-align: left;
        align-items: flex-start;
    }

    .archive-year {
        padding: 20px 18px;
    }

    .archive-year-head h2 {
        font-size: 22px;
    }

    .archive-cat {
        display: none;
    }

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

    .friend-apply {
        flex-wrap: wrap;
    }

    .friend-apply .btn {
        margin-left: 0;
    }

    .about-card {
        padding: 26px 22px;
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .footer-links {
        margin-left: 0;
    }

    .page-heading {
        align-items: flex-start;
    }

    .page-heading h1 {
        font-size: 25px;
    }
}

@media (max-width: 560px) {
    .sidebar {
        grid-template-columns: 1fr;
    }

    .side-about {
        grid-column: span 1;
    }

    .post-card {
        grid-template-columns: 1fr;
    }

    .post-card-cover {
        min-height: 0;
        aspect-ratio: 16 / 8.5;
    }

    .post-card-body {
        padding: 16px 17px 17px;
    }

    .post-card-excerpt {
        -webkit-line-clamp: 3;
    }

    .article {
        padding: 22px 17px;
        border: none;
        box-shadow: none;
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .article-content {
        font-size: 15.5px;
        line-height: 1.85;
    }

    .article-content pre {
        margin-left: -8px;
        margin-right: -8px;
        border-radius: 10px;
        padding: 16px;
    }

    .article-cover {
        margin-left: -17px;
        margin-right: -17px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .article-title {
        font-size: 24px;
    }

    .article-meta {
        gap: 7px 13px;
        font-size: 12px;
    }

    .comments {
        margin-top: 28px;
    }

    .comment-form {
        padding: 18px 16px;
        margin-left: -6px;
        margin-right: -6px;
    }

    .comment-avatar {
        width: 36px;
        height: 36px;
        border-radius: 11px;
        font-size: 14px;
    }

    .field-row {
        grid-template-columns: 1fr;
    }

    .auth-card {
        padding: 24px 20px;
        border-radius: var(--radius-lg);
    }

    .auth-head h1 {
        font-size: 23px;
    }

    .toast-stack {
        left: 14px;
        right: 14px;
        top: 14px;
        max-width: none;
    }

    .back-to-top {
        right: 14px;
        bottom: 16px;
    }
}

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