/* === Dawnlight 博客 - 纸鹿摸鱼处风格 === */

/* === 间距系统 === */
:root {
    /* 基础间距 */
    --space-xs: 0.5rem;
    /* 8px */
    --space-sm: 1rem;
    /* 16px */
    --space-md: 1.5rem;
    /* 24px */
    --space-lg: 2rem;
    /* 32px */
    --space-xl: 3rem;
    /* 48px */

    /* 亮色主题 */
    --bg-color: #ffffff;
    --bg-secondary: #f5f5f5;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --accent-color: #0066cc;
    --accent-hover: #0052a3;
    --card-bg: #ffffff;
    --card-border: #e5e5e5;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
    --sidebar-width: 270px;
    --gap-size: 16px;
    --radius: 8px;

    /* 主题切换过渡 - 优化版 */
    --theme-transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    /* 深色主题 */
    --bg-color: #1a1a1a;
    --bg-secondary: #2a2a2a;
    --text-primary: #e8e8e8;
    --text-secondary: #a0a0a0;
    --text-tertiary: #707070;
    --accent-color: #4d94ff;
    --accent-hover: #3377ff;
    --card-bg: #242424;
    --card-border: #333333;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* === 全局滚动条隐藏 - 跨浏览器兼容 === */
/* Chrome, Safari, Edge (Chromium) */
*::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

/* Firefox */
* {
    scrollbar-width: none;
}

/* IE and Edge Legacy */
* {
    -ms-overflow-style: none;
}

/* 确保特定容器保持滚动功能 */
html,
body {
    overflow: hidden;
    height: 100vh;
}

body {
    /* MiSans 优先，中文使用 MiSans，英文使用 Inter */
    font-family: "MiSans", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.8;
    min-height: 100vh;
    /* 平滑主题切换 */
    transition: var(--theme-transition);
}

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

ul {
    list-style: none;
}

/* 布局 */
.layout-container {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--sidebar-width);
    gap: var(--gap-size);
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px;
    height: 100vh;
    box-sizing: border-box;
}

/* 卡片基础 */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* 左侧边栏 */
.sidebar-left {
    height: calc(100vh - 32px);
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sidebar-left::-webkit-scrollbar {
    display: none;
}

.left-panel {
    padding: 16px;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 32px);
}

.brand-area {
    text-align: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--card-border);
}

.logo-avatar {
    display: inline-block;
    margin-bottom: 12px;
}

.logo-avatar img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: block;
}



.brand-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
    display: block;
}

.brand-slogan {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
}

/* 搜索按钮 - 替代原来的搜索框 */
.search-trigger-btn {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    background: var(--bg-color);
    color: var(--text-tertiary);
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-trigger-btn:hover {
    border-color: var(--accent-color);
    color: var(--text-secondary);
    background: var(--bg-secondary);
}

.search-trigger-btn svg {
    flex-shrink: 0;
    opacity: 0.6;
}

.search-trigger-btn span {
    flex: 1;
    text-align: left;
}

.search-trigger-btn kbd {
    font-size: 0.7rem;
    font-family: 'SF Mono', 'Consolas', monospace;
    padding: 2px 6px;
    background: var(--bg-secondary);
    border: 1px solid var(--card-border);
    border-radius: 4px;
    color: var(--text-tertiary);
}

/* === 搜索弹窗样式 === */
.search-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 10vh;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-modal {
    width: 100%;
    max-width: 600px;
    max-height: 70vh;
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--card-border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(-20px) scale(0.98);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-modal-overlay.active .search-modal {
    transform: translateY(0) scale(1);
}

/* 搜索头部 */
.search-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--card-border);
}

.search-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 10px 14px;
    transition: all 0.2s;
}

.search-input-wrapper:focus-within {
    background: var(--bg-color);
    box-shadow: 0 0 0 2px var(--accent-color);
}

.search-input-wrapper .search-icon {
    flex-shrink: 0;
    color: var(--text-tertiary);
}

.search-input-wrapper input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1rem;
    color: var(--text-primary);
    outline: none;
}

.search-input-wrapper input::placeholder {
    color: var(--text-tertiary);
}

.search-clear-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: var(--card-border);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.search-clear-btn:hover {
    background: var(--accent-color);
    color: #fff;
}

.search-modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 8px;
    color: var(--text-tertiary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.search-modal-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* 搜索内容区 */
.search-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    min-height: 200px;
    max-height: 400px;
}

.search-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.clear-history-btn {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.clear-history-btn:hover {
    background: var(--bg-secondary);
    color: var(--accent-color);
}

.search-result-count {
    color: var(--accent-color);
    font-weight: 500;
}

/* 搜索历史列表 */
.search-history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.search-history-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.search-history-item:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: rgba(var(--accent-rgb, 0, 102, 204), 0.1);
}

.search-history-item .remove-history {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--text-tertiary);
    transition: all 0.2s;
}

.search-history-item .remove-history:hover {
    background: var(--card-border);
    color: var(--text-primary);
}

/* 搜索结果列表 */
.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    cursor: pointer;
    border: 1px solid transparent;
}

.search-result-item:hover,
.search-result-item.active {
    background: var(--bg-secondary);
    border-color: var(--card-border);
}

.search-result-item.active {
    border-color: var(--accent-color);
    background: rgba(var(--accent-rgb, 0, 102, 204), 0.08);
}

.search-result-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--accent-color);
}

.search-result-icon svg {
    width: 20px;
    height: 20px;
}

.search-result-content {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-title mark {
    background: rgba(255, 213, 0, 0.3);
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}

.search-result-meta {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-result-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.search-result-arrow {
    color: var(--text-tertiary);
    opacity: 0;
    transform: translateX(-4px);
    transition: all 0.2s;
}

.search-result-item:hover .search-result-arrow,
.search-result-item.active .search-result-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* 无结果状态 */
.search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-tertiary);
    text-align: center;
}

