/* ============================================================
   图表画廊 - 总览页（大类卡片）样式
   依赖 base.css 中的 CSS 变量
   ============================================================ */

/* ---------- 页面容器 ---------- */
.cgi-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 1.5rem 4rem;
}

/* ---------- Hero 卡片包装层 ---------- */
.cgi-hero-wrap {
    max-width: 1400px;
    margin: 1.5rem auto 0;
    padding: 0 1.5rem;
}

/* ---------- Hero 卡片 ---------- */
.cgi-hero {
    background: linear-gradient(
        135deg,
        var(--hero-sky-from,  #0ea5e9) 0%,
        var(--hero-sky-via,   #3a84f0) 55%,
        var(--hero-sky-to,    #6366f1) 100%
    );
    border-radius: 16px;
    padding: 2.25rem 2rem 2rem;
    text-align: center;
    overflow: hidden;
}

.cgi-hero-inner {
    max-width: 720px;
    margin: 0 auto;
}

.cgi-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.75);
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 99px;
    padding: 4px 14px;
    margin-bottom: 1.1rem;
}

.cgi-hero-title {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.75rem;
    line-height: 1.3;
}

.cgi-hero-sub {
    font-size: 1rem;
    color: rgba(255,255,255,0.82);
    line-height: 1.7;
    margin: 0 auto 1.75rem;
    max-width: 560px;
}

/* 统计数字行 */
.cgi-hero-stats {
    display: inline-flex;
    align-items: center;
    gap: 0;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 0.6rem 1.5rem;
    backdrop-filter: blur(4px);
}

.cgi-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 1.25rem;
}

.cgi-stat-num {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
}

.cgi-stat-label {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.7);
    margin-top: 2px;
}

.cgi-stat-sep {
    width: 1px;
    height: 2.2rem;
    background: rgba(255,255,255,0.25);
    flex-shrink: 0;
}

/* ---------- 卡片网格 ---------- */
.cgi-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.1rem;
}

/* ---------- 单张卡片 ---------- */
.cgi-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--radius-lg, 12px);
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.18s, border-color 0.18s, transform 0.18s;
    cursor: pointer;
}

.cgi-card:hover {
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.1);
    border-color: var(--primary, #6366f1);
    transform: translateY(-2px);
}

/* 图标区 */
.cgi-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md, 8px);
    background: linear-gradient(135deg, var(--hero-indigo-from, #6366f1), var(--hero-indigo-to, #8b5cf6));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    flex-shrink: 0;
}

.cgi-icon--sky    { background: linear-gradient(135deg, var(--hero-sky-from,    #0ea5e9), var(--hero-sky-to,    #6366f1)); }
.cgi-icon--indigo { background: linear-gradient(135deg, var(--hero-indigo-from, #667eea), var(--hero-indigo-to, #764ba2)); }
.cgi-icon--purple { background: linear-gradient(135deg, var(--hero-purple-from, #6366f1), var(--hero-purple-to, #a855f7)); }
.cgi-icon--green  { background: linear-gradient(135deg, var(--hero-green-from,  #11998e), var(--hero-green-to,  #38ef7d)); }
.cgi-icon--teal   { background: linear-gradient(135deg, var(--hero-teal-from,   #34d399), var(--hero-teal-to,   #06b6d4)); }
.cgi-icon--orange { background: linear-gradient(135deg, var(--hero-orange-from, #f59e0b), var(--hero-orange-to, #ef4444)); }

.cgi-card-icon i {
    font-size: 1.4rem;
    color: #fff;
}

/* 文字区 */
.cgi-card-body {
    flex: 1;
    margin-bottom: 1rem;
}

.cgi-card-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary, #111827);
    margin-bottom: 0.35rem;
}

.cgi-card-desc {
    font-size: 0.85rem;
    color: var(--text-muted, #6b7280);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 底部：数量 + 箭头 */
.cgi-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color, #e5e7eb);
}

.cgi-card-count {
    font-size: 0.82rem;
    color: var(--text-muted, #6b7280);
    background: var(--bg-secondary, #f3f4f6);
    padding: 0.2rem 0.65rem;
    border-radius: 99px;
}

.cgi-card-arrow {
    font-size: 1rem;
    color: var(--primary, #6366f1);
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.18s, transform 0.18s;
}

.cgi-card:hover .cgi-card-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* 空状态 */
.cgi-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-muted, #6b7280);
    padding: 3rem 0;
    font-size: 0.9rem;
}

/* ---------- 面包屑（复用 chart_gallery.css 变量） ---------- */
.cg-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    font-size: 0.82rem;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    background: var(--bg-secondary, #f9fafb);
    flex-shrink: 0;
}

.cg-breadcrumb-link {
    color: var(--primary, #6366f1);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 500;
}

.cg-breadcrumb-link:hover {
    text-decoration: underline;
}

.cg-breadcrumb-sep {
    color: var(--text-muted, #9ca3af);
    font-size: 1rem;
}

.cg-breadcrumb-cur {
    color: var(--text-secondary, #374151);
    font-weight: 500;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1200px) {
    .cgi-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 900px) {
    .cgi-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
    .cgi-hero-wrap { padding: 0 1rem; margin-top: 1rem; }
    .cgi-hero { border-radius: 12px; padding: 1.75rem 1.25rem 1.5rem; }
    .cgi-hero-title { font-size: 1.5rem; }
    .cgi-hero-stats { padding: 0.5rem 0.75rem; }
    .cgi-stat { padding: 0 0.75rem; }
    .cgi-stat-num { font-size: 1.1rem; }
    .cgi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 400px) {
    .cgi-grid { grid-template-columns: 1fr; }
}
