/* ============================================================
   EX-01 集团财务分析驾驶舱 · 战略决策域
   在 finance.css 基础上增强 executive 层级信息架构
   ============================================================ */

.ex01-page {
    padding-top: clamp(12px, 1.5vw, 24px);
}

.ex01-page .container {
    max-width: 1720px;
}

/* —— 页头 Hero —— */
.ex01-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: var(--eh-space-4);
    padding: var(--eh-space-5) var(--eh-space-5) var(--eh-space-4);
    margin-bottom: var(--eh-space-4);
    background: linear-gradient(135deg, var(--eh-bg-subtle) 0%, var(--eh-surface-solid) 55%, rgba(37, 99, 235, 0.04) 100%);
    border: 1px solid var(--eh-border);
    border-radius: var(--eh-radius-xl);
    box-shadow: var(--eh-shadow-xs);
}

.ex01-hero-main {
    flex: 1;
    min-width: 280px;
}

.ex01-hero .ex01-code {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--eh-text-xs);
    font-weight: 700;
    font-family: var(--eh-font-mono);
    color: var(--eh-brand);
    background: var(--eh-brand-subtle);
    border: 1px solid var(--eh-border-brand);
    border-radius: var(--eh-radius-sm);
    padding: 3px 10px;
    margin-bottom: 10px;
}

.ex01-hero .title {
    font-size: clamp(1.35rem, 2.2vw, 1.75rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.25;
    color: var(--eh-text-primary);
}

.ex01-hero .title .highlight {
    color: var(--eh-brand);
}

.ex01-hero .sub {
    margin-top: 8px;
    font-size: var(--eh-text-sm);
    color: var(--eh-text-secondary);
    max-width: 52rem;
    line-height: 1.55;
}

.ex01-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--eh-space-2);
    margin-top: 12px;
}

.ex01-hero-meta .meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--eh-text-xs);
    font-weight: 600;
    color: var(--eh-text-muted);
    background: var(--eh-surface-solid);
    border: 1px solid var(--eh-border);
    border-radius: var(--eh-radius-full);
    padding: 4px 12px;
}

.ex01-hero-meta .meta-chip i {
    color: var(--eh-brand-light);
    font-size: 10px;
}

.ex01-hero-meta .meta-chip.live {
    color: var(--eh-success);
    background: var(--eh-success-muted);
    border-color: rgba(21, 128, 61, 0.2);
}

.ex01-hero-meta .meta-chip.live .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--eh-success);
    animation: ex01-pulse 2s ease infinite;
}

@keyframes ex01-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

.ex01-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--eh-space-2);
    align-items: flex-start;
}

.ex01-hero-actions .btn,
.ex01-hero-actions a.btn {
    background: var(--eh-brand-subtle);
    border: 1px solid var(--eh-border);
    border-radius: var(--eh-radius-md);
    padding: 8px 16px;
    font-size: var(--eh-text-sm);
    color: var(--eh-text-secondary);
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all var(--eh-duration);
}

.ex01-hero-actions .btn:hover,
.ex01-hero-actions a.btn:hover {
    background: var(--eh-brand-muted);
    border-color: var(--eh-border-brand);
    color: var(--eh-brand-light);
}

.ex01-hero-actions .btn-primary {
    background: var(--eh-brand);
    border-color: var(--eh-brand);
    color: var(--eh-text-inverse);
}

.ex01-hero-actions .btn-primary:hover {
    background: var(--eh-brand-dark);
    border-color: var(--eh-brand-dark);
    color: var(--eh-text-inverse);
}

.ex01-hero-actions a.hub-link {
    background: var(--eh-brand-subtle);
    border-color: var(--eh-border-brand);
    color: var(--eh-brand);
}

/* —— 工具栏 —— */
.ex01-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--eh-space-3);
    margin-bottom: var(--eh-space-4);
    padding: var(--eh-space-3) var(--eh-space-4);
    background: var(--eh-surface-solid);
    border: 1px solid var(--eh-border);
    border-radius: var(--eh-radius-lg);
}

