/* ==================== 个人博客主题 - Lighthouse风格 ==================== */

/* ==================== CSS变量和重置样式 ==================== */
:root {
    /* 主色调 */
    --primary-color: #f472b6;
    --primary-hover: #ec4899;
    --primary-light: #fce7f3;
    --primary-dark: #db2777;
    
    /* 文本颜色 */
    --text-color: #374151;
    --text-light: #6b7280;
    --text-lighter: #9ca3af;
    
    /* 背景颜色 */
    --bg-color: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-card: #ffffff;
    --bg-hover: #f3f4f6;
    
    /* 边框和阴影 */
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px 0 rgba(0, 0, 0, 0.1);
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    /* 过渡动画 */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 深色模式 */
body.dark-mode {
    --text-color: #f3f4f6;
    --text-light: #9ca3af;
    --text-lighter: #d1d5db;
    --bg-color: #1f2937;
    --bg-secondary: #111827;
    --bg-card: #1e293b;
    --border-color: #374151;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px 0 rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px 0 rgba(0, 0, 0, 0.4);
}

/* 禁用阴影效果 */
body.shadow-disabled {
    --shadow-sm: 0 0 0 0 rgba(0, 0, 0, 0);
    --shadow-md: 0 0 0 0 rgba(0, 0, 0, 0);
    --shadow-lg: 0 0 0 0 rgba(0, 0, 0, 0);
}

body.shadow-disabled .site-header {
    box-shadow: none;
}

body.shadow-disabled .site-aside {
    box-shadow: none;
}

body.shadow-disabled .card {
    box-shadow: none;
    border: 1px solid var(--border-color);
}

body.shadow-disabled .card:hover {
    box-shadow: none;
    transform: translateY(0);
}

body.shadow-disabled .post-card {
    box-shadow: none;
    border: 1px solid var(--border-color);
}

body.shadow-disabled .post-card:hover {
    box-shadow: none;
    transform: translateY(0);
}

body.shadow-disabled .btn:hover {
    box-shadow: none;
    transform: translateY(0);
}

body.shadow-disabled .category-link:hover {
    box-shadow: none;
    transform: translateY(0);
}

body.shadow-disabled .post-item-lh:hover {
    box-shadow: none;
    transform: translateX(0);
}

body.shadow-disabled .post-card-lh:hover {
    box-shadow: none;
    transform: translateY(0);
}

body.shadow-disabled .modal {
    box-shadow: none;
    border: 1px solid var(--border-color);
}

body.shadow-disabled .site-aside {
    box-shadow: none;
}

body.shadow-disabled .top-nav-item.active {
    box-shadow: none;
}

body.shadow-disabled .top-search-form .search-btn:hover {
    box-shadow: none;
    transform: scale(1);
}

body.shadow-disabled .topic-item-sm:hover {
    box-shadow: none;
    transform: translateY(0);
}

body.shadow-disabled .read-more:hover {
    box-shadow: none;
    transform: translateY(0);
}

body.shadow-disabled .btn-more:hover {
    box-shadow: none;
    transform: translateX(0);
}

body.shadow-disabled .top-tag {
    box-shadow: none;
}

body.shadow-disabled .article-content pre {
    box-shadow: none;
}

body.shadow-disabled .comment-avatar {
    box-shadow: none;
}

body.shadow-disabled .comment-form-wrapper {
    box-shadow: none;
}

body.shadow-disabled .submit-btn:hover {
    box-shadow: none;
    transform: translateY(0);
}

body.shadow-disabled .post-card-simple {
    box-shadow: none;
    border: 1px solid var(--border-color);
}

body.shadow-disabled .post-card-simple:hover {
    box-shadow: none;
    transform: translateY(0);
}

body.shadow-disabled .post-card-lh {
    box-shadow: none;
    border: 1px solid var(--border-color);
}

body.shadow-disabled .post-card-lh:hover {
    box-shadow: none;
    transform: translateY(0);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-color);
    background: var(--bg-secondary);
    transition: var(--transition);
    scroll-behavior: smooth;
}

body.dark-mode {
    background: #111827;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

/* ==================== 容器和网格系统 ==================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -12px;
    margin-left: -12px;
    justify-content: flex-start;
}

.row.g-3 > * {
    padding: 12px;
}

/* 基础列定义 */
.col-12 { flex: 0 0 100%; max-width: 100%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }

/* 平板端列 */
@media (min-width: 768px) {
    .col-md-2 { flex: 0 0 20%; max-width: 20%; }
    .col-md-4 { flex: 0 0 25%; max-width: 25%; }
}

/* 桌面端列 */
@media (min-width: 992px) {
    .col-lg-3 { flex: 0 0 25%; max-width: 25%; }
    .col-lg-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .col-lg-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
    
    .d-lg-flex { display: flex !important; }
    .d-lg-none { display: none !important; }
}

/* 大桌面端显示控制 */
@media (min-width: 1200px) {
    .d-xl-block { display: block !important; }
    .d-xl-none { display: none !important; }
}

@media (max-width: 1199.98px) {
    .d-xl-block { display: none !important; }
    .d-xl-none { display: block !important; }
}

/* ==================== 站点包裹器 ==================== */
.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ==================== 左侧边栏 ==================== */
.site-aside {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    z-index: 1001;
    border-right: 1px solid var(--border-color);
    display: none;
    background: var(--bg-card);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

.site-aside.show {
    transform: translateX(0);
    display: block;
}

.aside-wrapper {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.aside-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
}

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

.aside-menu li {
    margin-bottom: 2px;
}

.aside-menu a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--text-color);
    border-radius: 8px;
    transition: var(--transition);
    text-decoration: none;
}

.aside-menu a:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

.aside-menu .current-menu-item a {
    background: var(--primary-color);
    color: #fff;
}

.menu-icon {
    width: 24px;
    text-align: center;
    margin-right: 12px;
    font-size: 18px;
}

.menu-text {
    font-size: 15px;
    font-weight: 500;
}

/* 左侧边栏子菜单样式 */
.aside-menu .has-submenu {
    position: relative;
}

.aside-menu .has-submenu .menu-arrow {
    margin-left: auto;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.aside-menu .has-submenu .submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 0;
}

.aside-menu .has-submenu .submenu li {
    border-bottom: none;
}

.aside-menu .has-submenu .submenu a {
    padding: 8px 20px 8px 56px;
    font-size: 14px;
    color: var(--text-light);
    border-bottom: none;
}

.aside-menu .has-submenu .submenu a:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

.aside-menu .has-submenu .submenu .active a {
    color: var(--primary-color);
    background: var(--primary-light);
}

/* 移动端：点击展开子菜单 */
@media (max-width: 991px) {
    .aside-menu .has-submenu.active .submenu {
        max-height: 300px;
    }
    
    .aside-menu .has-submenu.active .menu-arrow {
        transform: rotate(180deg);
    }
}

/* ==================== 站点头部和导航 ==================== */
.site-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 12px 0;
    transition: var(--transition);
    will-change: transform;
}

body.dark-mode .site-header {
    background: rgba(31, 41, 55, 0.95);
}

body.dark-mode .btn-close {
    background: rgba(30, 41, 59, 0.8);
    border-color: #475569;
    color: #9ca3af;
}

body.dark-mode .btn-close:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

body.dark-mode .search-box-wrapper .btn.btn-link.btn-icon {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.4);
}

body.dark-mode .search-box-wrapper .btn.btn-link.btn-icon:hover {
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.5);
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-dark) 100%);
}

.navbar {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: nowrap;
    width: 100%;
}

.navbar-header {
    flex-shrink: 0;
    flex: 0 0 auto;
    min-width: fit-content;
}

.navbar-brand {
    display: flex;
    align-items: center;
    font-size: 22px;
    font-weight: 800;
    color: var(--text-color);
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: -0.5px;
    height: 50px;
        padding: 15px;
}

.navbar-brand .logo {
    height: 40px;
    max-width: 200px;
    display: flex;
    align-items: center;
}

/* 导航和搜索框包装器 */
.nav-search-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1 1 auto;
    min-width: 0;
    overflow: visible;
    height: 50px;
}

/* 顶部导航链接 */
.top-nav {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex: 1;
    min-width: 0;
    height: 100%;
}

.top-nav::-webkit-scrollbar {
    display: none;
}

