/* 店铺数据分析视图 */
.data-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.data-view.hidden {
    display: none;
}

/* 顶部工具栏 */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
}

/* 显示数值总开关 */
.chart-value-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    user-select: none;
}

.chart-value-switch[hidden] {
    display: none;
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch .slider {
    position: absolute;
    inset: 0;
    background: #cfd3e6;
    border-radius: 22px;
    transition: background 0.2s ease;
}

.switch .slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.switch input:checked + .slider {
    background: #667eea;
}

.switch input:checked + .slider::before {
    transform: translateX(18px);
}

.btn-import {
    padding: 8px 24px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.25s ease;
}

.btn-import:hover {
    background: #5a6fd6;
}

.btn-import:active {
    background: #4e60c2;
}

/* 内容区 */
.content-area {
    flex: 1;
    min-height: 0;
    background: #f5f6fa;
    padding: 24px;
    overflow: auto;
    display: flex;
    flex-direction: column;
}

/* 导入提示 */
.import-hint {
    color: #999;
    font-size: 14px;
    text-align: center;
    margin-top: 120px;
    line-height: 1.8;
}

.import-hint[hidden] {
    display: none;
}

.daily-meta {
    padding: 12px 16px;
    font-size: 13px;
    color: #666;
    border-bottom: 1px solid #eee;
}

/* 曲线图区 */
.charts-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: auto;
}

.charts-wrap[hidden] {
    display: none;
}

.charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 24px;
}

/* 指标分组标题 */
.chart-group {
    display: contents;
}

.chart-group-body {
    display: contents;
}

.chart-group-body[hidden] {
    display: none;
}

.chart-group-title {
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-group-title.collapsible-title:hover {
    color: #fff; /* 避免通用 hover 变色导致文字与背景同色不可见 */
    background: linear-gradient(90deg, #5a6fd6 0%, #6a4393 100%);
}

.chart-group-title .collapse-arrow {
    color: rgba(255, 255, 255, 0.85);
}

/* 子分组标题（如：曝光触达 / 点击引入 / 详情浏览） */
.chart-subgroup {
    display: contents;
}

.chart-subgroup-title {
    padding: 10px 18px 10px 32px;
    font-size: 14px;
    font-weight: 600;
    color: #444;
    background: #eef0f9;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-subgroup-title.collapsible-title:hover {
    color: #667eea;
}

/* 子分组内的指标卡片稍作缩进，体现层级 */
.chart-subgroup .chart-card {
    margin-left: 28px;
}

.chart-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.chart-card-title {
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #444;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    line-height: 1.5;
}

/* 可折叠标题：点击展开/收起曲线图 */
.collapsible-title {
    cursor: pointer;
}

.collapsible-title:hover {
    color: #667eea;
}

.collapse-arrow {
    font-size: 12px;
    color: #999;
    display: inline-block;
    transition: transform 0.2s ease;
}

.collapsible-title.open .collapse-arrow {
    transform: rotate(90deg);
}

.chart-body[hidden] {
    display: none;
}

/* 标题上的指标含义（加粗） */
.metric-desc-title {
    font-weight: 700;
    color: #333;
}

.chart-canvas-wrap {
    position: relative;
    height: 220px;
    padding: 12px;
}

/* 滚动条：曲线图区域 */
.charts-wrap::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.charts-wrap::-webkit-scrollbar-thumb {
    background: #c3c9e2;
    border-radius: 5px;
}

.charts-wrap::-webkit-scrollbar-thumb:hover {
    background: #a9b2d6;
}

.charts-wrap::-webkit-scrollbar-track {
    background: transparent;
}
