/* 重置 & 全局 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    background: #f5f5f5;
}

body {
    display: flex;
    flex-direction: column;
    font-family: 'Microsoft Yahei', Arial, sans-serif;
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

/* ===== 头部 - 全宽 ===== */
#hd {
    width: 100%;
    height: 65px;
    background: #fff;
    border-bottom: 1px solid #eaeef2;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    position: relative;
    z-index: 10;
}

.hd-inner {
    width: 100%;          /* 改为全宽，不再有最大宽度限制 */
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;      /* 左右内边距保持内容不贴边，但背景已全宽 */
}

.logo a {
    font-size: 22px;
    font-weight: bold;
    color: #2B7ACD;
    text-decoration: none;
}

.nav-menu ul {
    display: flex;
    list-style: none;
    gap: 30px;
}
.nav-menu a {
    color: #444;
    text-decoration: none;
    font-size: 15px;
}
.nav-menu a:hover { color: #2B7ACD; }

.user-bar a {
    margin-left: 15px;
    color: #666;
    text-decoration: none;
}
.user-bar a:hover { color: #2B7ACD; }

/* ===== 主容器 - 全宽 Flex 布局 ===== */
.main-container {
    flex: 1;
    display: flex;
    min-height: 0;          /* 防止溢出 */
    width: 100%;            /* 全宽，不再有 max-width 和自动居中 */
    background: #fff;
}

/* 左侧栏 - 紧贴左边 */
.sidebar-left {
    width: 260px;
    background: #fafafc;
    border-right: 1px solid #eceef2;
    overflow-y: auto;
    padding: 20px 15px;
    flex-shrink: 0;         /* 防止被压缩 */
}

/* 右侧栏 - 紧贴右边 */
.sidebar-right {
    width: 260px;
    background: #fafafc;
    border-left: 1px solid #eceef2;
    overflow-y: auto;
    padding: 20px 15px;
    flex-shrink: 0;
}

/* 中部区域 - 自适应剩余宽度 */
.content-main {
    flex: 1;
    overflow-y: auto;
    background: #fff;
    padding: 20px 25px;
}

/* ===== 底部 ===== */
#ft {
    background: #fff;
    border-top: 1px solid #eceef2;
    text-align: center;
    padding: 15px 20px;
    font-size: 12px;
    color: #999;
}

/* ===== 通用模块样式 (用于左右栏内部) ===== */
.module-box {
    margin-bottom: 25px;
    background: #fff;
    border-radius: 6px;
    padding: 12px 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}
.module-boxleft {
    margin-bottom: 25px;
    background: #fff;
    border-radius: 6px;
    
    
}
.module-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    padding-bottom: 8px;
    margin-bottom: 12px;
    border-bottom: 1px solid #eceef2;
}
.module-content {
    color: #666;
    font-size: 13px;
}

/* 用户信息卡片 */
.user-info .avatar {
    text-align: center;
    margin-bottom: 12px;
}
.user-info .avatar img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
}

/* 论坛版块列表 */
.forumlist { width: 100%; }
.category-title {
    font-size: 18px;
    font-weight: bold;
    margin: 20px 0 12px;
    padding-bottom: 5px;
    border-bottom: 2px solid #2B7ACD;
    display: inline-block;
}
.forum-item {
    padding: 15px 0;
    border-bottom: 1px dashed #eceef2;
    display: flex;
    align-items: center;
}
.forum-name {
    width: 150px;
    font-weight: bold;
}
.forum-name a {
    color: #2B7ACD;
    text-decoration: none;
    font-size: 13px;
}
.forum-description {
    flex: 1;
    color: #888;
    font-size: 13px;
}
.forum-stats {
    width: 120px;
    text-align: center;
    color: #999;
}
.forum-lastpost {
    width: 180px;
    font-size: 12px;
    color: #aaa;
}