.ex01-toolbar label {
    font-size: var(--eh-text-xs);
    font-weight: 600;
    color: var(--eh-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ex01-toolbar select {
    background: var(--eh-bg-subtle);
    border: 1px solid var(--eh-border);
    border-radius: var(--eh-radius-md);
    padding: 7px 12px;
    font-size: var(--eh-text-sm);
    color: var(--eh-text-primary);
    font-family: inherit;
    font-weight: 500;
}

.ex01-toolbar .toolbar-spacer {
    flex: 1;
    min-width: 12px;
}

.ex01-toolbar .region-selector {
    margin-bottom: 0;
}

/* —— 决策洞察条 —— */
.ex01-insights {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--eh-space-3);
    margin-bottom: var(--eh-space-4);
}

.ex01-insight {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    background: var(--eh-surface-solid);
    border: 1px solid var(--eh-border);
    border-radius: var(--eh-radius-lg);
    border-left-width: 3px;
    box-shadow: var(--eh-shadow-xs);
}

.ex01-insight.success { border-left-color: var(--eh-success); }
.ex01-insight.warning { border-left-color: var(--eh-warning); }
.ex01-insight.info { border-left-color: var(--eh-brand); }

.ex01-insight .insight-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--eh-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
}

.ex01-insight.success .insight-icon { background: var(--eh-success-muted); color: var(--eh-success); }
.ex01-insight.warning .insight-icon { background: var(--eh-warning-muted); color: var(--eh-warning); }
.ex01-insight.info .insight-icon { background: var(--eh-brand-muted); color: var(--eh-brand); }

.ex01-insight .insight-title {
    font-size: var(--eh-text-sm);
    font-weight: 700;
    color: var(--eh-text-primary);
    margin-bottom: 2px;
}

.ex01-insight .insight-desc {
    font-size: var(--eh-text-xs);
    color: var(--eh-text-muted);
    line-height: 1.5;
}

.ex01-insight .insight-val {
    font-family: var(--eh-font-mono);
    font-weight: 700;
    color: var(--eh-text-primary);
}

/* —— KPI 增强 —— */
.ex01-page .stat-card {
    text-align: left;
    position: relative;
    padding-top: 16px;
    padding-left: 16px;
}

.ex01-page .stat-card .kpi-icon {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border-radius: var(--eh-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    background: var(--eh-brand-subtle);
    color: var(--eh-brand);
}

.ex01-page .stat-card .num {
    text-align: left;
}

.ex01-page .stat-card .label {
    text-align: left;
}

/* —— 分区 Tab（sticky）—— */
.ex01-page .ex01-tabs-wrap {
    position: sticky;
    top: calc(var(--nav-height, 52px) + 4px);
    z-index: 40;
    background: var(--eh-bg-base);
    padding: 4px 0 var(--eh-space-2);
    margin-bottom: var(--eh-space-3);
}

.ex01-page .tabs {
    margin-bottom: 0;
    background: var(--eh-surface-solid);
    border: 1px solid var(--eh-border);
    border-radius: var(--eh-radius-lg);
    padding: 6px;
    gap: 4px;
    border-bottom: none;
}

.ex01-page .tabs button {
    border-radius: var(--eh-radius-md);
    padding: 8px 16px;
}

.ex01-page .tabs button.active {
    border-bottom: none;
    box-shadow: var(--eh-shadow-xs);
}

/* —— 指标行列表 —— */
.ex01-metric-list {
    font-size: var(--eh-text-sm);
}

.ex01-metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--eh-border);
    color: var(--eh-text-secondary);
}

.ex01-metric-row:last-child {
    border-bottom: none;
}

.ex01-metric-row .metric-label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.ex01-metric-row .metric-label i {
    color: var(--eh-text-faint);
    font-size: 11px;
    width: 14px;
    text-align: center;
}

.ex01-metric-row .metric-val {
    font-family: var(--eh-font-mono);
    font-weight: 600;
    color: var(--eh-text-primary);
    white-space: nowrap;
}

.ex01-metric-row .metric-delta {
    font-size: var(--eh-text-xs);
    font-weight: 600;
    white-space: nowrap;
}

.ex01-metric-row .metric-delta.up { color: var(--eh-success); }
.ex01-metric-row .metric-delta.down { color: var(--eh-danger); }
.ex01-metric-row .metric-delta.neutral { color: var(--eh-warning); }

/* —— 高亮摘要块 —— */
.ex01-callout {
    background: var(--eh-bg-subtle);
    border: 1px solid var(--eh-border);
    border-radius: var(--eh-radius-md);
    padding: 14px 16px;
    height: 100%;
}

.ex01-callout.highlight-brand {
    background: var(--eh-brand-subtle);
    border-color: var(--eh-border-brand);
}

.ex01-callout.highlight-success {
    background: var(--eh-success-muted);
    border-color: rgba(21, 128, 61, 0.2);
}