.top-nav-item {
    padding: 8px 16px;
    border-radius: 20px;
    color: var(--text-color);
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.top-nav-item:hover,
.top-nav-item.active {
    color: #fff;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* 导航菜单样式 */
.nav-list {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex: 1;
    min-width: 0;
    height: 100%;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-list::-webkit-scrollbar {
    display: none;
}

.nav-link {
    padding: 8px 16px;
    border-radius: 20px;
    color: var(--text-color);
    font-weight: 500;
    font-size: 14px;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    display: block;
}

.nav-link:hover,
.nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, #f472b6, #ec4899);
    box-shadow: 0 2px 8px rgba(236, 72, 153, 0.3);
}

/* 下拉菜单样式 */
.nav-item.has-dropdown {
    position: relative;
}

.nav-item.has-dropdown .nav-link {
    position: relative;
    padding-right: 30px;
}

.dropdown-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    transition: transform 0.3s ease;
}

.nav-item.has-dropdown:hover .dropdown-icon {
    transform: translateY(-50%) rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    min-width: 180px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 8px 0;
    margin-top: 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9999;
    list-style: none;
}

.nav-item.has-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-item {
    margin: 0;
    text-align: center;
}

.dropdown-link {
    display: block;
    padding: 10px 16px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
    border-radius: 0;
    white-space: nowrap;
    text-align: center;
}

.dropdown-link:hover,
.dropdown-link.active {
    background: var(--bg-hover);
    color: var(--primary-color);
}

/* 确保导航容器有足够的z-index和溢出显示 */
.nav-search-wrapper {
    position: relative;
    z-index: 1;
    overflow: visible;
}

.blog-header-nav {
    position: relative;
    z-index: 2;
    overflow: visible;
}

.nav-list {
    overflow: visible;
}

/* 修复导航项溢出隐藏问题 */
.nav-item {
    position: relative;
    overflow: visible;
}

.nav-item.has-dropdown {
    overflow: visible;
}

/* 移动端导航优化 */
@media (max-width: 991px) {
    /* 导航包装器优化 */
    .nav-search-wrapper {
        order: 1;
        flex: 1 1 100%;
        max-width: 100%;
        margin-top: 10px;
        margin-bottom: 0;
        position: relative;
    }
    
    /* 导航列表优化 - 默认隐藏，点击后显示 */
    .nav-list {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        background: var(--bg-card);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-lg);
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, opacity 0.3s ease;
        opacity: 0;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 1000;
        margin: 0;
        display: block;
        visibility: visible;
    }
    
    .nav-list.show {
        max-height: 500px;
        opacity: 1;
        overflow-y: auto;
        padding: 10px 0;
    }
    
    /* 导航项优化 */
    .nav-item {
        width: 100%;
        display: block;
    }
    
    .nav-link {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 20px;
        border-radius: 0;
        border-bottom: 1px solid var(--border-color);
        font-size: 15px;
        font-weight: 500;
        color: var(--text-primary);
        text-decoration: none;
    }
    
    .nav-item:last-child .nav-link {
        border-bottom: none;
    }
    
    .nav-item.has-dropdown .nav-link {
        padding-right: 20px;
    }
    
    .dropdown-icon {
        display: block;
        font-size: 12px;
        transition: transform 0.3s ease;
    }
    
    .nav-item.has-dropdown.active .dropdown-icon {
        transform: rotate(180deg);
    }
    
    /* 下拉菜单优化 */
    .dropdown-menu {
        position: static;
        box-shadow: none;
        border: none;
        margin-top: 0;
        opacity: 1;
        visibility: visible;
        transform: none;
        padding: 0;
        background: var(--bg-secondary);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        border-radius: 0;
        display: block;
    }
    
    .nav-item.has-dropdown.active .dropdown-menu {
        max-height: 300px;
    }
    
    .dropdown-item {
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .dropdown-link {
        padding: 10px 20px 10px 40px;
        font-size: 14px;
        border-radius: 0;
        text-align: left;
        color: var(--text-primary);
        text-decoration: none;
    }
    
    /* 确保导航在移动端可见 */
    .blog-header-nav {
        position: relative;
        z-index: 1001;
        display: block;
    }
    
    /* 搜索框显示在导航下方 */
    .search-box-wrapper {
        order: 2;
        flex: 1 1 100%;
        max-width: 100%;
        margin-top: 10px;
    }
    
    /* 强制显示导航 */
    .navbar-collapse {
        display: block !important;
    }
    
    .nav-search-wrapper .blog-header-nav {
        display: block !important;
    }
}

.blog-header-nav {
    width: 100%;
    height: 100%;
}

.list-menu {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* 顶部搜索框 */
.search-box-wrapper {
    position: relative;
    flex-shrink: 0;
    height: 50px;
    display: flex;
    align-items: center;
    margin-left: auto;
    right: 20px;
}

.search-box-wrapper .btn.btn-link.btn-icon {
    width: 42px;
    height: 42px;
        background: linear-gradient(135deg, #ff8fca 0%, #ff87c2 100%);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

.search-box-wrapper .btn.btn-link.btn-icon:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 6px 20px rgba(236, 72, 153, 0.4);
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-dark) 100%);
}

.search-box-wrapper .btn.btn-link.btn-icon:active {
    transform: scale(0.95);
}

.search-box-wrapper .btn.btn-link.btn-icon::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border-radius: 50%;
    z-index: -1;
    opacity: 0.5;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.3;
    }
    100% {
        transform: scale(1);
        opacity: 0.5;
    }
}

.top-search-form {
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 25px;
    padding: 5px;
    transition: var(--transition);
}

.top-search-form:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.top-search-form .search-input {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: transparent;
    font-size: 14px;
    min-width: 200px;
}

.top-search-form .search-input:focus {
    outline: none;
}

.top-search-form .search-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.top-search-form .search-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

/* ==================== 移动端搜索框 ==================== */
.mobile-search {
    flex: 1;
    max-width: 400px;
    margin: 0 20px;
}

.mobile-search-form {
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border-radius: 25px;
    padding: 5px;
    border: 2px solid transparent;
    transition: var(--transition);
}

.mobile-search-form:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.mobile-search-form .form-control {
    flex: 1;
    padding: 10px 15px;
    border: none;
    background: transparent;
    font-size: 14px;
}

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

.mobile-search-form .search-submit {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.mobile-search-form .search-submit:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

/* 移动端搜索框展开 */
.mobile-search-toggle.active {
    background: var(--primary-color) !important;
    color: #fff !important;
}

/* ==================== 按钮样式 ==================== */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    background: var(--primary-color);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

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

.btn-link {
    background: transparent;
    color: var(--text-color);
}

.btn-link:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 16px;
}

.btn-icon:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

.btn-rounded {
    border-radius: 50%;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

/* ==================== 模态框 ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    align-items: flex-start;
    justify-content: center;
    padding-top: 30vh;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.modal.show {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto;
}

.modal.show .modal-dialog {
    transform: translateY(0);
    opacity: 1;
}

.modal-dialog {
    transform: translateY(-50px);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 500px;
    width: 90%;
}

/* 移动端搜索模态框优化 */
@media (max-width: 768px) {
    .modal {
        padding-top: 30vh;
    }
    
    .modal-dialog {
        width: 95%;
        margin: 0;
    }

    .modal-body {
        padding: 15px;
    }

    .modal-header {
        padding: 15px;
    }

    .modal-title {
        font-size: 16px;
    }

    .form-control.p-2 {
        padding: 12px 16px;
        font-size: 16px;
    }
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
}

.btn-close {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    font-size: 20px;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    position: relative;
}

.btn-close::before {
    content: '✕';
    font-weight: 600;
    line-height: 1;
}

.btn-close:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    transform: rotate(90deg);
}

.btn-close:active {
    transform: rotate(90deg) scale(0.95);
}

.modal-body {
    padding: 20px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-color);
    transition: var(--transition);
    font-size: 15px;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-light);
}

/* ==================== 主体内容 ==================== */
.site-main {
    min-height: calc(100vh - 200px);
    background: var(--bg-body);
}

/* 分类和搜索页面的简化布局 */
.site-main.simple-layout {
    min-height: auto;
    background: transparent;
}

@media (max-width: 1199.98px) {
    .site-main {
        padding-left: 0;
    }
}

/* ==================== 主布局容器 ==================== */
.main-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.main-content-wrapper {
    flex: 1;
    min-width: 0;
}

.sidebar-right {
    width: 300px;
    flex-shrink: 0;
}