.forum-meta {display:flex;gap:12px; font-size:11px; color:#999; }
.forum-meta i {color: #999; font-size: 14px; margin-right: 8px;}

/* ===== 头部搜索框样式 ===== */
#hd {
    position: relative; /* 为绝对定位提供参考 */
}

.header-search {
    position: absolute;
    left: 260px;        /* 距离页面左侧260px */
    top: 50%;
    transform: translateY(-50%);
    width: 240px;
    height: 36px;
    z-index: 20;
}

.header-search form {
    display: flex;
    width: 100%;
    height: 100%;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 18px;
    overflow: hidden;
    transition: all 0.2s;
}

.header-search form:focus-within {
    border-color: #2B7ACD;
    box-shadow: 0 0 0 2px rgba(43,122,205,0.1);
}

.header-search input {
    flex: 1;
    border: none;
    padding: 0 12px;
    font-size: 13px;
    outline: none;
    background: transparent;
}

.header-search button {
    width: 52px;
    border: none;
    background: #f5f5f5;
    color: #555;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.header-search button:hover {
    background: #2B7ACD;
    color: #fff;
}

/* 调整导航菜单位置，避免被搜索框遮挡 */
.nav-menu {
    margin-left: 520px !important;  /* 确保菜单在搜索框右侧 (260px + 240px + 20px间距) */
}

/* 限制站点名称宽度，避免与搜索框重叠 */
.logo {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 响应式：小屏幕下隐藏搜索框，避免错位 */
@media (max-width: 1000px) {
    .header-search {
        display: none;
    }
    .nav-menu {
        margin-left: 0 !important;
    }
}

/* 全部板块搜索框 */
.all-forums-search {
    position: sticky;
    top: 0;
    background: #fff;
    padding: 0 0 12px 0;
    margin-bottom: 0px;
    border-bottom: 1px solid #eceef2;
    z-index: 5;
}
.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #f5f7fa;
    border-radius: 20px;
    padding: 0 12px;
    border: 1px solid #e2e6eb;
    transition: all 0.2s;
}
.search-input-wrapper:focus-within {
    border-color: #2B7ACD;
    background: #fff;
}
.search-input-wrapper i {
    color: #999;
    font-size: 14px;
    margin-right: 8px;
}
#allForumSearchInput {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 0;
    font-size: 13px;
    outline: none;
}
.clear-search {
    cursor: pointer;
    font-size: 18px;
    color: #999;
    padding: 0 4px;
    font-weight: normal;
}
.clear-search:hover {
    color: #333;
}
.search-results-header {
    font-size: 13px;
    font-weight: bold;
    padding: 8px 0;
    border-bottom: 1px solid #eceef2;
    margin-bottom: 12px;
    color: #2B7ACD;
}
/* 隐藏左侧栏、右侧栏以及全部版块容器滚动条，保留滚动功能 */
.sidebar-left,
.sidebar-right,
.all-forums-wrapper {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}
.sidebar-left::-webkit-scrollbar,
.sidebar-right::-webkit-scrollbar,
.all-forums-wrapper::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
}

/* 左侧栏版块高亮样式 */
.sidebar-left .forum-link-active {
    background-color: #e8f0fe;
    color: #2B7ACD;
    font-weight: 600;
    border-radius: 4px;
    display: inline-block;
    width: 100%;
    padding: 2px 8px;
    margin: 0 -8px;
}
/* 针对关注版块列表项的高亮 */
.sidebar-left .follow-forum-item .forum-link-active {
    background-color: #e8f0fe;
    border-radius: 6px;
}

/* ===== 瀑布流网格（一行5列） ===== */
.thread-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    margin: 20px 0;
}
@media (max-width: 1200px) {
    .thread-grid { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
    .thread-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
    .thread-grid { grid-template-columns: repeat(2, 1fr); }
}
.thread-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #eceef2;
}
.thread-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}
.card-cover {
    width: 100%;
    aspect-ratio: 16 / 10;
    background: #f5f7fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cover-placeholder {
    font-size: 12px;
    color: #999;
    text-align: center;
    padding: 20px;
}
.card-info {
    padding: 12px;
}
.card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
}
.card-title a {
    color: #2B7ACD;
    text-decoration: none;
}
.card-title a:hover {
    text-decoration: underline;
}
.card-summary {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-meta {
    margin-top: 10px;
    font-size: 12px;
    color: #999;
    display: flex;
    gap: 12px;
}
.card-meta i {
    margin-right: 4px;
}
.load-more-trigger {
    text-align: center;
    padding: 20px;
    color: #999;
}
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-top-color: #2B7ACD;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 封面文字（无图片时显示） */
.card-cover .cover-text {
    width: 100%;
    height: 100%;
    background: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #2B7ACD;
    text-align: center;
    padding: 20px;
    line-height: 1.4;
    word-break: break-all;
    box-sizing: border-box;
}
/* 卡片底部元信息 */
.card-meta {
    margin-top: 10px;
    font-size: 12px;
    color: #999;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.author-info {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.meta-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
}
.author-info a {
    color: #2B7ACD;
    text-decoration: none;
}
.author-info a:hover {
    text-decoration: underline;
}

/* 弹窗样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-dialog {
    width: 90%;
    max-width: 800px;
    max-height: 90%;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.modal-header {
    padding: 15px 20px;
    background: #f5f7fa;
    border-bottom: 1px solid #eaeef2;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #2B7ACD;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.modal-close {
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    color: #999;
    transition: color 0.2s;
}
.modal-close:hover {
    color: #333;
}
.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #fff;
}
.modal-loading {
    text-align: center;
    padding: 40px;
    color: #999;
}
/* 弹窗内帖子内容样式 */
.modal-body .post-content {
    font-size: 15px;
    line-height: 1.6;
}
.modal-body .post-replies {
    margin-top: 20px;
    border-top: 1px solid #eaeef2;
    padding-top: 15px;
}
.modal-body .reply-item {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}
.modal-body .reply-author {
    font-weight: bold;
    margin-bottom: 5px;
    color: #2B7ACD;
}
.modal-body .reply-message {
    font-size: 14px;
    color: #555;
}
@media (max-width: 600px) {
    .modal-dialog {
        width: 95%;
        max-height: 95%;
    }
    .modal-header h3 {
        font-size: 16px;
    }
}

/* 滚动条美化（可选） */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }