/**
 * Design System v6.0 — 组件与排版体系
 *
 * 【加载顺序与职责】改样式前先看这张表：
 * ---------------------------------------------------------------------------
 *  页面       | style.css | design-system.css | theme-refresh.css | admin-theme.css
 *  前台       |    ✓      |        ✓          |        ✓          |       —
 *  登录/注册  |    ✓      |        ✓          |        ✓          |       ✓
 *  后台       |    ✓      |        —          |        ✓          |       ✓
 * ---------------------------------------------------------------------------
 *  · 顺序：style.css → design-system.css → theme-refresh.css →（后台）admin-theme.css
 *    → 页面专属样式（home.css / diary.css / links.css / shuoshuo.css）
 *  · 后加载的层覆盖先加载的层。配色 / 阴影 / 圆角 / 字体族的"最终真源"是
 *    theme-refresh.css，本文件只负责"结构令牌 + 组件样式"。
 *  · 后台不加载本文件，因此后台需要的样式不要写在这里。
 *
 * 【本文件内容】可访问性、布局容器、头部导航、按钮、卡片、表单、文章列表与详情、
 * 评论、分页、目录、侧栏小部件、搜索浮层、抽屉、提示、骨架屏、页脚、工具类、
 * 滚动揭示、响应式，以及若干历史增量补丁层。
 */

/* ==================== 0. 全局优化 ==================== */
/* 平滑滚动 */
html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 20px);
}

/* 选中文本颜色 */
::selection {
    background: var(--primary-light);
    color: var(--primary-color);
}

/* 自定义滚动条 - 全局 */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-subtle);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
    border: 2px solid var(--bg-subtle);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Firefox 滚动条 */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-subtle);
}

/* 焦点状态 - 无障碍 */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 图片默认样式 */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 链接统一过渡 */
a {
    transition: color 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
}

/* ==================== 1. 结构令牌（仅非配色部分） ====================
 * 【为什么这里没有颜色】
 * 配色 / 阴影 / 圆角 / 字体族这些"视觉皮肤"令牌，全部由最后加载的
 * theme-refresh.css 统一定义（前台、登录页、后台三处都加载它，覆盖完整）。
 * 本文件曾在此重复定义过一套樱花粉令牌，结果是 100% 被 theme-refresh 覆盖的
 * 死代码，只会误导后来改配色的人。现已删除。
 *
 * 结论：改主色 / 背景 / 阴影 / 圆角 → 去 theme-refresh.css；
 *       改间距 / 层级 / 动效时长 → 在本文件这里加。
 */
:root {
    /* 间距系统 - 基于 4px 基准 */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;
    --space-20: 80px;

    /* 字形特性：开启常见连字与字距微调（字体族本身由 theme-refresh.css 定义） */
    --font-feature-body: "liga" 1, "kern" 1, "calt" 1;
    --font-feature-display: "liga" 1, "kern" 1, "dlig" 1;

    /* 流式排版：在视口范围内自适应缩放 */
    --font-size-fluid: clamp(1rem, 0.9rem + 0.4vw, 1.125rem);
    --h1-fluid: clamp(2rem, 1.4rem + 2.5vw, 3.25rem);
    --h2-fluid: clamp(1.5rem, 1.15rem + 1.5vw, 2.25rem);
    --h3-fluid: clamp(1.25rem, 1rem + 1vw, 1.625rem);

    /* 字体大小 */
    --text-xs: 0.72rem;
    --text-sm: 0.82rem;
    --text-base: 0.92rem;
    --text-lg: 1.05rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;

    /* 行高 */
    --leading-tight: 1.3;
    --leading-normal: 1.6;
    --leading-relaxed: 1.85;

    /* 动效系统 */
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 120ms;
    --duration-normal: 220ms;
    --duration-slow: 320ms;
    --duration-slower: 500ms;

    /* z-index 层级 */
    --z-base: 0;
    --z-sticky: 100;
    --z-header: 190;
    --z-drawer: 200;
    --z-overlay: 1000;
    --z-modal: 1002;
    --z-toast: 1004;
    --z-tooltip: 1006;

    /* 内容宽度 */
    --content-max: 1280px;
    --article-max: 760px;
    --sidebar-width: 320px;

    /* 过渡预设 */
    --transition-fast: all var(--duration-fast) var(--ease-out);
    --transition-normal: all var(--duration-normal) var(--ease-out);
    --transition-slow: all var(--duration-slow) var(--ease-out);
    --transition-colors: color var(--duration-fast) ease, background-color var(--duration-fast) ease, border-color var(--duration-fast) ease;
    --transition-transform: transform var(--duration-normal) var(--ease-out);
    --transition-shadow: box-shadow var(--duration-normal) var(--ease-out);
}

/* 深色配色令牌同样由 theme-refresh.css 的 [data-theme="dark"] 统一提供。
 * 本文件曾在此重复定义一整套粉色深色令牌，经比对 62 个令牌全部被覆盖，
 * 属纯死代码，已删除。改深色配色请去 theme-refresh.css。 */

/* ==================== 2. 基础重置与可访问性 ==================== */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    text-rendering: optimizeLegibility;
}

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

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.7;
    font-feature-settings: var(--font-feature-body);
    font-variant-ligatures: common-ligatures;
    text-rendering: optimizeLegibility;
    color: var(--text-color);
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 流式标题：在视口范围内平滑缩放，移动端不溢出、桌面端更舒展 */
.home-hero-title,
.article-title,
.page-title {
    font-size: var(--h1-fluid);
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.section-title,
.card-title {
    font-size: var(--h3-fluid);
    letter-spacing: -0.01em;
}

/* ==================== 动画编排：页面加载 staggered reveal ==================== */
@keyframes reveal-up {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: no-preference) {
    /* 容器添加 .stagger 类即可启用子元素错峰出现 */
    .stagger > * {
        opacity: 0;
        animation: reveal-up 0.5s var(--ease-spring) forwards;
    }
    .stagger > *:nth-child(1)  { animation-delay: 0.05s; }
    .stagger > *:nth-child(2)  { animation-delay: 0.10s; }
    .stagger > *:nth-child(3)  { animation-delay: 0.15s; }
    .stagger > *:nth-child(4)  { animation-delay: 0.20s; }
    .stagger > *:nth-child(5)  { animation-delay: 0.25s; }
    .stagger > *:nth-child(6)  { animation-delay: 0.30s; }
    .stagger > *:nth-child(7)  { animation-delay: 0.35s; }
    .stagger > *:nth-child(8)  { animation-delay: 0.40s; }
    .stagger > *:nth-child(n+9) { animation-delay: 0.45s; }

    /* 卡片 hover：仅 (hover: hover) 设备生效，避免移动端粘滞态 */
    @media (hover: hover) {
        .article-card,
        .links-grid-item {
            transition: transform 0.25s var(--ease-spring), box-shadow 0.25s ease;
        }
        .article-card:hover,
        .links-grid-item:hover {
            transform: translateY(-3px);
            box-shadow: var(--shadow-lg);
        }
    }
}

[data-theme="dark"] body {
    background-color: var(--bg-color);
}

/* 跳至主要内容链接 */
.skip-link {
    position: absolute;
    top: -60px;
    left: var(--space-4);
    z-index: calc(var(--z-toast) + 1);
    padding: var(--space-2) var(--space-4);
    background: var(--primary-color);
    color: #fff;
    border-radius: var(--radius);
    font-weight: 600;
    text-decoration: none;
    transition: top var(--duration-fast) var(--ease-out);
    box-shadow: var(--shadow-lg);
}

.skip-link:focus {
    top: var(--space-4);
    outline: 3px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

/* 焦点环 */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

button,
a,
input,
textarea,
select {
    touch-action: manipulation;
}

/* ==================== 3. 布局容器 ==================== */
.container {
    width: 100%;
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--space-5);
}

.main-wrapper {
    gap: var(--space-6);
    padding-top: calc(var(--space-8) + 60px);
    padding-bottom: var(--space-12);
}

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

.sidebar {
    gap: var(--space-5);
}

@media (max-width: 1024px) {
    .main-wrapper {
        padding-top: calc(var(--space-6) + 56px);
        gap: var(--space-5);
    }
    .sidebar {
        width: 280px;
        gap: var(--space-4);
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 var(--space-4);
    }
    .main-wrapper {
        padding-top: calc(var(--space-5) + 52px);
        gap: var(--space-5);
    }
}

/* ==================== 4. 头部导航重构 ==================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-header);
    height: var(--header-height);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--border-subtle);
    transition: transform 0.4s var(--ease-out),
                background-color 0.3s ease,
                box-shadow 0.3s ease,
                border-color 0.3s ease;
}

/* 头部滚动时的样式优化 */
.header.is-scrolled {
    box-shadow: var(--shadow-lg);
    background: var(--glass-bg);
    border-color: var(--border-color);
    height: 64px;
}

.header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
}

.logo {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    letter-spacing: -0.02em;
    transition: all 0.25s var(--ease-spring);
}

.logo:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

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

.logo img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 2px solid transparent;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s var(--ease-spring);
}

.logo:hover img {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-glow);
    transform: scale(1.05);
}

/* 桌面导航 */
.nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav a {
    position: relative;
    padding: 8px 14px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--radius);
    transition: all 0.2s var(--ease-out);
    overflow: hidden;
}

.nav a::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--primary-gradient);
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s var(--ease-spring);
    z-index: -1;
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 14px;
    right: 14px;
    height: 2px;
    background: var(--primary-gradient);
    border-radius: 2px;
    transform: scaleX(0);
    transition: transform 0.3s var(--ease-out);
}

.nav a:hover {
    color: var(--primary-color);
    background: var(--primary-lighter);
    transform: translateY(-2px);
}

.nav a:hover::before {
    opacity: 0.08;
    transform: scale(1);
}

.nav a:hover::after,
.nav a.active::after {
    transform: scaleX(1);
}

.nav a.active {
    color: var(--primary-color);
    background: var(--primary-light);
    font-weight: 600;
}

/* 头部操作区 */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.search-trigger,
.theme-toggle,
.social-icon-link,
.mobile-menu-btn {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
    position: relative;
}

.search-trigger::before,
.theme-toggle::before,
.social-icon-link::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    background: var(--primary-gradient);
    opacity: 0;
    transform: scale(0.8);
    transition: opacity var(--duration-fast) ease, transform var(--duration-fast) var(--ease-spring);
    z-index: -1;
}

.search-trigger:hover,
.theme-toggle:hover,
.social-icon-link:hover {
    background: var(--primary-lighter);
    border-color: var(--border-subtle);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.search-trigger:hover::before,
.theme-toggle:hover::before,
.social-icon-link:hover::before {
    opacity: 0.1;
    transform: scale(1);
}

.mobile-menu-btn {
    display: none;
}

@media (max-width: 900px) {
    .nav {
        display: none;
    }
    .mobile-menu-btn {
        display: inline-flex;
    }
}

/* 头部主题切换动画 */
.theme-toggle {
    overflow: hidden;
}

.theme-toggle svg {
    transition: transform var(--duration-normal) var(--ease-spring), opacity var(--duration-fast) ease;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    transform: rotate(-90deg) scale(0);
    opacity: 0;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    transform: rotate(0) scale(1);
    opacity: 1;
}

[data-theme="light"] .theme-toggle .moon-icon {
    transform: rotate(90deg) scale(0);
    opacity: 0;
}

[data-theme="light"] .theme-toggle .sun-icon {
    transform: rotate(0) scale(1);
    opacity: 1;
}

/* 桌面导航“更多”菜单 */
.nav-more {
    position: relative;
}

.nav-more-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 40px;
    padding: 8px 14px;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
}