/* ==================== 专题模块样式 ==================== */
.topic-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.topic-item {
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

.topic-item:hover {
    transform: translateX(-5px);
}

.topic-link {
    display: block;
    text-decoration: none;
    position: relative;
}

.topic-thumb {
    width: 100%;
    aspect-ratio: 3/2;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.3s ease;
}

.topic-item:hover .topic-thumb {
    transform: scale(1.05);
}

.topic-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
    padding: 20px 15px 15px;
    color: white;
}

.topic-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
    color: white;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.topic-item:hover .topic-title {
    color: #fbbf24;
}

/* ==================== 分类卡片内专题推荐样式 ==================== */
.topic-section {
    margin-bottom: 20px;
}

.topic-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.topic-item-sm {
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: var(--transition);
}

.topic-item-sm:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.topic-link-sm {
    display: block;
    text-decoration: none;
}

.topic-thumb-sm {
    width: 100%;
    aspect-ratio: 16/9;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.3s ease;
}

.topic-item-sm:hover .topic-thumb-sm {
    transform: scale(1.05);
}

.topic-info-sm {
    padding: 10px;
    background: var(--bg-secondary);
}

.topic-title-sm {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
    color: var(--text-color);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
}

.topic-item-sm:hover .topic-title-sm {
    color: var(--primary-color);
}

.main-content {
    display: flex;
    gap: 40px;
}

.main-content > div:first-child {
    flex: 1;
}

.sidebar {
    width: 320px;
}

/* ==================== 博客首页网格布局 ==================== */
.blog-home {
    width: 100%;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.post-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 420px;
    border: 1px solid var(--border-color);
    will-change: transform;
}

.post-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.post-cover {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/9;
    background: var(--bg-secondary);
}

.post-cover a {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.post-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.post-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
    display: flex;
    align-items: flex-end;
    padding: 15px;
    opacity: 0;
    transition: var(--transition);
}

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

.post-date {
    color: #fff;
    background: var(--primary-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.post-title {
    font-size: 22px;
    margin-bottom: 12px;
    line-height: 1.4;
    font-weight: 700;
}

.post-title a {
    color: var(--text-color);
    display: block;
    transition: var(--transition);
}

.post-title a:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

.post-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    color: var(--text-lighter);
    font-size: 14px;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}

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

.post-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.read-more {
    display: inline-block;
    padding: 10px 24px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: #fff;
    border-radius: 25px;
    font-weight: 600;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.read-more::after {
    content: '→';
    margin-left: 8px;
    transition: var(--transition);
}

.read-more:hover::after {
    margin-left: 16px;
}

.read-more:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    color: #fff;
}

.edit-link {
    font-size: 14px;
    color: var(--text-lighter);
    transition: var(--transition);
}

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

/* ==================== Lighthouse 风格卡片 ==================== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: var(--transition);
    will-change: transform;
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-xl {
    height: 100%;
}

.card-header {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

.card-header .h4 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 0 10px;
}

.card-header .d-flex {
    display: flex;
    align-items: center;
}

.card-header .justify-content-between {
    justify-content: space-between;
}

.btn-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--primary-light);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    border: 1px solid var(--primary-light);
}

.btn-more:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-more i {
    font-size: 11px;
    transition: var(--transition);
}

.btn-more:hover i {
    transform: translateX(3px);
}

.card-header i {
    font-size: 20px;
        color: #f56262;
}

.card-body {
    padding: 15px;
}

/* ==================== 媒体组件 ==================== */
.media {
    position: relative;
    overflow: hidden;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    width: 100%;
}

.media-2x1 {
    aspect-ratio: 16/7;
}

.media-4x1 {
    aspect-ratio: 4/1;
}

.media-4x3 {
    aspect-ratio: 4/3;
}

.media-content {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.5s ease;
}

.media:hover .media-content {
    transform: scale(1.1);
}

.media-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.overlay-bottom {
    align-items: flex-end;
}

.overlay-bottom .h5 {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
}

.slide-goto {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
}

/* ==================== 轮播图 ==================== */
.index-slide {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
}

.swiper {
    width: 100%;
    max-width: 100%;
}

.swiper-wrapper {
    display: flex;
    transition: transform 0.3s;
}

.swiper-slide {
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
}

.swiper-pagination {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--transition);
}

.swiper-pagination-bullet-active {
    background: #fff;
    transform: scale(1.2);
}

/* ==================== 列表组件 ==================== */
.list-item {
    position: relative;
    transition: var(--transition);
    will-change: transform;
}

.list-item:hover {
    transform: translateY(-3px);
}

.custom-hover {
    cursor: pointer;
}

.custom-hover:hover {
    box-shadow: var(--shadow-md);
}

.list-content {
    padding: 12px 0;
}

.list-body {
    position: relative;
}

.list-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.5;
}

.list-title.h-1x {
    height: 1.5em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    box-orient: vertical;
}

.list-title.h-2x {
    height: 3em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    box-orient: vertical;
}

.list-desc {
    font-size: 13px;
    color: var(--text-lighter);
    line-height: 1.5;
}

.list-desc.h-1x {
    height: 1.5em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    box-orient: vertical;
}

.list-goto {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
}

.list-grouped {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.list-overlay {
    background: transparent;
}

.list-number {
    counter-reset: item;
}

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

.list-bordered .list-item {
    border-bottom: 1px solid var(--border-color);
    padding: 8px 0;
}

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

/* 数字排序样式 */
.list-number .list-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.list-number-badge {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dc2626, #ef4444);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: var(--transition);
}

.list-item:nth-child(2) .list-number-badge {
    background: linear-gradient(135deg, #ef4444, #f87171);
}

.list-item:nth-child(3) .list-number-badge {
    background: linear-gradient(135deg, #f87171, #fca5a5);
}

.list-item:nth-child(4) .list-number-badge {
    background: linear-gradient(135deg, #fca5a5, #fecaca);
}

.list-item:nth-child(5) .list-number-badge {
    background: linear-gradient(135deg, #fecaca, #fee2e2);
}

.list-item:nth-child(6) .list-number-badge {
    background: linear-gradient(135deg, #fee2e2, #fecdd3);
}

.list-item:hover .list-number-badge {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

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

.list-grid-padding {
    gap: 20px;
}

/* ==================== 栏目推荐 ==================== */
.index-sudoku {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.index-sudoku .list-item {
    text-align: center;
    padding: 15px 10px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.index-sudoku .list-item:hover {
    background: var(--primary-light);
}

.index-sudoku .btn-link {
    display: inline-block;
    width: 48px;
    height: 48px;
    line-height: 48px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary-color);
    margin-bottom: 8px;
}

.index-sudoku .btn-link:hover {
    background: var(--primary-color);
    color: #fff;
    transform: scale(1.1);
}

.index-sudoku .text-sm {
    font-size: 13px;
}

/* ==================== 烈火风格栏目推荐 ==================== */
.index-sudoku-lh {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 20px;
}

.category-item {
    display: flex;
    justify-content: center;
}

.category-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 15px;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    transition: var(--transition);
    text-decoration: none;
    width: 100%;
    max-width: 120px;
}

.category-link:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    background: var(--bg-card);
}

.category-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    color: #fff;
    font-size: 24px;
    transition: var(--transition);
    overflow: hidden;
}

.category-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.category-link:hover .category-icon {
    transform: rotate(10deg) scale(1.1);
}

.category-name {
    color: var(--text-color);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    line-height: 1.4;
}

/* ==================== 友情链接 ==================== */
.friend-links-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 5px 0;
}

.friend-link-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: var(--transition);
    min-width: 80px;
}

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

.friend-link-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    border-radius: 4px;
}

.friend-link-name {
    font-size: 14px;
    color: var(--text-color);
    font-weight: 500;
}

.empty-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    color: var(--text-light);
}

body.shadow-disabled .friend-link-item:hover {
    box-shadow: none;
    transform: translateY(0);
}

/* ==================== 烈火风格文章列表 ==================== */
.posts-list-lh {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 10px 0;
}

.post-item-lh {
    display: flex;
    gap: 20px;
    padding: 20px;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    transition: var(--transition);
    will-change: transform;
    border: 1px solid transparent;
}

.post-item-lh:hover {
    transform: translateX(8px);
    background: var(--bg-card);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.post-thumb {
    flex-shrink: 0;
    width: 200px;
}

.post-thumb a {
    display: block;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.post-thumb a:hover {
    box-shadow: var(--shadow-md);
}

.thumb-image {
        width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.3s ease;
}

.post-thumb a:hover .thumb-image {
    transform: scale(1.1);
}

.post-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 150px;
}

.post-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 10px;
    overflow: hidden;
}

.post-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-clamp: 2;
    box-orient: vertical;
}

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

