/* CSS变量定义 */
:root {
    --primary-color: #1890ff;
    --text-color: #333;
    --primary-rgb: 24, 144, 255;
}

/* 卡片组件 */
.bbs-card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    margin-bottom: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.bbs-card-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}


.bbs-card-body {
    padding: 20px;
}


/* 论坛通用样式 */
.forum-overview, .latest-posts, .forum-intro, 
.top-posts, .posts-list, .plate-info-bbs-card {
    width: 650px;
}

/* 板块网格布局 */
.plate-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 明确指定一行两个 */
    gap: 15px;
}

/* 修改板块项目的悬停效果 */
.plate-item {
    display: flex;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-color);
    border: 1px solid #eee;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.plate-item:hover {
    background-color: #f0f0f0;
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}


.plate-icon {
    width: 50px;
    height: 50px;
    margin-right: 15px;
    flex-shrink: 0;
}

.plate-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.plate-info {
    flex: 1;
}

.plate-name {
    margin: 0 0 5px;
    font-size: 0.9rem;
    font-weight: 600;
}

.plate-desc {
    font-size: 0.75rem;
    color: #777;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;         /* 限制显示最多两行 */
    -webkit-box-orient: vertical;   /* 设置文本方向为垂直 */
    overflow: hidden;               /* 隐藏超出部分 */
    text-overflow: ellipsis;        /* 使用省略号表示截断内容 */
    word-break: break-word;         /* 允许在任意字符间断行 */
    line-height: 1.4;               /* 设置行高以便更好地控制显示效果 */
    max-height: 2.8em;              /* 最大高度约为两行文本高度（1.4 × 2） */
}


/* 帖子列表样式 - 修改为水平布局 */
.post-list {
    display: flex;
    flex-direction: column;
}

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

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

.post-item:hover {
    background-color: #f7f9fc;
}

.post-item.top-post {
    background-color: rgba(var(--primary-rgb), 0.05);
}

/* 帖子缩略图 - 调整为固定尺寸左侧显示 */
.post-thumbnail {
    width: 160px;
    margin-right: 15px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0; /* 防止缩略图被压缩 */
    position: relative; /* 为绝对定位的图片建立参考 */
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 确保图片覆盖整个容器区域 */
    position: absolute; /* 使图片完全填充容器 */
    top: 0;
    left: 0;
}

/* 帖子右侧内容布局 */
.post-right-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 用户信息调整为水平布局 */
.post-user-info {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    overflow: hidden; /* 防止子元素溢出 */
}

.post-user-avatar {
    flex-shrink: 0; /* 不允许头像缩小 */
    margin-right: 8px;
}

.post-user-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.post-user-name {
    max-width: 120px; /* 根据你的UI情况自定义宽度 */
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
    flex-shrink: 1; /* 允许缩小，但被限制最大宽度 */
    margin-right: 8px;
}

.post-tag,
.user-vip-badge,
.user-level-badge,
.user-title-badge {
    flex-shrink: 0; /* 不允许标签被压缩 */
    margin-right: 4px;
}

/* 修改帖子标题样式，确保截断生效 */
.post-title {
    margin: 0 0 8px;
    font-size: 1.1rem;
    max-width: 100%; /* 添加最大宽度限制 */
    overflow: hidden; /* 确保标题本身也有overflow属性 */
}

/* 帖子标题限制为一行 */
.post-title a {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    width: 100%; /* 添加宽度100% */
    box-sizing: border-box; /* 确保边框和内边距不会导致宽度超出 */
}

/* 确保父容器也有明确的宽度 */
.post-right-content {
    width: 100%;
    overflow: hidden; /* 添加overflow属性 */
}

/* 帖子项布局调整 */
.post-item {
    display: flex;
    flex-wrap: nowrap; /* 防止元素换行 */
}

/* 如果有缩略图，确保右侧内容有足够空间 */
.post-thumbnail {
    flex-shrink: 0; /* 防止缩略图被压缩 */
}

.post-thumbnail + .post-right-content {
    width: calc(100% - 120px); /* 120px是缩略图宽度+间距，根据实际情况调整 */
}

/* 帖子内容预览 */
.post-excerpt {
    margin: 0 0 10px;
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 42px;
}

.post-tag {
    display: inline-block;
    padding: 2px 6px;
    background-color: var(--primary-color);
    color: white;
    font-size: 0.7rem;
    border-radius: 4px;
    margin-right: 5px;
    font-weight: normal;
}