.nav-more-trigger svg {
    transition: transform var(--duration-fast) var(--ease-out);
}

.nav-more-trigger:hover,
.nav-more-trigger:focus-visible,
.nav-more-trigger.active,
.nav-more.is-open .nav-more-trigger {
    color: var(--primary-color);
    background: var(--primary-light);
}

.nav-more-trigger.active::after {
    content: '';
    position: absolute;
    right: 14px;
    bottom: 4px;
    left: 14px;
    height: 2px;
    border-radius: 2px;
    background: var(--primary-gradient);
}

.nav-more.is-open .nav-more-trigger svg {
    transform: rotate(180deg);
}

.nav-more-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: var(--z-header);
    display: grid;
    min-width: 168px;
    padding: var(--space-2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--card-bg);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.98);
    transform-origin: top right;
    transition: opacity var(--duration-fast) ease, transform var(--duration-fast) var(--ease-out), visibility var(--duration-fast) ease;
}

.nav-more.is-open .nav-more-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.nav-more-menu a {
    display: block;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.88rem;
    text-decoration: none;
    white-space: nowrap;
}

.nav-more-menu a::before,
.nav-more-menu a::after {
    display: none;
}

.nav-more-menu a:hover,
.nav-more-menu a:focus-visible,
.nav-more-menu a.active {
    background: var(--primary-light);
    color: var(--primary-color);
}

@media (max-width: 900px) {
    .nav-more {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nav-more-menu,
    .nav-more-trigger svg {
        transition: none;
    }
}

/* ==================== 5. 按钮系统 ==================== */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 10px 18px;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.4;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background-color var(--duration-fast) ease, border-color var(--duration-fast) ease, color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
    overflow: hidden;
    min-height: 40px;
    white-space: nowrap;
}

.btn::before {
    content: none;
}

.btn:hover::before {
    opacity: 0;
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled,
.btn.is-loading {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--text-color);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    background: var(--primary-active);
    border-color: var(--primary-active);
}

.btn-secondary {
    background: var(--bg-subtle);
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: var(--hover-bg);
    border-color: var(--border-strong);
    color: var(--primary-color);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
    min-height: 32px;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 14px 24px;
    font-size: 1rem;
    min-height: 48px;
    border-radius: var(--radius-lg);
}

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

.btn-ghost:hover {
    background: var(--hover-bg);
    color: var(--primary-color);
}

.btn-hero {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.btn-hero:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.7);
    color: #fff;
}

.btn-hero:active {
    background: rgba(255, 255, 255, 0.16);
}

/* 第三方 OAuth 登录/注册按钮（login.php / register.php 共用）。
   品牌底色为固定常量，不走主题令牌；深色下补 1px 描边防与页面背景融在一起。 */
.oauth-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #fff;
}

.oauth-btn--github { background: #24292f; }
.oauth-btn--gitcode { background: #fc5531; }
.oauth-btn--gitee { background: #c71d23; }
/* LINUX DO 品牌橙：#ffb003 上必须用深色文字，白字对比度不足 */
.oauth-btn--linuxdo { background: #ffb003; color: #1c1c1e; }

[data-theme="dark"] .oauth-btn--github {
    background: #24292f;
    border: 1px solid #4a535c;
}

/* 个人中心「第三方账号绑定」列表（profile.php）：
   一行 = 渠道名 / 绑定状态 / 操作，窄屏时状态换到第二行，按钮留在第一行右侧。 */
.oauth-bind-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-3, 12px);
}

.oauth-bind-row {
    display: flex;
    align-items: center;
    gap: var(--space-3, 12px);
    padding: var(--space-3, 12px) var(--space-4, 16px);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-subtle);
}

.oauth-bind-label {
    flex: 0 0 88px;
    font-weight: 600;
    color: var(--text-color);
}

.oauth-bind-state {
    flex: 1 1 auto;
    min-width: 0;
    font-size: var(--text-sm, 0.82rem);
    color: var(--text-light);
    overflow-wrap: anywhere;
}

.oauth-bind-bound {
    color: var(--success-color);
}

.oauth-bind-muted {
    color: var(--text-light);
}

.oauth-bind-actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: var(--space-2, 8px);
}

.oauth-bind-form {
    margin: 0;
}

@media (max-width: 560px) {
    .oauth-bind-row {
        flex-wrap: wrap;
    }

    .oauth-bind-label {
        flex: 1 1 auto;
    }

    .oauth-bind-state {
        order: 3;
        flex: 1 1 100%;
    }
}

/* 表单分隔线：OAuth 区与账号密码区之间的「或」横线 */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    color: var(--text-light);
    font-size: 0.875rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

/* 加载状态 */
.btn.is-loading::after {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== 6. 卡片系统 ==================== */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow var(--duration-normal) var(--ease-out),
                border-color var(--duration-fast) ease;
}

[data-theme="dark"] .card {
    background: var(--card-bg);
    border-color: var(--border-color);
    box-shadow: var(--shadow-sm);
}

.card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}

.card-header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
}

.card-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.card-body {
    padding: var(--space-6);
}

.card-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-subtle);
}

@media (max-width: 640px) {
    .card-header,
    .card-body {
        padding: var(--space-4);
    }
}

/* ==================== 7. 表单系统 ==================== */
.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.form-label .required {
    color: var(--danger-color);
    margin-left: 2px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 14px;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-color);
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: border-color var(--duration-fast) ease,
                box-shadow var(--duration-fast) ease,
                background-color var(--duration-fast) ease;
    -webkit-appearance: none;
    appearance: none;
}

.form-input:hover,
.form-textarea:hover,
.form-select:hover {
    border-color: var(--border-strong);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--primary-color);
    background: var(--card-bg);
    box-shadow: 0 0 0 3px var(--primary-light);
    outline: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-light);
}

.form-input:disabled,
.form-textarea:disabled {
    background: var(--bg-subtle);
    color: var(--text-tertiary);
    cursor: not-allowed;
    opacity: 0.7;
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-hint {
    margin-top: var(--space-1);
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

.form-error {
    margin-top: var(--space-1);
    font-size: 0.82rem;
    color: var(--danger-color);
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.form-error::before {
    content: '!';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--danger-color);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
}

.form-group.has-error .form-input,
.form-group.has-error .form-textarea,
.form-group.has-error .form-select {
    border-color: var(--danger-color);
    background: var(--danger-light);
}

.form-group.has-error .form-input:focus,
.form-group.has-error .form-textarea:focus,
.form-group.has-error .form-select:focus {
    box-shadow: 0 0 0 3px var(--danger-light);
}

/* 表单行（多列布局） */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    margin-bottom: var(--space-4);
}

.form-row .form-group {
    margin-bottom: 0;
}

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

/* 留言板表单 */
.guestbook-form {
    margin-bottom: var(--space-8);
    padding-bottom: var(--space-8);
    border-bottom: 1px solid var(--border-subtle);
}

.guestbook-intro {
    color: var(--text-tertiary);
    margin-bottom: var(--space-6);
    font-size: 0.92rem;
    line-height: 1.6;
}

.guestbook-count {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: var(--space-5);
}

.home-hero {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-8);
    padding: clamp(40px, 6vw, 72px) clamp(20px, 4vw, 60px);
    margin-bottom: var(--space-8);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-2xl);
    background: var(--card-bg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

[data-theme="dark"] .home-hero {
    border-color: var(--border-color);
    background: var(--card-bg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.home-hero-overlay {
    display: none;
}

.home-hero.has-bg .home-hero-overlay {
    display: block;
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.25));
    z-index: 0;
}

.home-hero.has-bg {
    border-color: transparent;
}

.home-hero.has-bg .home-hero-content,
.home-hero.has-bg .home-hero-panel {
    position: relative;
    z-index: 1;
}

.home-hero.has-bg .home-eyebrow,
.home-hero.has-bg h1,
.home-hero.has-bg p {
    color: #fff;
}

.home-hero.has-bg .home-eyebrow {
    color: rgba(255, 255, 255, 0.85);
}

.home-hero.has-bg p {
    color: rgba(255, 255, 255, 0.9);
}

.home-hero.has-bg .home-hero-panel {
    border-top-color: rgba(255, 255, 255, 0.25);
}

.home-hero.has-bg .hero-stat-card span,
.home-hero.has-bg .hero-stat-card small {
    color: #fff;
}

.home-hero.has-bg .hero-stat-card small {
    color: rgba(255, 255, 255, 0.75);
}

.home-hero-content {
    max-width: 720px;
}

.home-eyebrow {
    display: inline-block;
    margin-bottom: var(--space-4);
    color: var(--primary-color);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.home-hero h1 {
    margin: 0 0 var(--space-4);
    color: var(--text-color);
    font-family: var(--font-display);
    font-size: clamp(2.25rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.home-hero p {
    margin: 0;
    color: var(--text-secondary);
    font-size: clamp(1rem, 1.8vw, 1.125rem);
    line-height: 1.8;
}

.home-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    margin-top: var(--space-6);
}

.home-hero-panel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-color);
}

.hero-stat-card {
    padding: var(--space-4);
    text-align: center;
}

.hero-stat-card span {
    display: block;
    color: var(--text-color);
    font-family: var(--font-display);
    font-size: clamp(2rem, 3.5vw, 2.75rem);
    font-weight: 700;
    line-height: 1.1;
}

.hero-stat-card small {
    display: block;
    margin-top: var(--space-1);
    color: var(--text-light);
    font-size: 0.8rem;
    font-weight: 500;
}

/* ==================== 9. 文章列表（行式） ==================== */
/* 真实结构：.article-item 是列表中的行，含 .article-cover(img)、.article-title、.article-meta、.article-excerpt、.article-actions、.article-tags */
.article-item {
    padding: var(--space-6);
    border-bottom: 1px solid var(--border-subtle);
    transition: background-color var(--duration-fast) ease, box-shadow var(--duration-normal) var(--ease-out);
    position: relative;
}

.article-item:last-child {
    border-bottom: none;
}

.article-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-gradient);
    border-radius: 0 3px 3px 0;
    transform: scaleY(0);
    transform-origin: center;
    transition: transform var(--duration-normal) var(--ease-out);
}

.article-item:hover {
    background: var(--hover-bg);
    box-shadow: var(--shadow-sm);
}

.article-item:hover::before {
    transform: scaleY(1);
}

/* 封面图：真实为 <img class="article-cover"> */
.article-cover {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-4);
    transition: transform var(--duration-slow) var(--ease-out),
                filter var(--duration-normal) ease,
                box-shadow var(--duration-normal) var(--ease-out);
    background: var(--bg-subtle);
}

.article-item:hover .article-cover {
    transform: scale(1.02);
    box-shadow: var(--shadow-md);
}

@media (max-width: 640px) {
    .article-cover {
        aspect-ratio: 16 / 10;
    }
}

.article-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: var(--space-2);
    letter-spacing: -0.01em;
}

.article-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: color var(--duration-fast) ease;
    position: relative;
}

.article-title a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    transition: width var(--duration-normal) var(--ease-out);
}

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

.article-title a:hover::after {
    width: 100%;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-4);
    font-size: 0.82rem;
    color: var(--text-tertiary);
    margin-bottom: var(--space-3);
}

.article-meta .meta-item {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    transition: color var(--duration-fast) ease;
}

