/* 瑞希博客网 - 样式表 */

@font-face {
  font-family: "iconfont"; /* Project id 4940085 */
  src: url('//at.alicdn.com/t/c/font_4940085_gdsi7pxiv5.woff2?t=1749023672752') format('woff2'),
       url('//at.alicdn.com/t/c/font_4940085_gdsi7pxiv5.woff?t=1749023672752') format('woff'),
       url('//at.alicdn.com/t/c/font_4940085_gdsi7pxiv5.ttf?t=1749023672752') format('truetype');
}

.iconfont {
  font-family: "iconfont" !important;
  font-size: 16px;
  font-style: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.icon-wode:before {
  content: "\e6d8";
}

.icon-denglu:before {
  content: "\e60d";
}

.icon-zhuce:before {
  content: "\e6b3";
}

.icon-zhuye:before {
  content: "\e606";
}

.icon-fawenzhang:before {
  content: "\e668";
}

/* 公告和管理员博客样式 */
.announcement-badge {
    display: inline-block;
    background-color: #f44336;
    color: white;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 12px;
    margin-right: 8px;
    vertical-align: middle;
}

.admin-badge {
    display: inline-block;
    background-color: #2196F3;
    color: white;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 12px;
    margin-right: 8px;
    vertical-align: middle;
}

.admin-post {
    border: 1px solid #2196F3;
    box-shadow: 0 0 10px rgba(33, 150, 243, 0.2);
}

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "Hiragino Sans GB", "WenQuanYi Micro Hei", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s;
}

a:hover {
    color: #2980b9;
}

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

ul, ol {
    list-style: none;
}

/* 布局容器 */
.container {
    max-width: calc(100% - 20px);
    margin: 0 auto;
    padding: 0 10px;
    display: grid;
    grid-template-areas:
        "main sidebar"
        "footer footer";
    grid-template-columns: 1fr 300px;
    grid-gap: 30px;
    margin-top: 0;
}

/* 头部样式 */
header {
    display: none; /* 隐藏头部区域 */
}

/* 主要内容区域 */
main {
    grid-area: main;
    margin-top: 20px;
}

.featured-posts, .recent-posts {
    background-color: #fff;
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

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

.post-card {
    border: 1px solid #e0e0e0;
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.3s;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* 封面图样式 - 比例2.5:1.5 */
.post-image {
    position: relative;
    width: 100%;
    /* 根据比例2.5:1.5计算高度 */
    padding-bottom: 60%; /* 1.5/2.5 = 0.6 = 60% */
    background-color: #f5f5f5;
    overflow: hidden;
    border-radius: 8px;
}

.post-image img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover; /* 修改为cover确保填充整个容器 */
    transition: transform 0.5s;
}

/* 针对没有封面的默认图片特殊处理 */
.post-image img[src='images/ruihua.png'] {
    object-fit: contain;
    padding: 10px;
}

.post-card:hover .post-image img {
    transform: scale(1.05);
}

.post-content {
    padding: 15px;
}

.post-content h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

.post-meta {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.post-meta span.author {
    display: inline-block;
    padding: 2px 8px;
    background-color: #e8f4fc;
    border: 1px solid #c5e4f9;
    border-radius: 12px;
    color: #3498db;
    box-shadow: 0 1px 2px rgba(52, 152, 219, 0.1);
    transition: all 0.3s ease;
}

.post-meta span.author:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(52, 152, 219, 0.2);
    background-color: #d0e9f9;
}

.post-meta span.author a {
    color: #3498db;
    text-decoration: none;
}

.post-meta span.author a:hover {
    color: #2980b9;
}

/* 阅读全文链接样式 */
.read-more {
    display: inline-block;
    margin-top: 10px;
    padding: 5px 15px;
    background-color: #f5f5f5;
    border-radius: 12px;
    color: #3498db;
    font-size: 14px;
    transition: all 0.3s;
    border: 1px solid #e0e0e0;
}

.read-more:hover {
    background-color: #3498db;
    color: #fff;
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.post-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.post-item {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.post-item-image {
    position: relative;
    width: 100%;
    /* 根据比例2.5:1.5计算高度 */
    padding-bottom: 60%; /* 1.5/2.5 = 0.6 = 60% */
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f5f5f5;
}

.post-item-image img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover; /* 修改为cover确保填充整个容器 */
    transition: transform 0.3s ease;
}

/* 针对没有封面的默认图片特殊处理 */
.post-item-image img[src='images/ruihua.png'],
.post-image img[src='images/ruihua.png'] {
    object-fit: contain;
    padding: 10px;
    background-color: #f5f5f5;
    width: 100%;
    height: 100%;
}

.post-item:hover .post-item-image img {
    transform: scale(1.05);
}

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

.post-item h3 {
    margin-bottom: 10px;
}

.post-item .post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.8rem;
    align-items: center;
}

.post-item .post-meta span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.post-item .post-meta span.author {
    display: inline-block;
    padding: 2px 8px;
    background-color: #e8f4fc;
    border: 1px solid #c5e4f9;
    border-radius: 12px;
    color: #3498db;
    box-shadow: 0 1px 2px rgba(52, 152, 219, 0.1);
    transition: all 0.3s ease;
}

.post-item .post-meta span.author:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(52, 152, 219, 0.2);
    background-color: #d0e9f9;
}