.search-empty svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.search-empty p {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.search-empty span {
    font-size: 0.85rem;
}

/* 搜索底部 */
.search-modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--card-border);
    background: var(--bg-secondary);
}

.search-tips {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.tip-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-tips kbd {
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 0.7rem;
    padding: 2px 6px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 4px;
    box-shadow: 0 1px 0 var(--card-border);
}

/* 搜索历史为空状态 */
.search-history-empty {
    color: var(--text-tertiary);
    font-size: 0.85rem;
    padding: 20px 0;
    text-align: center;
}

/* 移动端搜索弹窗响应式 */
@media (max-width: 768px) {
    .search-modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .search-modal {
        max-width: 100%;
        max-height: 85vh;
        border-radius: 20px 20px 0 0;
        transform: translateY(100%);
    }

    .search-modal-overlay.active .search-modal {
        transform: translateY(0);
    }

    .search-modal-header {
        padding: 12px 16px;
    }

    .search-input-wrapper {
        padding: 8px 12px;
    }

    .search-input-wrapper input {
        font-size: 16px;
        /* 防止 iOS 放大 */
    }

    .search-modal-body {
        padding: 12px 16px;
        max-height: none;
    }

    .search-modal-footer {
        padding: 10px 16px;
    }

    .search-tips {
        gap: 12px;
        flex-wrap: wrap;
    }

    .search-trigger-btn kbd {
        display: none;
    }
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
}

.nav-item:hover {
    background: var(--bg-color);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-color);
    color: #fff;
}

.left-footer {
    border-top: 1px solid var(--card-border);
    padding-top: 16px;
    margin-top: 16px;
}

.theme-btn {
    width: 100%;
    padding: 12px;
    background: var(--bg-color);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.85rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-btn:hover {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
    transform: translateY(-1px);
}

.theme-icon {
    flex-shrink: 0;
}

/* 默认显示太阳图标，隐藏月亮图标 */
.theme-icon-light {
    display: block;
}

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

/* 暗色模式下显示月亮图标，隐藏太阳图标 */
[data-theme="dark"] .theme-icon-light {
    display: none;
}

[data-theme="dark"] .theme-icon-dark {
    display: block;
}

.footer-info {
    text-align: center;
}

.copyright {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    line-height: 1.6;
    margin-bottom: 4px;
}

.beian-info {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    line-height: 1.6;
}

.beian-link {
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.beian-link:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.police-beian {
    margin-left: 8px;
}

/* 主内容区 */
.main-column {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    height: calc(100vh - 32px);
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.main-column::-webkit-scrollbar {
    display: none;
}

/* 内容区域 */
.content-area {
    max-width: 800px;
}

/* === 横向滚动精选文章区 === */
.featured-section {
    position: relative;
    padding: var(--space-md) var(--space-md) 4px;
    transition: var(--theme-transition);
}

.featured-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 0 4px;
}

.featured-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.featured-title::before {
    content: '';
    display: block;
    width: 4px;
    height: 16px;
    background: var(--accent-color);
    border-radius: 2px;
}

.featured-controls {
    display: flex;
    gap: 8px;
}

.scroll-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-btn:hover {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

.scroll-btn:active {
    transform: scale(0.95);
}

/* 精选文章滚动区域 wrapper */
.featured-scroll-wrapper {
    position: relative;
    margin: 0 -16px;
    padding: 0 16px;
}

.featured-scroll-container {
    position: relative;
    overflow: hidden;
    padding: 20px 0 8px;
    margin-top: 0;
    /* 遮罩，让两边看起来有渐变消失效果 */
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 16px, black calc(100% - 16px), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 16px, black calc(100% - 16px), transparent 100%);
}

/* 滚动热区 */
.scroll-zone {
    position: absolute;
    top: 4px;
    height: 160px;
    /* 与卡片高度一致 */
    width: 80px;
    z-index: 20;
    cursor: pointer;
    transition: background 0.2s ease;
}

.scroll-zone-left {
    left: 0;
}

.scroll-zone-right {
    right: 0;
}

.featured-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 0 4px;
    /* 防止内容贴边 */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.featured-scroll::-webkit-scrollbar {
    display: none;
}

/* Premium Featured Card Design */
.featured-card {
    flex: 0 0 240px;
    /* 更宽的卡片 */
    height: 140px;
    scroll-snap-align: start;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: #fff !important;
    /* 强制白色文字 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    background: #1a1a1a;
    /* Fallback color */
}

.featured-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

/* 背景图层 */
.featured-card-cover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    z-index: 0;
}

.featured-card:hover .featured-card-cover {
    transform: scale(1.1);
}

/* 渐变遮罩层 - 确保文字可读 */
.featured-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0.1) 100%);
    z-index: 1;
}

/* 内容层 */
.featured-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 12px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.featured-card-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-card-date {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 标签徽章 */
.featured-tag-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 3px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 原有轮播（保留作为备用） */
.carousel-section {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    height: 220px;
    display: none;
    /* 默认隐藏，可通过 JS 切换 */
}

.carousel-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.carousel-track {
    display: flex;
    height: 100%;
}

.featured-post-card {
    min-width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    text-decoration: none;
}

[data-theme="dark"] .featured-post-card {
    background: linear-gradient(135deg, #1e3a8a 0%, #3730a3 100%);
}

.featured-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.featured-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.3;
}

.featured-desc {
    font-size: 0.9rem;
    opacity: 0.95;
    line-height: 1.5;
    max-width: 70%;
}

.featured-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    margin-top: 8px;
}

.featured-meta .tag {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 4px;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: #fff;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.carousel-btn-prev {
    left: 10px;
}

.carousel-btn-next {
    right: 10px;
}

.carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}

.carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
}

.carousel-dot.active {
    background: rgba(255, 255, 255, 0.8);
}

/* 工具栏 */
.toolbar-section {
    padding: 0 4px 16px;
    /* Remove card padding, keep bottom margin space */
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 600;
    /* Remove card styling to make it just text/buttons */
    background: transparent;
    border: none;
    box-shadow: none;
}