.article-meta .meta-item:hover {
    color: var(--primary-color);
}

.article-meta .meta-item svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.article-meta .pin-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 9px;
    background: var(--primary-gradient);
    color: var(--text-inverse);
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    margin-right: var(--space-1);
    box-shadow: var(--shadow-sm);
}

.article-excerpt {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 0.95rem;
    margin-bottom: var(--space-3);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-actions {
    margin-top: var(--space-2);
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

/* 阅读全文 / 查看全部 链接 */
.read-more-link,
.article-list-more {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 7px 14px;
    border-radius: var(--radius);
    background: var(--primary-light);
    color: var(--primary-color);
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--duration-fast) var(--ease-out);
    position: relative;
    overflow: hidden;
}

.read-more-link::before,
.article-list-more::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity var(--duration-fast) ease;
}

.read-more-link:hover,
.article-list-more:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.read-more-link:hover::before,
.article-list-more:hover::before {
    opacity: 1;
}

.read-more-link span,
.article-list-more span {
    position: relative;
    z-index: 1;
}

.read-more-link::after {
    content: '→';
    transition: transform var(--duration-fast) var(--ease-out);
}

.read-more-link:hover::after {
    transform: translateX(3px);
}

/* 文章列表工具栏 */
.article-list-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.article-list-toolbar .card-title {
    font-size: 1rem;
    margin: 0;
    margin-right: auto;
}

.article-list-summary {
    color: var(--text-tertiary);
    font-size: 0.82rem;
    flex: 0 0 auto;
    width: max-content;
    max-width: 100%;
}

.article-list-more {
    margin-left: var(--space-2);
    flex: 0 0 auto;
    width: max-content;
}

/* 首页筛选行 */
.home-filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4) var(--space-6);
    flex-wrap: wrap;
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px dashed var(--border-subtle);
}

.home-filter-row > .category-filter {
    position: relative;
}

/* 第二组（排序）前加分隔感 */
.home-filter-row > .category-filter + .category-filter,
.home-filter-row > .home-sort-filter {
    padding-left: var(--space-4);
    border-left: 1px solid var(--border-subtle);
}

.category-filter {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    align-items: center;
}

.category-filter a {
    padding: 7px 16px;
    border-radius: var(--radius-full);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-size: 0.83rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--border-color);
    transition: all var(--duration-fast) var(--ease-out);
    min-height: 32px;
    display: inline-flex;
    align-items: center;
}

.category-filter a:hover {
    background: var(--primary-lighter);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.category-filter a.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px var(--primary-glow);
    font-weight: 600;
}

/* 搜索框：输入与按钮等高 */
.search-box {
    display: flex;
    gap: var(--space-2);
    align-items: stretch;
}

.search-box input {
    flex: 1;
    min-width: 0;
}

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

.search-box input,
.search-box .btn {
    min-height: 44px;
}

/* ==================== 9. 文章详情页 ==================== */
.article-detail-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    animation: fadeInUp 0.6s var(--ease-out);
}

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

.article-detail-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 21 / 9;
    max-height: 420px;
    overflow: hidden;
    background: var(--bg-subtle);
}

.article-detail-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration-slow) var(--ease-out);
}

.article-detail-card:hover .article-detail-cover img {
    transform: scale(1.02);
}

.article-detail-cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 60%, rgba(0,0,0,0.4));
    pointer-events: none;
}

.article-detail-header {
    padding: var(--space-6) var(--space-8);
    border-bottom: 1px solid var(--border-subtle);
}

.article-detail-title {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-4);
    letter-spacing: -0.02em;
    transition: color var(--duration-fast) ease;
}

.article-detail-body {
    padding: var(--space-8);
}

/* 详情页 meta 增加底部分隔线 */
.article-detail-meta {
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.article-detail-meta .meta-item {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    color: var(--text-tertiary);
    font-size: 0.88rem;
    transition: color var(--duration-fast) ease;
}

.article-detail-meta .meta-item:hover {
    color: var(--primary-color);
}

.article-detail-meta .meta-item svg {
    width: 16px;
    height: 16px;
}

/* 详情页标签增加顶部分隔线 */
.article-detail-tags {
    margin-top: var(--space-6);
    padding-top: var(--space-4);
    border-top: 1px solid var(--border-subtle);
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.article-tags-label {
    color: var(--text-tertiary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-right: var(--space-2);
}

/* AI 总结面板 */
.ai-summary-panel {
    margin-bottom: var(--space-6);
    padding: var(--space-5);
    background: linear-gradient(135deg, var(--primary-lighter), var(--bg-subtle));
    border: 1px solid var(--primary-light);
    border-radius: var(--radius-lg);
    transition: box-shadow var(--duration-normal) var(--ease-out);
}

.ai-summary-panel:hover {
    box-shadow: var(--shadow-md);
}

.ai-summary-header {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    align-items: center;
    margin-bottom: var(--space-3);
}

.ai-summary-header svg {
    color: var(--primary-color);
}

.ai-summary-content {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
    padding: var(--space-4);
    background: var(--card-bg);
    border-radius: var(--radius);
    border-left: 3px solid var(--primary-color);
}

.ai-summary-loading {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.ai-summary-loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid var(--primary-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@media (max-width: 768px) {
    .article-detail-header,
    .article-detail-body {
        padding: var(--space-5);
    }
    .article-detail-cover {
        aspect-ratio: 16 / 9;
        max-height: 300px;
    }
}

/* 文章内容排版 - 优化阅读体验 */
.article-content {
    font-size: 1.0625rem;
    line-height: 1.9;
    color: var(--text-color);
    max-width: var(--article-max);
    text-rendering: optimizeLegibility;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.35;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
    scroll-margin-top: 88px;
    position: relative;
}

.article-content h1 { font-size: 2rem; }
.article-content h2 {
    font-size: 1.6rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
}

.article-content h2::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 48px;
    height: 3px;
    background: var(--primary-gradient);
    border-radius: 3px;
}

.article-content h3 { font-size: 1.3rem; }
.article-content h4 { font-size: 1.1rem; }

.article-content p {
    margin-bottom: 1.25rem;
    text-align: left;
    hyphens: auto;
}

.article-content a {
    color: var(--primary-color);
    text-decoration: underline;
    text-decoration-color: var(--primary-light);
    text-underline-offset: 3px;
    text-decoration-thickness: 1.5px;
    transition: all 0.2s ease;
}

.article-content a:hover {
    color: var(--primary-hover);
    text-decoration-color: var(--primary-color);
    text-decoration-thickness: 2px;
}

.article-content img {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    max-width: 100%;
    height: auto;
    margin: 2rem auto;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-content img:hover {
    transform: scale(1.01);
    box-shadow: var(--shadow-lg);
}

.article-content blockquote {
    margin: 2rem 0;
    padding: 1.25rem 1.5rem;
    border-left: 4px solid var(--primary-color);
    background: linear-gradient(135deg, var(--bg-subtle) 0%, var(--card-bg) 100%);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--text-secondary);
    font-style: italic;
    position: relative;
}

.article-content blockquote::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 10px;
    font-size: 4rem;
    color: var(--primary-light);
    font-family: var(--font-display);
    line-height: 1;
}

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

.article-content li {
    margin-bottom: 0.5rem;
    padding-left: 0.5rem;
}

.article-content li::marker {
    color: var(--primary-color);
}

.article-content code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    padding: 0.15em 0.4em;
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--danger-color);
}

.article-content pre {
    margin: 2rem 0;
    padding: 1.25rem;
    background: #1e1e1e;
    color: #d4d4d4;
    border: 1px solid #333;
    border-radius: var(--radius-lg);
    overflow-x: auto;
    position: relative;
}

.article-content pre[class*="language-"] {
    background: #1e1e1e;
}

.article-content pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: inherit;
    font-size: 0.9em;
    line-height: 1.7;
}

/* 文章表格 */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.9375rem;
    overflow: hidden;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.article-content table thead {
    background: var(--bg-subtle);
}

.article-content table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 700;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
    font-family: var(--font-display);
}

.article-content table td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.article-content table tbody tr {
    transition: background-color var(--duration-fast) ease;
}

.article-content table tbody tr:hover {
    background: var(--hover-bg);
}

.article-content table tbody tr:last-child td {
    border-bottom: none;
}

/* 文章内水平线 */
.article-content hr {
    border: none;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border-color), transparent);
    margin: var(--space-8) 0;
}

/* 文章上下篇导航 */
.article-neighbor-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    margin: var(--space-8) 0 var(--space-6);
}

.article-neighbor {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-lg);
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    text-decoration: none;
    color: var(--text-secondary);
    transition: all var(--duration-normal) var(--ease-out);
    min-width: 0;
}

.article-neighbor:hover {
    background: var(--card-bg);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.article-neighbor span {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.article-neighbor strong {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.article-neighbor.next {
    text-align: right;
}

.article-neighbor.disabled {
    opacity: 0.5;
    cursor: default;
}

.article-neighbor.disabled:hover {
    background: var(--bg-subtle);
    border-color: var(--border-subtle);
    box-shadow: none;
    transform: none;
}

@media (max-width: 640px) {
    .article-neighbor-nav {
        grid-template-columns: 1fr;
    }
    .article-neighbor.next {
        text-align: left;
    }
}

/* 关于页面 */
.about-hero {
    padding: var(--space-8) var(--space-8) var(--space-6);
    background: linear-gradient(135deg, var(--primary-light), transparent);
    border-bottom: 1px solid var(--border-subtle);
}

.about-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: var(--space-2);
}

.about-hero-subtitle {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.6;
}

.about-actions {
    margin-top: var(--space-6);
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
}

/* 间距工具类 */
.card-spaced {
    margin-top: var(--space-5);
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-6);
}

.about-tile {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding: var(--space-4) var(--space-5);
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    transition: all var(--duration-fast) var(--ease-out);
}

.about-tile:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.about-tile strong {
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.about-tile span {
    font-size: 1rem;
    color: var(--text-color);
    font-weight: 600;
}

/* 链接列表（关于页最近更新等） */
.link-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.link-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-2);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-secondary);
    transition: all var(--duration-fast) var(--ease-out);
}

.link-item:hover {
    background: var(--hover-bg);
    color: var(--primary-color);
    padding-left: var(--space-4);
}

.link-info {
    flex: 1;
    min-width: 0;
}

.link-name {
    font-weight: 600;
    font-size: 0.92rem;
    margin-bottom: 2px;
}

.link-desc {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

/* 文章标签 */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-6);
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    background: var(--bg-subtle);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
    text-decoration: none;
    transition: all var(--duration-fast) var(--ease-out);
}

.tag:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

/* ==================== 9b. 置顶徽章（独立） ==================== */
/* pin-badge 在文章标题内使用，不限于 .article-meta */
.pin-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    vertical-align: middle;
    line-height: 1.5;
    margin-right: var(--space-1);
    white-space: nowrap;
}

.pin-badge svg {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
}

/* 标题内的 pin-badge 缩小适配 */
.article-title .pin-badge {
    font-size: 0.68rem;
    padding: 1px 7px;
}

/* ==================== 9c. 标签云页面 ==================== */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    align-items: center;
    padding: var(--space-2) 0;
}

.tag-cloud-item {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 6px 16px;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    text-decoration: none;
    font-weight: 600;
    line-height: 1.4;
    transition: all var(--duration-normal) var(--ease-out);
}

.tag-cloud-item:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.tag-cloud-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--bg-subtle);
    color: var(--text-tertiary);
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    transition: all var(--duration-fast) ease;
}

