/**
 * 社区模块公共样式
 * 包含：布局框架、Hero区域、Tab导航、筛选栏、分页、卡片基础、文章/问答列表通用样式
 */

/* ==================== 布局框架 ==================== */
.community-container {
    background: #f5f7fa;
    min-height: calc(100vh - 60px);
    padding-top: 60px;
}

.community-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    gap: 20px;
}

.community-left {
    flex: 1;
    min-width: 0;
}

.community-right {
    width: 300px;
    flex-shrink: 0;
}

/* 详情页主体内容区 - 全宽居中 */
.community-detail-main {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* ==================== Hero区域 ==================== */
.community-hero {
    background: linear-gradient(135deg, #e8f4ff 0%, #f0f7ff 50%, #e6f0ff 100%); 
    background-image: linear-gradient(28deg, rgb(188 207 247 / 89%), rgba(191, 210, 250, 0) 79%);
    padding: 40px 0;
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.hero-left {
    flex: 1;
}

.hero-title {
    font-size: 36px;
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 24px;
}

/* 搜索框 */
.hero-search {
    position: relative;
    max-width: 480px;
    margin-bottom: 20px;
}

.hero-search input {
    width: 100%;
    height: 48px;
    border-radius: 24px;
    border: 1px solid #e0e6ed;
    padding: 0 10px 0 40px;
    font-size: 14px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: all 0.3s;
}

.hero-search input:focus {
    border-color: #3b82f6;
    box-shadow: 0 2px 12px rgba(59,130,246,0.15);
    outline: none;
}

.hero-search .search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 16px;
}

.hero-search .search-clear {
    position: absolute;
    right: -30px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 18px;
    cursor: pointer;
    display: none;
    transition: color 0.3s;
}

.hero-search .search-clear:hover {
    color: #666;
}

.hero-search .search-clear.show {
    display: block;
}

/* 右侧Banner */
.hero-banners {
    display: flex;
    gap: 16px;
    flex: 1;
    max-width: 600px;
}

.banner-item {
    flex: 1;
    height: 140px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s;
}

.banner-item:hover {
    transform: translateY(-2px);
}

.banner-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==================== Tab导航 ==================== */
.community-tabs-wrapper {
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
}

.community-tabs {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
}

.community-tab {
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 400;
    font-family: PingFangSC-Regular;
    color: #666;
    cursor: pointer;
    position: relative;
    transition: color 0.3s;
    text-decoration: none;
}

.community-tab:hover {
    color: #3b82f6;
}

.community-tab.active {
    color: #3b82f6;
    font-weight: 500;
}

.community-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 20px;
    height: 2px;
    background: #3b82f6;
}

/* ==================== 筛选栏 ==================== */
.filter-bar {
    display: flex;
    padding: 16px 20px;
    border-bottom: 1px solid #f5f5f5;
    gap: 12px;
    background: #fff;
    border-radius: 12px 12px 0 0;
    flex-wrap: wrap;
}

.filter-bar .filter-item {
    display: inline-flex !important;
    align-items: center;
    padding: 6px 16px !important;
    border-radius: 16px !important;
    font-size: 13px !important;
    color: #666 !important;
    background: #f5f7fa !important;
    cursor: pointer;
    transition: all 0.3s;
    border: none !important;
    line-height: 1.5 !important;
    height: auto !important;
    box-sizing: border-box;
    margin: 0 !important;
    vertical-align: middle;
}

.filter-bar .filter-item:hover,
.filter-bar .filter-item.active {
    background: #3b82f6 !important;
    color: #fff !important;
}

/* ==================== 卡片基础 ==================== */
.content-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    margin-bottom: 16px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f5f5f5;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.section-header .more {
    font-size: 13px;
    color: #999;
    cursor: pointer;
    font-weight: normal;
}

.section-header .more:hover {
    color: #3b82f6;
}

.sidebar-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* ==================== 文章列表通用 ==================== */
.article-list {
    background: #fff;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    padding: 0 20px;
    min-height: 540px;
}

.article-card,
.article-item {
    display: flex;
    align-items: flex-start;
    padding: 20px;
    border-bottom: 1px solid #f5f5f5;   
    transition: background 0.2s;
    gap: 16px;
}

.article-card:hover,
.article-item:hover {
    background: #fafafa;
}

.article-card:last-child,
.article-item:last-child {
    border-bottom: none;
}

.article-content,
.article-main {
    flex: 1;
    min-width: 0;
}

.article-title {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    display: box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    box-orient: vertical;
}

.article-title .tag {
    display: inline-block;
    padding: 2px 8px;
    background: #e8f4ff;
    color: #3b82f6;
    font-size: 12px;
    border-radius: 4px;
    margin-right: 8px;
    font-weight: normal;
}

.article-title .tag.hot {
    background: #fff2e8;
    color: #ff6b6b;
}

.article-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    display: box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    box-orient: vertical;
    min-height: calc(13px * 1.6 * 2);
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #999;
}

