/* 状态看板 — ECharts 科技大屏主题 */
.dashboard-tech {
    --dash-bg: #030508;
    --dash-surface: rgba(8, 14, 28, 0.88);
    --dash-border: rgba(34, 211, 238, 0.14);
    --dash-glow: rgba(34, 211, 238, 0.45);
    --dash-cyan: #22d3ee;
    --dash-blue: #3b82f6;
    --dash-purple: #818cf8;
    --dash-green: #34d399;
    --dash-yellow: #fbbf24;
    --dash-red: #f87171;
    --dash-text: #e2e8f0;
    --dash-muted: #64748b;
    margin: -24px;
    padding: 24px 24px 36px;
    min-height: calc(100vh - 60px);
    background: var(--dash-bg);
    color: var(--dash-text);
    position: relative;
    overflow: hidden;
}

/* 粒子画布 */
.dash-particles {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.dashboard-tech::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(34, 211, 238, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(34, 211, 238, 0.025) 1px, transparent 1px);
    background-size: 36px 36px;
    pointer-events: none;
    z-index: 0;
}

/* 扫描线 */
.dash-scanline {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.03) 2px,
        rgba(0, 0, 0, 0.03) 4px
    );
    animation: scanMove 8s linear infinite;
}

@keyframes scanMove {
    0% { background-position: 0 0; }
    100% { background-position: 0 100px; }
}

.dash-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
    z-index: 0;
}

.dash-glow-1 {
    width: 500px;
    height: 500px;
    top: -120px;
    left: 5%;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.18), transparent 70%);
    animation: glowFloat 10s ease-in-out infinite;
}

.dash-glow-2 {
    width: 400px;
    height: 400px;
    bottom: 5%;
    right: 0;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15), transparent 70%);
    animation: glowFloat 12s ease-in-out infinite reverse;
}

@keyframes glowFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.05); }
    66% { transform: translate(-15px, 15px) scale(0.95); }
}

.dash-inner {
    position: relative;
    z-index: 1;
    max-width: 1440px;
    margin: 0 auto;
}

/* 顶栏 */
.dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.dash-title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.dash-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 4px;
    background: linear-gradient(90deg, #fff 0%, var(--dash-cyan) 50%, var(--dash-blue) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleShine 4s linear infinite;
}

@keyframes titleShine {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.dash-subtitle {
    font-size: 12px;
    color: var(--dash-muted);
    letter-spacing: 3px;
    margin-top: 8px;
}

.dash-live {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--dash-cyan);
    background: rgba(34, 211, 238, 0.06);
    border: 1px solid rgba(34, 211, 238, 0.3);
    box-shadow: 0 0 24px rgba(34, 211, 238, 0.12);
}

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--dash-cyan);
    box-shadow: 0 0 8px var(--dash-cyan), 0 0 16px var(--dash-glow);
    animation: livePulse 1.5s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--dash-cyan), 0 0 16px var(--dash-glow); }
    50% { opacity: 0.4; box-shadow: 0 0 4px var(--dash-cyan); }
}

.dash-header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.dash-updated {
    font-size: 12px;
    color: var(--dash-muted);
    font-family: "SF Mono", "Fira Code", monospace;
}

.dash-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    font-size: 12px;
    font-weight: 500;
    color: var(--dash-cyan);
    background: rgba(34, 211, 238, 0.05);
    border: 1px solid rgba(34, 211, 238, 0.28);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.dash-refresh-btn:hover {
    background: rgba(34, 211, 238, 0.14);
    box-shadow: 0 0 28px rgba(34, 211, 238, 0.25);
    transform: translateY(-1px);
}

.dash-refresh-btn.is-loading svg {
    animation: spin 0.6s linear infinite;
}

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

/* KPI 卡片 */
.dash-kpi-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 14px;
    margin-bottom: 22px;
}

.dash-kpi-card {
    position: relative;
    padding: 18px 16px 14px;
    background: var(--dash-surface);
    border: 1px solid var(--dash-border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.35s;
    animation: cardFadeIn 0.6s ease backwards;
}

.dash-kpi-card:nth-child(1) { animation-delay: 0.05s; }
.dash-kpi-card:nth-child(2) { animation-delay: 0.1s; }
.dash-kpi-card:nth-child(3) { animation-delay: 0.15s; }
.dash-kpi-card:nth-child(4) { animation-delay: 0.2s; }
.dash-kpi-card:nth-child(5) { animation-delay: 0.25s; }
.dash-kpi-card:nth-child(6) { animation-delay: 0.3s; }

@keyframes cardFadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.dash-kpi-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 40px rgba(34, 211, 238, 0.1);
    border-color: rgba(34, 211, 238, 0.3);
}