.tag-cloud-item:hover .tag-cloud-count {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* ==================== 9d. 归档页面 ==================== */
.archive-year {
    margin-bottom: var(--space-8);
}

.archive-year:last-child {
    margin-bottom: 0;
}

.archive-year-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-2);
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
}

.archive-month {
    margin-bottom: var(--space-5);
}

.archive-month-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: var(--space-3);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.archive-count {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-tertiary);
}

.archive-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-left: var(--space-4);
    border-left: 2px solid var(--border-subtle);
}

.archive-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-secondary);
    transition: all var(--duration-fast) var(--ease-out);
    position: relative;
}

.archive-item::before {
    content: '';
    position: absolute;
    left: calc(-1 * var(--space-4) - 5px);
    top: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-color);
    transform: translateY(-50%);
    transition: all var(--duration-fast) ease;
}

.archive-item:hover {
    background: var(--hover-bg);
    color: var(--primary-color);
    transform: translateX(4px);
}

.archive-item:hover::before {
    background: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.archive-item-date {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    min-width: 42px;
}

.archive-item-title {
    flex: 1;
    font-size: 0.92rem;
    line-height: 1.5;
}

.archive-item-views {
    font-size: 0.75rem;
    color: var(--text-light);
    flex-shrink: 0;
}

/* ==================== 9e. 评论 / 留言系统 ==================== */
.comment-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

.comment-item {
    display: flex;
    gap: var(--space-3);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    transition: all var(--duration-fast) ease;
}

.comment-item:hover {
    border-color: var(--border-color);
    box-shadow: var(--shadow-sm);
}

.comment-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--card-bg);
    box-shadow: var(--shadow-sm);
}

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

.comment-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

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

.comment-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    border-radius: var(--radius-full);
}

.comment-time {
    font-size: 0.76rem;
    color: var(--text-light);
    margin-left: auto;
}

.comment-content {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text-secondary);
    word-break: break-word;
}

.comment-reply {
    margin-top: var(--space-3);
    padding: var(--space-3);
    background: var(--card-bg);
    border-radius: var(--radius);
    border-left: 3px solid var(--primary-light);
}

.comment-actions {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-2);
}

.comment-actions button {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 2px 0;
    transition: color var(--duration-fast) ease;
}

.comment-actions button:hover {
    color: var(--primary-color);
}

/* ==================== 9f. 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-5) !important;
}

.empty-state-icon {
    color: var(--text-light);
    margin-bottom: var(--space-4);
    opacity: 0.5;
}

.empty-state-icon svg {
    width: 56px;
    height: 56px;
}

.empty-state h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}

.empty-state p {
    font-size: 0.88rem;
    color: var(--text-tertiary);
    line-height: 1.6;
}

/* ==================== 9g. 分页 ==================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-1);
    margin-top: var(--space-8);
    padding-top: var(--space-6);
    flex-wrap: wrap;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 var(--space-2);
    border-radius: var(--radius);
    background: var(--card-bg);
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid var(--border-color);
    transition: all var(--duration-fast) var(--ease-out);
    cursor: pointer;
}

.page-link:hover:not(.active) {
    background: var(--primary-light);
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.page-link.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
    cursor: default;
}

.page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 40px;
    color: var(--text-light);
    font-weight: 600;
}

/* ==================== 10. 目录组件 ==================== */
.toc-container {
    margin-bottom: var(--space-6);
    padding: var(--space-5);
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.toc-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: var(--space-3);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--text-color);
}

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

.toc-list li {
    margin: 0;
}

.toc-list a {
    display: block;
    padding: var(--space-1) var(--space-2);
    color: var(--text-tertiary);
    font-size: 0.88rem;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all var(--duration-fast) ease;
    border-left: 2px solid transparent;
}

.toc-list a:hover {
    color: var(--primary-color);
    background: var(--primary-lighter);
    padding-left: calc(var(--space-2) + 4px);
}

.toc-list a.active {
    color: var(--primary-color);
    background: var(--primary-light);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

.toc-list .toc-h3 {
    padding-left: var(--space-4);
    font-size: 0.82rem;
}

/* ==================== 11. 侧边栏小部件 ==================== */
.widget {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: box-shadow var(--duration-normal) var(--ease-out),
                border-color var(--duration-fast) ease;
    animation: fadeInUp 0.5s var(--ease-out);
}

[data-theme="dark"] .widget {
    background: var(--card-bg);
    border-color: var(--border-color);
    box-shadow: var(--shadow-sm);
}

.widget:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-strong);
}

.widget-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    position: relative;
}

.widget-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity var(--duration-fast) ease;
}

.widget:hover .widget-title::before {
    opacity: 1;
}

.widget-content,
.widget-body {
    padding: var(--space-5);
}

/* 模板实际使用 .widget-header / .widget-body，作为 .widget-title / .widget-content 的别名 */
.widget-header {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    position: relative;
    color: var(--text-color);
}

.widget-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity var(--duration-fast) ease;
}

.widget:hover .widget-header::before {
    opacity: 1;
}

.widget-header > span {
    flex: 1;
}

.widget-header > a {
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: none;
    transition: color var(--duration-fast) ease;
}

.widget-header > a:hover {
    color: var(--primary-hover);
}

/* profile widget 主体直接放在 .widget-body.profile 内 */
.widget-body.profile {
    text-align: center;
    padding: var(--space-6) var(--space-5);
}

.profile-widget {
    text-align: center;
}

.profile-widget .avatar {
    width: 88px;
    height: 88px;
    border-radius: var(--radius-full);
    object-fit: cover;
    border: 3px solid var(--card-bg);
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-3);
    transition: transform var(--duration-normal) var(--ease-spring), box-shadow var(--duration-normal) ease;
}

.profile-widget .avatar:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-glow);
}

.profile-widget .name {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: var(--space-1);
    color: var(--text-color);
}

.profile-widget .bio {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    line-height: 1.6;
}

/* 快捷导航 */
.quick-nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.quick-nav-item {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 8px 14px;
    background: var(--bg-subtle);
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: 1px solid var(--border-subtle);
    text-decoration: none;
    transition: all var(--duration-fast) var(--ease-out);
}

.quick-nav-item:hover,
.quick-nav-item.active {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* 文章列表 */
.widget-article-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget-article-list li {
    border-bottom: 1px solid var(--border-subtle);
}

.widget-article-list li:last-child {
    border-bottom: none;
}

.widget-article-list a {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding: var(--space-3) 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-decoration: none;
    transition: all var(--duration-fast) ease;
}

.widget-article-list a:hover {
    color: var(--primary-color);
    padding-left: var(--space-2);
}

.widget-article-list a:hover .title {
    text-decoration: underline;
    text-decoration-color: var(--primary-light);
}

.widget-article-list .title {
    font-weight: 600;
    line-height: 1.4;
    transition: text-decoration var(--duration-fast) ease;
}

.widget-article-list .time {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
}

/* ==================== 12. 搜索浮层 ==================== */
.search-overlay {
    z-index: var(--z-overlay);
    padding-top: 10vh;
}

.search-overlay-backdrop {
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
}

.search-overlay-panel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

.search-overlay-header {
    padding: var(--space-5) var(--space-6);
    border-bottom: 1px solid var(--border-subtle);
}

.search-overlay-header input {
    font-size: 1.1rem;
}

.search-overlay-body {
    max-height: 46vh;
}

.search-result-item,
.search-recent-item {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius);
    margin-bottom: var(--space-1);
}

.search-recent-item {
    display: inline-flex;
    margin-right: var(--space-2);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    background: var(--bg-subtle);
    cursor: pointer;
    font: inherit;
}

.search-result-item:hover,
.search-result-item.is-selected,
.search-recent-item:hover {
    background: var(--hover-bg);
}

.search-result-item.is-selected {
    outline: 2px solid var(--primary-color);
}

.search-overlay-footer {
    padding: var(--space-3) var(--space-6);
    border-top: 1px solid var(--border-subtle);
}

/* ==================== 13. 移动端抽屉 ==================== */
.mobile-drawer {
    width: min(340px, 85vw);
    background: var(--card-bg);
    border-left: 1px solid var(--border-color);
    box-shadow: var(--shadow-xl);
    z-index: var(--z-drawer);
}

.mobile-drawer-header {
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-subtle);
}

.mobile-drawer-nav {
    padding: var(--space-4);
}

.mobile-drawer-nav a {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: var(--space-1);
    transition: all var(--duration-fast) var(--ease-out);
}

.mobile-drawer-nav a:hover,
.mobile-drawer-nav a.active {
    background: var(--primary-light);
    color: var(--primary-color);
    transform: translateX(4px);
}

.mobile-drawer-footer {
    padding: var(--space-4);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    gap: var(--space-2);
}

.mobile-drawer-overlay {
    z-index: calc(var(--z-drawer) - 1);
}

/* ==================== 14. 返回顶部 ==================== */
.back-to-top {
    position: fixed;
    bottom: var(--space-5);
    right: var(--space-5);
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--primary-color);
    color: #fff;
    border: none;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    z-index: calc(var(--z-header) - 1);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
    transition: opacity var(--duration-normal) ease,
                visibility var(--duration-normal) ease,
                transform var(--duration-normal) var(--ease-out),
                background-color var(--duration-fast) ease;
}

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

.back-to-top:hover {
    background: var(--primary-hover);
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-xl);
}

.back-to-top:active {
    transform: scale(0.95);
}

.back-to-top-ring {
    color: rgba(255, 255, 255, 0.45);
}

/* ==================== 15. 进度条 ==================== */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
    z-index: calc(var(--z-header) + 1);
    box-shadow: 0 0 10px var(--primary-glow);
    /* JS 写入 scaleX()，避免用 width 触发逐帧重排 */
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.1s linear;
}

/* ==================== 16. 提示与反馈 ==================== */
.alert {
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius);
    font-size: 0.92rem;
    font-weight: 500;
    border: 1px solid transparent;
    margin-bottom: var(--space-4);
}

.alert-success {
    background: var(--success-light);
    color: var(--success-color);
    border-color: rgba(61, 139, 107, 0.2);
}

.alert-error {
    background: var(--danger-light);
    color: var(--danger-color);
    border-color: rgba(196, 59, 59, 0.2);
}

.alert-warning {
    background: var(--warning-light);
    color: var(--warning-color);
    border-color: rgba(184, 134, 42, 0.2);
}

.alert-info {
    background: var(--info-light);
    color: var(--info-color);
    border-color: rgba(74, 122, 184, 0.2);
}

/* 提示信息的语义状态：错误/警告保持足够的文字对比度与可读性。 */
.alert-error,
.alert-warning {
    line-height: 1.6;
}

.toast-container {
    z-index: var(--z-toast);
}

.toast {
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-3) var(--space-5);
    font-size: 0.92rem;
    font-weight: 600;
}

/* ==================== 17. 骨架屏 ==================== */
.skeleton,
.img-skeleton {
    background: linear-gradient(110deg, var(--bg-subtle) 8%, var(--card-bg) 18%, var(--bg-subtle) 33%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.6s linear infinite;
    border-radius: var(--radius);
}

@keyframes skeleton-shimmer {
    to { background-position: 200% 0; }
}

.skeleton-text {
    height: 1em;
    border-radius: var(--radius-full);
    margin-bottom: var(--space-2);
}

.skeleton-title {
    height: 1.4em;
    width: 70%;
    border-radius: var(--radius-full);
    margin-bottom: var(--space-3);
}

.skeleton-circle {
    border-radius: var(--radius-full);
}

/* ==================== 18. 页脚 ==================== */
.footer {
    background: var(--bg-elevated);
    border-top: 1px solid var(--border-color);
    padding: var(--space-12) 0 var(--space-8);
    margin-top: var(--space-12);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-8);
    margin-bottom: var(--space-8);
}

