/* ===== 首页数据面板样式 ===== */

/* 首页各模块卡片头部的时间筛选条（今日/24小时/近7天，样式同 Monitor 数据面板时间条，颜色固定为数据面板品牌色 #2f6bff） */
.module-timebar { display: inline-flex; gap: 3px; align-items: center; background: #f0f3f8; padding: 2px; border-radius: 8px; flex-wrap: wrap; }
.module-timebar .dp-time-opt { font-size: 11px; font-weight: 500; padding: 3px 8px; border-radius: 6px; cursor: pointer; border: none; background: transparent; color: #5b6678; transition: all .15s; user-select: none; font-family: inherit; white-space: nowrap; }
.module-timebar .dp-time-opt:hover { color: #2f6bff; }
.module-timebar .dp-time-opt.active { background: #fff; color: #2f6bff; box-shadow: 0 1px 4px rgba(20,35,70,.12); }

/* 模块切换加载动效（同 Monitor 数据面板：圆环旋转 + 文字） */
.dp-mh-loading { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 160px; padding: 20px; color: #64748b; text-align: center; }
.dp-mh-loading .dp-spinner { width: 36px; height: 36px; flex-shrink: 0; border: 3px solid rgba(47, 107, 255, 0.15); border-top-color: #2f6bff; border-radius: 50%; animation: dp-spin 0.8s linear infinite; }
.dp-mh-loading .dp-loading-text { color: #64748b; font-size: 13px; line-height: 1.6; }
@keyframes dp-spin { to { transform: rotate(360deg); } }

.stats-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 20px; position: relative; }
.stat-card-dash { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; padding: 16px 14px; text-align: center; transition: all 0.3s; }
.stat-card-dash:hover { transform: translateY(-2px); box-shadow: 0 4px 20px rgba(0,0,0,0.15); border-color: var(--accent); }
.stat-card-dash .stat-icon { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin: 0 auto 8px; }
.stat-card-dash .stat-icon svg { width: 20px; height: 20px; stroke: white; fill: none; stroke-width: 2; }
.stat-card-dash .stat-num { font-size: 26px; font-weight: 700; line-height: 1.2; }
.stat-card-dash .stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.stat-card-dash .stat-sub { font-size: 11px; color: var(--text-muted); margin-top: 4px; line-height: 1.5; }
.stat-card-dash .stat-sub-wt { font-size: 11px; color: var(--text-muted); margin-top: 4px; line-height: 1.5; }
.stat-card-dash .stat-sub-wt b { color: var(--accent, #2f6bff); font-weight: 700; }
.stat-card-dash .stat-sub-date { font-size: 13px; font-weight: 700; color: var(--accent); letter-spacing: .3px; }
.stat-card-dash .stat-link { display: inline-block; text-decoration: none; color: inherit; cursor: pointer; transition: color .2s; }
.stat-card-dash .stat-link:hover { color: var(--accent); }
.stat-card-dash .stat-link:hover .stat-num { transform: scale(1.06); }
.stat-card-dash .stat-link .stat-num { transition: transform .2s; }
.stat-card-dash .stat-trend { font-size: 11px; margin-top: 6px; padding: 2px 8px; border-radius: 4px; display: inline-block; }
.stat-trend.up { background: var(--tag-success-bg); color: var(--success); }
.stat-trend.down { background: var(--tag-error-bg); color: var(--danger); }
.icon-blue { background: linear-gradient(135deg, #38bdf8, #0ea5e9); }
.icon-purple { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.icon-green { background: linear-gradient(135deg, #4ade80, #16a34a); }
.icon-orange { background: linear-gradient(135deg, #fb923c, #ea580c); }
.icon-red { background: linear-gradient(135deg, #f87171, #dc2626); }
.icon-cyan { background: linear-gradient(135deg, #2dd4bf, #0d9488); }
.dashboard-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.dashboard-card-full { grid-column: 1 / -1; }
.range-switch { display: inline-flex; gap: 4px; }
.range-switch button { background: var(--bg-input); border: 1px solid var(--border-color); color: var(--text-muted); font-size: 12px; padding: 4px 10px; border-radius: 6px; cursor: pointer; transition: all .15s; }
.range-switch button:hover { color: var(--text); border-color: var(--accent); }
.range-switch button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.dashboard-row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
/* minmax(0,1fr)：列宽严格均分，避免某一列被内容撑宽导致上下两排的列边界对不齐 */
.dashboard-row-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.panel-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; min-width: 0; }
.panel-header { padding: 14px 18px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; justify-content: space-between; }
.panel-header h3 { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.panel-header h3 svg { width: 18px; height: 18px; stroke: var(--accent); fill: none; stroke-width: 2; }
.panel-body { padding: 16px 18px; position: relative; }
/* 面板取数中的加载遮罩：与大屏同款圆环 + 文字，用卡片底色盖住旧内容（只在用户切换时间档位时出现） */
.panel-loading { position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: var(--bg-card); border-radius: 0 0 12px 12px; }
.panel-loading .dp-spinner { width: 36px; height: 36px; flex-shrink: 0; border: 3px solid rgba(47, 107, 255, 0.15); border-top-color: #2f6bff; border-radius: 50%; animation: dp-spin 0.8s linear infinite; }
.panel-loading .dp-loading-text { color: #64748b; font-size: 13px; line-height: 1.6; }
/* 词云卡片：flex 列布局，panel-body 吃满剩余高度。舞台铺满面板、内部画布按实际尺寸自适应，形状贴边 */
.wordcloud-card { display: flex; flex-direction: column; }
.wordcloud-card .panel-header { gap: 6px; flex-wrap: wrap; }
.wordcloud-card .wordcloud-body { flex: 1; padding: 0; min-height: 240px; position: relative; overflow: hidden; }
.wordcloud-card .wc-stage { position: absolute; top: 0; left: 0; right: 0; bottom: 0; }
.wordcloud-card .wc-stage canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
/* 词云形状切换按钮（复用 range-switch 风格） */
.wc-shapes { display: inline-flex; gap: 3px; align-items: center; background: #f0f3f8; padding: 2px; border-radius: 8px; }
.wc-shapes button { font-size: 11px; font-weight: 500; padding: 3px 8px; border-radius: 6px; cursor: pointer; border: none; background: transparent; color: #5b6678; transition: all .15s; line-height: 1.4; white-space: nowrap; font-family: inherit; }
.wc-shapes button:hover { color: #2f6bff; }
.wc-shapes button.active { background: #fff; color: #2f6bff; box-shadow: 0 1px 4px rgba(20,35,70,.12); }
.sentiment-container { display: flex; align-items: center; gap: 24px; }
.sentiment-donut { width: 140px; height: 140px; flex-shrink: 0; position: relative; }
.sentiment-donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.sentiment-donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.sentiment-donut-center .num { font-size: 22px; font-weight: 700; line-height: 1; }
.sentiment-donut-center .label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.sentiment-legend { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.sentiment-item { display: flex; align-items: center; gap: 10px; }
.sentiment-item .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.sentiment-item .dot.pos { background: var(--success); }
.sentiment-item .dot.neg { background: var(--danger); }
.sentiment-item .dot.neu { background: var(--text-muted); }
.sentiment-item .info { flex: 1; display: flex; justify-content: space-between; font-size: 13px; }
.sentiment-item .info .label { color: var(--text-secondary); }
.sentiment-item .info .val { font-weight: 500; }
.sentiment-item .bar-track { width: 100%; height: 4px; background: var(--bg-input); border-radius: 2px; overflow: hidden; }
.sentiment-item .bar-fill { height: 100%; border-radius: 2px; transition: width 0.6s ease; }
.site-list, .subject-list { display: flex; flex-direction: column; gap: 8px; }
.site-item, .subject-item { display: flex; align-items: center; gap: 10px; }
/* 舆情热点的表头行（从大屏移植过来，列与下方 .site-item 对齐；列表滚动时表头吸顶） */
.hot-head { display: flex; align-items: center; gap: 10px; padding: 0 0 6px; margin-bottom: 4px;
  font-size: 12px; color: var(--text-muted); border-bottom: 1px solid var(--border-color);
  position: sticky; top: 0; z-index: 2; background: var(--bg-card); }
.hot-head .hh-rank { flex: 0 0 22px; width: 22px; text-align: center; }
.hot-head .hh-name { flex: 1 1 auto; min-width: 0; }
.hot-head .hh-num { flex: 0 0 56px; width: 56px; text-align: right; }
.site-item .rank, .subject-item .rank { width: 22px; height: 22px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; flex-shrink: 0; }
.rank-1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #1e293b; }
.rank-2 { background: linear-gradient(135deg, #94a3b8, #64748b); color: white; }
.rank-3 { background: linear-gradient(135deg, #d97706, #b45309); color: white; }
.rank-other { background: var(--bg-input); color: var(--text-muted); }
.site-item .name, .subject-item .name { flex: 0 0 110px; width: 110px; font-size: 13px; color: #1f2937; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-item .count, .subject-item .count { flex: 0 0 70px; width: 70px; font-size: 13px; font-weight: 500; color: #1f2937; text-align: right; }
.site-item .bar-track, .subject-item .bar-track { flex: 1; width: auto; min-width: 40px; height: 4px; background: var(--bg-input); border-radius: 2px; overflow: hidden; }
.site-item .bar-fill, .subject-item .bar-fill { height: 100%; border-radius: 2px; background: linear-gradient(90deg, #f59e0b, #ef4444); transition: width 0.6s ease; }
.category-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.category-tag { padding: 6px 14px; border-radius: 8px; font-size: 13px; transition: all 0.2s; cursor: default; display: flex; align-items: center; gap: 6px; }
.category-tag:hover { transform: scale(1.05); }
.category-tag .cat-count { font-size: 11px; opacity: 0.7; }
.article-list { display: flex; flex-direction: column; }
.article-item { padding: 12px 0; border-bottom: 1px solid var(--border-color); transition: background 0.2s; }
.article-item:last-child { border-bottom: none; }
.article-item:hover { background: var(--hover-bg); }
.article-item .article-title { font-size: 13px; font-weight: 500; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.article-item .article-title a { color: var(--text-primary); text-decoration: none; }
.article-item .article-title a:hover { color: var(--accent); }
.article-item .article-meta { display: flex; align-items: center; gap: 12px; font-size: 11px; color: var(--text-muted); }
.article-item .article-summary { font-size: 12px; color: var(--text-secondary); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.loading-shimmer { background: linear-gradient(90deg, var(--bg-input) 25%, var(--bg-card) 50%, var(--bg-input) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 6px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.loading-shimmer.h20 { height: 20px; margin-bottom: 8px; }
.loading-shimmer.h40 { height: 40px; margin-bottom: 8px; }
.loading-shimmer.h60 { height: 60px; margin-bottom: 8px; }
.loading-shimmer.w60 { width: 60%; }
.loading-shimmer.w80 { width: 80%; }
.loading-shimmer.w90 { width: 90%; }
.error-state { text-align: center; padding: 32px; color: var(--text-muted); }
.error-state p { font-size: 14px; }

.overview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.overview-item { text-align: center; padding: 8px; }
.overview-item .ov-num { font-size: 20px; font-weight: 700; }
.overview-item .ov-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
@media (max-width: 1200px) {
html:not([data-fit]) .stats-grid { grid-template-columns: repeat(3, 1fr); }
html:not([data-fit]) .dashboard-row { grid-template-columns: 1fr; }
html:not([data-fit]) .dashboard-row-3 { grid-template-columns: 1fr; }
html:not([data-fit]) .dashboard-row-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
html:not([data-fit]) .stats-grid { grid-template-columns: repeat(2, 1fr); }
html:not([data-fit]) .dashboard-row-4 { grid-template-columns: 1fr 1fr; }
html:not([data-fit]) .sentiment-container { flex-direction: column; }
html:not([data-fit]) .sentiment-donut { width: 120px; height: 120px; }
}
@media (max-width: 480px) {
html:not([data-fit]) .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
html:not([data-fit]) .stat-card-dash { padding: 12px 10px; }
html:not([data-fit]) .stat-card-dash .stat-num { font-size: 20px; }
}

/* ===== 话题库动态（第一行右侧，时间线卡片块） ===== */
.tl-timeline {
    position: relative;
    max-height: 340px;
    overflow-y: auto;
    padding: 2px 14px 2px 8px;   /* 右侧留出空间，避免 hover/滚动条遮挡 */
    scrollbar-gutter: stable;
}

.tl-timeline::-webkit-scrollbar { width: 6px; }
.tl-timeline::-webkit-scrollbar-track { background: transparent; }
.tl-timeline::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }

.tl-item {
    position: relative;
    padding: 0 0 12px 18px;
    margin-left: 8px;
    border-left: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
}

.tl-item:last-child { border-left-color: transparent; }

.tl-dot {
    position: absolute;
    left: -7px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--bg-card);
    box-shadow: 0 0 0 1px var(--border-color);
}

.tl-card {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 12px;
    transition: all 0.2s;
}

.tl-item:hover .tl-card {
    border-color: var(--accent);
    background: var(--bg-nav-hover);
}

.tl-card-head {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 5px;
}

.tl-time { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* 徽章通用：与时间筛选条同风格的灰底小圆角（语义用文字色区分，不再用彩色底） */
.tl-badge {
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.2px;
    background: #f0f3f8;
    color: #475569;
    border: 1px solid #e2e8f0;
}

/* 相关度徽章（区分度：强=红字 中=橙字，底色统一灰） */
.tl-badge-rel {
    background: #f0f3f8;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

/* 情感徽章（底色统一灰，文字色由内联语义色控制） */
.tl-badge-senti {
    background: #f0f3f8;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.tl-title {
    font-size: 12.5px;
    color: var(--text-primary);
    line-height: 1.5;
    font-weight: 500;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* AI 摘要：次级文字，两行截断 */
.tl-summary {
    margin-top: 5px;
    font-size: 11.5px;
    color: var(--text-secondary);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding: 6px 8px;
    background: rgba(148, 163, 184, 0.06);
    border-left: 2px solid var(--border-color);
    border-radius: 0 6px 6px 0;
}

.tl-meta { margin-top: 4px; font-size: 11px; color: var(--text-muted); }

.tl-meta-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 5px;
    font-size: 11px;
    color: var(--text-muted);
}

/* AI 智能标签：与筛选条同风格的灰底小圆角，分类用文字色区分，hover 加深 */
.tl-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 7px;
}

.tl-tag {
    font-size: 10.5px;
    font-weight: 500;
    line-height: 1;
    padding: 3px 9px;
    border-radius: 6px;
    background: #f0f3f8;
    color: #475569;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
    transition: all 0.15s;
}

.tl-tag:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

/* 按标签分类以文字色区分：信息分类=蓝、所属企业=紫、所属领域=青、所属业务=橙 */
.tl-tag[data-cat="所属企业"] { color: #6d28d9; }
.tl-tag[data-cat="所属领域"] { color: #0f766e; }
.tl-tag[data-cat="所属业务"] { color: #b45309; }
.tl-tag[data-cat="信息分类"] { color: #0369a1; }

/* ===== 舆情热点：可点击 + 话题详情弹窗（内容复用 /TopicLibrary 的右侧详情） ===== */
.site-item.hot-clickable { cursor: pointer; }
.site-item.hot-clickable:hover { background: var(--bg-input); }
.hot-detail-overlay {
    position: fixed; inset: 0; z-index: 900; background: rgba(15, 23, 42, .45);
    display: flex; align-items: center; justify-content: center; padding: 24px;
    opacity: 0; pointer-events: none; transition: opacity .2s;
}
.hot-detail-overlay.show { opacity: 1; pointer-events: auto; }
.hot-detail-box {
    width: 780px; max-width: 96vw; height: 88vh; background: #f3f5f9;
    border-radius: 14px; box-shadow: 0 20px 60px rgba(15, 23, 42, .28);
    display: flex; flex-direction: column; overflow: hidden;
}
.hot-detail-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--border-color); flex-shrink: 0;
}
.hot-detail-head .hot-detail-title { font-size: 14px; font-weight: 600; color: var(--text); }
.hot-detail-close {
    width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border-color);
    background: #fff; color: var(--text-muted); cursor: pointer; font-size: 14px;
    display: flex; align-items: center; justify-content: center; transition: all .15s;
}
.hot-detail-close:hover { color: var(--text); border-color: var(--accent); }
.hot-detail-frame { flex: 1; width: 100%; border: 0; background: #f3f5f9; display: block; }