.ex01-callout .callout-title {
    font-size: var(--eh-text-sm);
    font-weight: 700;
    color: var(--eh-text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ex01-callout .callout-body {
    font-size: var(--eh-text-sm);
    color: var(--eh-text-secondary);
    line-height: 1.75;
}

.ex01-callout .callout-body .pos { color: var(--eh-success); font-weight: 600; }
.ex01-callout .callout-body .warn { color: var(--eh-warning); font-weight: 600; }

/* —— 图例 —— */
.ex01-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: var(--eh-text-xs);
    color: var(--eh-text-muted);
    margin-top: 8px;
}

.ex01-chart-legend .legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ex01-chart-legend .swatch {
    width: 10px;
    height: 10px;
    border-radius: 2px;
}

/* —— 能力矩阵 —— */
.ex01-cap-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--eh-space-3);
}

.ex01-cap-item {
    background: var(--eh-bg-subtle);
    border: 1px solid var(--eh-border);
    border-radius: var(--eh-radius-md);
    padding: 12px 14px;
    transition: border-color var(--eh-duration), box-shadow var(--eh-duration);
}

.ex01-cap-item:hover {
    border-color: var(--eh-border-brand);
    box-shadow: var(--eh-shadow-xs);
}

.ex01-cap-item .cap-name {
    font-size: var(--eh-text-sm);
    font-weight: 700;
    color: var(--eh-brand);
    margin-bottom: 4px;
}

.ex01-cap-item .cap-desc {
    font-size: var(--eh-text-xs);
    color: var(--eh-text-muted);
    line-height: 1.5;
}

.ex01-section-foot {
    margin-top: var(--eh-space-3);
    padding-top: var(--eh-space-3);
    border-top: 1px solid var(--eh-border);
}

/* —— 区域标签扩展 —— */
.ex01-page .region-tag.sea { background: var(--eh-brand-muted); color: var(--eh-brand); }
.ex01-page .region-tag.eu { background: var(--eh-success-muted); color: var(--eh-success); }
.ex01-page .region-tag.usa { background: var(--eh-warning-muted); color: var(--eh-warning); }
.ex01-page .region-tag.me { background: var(--eh-danger-muted); color: var(--eh-danger); }

@media (max-width: 1100px) {
    .ex01-insights { grid-template-columns: 1fr; }
    .ex01-cap-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
    .ex01-cap-grid { grid-template-columns: 1fr; }
    .ex01-hero-actions { width: 100%; }
}

/* —— 模块快捷导航 —— */
.ex01-modnav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--eh-space-2);
    margin-bottom: var(--eh-space-4);
    padding: var(--eh-space-3);
    background: var(--eh-bg-subtle);
    border: 1px solid var(--eh-border);
    border-radius: var(--eh-radius-lg);
}

.ex01-modnav a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: var(--eh-text-xs);
    font-weight: 600;
    color: var(--eh-text-secondary);
    background: var(--eh-surface-solid);
    border: 1px solid var(--eh-border);
    border-radius: var(--eh-radius-md);
    text-decoration: none;
    transition: all var(--eh-duration);
    cursor: pointer;
}

.ex01-modnav a:hover {
    border-color: var(--eh-border-brand);
    color: var(--eh-brand);
    box-shadow: var(--eh-shadow-xs);
}

.ex01-modnav a i { color: var(--eh-brand-light); font-size: 11px; }

.ex01-modnav a.hub-link {
    background: var(--eh-brand-subtle);
    border-color: var(--eh-border-brand);
    color: var(--eh-brand);
}

/* —— 图表容器高度 —— */
.ex01-page .chart-container {
    position: relative;
    height: 240px;
    min-height: 200px;
}

.ex01-page .chart-container.chart-sm { height: 200px; }

.ex01-page .chart-container canvas {
    max-height: none !important;
}

/* —— KPI 刷新动画 —— */
.ex01-page .stat-card.kpi-flash {
    animation: ex01-kpi-flash 0.4s ease;
}

@keyframes ex01-kpi-flash {
    0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.35); }
    100% { box-shadow: var(--eh-shadow-xs); }
}

.ex01-hero-actions .spinning i {
    animation: ex01-spin 0.7s linear infinite;
}

@keyframes ex01-spin {
    to { transform: rotate(360deg); }
}

