/* static/admin/stats.css —— 统计页（第 30、31 项）纯 CSS/SVG 图表样式 */

.stats-days {
    display: flex;
    gap: 6px;
}
.stats-days .settings-option-btn {
    padding: 5px 12px;
    font-size: 0.76rem;
}
.stats-days .settings-option-btn.active::after {
    content: '';
    margin: 0;
}

.panel {
    max-width: 1200px;
    margin: 0 auto 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 18px;
    animation: riseIn 0.4s ease backwards;
}
.panel-row {
    display: flex;
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto 16px;
}
.panel-row .panel {
    flex: 1;
    margin: 0;
    min-width: 0;
}
@media (max-width: 768px) {
    .panel-row { flex-direction: column; }
}
.panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}
.panel-title i {
    color: var(--text-secondary);
}
.panel-hint {
    font-size: 0.7rem;
    font-weight: 400;
    color: var(--text-tertiary);
    margin-left: 6px;
}
.panel-empty {
    color: var(--text-tertiary);
    font-size: 0.82rem;
    text-align: center;
    padding: 22px 0;
}

/* ---------- 每日消息量柱状图 ---------- */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 160px;
    overflow-x: auto;
    padding-bottom: 18px;
    position: relative;
}
.bar-col {
    flex: 0 0 22px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    position: relative;
}
.bar-fill {
    width: 100%;
    min-height: 2px;
    background: var(--text-secondary);
    border-radius: 3px 3px 0 0;
    transition: height 0.4s ease;
}
.bar-col:hover .bar-fill {
    background: var(--text-primary);
}
.bar-label {
    position: absolute;
    bottom: -16px;
    font-size: 0.6rem;
    color: var(--text-tertiary);
    white-space: nowrap;
}

/* ---------- 情绪趋势（堆叠柱） ---------- */
.emotion-legend {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.emotion-legend .legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    color: var(--text-secondary);
}
.emotion-legend .legend-item i {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    display: inline-block;
}
.emotion-chart {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    height: 150px;
    overflow-x: auto;
}
.stack-col {
    flex: 0 0 20px;
    display: flex;
    flex-direction: column-reverse;
    border-radius: 3px;
    overflow: hidden;
    min-height: 6px;
    background: var(--hover-bg);
    transition: opacity var(--transition-fast);
}
.stack-col:hover {
    opacity: 0.8;
}
.stack-col .seg {
    width: 100%;
}

/* ---------- 横向条形（情绪分布 / 各角色消息量） ---------- */
.dist-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.dist-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
}
.dist-label {
    flex: 0 0 96px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dist-bar-wrap {
    flex: 1;
    min-width: 0;
    height: 10px;
    background: var(--hover-bg);
    border-radius: 999px;
    overflow: hidden;
}
.dist-bar {
    display: block;
    height: 100%;
    border-radius: 999px;
    transition: width 0.4s ease;
}
.dist-value {
    flex: 0 0 44px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
    font-weight: 600;
}

/* ---------- 活跃时段热力图 ---------- */
.hourly-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 5px;
}
.hour-cell {
    position: relative;
    height: 34px;
    border-radius: 6px;
    background: var(--hover-bg);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
}
.hour-cell i {
    position: absolute;
    inset: 0;
    background: var(--text-primary);
    transition: opacity 0.4s ease;
}
.hour-cell span {
    position: relative;
    font-size: 0.6rem;
    color: var(--text-secondary);
    padding-bottom: 2px;
}