.footer-bottom {
    padding-top: var(--space-6);
    border-top: 1px solid var(--border-subtle);
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

/* ==================== 19. 工具类 ==================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-light { color: var(--text-light); }
.text-primary-color { color: var(--primary-color); }

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: var(--space-2); }
.mb-2 { margin-bottom: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mb-4 { margin-bottom: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-6 { margin-bottom: var(--space-6); }

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

/* 文章操作按钮增强（仅详情页 .article-detail-card 内） */
.article-detail-card .article-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
    padding: var(--space-5) 0;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: var(--space-5);
}

.article-action-btn,
.article-toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 10px 18px;
    background: var(--bg-subtle);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out);
}

.article-action-btn:hover,
.article-toolbar-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.article-action-btn.active,
.article-toolbar-btn.active {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.article-action-btn:active,
.article-toolbar-btn:active {
    transform: scale(0.97);
}

.article-action-btn svg,
.article-toolbar-btn svg {
    width: 16px;
    height: 16px;
}

/* 分享弹窗增强 */
.share-modal {
    z-index: var(--z-modal);
}

.share-grid {
    gap: var(--space-3);
}

.share-item {
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-2);
}

.share-item:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
    transform: translateY(-3px);
}

/* ==================== 20. 滚动揭示动画 ==================== */
/* 正文默认可见；只有成功注册观察器的屏外元素参与动画。 */
html.js .is-reveal-pending {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.is-revealed,
.article-item.is-revealed,
.reveal-item.is-revealed {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

@media (prefers-reduced-motion: reduce) {
    html.js .is-reveal-pending {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

@media (scripting: none) {
    html.js .is-reveal-pending {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ==================== 21. 响应式优化 ==================== */
/* 平板端 (≤1024px) */
@media (max-width: 1024px) {
    .main-content {
        gap: 24px;
    }
    
    .article-detail-header,
    .article-detail-body {
        padding: 32px 28px;
    }
}

/* 移动端 (≤768px) */
@media (max-width: 768px) {
    .home-hero {
        padding: 32px 20px;
        border-radius: 14px;
    }

    .home-hero-panel {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-3);
        padding-top: var(--space-4);
    }

    .hero-stat-card {
        padding: var(--space-3);
    }

    .hero-stat-card span {
        font-size: clamp(1.75rem, 4vw, 2.25rem);
    }

    /* 全局 */
    .container {
        padding: 0 16px;
    }
    
    /* 布局 */
    .main-wrapper {
        flex-direction: column;
        gap: 24px;
        padding-top: 80px;
    }
    
    .main-content {
        width: 100%;
    }
    
    .sidebar {
        width: 100%;
        order: 2;
    }
    
    /* 文章列表 */
    .article-item {
        padding: 20px 16px;
    }
    
    .article-title {
        font-size: 1.15rem;
    }
    
    .article-body {
        padding: 16px;
    }
    
    .article-detail-title {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    .article-detail-header,
    .article-detail-body {
        padding: 20px 16px;
    }
    
    /* 文章内容 */
    .article-content {
        font-size: 1rem;
        line-height: 1.85;
    }
    
    .article-content h2 {
        font-size: 1.35rem;
    }
    
    .article-content h3 {
        font-size: 1.15rem;
    }
    
    .article-content p {
        text-align: left;
        hyphens: none;
    }
    
    .article-content img {
        margin: 1.5rem 0;
    }
    
    .article-content blockquote {
        margin: 1.5rem 0;
        padding: 1rem;
    }
    
    /* 表格横向滚动 */
    .article-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* 侧边栏 */
    .widget {
        margin-bottom: 16px;
    }
    
    .widget-title {
        padding: 14px 16px;
    }
    
    .widget-content {
        padding: 16px;
    }
    
    /* 页脚 */
    .footer {
        padding: 24px 0;
    }
    
    .footer-links {
        flex-wrap: wrap;
        gap: 12px 20px;
    }
}

/* 小屏手机 (≤480px) */
@media (max-width: 480px) {
    .home-hero-actions {
        flex-direction: column;
    }

    .home-hero-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .home-hero-panel {
        grid-template-columns: 1fr;
    }

    /* 头部 */
    .header {
        height: 56px;
    }
    
    .header-inner {
        padding: 0 12px;
    }
    
    .logo {
        font-size: 1.1rem;
    }
    
    .logo img {
        width: 32px;
        height: 32px;
    }
    
    .nav {
        display: none;
    }
    
    .search-trigger,
    .theme-toggle,
    .social-icon-link {
        width: 44px;
        height: 44px;
        padding: 10px;
    }
    
    /* 布局调整 */
    .container {
        padding: 0 12px;
    }
    
    .main-wrapper {
        padding-top: 68px;
        gap: 20px;
    }
    
    /* 文章列表 */
    .article-item {
        padding: 16px 12px;
        border-radius: 12px;
        margin-bottom: 12px;
    }
    
    .article-title {
        font-size: 1.05rem;
    }
    
    .article-meta {
        gap: 12px;
        font-size: 0.75rem;
    }
    
    .article-excerpt {
        font-size: 0.875rem;
        -webkit-line-clamp: 2;
    }
    
    /* 文章详情 */
    .article-detail-cover {
        aspect-ratio: 16 / 10;
        max-height: 220px;
    }
    
    .article-detail-title {
        font-size: 1.3rem;
    }

    /* 标签 */
    .tag {
        padding: 4px 10px;
        font-size: 0.75rem;
    }
    
    /* 快速导航 */
    .quick-nav-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .quick-nav-item {
        padding: 10px 8px;
        font-size: 0.75rem;
    }
}

/* ---------- 23. 窄屏头部与控件收束 ---------- */
@media (max-width: 900px) {
    .header-actions {
        flex-shrink: 0;
    }

    .header-actions .social-icon-link {
        display: none;
    }
}

@media (max-width: 520px) {
    .header-inner {
        gap: var(--space-2);
    }

    .header .logo {
        min-width: 0;
        max-width: 42vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .header-actions {
        gap: 2px;
    }

    .header-actions .search-trigger,
    .header-actions .theme-toggle,
    .header-actions .mobile-menu-btn {
        width: 40px;
        height: 40px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* 超小屏 (≤360px) */
@media (max-width: 360px) {
    .logo {
        font-size: 1rem;
    }
    
    .article-title {
        font-size: 1rem;
    }
    
    .quick-nav-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 打印样式 */
@media print {
    .header,
    .sidebar,
    .footer,
    .article-actions,
    .share-modal {
        display: none !important;
    }
    
    .main-wrapper {
        padding-top: 0;
    }
    
    .article-content {
        max-width: 100%;
        font-size: 12pt;
        line-height: 1.6;
    }
    
    .article-content a {
        color: inherit;
        text-decoration: underline;
    }
    
    .article-content h2,
    .article-content h3 {
        page-break-after: avoid;
    }
    
    .article-content img {
        max-width: 100%;
        page-break-inside: avoid;
    }
}


/* ==================== 22a. 后台背景图位置 9 宫格选择器 ==================== */
.bg-position-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 56px);
    gap: 6px;
    width: 220px;
    max-width: 100%;
}

.bg-pos-cell {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-subtle);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.78rem;
    color: var(--text-secondary);
    transition: all var(--duration-fast) var(--ease-out);
    user-select: none;
}

.bg-pos-cell:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--primary-lighter);
}

.bg-pos-cell.is-active {
    background: var(--primary-gradient);
    border-color: var(--primary-color);
    color: #fff;
    box-shadow: var(--shadow-sm), 0 0 0 3px var(--primary-light);
    font-weight: 600;
}

.bg-pos-cell.is-active::after {
    content: '✓';
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.9);
}

.bg-pos-cell input:focus-visible + span {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* range 滑块美化 */
.form-range {
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--bg-subtle);
    border-radius: var(--radius-full);
    outline: none;
    cursor: pointer;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-gradient);
    border: 2px solid var(--card-bg);
    box-shadow: var(--shadow-sm);
    transition: transform var(--duration-fast) var(--ease-spring);
}

.form-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.form-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 2px solid var(--card-bg);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

/* ==================== 22b. 主内容区底部小工具布局 ==================== */
.bottom-widgets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-5);
    margin-top: var(--space-8);
}

.bottom-widgets .widget {
    margin: 0;
}

.bottom-widgets .widget-header {
    font-size: 0.95rem;
    padding: var(--space-3) var(--space-4);
}

.bottom-widgets .widget-body {
    padding: var(--space-4);
}

@media (max-width: 1024px) {
    .bottom-widgets {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .bottom-widgets {
        grid-template-columns: 1fr;
    }
}

/* ==================== 23. 登录页样式（接入设计系统） ==================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6) var(--space-4);
    background:
        radial-gradient(circle at 20% 10%, var(--primary-lighter) 0%, transparent 45%),
        radial-gradient(circle at 80% 90%, var(--accent-light) 0%, transparent 45%),
        var(--bg-color);
    font-family: var(--font-sans);
    color: var(--text-color);
}

.login-box {
    width: 100%;
    max-width: 440px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: var(--space-10) var(--space-8);
    animation: fadeInUp 0.5s var(--ease-out);
}

.login-title {
    font-family: var(--font-display);
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-color);
    text-align: center;
    margin-bottom: var(--space-2);
    letter-spacing: -0.01em;
}

.login-subtitle {
    font-size: 0.9rem;
    color: var(--text-tertiary);
    text-align: center;
    margin-bottom: var(--space-6);
}

.login-box .form-group {
    margin-bottom: var(--space-4);
}

.login-box .form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}

.login-box .form-input {
    width: 100%;
    padding: 12px 14px;
    font-size: 0.95rem;
    font-family: var(--font-sans);
    color: var(--text-color);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius);
    transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease;
}

.login-box .form-input::placeholder {
    color: var(--text-muted);
}

.login-box .form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: var(--input-focus-shadow);
}

.login-box .btn-primary {
    width: 100%;
    padding: 12px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    background: var(--primary-gradient);
    color: var(--text-color);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: transform var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) ease, filter var(--duration-fast) ease;
}

.login-box .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md), var(--shadow-glow);
    filter: brightness(1.04);
}

.login-box .btn-primary:active {
    transform: translateY(0);
}

.login-box .alert {
    margin-bottom: var(--space-4);
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    border: 1px solid transparent;
}

.login-box .alert-error {
    background: var(--danger-light);
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.login-box a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--duration-fast) ease;
}

.login-box a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

@media (max-width: 480px) {
    .login-box {
        padding: var(--space-8) var(--space-5);
    }

    .login-title {
        font-size: 1.5rem;
    }
}

/* ====================================================
 * 18. 微交互增强 v6.1
 * 叠加层：在现有样式之上增强视觉反馈，不覆盖原有基础样式
 * 尊重 prefers-reduced-motion（已在第 2 节全局关闭动画）
 * ==================================================== */

/* --- 主按钮：hover 时斜向光泽扫过 --- */
.btn-primary,
.btn-hero {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

/* --- 文章列表项：hover 封面蒙层（顶部高光线已移除，与 ::before 左侧色块功能重叠） --- */
/* 封面图：hover 时叠加柔光渐变，增加层次感 */
.article-cover {
    position: relative;
}

.article-item .article-cover-wrap {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.article-item .article-cover-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        transparent 55%,
        rgba(28, 25, 21, 0.18) 100%
    );
    opacity: 0;
    transition: opacity var(--duration-slow) var(--ease-out);
    pointer-events: none;
}

.article-item:hover .article-cover-wrap::after {
    opacity: 1;
}

[data-theme="dark"] .article-item .article-cover-wrap::after {
    background: linear-gradient(
        180deg,
        transparent 55%,
        rgba(0, 0, 0, 0.32) 100%
    );
}

/* --- 标签：hover 时左侧出现强调点 --- */
.tag {
    position: relative;
    padding-left: 18px;
}

.tag::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    transition: transform var(--duration-fast) var(--ease-spring);
}

.tag:hover::before {
    transform: translateY(-50%) scale(1);
}

/* --- 评论头像：hover 出现强调环 --- */
.comment-avatar {
    transition: transform var(--duration-normal) var(--ease-spring),
                box-shadow var(--duration-normal) ease;
}

.comment-item:hover .comment-avatar {
    transform: scale(1.06) rotate(-2deg);
    box-shadow: 0 0 0 3px var(--primary-light), var(--shadow-sm);
}

/* --- 表单输入：聚焦时边框渐显 + 微提升 --- */
.form-input,
.form-textarea,
.form-select {
    transition: border-color var(--duration-fast) ease,
                box-shadow var(--duration-normal) var(--ease-out),
                transform var(--duration-fast) var(--ease-out),
                background-color var(--duration-fast) ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    transform: translateY(-1px);
    box-shadow: 0 0 0 3px var(--primary-light),
                0 4px 12px rgba(255, 123, 165, 0.08);
}

/* --- 卡片入场动画：滚动可见时淡入上移 --- */
@keyframes lmFadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.article-item,
.widget,
.comment-item {
    animation: lmFadeUp var(--duration-slower) var(--ease-out) both;
}

/* 错开评论与子评论的入场节奏 */
.comment-reply {
    animation: lmFadeUp var(--duration-slow) var(--ease-out) both;
}

/* --- 文章正文链接：动画下划线 --- */
.article-content a,
.comment-content a {
    background-image: linear-gradient(var(--primary-color), var(--primary-color));
    background-size: 0% 1.5px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size var(--duration-normal) var(--ease-out);
    padding-bottom: 1px;
}

.article-content a:hover,
.comment-content a:hover {
    background-size: 100% 1.5px;
}

/* --- 阅读进度条：渐变流动光效 --- */
.reading-progress {
    background: linear-gradient(
        90deg,
        var(--primary-color) 0%,
        var(--primary-hover) 50%,
        var(--primary-color) 100%
    );
    background-size: 200% 100%;
    animation: lmProgressFlow 4s linear infinite;
}

@keyframes lmProgressFlow {
    from { background-position: 0% 0; }
    to { background-position: 200% 0; }
}

/* --- 文章互动按钮：点赞激活时心形脉动 --- */
.article-action-btn.like-btn.active {
    animation: lmHeartBeat 0.6s var(--ease-spring);
}

@keyframes lmHeartBeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.18); }
    50% { transform: scale(0.95); }
    75% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