/* 帖子元数据样式 */
.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.8rem;
    color: #777;
    margin-top: auto;
}

.post-meta a {
    color: #777;
    text-decoration: none;
}

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

.post-meta-item {
    display: flex;
    align-items: center;
}

.post-meta-item i {
    margin-right: 3px;
}

/* 板块详情页样式 */
.plate-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.plate-icon {
    width: 60px;
    height: 60px;
    margin-right: 15px;
}

.plate-detail {
    flex: 1;
    margin-right: 5px;
}

.plate-description {
    color: #666;
    font-size: 0.9rem;
}

.plate-announcement {
    margin-top: 15px;
    padding: 10px 15px;
    background-color: #fff8e1;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
    font-size: 0.9rem;
}

.plate-moderators {
    margin-top: 10px;
    font-size: 0.9rem;
}

.moderator-badge {
    display: inline-block;
    padding: 2px 8px;
    background-color: #e6f7ff;
    border: 1px solid #91d5ff;
    color: #1890ff;
    border-radius: 4px;
    margin-right: 5px;
    font-size: 0.8rem;
}

/* 帖子筛选 */
.post-filters {
    display: flex;
    gap: 15px;
}

.filter-link {
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 3px 0;
    position: relative;
}

.filter-link.active, .filter-link:hover {
    color: var(--primary-color);
}

.filter-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

/* 左侧边栏中的板块列表样式 */
.forum-plates-bbs-card .category-header {
    display: flex;
    align-items: center;
}

.forum-plates-bbs-card .category-header i {
    margin-right: 5px;
}

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

.forum-plate-item {
    border-bottom: 1px solid #eee;
}

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

.forum-plate-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
}

.forum-plate-link:hover,
.forum-plate-link.active {
    color: var(--primary-color);
}

.forum-plate-icon {
    width: 30px;
    height: 30px;
    margin-right: 8px;
    border-radius: 4px;
}

/* 分页容器 */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 15px;
    margin: 10px;
    background: #f0f7ff;
    color: #3b82f6;
    border-radius: var(--border-radius);
    text-decoration: none;
    transition: var(--transition);
}

.pagination-btn:hover {
      background: #3b82f6;
  color: white;
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
  transform: translateY(-2px);
}

.fa-angle-right {
    margin-left: 5px;  /* 左边距，让箭头与文字有间隔 */
}

.fa-angle-left {
    margin-right: 5px;  /* 右边距，让箭头与文字有间隔 */
}

.pagination-info {
    font-size: 0.9rem;
    color: #666;
}

/* 视图更多按钮 */
.view-more {
    text-align: center;
    margin-top: 20px;
}

/* 板块统计信息样式 */
.plate-stats {
    display: flex;
    align-items: center;
    margin-top: 8px;
    gap: 15px;
}

.plate-heat, .plate-topic-count {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: #666;
}

.heat-icon {
    color: #ff4d4f;
    margin-right: 5px;
    font-size: 1rem;
    animation: pulse 1.5s infinite;
}

.topic-icon {
    color: #1890ff;
    margin-right: 5px;
    font-size: 1rem;
}

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



