/**
 * Status Light v2.0 — 前台样式
 * 二次元清新可爱风格
 * 指示灯大小 ≈ 4 个汉字
 */

/* ============================================================
   1. 居中包裹层
   ============================================================ */
.sl2-public-wrap {
    text-align: center;
}

/* ============================================================
   2. 容器
   ============================================================ */
.sl2-public {
    display: inline-flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 20px;
    background: #ffffff;
    border-radius: 16px;
    border: 1.5px solid #f0dce8;
    box-shadow:
        0 2px 12px rgba(180, 140, 160, 0.08),
        0 0 0 1px rgba(240, 220, 235, 0.4);
    max-width: 280px;
}

/* 休息中 */
.sl2-public--resting {
    border-color: #e8e0ec;
    box-shadow: 0 2px 10px rgba(160, 140, 170, 0.06);
    opacity: 0.85;
}

/* ============================================================
   2. 状态行：灯 + 图标 + 标签
   ============================================================ */
.sl2-pub-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ============================================================
   3. 拟物小灯泡 — 约 4 个汉字宽 (~48px)
   ============================================================ */
.sl2-pub-bulb {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

/* ── 外层光晕 ── */
.sl2-pub-bulb__glow {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        color-mix(in srgb, var(--sl2-accent, #89c2ff) 40%, transparent) 0%,
        transparent 70%
    );
    animation: sl2-glow-pulse 2s ease-in-out infinite;
}

@keyframes sl2-glow-pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 0.9; transform: scale(1.15); }
}

/* ── LED 核心球体 ── */
.sl2-pub-bulb__core {
    position: relative;
    z-index: 1;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    /* 玻璃凸面效果 */
    background:
        radial-gradient(
            circle at 38% 32%,
            rgba(255,255,255,0.7) 0%,
            rgba(255,255,255,0.1) 20%,
            transparent 40%
        ),
        radial-gradient(
            circle at 50% 50%,
            color-mix(in srgb, var(--sl2-accent, #89c2ff) 80%, #ffffff) 0%,
            var(--sl2-accent, #89c2ff) 40%,
            color-mix(in srgb, var(--sl2-accent, #89c2ff) 60%, #000000) 100%
        );
    box-shadow:
        0 0 8px color-mix(in srgb, var(--sl2-accent, #89c2ff) 60%, transparent),
        0 0 20px color-mix(in srgb, var(--sl2-accent, #89c2ff) 30%, transparent),
        inset 0 -2px 3px rgba(0,0,0,0.2);
    animation: sl2-core-glow 1.5s ease-in-out infinite;
}

@keyframes sl2-core-glow {
    0%, 100% {
        box-shadow:
            0 0 8px color-mix(in srgb, var(--sl2-accent, #89c2ff) 60%, transparent),
            0 0 20px color-mix(in srgb, var(--sl2-accent, #89c2ff) 30%, transparent);
    }
    50% {
        box-shadow:
            0 0 14px color-mix(in srgb, var(--sl2-accent, #89c2ff) 80%, transparent),
            0 0 30px color-mix(in srgb, var(--sl2-accent, #89c2ff) 45%, transparent),
            0 0 46px color-mix(in srgb, var(--sl2-accent, #89c2ff) 20%, transparent);
    }
}

/* ── 小星星装饰 ── */
.sl2-pub-bulb__spark {
    position: absolute;
    z-index: 2;
    top: -2px;
    right: 0;
    font-size: 12px;
    animation: sl2-sparkle-pop 2s ease-in-out infinite;
    color: var(--sl2-accent, #89c2ff);
    filter: brightness(1.3);
}
@keyframes sl2-sparkle-pop {
    0%, 100% { opacity: 0; transform: scale(0.5) rotate(0deg); }
    40% { opacity: 1; transform: scale(1.1) rotate(15deg); }
    60% { opacity: 1; transform: scale(1) rotate(-10deg); }
    80% { opacity: 0.5; transform: scale(0.8) rotate(0deg); }
}

/* ── 关闭状态的灯 ── */
.sl2-pub-bulb--off .sl2-pub-bulb__core {
    background:
        radial-gradient(
            circle at 38% 32%,
            rgba(255,255,255,0.3) 0%,
            rgba(255,255,255,0.05) 20%,
            transparent 40%
        ),
        radial-gradient(
            circle at 50% 50%,
            #c8c0cc 0%,
            #b0a8b8 40%,
            #908898 100%
        );
    box-shadow:
        inset 0 -2px 3px rgba(0,0,0,0.15);
    animation: none;
}
.sl2-pub-bulb--off + .sl2-pub-icon {
    /* no glow */
}

/* ============================================================
   4. 图标 & 标签
   ============================================================ */
.sl2-pub-icon {
    font-size: 22px;
}

.sl2-pub-label {
    font-size: 16px;
    font-weight: 700;
    color: #5a4a6a;
    letter-spacing: 1px;
}

.sl2-pub-label--rest {
    color: #a898b0;
}

/* ============================================================
   5. 详情区
   ============================================================ */
.sl2-pub-detail {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-left: 4px;
}

.sl2-pub-name {
    font-size: 14px;
    font-weight: 700;
    color: #4a3a5a;
}

.sl2-pub-note {
    font-size: 12px;
    color: #a090b0;
    font-style: italic;
}

.sl2-pub-image {
    margin-top: 4px;
    width: 100%;
    max-width: 200px;
    border-radius: 10px;
    border: 1.5px solid #f0dce8;
    object-fit: cover;
}

/* ============================================================
   6. 响应式
   ============================================================ */
@media (max-width: 480px) {
    .sl2-public {
        max-width: 240px;
        padding: 12px 14px;
        gap: 8px;
    }
    .sl2-pub-bulb {
        width: 38px;
        height: 38px;
    }
    .sl2-pub-bulb__core {
        width: 20px;
        height: 20px;
    }
    .sl2-pub-label {
        font-size: 14px;
    }
}