.article-action-btn {
    transition: transform var(--duration-fast) var(--ease-spring),
                background-color var(--duration-fast) ease,
                color var(--duration-fast) ease,
                box-shadow var(--duration-normal) ease;
}

.article-action-btn:hover {
    transform: translateY(-2px);
}

.article-action-btn:active {
    transform: translateY(0) scale(0.96);
}

/* --- 空状态图标：缓慢呼吸效果 --- */
.empty-state-icon {
    animation: lmBreathe 3.5s ease-in-out infinite;
    color: var(--text-muted);
}

@keyframes lmBreathe {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.06); opacity: 1; }
}

/* --- 侧栏小部件：hover 顶部出现强调线 --- */
.widget {
    position: relative;
}

.widget::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--duration-slow) var(--ease-out);
}

.widget:hover::after {
    transform: scaleX(1);
}

/* ====================================================
 * 20. 排版令牌统一工具类 v6.2
 * 叠加层：抽象 sidebar/bottom-widgets 内联样式，统一走令牌
 * 不覆盖基础样式；尊重 prefers-reduced-motion（本节不引入新动画）
 * ==================================================== */

/* 站点统计网格（bottom-widgets） */
.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
}
.stat-cell {
    text-align: center;
    padding: var(--space-3);
    background: var(--bg-subtle);
    border-radius: var(--radius);
}
.stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: var(--leading-tight);
}
.stat-value--primary { color: var(--primary-color); }
.stat-value--success { color: var(--success-color); }
.stat-value--warning { color: var(--warning-color); }
.stat-value--accent  { color: var(--accent-color); }
.stat-label {
    font-size: var(--text-xs);
    color: var(--text-light);
    margin-top: 2px;
}

/* widget 操作区/按钮 */
.widget-action {
    margin-top: var(--space-4);
    text-align: center;
}
.widget-action-link {
    font-size: var(--text-sm);
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--duration-fast) ease;
}
.widget-action-link:hover { color: var(--primary-hover); }
.btn-block { width: 100%; }

/* 标签云 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}
.tag--sm { font-size: var(--text-sm); }

/* 链接列表紧凑变体 */
.link-item--compact { padding: var(--space-2) 0; }

/* 空状态文本 */
.empty-text {
    color: var(--text-light);
    text-align: center;
    padding: var(--space-3);
    font-size: var(--text-sm);
}
.empty-text--inline { display: inline; padding: 0; }
.empty-state--compact { padding: var(--space-5); }

/* 头像回退 */
.link-avatar--fallback {
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-inverse);
    font-size: var(--text-sm);
}

/* 模态框排版 */
.modal-heading { margin-bottom: var(--space-4); }
.modal-qr-img { max-width: 200px; }

/* 页脚元信息 */
.footer-meta {
    margin-top: var(--space-2);
    color: var(--text-light);
    font-size: var(--text-sm);
}

/* --- 文章列表信息密度精修（保守，不动结构） --- */
.article-cover { margin-bottom: var(--space-3); }
.article-title { margin-bottom: var(--space-2); }
.article-excerpt { margin-bottom: var(--space-3); }

/* --- 文章列表 meta 间距响应式收紧 --- */
@media (max-width: 768px) {
    .article-meta { gap: var(--space-3); }
}
@media (max-width: 480px) {
    .article-meta { gap: var(--space-2); }
}
@media (max-width: 640px) {
    .article-item { padding: var(--space-4) 0; }
}

/* --- 暗色模式微调 --- */
[data-theme="dark"] .stat-cell { background: var(--bg-subtle); }

/* ====================================================
 * 21. 移动端适配增强 v6.3
 * 叠加层：修复移动端横向溢出、触摸目标、字号可读性、触摸设备交互
 * 尊重 prefers-reduced-motion（本节不引入新动画）
 * ==================================================== */

/* --- 高：文章正文长 URL / 长词断行，防止横向溢出 --- */
.article-content p,
.article-content a,
.article-content li,
.article-content blockquote {
    overflow-wrap: anywhere;
    word-break: normal;
}

.article-content a {
    overflow-wrap: anywhere;
}

/* --- 高：文章嵌入 iframe / video 响应式，防止固定宽度溢出 --- */
.article-content iframe,
.article-content video,
.article-content embed,
.article-content object {
    max-width: 100%;
}
.article-content iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 0;
    border-radius: var(--radius);
    margin: var(--space-4) 0;
}

/* --- 中：触摸目标尺寸提升至 ≥44px（iOS HIG / Material 规范） --- */
.mobile-drawer-close {
    width: 44px;
    height: 44px;
}
.read-more-link,
.article-list-more {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}
.btn-sm {
    min-height: 36px;
}

/* --- 中：480px 不应缩小顶部图标按钮，保持 44×44 触摸目标 --- */
@media (max-width: 480px) {
    .search-trigger,
    .theme-toggle,
    .social-icon-link {
        width: 44px;
        height: 44px;
        padding: 10px;
    }
    /* 文章 meta / 标签 / 快捷导航字号从 12px 提升到 13px，保证可读性 */
    .article-meta {
        font-size: var(--text-sm);
    }
    .tag {
        font-size: var(--text-sm);
    }
    .quick-nav-item {
        font-size: var(--text-sm);
    }
}

/* --- 中：触摸设备（无 hover）gallery 按钮始终显示，尺寸提升 --- */
@media (hover: none) {
    .gallery-item-overlay {
        opacity: 1;
        background: linear-gradient(to bottom, transparent 55%, rgba(0, 0, 0, 0.65) 100%);
    }
    .gallery-btn {
        width: 44px;
        height: 44px;
    }
}

/* --- 低：360px 超小屏文章图片画廊降为单列 --- */
@media (max-width: 360px) {
    .article-gallery {
        grid-template-columns: 1fr;
    }
}

/* --- 低：留言板 / 友链申请提交按钮移动端占满宽度 --- */
@media (max-width: 640px) {
    .comment-form .btn-primary,
    .guestbook-form .btn-primary,
    .link-apply-form .btn-primary {
        width: 100%;
    }
}


/* ====================================================
 * 22. UI polish v6.4
 * Homepage hierarchy, calmer cards, and better mobile layout.
 * ==================================================== */

body {
    background:
        linear-gradient(180deg, rgba(183, 148, 244, 0.06) 0%, transparent 320px),
        var(--bg-color);
}

.main-wrapper {
    align-items: flex-start;
}

.header {
    box-shadow: 0 1px 0 var(--border-subtle);
}

.header.is-scrolled {
    box-shadow: 0 10px 30px rgba(28, 25, 21, 0.08);
}

.logo,
.home-hero h1,
.card-title,
.article-title,
.profile-name {
    letter-spacing: 0;
}

.nav {
    min-width: 0;
}

.nav a {
    white-space: nowrap;
}

.search-trigger,
.theme-toggle,
.social-icon-link,
.mobile-menu-btn {
    background: rgba(255, 255, 255, 0.44);
    border-color: var(--border-subtle);
}

[data-theme="dark"] .search-trigger,
[data-theme="dark"] .theme-toggle,
[data-theme="dark"] .social-icon-link,
[data-theme="dark"] .mobile-menu-btn {
    background: rgba(255, 255, 255, 0.04);
}

.card,
.widget,
.article-detail-card {
    box-shadow: 0 1px 2px rgba(28, 25, 21, 0.04);
}

.card:hover,
.widget:hover,
.article-detail-card:hover {
    border-color: var(--border-color);
    box-shadow: var(--shadow-lg);
}

.card-header,
.widget-header {
    background: linear-gradient(180deg, var(--card-bg), var(--bg-subtle));
}

.home-hero {
    grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
    align-items: end;
    gap: clamp(24px, 5vw, 56px);
    min-height: clamp(340px, 42vw, 520px);
    padding: clamp(40px, 7vw, 88px) clamp(24px, 5vw, 72px);
    background:
        linear-gradient(135deg, rgba(183, 148, 244, 0.12) 0%, transparent 48%),
        linear-gradient(315deg, var(--primary-light) 0%, transparent 42%),
        var(--card-bg);
}

.home-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.28), transparent 48%);
    pointer-events: none;
}

[data-theme="dark"] .home-hero::before {
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.04), transparent 48%);
}

.home-hero.has-bg::before {
    display: none;
}