.sort-options {
    display: flex;
    gap: 6px;
}

.sort-options span {
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.sort-options span:hover {
    background: var(--bg-color);
    color: var(--accent-color);
}

.sort-options span.active {
    background: var(--accent-color);
    color: #fff;
}

/* 文章卡片 */
.post-card {
    display: flex;
    /* Flex layout for left-right structure */
    align-items: stretch;
    /* Stretch to matching height */
    padding: 0;
    /* Remove padding from container, move to inner */
    margin-bottom: 16px;
    /* Compact margin */
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-sm);
    /* Add shadow for better boundary */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    height: 120px;
    /* Fixed height for compactness */
    text-decoration: none;
    color: inherit;
}

.post-card.has-cover .post-info {
    flex: 1;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 1;
    min-width: 0;
    /* Fix flex child overflow */
}

/* Fallback for no cover */
.post-card:not(.has-cover) .post-info {
    flex: 1;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.post-cover-wrapper {
    width: 35%;
    /* Right side width */
    max-width: 280px;
    min-width: 200px;
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
}

.post-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* Create the fade effect into background */
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 50%);
    mask-image: linear-gradient(to right, transparent 0%, black 50%);
}

/* Post Info Typography */
.post-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: auto;
    /* Push meta to bottom if space allows */
    opacity: 0.85;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 8px;
}

.post-date,
.post-words,
.post-category {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

/* Post Meta Tags */
.post-meta-tags {
    color: var(--text-tertiary);
    /* Use same color as other meta */
}

.meta-tag-pill {
    color: var(--accent-color);
    background: rgba(102, 126, 234, 0.1);
    /* Light accent bg */
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-right: 6px;
    /* Spacing between tags */
    font-weight: 500;
    line-height: normal;
}

.meta-tag-pill:last-child {
    margin-right: 0;
}

/* Hover Effects */
.post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: transparent;
}

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

/* Accent Line */
.post-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--accent-color);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.post-card:hover::before {
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .post-card {
        height: auto;
        flex-direction: column-reverse;
        /* Stack image on top or bottom? Let's hide cover or stack normally. Actually keeping row is better for small cards, maybe just shrink image */
    }

    .post-card.has-cover {
        height: 120px;
    }

    .post-cover-wrapper {
        width: 30%;
        min-width: 120px;
    }

    .post-desc {
        -webkit-line-clamp: 1;
        line-clamp: 1;
        /* Less text on mobile */
    }
}


.tag {
    color: var(--accent-color);
    background: rgba(102, 126, 234, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: normal;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 30px 0;
}

.pagination button {
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1rem;
    transition: color 0.2s ease;
}

.pagination button:hover:not(:disabled) {
    color: var(--accent-color);
}

.pagination button:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

#page-num {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    font-family: 'SF Mono', 'Consolas', monospace;
    letter-spacing: 1px;
}

/* 右侧边栏 */
.sidebar-right {
    height: calc(100vh - 32px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    line-height: 1.5;
}

.sidebar-right::-webkit-scrollbar {
    display: none;
}

.widget-card {
    padding: 14px 16px;
}

.widget-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--card-border);
    line-height: 1.3;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 4px;
    background: transparent;
    border-radius: 8px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    width: auto;
    border: none;
    /* Remove border for cleaner look in compact mode */
    position: relative;
}

/* Add vertical dividers between items */
.stat-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 20%;
    height: 60%;
    width: 1px;
    background: var(--card-border);
}

.stat-item:hover {
    transform: translateY(-2px);
    background: rgba(0, 0, 0, 0.02);
}

.stat-icon-wrapper {
    display: none;
    /* Hide icons to save space */
}

.stat-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 3px;
    line-height: 1.2;
}

.stat-num {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
    font-family: inherit;
    /* Use default font to match others */
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: transparent;
    /* Remove background for cleaner look or use very subtle one */
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 0;
    /* Remove margin to stack them */
    font-size: 0.85rem;
    line-height: 1.4;
    transition: background-color 0.2s;
}

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

.info-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.info-label {
    color: var(--text-tertiary);
    /* Softer color for label */
    font-weight: 500;
    line-height: 1.3;
}

.info-value {
    color: var(--text-primary);
    font-weight: 600;
    flex: 1;
    /* Take remaining space */
    padding-left: 10px;
    /* spacing from label */
    text-align: right;
    word-break: break-all;
    /* Allow breaking if extremely long */
    font-family: inherit;
    line-height: 1.3;
}

.social-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-color);
    border-radius: 10px;
    margin-bottom: 8px;
    text-decoration: none;
    color: var(--text-primary);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--card-border);
    line-height: 1.4;
}

.social-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.social-card.has-bg::before {
    opacity: 0.15;
}

.social-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.social-card:hover::before {
    opacity: 0.25;
}

.social-card.has-color {
    color: #fff;
}

.social-card.has-color:hover {
    filter: brightness(1.1);
}

.social-card-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 10px;
    font-size: 1.3rem;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    transition: background 0.2s ease, transform 0.2s ease;
}

.social-card:hover .social-card-icon {
    transform: scale(1.05);
}

.social-card.has-color .social-card-icon {
    background: rgba(255, 255, 255, 0.2);
}

.social-card-info {
    flex: 1;
    position: relative;
    z-index: 1;
    min-width: 0;
}

.social-card-name {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 2px;
    line-height: 1.3;
}

.social-card-desc {
    font-size: 0.75rem;
    opacity: 0.7;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

.social-card-arrow {
    position: relative;
    z-index: 1;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    color: var(--text-tertiary);
}

.social-card:hover .social-card-arrow {
    opacity: 1;
    transform: translateX(0);
}

.social-card.has-color .social-card-arrow {
    color: rgba(255, 255, 255, 0.8);
}

/* 文章详情 */
.article-container {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 40px;
    max-width: 800px;
    margin: 0 auto;
}

.article-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 16px 0;
    line-height: 1.4;
    color: var(--text-primary);
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--card-border);
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