/* —— Toast —— */
.ex01-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    z-index: 100010;
    padding: 10px 20px;
    background: #111827;
    color: #f9fafb;
    font-size: var(--eh-text-sm);
    font-weight: 600;
    border-radius: var(--eh-radius-full);
    box-shadow: var(--eh-shadow-md);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.ex01-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* —— 预算指标 id 占位 —— */
.ex01-budget-grid .ex01-metric-row .metric-val { min-width: 4rem; text-align: right; }

/* ============================================================
   EX-01 v2 · Bento Executive Layout
   ============================================================ */

.ex01-page.ex01-v2 .ex01-hero {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 40%, rgba(29, 78, 216, 0.04) 100%);
    border-left: 4px solid var(--eh-brand);
}

.ex01-page.ex01-v2 .ex01-hero .sub-en {
    font-size: var(--eh-text-xs);
    color: var(--eh-text-muted);
    margin-top: 6px;
    letter-spacing: 0.02em;
}

.ex01-kpi-strip {
    display: grid;
    grid-template-columns: minmax(160px, 200px) repeat(5, minmax(0, 1fr));
    gap: var(--eh-space-3);
    margin-bottom: var(--eh-space-4);
}

.ex01-health-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: linear-gradient(145deg, var(--eh-brand) 0%, #1e40af 100%);
    border-radius: var(--eh-radius-lg);
    color: #fff;
    box-shadow: var(--eh-shadow-sm);
    text-align: center;
}

.ex01-health-card .health-score {
    font-size: 2.5rem;
    font-weight: 800;
    font-family: var(--eh-font-mono);
    line-height: 1;
}

.ex01-health-card .health-label {
    font-size: var(--eh-text-xs);
    font-weight: 600;
    opacity: 0.9;
    margin-top: 4px;
}

.ex01-health-card .health-sub {
    font-size: 10px;
    opacity: 0.75;
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.ex01-kpi-strip .stat-card {
    margin: 0;
}

.ex01-bento {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--eh-space-3);
}

.ex01-bento .card {
    margin-bottom: 0;
    height: 100%;
}

.bento-region { grid-column: span 4; }
.bento-profit { grid-column: span 4; }
.bento-matrix { grid-column: span 4; }
.bento-trend { grid-column: span 12; }
.bento-pnl { grid-column: span 6; }
.bento-drivers { grid-column: span 6; }

.ex01-matrix-table {
    width: 100%;
    font-size: var(--eh-text-xs);
    border-collapse: collapse;
}

.ex01-matrix-table th {
    text-align: left;
    padding: 6px 8px;
    color: var(--eh-text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--eh-border);
}

.ex01-matrix-table td {
    padding: 8px;
    border-bottom: 1px solid var(--eh-border);
    color: var(--eh-text-secondary);
}

.ex01-matrix-table tr:last-child td { border-bottom: none; }

.ex01-matrix-table .mono {
    font-family: var(--eh-font-mono);
    font-weight: 600;
    color: var(--eh-text-primary);
}

.ex01-deck-split {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--eh-space-4);
    margin-bottom: var(--eh-space-4);
}

.ex01-side-rail {
    display: flex;
    flex-direction: column;
    gap: var(--eh-space-3);
}

.ex01-side-rail .ex01-callout {
    flex: 1;
}

.ex01-quick-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.ex01-quick-links a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    font-size: var(--eh-text-xs);
    font-weight: 600;
    color: var(--eh-text-secondary);
    background: var(--eh-bg-subtle);
    border: 1px solid var(--eh-border);
    border-radius: var(--eh-radius-md);
    text-decoration: none;
    transition: all var(--eh-duration);
}

.ex01-quick-links a:hover {
    border-color: var(--eh-border-brand);
    color: var(--eh-brand);
    background: var(--eh-brand-subtle);
}

@media (max-width: 1200px) {
    .ex01-kpi-strip { grid-template-columns: repeat(3, 1fr); }
    .ex01-health-card { grid-column: span 3; flex-direction: row; gap: 16px; text-align: left; }
    .ex01-bento { grid-template-columns: 1fr 1fr; }
    .bento-region, .bento-profit, .bento-matrix, .bento-pnl, .bento-drivers, .bento-trend { grid-column: span 2; }
    .ex01-deck-split { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .ex01-kpi-strip { grid-template-columns: 1fr 1fr; }
    .ex01-bento { grid-template-columns: 1fr; }
    .bento-region, .bento-profit, .bento-matrix, .bento-pnl, .bento-drivers, .bento-trend { grid-column: span 1; }
}