.home-hero-content,
.home-hero-panel {
    position: relative;
    z-index: 1;
}

.home-eyebrow {
    padding: 6px 10px;
    border: 1px solid var(--primary-light);
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.48);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
}

[data-theme="dark"] .home-eyebrow {
    background: rgba(255, 255, 255, 0.06);
}

.home-hero h1 {
    max-width: 20ch;
    text-wrap: balance;
}

.home-hero p {
    max-width: 58ch;
}

.home-hero-actions .btn {
    min-width: 132px;
}

.home-hero:not(.has-bg) .btn-hero {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 8px 18px var(--primary-glow);
}

.home-hero:not(.has-bg) .btn-hero:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.home-hero:not(.has-bg) .home-hero-actions .btn-hero + .btn-hero {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-secondary);
    box-shadow: none;
}

.home-hero:not(.has-bg) .home-hero-actions .btn-hero + .btn-hero:hover {
    background: var(--hover-bg);
    border-color: var(--border-strong);
    color: var(--primary-color);
}

.home-hero-panel {
    align-self: stretch;
    grid-template-columns: 1fr;
    gap: var(--space-3);
    padding: var(--space-4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.52);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

[data-theme="dark"] .home-hero-panel {
    background: rgba(255, 255, 255, 0.06);
}

.hero-stat-card {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
}

.hero-stat-card span {
    font-size: clamp(1.9rem, 4vw, 3rem);
}

.hero-stat-card small {
    margin-top: 0;
    font-size: 0.86rem;
}

.home-hero.has-bg .home-hero-panel {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.22);
}

.home-hero.has-bg .hero-stat-card {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.18);
}

.home-hero + .card {
    margin-top: calc(var(--space-3) * -1);
}

.home-hero + .card .card-body {
    padding: var(--space-5);
}

.search-box {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto auto;
    gap: var(--space-3);
}

.search-box .form-input,
.search-box .btn {
    border-radius: var(--radius-lg);
}

.home-filter-row {
    align-items: flex-start;
    gap: var(--space-4);
    border-top-style: solid;
}

.home-filter-row > .category-filter + .category-filter,
.home-filter-row > .home-sort-filter {
    margin-left: auto;
    padding-left: var(--space-4);
}

.category-filter {
    gap: 8px;
}

.category-filter a {
    min-height: 36px;
    padding: 7px 14px;
    background: var(--bg-subtle);
}

.article-list-card,
.widget {
    border-radius: var(--radius-xl);
}

.article-list-toolbar {
    min-height: 66px;
}

.article-list-summary {
    padding: 5px 10px;
    border-radius: var(--radius-full);
    background: var(--bg-subtle);
}

.article-item {
    padding: 28px var(--space-6);
    transition: background-color var(--duration-fast) ease, box-shadow var(--duration-normal) var(--ease-out);
}

.article-item:hover {
    transform: none;
}

.article-cover {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
}

.article-item:hover .article-cover {
    transform: none;
    filter: saturate(1.04) contrast(1.02);
}

.article-title {
    font-size: clamp(1.18rem, 2vw, 1.42rem);
    text-wrap: balance;
}

.article-title a::after {
    display: none;
}

.article-meta {
    gap: 10px 16px;
}

.article-meta .meta-item {
    padding: 0;
    border-radius: 0;
    background: transparent;
}

.article-excerpt {
    max-width: 72ch;
}

.article-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.read-more-link,
.article-list-more {
    border: 1px solid var(--primary-light);
}

.tag {
    border-color: var(--primary-light);
    background: var(--primary-lighter);
}

.quick-nav-item,
.link-item,
.sponsor-item {
    min-height: 44px;
}

@media (max-width: 1180px) {
    .nav a {
        padding-inline: 10px;
        font-size: 0.84rem;
    }

    .header-actions {
        gap: 6px;
    }
}

@media (max-width: 1024px) {
    .home-hero {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .home-hero-panel {
        grid-template-columns: repeat(3, 1fr);
    }

    .hero-stat-card {
        display: block;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .home-hero {
        padding: 32px 20px;
        gap: var(--space-5);
    }

    .home-hero h1 {
        max-width: 100%;
    }

    .home-hero-panel {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        padding: var(--space-3);
    }

    .hero-stat-card {
        padding: var(--space-3);
    }

    .search-box {
        grid-template-columns: 1fr;
    }

    .search-box .btn {
        width: 100%;
    }

    .home-filter-row > .category-filter + .category-filter,
    .home-filter-row > .home-sort-filter {
        width: 100%;
        margin-left: 0;
        padding-left: 0;
        border-left: 0;
    }

    .category-filter {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    .category-filter::-webkit-scrollbar {
        display: none;
    }

    .category-filter a {
        flex: 0 0 auto;
    }

    .article-list-toolbar {
        align-items: flex-start;
    }

    .article-list-summary {
        order: 3;
        width: 100%;
    }

    .article-item {
        padding: var(--space-5) var(--space-4);
    }
}

@media (max-width: 480px) {
    .home-hero {
        border-radius: var(--radius-lg);
    }

    .home-hero-panel {
        grid-template-columns: 1fr;
    }

    .hero-stat-card {
        display: flex;
        text-align: left;
    }

    .article-list-card {
        border-radius: var(--radius-lg);
    }

    .article-list-more,
    .article-actions .read-more-link {
        width: 100%;
        justify-content: center;
        margin-left: 0;
    }
}

/* ==================== UI 中等优化补丁 v1 ==================== */

/* 改动1：焦点环可见性修复 —— 在主色背景元素上改用白色描边 + 主色阴影环 */
.btn-primary:focus-visible,
.page-link.active:focus-visible,
.category-filter a.active:focus-visible,
.tag-cloud-item:hover:focus-visible,
.read-more-link:hover:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--primary-glow);
}

/* 改动8：触摸目标尺寸提升 —— 标签与分页按钮满足 44px 推荐 */
.tag {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
}

.page-link {
    min-height: 44px;
}

/* ==================== 二次元少女风装饰层 ==================== */

/* 樱花飘落容器：固定全屏，不阻挡交互 */
.sakura-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

/* 单片樱花 */
.sakura {
    position: absolute;
    top: -20px;
    width: 14px;
    height: 14px;
    background: radial-gradient(circle at 30% 30%, #ffd0e0 0%, #ff9bbf 60%, #ff7ba5 100%);
    border-radius: 50% 0 50% 0;
    opacity: 0.85;
    animation: sakura-fall linear infinite;
    filter: drop-shadow(0 0 2px rgba(255, 123, 165, 0.3));
}

/* 樱花飘落关键帧：从顶部飘落到底部，带横向摆动和旋转 */
@keyframes sakura-fall {
    0% {
        transform: translate3d(0, -20px, 0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.85;
    }
    50% {
        transform: translate3d(40px, 50vh, 0) rotate(180deg);
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translate3d(-30px, 100vh, 0) rotate(360deg);
        opacity: 0;
    }
}

/* 深色模式下樱花更柔和 */
[data-theme="dark"] .sakura {
    background: radial-gradient(circle at 30% 30%, #ffc8dc 0%, #ff9bbf 60%, #e85d8c 100%);
    opacity: 0.6;
    filter: drop-shadow(0 0 3px rgba(255, 155, 191, 0.4));
}

/* 尊重 reduced-motion：关闭飘落动画 */
@media (prefers-reduced-motion: reduce) {
    .sakura-container {
        display: none;
    }
    .sakura {
        animation: none;
    }
}

/* 后台页面禁用樱花装饰：通过 body class 或路径判断 */
body.admin-page .sakura-container,
body[class*="admin"] .sakura-container {
    display: none;
}

/* ============================================================
   少女风强化 v2.0 — 二次元樱花少女风全面增强
   不改变项目结构，仅在现有选择器上叠加粉色光晕、
   柔和动画、圆润质感与微交互。所有规则为后定义胜出。
   ============================================================ */

/* ---------- 0. 设计令牌补充 ---------- */
:root {
    --sakura-petal: #ffb8d0;
    --sakura-petal-light: #ffd5e6;
    --sakura-petal-deep: #e85d8c;
    --gradient-sakura: linear-gradient(135deg, #ff7ba5 0%, #b794f4 50%, #a7e0d6 100%);
    --gradient-sakura-soft: linear-gradient(135deg, rgba(255,123,165,0.08) 0%, rgba(183,148,244,0.06) 100%);
    --gradient-sakura-hover: linear-gradient(135deg, #e85d8c 0%, #c9a8f9 100%);
}

/* ---------- 1. 按钮：主按钮渐变 + 粉色光晕 + 柔和上浮 ---------- */
.btn-primary {
    background: var(--primary-gradient);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px var(--primary-glow), 0 2px 4px rgba(255,123,165,0.15);
    transition: all 0.28s var(--ease-out, cubic-bezier(0.16, 1, 0.3, 1));
    text-shadow: 0 1px 2px rgba(190,60,100,0.18);
}

.btn-primary:hover {
    background: var(--primary-gradient-hover);
    box-shadow: 0 6px 20px var(--primary-glow), 0 4px 12px rgba(255,123,165,0.25);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0) scale(0.97);
    box-shadow: 0 2px 8px var(--primary-glow);
}

/* ---------- 2. 按钮：次级按钮微浮 ---------- */
.btn-secondary {
    box-shadow: var(--shadow-xs);
    transition: all 0.25s var(--ease-out);
}

.btn-secondary:hover {
    box-shadow: 0 2px 8px var(--primary-glow);
    transform: translateY(-1px);
}

.btn-secondary:active {
    transform: translateY(0) scale(0.97);
}

/* ---------- 3. 按钮：Hero 磨砂玻璃 + 粉色光边 ---------- */
.btn-hero {
    background: rgba(255, 123, 165, 0.15);
    border-color: rgba(255, 184, 208, 0.5);
    backdrop-filter: blur(8px) saturate(1.3);
    -webkit-backdrop-filter: blur(8px) saturate(1.3);
    box-shadow: 0 4px 16px rgba(255,123,165,0.2), inset 0 1px 0 rgba(255,255,255,0.12);
    transition: all 0.3s var(--ease-out);
}

.btn-hero:hover {
    background: rgba(255, 123, 165, 0.28);
    border-color: rgba(255, 200, 220, 0.8);
    box-shadow: 0 6px 24px rgba(255,123,165,0.35), inset 0 1px 0 rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

/* ---------- 4. 卡片：悬浮微浮 + 轮廓光 ---------- */
.card {
    transition: box-shadow 0.32s var(--ease-out),
                transform 0.32s var(--ease-out),
                border-color 0.2s ease;
}

.card:hover {
    box-shadow: 0 8px 28px var(--primary-glow), var(--shadow-md);
    border-color: var(--border-strong);
}

/* 文章列表卡片不上浮，避免布局跳动 */
.article-list-card:hover {
    transform: none;
    box-shadow: var(--shadow-lg);
}

/* ---------- 5. 焦点环：粉色 ---------- */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ---------- 6. 表单聚焦光晕 ---------- */
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--primary-color);
    background: var(--card-bg);
    box-shadow: 0 0 0 3px var(--primary-light), 0 2px 8px var(--primary-glow);
    outline: none;
}

/* ---------- 7. 链接 hover ---------- */
a:hover {
    text-decoration-color: var(--primary-color);
}

/* ---------- 8. 导航栏下划线动画 ---------- */
.nav a {
    position: relative;
    padding: 6px 2px;
    transition: color 0.22s ease;
}

.nav a.active {
    color: var(--primary-color);
    font-weight: 700;
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary-gradient);
    border-radius: 2px;
    transform: translateY(50%);
    transition: all 0.3s var(--ease-spring);
}

.nav a:hover::after {
    width: 80%;
    left: 10%;
}

.nav a.active::after {
    width: 90%;
    left: 5%;
}

/* ---------- 9. Hero 统计卡片 ---------- */
.hero-stat-card {
    border-radius: var(--radius-lg);
    background: var(--gradient-sakura-soft);
    border: 1px solid var(--border-subtle);
    transition: transform 0.28s var(--ease-out), box-shadow 0.28s var(--ease-out),
                background 0.28s ease;
    overflow: hidden;
}

.hero-stat-card span {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
}

/* 有背景图时回退为纯白文字 */
.home-hero.has-bg .hero-stat-card span {
    -webkit-text-fill-color: #fff;
    background: none;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

@media (hover: hover) {
    .hero-stat-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 24px var(--primary-glow);
        background: linear-gradient(135deg, rgba(255,123,165,0.10) 0%, rgba(183,148,244,0.08) 100%);
    }
}

/* ---------- 10. 文章列表底部操作区 ---------- */
.article-list-toolbar {
    align-items: center;
}

.article-list-footer-actions {
    text-align: center;
    padding: 20px 0 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* ---------- 11. 置顶徽章 ---------- */
.pin-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: var(--primary-gradient);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 6px var(--primary-glow);
    vertical-align: middle;
}

.pin-badge svg {
    animation: pin-bounce 2.5s ease-in-out infinite;
}

@keyframes pin-bounce {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-2px) rotate(5deg); }
}

/* ---------- 12. 文章画廊统一比例 ---------- */
.article-gallery-item {
    aspect-ratio: 16 / 9;
}

.article-gallery-item--extra {
    display: none;
}

.article-gallery-more {
    z-index: 1;
    width: 100%;
    height: 100%;
    border: 0;
    font: inherit;
    cursor: zoom-in;
}

@media (prefers-reduced-motion: reduce) {
    .article-gallery-more {
        transition: none;
    }
}

/* ---------- 13. 搜索/筛选栏层级分组 ---------- */
.home-search-bar {
    margin-bottom: 16px;
}

.home-filter-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-4) var(--space-6);
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
}