.meta-item svg {
    flex-shrink: 0;
}

.article-container h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 24px;
    line-height: 1.4;
    color: var(--text-primary);
}

.back-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    margin-bottom: 24px;
    background: var(--bg-color);
    color: var(--text-secondary);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    font-size: 0.9rem;
}

/* 普通返回按钮样式 */
.back-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    margin-bottom: 24px;
    background: var(--bg-color);
    color: var(--text-secondary);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

/* 返回顶部按钮 */
.back-to-top,
#back-to-top {
    position: fixed;
    bottom: 24px;
    right: 16px;
    width: 48px;
    height: 48px;
    padding: 0;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-primary);
    z-index: 990;
    cursor: pointer;
    transition: all 0.3s ease;
}

#back-to-top:hover {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

#back-to-top:active {
    transform: translateY(-2px);
}

/* 文章封面样式 */
.article-cover-wrapper {
    margin-bottom: 20px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.article-cover {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

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

.markdown-body {
    line-height: 1.9;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.markdown-body h1,
.markdown-body h2 {
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 0.4em;
    margin-top: 2.5em;
    margin-bottom: 1.2em;
    font-weight: 600;
    color: var(--text-primary);
}

.markdown-body h1 {
    font-size: 1.8rem;
}

.markdown-body h2 {
    font-size: 1.5rem;
}

.markdown-body h3 {
    font-size: 1.25rem;
    margin-top: 2em;
    margin-bottom: 1em;
    font-weight: 600;
    color: var(--text-primary);
}

.markdown-body h4 {
    font-size: 1.1rem;
    margin-top: 1.8em;
    margin-bottom: 0.8em;
    font-weight: 600;
}

.markdown-body p {
    margin-bottom: 1.2em;
}

.markdown-body a {
    color: var(--accent-color);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.markdown-body a:hover {
    text-decoration-thickness: 2px;
}

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

.markdown-body code {
    font-family: "Consolas", "Monaco", "Courier New", monospace;
    font-size: 0.9em;
}

.markdown-body pre {
    background: #f6f8fa;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    padding: 16px;
    overflow-x: auto;
    margin: 1.5em 0;
    line-height: 1.6;
}

[data-theme="dark"] .markdown-body pre {
    background: #1e1e1e;
    border-color: #333;
}

.markdown-body pre code {
    color: var(--text-primary);
    background: transparent;
    padding: 0;
}

.markdown-body p code {
    background: rgba(0, 102, 204, 0.08);
    color: var(--accent-color);
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

[data-theme="dark"] .markdown-body p code {
    background: rgba(77, 148, 255, 0.15);
}

.markdown-body ul,
.markdown-body ol {
    padding-left: 1.8em;
    margin-bottom: 1.2em;
}

.markdown-body li {
    margin-bottom: 0.5em;
    line-height: 1.8;
}

.markdown-body li::marker {
    color: var(--text-tertiary);
}

.markdown-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5em 0;
}

.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 0.95rem;
}

.markdown-body table th,
.markdown-body table td {
    padding: 12px 14px;
    border: 1px solid var(--card-border);
    text-align: left;
}

.markdown-body table th {
    background: var(--bg-color);
    font-weight: 600;
    color: var(--text-primary);
}

.markdown-body table tbody tr:nth-child(even) {
    background: var(--bg-color);
}

.markdown-body table tbody tr:hover {
    background: var(--bg-color);
}

.markdown-body hr {
    border: none;
    border-top: 1px solid var(--card-border);
    margin: 2.5em 0;
}

.markdown-body strong {
    font-weight: 600;
    color: var(--text-primary);
}

.markdown-body em {
    font-style: italic;
}

/* 归档页面 */
.archive-container {
    padding: 24px 20px;
}

/* 归档头部 */
.archive-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--card-border);
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

/* 年龄徽章 */
.age-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--accent-color);
    border-radius: 6px;
    color: #fff;
}

.age-number {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
}

.age-text {
    font-size: 0.85rem;
}

/* 年份分组 */
.archive-year {
    margin-bottom: 32px;
    position: relative;
}

.year-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 16px;
    padding-left: 0;
    border-left: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 年份图标 - 阴影效果 */
.year-title::before {
    content: '';
    width: 16px;
    height: 16px;
    background: transparent;
    border-radius: 50%;
    box-shadow: 0 0 0 3px var(--accent-color);
}

.year-posts {
    position: relative;
    padding-left: 24px;
}

/* 时间轴线条 */
.year-posts::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent-color) 0%, transparent 100%);
    opacity: 0.3;
}

/* 文章条目 */
.archive-post {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 16px;
    background: var(--bg-color);
    border-radius: 8px;
    margin-bottom: 6px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    text-decoration: none;
    color: var(--text-primary);
    overflow: hidden;
}

.archive-post::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent-color);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.archive-post:hover {
    background: var(--card-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.archive-post:hover::before {
    transform: scaleY(1);
}

.archive-date {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    min-width: 85px;
    font-family: 'SF Mono', 'Consolas', monospace;
}

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

.archive-title {
    flex: 1;
    font-weight: 500;
}

/* 分类页面 - 优化版 */
.categories-container {
    padding: 24px;
}

.categories-container .page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.categories-container .page-title::before {
    content: '';
    display: block;
    width: 4px;
    height: 24px;
    background: var(--accent-color);
    border-radius: 2px;
}

.tags-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.tag-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 16px;
    position: relative;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    animation: tagCardFadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
}

/* 分类卡片渐入动画 */
@keyframes tagCardFadeIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 为每个卡片添加延迟动画 */
.tag-card:nth-child(1) {
    animation-delay: 0.05s;
}

.tag-card:nth-child(2) {
    animation-delay: 0.1s;
}

.tag-card:nth-child(3) {
    animation-delay: 0.15s;
}

.tag-card:nth-child(4) {
    animation-delay: 0.2s;
}

.tag-card:nth-child(5) {
    animation-delay: 0.25s;
}

.tag-card:nth-child(6) {
    animation-delay: 0.3s;
}

.tag-card:nth-child(n+7) {
    animation-delay: 0.35s;
}

.tag-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color), var(--accent-hover));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tag-card:hover {
    border-color: var(--accent-color);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
    transform: translateY(-4px) scale(1.01);
}