.article-meta .author {
    color: #666;
    display: inline-flex;
    align-items: center;
}

.article-meta .left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.article-thumb,
.article-cover {
    width: 160px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.article-thumb img,
.article-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 文章页作者头像 */
.article-meta .author [data-avatar-name],
.author [data-avatar-name],
.article-meta .author .user-avatar-img,
.author .user-avatar-img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    vertical-align: middle;
    margin-right: 5px;
    object-fit: cover;
}

/* ==================== 问答列表通用 ==================== */
.qa-list {
    background: #fff;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    min-height: 540px;
}

.qa-item {
    display: flex;
    padding: 20px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
}

.qa-item:hover {
    background: #fafafa;
}

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

.qa-content {
    flex: 1;
    min-width: 0;
}


.qa-title {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.5;
    min-height: 30px;
}

.qa-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #999;
}

.qa-meta .author {
    color: #666;
}

.reward-icon {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: #fff2e8;
    color: #ff6b6b;
    font-size: 12px;
    border-radius: 4px;
    margin-left: 8px;
}

/* 首页问答特有 */
.qa-header-filter {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.qa-filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 16px;
    font-size: 13px;
    color: #666;
    background: #f5f7fa;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    font-weight: 500;
}

.qa-filter-btn:hover,
.qa-filter-btn.active {
    background: #3b82f6;
    color: #fff;
}

.qa-filter-btn.reward {
    background: #fff2e8;
    color: #ff6b6b;
}

/* 问答页特有 */
.qa-stats {
    width: 70px;
    text-align: center;
    flex-shrink: 0;
    margin-right: 16px;
    background: #f8f8fa;
    color: #4e5969;
    border-radius: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60px;
}

/* 状态1：待回答（回答为0）- 黄色 */
.qa-stats.pending {
    background: #fff7e6;
}

.qa-stats .count {
    font-size: 20px;
    font-weight: 600;
    color: #007620;
    display: block;
}

.qa-stats .count.answered {
    color: #52c41a;
}

/* 待回答图标样式 */
.qa-stats .count.pending {
    color: #faad14;
    font-size: 24px;
    line-height: 1;
}

.qa-stats .count.pending i {
    font-size: 24px;
}

/* 已解决图标样式 */
.qa-stats .count.solved {
    color: #52c41a;
    font-size: 24px;
    line-height: 1;
}

.qa-stats .count.solved i {
    font-size: 24px;
}