/* 响应式调整 */
@media (max-width: 768px) {
    /* 通用容器宽度调整 */
    .forum-overview, .latest-posts, .forum-intro, 
    .top-posts, .posts-list, .plate-info-bbs-card {
        width: 100%;
        box-sizing: border-box;
    }
    
    /* 板块网格布局调整 */
    .plate-grid {
        grid-template-columns: 1fr;
    }
    
    /* 帖子元数据间距减小 */
    .post-meta {
        gap: 5px;
    }
    
    /* 移动端帖子列表布局调整 */
    .post-item {
        flex-direction: column;
        padding: 12px 10px;
    }
    
    .post-thumbnail {
        width: 100%;
        height: 160px;
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .post-right-content {
        width: 100%;
    }
    
    .post-thumbnail + .post-right-content {
        width: 100%;
    }
    
    .post-user-info {
        margin-bottom: 5px;
    }
    
    .post-title {
        margin-bottom: 5px;
        font-size: 1rem;
    }
    
    .post-excerpt {
        font-size: 0.85rem;
        -webkit-line-clamp: 3;
        max-height: 60px;
    }
    
    .plate-icon {
        margin-bottom: 10px;
    }
    
    .filter-link {
        padding: 5px;
    }
    
    /* 分页容器在移动端换行显示 */
    .pagination-container {
        flex-direction: row;
        flex-wrap: wrap; /* 允许元素换行 */
        justify-content: center;
        gap: 10px; /* 按钮之间的间距 */
    }
    
    .pagination-info {
        width: 100%; /* 让信息占据整行 */
        text-align: center;
        margin: 5px 0;
        order: -1; /* 让信息显示在最上面 */
    }
    
    .pagination-btn {
        margin: 5px 0; /* 设置上下边距 */
    }
    
    .plate-stats {
        align-items: flex-start;
        gap: 5px;
    }
    
    .plate-heat, .plate-topic-count {
        font-size: 0.85rem;
    }
}

/* 小屏幕手机特殊优化 */
@media (max-width: 480px) {
    .post-thumbnail {
        height: 140px;
    }
    
    .post-excerpt {
        -webkit-line-clamp: 2;
        max-height: 42px;
        margin-bottom: 8px;
    }
    
    .post-meta {
        font-size: 0.75rem;
    }
    
    .post-meta-item i {
        margin-right: 2px;
    }
}

/* 空帖子状态优化样式 */
.empty-posts-container {
    padding: 40px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    background-color: #fafafa;
    border-radius: 8px;
}

.empty-posts-content {
    text-align: center;
    max-width: 500px;
}

.empty-posts-icon {
    font-size: 5rem;
    color: #e0e0e0;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.empty-posts-text h4 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 10px;
    font-weight: 600;
}

.empty-posts-text p {
    font-size: 1rem;
    color: #666;
    margin-bottom: 25px;
    line-height: 1.5;
}

.empty-posts-action {
    margin-top: 15px;
}

.empty-posts-action .btn {
    padding: 10px 25px;
        font-size: 1rem;
        transition: all 0.3s;
        box-shadow: 0 2px 10px rgba(24, 144, 255, 0.2);
        width: auto;
        max-width: 200px;
    }
    
.empty-posts-action .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.3);
}

/* 改善置顶帖子样式 */
.top-post {
    background-color: rgba(var(--primary-rgb), 0.05);
    border-left: 3px solid var(--primary-color);
}

