﻿/* =========================================================
   迈博瑞数据中台 - 果冻主题基础
   设计令牌 + 通用组件 + 通用动效 + 实时刷新动效
   ========================================================= */

:root {
    --jelly-primary-start: #60a5fa;
    --jelly-primary-end: #2563eb;
    --jelly-radius-card: 14px;
    --jelly-radius-panel: 12px;
    --jelly-radius-btn: 8px;
    --jelly-ease-bounce: cubic-bezier(.34, 1.56, .64, 1);
    --jelly-text-primary: #1e293b;
    --jelly-text-secondary: #475569;
    --jelly-text-muted: #94a3b8;
    --jelly-shadow-card: 0 4px 12px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04);
    --jelly-shadow-card-hover: 0 8px 24px rgba(15, 23, 42, 0.12), 0 4px 8px rgba(15, 23, 42, 0.06);
    --jelly-shadow-btn: 0 2px 6px rgba(59, 130, 246, 0.28);
    --jelly-shadow-btn-hover: 0 4px 12px rgba(59, 130, 246, 0.38);
    --jelly-shadow-panel: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --jelly-shadow-panel-hover: 0 4px 12px rgba(15, 23, 42, 0.08);
}

/* ========== 通用动效 ========== */
@keyframes jelly-pop {
    0% {
        transform: scale(.55);
        opacity: 0;
    }

    55% {
        transform: scale(1.09);
        opacity: 1;
    }

    78% {
        transform: scale(.965);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes jelly-card-in {
    from {
        opacity: 0;
        transform: translateY(24px) scale(.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes jelly-drift {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(40px, -30px) scale(1.08);
    }

    66% {
        transform: translate(-30px, 25px) scale(.94);
    }
}

@keyframes jelly-dot-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 4px rgba(91, 140, 255, .15);
    }

    50% {
        transform: scale(1.35);
        box-shadow: 0 0 0 9px rgba(91, 140, 255, .05);
    }
}

/* ========== 实时刷新：数值跳动 ========== */
@keyframes jelly-value-up {
    0% {
        color: #fff;
        transform: scale(1);
    }

    25% {
        color: #22e6a0;
        transform: scale(1.14);
        text-shadow: 0 0 12px rgba(34, 230, 160, .6);
    }

    100% {
        color: #fff;
        transform: scale(1);
    }
}

@keyframes jelly-value-down {
    0% {
        color: #fff;
        transform: scale(1);
    }

    25% {
        color: #ff6b8a;
        transform: scale(.9);
        text-shadow: 0 0 12px rgba(255, 107, 138, .6);
    }

    100% {
        color: #fff;
        transform: scale(1);
    }
}

.jelly-value.is-up {
    animation: jelly-value-up .9s var(--jelly-ease-bounce);
}

.jelly-value.is-down {
    animation: jelly-value-down .9s var(--jelly-ease-bounce);
}

/* ========== 实时刷新：卡片脉冲 ========== */
@keyframes jelly-card-pulse {
    0% {
        box-shadow: var(--jelly-shadow-card);
    }

    50% {
        box-shadow: 0 0 0 4px rgba(255, 255, 255, .35), var(--jelly-shadow-card-hover);
    }

    100% {
        box-shadow: var(--jelly-shadow-card);
    }
}

.jelly-card.is-refresh {
    animation: jelly-card-pulse 1s ease-out;
}

/* ========== 通用按钮（扁平） ========== */
.jelly-btn {
    position: relative;
    border: none;
    border-radius: var(--jelly-radius-btn);
    background: var(--jelly-primary-start);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
    transition: background-color .2s ease;
}

    .jelly-btn:hover {
        background: #0860c7;
    }

    .jelly-btn:active {
        background: #0759b3;
    }

    .jelly-btn:disabled {
        opacity: .7;
        cursor: not-allowed;
    }

/* ========== 通用卡片（扁平，配色由 tone-* 提供） ========== */
.jelly-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--jelly-radius-card);
    padding: 18px 20px 16px;
    color: #fff;
    background-image: linear-gradient(135deg, var(--c1, var(--jelly-primary-start)), var(--c2, var(--jelly-primary-end)));
    animation: jelly-pop .68s var(--jelly-ease-bounce) backwards;
}

    .jelly-card:hover {
        filter: brightness(1.05);
    }

/* ========== 通用白板面板（扁平） ========== */
.jelly-panel {
    border-radius: var(--jelly-radius-panel);
    background: #fff;
    padding: 16px 18px 18px;
    border: 1px solid var(--app-border, #d0d7de);
    transition: border-color .2s ease;
}

    .jelly-panel:hover {
        border-color: var(--app-border-strong, #afb8c1);
    }

/* ========== 倒计时进度条 ========== */
.board-countdown {
    position: relative;
    width: 96px;
    height: 4px;
    border-radius: 999px;
    background: rgba(91, 140, 255, .12);
    overflow: hidden;
}

.board-countdown-bar {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--jelly-primary-start), var(--jelly-primary-end));
    transition: width 1s linear;
}