.tag-card:hover::before {
    opacity: 1;
}

.tag-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--card-border);
}

.tag-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tag-name::before {
    content: '#';
    color: var(--accent-color);
    margin-right: 2px;
}

.tag-count {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    background: var(--bg-secondary);
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 500;
    flex-shrink: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.tag-card:hover .tag-count {
    background: var(--accent-color);
    color: #fff;
}

.tag-posts {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tag-post-link {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 12px;
}

.tag-post-link:hover {
    background: var(--bg-secondary);
    color: var(--accent-color);
    transform: translateX(4px);
}

.tag-post-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tag-post-link .post-title {
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.2s;
}

.tag-post-link:hover .post-title {
    color: var(--accent-color);
}

.tag-post-link .post-excerpt {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

.tag-post-link .post-date {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    flex-shrink: 0;
    font-family: 'JetBrains Mono', monospace;
}

/* 分类卡片大小自适应 */
.tag-card-small .tag-posts {
    min-height: auto;
}

.tag-card-medium .tag-posts {
    min-height: auto;
}

/* 查看更多链接 */
.tag-more-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    margin-top: 8px;
    border-top: 1px dashed var(--card-border);
    font-size: 0.8rem;
    color: var(--accent-color);
    transition: all 0.2s;
}

.tag-more-link:hover {
    background: var(--bg-secondary);
    border-radius: 6px;
}

/* 分类详情页面 */
.category-detail-container {
    padding: 24px;
}

.category-detail-header {
    margin-bottom: 24px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-tertiary);
    text-decoration: none;
    margin-bottom: 16px;
    transition: color 0.2s;
}

.back-link svg {
    width: 16px;
    height: 16px;
}

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

.category-title-wrap {
    display: flex;
    align-items: baseline;
    gap: 16px;
    flex-wrap: wrap;
}

.category-title-wrap .page-title {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
}

.category-tag-icon {
    color: var(--accent-color);
    font-weight: 400;
}

.category-post-count {
    font-size: 0.85rem;
    color: var(--text-tertiary);
}

/* 分类页搜索栏 */
.category-search-bar {
    margin-bottom: 20px;
}

.category-search-bar input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    background: var(--bg-color);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.category-search-bar input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

.category-search-bar input::placeholder {
    color: var(--text-tertiary);
}

/* 分类文章列表 */
.category-posts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 分类文章列表项动画 */
.category-post-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--bg-color);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: categoryPostFadeIn 0.4s ease forwards;
    opacity: 0;
}

@keyframes categoryPostFadeIn {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 分类文章延迟动画 */
.category-post-item:nth-child(1) {
    animation-delay: 0.05s;
}

.category-post-item:nth-child(2) {
    animation-delay: 0.1s;
}

.category-post-item:nth-child(3) {
    animation-delay: 0.15s;
}

.category-post-item:nth-child(4) {
    animation-delay: 0.2s;
}

.category-post-item:nth-child(5) {
    animation-delay: 0.25s;
}

.category-post-item:nth-child(n+6) {
    animation-delay: 0.3s;
}

.category-post-item:hover {
    border-color: var(--accent-color);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px) translateX(4px);
}

.category-post-main {
    flex: 1;
    min-width: 0;
}

.category-post-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 6px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.2s;
}

.category-post-item:hover .category-post-title {
    color: var(--accent-color);
}

.category-post-excerpt {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    margin: 0 0 10px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.5;
}

.category-post-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.category-post-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.category-post-meta .meta-item svg {
    width: 14px;
    height: 14px;
}

.category-post-meta .featured-badge {
    color: var(--accent-color);
    font-weight: 500;
}

.category-post-arrow {
    flex-shrink: 0;
    color: var(--text-tertiary);
    transition: all 0.2s;
}

.category-post-arrow svg {
    width: 20px;
    height: 20px;
}

.category-post-item:hover .category-post-arrow {
    color: var(--accent-color);
    transform: translateX(4px);
}

.empty-category {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

/* 空状态 */
.tags-grid:empty::after {
    content: '暂无分类标签';
    display: block;
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px 20px;
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

/* 友链页面 - 优化版 */
.links-container {
    padding: 16px 14px;
}

.links-section {
    margin-bottom: 24px;
}

.links-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--card-border);
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.link-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-color);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: all 0.25s ease;
}

.link-card:hover {
    background: var(--card-bg);
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.link-avatar {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    background: var(--card-border);
}

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

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

.link-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.link-desc {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 申请友链区域 */
.links-info {
    padding: 16px;
    background: var(--bg-color);
    border-radius: 10px;
    border: 1px dashed var(--card-border);
}

.links-info h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.links-info>p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.links-info ul {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px 16px;
    margin-bottom: 12px;
}

.links-info li {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    padding-left: 12px;
    position: relative;
}

.links-info li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent-color);
}

.links-note {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    padding-top: 8px;
    border-top: 1px solid var(--card-border);
}

