/* ============================================
   图表使用指南（对齐帮助 Hub 风格）
   ============================================ */

.cg-page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
}

.cg-back {
    margin: 1.25rem 0 0;
}

.cg-back a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.18s;
}

.cg-back a:hover {
    color: var(--action-color);
}

.cg-section-intro {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.7;
}

/* ── 图表快览横向 chips ── */
.cg-overview-scroll {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 2px 12px;
    margin-bottom: 1rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.cg-overview-chip {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-card);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: border-color 0.18s, color 0.18s, background 0.18s, box-shadow 0.18s;
    white-space: nowrap;
    font-family: inherit;
}

.cg-overview-chip:hover {
    border-color: var(--action-color);
    color: var(--action-color);
    background: var(--action-light);
}

.cg-overview-chip.ov-active {
    border-color: var(--action-color);
    background: var(--action-color);
    color: #fff;
    box-shadow: 0 2px 8px rgba(var(--action-rgb), 0.22);
}

/* ── 场景筛选 ── */
.cg-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 0 1rem;
    align-items: center;
}

.cg-filter-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 4px;
    white-space: nowrap;
}

.cg-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 16px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    background: var(--bg-card);
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.18s;
    font-weight: 500;
    font-family: inherit;
}

.cg-filter-btn:hover {
    border-color: var(--action-color);
    color: var(--action-color);
    background: var(--action-light);
}

.cg-filter-btn.active {
    border-color: var(--action-color);
    background: var(--action-color);
    color: #fff;
    box-shadow: 0 2px 8px rgba(var(--action-rgb), 0.22);
}

/* ── 图表卡片网格 ── */
.cg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.cg-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.cg-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.cg-card[data-hidden="1"] {
    display: none;
}

.cg-chart-area {
    height: 200px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
}

.cg-chart-canvas {
    width: 100%;
    height: 100%;
}

.cg-card-body {
    padding: 16px;
}

.cg-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 8px;
}

.cg-card-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    flex-shrink: 0;
}

.cg-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.cg-tag-trend   { background: var(--action-light); color: var(--action-dark); }
.cg-tag-compose { background: #fce7f3; color: #9d174d; }
.cg-tag-compare { background: var(--accent-mint-light); color: var(--accent-mint-dark); }
.cg-tag-dist    { background: var(--color-warning-light); color: var(--color-warning-dark); }
.cg-tag-funnel  { background: #ede9fe; color: #5b21b6; }
.cg-tag-user    { background: #e0f2fe; color: #0369a1; }

.cg-scene {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 10px;
}

.cg-tip {
    font-size: 0.82rem;
    color: var(--action-dark);
    background: var(--action-light);
    border-left: 3px solid var(--action-color);
    border-radius: 0 6px 6px 0;
    margin-bottom: 14px;
    line-height: 1.55;
}

.cg-tip-collapsible {
    padding: 0;
    overflow: hidden;
    border-radius: 0 6px 6px 0;
}

.cg-tip-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 10px;
    font-size: 0.82rem;
    color: var(--action-color);
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-weight: 500;
    font-family: inherit;
}

.cg-tip-toggle:hover {
    background: rgba(var(--action-rgb), 0.06);
}

.cg-tip-arrow {
    margin-left: auto;
    transition: transform 0.22s;
    font-size: 1rem;
}

.cg-tip-body {
    display: none;
    padding: 0 10px 7px 26px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.cg-tip-body.is-open {
    display: block;
}

.cg-goto-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 18px;
    background: var(--action-color);
    color: #fff;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.18s, transform 0.12s, box-shadow 0.18s;
    box-shadow: 0 2px 8px rgba(var(--action-rgb), 0.2);
}

.cg-goto-btn:hover {
    background: var(--action-hover);
    color: #fff;
    text-decoration: none;
    transform: translateX(2px);
}

@keyframes cgCardPulse {
    0%   { box-shadow: 0 0 0 0 rgba(var(--action-rgb), 0.45); }
    70%  { box-shadow: 0 0 0 10px rgba(var(--action-rgb), 0); }
    100% { box-shadow: 0 0 0 0 rgba(var(--action-rgb), 0); }
}

.cg-card-highlight {
    animation: cgCardPulse 1.2s ease-out;
}

/* ── 底部快捷入口 ── */
.cg-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem 1.25rem;
    margin-top: 2rem;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--bg-muted);
}

.cg-footer-links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    text-decoration: none;
}

.cg-footer-links a:hover {
    color: var(--action-color);
}

.cg-footer-links a i {
    color: var(--action-color);
}

@media (max-width: 768px) {
    .cg-page {
        padding: 0 1rem 2.5rem;
    }

    .cg-grid {
        grid-template-columns: 1fr;
    }

    .cg-filter-bar {
        gap: 6px;
    }

    .cg-filter-btn {
        font-size: 0.82rem;
        padding: 5px 12px;
    }
}