/* =========================================================
   Frappe / Espresso 统一风格覆盖
   注意：看板页中本文件先于 dashboard/*.css 加载，
   因此针对页面级规则使用更强的后代选择器覆盖。
   ========================================================= */

:root {
    --jelly-text-primary: #171717;
    --jelly-text-secondary: #666666;
    --jelly-text-muted: #999999;
    --jelly-radius-card: 8px;
    --jelly-radius-panel: 8px;
    --jelly-shadow-card: none;
    --jelly-shadow-card-hover: none;
}

@keyframes jelly-card-enter {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes jelly-card-refresh {
    0%, 100% {
        border-color: var(--app-border, #e2e8f0);
    }

    50% {
        border-color: var(--app-primary, #3b82f6);
    }
}

@keyframes jelly-value-flash-up {
    0% {
        color: #171717;
    }

    30% {
        color: #16a34a;
    }

    100% {
        color: #171717;
    }
}

@keyframes jelly-value-flash-down {
    0% {
        color: #171717;
    }

    30% {
        color: #dc2626;
    }

    100% {
        color: #171717;
    }
}

/* ---------- 指标卡：白底 + 1px 边框 + 8px 圆角，无阴影 ---------- */
.jelly-card {
    padding: 16px 18px 14px;
    color: var(--jelly-text-primary);
    background: #fff;
    background-image: none;
    border: 1px solid var(--app-border, #e2e8f0);
    border-radius: 8px;
    box-shadow: none;
    filter: none;
    animation: jelly-card-enter .3s var(--app-ease-out, ease-out) backwards;
    transition: border-color .2s ease;
}

    /* tone 仅作为顶部 2px 色条 */
    .jelly-card::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 2px;
        background: var(--c1, var(--app-primary, #3b82f6));
    }

    .jelly-card:hover {
        filter: none;
        transform: none;
        box-shadow: none;
        border-color: var(--app-border-strong, #cbd5e1);
    }

    .jelly-card.is-refresh {
        animation: jelly-card-refresh 1s ease-out;
    }

    .jelly-card .jelly-label {
        color: #666;
        opacity: 1;
        letter-spacing: 0;
    }

    .jelly-card .jelly-value {
        color: #171717;
        font-weight: 600;
        text-shadow: none;
    }

        .jelly-card .jelly-value em {
            color: #999;
            opacity: 1;
        }

    .jelly-card .jelly-hint {
        color: #999;
        opacity: 1;
    }

.jelly-value.is-up {
    animation: jelly-value-flash-up .9s ease;
}

.jelly-value.is-down {
    animation: jelly-value-flash-down .9s ease;
}

/* ---------- 面板：与列表页卡片一致（低对比、无阴影） ---------- */
.jelly-panel {
    border-radius: 8px;
    border-color: var(--app-border, #e2e8f0);
    background: #fff;
    box-shadow: none;
}

    .jelly-panel:hover {
        border-color: var(--app-border-strong, #cbd5e1);
    }

    .jelly-panel .panel-head {
        color: var(--jelly-text-primary);
        font-weight: 600;
    }

        .jelly-panel .panel-head small {
            color: #999;
        }

/* ---------- 看板标题与刷新指示 ---------- */
.board-head .board-title {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--jelly-text-primary);
}

.board-head .board-dot {
    width: 8px;
    height: 8px;
    background: var(--app-primary, #3b82f6);
    box-shadow: none;
    animation: none;
}

.board-head .board-countdown {
    background: #ededed;
}

.board-head .board-countdown-bar {
    background: var(--app-primary, #3b82f6);
}

/* ---------- 图表：扁平单色，低对比 ---------- */
.jelly-panel .bar-track,
.jelly-panel .contract-track {
    background: #f1f1f1;
    box-shadow: none;
}

.jelly-panel .bar-fill,
.jelly-panel .contract-fill,
.jelly-panel .trend-bar {
    background: var(--app-primary, #3b82f6);
    box-shadow: none;
    transition: width .6s var(--app-ease, ease), height .6s var(--app-ease, ease);
}

.jelly-panel .bar-fill.bar-fill-alt,
.jelly-panel .trend-bar.trend-bar-alt {
    background: #93c5fd;
}

.jelly-panel .bar-fill.bar-fill-amount {
    background: #60a5fa;
}

.jelly-panel .bar-empty {
    color: #b0b0b0;
}