/* 友链申请说明 Markdown 内容样式 */
.links-info-content {
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.links-info-content h1,
.links-info-content h2,
.links-info-content h3,
.links-info-content h4 {
    color: var(--text-primary);
    font-weight: 600;
    margin-top: 16px;
    margin-bottom: 8px;
    line-height: 1.4;
}

.links-info-content h1 {
    font-size: 1.3em;
}

.links-info-content h2 {
    font-size: 1.15em;
}

.links-info-content h3 {
    font-size: 1.05em;
}

.links-info-content h4 {
    font-size: 1em;
}

.links-info-content h1:first-child,
.links-info-content h2:first-child,
.links-info-content h3:first-child {
    margin-top: 0;
}

.links-info-content p {
    margin-bottom: 10px;
}

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

.links-info-content strong {
    font-weight: 600;
    color: var(--text-primary);
}

.links-info-content em {
    font-style: italic;
}

.links-info-content del {
    text-decoration: line-through;
    color: var(--text-tertiary);
}

.links-info-content a {
    color: var(--accent-color);
    text-decoration: none;
}

.links-info-content a:hover {
    text-decoration: underline;
}

.links-info-content ul,
.links-info-content ol {
    margin: 10px 0;
    padding-left: 20px;
}

.links-info-content ul {
    list-style-type: disc;
}

.links-info-content ol {
    list-style-type: decimal;
}

.links-info-content li {
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.links-info-content li::marker {
    color: var(--accent-color);
}

.links-info-content blockquote {
    margin: 12px 0;
    padding: 10px 16px;
    border-left: 3px solid var(--accent-color);
    background: var(--bg-secondary);
    border-radius: 0 6px 6px 0;
    color: var(--text-secondary);
}

.links-info-content blockquote p {
    margin: 0;
}

.links-info-content code {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
    font-size: 0.9em;
    color: var(--accent-color);
}

.links-info-content pre {
    margin: 12px 0;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow-x: auto;
}

.links-info-content pre code {
    background: none;
    padding: 0;
    color: var(--text-primary);
}

.links-info-content hr {
    border: none;
    border-top: 1px solid var(--card-border);
    margin: 16px 0;
}

/* 空状态 */
.links-grid:empty::after {
    content: '暂无友链';
    display: block;
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

/* 移动端导航 */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--card-border);
    z-index: 1000;
    padding: 0 12px;
    align-items: center;
    justify-content: space-between;
}

.mobile-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-logo {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.mobile-title {
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.mobile-menu-btn {
    width: 44px;
    height: 44px;
    background: var(--bg-color);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    /* 优化触摸反馈 */
    -webkit-tap-highlight-color: transparent;
}

.mobile-menu-btn span {
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
}

.mobile-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    background: var(--card-bg);
    z-index: 1001;
    transform: translateX(-100%);
    overflow-y: auto;
    border-right: 1px solid var(--card-border);
    /* GPU加速优化 */
    will-change: transform;
    -webkit-transform: translateZ(0);
    transform: translateZ(0) translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-sidebar.active {
    transform: translateZ(0) translateX(0);
}

.mobile-sidebar-content {
    padding: 16px;
}

.mobile-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    background: var(--bg-color);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    /* 优化触摸反馈 */
    -webkit-tap-highlight-color: transparent;
}

.mobile-nav-menu {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    min-height: 44px;
    /* 优化触摸反馈 */
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s ease;
}

.mobile-nav-item:hover {
    background: var(--bg-color);
}

.mobile-nav-item:active {
    transform: scale(0.98);
}

.mobile-nav-item.active {
    background: var(--accent-color);
    color: #fff;
}

.mobile-search {
    margin-top: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--card-border);
}

.mobile-search input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    background: var(--bg-color);
    font-size: 0.9rem;
}

.mobile-footer {
    margin-top: 16px;
    padding-top: 16px;
}

.mobile-theme-btn {
    width: 100%;
    padding: 12px;
    background: var(--bg-color);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-primary);
    /* 确保文字颜色跟随主题 */
}

.mobile-theme-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

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

.mobile-copyright {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-align: center;
    line-height: 1.6;
}

.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 响应式 */
@media (max-width: 1024px) {
    .layout-container {
        grid-template-columns: 220px 1fr;
    }

    .sidebar-right {
        display: none;
    }

    .sidebar-left,
    .main-column {
        height: auto;
        overflow: visible;
    }
}

