/* ==========================================================
   🎨 主题切换器 (通用悬浮组件)
   ----------------------------------------------------------
   三套主题通用，固定右下角，带配色预览与勾选状态
   ========================================================== */

/* ---------- 悬浮魔法按钮 ---------- */
.theme-fab {
    position: fixed;
    right: 22px;
    bottom: 24px;
    z-index: 2000;
    font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}
.theme-fab-btn {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 3px solid #fff;
    background: linear-gradient(135deg, #b28cff, #8360ee);
    box-shadow: 0 6px 0 #6244cc, 0 12px 26px rgba(98, 68, 204, 0.4);
    font-size: 27px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .16s ease, box-shadow .16s ease;
    animation: fabPulse 3.2s ease-in-out infinite;
}
.theme-fab-btn:hover { transform: translateY(-4px) rotate(-10deg); }
.theme-fab-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #6244cc; }
@keyframes fabPulse {
    0%, 100% { box-shadow: 0 6px 0 #6244cc, 0 12px 26px rgba(98,68,204,.4); }
    50% { box-shadow: 0 6px 0 #6244cc, 0 12px 34px rgba(98,68,204,.65); }
}

/* ---------- 主题选择面板 ---------- */
.theme-fab-panel {
    position: absolute;
    right: 0;
    bottom: 72px;
    width: 272px;
    background: #FFFFFF;
    border: 3px solid #EDE7FF;
    border-radius: 20px;
    box-shadow: 0 14px 38px rgba(60, 40, 120, 0.28);
    padding: 12px;
    display: none;
    transform-origin: bottom right;
}
.theme-fab.is-open .theme-fab-panel { display: block; animation: themePop .2s cubic-bezier(.68,-.55,.27,1.4); }
@keyframes themePop {
    from { transform: scale(.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.theme-fab-title {
    font-size: .82rem;
    font-weight: 800;
    color: #8a86a0;
    text-align: center;
    padding: 2px 0 10px;
    letter-spacing: 1px;
}

.theme-opt {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    padding: 9px 10px;
    border: 2px solid #EFEDF6;
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    margin-bottom: 8px;
    font-family: inherit;
    transition: transform .14s ease, border-color .14s ease, background .14s ease;
}
.theme-opt:last-child { margin-bottom: 0; }
.theme-opt:hover { border-color: #b28cff; background: #FAF8FF; transform: translateX(-3px); }
.theme-opt.is-active { border-color: #8360ee; background: #F4F0FF; box-shadow: 0 3px 0 #ddd4ff; }

/* 配色预览条 */
.theme-swatch { display: flex; gap: 3px; flex: none; }
.theme-swatch i { width: 9px; height: 28px; border-radius: 5px; display: block; }
.sw-candy i:nth-child(1) { background: #FF87AB; }
.sw-candy i:nth-child(2) { background: #FFD23F; }
.sw-candy i:nth-child(3) { background: #5AC8FA; }
.sw-scene i:nth-child(1) { background: #4FB0FF; }
.sw-scene i:nth-child(2) { background: #4FD9A0; }
.sw-scene i:nth-child(3) { background: #8FD45C; }
.sw-story i:nth-child(1) { background: #ff9f43; }
.sw-story i:nth-child(2) { background: #ff6b6b; }
.sw-story i:nth-child(3) { background: #9b6dff; }

.theme-opt-txt { flex: 1; }
.theme-opt-txt b { display: block; font-size: .92rem; font-weight: 800; color: #33304a; }
.theme-opt-txt small { display: block; font-size: .72rem; color: #8a86a0; margin-top: 1px; }
.theme-opt-check { margin-left: auto; color: #8360ee; font-weight: 900; font-size: 1rem; opacity: 0; }
.theme-opt.is-active .theme-opt-check { opacity: 1; }

/* ---------- 场景漂浮装饰层（三套主题共用容器） ---------- */
.decor-layer { display: none; position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.decor-layer span { position: absolute; font-size: 34px; opacity: .85; }

/* 英语乐园：云朵 / 太阳 / 小鸟 */
.scene-decor span:nth-child(1) { top: 14%; left: 7%; font-size: 54px; }
.scene-decor span:nth-child(2) { top: 9%; right: 8%; font-size: 46px; }
.scene-decor span:nth-child(3) { top: 30%; right: 14%; font-size: 30px; }
.scene-decor span:nth-child(4) { top: 46%; left: 4%; font-size: 40px; }

/* 暖心故事：云朵 / 彩虹 / 星星 */
.story-decor span:nth-child(1) { top: 5%; left: 6%; }
.story-decor span:nth-child(2) { top: 12%; right: 8%; }
.story-decor span:nth-child(3) { top: 46%; left: 2%; }
.story-decor span:nth-child(4) { bottom: 16%; right: 3%; }
.story-decor span:nth-child(5) { bottom: 5%; left: 10%; }

@media (max-width: 560px) {
    .theme-fab { right: 14px; bottom: 16px; }
    .theme-fab-btn { width: 52px; height: 52px; font-size: 24px; }
    .theme-fab-panel { width: 250px; }
}