.qa-stats .label {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

/* 待回答文字样式 */
.qa-stats.pending .label {
    color: #faad14;
    font-size: 14px;
}

/* 已解决样式 */
.qa-stats.solved {
    background: #f3fcf1;
    color: #007620;
}

.qa-stats.solved .label {
    color: #52c41a;
    font-size: 14px;
}



.qa-more {
    padding: 16px 20px;
    text-align: center;
    border-top: 1px solid #f5f5f5;
}

.qa-more-btn {
    padding: 8px 24px;
    background: transparent;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    color: #666;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.qa-more-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

/* ==================== 分页 ==================== */
.pagination-wrapper {
    background: #fff;
    padding: 20px;
    border-radius: 0 0 12px 12px;
    display: flex;
    justify-content: center;
}

/* ==================== 右侧边栏通用 ==================== */
.welcome-card {
   
    
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.welcome-card .welcome-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.welcome-card .welcome-text {
    font-size: 14px;
    color: #666;
    margin-bottom: 12px;
}

.welcome-card .welcome-tips {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
    font-size: 13px;
    color: #999;
}

.welcome-card .welcome-tips li {
    margin-bottom: 6px;
}

.welcome-card .action-btns {
    display: flex;
    gap: 10px;
}

.welcome-card .action-btns .layui-btn {
    flex: 1;
    border-radius: 20px;
}

/* 已登录用户信息区域 */
.welcome-card .user-info-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.welcome-card .user-avatar-large {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1e9fff 0%, #1677ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    overflow: hidden;
}

.welcome-card .user-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.welcome-card .user-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

/* 用户统计数据 */
.welcome-card .user-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    padding: 0 10px;
}

.welcome-card .user-stats .stat-item {
    flex: 1;
    text-align: center;
}

.welcome-card .user-stats .stat-num {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    line-height: 1.2;
}

.welcome-card .user-stats .stat-label {
    font-size: 13px;
    color: #999;
    margin-top: 4px;
}

.welcome-card .user-stats .stat-divider {
    width: 1px;
    height: 30px;
    background: #e8e8e8;
}

/* 我的奖励 */
.reward-info {
    display: flex;
    gap: 20px;
}

.reward-info .reward-item {
    flex: 1;
    text-align: center;
    padding: 10px;
    background: #f5f7fa;
    border-radius: 8px;
}

.reward-info .reward-label {
    display: block;
    font-size: 12px;
    color: #999;
    margin-bottom: 4px;
}

.reward-info .reward-value {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #ff6b6b;
}

/* 贡献榜 */
.rank-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.rank-header .rank-title {
    font-size: 15px;
    font-weight: 600;
}

.rank-header .rank-tabs {
    font-size: 12px;
    color: #999;
}

.rank-header .rank-tabs span {
    cursor: pointer;
}

.rank-header .rank-tabs span.active {
    color: #3b82f6;
}

.rank-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
}

.rank-item .rank-num {
    width: 20px;
    font-weight: 600;
    color: #999;
}

.rank-item .rank-num.top1 { color: #ff6b6b; }
.rank-item .rank-num.top2 { color: #ffa94d; }
.rank-item .rank-num.top3 { color: #ffd43b; }

.rank-item .user-avatar-img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.rank-item .rank-name {
    flex: 1;
    margin-left: 10px;
    font-size: 14px;
}

.rank-item .rank-score {
    color: #999;
    font-size: 12px;
}

/* ==================== 随机色圆头像 ==================== */
.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
}

.user-avatar.large {
    width: 48px;
    height: 48px;
    font-size: 18px;
}

.user-avatar.small {
    width: 28px;
    height: 28px;
    font-size: 12px;
}

/* 预定义颜色组 */
.avatar-color-0 { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.avatar-color-1 { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.avatar-color-2 { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.avatar-color-3 { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.avatar-color-4 { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.avatar-color-5 { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); }
.avatar-color-6 { background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%); }
.avatar-color-7 { background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%); }
.avatar-color-8 { background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%); }
.avatar-color-9 { background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%); }

/* ==================== 工作流弹窗 ==================== */
.workflow-detail-popup {
    padding: 24px;
    background: #fff;
}

.workflow-detail-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.workflow-detail-icon {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    overflow: hidden;
    flex-shrink: 0;
}

.workflow-detail-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.workflow-detail-info {
    flex: 1;
    min-width: 0;
}

.workflow-detail-info h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.workflow-detail-info p {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 12px;
}

.workflow-detail-stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #999;
}

.workflow-detail-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.workflow-detail-price {
    margin-left: auto;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.workflow-detail-price.free {
    background: #f6ffed;
    color: #52c41a;
}

.workflow-detail-price.paid {
    background: #fff2e8;
    color: #ff6b6b;
}

.workflow-detail-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.workflow-detail-actions .layui-btn-primary {
    border-color: #e0e0e0;
    color: #666;
}

.workflow-detail-actions .layui-btn-normal {
    background: #ff6b6b;
    border-color: #ff6b6b;
}

.workflow-detail-divider {
    height: 1px;
    background: #f0f0f0;
    margin: 20px 0;
}

.workflow-detail-body {
    display: flex;
    gap: 20px;
    height: 500px;
    overflow: hidden;
}

.workflow-detail-left {
    flex: 1;
    min-width: 0;
    max-height: 100%;
    overflow-y: auto;
    padding-right: 10px;
}

.workflow-detail-left h4 {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.workflow-detail-left p {
    font-size: 13px;
    color: #666;
    line-height: 1.8;
    margin-bottom: 20px;
}

.workflow-detail-scene {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #f0f0f0;
}

.workflow-detail-scene img {
    width: 100%;
    height: auto;
}

.workflow-detail-right {
    width: 230px;
    flex-shrink: 0;
    max-height: 100%;
    overflow-y: auto;
    padding-right: 10px;
}

.workflow-detail-developer h4,
.workflow-detail-updates h4 {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.developer-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 20px;
}

.workflow-version {
    display: inline-block;
    padding: 2px 8px;
    background: #e8f4ff;
    color: #3b82f6;
    font-size: 12px;
    border-radius: 4px;
    margin-right: 8px;
}

/* 滚动条美化 */
.workflow-detail-left::-webkit-scrollbar,
.workflow-detail-right::-webkit-scrollbar {
    width: 6px;
}

.workflow-detail-left::-webkit-scrollbar-thumb,
.workflow-detail-right::-webkit-scrollbar-thumb {
    background: #c0c4cc;
    border-radius: 3px;
}

.workflow-detail-left::-webkit-scrollbar-thumb:hover,
.workflow-detail-right::-webkit-scrollbar-thumb:hover {
    background: #909399;
}

.workflow-detail-left::-webkit-scrollbar-track,
.workflow-detail-right::-webkit-scrollbar-track {
    background: #f0f2f5;
    border-radius: 3px;
}

/* 自定义时间线 */
.workflow-timeline {
    position: relative;
    padding-left: 20px;
}

.workflow-timeline::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: #e0e0e0;
}

.workflow-timeline-item {
    position: relative;
    padding-bottom: 16px;
}

.workflow-timeline-item:last-child {
    padding-bottom: 0;
}

.workflow-timeline-dot {
    position: absolute;
    left: -20px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #3b82f6;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #e0e0e0;
}

.workflow-timeline-time {
    font-size: 12px;
    color: #999;
    margin-bottom: 4px;
}

.workflow-timeline-desc {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

/* Layui 弹窗自定义 */
.layui-layer-page .layui-layer-content {
    overflow: visible;
}

/* ==================== 响应式布局 ==================== */
@media (max-width: 1024px) {
    .hero-content {
        flex-direction: column;
        gap: 24px;
    }
    
    .hero-banners {
        max-width: 100%;
        width: 100%;
    }
    
    .community-main {
        flex-direction: column;
    }
    
    .community-right {
        width: 100%;
    }
    
    .sidebar-card {
        margin-bottom: 12px;
    }
}

@media (max-width: 768px) {
    .community-hero {
        padding: 24px 0;
    }
    
    .hero-left {
        width: 85%;
    }
    
    .hero-title {
        font-size: 24px;
        margin-bottom: 16px;
    }
    
    .hero-search {
        max-width: none;
    }
    
    .hero-banners {
        flex-direction: column;
        gap: 12px;
    }
    
    .banner-item {
        height: 100px;
    }
    
    .community-tab {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .community-tab.active::after {
        left: 16px;
        right: 16px;
    }
    
    .community-main,
    .community-detail-main {
        padding: 12px;
    }
    
    .filter-bar {
        padding: 12px 16px;
    }
    
    .article-thumb,
    .article-cover {
        display: none;
    }
    
    .qa-header-filter {
        flex-wrap: wrap;
    }
    
    .qa-stats {
        width: 50px;
        margin-right: 12px;
    }
    
    .qa-stats .count {
        font-size: 16px;
    }
    
    /* 弹窗响应式 */
    .workflow-detail-popup {
        padding: 16px;
    }
    
    .workflow-detail-header {
        flex-wrap: wrap;
    }
    
    .workflow-detail-icon {
        width: 60px;
        height: 60px;
    }
    
    .workflow-detail-actions {
        width: 100%;
        margin-top: 10px;
    }
    
    .workflow-detail-body {
        flex-direction: column;
        height: auto;
        max-height: 50vh;
    }
    
    .workflow-detail-left,
    .workflow-detail-right {
        width: 100%;
        max-height: 50vh;
    }
}