@media (max-width: 768px) {

    /* === 基础布局优化 === */
    html,
    body {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }

    .layout-container {
        grid-template-columns: 1fr;
        padding: 60px 12px 24px;
        gap: 16px;
        width: 100%;
        box-sizing: border-box;
        overflow-x: hidden;
        display: block;
        /* 改为 block 避免 grid 在移动端的复杂对其问题 */
    }

    .sidebar-left,
    .sidebar-right {
        display: none;
    }

    .main-column {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    /* === 顶部导航栏 === */
    .mobile-header {
        display: flex;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    }

    /* 移动端菜单关闭按钮位置修正 */
    .mobile-close-btn {
        top: 16px;
        right: 16px;
        width: 36px;
        height: 36px;
        font-size: 20px;
        z-index: 1002;
    }

    /* === 精选文章垂直堆叠优化 (避免水平溢出) === */
    .featured-section {
        margin: 0 -12px 20px -12px;
        padding: 0 12px;
        width: calc(100% + 24px);
    }

    .featured-scroll {
        display: flex;
        flex-direction: column;
        /* 移动端改为垂直堆叠 */
        gap: 12px;
        padding: 0;
        width: 100%;
    }

    .featured-card {
        flex: none;
        width: 100%;
        height: 180px;
        /* 稍微增加高度 */
    }

    /* 隐藏精选区滚动按钮 */
    .featured-controls,
    .scroll-zone {
        display: none !important;
    }

    /* === 文章列表 === */
    .content-area {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .post-card {
        padding: 16px;
        margin-bottom: 0;
        /* 由 gap 控制间距 */
    }

    .post-title {
        font-size: 1.15rem;
        line-height: 1.4;
    }

    .post-desc {
        font-size: 0.9rem;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        margin-bottom: 12px;
    }

    .post-meta {
        flex-wrap: wrap;
        gap: 8px 12px;
    }

    /* === 文章详情页 === */
    .article-container {
        padding: 20px 16px;
        margin: 0;
        border-radius: 8px;
        overflow-x: hidden;
        /* 防止内容溢出 */
    }

    .article-container h1 {
        font-size: 1.6rem;
        line-height: 1.3;
        margin-bottom: 16px;
    }

    .article-meta {
        font-size: 0.8rem;
        gap: 10px;
    }

    /* 代码块优化 - 允许内部水平滚动 */
    .markdown-body pre {
        margin: 1em -16px;
        /* 负边距让代码块贴边，增加可视宽度 */
        padding: 16px;
        border-radius: 0;
        border-left: none;
        border-right: none;
        width: calc(100% + 32px);
        overflow-x: auto;
    }

    /* 复制按钮位置适配 */
    .copy-code-btn {
        top: 4px !important;
        right: 4px !important;
        padding: 3px 8px !important;
        font-size: 0.75rem !important;
    }

    /* 图片自适应 */
    .markdown-body img {
        max-width: 100%;
        height: auto;
        border-radius: 6px;
    }

    /* === 归档页优化 === */
    .archive-container {
        padding: 20px 16px;
    }

    /* 修正归档时间轴溢出 */
    .archive-year {
        margin-left: 0;
        padding-left: 0;
    }

    .archive-post {
        display: flex;
        flex-direction: column;
        /* 日期和标题垂直排列 */
        gap: 4px;
        padding: 12px 0;
        border-bottom: 1px dashed var(--card-border);
    }

    .archive-date {
        font-size: 0.8rem;
        color: var(--text-tertiary);
        margin-right: 0;
    }

    .archive-title {
        font-size: 1rem;
    }

    /* === 分类页优化 === */
    .tags-grid,
    .links-grid {
        grid-template-columns: 1fr;
        /* 强制单列 */
        gap: 12px;
    }

    .categories-container,
    .category-detail-container,
    .links-container {
        padding: 20px 16px;
    }

    .category-post-item {
        padding: 12px;
    }

    .category-post-title {
        font-size: 1rem;
    }

    /* === 返回顶部按钮优化 === */
    #back-to-top {
        bottom: 24px;
        right: 20px;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: var(--card-bg);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        opacity: 0.9;
        display: none;
        /* JS 控制显示 Flex */
        z-index: 990;
    }

    #back-to-top.visible {
        display: flex !important;
    }

    /* === 分页器 === */
    .pagination {
        gap: 12px;
        padding: 20px 0;
    }

    .pagination button {
        min-width: 40px;
        height: 40px;
        padding: 0 12px;
        font-size: 0.9rem;
    }
}

/* 超小屏幕额外优化 */
@media (max-width: 375px) {
    .featured-card {
        height: 160px;
    }

    .mobile-title {
        max-width: 150px;
    }
}

