/* ===== 数据分析样式 ===== */
.analytics-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.2rem;
}

.chart-card h3 {
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
}

/* 热力图 */
.heatmap {
    overflow-x: auto;
}

.heatmap-cell {
    aspect-ratio: 1;
    border-radius: 2px;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    min-width: 16px;
}

.heatmap-cell:active {
    transform: scale(1.5);
    z-index: 1;
}

.heatmap-cell[data-level="0"] { background: var(--bg); border: 1px solid var(--border); }
.heatmap-cell[data-level="1"] { background: rgba(108, 92, 231, 0.2); }
.heatmap-cell[data-level="2"] { background: rgba(108, 92, 231, 0.4); }
.heatmap-cell[data-level="3"] { background: rgba(108, 92, 231, 0.6); }
.heatmap-cell[data-level="4"] { background: rgba(108, 92, 231, 0.8); }
.heatmap-cell[data-level="5"] { background: var(--primary); }

.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.8rem;
    font-size: 0.65rem;
    color: var(--text-muted);
}

.heatmap-legend-cell {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

.heatmap-labels {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 4px;
    margin-bottom: 0.4rem;
}

.heatmap-label {
    font-size: 0.55rem;
    color: var(--text-muted);
    text-align: center;
}

/* 成长曲线 */
#growth-chart {
    width: 100%;
    height: auto;
    max-height: 250px;
}

/* 完成率环形图 */
.completion-ring {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem;
}

.completion-ring svg {
    width: 150px;
    height: 150px;
}

.ring-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 12;
}

.ring-fill {
    fill: none;
    stroke: var(--primary);
    stroke-width: 12;
    stroke-linecap: round;
    stroke-dasharray: 502.65;
    stroke-dashoffset: 502.65;
    transform: rotate(-90deg);
    transform-origin: center;
    transition: stroke-dashoffset 1.5s ease;
}

.ring-text {
    fill: var(--text);
    font-size: 2rem;
    font-weight: 700;
    text-anchor: middle;
    dominant-baseline: middle;
}

/* AI建议 */
.ai-suggestions {
    min-height: 80px;
    margin-bottom: 0.8rem;
}

.ai-placeholder {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.85rem;
}

.ai-suggestion-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.8rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    line-height: 1.5;
    border-left: 3px solid var(--secondary);
}

.ai-suggestion-item .suggestion-type {
    font-size: 0.65rem;
    color: var(--secondary);
    text-transform: uppercase;
    margin-bottom: 0.2rem;
    font-weight: 600;
}

/* ===== 桌面端 ===== */
@media (min-width: 769px) {
    .analytics-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .ai-card {
        grid-column: span 2;
    }

    .completion-ring svg {
        width: 180px;
        height: 180px;
    }

    .heatmap-cell:hover {
        transform: scale(1.3);
        z-index: 1;
    }
}

@media (max-width: 768px) {
    .heatmap-labels {
        grid-template-columns: repeat(6, 1fr);
    }
}
