/* ===== 移动端社区页面样式 ===== */

/* ===== 详情页：元信息行右侧操作图标 ===== */
.article-actions-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    flex-shrink: 0;
}

.toolbar-icon-btn {
    background: none;
    border: none;
    padding: 4px;
    color: #86909C;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
}

.toolbar-icon-btn i {
    font-size: 20px;
}

.toolbar-icon-btn.active i {
    color: var(--primary-color);
}

.mobile-community-page {
    min-height: 100vh;
    background: #f5f5f5;
}

.mobile-community-detail-page {
    padding-bottom: 30px;
    min-height: 100vh;
    background: #fff;
}

/* ===== 分类导航标签 ===== */
.community-nav-tabs-mobile {
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    padding: 12px 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.nav-tabs-wrapper {
    display: flex;
    gap: 8px;
    white-space: nowrap;
}

.nav-tab {
    padding: 6px 16px;
    border-radius: 20px;
    color: #666;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.3s;
}

.nav-tab.active {
    background: #2B57A5;
    border-color: #2B57A5;
    color: #fff;
}

/* ===== 页头 ===== */
.page-header-mobile {
    background: #fff;
    padding: 16px;
}

.page-title-mobile {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
}

.page-description-mobile {
    font-size: 13px;
    color: #999;
    margin: 0;
}

/* ===== 内容列表 ===== */
.community-list-mobile {
    padding: 0;
}

/* 今日头条式信息流卡片：只留标题 + 右侧缩略图 */
.community-card-mobile {
    display: flex;
    gap: 12px;
    align-items: center;
    background: #fff;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
}

.community-card-main-mobile {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* 有缩略图时正文与图等高，标题贴顶、时间贴底 */
.community-card-mobile.has-thumb .community-card-main-mobile {
    min-height: 78px;
    justify-content: space-between;
}

.community-card-title-mobile {
    font-size: 16px;
    font-weight: 500;
    color: #222;
    margin: 0;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.community-card-meta-mobile {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 12px;
    color: #9aa0a6;
}

.meta-tag-mobile {
    color: #6b7075;
}

.community-card-thumb-mobile {
    flex: 0 0 116px;
    width: 116px;
    height: 78px;
    border-radius: 4px;
    overflow: hidden;
}

.community-card-thumb-mobile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ===== 详情页 ===== */
.article-header-mobile {
    padding: 16px 16px 8px;
}

.article-title-mobile {
    font-size: 22px;
    color: #1D2129;
    margin: 0 0 12px 0;
    font-family: SourceHanSerifCN;
    font-weight: 600;
    line-height: 32px;
}

.article-meta-mobile {
    display: flex;
    gap: 12px;
    padding: 0;
    font-size: 12px;
    color: #86909C;
    font-family: var(--font-data);
}

.article-author-mobile {
    display: flex;
    align-items: center;
    gap: 8px;
}

.author-avatar-mobile {
    width: 24px;
    height: 24px;
    border-radius: 2px;
    object-fit: cover;
}

.author-info-mobile {
    display: flex;
    align-items: center;
    gap: 8px;
}

.author-name-mobile {
    font-size: 12px;
    font-weight: 500;
    color: #4E5969;
    margin-bottom: 0;
}

.article-time-mobile {
    font-size: 12px;
    color: #86909C;
}

.article-stats-mobile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-item-mobile {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #86909C;
}

.stat-item-mobile i {
    font-size: 12px;
}

/* ===== 文章内容 ===== */
.article-content-mobile {
    padding: 8px 16px 16px;
    font-size: 17px;
    color: #333;
    margin-bottom: 16px;
    width: 100%;
    font-family: PingFang SC;
    line-height: 1.6;
    font-weight: 400;
    text-align: justify;
    letter-spacing: 0;
    margin-left: 0 !important;
}

.article-content-mobile img {
    max-width: 100%;
    height: auto;
    border-radius: 2px;
    margin: 12px 0;
}

.article-content-mobile p {
    margin-bottom: 16px;
}

.article-content-mobile h2,
.article-content-mobile h3,
.article-content-mobile h4,
.article-content-mobile h5 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 18px;
}

/* ===== 富文本内表格横向滚动（由 JS 动态包裹 .table-container） ===== */
.article-content-mobile .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-height: 600px;
    border-radius: 2px;
    margin: 8px 0;
}

.article-content-mobile .table-container table,
.article-content-mobile table {
    min-width: 100%;
    border-collapse: collapse;
    margin-bottom: 14px;
}

.article-content-mobile .table-container th,
.article-content-mobile .table-container td,
.article-content-mobile th,
.article-content-mobile td {
    min-width: 100px;
    max-width: 180px;
    padding: 6px;
    font-size: 14px;
    border: 1px solid #eee;
}

.article-content-mobile .table-container th,
.article-content-mobile th {
    background-color: #f5f5f5;
    font-weight: bold;
    color: #333;
    text-align: center;
    line-height: 1.2;
    position: sticky;
    top: -1px;
    z-index: 9;
}

/* ===== 数据快讯卡片 ===== */
.data-flash-card-mobile {
    background: #f8f9fa;
    padding: 16px;
    margin-bottom: 16px;
}

.flash-card-header-mobile {
    margin-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.flash-card-title-mobile {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.flash-card-body-mobile {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flash-data-item-mobile {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flash-label-mobile {
    font-size: 14px;
    color: #666;
    padding-right: 10px;
}

.flash-value-mobile {
    /* 核心三属性 */
    white-space: nowrap;      /* 1. 强制不换行 */
    overflow: hidden;         /* 2. 隐藏超出的内容 */
    text-overflow: ellipsis;  /* 3. 超出部分显示省略号 (...) */
  
    /* 使得 span 支持宽度限制 */
    display: inline-block;    /* 或者 block，取决于你的布局需求 */
    
    /* 宽度限制（示例） */
    max-width: 100%;          /* 限制最大宽度为父容器的100%，或者指定具体像素如 200px */
    vertical-align: middle;   /* 如果有对齐问题，可以加上这个 */
  }

/* 可点击展开的 flash-value */
.flash-value-mobile.expandable {
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

/* 展开后的状态 */
.flash-value-mobile.expanded {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    max-width: 100%;
    word-wrap: break-word;
    word-break: break-all;
}

/* 通用可展开文本样式 */
.expandable {
    cursor: pointer;
    transition: all 0.3s ease;
    text-underline-offset: 2px;
}

.expandable:not(.expanded) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80%;
}

.expandable.expanded {
    white-space: normal;
    word-wrap: break-word;
    word-break: break-all;
    text-decoration: none;
}

.expandable:active {
    opacity: 0.7;
}

/* ===== 数据快讯表格 ===== */
.data-quicknews-section-mobile {
    background: #fff;
}

.quicknews-table-title-mobile {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 16px 0;
}

/* ===== 数据排行榜 ===== */
.data-rank-section-mobile {
    background: #fff;
    padding: 16px 0;
}

.rank-title-mobile {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 16px 0;
}

.rank-footer-mobile {
    font-size: 12px;
    color: #999;
    padding-top: 12px;
}

/* ===== 数据对比 ===== */
.data-compare-section-mobile {
    background: #fff;
    padding: 16px;
    margin-bottom: 12px;
}

.compare-chart-header-mobile {
    margin-bottom: 16px;
}

.chart-title-mobile {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.data-compare-table-mobile {
    background: #fff;
    padding: 16px;
    margin-bottom: 12px;
}

/* ===== 图表区域 ===== */
.quicknews-chart-section-mobile,
.rank-chart-section-mobile,
.compare-chart-section-mobile {
    margin-bottom: 16px;
}

/* 🔴 必须是 height 不能是 min-height：图表容器 .gh-chart 的高度是 height:100%，
   父级只给 min-height 时百分比高度无从计算，算出来是 0，ECharts 画在 0 高的画布上=整块空白。
   全站其它 .chart-wrapper-mobile（mobile-channel / mobile-fangjia / mobile-compare）都是写死 height，
   只有这里当年按 Chart.js（画布自己撑高）写成 min-height，换 ECharts 后就崩了。 */
.chart-wrapper-mobile {
    position: relative;
    width: 100%;
    margin-top: 8px;
    height: 220px;
}

.chart-wrapper-mobile canvas {
    max-width: 100%;
    height: 100% !important;
}

/* ===== 数据表格 ===== */
.table-scroll-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #f0f0f0;
    border-radius: var(--border-radius-md);
    margin-bottom: 12px;
}

.data-table-mobile {
    width: 100%;
    min-width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.table-header-mobile {
    background: #f8f9fa;
}

.table-header-row-mobile {
    border-bottom: 1px solid #e0e0e0;
}

.table-header-cell-mobile {
    padding: 12px 8px;
    font-size: 12px;
    font-weight: 500;
    color: #333;
    text-align: center;
    white-space: nowrap;
    min-width: 80px;
}

.table-header-cell-mobile:last-child {
    border-right: none;
}

.table-body-mobile {
    background: #fff;
}

.table-row-mobile {
    border-bottom: 1px solid #f0f0f0;
}

.table-row-mobile:last-child {
    border-bottom: none;
}

.table-cell-mobile {
    padding: 12px 8px;
    font-size: 13px;
    color: #666;
    text-align: center;
    white-space: nowrap;
    min-width: 80px;
}

.table-cell-mobile:last-child {
    border-right: none;
}

/* 下载按钮与表格之间留一档间距：贴着表格下边框会读成表格的一部分。
   改这里记得同步小程序 pages/community/components/community-block.scss 的 .rank-table-actions */
.table-actions-mobile {
    padding: 10px 0 0;
    margin-bottom: 8px;
}

.rank-badge-mobile {
    font-size: 13px;
    font-family: var(--font-data);
    font-feature-settings: "tnum" on, "lnum" on;
    color: var(--bs-dark);
}

.rank-badge-mobile.normal {
    color: #86909C;
}

.rank-badge-mobile.top1,
.rank-badge-mobile.top2,
.rank-badge-mobile.top3 {
    font-weight: 700;
    color: #1D2129;
}

/* ===== 社区数据表格（专用，参考 community.css data-rank-table）===== */
.community-data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    color: var(--text-dark);
    background: #fff;
}

.community-data-table th {
    background: #F8F9FA;
    padding: 8px 12px;
    text-align: center;
    font-weight: 500;
    color: #64748B;
    font-size: 12px;
    line-height: 1.2;
    border: 1px solid var(--border-color);
}

.community-data-table th.sticky-col {
    position: sticky;
    left: 0;
    z-index: 11;
    background: #F8F9FA;
    text-align: left;
}

.community-data-table td {
    padding: 8px 12px;
    text-align: center;
    font-size: 13px;
    color: var(--text-dark);
    font-family: var(--font-data);
    font-feature-settings: "tnum" on, "lnum" on;
    border: 1px solid var(--border-color);
    white-space: nowrap;
}

.community-data-table td.sticky-col {
    position: sticky;
    left: 0;
    z-index: 9;
    background: #fff;
    text-align: left;
    font-family: var(--font-ui);
    font-variant-numeric: normal;
}

.community-data-table tbody tr:hover {
    background: #F0F4FA;
}

.community-data-table tbody tr:hover td.sticky-col {
    background: #F0F4FA;
}

.data-flash-footer-mobile {
    font-size: 12px;
    color: #999;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}

/* ===== 关联数据卡片 ===== */
.macro-data-card-mobile {
    margin: 0 16px 20px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 2px;
}

.macro-data-header-mobile {
    background: #F8F9FA;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.macro-data-title-mobile {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.macro-data-title-mobile i {
    font-size: 16px;
    color: var(--primary-color);
}

.macro-data-body-mobile {
    padding: 12px;
}

.macro-data-info-mobile {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 0;
}

.info-item-mobile {
    display: flex;
    align-items: flex-start;
    font-size: 13px;
    line-height: 1.5;
    justify-content: space-between;
}

.info-label-mobile {
    color: #86909C;
    width: 70px;
    flex-shrink: 0;
}

.info-value-mobile {
    color: #1D2129;
    word-break: break-word;
}

.info-value-mobile.expandable {
    display: inline-block;
    max-width: 100%;
}

.info-value-mobile.link {
    color: var(--primary-color);
    text-decoration: none;
}

.macro-data-detail-link {
    font-size: 13px;
}

.macro-data-detail-link i {
    font-size: 12px;
}

/* ===== 详情页操作按钮 ===== */
.article-actions-mobile {
    padding: 0 16px 24px;
    margin: 0;
    display: flex;
    gap: 24px;
    align-items: center;
    border: none;
    justify-content: flex-start;
}

.btn-action-compact {
    background: transparent;
    border: none;
    padding: 0;
    font-size: 13px;
    color: #4E5969;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.btn-action-compact.active,
.btn-action-compact:active {
    color: var(--primary-color) !important;
}

.btn-action-compact i {
    font-size: 16px;
    margin-right: 0;
}

/* ===== 评论区 ===== */
.comment-section-mobile {
    background: #fff;
    padding: 16px;
    border-top: 6px solid #F2F4F8;
}
.comment-section-mobile .card-title-row {
    margin-bottom: 12px;
}
.comment-count-mobile {
    font-size: 14px;
    color: #999;
    font-weight: normal;
}
.comment-item-mobile {
    padding: 12px 0;
    border-bottom: 1px solid #F2F4F8;
}
.comment-item-mobile:last-child {
    border-bottom: none;
}
.comment-header-mobile {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    gap: 8px;
}
.comment-avatar-mobile {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.comment-meta-mobile {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.comment-name-mobile {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
}
.comment-time-mobile {
    font-size: 11px;
    color: #999;
    line-height: 1.4;
}
.comment-like-mobile {
    font-size: 12px;
    color: #999;
    flex-shrink: 0;
}
.comment-content-mobile {
    font-size: 14px;
    color: #444;
    line-height: 1.7;
    padding-left: 40px;
    word-break: break-word;
}

/* ===== 继续阅读（对齐 PC .cc-rec-*；手机强制 1 列） ===== */
.cc-rec-section-mobile {
    padding: 0;
    border-top: 6px solid #F2F4F8;
    background: #fff;
}
.cc-grid-mobile {
    display: grid;
    grid-template-columns: 1fr;
    padding: 0 16px 16px;
}
.cc-card-mobile {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border: none;
    border-bottom: 1px solid var(--border-color, #ebeef5);
    border-radius: 0;
    text-decoration: none;
    background: #fff;
}
.cc-card-mobile:active {
    background: #F7FAFC;
}
.cc-card-img-mobile {
    flex: 0 0 100px;
    align-self: stretch;
    min-height: 80px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--border-color, #ebeef5);
}
.cc-card-img-mobile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.cc-card-body-mobile {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.cc-card-title-mobile {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: #1D2129;
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-all;
}
.cc-card-summary-mobile {
    flex: 1;
    margin: 0;
    font-size: 12px;
    line-height: 1.6;
    color: #86909C;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== 空状态 ===== */
.empty-state-mobile {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    margin: 12px 16px;
}

.empty-icon-mobile {
    font-size: 64px;
    color: #ddd;
    margin-bottom: 20px;
}

.empty-text-mobile {
    font-size: 14px;
    color: #999;
    margin: 0;
}

/* ===== 响应式调整 ===== */
@media (max-width: 375px) {
    .article-actions-mobile {
        flex-wrap: wrap;
    }
}


/* 数据地图文章：正文地图下的来源行 + 折叠数值表（同 PC 口径，字号收紧） */
.crp-map-source { margin: 6px 0 10px; font-size: 12px; color: var(--text-muted); }
.crp-map-table { margin: 0 0 16px; font-size: 12px; }
.crp-map-table > summary { cursor: pointer; padding: 4px 0; font-size: 12px; color: var(--text-muted); }
.crp-map-table table { width: 100%; margin-top: 8px; border-collapse: collapse; }
.crp-map-table th,
.crp-map-table td { padding: 5px 8px; text-align: left; border-bottom: 1px solid var(--border-color, #eee); }
.crp-map-table th { font-weight: normal; color: var(--text-muted); }
.crp-map-table th:last-child,
.crp-map-table td:last-child { text-align: right; }

/* 草稿预览提示条（手机端） */
.preview-banner {
  margin: 0 0 10px;
  padding: 8px 12px;
  font-size: 12px;
  color: #8a5a00;
  background: #fff8e6;
  border: 1px solid #f0e0b8;
  border-radius: 2px;
}

/* ===== 数据报告：正文表格外框（手机端） =====
   钩子同 PC，由 community-report-charts.js 打在 .article-content-mobile 上，只作用于报告页。
   .table-container 的横向滚动已由既有规则（261 行）提供，这里只补白底与外边距，不重复写 overflow。 */
.article-content-mobile[data-report-body] .table-container {
    background: #fff;
    margin: 12px 0;
}