/* === 移动端深度优化 === */
@media (max-width: 768px) {

    /* iOS 刘海屏/底部安全区域适配 */
    .layout-container {
        padding-top: calc(60px + env(safe-area-inset-top, 0px));
        padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
        padding-left: calc(12px + env(safe-area-inset-left, 0px));
        padding-right: calc(12px + env(safe-area-inset-right, 0px));
    }

    .mobile-header {
        padding-top: env(safe-area-inset-top, 0px);
        height: calc(50px + env(safe-area-inset-top, 0px));
    }

    /* 移动端侧边栏安全区域 */
    .mobile-sidebar {
        padding-top: env(safe-area-inset-top, 0px);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    /* 阅读进度条 - 确保在移动端可见 */
    .reading-progress {
        position: fixed;
        top: 50px;
        /* 顶部导航下方 */
        left: 0;
        width: 0%;
        height: 3px;
        background: linear-gradient(90deg, var(--accent-color), var(--accent-hover, #3377ff));
        z-index: 999;
        transition: width 0.1s ease-out;
    }

    /* 文章卡片优化 - 移动端隐藏封面图，内容完整显示 */
    .post-card {
        flex-direction: column;
        height: auto !important;
        min-height: unset;
        overflow: visible;
    }

    /* 移动端隐藏封面图，让内容区域有更多空间 */
    .post-card .post-cover-wrapper {
        display: none;
    }

    .post-card .post-info {
        flex: 1;
        padding: 16px;
        width: 100%;
    }

    .post-card.has-cover .post-info {
        padding: 16px;
    }

    /* 标题完整显示 */
    .post-title {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    /* 描述完整显示 */
    .post-desc {
        display: -webkit-box;
        -webkit-line-clamp: 3;
        line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-bottom: 12px;
    }

    /* 元信息自动换行 */
    .post-meta {
        flex-wrap: wrap;
        gap: 8px 16px;
    }

    /* 标签自动换行 */
    .post-meta-tags {
        flex-wrap: wrap;
        gap: 6px;
    }

    .meta-tag-pill {
        margin-right: 0;
    }

    /* 精选文章标题优化 */
    .featured-header {
        padding: 0 4px;
        margin-bottom: 12px;
    }

    .featured-title {
        font-size: 1rem;
    }

    /* 精选滚动区域边距优化 */
    .featured-scroll-wrapper {
        margin: 0;
        padding: 0;
    }

    .featured-scroll-container {
        padding: 8px 0;
        margin: 0;
        -webkit-mask-image: none;
        mask-image: none;
    }

    /* 工具栏优化 */
    .toolbar-section {
        padding: 0 0 12px;
        font-size: 0.9rem;
    }

    .sort-options span {
        padding: 8px 14px;
        font-size: 0.85rem;
        min-height: 36px;
        display: flex;
        align-items: center;
    }

    /* 触摸反馈优化 - 所有可点击元素 */
    .post-card:active,
    .featured-card:active,
    .mobile-nav-item:active,
    .sort-options span:active {
        opacity: 0.8;
        transform: scale(0.98);
    }

    /* 禁用默认触摸高亮 */
    a,
    button,
    .post-card,
    .featured-card,
    .link-card {
        -webkit-tap-highlight-color: transparent;
    }

    /* 移动端搜索输入框优化 */
    .mobile-search input {
        min-height: 44px;
        padding: 12px 14px;
        font-size: 16px;
        /* 防止 iOS 自动缩放 */
        border-radius: 10px;
    }

    .mobile-search input:focus {
        outline: none;
        border-color: var(--accent-color);
        box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
    }

    /* 移动端导航项优化 */
    .mobile-nav-item {
        min-height: 48px;
        padding: 14px 16px;
        border-radius: 10px;
        font-size: 0.95rem;
    }

    .mobile-nav-item svg {
        width: 20px;
        height: 20px;
    }

    /* 移动端主题切换按钮优化 */
    .mobile-theme-btn {
        min-height: 48px;
        font-size: 0.95rem;
        border-radius: 10px;
    }

    /* 移动端版权信息优化 */
    .mobile-copyright {
        padding: 16px 0;
        font-size: 0.8rem;
        line-height: 1.8;
    }

    /* 分页器触摸区域优化 */
    .pagination button {
        min-width: 48px;
        min-height: 48px;
        font-size: 1.2rem;
    }

    #page-num {
        font-size: 0.9rem;
        padding: 0 8px;
    }

    /* 返回顶部按钮优化 */
    .back-to-top,
    #back-to-top {
        width: 48px;
        height: 48px;
        bottom: calc(24px + env(safe-area-inset-bottom, 0px));
        right: 16px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--card-bg);
        border: 1px solid var(--card-border);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
        font-size: 1.2rem;
        color: var(--text-primary);
        z-index: 990;
    }

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

    /* 文章详情页优化 */
    .article-title {
        font-size: 1.4rem;
        line-height: 1.4;
    }

    .article-meta {
        gap: 12px;
        font-size: 0.8rem;
        padding-bottom: 16px;
    }

    .meta-item {
        font-size: 0.8rem;
    }

    /* 返回按钮优化 */
    .back-btn {
        min-height: 44px;
        padding: 10px 16px;
        font-size: 0.9rem;
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

    /* Markdown 内容优化 */
    .markdown-body {
        font-size: 1rem;
        line-height: 1.85;
    }

    .markdown-body h1 {
        font-size: 1.5rem;
        margin-top: 2em;
    }

    .markdown-body h2 {
        font-size: 1.3rem;
        margin-top: 1.8em;
    }

    .markdown-body h3 {
        font-size: 1.15rem;
        margin-top: 1.5em;
    }

    /* 表格响应式 */
    .markdown-body table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        font-size: 0.85rem;
    }

    .markdown-body table th,
    .markdown-body table td {
        padding: 10px 12px;
    }

    /* 友链页面优化 */
    .link-card {
        padding: 14px;
    }

    .link-avatar {
        width: 48px;
        height: 48px;
    }

    .link-title {
        font-size: 0.95rem;
    }

    /* 分类页面优化 */
    .tag-card {
        padding: 14px;
    }

    .tag-name {
        font-size: 0.95rem;
    }

    .tag-post-link {
        padding: 12px;
        min-height: 44px;
    }

    /* 归档页面优化 */
    .archive-post {
        min-height: 44px;
        padding: 14px 12px;
    }

    .year-title {
        font-size: 1.1rem;
    }

    /* 搜索弹窗移动端优化 */
    .search-result-item {
        padding: 14px 12px;
        min-height: 60px;
    }

    .search-result-icon {
        width: 36px;
        height: 36px;
    }

    .search-history-item {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
}

/* === 横屏模式优化 === */
@media (max-width: 768px) and (orientation: landscape) {
    .layout-container {
        padding-top: calc(50px + env(safe-area-inset-top, 0px));
    }

    .featured-section {
        margin-bottom: 16px;
    }

    .featured-card {
        height: 140px;
    }

    .mobile-sidebar {
        width: 320px;
        max-width: 50vw;
    }

    /* 横屏时文章卡片双列 */
    .content-area {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .post-card {
        height: auto;
    }
}

/* === 减少动画偏好 (无障碍) === */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* === ��������ʽ�Ż� === */
.announcement-wrapper {
    margin-bottom: 8px;
    animation: fadeIn 0.4s ease;
}

.announcement-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.announcement-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.announcement-item {
    position: relative;
    padding: 4px 28px 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    line-height: 1.4;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    transition: all 0.25s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.announcement-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transform: translateX(2px);
}

.announcement-type-icon {
    flex-shrink: 0;
    margin-top: 1px;
    display: flex;
    align-items: center;
}

.announcement-content-text p {
    margin: 0;
}

.announcement-close-btn {
    position: absolute;
    top: 4px;
    right: 6px;
    width: 16px;
    height: 16px;
    line-height: 14px;
    text-align: center;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    color: currentColor;
    opacity: 0.5;
    transition: all 0.2s;
    background: rgba(0, 0, 0, 0.05);
}

.announcement-close-btn:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

/* 类型样式 - 更细腻的颜色 */
/* Info (默认/蓝色) */
.announcement-item.type-info {
    background: linear-gradient(to right, rgba(59, 130, 246, 0.08), rgba(59, 130, 246, 0.02));
    border-color: rgba(59, 130, 246, 0.2);
    color: #1e3a8a;
}

.dark-mode .announcement-item.type-info {
    background: linear-gradient(to right, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.04));
    color: #93c5fd;
}

/* Warning (橙色) */
.announcement-item.type-warning {
    background: linear-gradient(to right, rgba(245, 158, 11, 0.08), rgba(245, 158, 11, 0.02));
    border-color: rgba(245, 158, 11, 0.2);
    color: #92400e;
}

.dark-mode .announcement-item.type-warning {
    background: linear-gradient(to right, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.04));
    color: #fcd34d;
}

/* Danger (红色 - 告警) */
.announcement-item.type-danger {
    background: linear-gradient(to right, rgba(239, 68, 68, 0.08), rgba(239, 68, 68, 0.02));
    border-co