/* ==================== 全局样式 ==================== */
/* 定义全局颜色变量和基础样式 */
:root {
    --primary-color: #4080ff;
    --success-color: #00b83f;
    --warning-color: #ff9900;
    --danger-color: #ff4d4f;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    background-color: #f6f6f6;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

/* ==================== Bootstrap 5 导航栏自定义样式 ==================== */
.navbar .logo-blog {
    background: #4080ff;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 700;
    margin-right: 6px;
}
.navbar .logo-text {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}
.offcanvas-title .logo-blog {
    background: #4080ff;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 700;
    margin-right: 6px;
}
.offcanvas-title .logo-text {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.search-icon {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ==================== 页面容器样式 ==================== */
/* 用于包裹整个页面内容，设置最大宽度和内边距 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 16px 16px;
}

/* ==================== 主体内容布局样式 ==================== */
/* 用于博客首页主内容区域，包含左侧文章列表和右侧边栏 */
.main-content {
    display: flex;
    gap: 16px;
}
.content-left {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}
.article-list {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-top: 0;
    padding-top: 0;
    margin-bottom: 0;
}
.content-right {
    width: 320px;
    flex-shrink: 0;
    position: sticky;
    top: 80px;
}
.ub-text-blog {
    background: #fff;
    padding: 0;
    margin-bottom: 0;
    border-bottom: 1px dashed #e8e8e8;
    padding-bottom: 24px;
}
.article-header {
    padding: 12px 24px 0;
}
.article-title-row {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
}
.article-labels {
    margin-right: 12px;
}
.label {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.7;
    margin-right: 8px;
}
.label-top {
    background: #e6f7ff;
    color: #1890ff;
}
.label-hot {
    background: #fff2e8;
    color: #ff4d4f;
}
.label-recommend {
    background: #fff7e6;
    color: #fa8c16;
}
.article-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    line-height: 1.7;
}
.article-title:hover {
    color: var(--primary-color);
}
.article-body {
    margin-top: 8px;
    padding: 0 24px;
}
.article-content-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
@media (min-width: 768px) {
    .article-content-wrap {
        flex-direction: row;
    }
    .article-content {
        flex: 1;
        overflow: hidden;
        min-width: 0;
    }
    .article-cover-box {
        width: 160px;
        flex-shrink: 0;
        margin-left: 16px;
        margin-bottom: 0;
    }
}
.article-content {
    flex: 1;
    overflow: hidden;
}
.article-meta {
    color: #999;
    font-size: 12px;
    padding-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.article-meta span {
    margin-right: 4px;
}
.article-summary {
    color: #999;
    font-size: 14px;
    line-height: 1.7;
    height: 56px;
    overflow: hidden;
    padding-top: 8px;
}
.article-tags {
    padding-top: 8px;
}
.article-tag {
    display: inline-block;
    padding: 4px 16px;
    background: #fff;
    color: #666;
    border: 1px solid #d9d9d9;
    border-radius: 16px;
    font-size: 12px;
    margin-right: 6px;
    margin-bottom: 6px;
    line-height: 1.5;
    transition: all 0.2s ease;
    text-decoration: none;
}
.article-tag:hover {
    border-color: #1890ff;
    color: #1890ff;
}
.article-cover-box {
    width: 100%;
    margin-bottom: 8px;
}
.article-cover-link {
    display: block;
    border-radius: 6px;
    overflow: hidden;
}
.article-cover-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
    object-fit: cover;
    transition: transform 0.3s ease, rotate 0.3s ease;
}
.article-cover-link:hover .article-cover-img {
    transform: scale(1.1) rotate(3deg);
}

/* ==================== 侧边栏样式 ==================== */
/* 用于博客首页右侧边栏区域，包含作者信息、分类、标签云、热门博客、友情链接 */
.sidebar-card {
    background: #fff;
    border-radius: 10px;
    margin-bottom: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.sidebar-card:hover {
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}
.sidebar-header {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    background: #fafbfc;
    display: flex;
    align-items: center;
    gap: 8px;
}
.sidebar-header i {
    font-size: 16px;
    margin-right: 4px;
    color: #667eea;
}
.icon-category {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");
}
.icon-tag {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z'/%3E%3Cline x1='7' y1='7' x2='7' y2='7'/%3E%3C/svg%3E");
}
.icon-hot {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff6b6b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 8v4l3 3m6-3a9 9 0 1 1-18 0 9 9 0 0 1 18 0z'/%3E%3C/svg%3E");
}
.icon-link {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71'/%3E%3Cpath d='M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71'/%3E%3C/svg%3E");
}
.icon-arrow {
    width: 8px !important;
    height: 8px !important;
    margin-right: 6px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E");
}
.sidebar-content {
    padding: 12px;
}
.author-card {
    text-align: center;
    padding: 32px 20px 24px;
    position: relative;
    background: linear-gradient(180deg, #f8f9ff 0%, #ffffff 50%);
}
.author-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}
.wechat-profile {
    width: 88px;
    height: 88px;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    margin: 0 auto 14px;
    background-color: #f0f0f0;
    border: 3px solid #fff;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.25);
    transition: transform 0.3s ease;
}
.author-card:hover .wechat-profile {
    transform: scale(1.05);
}
.wechat-name {
    font-size: 17px;
    font-weight: 700;
    color: #333;
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}
.wechat-slogan {
    font-size: 12px;
    color: #888;
    line-height: 1.6;
    margin: 0 10px;
}
.contact-list {
    padding: 4px 0;
}
.contact-item {
    display: flex;
    align-items: center;
    padding: 14px 8px;
    border-bottom: 1px dashed #eee;
    font-size: 13px;
    color: #555;
    transition: background 0.2s ease;
    border-radius: 4px;
}
.contact-item:hover {
    background: #f8f9ff;
}
.contact-item:last-child {
    border-bottom: none;
}
.contact-item > i {
    margin-right: 10px;
    color: #667eea;
    width: 18px;
    text-align: center;
    font-size: 15px;
}
.contact-label {
    color: #999;
    margin-right: 10px;
    min-width: 32px;
}
.contact-value {
    flex: 1;
    color: #333;
    word-break: break-all;
}
.contact-qrcode {
    justify-content: center;
    padding: 12px 0 4px;
}
.contact-qrcode img {
    width: 120px;
    height: auto;
    border-radius: 6px;
}
.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.category-item {
    width: calc(50% - 4px);
    padding: 9px 12px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 20px;
    text-decoration: none;
    color: #666;
    font-size: 13px;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}
.category-item:hover {
    border-color: #d0d0d0;
    background: #fafafa;
}
.category-arrow {
    width: 6px;
    height: 6px;
    border-right: 1px solid #999;
    border-bottom: 1px solid #999;
    transform: rotate(-45deg);
    margin-right: 6px;
    flex-shrink: 0;
}
.category-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.category-count {
    color: #999;
    margin-left: 4px;
    font-size: 12px;
}
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.tag-item {
    padding: 5px 10px;
    background: #f5f5f5;
    color: #666;
    border-radius: 16px;
    font-size: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}
.tag-item:hover {
    background: #eee;
    color: #333;
}
.tag-count {
    min-width: 16px;
    height: 16px;
    background: #ccc;
    color: #fff;
    border-radius: 8px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tag-all {
    margin-left: auto;
    font-size: 12px;
    color: #999;
    text-decoration: none;
    font-weight: normal;
}
.tag-all:hover {
    color: #666;
}
.hot-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.hot-item {
    padding: 8px 0;
}
.hot-link {
    color: #666;
    text-decoration: none;
    font-size: 13px;
    display: flex;
    align-items: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.2s ease;
}
.hot-link:hover {
    color: #4080ff;
}
.hot-arrow {
    width: 6px;
    height: 6px;
    border-right: 1px solid #999;
    border-bottom: 1px solid #999;
    transform: rotate(-45deg);
    margin-right: 8px;
    flex-shrink: 0;
}
.hot-link:hover .hot-arrow {
    border-color: #4080ff;
}
.friend-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.friend-item {
    width: calc(50% - 4px);
    padding: 10px 12px;
    background: #f5f5f5;
    border-radius: 4px;
    text-decoration: none;
    color: #666;
    font-size: 13px;
    text-align: center;
    transition: all 0.2s ease;
}
.friend-item:hover {
    background: #eee;
    color: #333;
}
.empty-tip {
    color: #999;
    font-size: 13px;
    text-align: center;
    width: 100%;
    padding: 10px;
}

/* ==================== 分页样式 ==================== */
/* 用于博客首页文章列表底部的分页导航 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 0;
}
.page-item {
    list-style: none;
    margin: 0 4px;
}
.page-link {
    display: block;
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    color: #666;
    text-decoration: none;
    font-size: 14px;
}
.page-link:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}
.page-item.active .page-link {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}
.footer {
    background: #fff;
    padding: 16px 0;
    margin-top: 16px;
    text-align: center;
    border-top: 1px solid #f0f0f0;
}
.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}
.footer-logo {
    font-size: 14px;
    font-weight: 700;
    color: #4080ff;
}
.footer-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}
.footer-domain {
    font-size: 12px;
    color: #909399;
}
@media (max-width: 480px) {
    .footer-brand {
        flex-direction: column;
        gap: 2px;
    }
}
.footer p {
    color: #999;
    font-size: 12px;
    margin-bottom: 5px;
}
.footer p a {
    color: #999;
    text-decoration: none;
}
.footer p a:hover {
    color: var(--primary-color);
}
.footer-links {
    margin-bottom: 15px;
}
.footer-links a {
    color: #999;
    text-decoration: none;
    font-size: 12px;
    margin: 0 10px;
}
.footer-links a:hover {
    color: var(--primary-color);
}

/* ==================== 页脚样式 ==================== */
/* 用于博客首页底部页脚区域，包含版权信息和友情链接 */

/* ==================== 响应式样式 ==================== */
/* 用于不同屏幕尺寸的布局适配，包括桌面端、平板和移动端 */
@media (min-width: 1024px) {
    .article-body {
        flex-direction: row;
    }
    .article-cover-box {
        width: 160px;
        flex-shrink: 0;
        margin-left: 16px;
        margin-bottom: 0;
    }
    .article-cover {
        height: 106px;
    }
}
@media (max-width: 1023px) {
    .article-body {
        flex-direction: column-reverse;
    }
    .article-content-wrap {
        flex-direction: column;
    }
    .article-content {
        overflow: visible;
        min-width: 0;
    }
    .article-cover-box {
        width: 100%;
        margin-bottom: 8px;
        margin-left: 0;
    }
    .article-cover {
        height: 180px;
    }
    .article-meta,
    .article-tags,
    .article-summary {
        display: block;
    }
}
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    .content-right {
        width: 100%;
        position: static;
    }
}