.post-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
    font-size: 13px;
    color: var(--text-lighter);
    align-items: center;
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-meta i {
    font-size: 12px;
}

.post-desc {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.6;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-clamp: 3;
    box-orient: vertical;
}

/* ==================== 烈火风格卡片网格布局 ==================== */
.posts-grid-lh {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
}

.post-card-lh {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-secondary);
    transition: var(--transition);
    will-change: transform;
    border: 1px solid var(--border-color);
}

.post-card-lh:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.post-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.post-card-thumb {
    width: 100%;
    aspect-ratio: 4/3;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.3s ease;
}

.post-card-lh:hover .post-card-thumb {
    transform: scale(1.1);
}

.post-card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.3), transparent);
    color: #fff;
    transition: var(--transition);
}

.post-card-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    box-orient: vertical;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.post-card-lh:hover .post-card-title {
    color: #fff;
}

/* ==================== 通用链接样式优化 ==================== */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
    text-decoration: none;
}

/* ==================== 悬停效果优化 ==================== */
.category-link:hover,
.post-item-lh:hover,
.list-item:hover {
    cursor: pointer;
}

/* ==================== 顶部导航响应式 ==================== */
@media (max-width: 992px) {
    .nav-search-wrapper {
        flex-wrap: nowrap;
        overflow: hidden;
    }

    .top-nav {
        width: 100%;
        justify-content: flex-start;
        margin-bottom: 10px;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .top-nav::-webkit-scrollbar {
        display: none;
    }

    .top-search-form {
     
    }

    .top-search-form .search-input {
        flex: 1;
        min-width: auto;
    }

    /* 卡片网格平板端 - 4列 */
    .posts-grid-lh {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }

    .post-card-thumb {
        aspect-ratio: 1/1;
    }

    .post-card-info {
        padding: 10px;
    }

    .post-card-title {
        font-size: 13px;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    /* 主布局响应式 */
    .main-layout {
        flex-direction: column;
    }

    .sidebar-right {
        display: none !important;
    }

    .topic-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

/* ==================== 优化的列表样式 ==================== */
.list-item .list-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

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

/* ==================== 搜索框 ==================== */
.search-block .form-control {
    padding: 15px 20px;
    font-size: 16px;
    border-radius: var(--radius-md);
}

/* ==================== Flex 工具类 ==================== */
.flex-fill {
    flex: 1 1 auto;
}

.align-items-center {
    align-items: center;
}

.ms-auto {
    margin-left: auto !important;
}

.me-auto {
    margin-right: auto !important;
}

.ms-2 {
    margin-left: 8px !important;
}

.ms-3 {
    margin-left: 16px !important;
}

.ms-4 {
    margin-left: 24px !important;
}

.gap-16 {
    gap: 16px;
}

.gap-20 {
    gap: 20px;
}

.gap-24 {
    gap: 24px;
}

/* ==================== 文本工具类 ==================== */
.text-center {
    text-align: center;
}

.text-sm {
    font-size: 13px;
}

.text-xs {
    font-size: 12px;
}

.text-md {
    font-size: 15px;
}

.text-xx {
    font-size: 11px;
}

/* ==================== 宽度工具类 ==================== */
.w-36 {
    width: 90px;
}

.w-16 {
    width: 4rem;
}

/* ==================== 圆形工具类 ==================== */
.rounded {
    border-radius: var(--radius-sm) !important;
}

.rounded-1 {
    border-radius: var(--radius-md) !important;
}

.rounded-circle {
    border-radius: 50% !important;
}

/* ==================== 置顶标记 ==================== */
.top-tag {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    color: #fff;
    padding: 3px 12px;
    border-radius: 15px;
    font-size: 12px;
    margin-left: 10px;
    vertical-align: middle;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(238, 90, 90, 0.3);
}

/* ==================== 文章详情 ==================== */
.article-detail {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 10px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.article-detail .article-title {
    font-size: 36px;
    margin-bottom: 20px;
    line-height: 1.4;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.article-detail .article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding-bottom: 25px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 25px;
}

.article-detail .article-cover {
    margin-bottom: 35px;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.article-detail .article-cover img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
}

.article-content {
    line-height: 2.0;
    color: var(--text-color);
    margin-bottom: 40px;
    font-size: 18px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.article-content p {
    margin-bottom: 22px;
    text-align: justify;
    word-wrap: break-word;
    hyphens: auto;
    letter-spacing: 0.02em;
}

/* 文章标题样式优化 */
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5 {
    margin: 10px 0 15px;
    font-weight: 700;
    color: var(--text-color);
    position: relative;
    scroll-margin-top: 80px;
    line-height: 1.4;
}

/* H1 - 主标题 */
.article-content h1 {
    font-size: 34px;
    text-align: left;
    padding: 18px 0 15px;
    margin: 45px 0 25px;
    position: relative;
    border-bottom: 3px solid var(--primary-light);
    font-weight: 800;
}

.article-content h1::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
    border-radius: 2px;
}

/* H2 - 大章节 */
.article-content h2 {
    font-size: 20px;
    border-left: 6px solid var(--primary-color);
    background: linear-gradient(90deg, var(--primary-light), transparent);
    padding: 10px 15px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    margin-right: -25px;
}

.article-content h2::before {
    color: var(--primary-color);
    font-weight: 800;
}

/* H3 - 中章节 */
.article-content h3 {
    font-size: 24px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--primary-light);
    display: inline-block;
    width: 100%;
}

.article-content h3::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 80px;
    height: 3px;
    background: var(--primary-color);
}

/* H4 - 小章节 */
.article-content h4 {
    font-size: 20px;
    color: var(--primary-color);
    padding-left: 15px;
    border-left: 4px solid var(--primary-light);
    margin: 30px 0 20px;
    font-weight: 600;
}

/* H5 - 最小章节 */
.article-content h5 {
    font-size: 18px;
    color: var(--text-color);
    padding: 8px 0;
    margin: 25px 0 18px;
    font-weight: 600;
    position: relative;
}

.article-content h5::before {
    content: '▸ ';
    color: var(--primary-color);
    font-weight: 700;
}

.article-content code {
    background: var(--primary-light);
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 8px;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 15px;
    font-weight: 500;
    border: 1px solid rgba(244, 114, 182, 0.2);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.article-content pre {
    background: linear-gradient(135deg, #2d3748 0%, #1e293b 100%);
    color: #e2e8f0;
    padding: 25px;
    border-radius: var(--radius-lg);
    overflow-x: auto;
    margin-bottom: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border: 1px solid #374151;
    position: relative;
}

.article-content pre::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

body.dark-mode .article-content pre {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-color: #475569;
}

.article-content blockquote {
    border-left: 5px solid var(--primary-color);
    padding-left: 25px;
    margin-bottom: 25px;
    color: var(--text-light);
    font-style: italic;
    background: linear-gradient(90deg, var(--bg-secondary), transparent);
    padding: 20px 25px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    position: relative;
    font-size: 17px;
    line-height: 1.8;
}

.article-content blockquote::before {
    content: '"';
    position: absolute;
    top: 10px;
    left: 5px;
    font-size: 48px;
    color: var(--primary-light);
    opacity: 0.3;
    font-family: Georgia, serif;
}

/* 优化链接样式 */
.article-content a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 2px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.article-content a:hover {
    color: var(--primary-hover);
    border-bottom-color: var(--primary-color);
    background: var(--primary-light);
    padding: 0 4px 2px;
    border-radius: 4px;
}

/* 首段首字下沉效果 - 已禁用
.article-content > p:first-of-type {
    position: relative;
}

.article-content > p:first-of-type::first-letter {
    float: left;
    font-size: 5em;
    line-height: 0.8;
    margin: 0.1em 0.2em 0.1em 0;
    color: var(--primary-color);
    font-weight: 700;
    font-family: Georgia, serif;
}
*/

/* 图片样式优化 */
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    margin: 25px 0;
}

.article-content img:hover {
    transform: scale(1.02);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

/* 列表样式优化 */
.article-content ul,
.article-content ol {
    margin: 20px 0;
    padding-left: 25px;
}

.article-content li {
    margin-bottom: 8px;
    line-height: 1.8;
}

.article-content ul li::marker {
    color: var(--primary-color);
    font-size: 1.2em;
}

.article-content ol li::marker {
    color: var(--primary-color);
    font-weight: 600;
}

/* 表格样式优化 */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.article-content th,
.article-content td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.article-content th {
    background: var(--primary-light);
    color: var(--primary-color);
    font-weight: 600;
}

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

/* 响应式优化 */
@media (max-width: 768px) {
    .article-content {
        font-size: 16px;
        line-height: 1.9;
    }
    
    .article-content h1 {
        font-size: 26px;
        padding: 12px 0 10px;
        margin: 35px 0 20px;
    }
    
    .article-content h1::after {
        width: 80px;
        height: 3px;
    }
    
    .article-content h2 {
        font-size: 24px;
        margin-left: 0;
        margin-right: 0;
        padding: 14px 18px;
    }
    
    .article-content h3 {
        font-size: 20px;
    }
    
    .article-content h4 {
        font-size: 18px;
        padding-left: 12px;
    }
    
    .article-content h5 {
        font-size: 16px;
    }
    
    .article-content pre {
        padding: 15px;
        margin-left: -15px;
        margin-right: -15px;
        border-radius: 0;
    }
    
    /* 文章标签移动端优化 */
    .article-tags {
        padding: 20px 15px;
        gap: 8px;
    }
    
    .article-tags i {
        font-size: 16px;
    }
    
    .article-tags a {
        padding: 5px 12px;
        font-size: 13px;
    }
    
    /* .article-content > p:first-of-type::first-letter {
        font-size: 3.5em;
    } */
}



/* ==================== 评论区 ==================== */
.comments-section {
    margin-top: 50px;
    padding-top: 40px;
    border-top: 3px solid var(--border-color);
}

.comments-title {
    font-size: 26px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-color);
    font-weight: 700;
}

/* 评论列表容器 */
.comments-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* 评论项 */
.comments-list li.comment {
    position: relative;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0;
}

/* 评论框架结构优化 */
.comment-box {
    display: flex;
    gap: 12px;
    padding: 15px;
    margin-bottom: 0;
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

/* 主评论样式 */
.comment-level-1 {
    background: var(--bg-color);
}

/* 子评论容器 - 所有层级（统一缩进） */
.comments-list ol.children {
    list-style: none;
    padding-left: 0;
        position: relative;
}


/* 所有子评论项样式（二级及更深层级） - 统一框架 */
.comment-level-2,
.comment-level-3,
.comment-level-4,
.comment-level-5 {
    background: rgba(249, 250, 251, 0.5);
    border: 1px solid var(--border-light);
    margin-bottom: 10px;
    border-left: 3px solid var(--primary-light);
}

body.dark-mode .comment-level-2,
body.dark-mode .comment-level-3,
body.dark-mode .comment-level-4,
body.dark-mode .comment-level-5 {
    background: rgba(31, 41, 55, 0.3);
}



/* 评论头像样式 */
.comment-avatar {
    flex-shrink: 0;
}

.comment-avatar .avatar {
    border-radius: 50%;
    border: 2px solid var(--border-color);
    transition: border-color 0.3s ease;
}

.comment-level-2 .comment-avatar .avatar {
    border-color: var(--primary-light);
    transform: scale(0.9);
}

/* 评论内容区域 */
.comment-content {
    flex: 1;
    min-width: 0;
}

/* 评论头部 */
.comment-header {
    margin-bottom: 8px;
}

.comment-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3px;
    gap: 10px;
}

.comment-author {
    font-weight: 600;
    color: var(--text-color);
    font-size: 14px;
    flex-shrink: 0;
}

.comment-time {
    font-size: 11px;
    color: var(--text-lighter);
    margin-right: auto;
    flex-shrink: 0;
}

.comment-reply {
    flex-shrink: 0;
}

/* 移动端评论头部优化 - 保持同一行 */
@media (max-width: 768px) {
    .comment-header-top {
        gap: 8px;
    }
    
    .comment-author {
        flex-shrink: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .comment-time {
        font-size: 10px;
        margin-right: auto;
    }
    
    .comment-reply a {
        font-size: 11px;
        padding: 2px 5px;
    }
}

/* 评论主体 */
.comment-body {
    margin-bottom: 8px;
    line-height: 1.5;
}

.comment-body p {
    margin: 0;
    word-wrap: break-word;
    font-size: 14px;
}

/* 回复按钮样式 */
.comment-reply a {
    font-size: 12px;
    color: var(--primary-color);
    text-decoration: none;
    padding: 3px 6px;
    border-radius: 3px;
    transition: all 0.2s ease;
    background: var(--primary-light);
    border: 1px solid var(--primary-light);
}

.comment-reply a:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* 主评论回复按钮特殊样式 */
.comment-level-1 .comment-reply a {
    background: transparent;
    border: 1px solid var(--border-color);
}

.comment-level-1 .comment-reply a:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* 评论框 */
.comment-box {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    position: relative;
}

/* 头像样式 */
.comment-box .avatar.avatar-42.photo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--border-color);
}

/* 子评论头像略小 */
.comments-list ol.children .comment-box .avatar.avatar-42.photo {
    width: 42px;
    height: 42px;
}

/* 右侧内容区 */
.right-box {
    flex: 1;
    min-width: 0;
}

/* 主评论右侧内容有左边距 */
.comments-list.show-avatars > li > .comment-box > .right-box {
    padding-left: 5px;
}

/* 子评论右侧内容 */
.comments-list.show-avatars ol.children .comment-box > .right-box {
    padding-left: 12px;
}

/* 子评论整体视觉差异 */
.comments-list ol.children .comment-box {
    background: rgba(255, 255, 255, 0.5);
    padding: 10px;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary-light);
}

body.dark-mode .comments-list ol.children .comment-box {
    background: rgba(31, 41, 55, 0.3);
}

/* 子评论头像特殊样式 */
.comments-list ol.children .comment-box .avatar.avatar-42.photo {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 2px var(--primary-light);
}

/* 子评论回复按钮样式 */
.comments-list ol.children .comment-meta .reply a {
    background: var(--primary-light);
    color: var(--primary-color);
    font-size: 12px;
}

.comments-list ol.children .comment-meta .reply a:hover {
    background: var(--primary-color);
    color: #fff;
}

/* 子评论时间信息 */
.comments-list ol.children .time {
    font-size: 11px;
    color: var(--text-lighter);
}

/* 评论元信息（作者、回复） */
.right-box .comment-meta {
    margin: 0 0 8px 0;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.right-box .comment-meta .author {
    font-weight: 600;
    color: var(--text-color);
}

.right-box .comment-meta .reply a {
    color: var(--text-lighter);
    text-decoration: none;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition);
    padding: 4px 8px;
    border-radius: 4px;
}

.right-box .comment-meta .reply a:hover {
    color: var(--primary-color);
    background: var(--primary-light);
}

/* 评论内容 */
.right-box p:not(.comment-meta):not(.time) {
    margin: 0 0 8px 0;
    line-height: 1.7;
    color: var(--text-color);
    font-size: 14px;
    word-wrap: break-word;
    word-break: break-all;
}

/* 时间信息 */
.right-box .time {
    margin: 0;
    font-size: 12px;
    color: var(--text-lighter);
}

/* 评论项 hover 效果 */
.comments-list li.comment:hover .comment-box .avatar.avatar-42.photo {
    border-color: var(--primary-color);
    transform: scale(1.05);
    transition: var(--transition);
}

/* 子评论 hover 效果 */
.comments-list ol.children li:hover {
    background: var(--bg-secondary);
    margin-left: -5px;
    padding-left: 10px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.right-box .time time {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* 评论头部标题栏 */
.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
}

.panel-header .log_h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-header .right {
    font-size: 14px;
    color: var(--text-lighter);
}

.panel-header .comments-number {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 16px;
}

/* 主评论和子评论的视觉区分 */
.comments-list > li > .comment-box {
    padding: 1px 0;
}

/* 子评论容器背景 */
.comments-list ol.children {
    background: rgba(249, 250, 251, 0.5);
    border-radius: var(--radius-sm);
    padding: 5px;
}

/* 子评论项之间的间距 */
.comments-list ol.children li {
    margin-bottom: 15px;
}

.comments-list ol.children li:last-child {
    margin-bottom: 0;
}

/* 子评论不需要顶部边框 */
.comments-list ol.children li {
    border-top: none;
    padding-top: 0;
}

/* 评论分页 */
.comments-list-nav {
    margin-top: 30px;
    text-align: center;
}

.empty-comments {
    text-align: center;
    padding: 50px;
    color: var(--text-light);
    font-size: 16px;
}

.comment-form-wrapper {
    background: var(--bg-secondary);
    padding: 30px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.comment-form-wrapper h4 {
    margin-bottom: 20px;
    color: var(--text-color);
    font-size: 18px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-color);
    transition: var(--transition);
    font-size: 15px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

.captcha {
    margin-left: 10px;
    vertical-align: middle;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.captcha:hover {
    transform: scale(1.05);
}

.submit-btn {
    padding: 14px 40px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.5px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}
/* ==================== 分页 ==================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 50px auto 30px;
    flex-wrap: wrap;
    max-width: 100%;
}

.pagination a,
.pagination span {
    padding: 12px 18px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-card);
    color: var(--text-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    position: relative;
    overflow: hidden;
    will-change: transform;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.pagination a:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-dark));
    border-color: var(--primary-color);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.pagination .active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-dark));
    border-color: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.25);
    font-weight: 700;
}

.pagination a:hover::before,
.pagination .active::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.pagination .prev,
.pagination .next {
    padding: 12px 20px;
    font-weight: 600;
    background: var(--bg-secondary);
    border-color: var(--border-color-light);
}

.pagination .prev:hover,
.pagination .next:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.pagination .dots {
    background: transparent;
    border-color: transparent;
    color: var(--text-muted);
    cursor: default;
    box-shadow: none;
}

.pagination .dots:hover {
    transform: none;
    background: transparent;
    border-color: transparent;
    color: var(--text-muted);
}

.pagination .screen-reader-text {
    display: none;
}

/* 响应式分页 */
@media (max-width: 768px) {
    .pagination {
        gap: 6px;
        margin: 30px auto 20px;
    }
    
    .pagination a,
    .pagination span {
        padding: 10px 14px;
        min-width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
    
    .pagination .prev,
    .pagination .next {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .pagination {
        gap: 4px;
    }
    
    .pagination a,
    .pagination span {
        padding: 8px 12px;
        min-width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }
}

.nav-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* EMlog 分页样式 */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 50px auto 30px;
    flex-wrap: wrap;
    max-width: 100%;
}

.pagination-wrapper a,
.pagination-wrapper span {
    padding: 12px 18px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-card);
    color: var(--text-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    position: relative;
    overflow: hidden;
    will-change: transform;
    box-shadow: 0 2px 8px rgba(247, 247, 247, 0.05);
}

.pagination-wrapper a:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-dark));
    border-color: var(--primary-color);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.pagination-wrapper span {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-dark));
    border-color: var(--primary-color);
    color: #374151;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.25);
    font-weight: 700;
}

.pagination-wrapper a:hover::before,
.pagination-wrapper span::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 1.5s infinite;
}

/* 响应式分页 */
@media (max-width: 768px) {
    .pagination-wrapper {
        gap: 6px;
        margin: 30px auto 20px;
    }
    
    .pagination-wrapper a,
    .pagination-wrapper span {
        padding: 10px 14px;
        min-width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .pagination-wrapper {
        gap: 4px;
    }
    
    .pagination-wrapper a,
    .pagination-wrapper span {
        padding: 8px 12px;
        min-width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }
}

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-light);
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.empty-state i {
    font-size: 72px;
    margin-bottom: 25px;
    opacity: 0.4;
    color: var(--text-lighter);
}

.empty-state p {
    font-size: 18px;
    margin-bottom: 25px;
}

.btn {
    padding: 12px 15px;
    border-radius: 30px;
    font-weight: 600;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

/* ==================== 站点底部 ==================== */
.site-footer {
    background: var(--bg-card);
    padding: 30px 0;
    margin-top: 40px;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.copyright {
    color: var(--text-lighter);
    font-size: 13px;
    line-height: 1.8;
}

.copyright a {
    color: var(--text-lighter);
}

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

/* ==================== 404页面 ==================== */
.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-secondary);
}

.error-content {
    text-align: center;
}

.error-code {
    font-size: 120px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 30px;
}

.error-message {
    font-size: 36px;
    color: var(--text-color);
    margin-bottom: 15px;
    font-weight: 700;
}

.error-description {
    color: var(--text-light);
    margin-bottom: 40px;
    font-size: 18px;
}

.error-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ==================== 显示控制类 ==================== */
.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}

.d-flex {
    display: flex !important;
}

/* 大屏幕显示控制 */
@media (min-width: 992px) {
    .d-lg-block {
        display: block !important;
    }

    .d-lg-flex {
        display: flex !important;
    }

    .d-lg-none {
        display: none !important;
    }

    /* 桌面端显示搜索框 */
    .search-box-wrapper.d-lg-flex {
        display: flex !important;
    }
}

/* 中等屏幕显示控制（平板） */
@media (min-width: 768px) and (max-width: 991.98px) {
    .d-md-none {
        display: none !important;
    }
}

/* 小屏幕显示控制（手机） */
@media (max-width: 767.98px) {
    .d-md-none {
        display: none !important;
    }
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 992px) {
    .posts-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 25px;
    }

    .col-lg-8,
    .col-lg-4,
    .col-lg-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .d-lg-flex {
        display: block !important;
    }

    .d-lg-none {
        display: block !important;
    }
}

/* 平板端响应式 */
@media (max-width: 992px) {
    /* 平板端轮播图优化 */
    .media-2x1 {
        aspect-ratio: 18/7;
        max-height: 280px;
    }

    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-wrap: nowrap;
        gap: 10px;
        padding: 0;
        justify-content: flex-start;
    }

    .navbar-header {
        flex: 0 0 auto;
        margin-right: auto;
    }

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

    .top-nav {
        display: none;
    }

    .navbar-brand {
        font-size: 18px;
    }

    .main-content {
        flex-direction: column;
        gap: 30px;
    }

    .sidebar {
        width: 100%;
    }

    .posts-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .post-card {
        display: flex;
        flex-direction: column;
    }

    .post-cover {
        aspect-ratio: 16/10;
    }

    .article-detail {
        padding: 30px 20px;
    }

    .article-detail .article-title {
        font-size: 28px;
    }

    .article-navigation {
        flex-direction: column;
    }

    .nav-next {
        text-align: left;
    }

    .error-code {
        font-size: 80px;
    }

    .error-message {
        font-size: 28px;
    }

    .error-actions {
        flex-direction: column;
        align-items: center;
    }

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

    /* 轮播图响应式 */
    
    /* 手机端轮播图优化 */
    .index-slide {
        height: auto;
    }

    .media-2x1 {
        aspect-ratio: 16/9;
        max-height: 220px;
    }

    .media-content {
        background-size: cover;
        background-position: center;
    }
    
    .media-overlay {
        padding: 10px;
    }
    
    .overlay-bottom .h5 {
        font-size: 14px;
        line-height: 1.3;
    }
    
    .swiper-pagination {
        bottom: 8px;
    }
    
    .swiper-pagination-bullet {
        width: 8px;
        height: 8px;
    }

    /* 移动端搜索框样式 */
    .mobile-search {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 1001;
        max-width: none;
        margin: 10px 0 0 0;
        background: var(--bg-card);
        padding: 10px;
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-lg);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.3s ease;
    }

    .mobile-search.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    /* 卡片网格移动端 - 2列 */
    .posts-grid-lh {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .post-card-thumb {
        aspect-ratio: 1/1;
    }

    .post-card-info {
        padding: 10px;
    }

    .post-card-title {
        font-size: 13px;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    /* 顶部导航在移动端隐藏搜索框 */
    .nav-search-wrapper {
        order: 4;
        width: 100%;
    }

    /* 主布局移动端 */
    .main-layout {
        flex-direction: column;
    }

    .sidebar-right {
        display: none !important;
    }

    .topic-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .topic-title {
        font-size: 13px;
    }
}

@media (max-width: 576px) {
    body {
        font-size: 15px;
    }

    .container {
        padding: 0 8px;
    }

    .col-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .col-md-2,
    .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .site-logo {
        font-size: 20px;
    }

    .nav-item {
        padding: 8px 16px;
        font-size: 14px;
    }

    .post-title {
        font-size: 20px;
    }

    .article-detail {
        padding: 25px 15px;
    }

    .comment-avatar img {
        width: 48px;
        height: 48px;
    }
    .site-footer {
        padding: 40px 0;
    }

    /* 栏目推荐响应式 */
    .index-sudoku .col-4.col-md-2.col-lg-4 {
        flex: 0 0 33.333%;
        max-width: 33.333%;
    }

    /* 烈火风格响应式 */
    .index-sudoku-lh {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
        padding: 15px 0;
    }

    .category-link {
        padding: 15px 10px;
        max-width: 100%;
    }

    .category-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .category-name {
        font-size: 12px;
    }

    .post-item-lh {
        flex-direction: column;
        padding: 15px;
    }

    .post-thumb {
        width: 100%;
    }

    .post-thumb a {
        border-radius: var(--radius-md);
    }

    .thumb-image {
        width: 100%;
        height: 180px;
    }

    .post-info {
        min-height: auto;
        margin-top: 15px;
    }

    .post-title {
        font-size: 16px;
    }

    .post-meta {
        font-size: 12px;
        gap: 15px;
    }

    .post-desc {
        font-size: 13px;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    /* 卡片网格响应式 */
    .posts-grid-lh {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

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

/* ==================== 隐藏/显示工具类 ==================== */
.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}

.d-md-block {
    display: none !important;
}

.d-md-none {
    display: block !important;
}

@media (min-width: 768px) {
    .d-md-block {
        display: block !important;
    }

    .d-md-none {
        display: none !important;
    }
}

/* ==================== 背景颜色工具类 ==================== */
.bg-white {
    background: var(--bg-card) !important;
}

/* ==================== 滚动条样式 ==================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--text-lighter);
    border-radius: 10px;
    border: 3px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* ==================== 动画效果 ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-card {
    animation: fadeInUp 0.6s ease;
}

.post-card:nth-child(1) {
    animation-delay: 0.1s;
}

.post-card:nth-child(2) {
    animation-delay: 0.2s;
}

.post-card:nth-child(3) {
    animation-delay: 0.3s;
}

.post-card:nth-child(4) {
    animation-delay: 0.4s;
}

.post-card:nth-child(5) {
    animation-delay: 0.5s;
}

.post-card:nth-child(6) {
    animation-delay: 0.6s;
}

/* ==================== 文章阅读页面布局 ==================== */
.article-layout {
    background: var(--bg-body);
    min-height: 100vh;
    padding: 30px 0;
}

.article-layout .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.article-layout .row {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    flex-direction: row; /* 确保默认是水平排列 */
}

.article-sidebar {
    flex: 0 0 280px;
    max-width: 280px;
    position: sticky;
    top: 100px;
    height: fit-content;
    order: 2; /* 侧边栏放在右侧 */
}

.article-main {
    flex: 1;
    min-width: 0;
    order: 1; /* 文章内容放在左侧 */
}

/* 侧边栏样式适配 */
.article-sidebar {
    display: block !important; /* 强制显示 */
    visibility: visible !important;
    opacity: 1 !important;
}

.article-sidebar .column-small {
    width: 100%;
    margin-bottom: 0;
    display: block !important;
}

.article-sidebar .side-bar {
    display: flex !important;
    flex-direction: column;
    gap: 20px;
    visibility: visible !important;
    opacity: 1 !important;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .article-layout {
        padding: 20px 0;
    }
    
    .article-layout .container {
        padding: 0 15px;
    }
    
    .article-layout .row {
        flex-direction: column-reverse;
        gap: 20px;
    }
    
    .article-sidebar {
        flex: 0 0 100%;
        max-width: 100%;
        position: static;
        display: none !important;
    }
    
    .article-main {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* 文章内容区域优化 */
.article-detail {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 30px;
}

/* 文章头部样式优化 */
.article-title {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 15px;
    color: var(--text-color);
    padding: 10px 10px 0;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 0 30px 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0;
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.article-meta i {
    font-size: 0.8rem;
}

/* 文章封面优化 */
.article-cover {
    margin: 0;
    padding: 0;
}

.article-cover img {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
}

/* 文章内容优化 */
.article-content {
    padding: 10px;
    line-height: 1.8;
    font-size: 1.1rem;
    color: var(--text-color);
}

/* 文章标签优化 */
.article-tags {
    padding: 25px 30px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.article-tags i {
    font-size: 18px;
    color: var(--primary-color);
    margin-right: 5px;
}

.article-tags a {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    background: linear-gradient(135deg, var(--primary-light) 0%, rgba(244, 114, 182, 0.1) 100%);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    border: 1px solid rgba(244, 114, 182, 0.2);
    position: relative;
    overflow: hidden;
}

.article-tags a:hover {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
    border-color: transparent;
}

.article-tags a::before {
    content: '#';
    margin-right: 4px;
    font-weight: 700;
    opacity: 0.7;
}

.article-tags a:hover::before {
    opacity: 1;
}

/* 深色模式适配 */
body.dark-mode .article-tags a {
    background: linear-gradient(135deg, rgba(244, 114, 182, 0.15) 0%, rgba(236, 72, 153, 0.1) 100%);
    border-color: rgba(244, 114, 182, 0.3);
}

body.dark-mode .article-tags a:hover {
    border-color: transparent;
}

/* ==================== 文章导航 - 优化版 ==================== */
.article-navigation {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 20px;
    padding: 0;
    position: relative;
}

.nav-prev,
.nav-next {
    flex: 0 0 calc(50% - 10px);
    min-width: 0;
    position: relative;
}

.nav-prev a,
.nav-next a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 25px 30px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    font-size: 16px;
    line-height: 1.4;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    min-height: 110px;
    backdrop-filter: blur(10px);
}

/* 导航卡片背景渐变效果 */
.nav-prev a::before,
.nav-next a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(244, 114, 182, 0.1), 
        transparent);
    transition: left 0.8s ease;
    z-index: 0;
}

.nav-prev a:hover::before,
.nav-next a:hover::before {
    left: 100%;
}

.nav-prev a:hover,
.nav-next a:hover {
    background: var(--bg-card);
    border-color: var(--primary-color);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 40px rgba(244, 114, 182, 0.15);
    color: var(--text-color);
}

/* 图标样式 */
.nav-prev .fas,
.nav-next .fas {
    font-size: 20px;
    color: var(--primary-color);
    transition: all 0.3s ease;
    flex-shrink: 0;
    z-index: 1;
    position: relative;
}

.nav-prev a:hover .fas {
    transform: translateX(-3px) scale(1.1);
    color: var(--primary-color);
}

.nav-next a:hover .fas {
    transform: translateX(3px) scale(1.1);
    color: var(--primary-color);
}

/* 导航标题文字 - 限制两行显示 */
.nav-prev a span,
.nav-next a span {
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
    z-index: 1;
    position: relative;
    word-break: break-word;
    hyphens: auto;
    line-height: 1.4;
}

/* 上一篇：图标在左侧 */
.nav-prev a {
    text-align: left;
    padding-right: 35px;
}

.nav-prev .fas {
    order: 1;
}

.nav-prev span {
    order: 2;
}

/* 下一篇：图标在右侧 */
.nav-next a {
    text-align: right;
    padding-left: 35px;
    flex-direction: row-reverse;
}

.nav-next .fas {
    order: 2;
}

.nav-next span {
    order: 1;
}

/* 无文章时的样式 */
.nav-prev.meta-nav:not(:has(a)),
.nav-next.meta-nav:not(:has(a)) {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 25px 30px;
    background: var(--bg-secondary);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-lighter);
    font-weight: 500;
    font-size: 15px;
    cursor: not-allowed;
    min-height: 110px;
    box-shadow: var(--shadow-sm);
}

.nav-prev.meta-nav:not(:has(a)) .fas,
.nav-next.meta-nav:not(:has(a)) .fas {
    color: var(--text-lighter);
    font-size: 18px;
}

/* 导航卡片装饰效果 */
.nav-prev a::after,
.nav-next a::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(244, 114, 182, 0.03) 0%, 
        rgba(236, 72, 153, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
    z-index: 0;
}

.nav-prev a:hover::after,
.nav-next a:hover::after {
    opacity: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .article-navigation {
        flex-direction: row;
        gap: 12px;
        align-items: stretch;
        max-width: 100%;
        padding: 0 20px;
        margin: 30px 0;
    }
    
    .nav-prev,
.nav-next {
        max-width: 50%;
        flex: 1;
    }
    
    .nav-prev a,
.nav-next a {
        padding: 16px 12px;
        height: 60px;
        font-size: 14px;
        border-radius: var(--radius-md);
        background: linear-gradient(145deg, #f8fafc 0%, #f1f5f9 100%);
        border: 1px solid #e2e8f0;
        font-weight: 500;
        gap: 6px;
        min-width: 0;
        /* 文字单行显示，超出省略 */
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }
    
    .nav-prev a .fas,
.nav-next a .fas {
        font-size: 12px;
        font-weight: 600;
        flex-shrink: 0;
        margin: 0;
    }
    
    /* 导航标题文字 - 限制单行显示 */
    .nav-prev a span,
    .nav-next a span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: block;
        flex: 1;
        min-width: 0;
        max-width: calc(100% - 20px);
        text-align: center;
    }
    
    /* 上一篇：图标在左侧 */
    .nav-prev a {
        flex-direction: row;
    }
    
    .nav-prev a .fas {
        order: 1;
        margin-right: 6px;
    }
    
    .nav-prev a span {
        order: 2;
    }
    
    /* 下一篇：图标在右侧 */
    .nav-next a {
        flex-direction: row-reverse;
    }
    
    .nav-next a .fas {
        order: 2;
        margin-left: 6px;
    }
    
    .nav-next a span {
        order: 1;
    }
    
    .nav-prev a:hover,
.nav-next a:hover {
        background: linear-gradient(145deg, var(--primary-color) 0%, var(--primary-dark) 100%);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(244, 114, 182, 0.25);
    }
    
    .nav-prev.meta-nav:not(:has(a)),
.nav-next.meta-nav:not(:has(a)) {
        padding: 16px 12px;
        height: 60px;
        font-size: 13px;
        border: 2px dashed #cbd5e1;
        color: #94a3b8;
        font-style: italic;
        font-weight: 400;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }
    
    .nav-prev.meta-nav:not(:has(a)) span,
    .nav-next.meta-nav:not(:has(a)) span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        display: block;
        max-width: 100%;
        flex: 1;
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .article-navigation {
        flex-direction: column;
        gap: 8px;
        max-width: 100%;
        padding: 0 15px;
        margin: 25px 0;
    }
    
    .nav-prev,
.nav-next {
        max-width: 100%;
        width: 100%;
    }
    
    .nav-prev a,
.nav-next a {
        height: 56px;
        font-size: 13px;
        padding: 14px 16px;
        border-radius: var(--radius-md);
        gap: 4px;
    }
    
    .nav-prev a .fas,
.nav-next a .fas {
        font-size: 11px;
    }
    
    .nav-prev a,
    .nav-next a {
        /* 强制文字单行显示，超出省略 */
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .nav-prev a span,
    .nav-next a span {
        max-width: calc(100% - 18px);
        /* 限制字数，10个字符 */
        max-width: 10em;
    }
    
    .nav-prev.meta-nav:not(:has(a)),
.nav-next.meta-nav:not(:has(a)) {
        height: 56px;
        padding: 14px 16px;
        font-size: 12px;
        gap: 4px;
    }
}

/* 超小屏幕优化 */
@media (max-width: 360px) {
    .article-navigation {
        gap: 6px;
        padding: 0 12px;
        margin: 20px 0;
    }
    
    .nav-prev a,
.nav-next a {
        height: 52px;
        font-size: 12px;
        padding: 12px 14px;
        gap: 4px;
    }
    
    .nav-prev a .fas,
.nav-next a .fas {
        font-size: 10px;
    }
    
    .nav-prev a,
    .nav-next a {
        /* 强制文字单行显示，超出省略 */
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .nav-prev a span,
    .nav-next a span {
        max-width: calc(100% - 16px);
        /* 限制字数，10个字符 */
        max-width: 10em;
    }
}

.nav-prev a:hover,
.nav-next a:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

/* 评论区优化 */
.comments-section {
    border-top: 1px solid var(--border-color);
    padding-top: 30px;
}

.comments-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-color);
}

.comment-form-wrapper {
    margin-top: 30px;
}

.comment-form-wrapper h4 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text-color);
}

/* ==================== 文章目录链接悬停动画 ==================== */
.table-of-contents .toc-link {
    position: relative;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border-radius: 6px;
    overflow: hidden;
}

.table-of-contents .toc-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(244, 114, 182, 0.1), 
        transparent);
    transition: left 0.6s ease;
    z-index: 0;
}

