/*
 * Zibll Site Stats - 前端样式
 * 液态玻璃（Liquid Glass）风格：透明磨砂 + 边缘高光 + 渐变数字
 *
 * @version 1.1.2
 */

/* ---------- 抵消子比主题 .zib-widget 的内边距与底板 ----------
 * 子比给 .zib-widget 设了 padding:15px + 背景色 + 阴影，
 * 在卡片四周留下明显空白并把玻璃卡片垫成"实心盒"。
 * 主题 CSS 在插件之后加载、优先级相同时会反超，
 * 因此用 .zib-widget.widget_zss_stats 双类选择器（0,2,0）压过 .zib-widget（0,1,0）。
 * 仅作用于本挂件，不影响其它挂件。 */
.zib-widget.widget_zss_stats {
    padding: 0;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
}

.zss-stats-box {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin: 0;
    padding: 0;
}

/* ---------- 液态玻璃卡片 ---------- */
.zss-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 2px;
    padding: 16px 10px 14px;
    border-radius: 16px;
    overflow: hidden;

    /* 透明玻璃体：浅色底 + 强模糊 + 饱和度提升，透出背后页面 */
    background: linear-gradient(135deg,
        rgba(255, 255, 255, .28),
        rgba(255, 255, 255, .10) 55%,
        rgba(255, 255, 255, .04));
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);

    /* 玻璃边缘：亮边 + 内高光 + 外投影 */
    border: 1px solid rgba(255, 255, 255, .35);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .45),
        inset 0 -1px 0 rgba(255, 255, 255, .06),
        0 8px 28px rgba(15, 23, 42, .08);

    transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}

/* 顶部玻璃反光带（取代原色条） */
.zss-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 8%;
    right: 8%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, .8),
        transparent);
    pointer-events: none;
}

/* 角落环境光晕（随卡片主题色，极淡） */
.zss-card::after {
    content: '';
    position: absolute;
    top: -40%;
    left: -20%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle,
        color-mix(in srgb, var(--zss-accent, #3b82f6) 18%, transparent),
        transparent 70%);
    pointer-events: none;
}

.zss-card:hover {
    transform: translateY(-3px);
    background: linear-gradient(135deg,
        rgba(255, 255, 255, .36),
        rgba(255, 255, 255, .14) 55%,
        rgba(255, 255, 255, .07));
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .55),
        0 12px 36px rgba(15, 23, 42, .14);
}

/* ---------- 文字 ---------- */
.zss-label {
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    letter-spacing: 1px;
    white-space: nowrap;
}

.zss-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.25;
    background: linear-gradient(135deg,
        var(--zss-accent, #3b82f6),
        color-mix(in srgb, var(--zss-accent, #3b82f6) 45%, #0ea5e9));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    transition: opacity .2s ease;
}

.zss-value.is-updating {
    opacity: .45;
}

.zss-sub {
    font-size: 12px;
    color: #94a3b8;
    white-space: nowrap;
}

/* ---------- 暗黑模式：深玻璃 ---------- */
@media (prefers-color-scheme: dark) {
    .zss-card {
        background: linear-gradient(135deg,
            rgba(255, 255, 255, .10),
            rgba(255, 255, 255, .04) 55%,
            rgba(255, 255, 255, .015));
        border-color: rgba(255, 255, 255, .14);
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, .14),
            inset 0 -1px 0 rgba(255, 255, 255, .03),
            0 8px 28px rgba(0, 0, 0, .35);
    }
    .zss-card::before {
        background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, .45),
            transparent);
    }
    .zss-card:hover {
        background: linear-gradient(135deg,
            rgba(255, 255, 255, .15),
            rgba(255, 255, 255, .06) 55%,
            rgba(255, 255, 255, .03));
        box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, .2),
            0 12px 36px rgba(0, 0, 0, .45);
    }
    .zss-label { color: rgba(226, 232, 240, .75); }
    .zss-sub   { color: rgba(148, 163, 184, .6); }
}

/* ---------- 响应式：平板 3 列，手机 5 列横排自适应 ---------- */
@media (max-width: 1024px) {
    .zss-stats-box { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .zss-stats-box {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 6px;
    }
    .zss-card {
        padding: 10px 4px 9px;
        gap: 1px;
        border-radius: 12px;
    }
    .zss-label { font-size: 10px; letter-spacing: 0; }
    .zss-value { font-size: 17px; }
    .zss-sub   { font-size: 9px; }
}
