/* =========================================================
 * ZhiCms 论坛/社区模块公共样式
 * 整合自：forum/index.html、forum/group.html（.forum-* / .fc-* 系列）
 * 加载位置：<head> 中，仅论坛相关页面加载
 * 含移动端适配（PC/移动端兼容）
 * ========================================================= */

/* ===== 论坛页签 ===== */
.forum-tabs {
    display: flex;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 16px;
    overflow-x: auto;
}
.forum-tab {
    padding: 6px 14px;
    border-radius: 20px;
    background: #f5f5f5;
    color: #666;
    text-decoration: none;
    white-space: nowrap;
    font-size: 14px;
    transition: all 0.2s;
}
.forum-tab:hover { background: #e6f7ff; color: #1890ff; }
.forum-tab.active { background: #1890ff; color: #fff; }

/* ===== 帖子列表 ===== */
.forum-list { display: flex; flex-direction: column; gap: 12px; }
.forum-card {
    background: #fff;
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: box-shadow 0.2s;
}
.forum-card:hover { box-shadow: 0 3px 8px rgba(0,0,0,0.08); }
.fc-header { display: flex; align-items: center; margin-bottom: 10px; }
.fc-avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff; border-radius: 50%;
    font-size: 14px; font-weight: 600;
}
.fc-user { margin-left: 10px; flex: 1; }
.fc-user strong { display: block; font-size: 14px; color: #333; }
.fc-user small { color: #999; font-size: 12px; }
.fc-stats { color: #999; font-size: 12px; }
.fc-stats span { margin-left: 10px; }
.fc-stats i { margin-right: 2px; }

.fc-title-link { text-decoration: none; }
.fc-title {
    font-size: 15px; color: #333; margin: 4px 0 8px;
    line-height: 1.4; font-weight: 600;
}
.fc-content {
    font-size: 14px; color: #444; line-height: 1.7;
    word-break: break-word; max-height: 200px; overflow: hidden;
}
.fc-content p { margin: 0 0 8px; }
.fc-content img { max-width: 100%; height: auto; }
.fc-content a { color: #1890ff; }

/* ===== 帖子图片 ===== */
.fc-images { display: grid; gap: 6px; margin: 10px 0; }
.fc-images-grid { grid-template-columns: repeat(3, 1fr); }
.fc-images-single { grid-template-columns: minmax(0, 280px); }
.fc-img-item {
    padding-top: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    position: relative;
}
.fc-img-item img {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    cursor: zoom-in;
    transition: transform 0.3s;
}
.fc-img-item:hover img { transform: scale(1.05); }
.fc-images-single .fc-img-item { padding-top: 75%; }

/* ===== 商品卡片 ===== */
.fc-goods-card {
    display: flex; gap: 10px;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 8px;
    background: #fafafa;
    text-decoration: none;
    color: inherit;
    margin: 10px 0;
    transition: all 0.2s;
}
.fc-goods-card:hover { background: #f0f7ff; border-color: #91d5ff; }
.fc-goods-pic {
    width: 70px; height: 70px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}
.fc-goods-info { flex: 1; min-width: 0; }
.fc-goods-title {
    font-size: 13px; color: #333; line-height: 1.4;
    max-height: 38px; overflow: hidden;
    margin-bottom: 6px;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.fc-goods-price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.fc-goods-platform {
    padding: 2px 6px;
    background: #e6f7ff;
    color: #1890ff;
    border-radius: 3px;
    font-size: 11px;
}
.fc-goods-act { color: #f5222d; font-size: 16px; font-weight: 700; }
.fc-goods-orig { color: #999; text-decoration: line-through; font-size: 12px; }
.fc-goods-coupon {
    padding: 2px 5px;
    background: #fff1f0;
    color: #f5222d;
    border-radius: 3px;
    font-size: 11px;
}

/* ===== 卡片底部操作 ===== */
.fc-footer {
    display: flex;
    justify-content: space-around;
    border-top: 1px solid #f5f5f5;
    padding-top: 8px;
    margin-top: 8px;
}
.fc-action {
    color: #666;
    font-size: 13px;
    text-decoration: none;
    padding: 4px 12px;
    border-radius: 6px;
    transition: all 0.2s;
}
.fc-action:hover { background: #f5f5f5; color: #1890ff; }
.fc-action.liked i { color: #f5222d; font-weight: 700; }

/* ===== 空状态 / 分页 ===== */
.empty-state { text-align: center; padding: 60px 20px; }
.pagination-box { text-align: center; margin-top: 20px; }
/* 分页：弹性换行居中，避免页数多时超出内容区错位 */
.pagination-box { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
.pagination-box li { margin: 0; list-style: none; }
.pagination-box li.pageEllipsis span {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 28px; height: 36px; color: #999; background: transparent; border: none; cursor: default;
}
/* 论坛分页页码按钮 */
.pagination-box li a,
.pagination-box li.active a {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 36px; height: 36px; padding: 0 12px; border-radius: 10px;
    background: #fff; color: #333; border: 1px solid #eee; font-size: 14px;
}
.pagination-box li a:hover { border-color: #1890ff; color: #1890ff; }
.pagination-box li.active a { background: #1890ff; border-color: transparent; color: #fff; cursor: default; }

/* ===== 小组信息卡片（forum/group 页）===== */
.group-info-card {
    display: flex; gap: 14px;
    background: linear-gradient(135deg, #fff, #f5f7fa);
    padding: 16px; border-radius: 10px;
    margin-bottom: 16px;
    border: 1px solid #eee;
}
.gic-avatar {
    width: 60px; height: 60px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; font-weight: 700;
    flex-shrink: 0;
}
.gic-info { flex: 1; }
.gic-info h3 { margin: 0 0 6px; font-size: 18px; color: #333; }
.gic-info .text-muted { font-size: 13px; margin: 0 0 6px; }
.gic-stats { display: flex; gap: 14px; color: #999; font-size: 13px; }
.gic-stats i { margin-right: 4px; }

/* ===== 移动端适配 ===== */
@media (max-width: 767px) {
    .forum-tabs { gap: 6px; padding: 6px 0; margin-bottom: 12px; }
    .forum-tab { padding: 5px 12px; font-size: 13px; }
    .forum-list { gap: 10px; }
    .forum-card { padding: 12px 14px; }
    .fc-header { flex-wrap: wrap; }
    .fc-avatar { width: 32px; height: 32px; font-size: 13px; }
    .fc-stats { width: 100%; margin-top: 8px; text-align: right; }
    .fc-stats span { margin-left: 6px; font-size: 11px; }
    .fc-title { font-size: 14px; }
    .fc-content { font-size: 13px; max-height: 150px; }
    .fc-images-grid { grid-template-columns: repeat(3, 1fr); gap: 4px; }
    .fc-images-single { grid-template-columns: 1fr; }
    .fc-goods-card { flex-direction: column; gap: 8px; }
    .fc-goods-pic { width: 100%; height: auto; max-height: 180px; }
    .fc-footer { justify-content: space-between; padding: 8px 4px 0; }
    .fc-action { font-size: 12px; padding: 6px 10px; }
    .pagination-box .pagination { font-size: 13px; }
    .group-info-card { padding: 12px; gap: 10px; }
    .gic-avatar { width: 46px; height: 46px; font-size: 20px; }
}

/* ===== 深色模式适配（论坛/社区）===== */
[data-theme="dark"]{
    .forum-tabs{border-bottom-color:var(--dividerColor,#2a2f38);}
    .forum-tab{background:var(--surfaceHover,#23272f);color:var(--lightColor,#828a96);}
    .forum-tab:hover{background:var(--borderColor,rgba(255,255,255,.06));color:var(--aHoverColor,#ff6a6e);}
    .forum-card{background:var(--conBgcolor,#1a1d24);box-shadow:0 1px 3px rgba(0,0,0,.2);}
    .forum-card:hover{box-shadow:0 3px 8px rgba(0,0,0,.3);}
    .fc-user strong{color:var(--fontColor,#e8eaed);}
    .fc-user small{color:var(--lightColor,#828a96);}
    .fc-stats{color:var(--lightColor,#828a96);}
    .fc-title{color:var(--aColor,#e8eaed);}
    .fc-content{color:var(--fontColor,#e8eaed);}
    .fc-content a{color:var(--aHoverColor,#ff6a6e);}
    .fc-goods-card{background:var(--surfaceHover,#23272f);border-color:var(--borderColor,rgba(255,255,255,.08));}
    .fc-goods-title{color:var(--fontColor,#e8eaed);}
    .fc-goods-orig{color:var(--lightColor,#828a96);}
    .fc-footer{border-top-color:var(--dividerColor,#2a2f38);}
    .fc-action{color:var(--lightColor,#828a96);}
    .fc-action:hover{background:var(--borderColor,rgba(255,255,255,.06));color:var(--aHoverColor,#ff6a6e);}
    .group-info-card{background:linear-gradient(135deg,var(--conBgcolor,#1a1d24),var(--surfaceHover,#23272f));border-color:var(--borderColor,rgba(255,255,255,.08));}
    .gic-info h3{color:var(--fontColor,#e8eaed);}
    .gic-stats{color:var(--lightColor,#828a96);}
    .pagination-box li a,
    .pagination-box li.active a{background:var(--conBgcolor,#1a1d24);color:var(--fontColor,#e8eaed);border-color:var(--borderColor,rgba(255,255,255,.1));}
    .pagination-box li a:hover{border-color:var(--aHoverColor,#ff6a6e);color:var(--aHoverColor,#ff6a6e);}
    .pagination-box li.active a{background:var(--gradient,#ff4d4f);border-color:transparent;color:#fff;}
    .pagination-box li.pageEllipsis span{color:var(--lightColor,#828a96);}
}