/* 侧边栏样式 */
.sidebar {
    grid-area: sidebar;
    margin-top: 20px;
}

.widget {
    background-color: #fff;
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.widget h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
}

.categories li {
    padding: 8px 0;
    border-bottom: 1px dashed #e0e0e0;
}

.categories li:last-child {
    border-bottom: none;
}

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

.tag {
    display: inline-block;
    padding: 5px 10px;
    background-color: #f0f8ff;
    border-radius: 12px;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.tag:hover {
    background-color: #3498db;
    color: #fff;
}

/* 次级导航 */
.secondary-nav {
    margin: 20px 0;
}

.secondary-nav ul {
    display: flex;
    justify-content: center;
    padding-bottom: 10px;
}

.secondary-nav li {
    margin: 0 15px;
}

.secondary-nav a {
    color: #2c3e50;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 3px;
    transition: all 0.3s;
}

.secondary-nav a:hover, .secondary-nav a.active {
    color: #3498db;
    background-color: #f0f8ff;
}

/* 页脚样式 */
footer {
    grid-area: footer;
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 30px 0 0 0;
    margin-top: 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    grid-gap: 30px;
    padding: 0 15px 30px 15px;
}

.footer-logo h2 {
    color: #ecf0f1;
    border-bottom: none;
    padding-bottom: 0;
}

.footer-links ul {
    margin-top: 15px;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #ecf0f1;
}

.footer-links a:hover {
    color: #3498db;
}

.social-links {
    margin-top: 15px;
}

.social-links a {
    display: inline-block;
    margin-right: 15px;
    color: #ecf0f1;
}

.copyright {
    text-align: center;
    padding: 15px 0;
    background-color: #1a252f;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 14px;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    margin-right: 10px;
}

.btn-primary {
    background-color: #3498db;
    color: #fff;
}

.btn-primary:hover {
    background-color: #2980b9;
    color: #fff;
}

.btn-secondary {
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #e0e0e0;
}

.btn-secondary:hover {
    background-color: #e0e0e0;
}

/* 刷新按钮 */
.refresh-btn {
    float: right;
    padding: 6px 12px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}

.refresh-btn:hover {
    background-color: #2980b9;
}

/* 动作按钮容器 */
.action-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.action-buttons .btn {
    flex: 1;
}

.action-tip {
    font-size: 0.9rem;
    color: #7f8c8d;
    text-align: center;
    margin-top: 10px;
}

/* 空内容提示样式 */
.empty-message {
    padding: 20px;
    text-align: center;
    color: #7f8c8d;
    background-color: #f9f9f9;
    border-radius: 5px;
    margin-bottom: 20px;
}

/* 查看更多按钮区域 */
.view-more {
    text-align: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.view-more .btn {
    padding: 8px 25px;
}

/* 博客摘要标签容器 */
.blog-stats-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.blog-excerpt-numbers {
    display: inline-block;
    padding: 3px 10px;
    background-color: #f0f8ff;
    border: 1px solid #d0e8ff;
    border-radius: 12px;
    font-size: 12px;
    color: #3498db;
    transition: background-color 0.3s;
}

.blog-excerpt-numbers:hover {
    background-color: #d0e8ff;
}

/* 响应式样式 */
@media (max-width: 768px) {
    .container {
        grid-template-areas:
            "header"
            "main"
            "sidebar"
            "footer";
        grid-template-columns: 1fr;
        padding: 0 8px;
        grid-gap: 20px;
    }

    nav ul {
        flex-wrap: wrap;
    }
    
    .post-grid, .post-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .featured-posts, .recent-posts {
        padding: 15px;
        border-radius: 14px;
    }
    
    .widget {
        padding: 15px;
        border-radius: 14px;
    }
    
    .post-image, .post-item-image {
        padding-bottom: 60%; /* 保持2.5:1.5比例 */
    }
    
    .post-image img, .post-item-image img {
        max-height: 200px;
    }
    
    .post-item .post-meta {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 5px;
        font-size: 0.75rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    /* 摘要标签在小屏幕上的样式 */
    .blog-stats-container {
        gap: 6px;
    }
    
    .blog-excerpt-numbers {
        padding: 2px 8px;
        font-size: 11px;
    }
}

/* 极小屏幕适配 */
@media (max-width: 480px) {
    .container {
        padding: 0 6px;
        grid-gap: 15px;
    }
    
    .post-grid, .post-list {
        grid-template-columns: 1fr;
    }
    
    .post-content h3 {
        font-size: 1rem;
    }
    
    .post-meta {
        font-size: 0.8rem;
    }
    
    .blog-excerpt-numbers {
        padding: 2px 6px;
        font-size: 10px;
    }
    
    .read-more {
        padding: 4px 10px;
        font-size: 12px;
    }
    
    .featured-posts, .recent-posts {
        padding: 12px;
    }
    
    .widget {
        padding: 12px;
    }
}

/* 博客统计数字框样式 */
.blog-stats {
    display: inline-block;
    margin-top: 15px;
    padding: 5px 15px;
    background-color: #fff8e5;
    border: 1px solid #ffecb3;
    border-radius: 12px;
    color: #ff9800;
    font-size: 14px;
    font-family: monospace;
}

.post-image img.default-img,
.post-item-image img.default-img {
    object-fit: contain !important;
    padding: 10px;
    max-width: 100%;
    max-height: 100%;
}

/* 热点科技/微博热搜样式 */
.csdn-hot ul, .weibo-hot ul {
    margin: 0;
    padding: 0;
}

.csdn-hot li, .weibo-hot li {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    display: flex;
    align-items: center;
}

.csdn-hot li:last-child, .weibo-hot li:last-child {
    border-bottom: none;
}

.csdn-hot li.loading, .weibo-hot li.loading {
    text-align: center;
    color: #999;
    padding: 15px 0;
}

.csdn-hot .rank-num, .weibo-hot .rank-num {
    display: inline-block;
    width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    background-color: #f1f1f1;
    color: #999;
    border-radius: 4px;
    margin-right: 10px;
    font-size: 12px;
    font-weight: bold;
}

.csdn-hot .rank-num.top-rank {
    background-color: #3498db;
    color: white;
}

.weibo-hot .rank-num.top-rank {
    background-color: #ff3852;
    color: white;
}

.csdn-hot a, .weibo-hot a {
    color: #333;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.csdn-hot .hot-value, .weibo-hot .hot-value {
    font-size: 12px;
    padding-left: 10px;
}

.csdn-hot .hot-value {
    color: #3498db;
}

.weibo-hot .hot-value {
    color: #ff3852;
}

.csdn-hot .hot-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.csdn-hot .hot-author {
    font-size: 11px;
    color: #888;
    margin-bottom: 3px;
    display: none; /* 默认隐藏，在小屏幕显示 */
}

/* 触摸反馈 */
.csdn-hot li.touch-active {
    background-color: #f8f8f8;
}

/* 移动端响应式样式 */
@media (max-width: 768px) {
    .csdn-hot li {
        padding: 12px 0;
    }
    
    .csdn-hot .rank-num {
        width: 20px;
        height: 20px;
        line-height: 20px;
        font-size: 11px;
        margin-right: 8px;
    }
    
    .csdn-hot .hot-author {
        display: block; /* 在小屏幕显示作者 */
    }
    
    .csdn-hot a {
        font-size: 14px;
        line-height: 1.4;
        /* 移动端显示两行标题 */
        white-space: normal;
        display: -webkit-box;
        display: box; /* 标准属性 */
        -webkit-line-clamp: 2;
        line-clamp: 2; /* 标准属性 */
        -webkit-box-orient: vertical;
        box-orient: vertical; /* 标准属性 */
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .csdn-hot .hot-value {
        font-size: 10px;
        min-width: 40px;
        text-align: right;
    }
}

@media (max-width: 480px) {
    .csdn-hot h3 {
        font-size: 16px;
    }
    
    .csdn-hot li {
        padding: 10px 0;
    }
    
    .csdn-hot .rank-num {
        width: 18px;
        height: 18px;
        line-height: 18px;
        font-size: 10px;
        margin-right: 6px;
    }
    
    .csdn-hot a {
        font-size: 13px;
    }
    
    .csdn-hot .hot-value {
        min-width: 30px;
    }
}

/* 旋转动画 */
.fa-spin {
    animation: fa-spin 1s infinite linear;
}

@keyframes fa-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* 确保最新文章标题和按钮在同一行 */
.recent-posts h2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

 