.home-filter-group {
    min-width: 0;
}

.home-filter-label {
    display: block;
    margin-bottom: var(--space-2);
    color: var(--text-tertiary);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.08em;
}

.home-filter-group .category-filter {
    margin: 0;
}

.home-sort-group {
    padding-left: var(--space-5);
    border-left: 1px solid var(--border-subtle);
}

.home-sort-filter a {
    font-size: 0.82rem;
    padding: 5px 14px;
}

.home-hero-summary {
    align-content: center;
}

.home-hero-summary .hero-stat-card {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    text-align: left;
}

.home-hero-summary .hero-stat-card span {
    font-size: clamp(1.35rem, 2.4vw, 1.9rem);
}

.home-hero-summary .hero-stat-card small {
    margin-top: 0;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .home-filter-row {
        grid-template-columns: 1fr;
    }

    .home-sort-group {
        padding-left: 0;
        border-left: 0;
    }

    .home-filter-group .category-filter {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    .home-filter-group .category-filter::-webkit-scrollbar {
        display: none;
    }

    .home-filter-group .category-filter a {
        flex: 0 0 auto;
        min-height: 40px;
    }
}

@media (max-width: 480px) {
    .home-hero-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .home-hero-summary .hero-stat-card {
        display: block;
        padding: var(--space-3);
        text-align: center;
    }

    .home-hero-summary .hero-stat-card small {
        margin-top: var(--space-1);
        white-space: normal;
    }
}

/* ---------- 14. 移动端抽屉底部按钮 ---------- */
.mobile-drawer-footer .btn {
    flex: 1;
}

/* ---------- 15. 樱花飘落质感 ---------- */
.sakura {
    box-shadow: 0 0 4px rgba(255, 184, 208, 0.4);
}

[data-theme="dark"] .sakura {
    box-shadow: 0 0 5px rgba(255, 155, 191, 0.5);
}

/* ---------- 16. 暗色模式对比度 ---------- */
[data-theme="dark"] {
    --text-muted: #b097b8;
    --text-light: #9d87a6;
    --card-bg: #2a1f28;
    --bg-elevated: #322530;
}

[data-theme="dark"] .text-secondary {
    color: #c5b0cc;
}

/* ---------- 17. 页脚多列布局 ---------- */
.footer {
    background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg-subtle) 100%);
    border-top: 1px solid var(--border-color);
    padding: var(--space-12) 0 var(--space-8);
    margin-top: var(--space-12);
}

.footer-inner {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--space-8);
    align-items: start;
    text-align: left;
}

.footer-brand-col {
    max-width: 280px;
}

.footer-brand-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: var(--space-2);
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer-brand-desc {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.7;
}

.footer-nav-title {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: var(--space-3);
    padding-bottom: var(--space-2);
    border-bottom: 2px solid var(--border-subtle);
}

.footer-nav-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.footer-nav-list a {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    transition: color 0.22s ease, padding-left 0.22s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer-nav-list a:hover {
    color: var(--primary-color);
    padding-left: 4px;
}

.footer-meta-col {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.footer-social-row {
    display: flex;
    gap: var(--space-3);
}

.footer-social-row a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    background: var(--bg-subtle);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    transition: all 0.25s var(--ease-out);
    text-decoration: none;
}

.footer-social-row a:hover {
    background: var(--primary-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 12px var(--primary-glow);
    transform: translateY(-2px);
}

.footer-social-row a svg {
    width: 18px;
    height: 18px;
}

.footer-contact-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    font-size: var(--text-sm);
}

.footer-contact-list a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
    overflow-wrap: anywhere;
}

.footer-contact-list a:hover {
    color: var(--primary-color);
}

.footer-icp {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.footer-icp a {
    color: var(--text-tertiary);
    transition: color 0.2s ease;
}

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

.footer-bottom-bar {
    grid-column: 1 / -1;
    padding-top: var(--space-5);
    border-top: 1px solid var(--border-subtle);
    text-align: center;
    font-size: var(--text-xs);
    color: var(--text-tertiary);
}

.footer-meta {
    margin-top: var(--space-2);
    color: var(--text-tertiary);
    font-size: var(--text-xs);
}

.footer-meta .visitor-count {
    color: var(--primary-color);
    font-weight: 700;
}

@media (max-width: 768px) {
    .footer-inner {
        grid-template-columns: 1fr;
        gap: var(--space-6);
        text-align: center;
    }

    .footer-brand-col {
        max-width: none;
        margin: 0 auto;
    }

    .footer-nav-list {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--space-3) var(--space-4);
    }

    .footer-nav-title {
        text-align: center;
    }

    .footer-social-row {
        justify-content: center;
    }

    .footer-nav-list a:hover {
        padding-left: 0;
    }
}

/* ---------- 18. Widget 顶部彩虹条 ---------- */
.widget::after {
    background: var(--gradient-sakura);
    height: 3px;
    border-radius: 0 0 3px 3px;
    box-shadow: 0 1px 4px var(--primary-glow);
}

/* ---------- 19. 侧栏头像光环 ---------- */
.profile-avatar {
    box-shadow: 0 0 0 4px var(--card-bg), 0 0 0 6px var(--border-color), var(--shadow-md);
    transition: box-shadow 0.4s var(--ease-out), transform 0.4s var(--ease-spring);
}

.profile-avatar:hover {
    box-shadow: 0 0 0 4px var(--card-bg), 0 0 0 6px var(--primary-color), 0 0 20px var(--primary-glow);
    transform: rotate(3deg) scale(1.05);
}

/* ---------- 20. 返回顶部按钮 ---------- */
.back-to-top {
    box-shadow: 0 4px 16px var(--primary-glow), var(--shadow-md);
}

.back-to-top:hover {
    box-shadow: 0 6px 24px var(--primary-glow), var(--shadow-lg);
}

/* ---------- 21. 分页微交互 ---------- */
.pagination a,
.pagination span {
    transition: all 0.25s var(--ease-out);
}

.pagination a:hover {
    box-shadow: 0 2px 8px var(--primary-glow);
    transform: translateY(-1px);
}

/* ---------- 22. 标签 chip ---------- */
.tag {
    background: var(--gradient-sakura-soft);
    border: 1px solid var(--border-subtle);
    transition: all 0.25s var(--ease-out);
    cursor: default;
}

.tag:hover {
    background: var(--primary-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px var(--primary-glow);
    transform: translateY(-1px);
}

/* ---------- 23. Empty state ---------- */
.empty-state h3 {
    color: var(--primary-color);
}
/* ---------- 24. 首页筛选卡片间距 ---------- */
.home-filter-card {
    margin-bottom: 20px;
}

/* ---------- 25. AI 总结面板组件 ---------- */
.ai-summary-label {
    font-weight: 600;
}

.ai-provider-select {
    width: auto;
    min-width: 180px;
}

.ai-summary-alert {
    margin: 0;
    padding: 10px 14px;
    font-size: 0.85rem;
}

/* ---------- 26. 表单行内组 ---------- */
.form-group-inline {
    margin-bottom: 0;
}

/* 评论表单底部间距统一 */
.comment-form {
    margin-bottom: 32px;
}

/* ---------- 27. 空状态宽敞内边距 ---------- */
.empty-state-roomy {
    padding: 40px 20px;
}

/* ============================================================
   游戏管理后台 - Games Admin
   ============================================================ */
.game-sw-thumb {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border-color);
}
.game-sw-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
}

/* ---------- 28. 更多菜单级联覆盖 ---------- */
.nav-more-menu a,
.nav-more-menu a:hover,
.nav-more-menu a:focus-visible,
.nav-more-menu a.active {
    display: block;
    padding: 10px 12px;
    border-radius: var(--radius);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.5;
    text-decoration: none;
    transform: none;
    white-space: nowrap;
}

.nav-more-menu a:hover,
.nav-more-menu a:focus-visible,
.nav-more-menu a.active {
    background: var(--primary-light);
    color: var(--primary-color);
}

.nav-more-menu a::before,
.nav-more-menu a::after {
    content: none;
    display: none;
}

/* ==================== 首页文章卡片：短视频平台式（封面左小块 + 标题右置顶） ==================== */
.article-list-card .article-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
}

.article-cover-link {
    flex: 0 0 auto;
    align-self: flex-start;
    width: clamp(176px, 30%, 280px);
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: block;
    background: var(--bg-subtle);
}

.article-cover-link .article-cover {
    width: 100%;
    height: 100%;
    margin-bottom: 0;
    border: none;
    border-radius: 0;
    object-fit: cover;
}

.article-list-card .article-item-body {
    flex: 1 1 auto;
    min-width: 0;
}

.article-list-card .article-item-body .article-title {
    margin-top: 0;
}

.article-list-card .article-item-body .article-excerpt {
    -webkit-line-clamp: 2;
}

/* 悬停：封面在圆角框内轻微放大 */
.article-list-card .article-item:hover .article-cover-link .article-cover {
    transform: scale(1.05);
    filter: saturate(1.04) contrast(1.02);
}

@media (max-width: 640px) {
    .article-list-card .article-item {
        gap: var(--space-3);
    }
    .article-cover-link {
        width: 140px;
    }
}

@media (max-width: 480px) {
    .article-cover-link {
        width: 120px;
        border-radius: var(--radius);
    }
}