.table-of-contents .toc-link:hover {
    background: linear-gradient(135deg, rgba(244, 114, 182, 0.05) 0%, rgba(236, 72, 153, 0.08) 100%);
    color: var(--primary-color) !important;
    transform: translateX(8px);
    box-shadow: 0 4px 16px rgba(244, 114, 182, 0.15);
    border-left: 3px solid var(--primary-color);
    padding-left: 15px !important;
    margin-left: -3px;
}

.table-of-contents .toc-link:hover::before {
    left: 100%;
}

.table-of-contents .toc-link.active {
    background: linear-gradient(135deg, var(--primary-light) 0%, rgba(244, 114, 182, 0.2) 100%);
    color: var(--primary-color) !important;
    border-left: 3px solid var(--primary-color);
    padding-left: 15px !important;
    margin-left: -3px;
    font-weight: 700;
    box-shadow: 0 3px 12px rgba(244, 114, 182, 0.2);
}

/* 目录容器整体优化 */
.table-of-contents {
    border: 2px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.table-of-contents:hover {
    border-color: var(--primary-light);
    box-shadow: 0 8px 32px rgba(244, 114, 182, 0.1);
}

/* 目录标题样式 */
.toc-title {
    position: relative;
    padding-left: 20px;
    color: var(--primary-color);
}

.toc-title::before {
    content: '📖';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(-50%);
    }
    40% {
        transform: translateY(-55%);
    }
    60% {
        transform: translateY(-45%);
    }
}