/* 置顶帖子简化样式 */
.top-posts-simple {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.top-post-item {
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
    display: flex;
    align-items: center;
}

.top-post-item .top-post-title {
    font-weight: 500;
    color: #333;
    text-decoration: none;
    flex: 1;
}

.top-post-item .top-post-title:hover {
    color: var(--primary-color, #1890ff);
}

/* 论坛页面轮播图样式 */
.forum-carousel {
    width: 100%;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.forum-carousel .carousel-wrapper {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
}

.forum-carousel .carousel-slides {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.4s ease-in-out;
}

.forum-carousel .carousel-slide {
    min-width: 100%;
    height: 100%;
}

.forum-carousel .carousel-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.forum-carousel .carousel-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.forum-carousel .carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    padding: 15px;
}

.forum-carousel .carousel-controls {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    align-items: center;
}

.forum-carousel .carousel-prev,
.forum-carousel .carousel-next {
    background-color: rgba(255, 255, 255, 0.8);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0 5px;
}

.forum-carousel .carousel-indicators {
    display: flex;
    margin: 0 10px;
}

.forum-carousel .carousel-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    margin: 0 3px;
    cursor: pointer;
}

.forum-carousel .carousel-indicator.active {
    background-color: white;
}

/* 媒体查询适配移动端 */
@media (max-width: 768px) {
    .forum-carousel .carousel-wrapper {
        height: 200px;
    }
}

/* 标签颜色样式 */
.post-tag.essence-tag {
    background-color: #FFCC00; /* 黄色背景 */
    color: white;
}

.post-tag.admin-verify-tag {
    background-color: #9C27B0; /* 紫色背景 */
    color: white;
}

.post-tag.hot-tag {
    background-color: #FF0000; /* 红色背景 */
    color: white;
}

.post-tag.top-tag {
    background-color: #ff6b6b; /* 粉色背景 */
    color: white;
}

.post-tag.new-tag {
    background-color: #4CAF50; /* 绿色背景 */
    color: white;
}

.post-tag.reward-tag {
    background-color: #ff9800; /* 橙色背景 */
    color: white;
}


/* 待审核帖子样式 */
.sh-pending-posts-section {
    margin-bottom: 20px;
}

.sh-pending-posts-section .bbs-card-header {
    background-color: #fff3e0;
}

.shbt {
    font-size: 0.9rem;
    font-weight: 500;
}

.sh-pending-post {
    background-color: #fffaf3;
    border: 1px solid #f0e0c0;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.sh-pending-post:last-child {
    margin-bottom: 0;
}

.sh-pending-badge {
    display: inline-block;
    background-color: #f39c12;
    color: white;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 3px;
    margin-right: 5px;
}

.post-excerpt {
    margin: 10px 0;
    color: #666;
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 42px;
}

/* 待审核评论样式 */
.sh-pending-post .comment-content {
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
}

.sh-pending-post .post-info {
    padding: 5px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 8px !important;
}

.sh-pending-post .post-info a {
    text-decoration: none;
    font-weight: 500;
}

.sh-pending-post .post-info a:hover {
    text-decoration: underline;
}

.sh-pending-post .comment-text {
    margin: 8px 0;
    padding: 8px;
    background: #fff;
    border-radius: 3px;
    border-left: 3px solid #f0ad4e;
}

.sh-pending-post .comment-author {
    font-size: 12px;
    color: #999;
    border-top: 1px solid #eee;
    padding-top: 8px;
}

.sh-pending-badge {
    background: #f0ad4e;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    margin-right: 8px;
}


/* 操作按钮区域样式 - 确保按钮等宽 */
.sh-post-actions {
    display: flex;
    margin-top: 10px;
    gap: 8px;
    width: 100%;
}

.sh-post-actions .btn {
    flex: 1; /* 平均分配空间 */
    text-align: center;
    font-size: 12px;
    padding: 6px 0; /* 上下padding保持，左右设为0 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sh-post-actions .btn i {
    margin-right: 4px;
}

.sh-btn-success {
    background-color: #28a745;
    border-color: #28a745;
    color: white;
}

.sh-btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

.sh-btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

.sh-btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

/* 响应式调整 */
@media (max-width: 576px) {
    .sh-post-actions {
        gap: 5px;
    }
    
    .sh-post-actions .btn {
        font-size: 11px;
        padding: 5px 0;
    }
    
    .sh-post-actions .btn i {
        margin-right: 3px;
    }
}

/* 论坛介绍卡片样式 */
.forum-intro {
    margin-bottom: 25px;
}

.forum-intro .bbs-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.forum-intro .bbs-card:hover {
    transform: translateY(-3px);
}

.forum-intro .bbs-card-header {
    border-bottom: none;
    color: #000;
}

.forum-intro .bbs-card-header h3 {
    color: #000;
    font-weight: 500;
}

.forum-intro .bbs-card-header h3 i {
    color: #000;
    font-size: 20px;
}

.forum-announcement {
    color: #444;
    line-height: 1.6;
}

.forum-announcement p {
    margin-bottom: 15px;
    font-size: 15px;
}

.forum-announcement p:first-child {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    border-left: 3px solid #3b82f6;
    padding-left: 12px;
}

.forum-announcement ul {
    background-color: #f9fafb;
    border-radius: 8px;
    padding: 15px 15px 15px 35px;
    margin: 0;
    border: 1px solid #f0f0f0;
}

.forum-announcement li {
    margin-bottom: 10px;
    position: relative;
    list-style-type: none;
}

.forum-announcement li:last-child {
    margin-bottom: 0;
}

.forum-announcement li:before {
    content: "\f00c";
    font-family: "FontAwesome";
    position: absolute;
    left: -20px;
    color: #3b82f6;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .forum-intro .bbs-card-header h3 {
        font-size: 16px;
    }
    
    .forum-announcement p:first-child {
        font-size: 15px;
    }
    
    .forum-announcement ul {
        padding: 12px 12px 12px 30px;
    }
    
    .forum-announcement li {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .forum-intro .bbs-card-header {
        padding: 12px 15px;
    }
    
    .forum-intro .bbs-card-body {
        padding: 15px;
    }
    
    .forum-announcement p {
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    .forum-announcement ul {
        padding: 10px 10px 10px 28px;
    }
    
    .forum-announcement li {
        font-size: 13px;
        margin-bottom: 8px;
    }
}

/* 移动端适配样式 */
@media (max-width: 768px) {
    .plate-header {
        flex-wrap: wrap; /* 允许元素换行 */
    }
    
    .plate-icon {
        margin-right: 15px;
    }
    
    .plate-detail {
        flex: 1;
        min-width: 0; /* 防止内容溢出 */
    }
    
    .plate-actions {
        width: 100%;
        margin-top: 5px;
        text-align: center;
        order: 3; /* 确保按钮显示在最下方 */
    }
    
    .plate-actions .btn {
        width: 100%;
    }
}