.dash-kpi-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.06), transparent);
    animation: cardShimmer 4s ease-in-out infinite;
}

@keyframes cardShimmer {
    0%, 100% { left: -100%; }
    50% { left: 100%; }
}

.dash-kpi-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.dash-kpi-label {
    font-size: 11px;
    color: var(--dash-muted);
    letter-spacing: 1.5px;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.dash-kpi-value {
    font-size: 30px;
    font-weight: 700;
    font-family: "SF Mono", "Fira Code", Consolas, monospace;
    color: var(--accent);
    line-height: 1;
    position: relative;
    z-index: 1;
    transition: text-shadow 0.3s;
}

.dash-kpi-value.is-animating {
    text-shadow: 0 0 24px var(--accent), 0 0 48px color-mix(in srgb, var(--accent) 30%, transparent);
}

.dash-kpi-bar {
    margin-top: 12px;
    height: 3px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.dash-kpi-bar-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #fff));
    border-radius: 2px;
    box-shadow: 0 0 8px var(--accent);
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.dash-kpi-card[data-accent="cyan"] { --accent: var(--dash-cyan); }
.dash-kpi-card[data-accent="blue"] { --accent: var(--dash-blue); }
.dash-kpi-card[data-accent="green"] { --accent: var(--dash-green); }
.dash-kpi-card[data-accent="purple"] { --accent: var(--dash-purple); }
.dash-kpi-card[data-accent="yellow"] { --accent: var(--dash-yellow); }
.dash-kpi-card[data-accent="red"] { --accent: var(--dash-red); }

/* 图表面板 */
.dash-chart-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.dash-panel {
    background: var(--dash-surface);
    border: 1px solid var(--dash-border);
    border-radius: 14px;
    padding: 20px 20px 10px;
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
    animation: panelSlideIn 0.7s ease backwards;
}

.dash-chart-row .dash-panel:first-child { animation-delay: 0.35s; }
.dash-chart-row .dash-panel:last-child { animation-delay: 0.45s; }

@keyframes panelSlideIn {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

.dash-panel-glow {
    box-shadow: inset 0 0 60px rgba(34, 211, 238, 0.02);
}

.dash-panel-corner {
    position: absolute;
    width: 16px;
    height: 16px;
    border-color: rgba(34, 211, 238, 0.5);
    border-style: solid;
    pointer-events: none;
}

.dash-panel-corner-tl {
    top: 8px;
    left: 8px;
    border-width: 2px 0 0 2px;
}

.dash-panel-corner-br {
    bottom: 8px;
    right: 8px;
    border-width: 0 2px 2px 0;
}

.dash-panel-main {
    min-width: 0;
}

.dash-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dash-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 1px;
}

.dash-panel-title::before {
    content: "";
    width: 3px;
    height: 16px;
    background: linear-gradient(180deg, var(--dash-cyan), var(--dash-blue));
    border-radius: 2px;
    box-shadow: 0 0 10px var(--dash-glow);
    animation: barPulse 2s ease-in-out infinite;
}

@keyframes barPulse {
    0%, 100% { box-shadow: 0 0 10px var(--dash-glow); }
    50% { box-shadow: 0 0 20px var(--dash-glow), 0 0 30px rgba(34, 211, 238, 0.2); }
}

.dash-panel-tag {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(34, 211, 238, 0.55);
    padding: 4px 10px;
    border: 1px solid rgba(34, 211, 238, 0.18);
    border-radius: 4px;
    background: rgba(34, 211, 238, 0.04);
}

.dash-chart {
    width: 100%;
    height: 320px;
}

.dash-chart-tall {
    height: 420px;
}

@media (max-width: 1200px) {
    .dash-kpi-row { grid-template-columns: repeat(3, 1fr); }
    .dash-chart-row { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .dashboard-tech { margin: -24px -16px; padding: 16px; }
    .dash-kpi-row { grid-template-columns: repeat(2, 1fr); }
    .dash-kpi-value { font-size: 22px; }
    .dash-chart, .dash-chart-tall { height: 320px; }
    .dash-title { font-size: 18px; letter-spacing: 2px; }
}