/* ==================== 简化版文章卡片样式 ==================== */
.post-card-simple {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
    height: 100%;
    will-change: transform;
}

.post-card-simple:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    border-color: #3b82f6;
}

.post-card-simple .post-card-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.3s ease;
}

.post-card-simple:hover .post-card-thumb {
    transform: scale(1.03);
}

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

.post-card-simple .post-card-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 10px 0;
    color: #ffffff;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    box-orient: vertical;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.post-card-simple .post-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #f3f4f6;
    margin-top: 4px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.post-card-simple .post-excerpt {
    font-size: 13px;
    line-height: 1.5;
    color: #6b7280;
    margin: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    line-clamp: 3;
    box-orient: vertical;
}

/* 页面标题样式 */
.page-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 6px;
}

.page-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
    background: #f9fafb;
    border-radius: 8px;
    margin: 20px 0;
}

.empty-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
}

.empty-subtitle {
    font-size: 14px;
    margin: 0;
}

/* 分页样式 */
.pagination-wrapper {
    text-align: center;
    padding: 20px 0;
}

/* 分类和搜索页面布局优化 */
.site-main.simple-layout {
    min-height: auto;
    background: #f8fafc;
    padding: 20px 0;
}

.site-main.simple-layout .container {
    padding: 0 8px;
}

.site-main.simple-layout .main-layout {
    flex-direction: column;
    gap: 0;
}

.site-main.simple-layout .main-content-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* 4列正方形卡片网格布局 */
.posts-grid-simple {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    padding: 20px 0;
}

/* 平板端 - 3列 */
@media (max-width: 1024px) {
    .posts-grid-simple {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

/* 手机端 - 2列 */
@media (max-width: 768px) {
    .posts-grid-simple {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 15px 0;
    }
}

/* 小屏手机端 - 2列，但卡片更宽松 */
@media (max-width: 480px) {
    .posts-grid-simple {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 12px 0;
    }
}

/* 正方形卡片优化 */
.post-card-simple.square {
    aspect-ratio: 1/1;
    display: flex;
    flex-direction: column;
}

.post-card-simple.square .post-card-thumb {
    aspect-ratio: 1/1;
    flex-shrink: 0;
}

.post-card-simple.square .post-card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 0;
}

.post-card-simple.square .post-card-title {
    font-size: 14px;
    line-height: 1.3;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.post-card-simple.square .post-card-meta {
    font-size: 10px;
    margin-top: auto;
    color: #ffffff;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .post-card-simple .post-card-info {
        padding: 10px;
    }

    .post-card-simple .post-card-title {
        font-size: 13px;
        line-height: 1.4;
    }

    .post-card-simple .post-card-meta {
        font-size: 11px;
    }

    .post-card-simple.square .post-card-title {
        font-size: 12px;
        line-height: 1.3;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }

    .post-card-simple.square .post-card-meta {
        font-size: 10px;
    }
    }
    
    .page-title {
        font-size: 20px;
    }
    
    .page-header {
        margin-bottom: 20px;
        padding: 15px 0;
    }
    
    .site-main.simple-layout {
        padding: 15px 0;
    }
    
    .site-main.simple-layout .container {
        padding: 0 10px;
    }
}