/* ════════════════════════════════════════════════════════════ */
/* 🧸 小千同学·换装小剧场 — 可爱手游风 UI                        */
/* 设计规范：粉色马卡龙 + 圆形大按钮 + 玻璃拟态 + 大圆角         */
/* ════════════════════════════════════════════════════════════ */

:root {
    /* 粉色主题色板 */
    --pink-main: #ff8bb3;      /* 主粉 */
    --pink-deep: #ff5e93;      /* 深粉（强调、激活） */
    --pink-soft: #ffd5e4;      /* 浅粉（背景） */
    --pink-bg: #ffe9f0;        /* 最浅粉 */
    --mint: #7dd8c7;           /* 薄荷（好感度） */
    --gold: #ffc857;           /* 金色（星级/硬币） */
    --purple-soft: #b8a5ff;    /* 淡紫（稀有度） */

    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(255, 255, 255, 0.9);
    --glass-shadow: 0 8px 24px rgba(255, 139, 179, 0.22);

    --text-dark: #4a2a3a;
    --text-mid: #8a6a78;
    --text-light: #b99aac;

    --radius-round: 999px;
    --radius-big: 28px;
    --radius-mid: 18px;
    --radius-sm: 12px;
}

/* 整体：移除滚动，固定全屏舞台 */
html.dressup-html {
    overflow: hidden;
    height: 100%;
    width: 100%;
}
.dressup-body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    height: 100%;
    height: 100dvh;
    background: linear-gradient(135deg, #ffd5e4 0%, #ffe9f0 50%, #e8e4ff 100%);
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--text-dark);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* ════════════════════════════════════════ */
/* ⏳ 加载遮罩                                */
/* ════════════════════════════════════════ */
.loading-mask {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, var(--pink-soft), var(--pink-bg));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 10000;
    transition: opacity 0.4s;
}
.loading-mask.hidden {
    opacity: 0;
    pointer-events: none;
}
.loading-heart {
    font-size: 4rem;
    animation: heartBeat 0.9s ease-in-out infinite;
}
@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}
.loading-text {
    color: var(--pink-deep);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 1px;
}

/* ════════════════════════════════════════ */
/* 🎮 主容器：全屏绝对定位舞台                */
/* ════════════════════════════════════════ */
.game-root {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* 场景背景：轻微柔化让主体更突出 */
.scene-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-image 0.5s ease-out, opacity 0.4s, filter 0.5s;
    background-color: var(--pink-soft);
    background-image: linear-gradient(135deg, #ffd5e4 0%, #e8e4ff 100%);
    z-index: 0;
    filter: saturate(1.05) brightness(1.02);
}
.scene-bg.fading { opacity: 0.3; }

/* 全身模式：用白色遮罩盖住场景背景，避免半身透视背景与全身人物不协调 */
.scene-bg.fullbody-bg {
    background-image: none !important;
    background-color: #ffffff !important;
    filter: none !important;
    transition: background-color 0.4s ease-out, filter 0.3s;
}
.scene-overlay.fullbody-bg {
    opacity: 0 !important;
    transition: opacity 0.4s ease-out;
}

/* 柔光叠加层：加强暖光氛围 + 暗角，让人物更突出 */
.scene-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 60%, transparent 30%, rgba(255, 139, 179, 0.18) 100%),
        radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.35) 0%, transparent 45%),
        radial-gradient(ellipse at 75% 85%, rgba(255, 139, 179, 0.22) 0%, transparent 55%);
    pointer-events: none;
    z-index: 1;
}

/* ════════════════════════════════════════ */
/* 📌 顶部栏（三段式：返回 / 标题 / 资源）     */
/* ════════════════════════════════════════ */
/* 顶部栏：在超宽屏上同样内收，保持跟左右UI一致的最大边距 */
.top-bar {
    position: absolute;
    top: 0;
    left: max(0px, calc(50% - 660px));
    right: max(0px, calc(50% - 660px));
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    z-index: 50;
    pointer-events: none; /* 让中间无内容区域可穿透点击 */
}
.top-bar > * { pointer-events: auto; }

.top-left, .top-right {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* 胶囊按钮（顶部通用） —— 用 clamp 流式缩放 */
.pill-btn {
    width: clamp(44px, 5vw, 64px);
    height: clamp(44px, 5vw, 64px);
    border-radius: 50%;
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: clamp(1.2rem, 1.6vw, 1.85rem);
    transition: all 0.18s;
    color: var(--pink-deep);
    text-decoration: none;
    padding: 0;
}
.pill-btn:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 10px 28px rgba(255, 94, 147, 0.35);
}
.pill-btn:active {
    transform: scale(0.95);
}

/* 音频静音按钮状态 */
.pill-btn.muted {
    opacity: 0.6;
    color: var(--text-mid);
}
.pill-btn.muted:hover {
    opacity: 0.8;
}

/* 章节胶囊 */
.chapter-pill {
    padding: clamp(8px, 1vw, 14px) clamp(16px, 2.2vw, 30px);
    border-radius: var(--radius-round);
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: var(--text-dark);
    font-size: clamp(0.88rem, 1.1vw, 1.18rem);
    font-weight: 700;
    white-space: nowrap;
    max-width: 45vw;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 资源胶囊 */
.resource-pill {
    display: flex;
    align-items: center;
    gap: clamp(6px, 0.8vw, 10px);
    padding: clamp(6px, 0.9vw, 10px) clamp(14px, 1.8vw, 22px) clamp(6px, 0.9vw, 10px) clamp(8px, 1vw, 12px);
    border-radius: var(--radius-round);
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    min-width: clamp(70px, 8vw, 110px);
}
.res-icon { font-size: clamp(1.1rem, 1.4vw, 1.6rem); }
.res-num {
    font-size: clamp(0.88rem, 1.1vw, 1.2rem);
    font-weight: 800;
    color: var(--pink-deep);
    letter-spacing: 0.3px;
}

/* ════════════════════════════════════════ */
/* 🌸 左侧竖向圆形功能导航                    */
/* ════════════════════════════════════════ */
/* 左侧竖向圆形功能导航：贴屏幕左边 */
.side-nav-left {
    position: absolute;
    left: clamp(8px, 1.8vw, 26px);
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 1.4vw, 18px);
    z-index: 40;
}

.round-nav-btn {
    position: relative;
    width: clamp(56px, 7vw, 96px);
    height: clamp(56px, 7vw, 96px);
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pink-main) 0%, var(--pink-deep) 100%);
    border: 4px solid #fff;
    box-shadow:
        0 6px 16px rgba(255, 94, 147, 0.4),
        inset 0 -3px 8px rgba(0, 0, 0, 0.08),
        inset 0 3px 6px rgba(255, 255, 255, 0.4);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    transition: all 0.2s;
    padding: 0;
}
.round-nav-btn:hover {
    transform: scale(1.1) rotate(-3deg);
    box-shadow:
        0 10px 24px rgba(255, 94, 147, 0.55),
        inset 0 -3px 8px rgba(0, 0, 0, 0.08),
        inset 0 3px 6px rgba(255, 255, 255, 0.5);
}
.round-nav-btn:active {
    transform: scale(0.95);
}
.round-nav-btn.locked {
    background: linear-gradient(135deg, #cbb8c8, #b99aac);
    cursor: not-allowed;
}
.round-nav-btn.locked:hover {
    transform: none;
}

.nav-emoji {
    font-size: clamp(1.4rem, 1.8vw, 2.2rem);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
    line-height: 1;
}
.nav-tag {
    font-size: clamp(0.6rem, 0.72vw, 0.82rem);
    color: #fff;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.lock-badge {
    position: absolute;
    top: -6px;
    right: -10px;
    background: #fff;
    color: var(--pink-deep);
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: var(--radius-round);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    border: 1.5px solid var(--pink-soft);
}

.round-nav-btn.round-sm {
    width: 60px;
    height: 60px;
}
.round-nav-btn.round-sm .nav-emoji {
    font-size: 1.5rem;
}

/* ════════════════════════════════════════ */
/* 🧁 右侧信息卡（角色 + 好感度）             */
/* ════════════════════════════════════════ */
/* 右侧角色信息卡：回到屏幕右边 */
.side-info-right {
    position: absolute;
    right: clamp(8px, 1.8vw, 26px);
    top: clamp(72px, 10vh, 120px);
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 1vw, 14px);
    z-index: 40;
    max-width: clamp(150px, 20vw, 280px);
}

.info-card {
    display: flex;
    align-items: center;
    gap: clamp(8px, 1vw, 14px);
    padding: clamp(7px, 0.9vw, 12px) clamp(14px, 1.6vw, 22px) clamp(7px, 0.9vw, 12px) clamp(7px, 0.9vw, 12px);
    border-radius: var(--radius-round);
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.info-avatar {
    width: clamp(38px, 4.2vw, 64px);
    height: clamp(38px, 4.2vw, 64px);
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pink-main), var(--pink-deep));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(1.15rem, 1.5vw, 1.95rem);
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(255, 94, 147, 0.3);
    flex-shrink: 0;
}
.info-meta { display: flex; flex-direction: column; min-width: 0; }
.info-name {
    font-size: clamp(0.82rem, 1.05vw, 1.18rem);
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.info-sub {
    font-size: clamp(0.66rem, 0.82vw, 0.92rem);
    color: var(--text-mid);
    margin-top: 3px;
    white-space: nowrap;
}

/* 属性条 */
.stat-chip {
    display: flex;
    align-items: center;
    gap: clamp(8px, 1vw, 12px);
    padding: clamp(6px, 0.8vw, 10px) clamp(12px, 1.6vw, 20px) clamp(6px, 0.8vw, 10px) clamp(8px, 0.9vw, 12px);
    border-radius: var(--radius-round);
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}
.stat-icon { font-size: clamp(1rem, 1.2vw, 1.45rem); }
.stat-bar {
    flex: 1;
    height: clamp(8px, 0.9vw, 12px);
    border-radius: var(--radius-round);
    background: rgba(255, 213, 228, 0.6);
    overflow: hidden;
    min-width: clamp(50px, 7vw, 110px);
}
.stat-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--pink-main), var(--pink-deep));
    border-radius: inherit;
    transition: width 0.4s;
}
.stat-fill.stat-star {
    background: linear-gradient(90deg, var(--gold), #ff9a3d);
}
.stat-val {
    font-size: clamp(0.78rem, 0.95vw, 1.05rem);
    font-weight: 800;
    color: var(--pink-deep);
    min-width: clamp(28px, 3vw, 42px);
    text-align: right;
}

.side-info-right .round-nav-btn {
    align-self: flex-end;
    margin-top: 4px;
}

/* ════════════════════════════════════════ */
/* 👧 角色立绘                                */
/* ════════════════════════════════════════ */
/* ═══ 角色立绘 ═══ */
/* 核心思路：锚定"头部位置"，身体向下延伸，超出部分由 mask 渐隐吃掉
   —— 这样无论 height 怎么变，头始终在画面视觉黄金位（上方 1/4 处） */
.character-layer {
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
    overflow: hidden;
}
.character-wrap {
    position: absolute;
    /* 🔑 关键：用 top 锚定头顶位置，不再用 bottom
       这样身体向下延伸到哪里就在哪里渐隐，头的位置永远稳定 */
    top: 14%;                  /* 头部下移：脸落在画面上 1/4 处，不再顶到天花板 */
    left: clamp(110px, 18vw, 320px);
    height: 130%;              /* 身体向下长到超出画面，多出来的部分被 mask 吃掉 */
    aspect-ratio: 9 / 16;
    max-width: clamp(280px, 58vw, 720px);
    min-width: clamp(260px, 32vw, 380px);
    animation: charFloat 4s ease-in-out infinite;
    filter: drop-shadow(0 16px 32px rgba(255, 94, 147, 0.25));
    /* 渐隐延后：头→胸→腰完全不透明，大腿中段开始渐隐，膝盖以下完全透明 */
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 62%, rgba(0,0,0,0.75) 78%, rgba(0,0,0,0) 92%);
            mask-image: linear-gradient(to bottom, #000 0%, #000 62%, rgba(0,0,0,0.75) 78%, rgba(0,0,0,0) 92%);
    transition: top 0.4s, height 0.4s cubic-bezier(.34,1.56,.64,1), max-width 0.4s, left 0.4s;
    pointer-events: auto;
}/* 全身模式：头部上移 + 高度收为 94%（让脚回到画面底部附近），去 mask */
.character-layer.fullbody .character-wrap {
    top: 3%;
    height: 94%;
    aspect-ratio: 9 / 16;
    max-width: 42vw;
    -webkit-mask-image: none;
            mask-image: none;
}
@keyframes charFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.char-part {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: top center; /* 🔑 头部贴容器顶：锚定头的位置，身体向下延伸，超出容器的部分由 mask 吃掉 */
    transition: opacity 0.3s;
    user-select: none;
    -webkit-user-drag: none;
}

/* ═══ 视图切换按钮（全身/胸像） ═══ */
.view-toggle-btn {
    position: absolute;
    right: clamp(12px, 1.8vw, 26px);
    bottom: clamp(150px, 17vh, 200px);
    width: clamp(54px, 5.8vw, 76px);
    height: clamp(54px, 5.8vw, 76px);
    border-radius: 50%;
    background: var(--glass-bg);
    border: 3px solid #fff;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    color: var(--pink-deep);
    transition: all 0.18s;
    z-index: 36;
    pointer-events: auto;
    padding: 0;
}
.view-toggle-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 22px rgba(255, 94, 147, 0.4);
}
.view-toggle-btn:active { transform: scale(0.94); }
.view-toggle-emoji {
    font-size: clamp(1.15rem, 1.3vw, 1.65rem);
    line-height: 1;
}
.view-toggle-text {
    font-size: clamp(0.6rem, 0.72vw, 0.78rem);
    font-weight: 800;
    letter-spacing: 0.5px;
}
.char-body { z-index: 1; }
.char-outfit { z-index: 2; }
.char-expression { z-index: 3; }

/* 舞台提示气泡 */
.stage-hint {
    position: absolute;
    top: 78px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--radius-round);
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(14px);
    z-index: 20;
    animation: hintFade 6s ease forwards;
    pointer-events: none;
}
@keyframes hintFade {
    0% { opacity: 0; transform: translate(-50%, -10px); }
    10%, 70% { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, -10px); }
}
.hint-emoji { font-size: 1.1rem; }
.hint-text { font-size: 0.8rem; color: var(--text-dark); font-weight: 600; }

/* ════════════════════════════════════════ */
/* 💖 左下：超大换装主按钮                    */
/* ════════════════════════════════════════ */
/* 左下换装按钮：贴屏幕左边 */
.main-action-btn {
    display: none; /* 已移除，换装功能移至底部Tab栏 */
}
@keyframes mainBtnPulse {
    0%, 100% {
        box-shadow:
            0 12px 28px rgba(255, 94, 147, 0.5),
            0 0 0 4px rgba(255, 94, 147, 0.15),
            inset 0 -5px 12px rgba(0, 0, 0, 0.1),
            inset 0 5px 10px rgba(255, 255, 255, 0.4);
    }
    50% {
        box-shadow:
            0 12px 28px rgba(255, 94, 147, 0.6),
            0 0 0 10px rgba(255, 94, 147, 0.08),
            inset 0 -5px 12px rgba(0, 0, 0, 0.1),
            inset 0 5px 10px rgba(255, 255, 255, 0.4);
    }
}
.main-action-btn:hover {
    transform: scale(1.06);
}
.main-action-btn:active {
    transform: scale(0.94);
}
.main-action-text {
    font-size: clamp(2.1rem, 2.6vw, 3.6rem);
    font-weight: 900;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    line-height: 1;
    margin-bottom: 4px;
}
.main-action-sub {
    font-size: clamp(0.66rem, 0.8vw, 1rem);
    color: #fff;
    font-weight: 800;
    letter-spacing: 2px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ════════════════════════════════════════ */
/* 🎀 底部图标 Tab 栏                         */
/* ════════════════════════════════════════ */
.bottom-tabbar {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    border-radius: var(--radius-round);
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 30;
}

.tab-btn {
    min-width: clamp(54px, 6.5vw, 86px);
    padding: clamp(6px, 0.9vw, 10px) clamp(10px, 1.4vw, 18px);
    border-radius: var(--radius-round);
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    transition: all 0.18s;
    color: var(--text-mid);
}
.tab-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    color: var(--pink-deep);
}
.tab-btn.active {
    background: linear-gradient(135deg, var(--pink-main), var(--pink-deep));
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 94, 147, 0.4);
    transform: translateY(-4px);
}
.tab-btn.active .tab-text { color: #fff; }

.tab-emoji {
    font-size: clamp(1.3rem, 1.6vw, 1.95rem);
    line-height: 1;
}
.tab-text {
    font-size: clamp(0.66rem, 0.82vw, 0.92rem);
    font-weight: 700;
    letter-spacing: 0.3px;
    color: inherit;
}

/* 中间突出按钮 */
.tab-btn-center {
    transform: translateY(-14px) scale(1.2);
    background: linear-gradient(135deg, var(--pink-main), var(--pink-deep));
    color: #fff;
    box-shadow: 0 6px 16px rgba(255, 94, 147, 0.5);
    border: 3px solid #fff;
    padding: 10px 14px;
}
.tab-btn-center:hover {
    transform: translateY(-18px) scale(1.25);
    background: linear-gradient(135deg, var(--pink-main), var(--pink-deep));
    color: #fff;
}
.tab-btn-center .tab-text { color: #fff; }
.tab-btn-center.active {
    transform: translateY(-18px) scale(1.25);
}

/* ════════════════════════════════════════ */
/* 🗂 抽屉面板（底部弹出）                    */
/* ════════════════════════════════════════ */
.drawer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 68vh;
    background: linear-gradient(180deg, #fff 0%, var(--pink-bg) 100%);
    border-radius: var(--radius-big) var(--radius-big) 0 0;
    box-shadow: 0 -12px 40px rgba(255, 94, 147, 0.25);
    z-index: 80;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(.34,1.56,.64,1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.drawer.open {
    transform: translateY(0);
}
.drawer-mask {
    position: absolute;
    inset: 0;
    background: rgba(74, 42, 58, 0.35);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
    z-index: 75;
    backdrop-filter: blur(2px);
}
.drawer-mask.open {
    opacity: 1;
    visibility: visible;
}
.drawer-handle {
    width: 48px;
    height: 5px;
    background: var(--pink-soft);
    border-radius: var(--radius-round);
    margin: 10px auto 4px;
    flex-shrink: 0;
}
.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px 12px;
    flex-shrink: 0;
}
.drawer-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: 0.5px;
}
.drawer-close {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: var(--pink-soft);
    color: var(--pink-deep);
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s;
}
.drawer-close:hover {
    background: var(--pink-main);
    color: #fff;
    transform: rotate(90deg);
}
.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px 24px;
    -webkit-overflow-scrolling: touch;
}
.drawer-body::-webkit-scrollbar { width: 6px; }
.drawer-body::-webkit-scrollbar-thumb { background: var(--pink-main); border-radius: 3px; }

.panel-content { display: none; }
.panel-content.active {
    display: block;
    animation: tabFadeIn 0.25s ease-out;
}
@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════════════════════ */
/* 🃏 服装/场景卡片                           */
/* ════════════════════════════════════════ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
}

.selectable-card {
    position: relative;
    aspect-ratio: 2 / 3;
    background: #fff;
    border: 3px solid transparent;
    border-radius: var(--radius-mid);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.18s;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(255, 139, 179, 0.15);
}
.selectable-card:hover {
    transform: translateY(-4px) scale(1.02);
    border-color: var(--pink-main);
    box-shadow: 0 10px 22px rgba(255, 94, 147, 0.3);
}
.selectable-card.active {
    border-color: var(--pink-deep);
    box-shadow:
        0 0 0 3px rgba(255, 94, 147, 0.25),
        0 10px 22px rgba(255, 94, 147, 0.4);
}
.selectable-card.active::after {
    content: "✓";
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--pink-main), var(--pink-deep));
    color: #fff;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(255, 94, 147, 0.5);
}
.selectable-card.locked {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(0.5);
}
.selectable-card.locked:hover {
    transform: none;
}
.selectable-card.locked::before {
    content: "🔒";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.6rem;
    z-index: 2;
}

.card-thumbnail {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--pink-bg), var(--pink-soft));
    overflow: hidden;
}
.card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.card-label {
    padding: 8px 6px;
    background: #fff;
    color: var(--text-dark);
    font-size: 0.88rem;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-rarity {
    position: absolute;
    top: 6px;
    left: 6px;
    font-size: 0.72rem;
    font-weight: 900;
    padding: 3px 8px;
    border-radius: var(--radius-round);
    z-index: 1;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.12);
}
.card-rarity.N { background: #b99aac; color: #fff; }
.card-rarity.R { background: var(--mint); color: #fff; }
.card-rarity.SR { background: linear-gradient(135deg, var(--purple-soft), var(--pink-main)); color: #fff; }
.card-rarity.SSR { background: linear-gradient(135deg, var(--gold), #ff9a3d); color: #fff; }

/* ════════════════════════════════════════ */
/* 📖 章节列表                               */
/* ════════════════════════════════════════ */
.chapter-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.chapter-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: #fff;
    border: 2px solid transparent;
    border-radius: var(--radius-mid);
    cursor: pointer;
    transition: all 0.18s;
    box-shadow: 0 4px 12px rgba(255, 139, 179, 0.15);
}
.chapter-item:hover {
    border-color: var(--pink-main);
    transform: translateX(4px);
    box-shadow: 0 8px 18px rgba(255, 94, 147, 0.25);
}
.chapter-item.locked {
    opacity: 0.55;
    cursor: not-allowed;
    filter: grayscale(0.4);
}
.chapter-item.locked:hover { transform: none; }
.chapter-item.completed {
    background: linear-gradient(135deg, #fff 0%, var(--pink-bg) 100%);
}
.chapter-item.completed .chapter-icon {
    background: linear-gradient(135deg, var(--mint), #5ec4b0);
    color: #fff;
}
.chapter-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--pink-main), var(--pink-deep));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(255, 94, 147, 0.3);
    border: 2px solid #fff;
}
.chapter-info { flex: 1; min-width: 0; }
.chapter-name {
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 4px;
}
.chapter-meta {
    font-size: 0.85rem;
    color: var(--text-mid);
}
.chapter-arrow {
    color: var(--pink-main);
    font-size: 1.4rem;
    font-weight: 800;
}

/* ════════════════════════════════════════ */
/* 📷 相册                                  */
/* ════════════════════════════════════════ */
.album-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
}
.album-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: var(--text-mid);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.9;
}
.album-item {
    aspect-ratio: 9 / 16;
    background: #fff;
    border: 2px solid transparent;
    border-radius: var(--radius-mid);
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(255, 139, 179, 0.15);
    transition: all 0.18s;
}
.album-item:hover {
    transform: translateY(-3px);
    border-color: var(--pink-main);
}
.album-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ════════════════════════════════════════ */
/* 💬 对话框（剧情）                          */
/* ════════════════════════════════════════ */
.dialogue-box {
    position: absolute;
    left: 50%;
    bottom: 110px;
    transform: translateX(-50%);
    width: calc(100% - 60px);
    max-width: 680px;
    background: var(--glass-bg);
    border: 3px solid #fff;
    border-radius: var(--radius-big);
    padding: 18px 24px 40px;
    backdrop-filter: blur(16px);
    z-index: 60;
    cursor: pointer;
    box-shadow: 0 14px 40px rgba(255, 94, 147, 0.3);
    animation: dialogueIn 0.3s ease-out;
}
@keyframes dialogueIn {
    from { opacity: 0; transform: translate(-50%, 20px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}
.dialogue-speaker {
    display: inline-block;
    background: linear-gradient(135deg, var(--pink-main), var(--pink-deep));
    color: #fff;
    font-size: 0.85rem;
    font-weight: 800;
    padding: 4px 14px;
    border-radius: var(--radius-round);
    margin-bottom: 10px;
    letter-spacing: 0.5px;
    box-shadow: 0 3px 8px rgba(255, 94, 147, 0.35);
}
.dialogue-speaker:empty { display: none; }

.dialogue-text {
    font-size: 1.02rem;
    line-height: 1.75;
    color: var(--text-dark);
    min-height: 1.7em;
    letter-spacing: 0.3px;
    font-weight: 500;
}
.dialogue-text.typing::after {
    content: '▌';
    color: var(--pink-main, #f472b6);
    animation: cursorBlink 0.6s steps(2) infinite;
    margin-left: 1px;
    font-weight: 400;
}
@keyframes cursorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}
.dialogue-box.narration {
    background: rgba(255, 255, 255, 0.85);
}
.dialogue-box.narration .dialogue-text {
    color: var(--text-mid);
    font-style: italic;
    text-align: center;
}

.dialogue-choices {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}
.dialogue-choices:empty { display: none; }
.dialogue-choice {
    padding: 12px 18px;
    background: #fff;
    border: 2px solid var(--pink-soft);
    border-radius: var(--radius-mid);
    color: var(--text-dark);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s;
    text-align: left;
}
.dialogue-choice:hover {
    background: linear-gradient(135deg, var(--pink-soft), var(--pink-bg));
    border-color: var(--pink-deep);
    transform: translateX(6px);
    box-shadow: 0 4px 10px rgba(255, 94, 147, 0.2);
}

.dialogue-indicator {
    position: absolute;
    right: 20px;
    bottom: 14px;
    color: var(--pink-deep);
    font-size: 0.8rem;
    font-weight: 700;
    animation: blink 1.2s ease-in-out infinite;
}
@keyframes blink {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}
.dialogue-box.has-choices .dialogue-indicator { display: none; }

/* ════════════════════════════════════════ */
/* 🌸 菜单弹层                                */
/* ════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(74, 42, 58, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
}
.modal-overlay.active { display: flex; }

.modal-cute {
    background: #fff;
    border-radius: var(--radius-big);
    padding: 28px;
    min-width: min(300px, 90vw);
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(255, 94, 147, 0.3);
    border: 3px solid var(--pink-soft);
}
.modal-cute h2 {
    margin: 0 0 20px;
    color: var(--pink-deep);
    font-size: 1.3rem;
    text-align: center;
    font-weight: 900;
}
.menu-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.menu-btn {
    padding: 12px 18px;
    background: linear-gradient(135deg, var(--pink-bg), var(--pink-soft));
    border: 2px solid transparent;
    border-radius: var(--radius-mid);
    color: var(--text-dark);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    text-align: left;
    transition: all 0.18s;
    display: block;
}
.menu-btn:hover {
    background: linear-gradient(135deg, var(--pink-main), var(--pink-deep));
    color: #fff;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(255, 94, 147, 0.35);
}
.modal-actions {
    margin-top: 20px;
    text-align: center;
}
.btn-cute {
    padding: 10px 32px;
    background: linear-gradient(135deg, var(--pink-main), var(--pink-deep));
    border: none;
    border-radius: var(--radius-round);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 94, 147, 0.4);
    transition: all 0.18s;
}
.btn-cute:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(255, 94, 147, 0.5);
}

/* ════════════════════════════════════════ */
/* 🍬 Toast                                  */
/* ════════════════════════════════════════ */
.toast-container {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 500;
    pointer-events: none;
}
.toast {
    padding: 10px 22px;
    background: var(--glass-bg);
    border: 2px solid #fff;
    border-radius: var(--radius-round);
    color: var(--text-dark);
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(14px);
    animation: toastIn 0.3s ease-out;
}
.toast.success { color: var(--mint); border-color: var(--mint); }
.toast.error { color: #ff5e6c; border-color: #ff5e6c; }
.toast.warning { color: #ff9a3d; border-color: #ff9a3d; }
@keyframes toastIn {
    from { opacity: 0; transform: translateY(-16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════════════════════ */
/* 📱 移动端适配（平板 & 手机）              */
/* 注：大部分 UI 尺寸由 clamp() 已经连续缩放 */
/* 这里只处理需要"布局重构"的部分           */
/* ════════════════════════════════════════ */

/* 平板 / 窄桌面 (≤ 900px)：立绘开始向中间移动 */
@media (max-width: 900px) {
    .character-wrap {
        /* 居中：absolute 元素需要明确 width 才能让 margin auto 生效 */
        left: 0;
        right: 0;
        width: 70vw;
        max-width: 70vw;
        margin-left: auto;
        margin-right: auto;
    }
}

/* 手机端 (≤ 640px)：立绘完全居中，布局紧凑 */
@media (max-width: 640px) {
    /* ═══════════════════════════════════════════════════ */
    /* 📱 手机端 UI 全面适配（≤640px）                      */
    /* 设计原则：大按钮易操作，资源竖排右侧，不裁切不拥挤    */
    /* ═══════════════════════════════════════════════════ */

    /* ── 顶部栏：只保留导航按钮+章节名，资源移到右侧 ── */
    .top-bar {
        left: 0;
        right: 0;
        padding: 8px 10px;
        flex-wrap: nowrap;
        gap: 8px;
        overflow: hidden;
    }
    .top-left {
        gap: 6px;
        flex-shrink: 0;
        order: 1;
    }
    .top-center {
        order: 2;
        flex: 1;
        min-width: 0;
    }
    .top-right {
        order: 3;
        gap: 6px;
        flex-shrink: 0;
    }

    /* 顶部按钮：大尺寸易点击 */
    .pill-btn {
        width: 52px;
        height: 52px;
        font-size: 1.4rem;
        flex-shrink: 0;
    }

    /* 资源胶囊：手机端从顶栏移到右侧竖排 */
    .resource-pill {
        position: fixed;
        right: 8px;
        z-index: 45;
        padding: 8px 14px 8px 10px;
        gap: 6px;
        min-width: 0;
        border-radius: 22px;
        background: rgba(255, 255, 255, 0.88);
        border: 2px solid rgba(255, 255, 255, 0.95);
        box-shadow: 0 4px 14px rgba(255, 139, 179, 0.22);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        flex-shrink: 0;
    }
    /* 三个资源胶囊竖排定位 —— 从顶部栏下方开始，留足间距 */
    .top-right > .resource-pill:first-child { top: 64px; }   /* 💝 好感度 */
    .resource-pill.res-gold { top: 116px; }                   /* 金币 */
    .resource-pill.res-normal { top: 168px; }                 /* 像素点 */

    .res-icon { font-size: 1.15rem; }
    .res-num { font-size: 1rem; font-weight: 800; }
    .res-coin-icon { width: 22px; height: 22px; }

    /* 章节胶囊 */
    .chapter-pill {
        font-size: 0.95rem;
        padding: 8px 16px;
        max-width: 160px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        flex-shrink: 1;
        min-width: 0;
    }

    /* 手机端隐藏全屏按钮和音量按钮（节省空间） */
    #btnFullscreen { display: none; }
    #btnAudioToggle { display: none; }
    /* 手机端隐藏右侧信息卡 */
    .side-info-right { display: none; }

    /* ── 左侧导航：大按钮，易操作 ── */
    .side-nav-left {
        top: 50%;
        left: 6px;
        gap: 12px;
    }
    .side-nav-left .round-nav-btn {
        width: 56px;
        height: 56px;
        border-width: 3px;
    }
    .side-nav-left .nav-emoji { font-size: 1.5rem; }
    .side-nav-left .nav-tag { display: none; }  /* 手机端隐藏文字标签 */
    .side-nav-left .lock-badge { font-size: 0.6rem; padding: 2px 5px; top: -3px; right: -6px; }

    /* ── 全身切换按钮：大尺寸 ── */
    .view-toggle-btn {
        width: 62px;
        height: 62px;
        font-size: 0.85rem;
        right: 10px;
        bottom: 110px;
    }

    /* ── 立绘：居中显示 ── */
    /* 胸像模式：放大到画面中心，头到腰 */
    .character-wrap {
        height: 240%;
        width: auto;
        max-width: none;
        aspect-ratio: 9 / 16;
        min-width: 0;
        left: -15%;
        right: -15%;
        margin-left: 0;
        margin-right: 0;
        top: 10%;
    }
    /* 全身模式 */
    .character-layer.fullbody .character-wrap {
        top: 8%;
        height: 90%;
        width: auto;
        max-width: none;
        left: 5%;
        right: 5%;
        margin-left: 0;
    }

    /* ── 底部 tabbar：灰色底，按钮塞满，点击高亮 ── */
    .bottom-tabbar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        transform: none;
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)) 4px;
        gap: 0;
        border-radius: 18px 18px 0 0;
        flex-wrap: nowrap;
        background: rgba(230, 230, 235, 0.92);
        border: none;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        z-index: 100;
    }
    .tab-btn {
        min-width: 0;
        padding: 10px 2px 8px;
        flex: 1 1 0;
        gap: 3px;
        border-radius: 12px;
        color: rgba(80, 80, 90, 0.7);
        background: transparent;
        transition: color 0.2s, background 0.2s;
    }
    .tab-btn:hover {
        background: rgba(0, 0, 0, 0.05);
        color: rgba(80, 80, 90, 0.9);
    }
    .tab-btn.active {
        background: transparent;
        color: #ff8bb3;
        box-shadow: none;
        transform: none;
    }
    .tab-btn.active .tab-text { color: #ff8bb3; }
    .tab-btn.active .tab-emoji { filter: none; }
    /* 未激活时 emoji 灰度化 */
    .tab-btn:not(.active) .tab-emoji {
        filter: grayscale(60%) opacity(0.5);
        transition: filter 0.2s;
    }
    .tab-btn:hover .tab-emoji {
        filter: grayscale(20%) opacity(0.8);
    }
    .tab-emoji { font-size: 2.0rem; }
    .tab-text { font-size: 1.12rem; font-weight: 600; letter-spacing: 0; color: inherit; }
    /* 手机端中间换装按钮：保持高亮但不突出 */
    .tab-btn-center {
        transform: none;
        border: none;
        padding: 10px 2px 8px;
        box-shadow: none;
        background: rgba(255, 94, 147, 0.15);
        color: #ff8bb3;
    }
    .tab-btn-center .tab-emoji { filter: none !important; }
    .tab-btn-center .tab-text { color: #ff8bb3; }
    .tab-btn-center:hover {
        transform: none;
        background: rgba(255, 94, 147, 0.25);
    }
    .tab-btn-center.active {
        transform: none;
        background: rgba(255, 94, 147, 0.3);
    }

    /* ── 抽屉面板 ── */
    .drawer { max-height: 58vh; }
    .drawer-body { padding: 0 10px 16px; }

    /* ── 卡片网格：手机上固定 3 列 ── */
    .card-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .album-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    /* ── 舞台提示 ── */
    .stage-hint { top: 90px; }

    /* ── 对话框 ── */
    .dialogue-box {
        width: calc(100% - 16px);
        padding: 12px 14px 28px;
        bottom: 84px;
    }
}

/* 超小手机 (≤ 380px)：卡片改为 2 列 */
@media (max-width: 380px) {
    .card-grid { grid-template-columns: repeat(2, 1fr); }
    .album-list { grid-template-columns: repeat(2, 1fr); }
    .character-wrap { width: 100%; left: 0; right: 0; }
}

/* 妯睆浼樺寲 */
@media (max-height: 500px) and (orientation: landscape) {
    .character-wrap { height: 85%; }
    .main-action-btn { bottom: 90px; }
    .stage-hint { display: none; }
}

/* ════════════════════════════════════════ */
/* 🌸 两侧装饰层：桌面端填充空白的樱花/爱心/星星 */
/* ════════════════════════════════════════ */
.side-decor {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 22vw;
    max-width: 340px;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}
.side-decor-left { left: 0; }
.side-decor-right { right: 0; }

/* 柔光气泡（两侧更大的粉色光晕） */
.decor-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.55;
    mix-blend-mode: screen;
    animation: blobDrift 14s ease-in-out infinite;
}
.decor-blob-1 {
    width: 280px; height: 280px;
    top: 20%; left: -80px;
    background: radial-gradient(circle, #ff8bb3 0%, transparent 70%);
}
.decor-blob-2 {
    width: 320px; height: 320px;
    bottom: 10%; right: -100px;
    background: radial-gradient(circle, #b8a5ff 0%, transparent 70%);
    animation-delay: -6s;
}
@keyframes blobDrift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33%     { transform: translate(20px, -30px) scale(1.08); }
    66%     { transform: translate(-15px, 20px) scale(0.95); }
}

/* 飘落樱花/小花 */
.decor-sakura {
    position: absolute;
    font-size: 1.5rem;
    opacity: 0;
    filter: drop-shadow(0 4px 8px rgba(255, 94, 147, 0.25));
    animation: sakuraFall 10s linear infinite;
    will-change: transform, opacity;
}
.decor-sakura-1 { left: 18%; font-size: 1.8rem; animation-delay: 0s;    animation-duration: 11s; }
.decor-sakura-2 { left: 62%; font-size: 1.3rem; animation-delay: -3s;   animation-duration: 9s;  }
.decor-sakura-3 { left: 40%; font-size: 2.1rem; animation-delay: -6s;   animation-duration: 13s; }
.decor-sakura-4 { left: 28%; font-size: 1.6rem; animation-delay: -1.5s; animation-duration: 10s; }
.decor-sakura-5 { left: 70%; font-size: 2rem;   animation-delay: -4.5s; animation-duration: 12s; }
.decor-sakura-6 { left: 50%; font-size: 1.4rem; animation-delay: -8s;   animation-duration: 14s; }

@keyframes sakuraFall {
    0%   { transform: translate(0, -10%) rotate(0deg);     opacity: 0; }
    10%  { opacity: 0.85; }
    50%  { transform: translate(20px, 50vh) rotate(180deg); }
    90%  { opacity: 0.9; }
    100% { transform: translate(-15px, 110vh) rotate(360deg); opacity: 0; }
}

/* 漂浮爱心/星星（轻微上下浮动，不掉落） */
.decor-heart, .decor-star {
    position: absolute;
    font-size: 1.6rem;
    filter: drop-shadow(0 3px 6px rgba(255, 94, 147, 0.3));
    animation: decorBob 5s ease-in-out infinite;
}
.decor-heart-1 { top: 22%; left: 10%; font-size: 1.8rem; animation-delay: -1s; }
.decor-heart-2 { top: 65%; right: 14%; font-size: 2rem; animation-delay: -2.5s; }
.decor-star-1  { top: 10%; right: 16%; font-size: 1.3rem; animation-delay: 0s;   }
.decor-star-2  { top: 70%; left: 24%;  font-size: 1.5rem; animation-delay: -1.5s; }
.decor-star-3  { top: 35%; left: 16%;  font-size: 1.2rem; animation-delay: -3s; }
.decor-star-4  { top: 50%; right: 24%; font-size: 1.7rem; animation-delay: -4s; }

@keyframes decorBob {
    0%, 100% { transform: translateY(0) rotate(0deg);   opacity: 0.7; }
    50%      { transform: translateY(-14px) rotate(8deg); opacity: 1; }
}

/* 窄屏自动隐藏装饰层，避免遮挡主UI */
@media (max-width: 1024px) {
    .side-decor { width: 14vw; }
    .decor-heart, .decor-star, .decor-sakura { opacity: 0.6; }
    .decor-blob { opacity: 0.35; }
}
@media (max-width: 720px) {
    .side-decor { display: none; }
}

/* 用户偏好关闭动效时，停掉装饰动画 */
@media (prefers-reduced-motion: reduce) {
    .decor-sakura, .decor-heart, .decor-star, .decor-blob { animation: none; }
}

/* ═══════════════════════════════════════════════════════════
   🎬 视频过场层（开场 / 结尾 / 剧情中插）
   ═══════════════════════════════════════════════════════════ */
.video-cutscene {
    position: fixed;
    inset: 0;
    z-index: 9500;
    background: #000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.video-cutscene.active {
    opacity: 1;
}
.video-cutscene-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    outline: none;
}

/* 顶部标签（小小的，不打扰画面） */
.video-cutscene-topbar {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 999px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    pointer-events: none;
    opacity: 0.85;
}
.video-cutscene-label::before {
    content: '🎬 ';
    margin-right: 4px;
}

/* 跳过按钮（右下角，3 秒后出现） */
.video-cutscene-skip {
    position: absolute;
    right: 24px;
    bottom: 32px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    background: rgba(255, 255, 255, 0.14);
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    border-radius: 999px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateX(14px);
    transition: opacity 0.35s ease, transform 0.35s ease, background 0.2s, border-color 0.2s;
}
.video-cutscene-skip.ready {
    opacity: 1;
    transform: translateX(0);
}
.video-cutscene-skip:hover {
    background: rgba(255, 255, 255, 0.28);
    border-color: #fff;
}
.video-cutscene-skip .skip-icon {
    font-size: 1.1rem;
    font-weight: 700;
    transform: translateY(-1px);
}

/* 底部小提示 */
.video-cutscene-hint {
    position: absolute;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    pointer-events: none;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* 手机端：跳过按钮更贴近拇指热区 */
@media (max-width: 720px) {
    .video-cutscene-skip {
        right: 14px;
        bottom: 20px;
        padding: 10px 18px;
        font-size: 0.9rem;
    }
    .video-cutscene-topbar {
        font-size: 0.78rem;
        padding: 5px 11px;
    }
    .video-cutscene-hint {
        font-size: 0.7rem;
        bottom: 64px; /* 避免被跳过按钮压住 */
    }
}

/* ═══════════════════════════════════════════════════════════
   📖 对话框内工具按钮（退出剧情等）
   ═══════════════════════════════════════════════════════════ */
.dialogue-tools {
    position: absolute;
    top: 10px;
    right: 14px;
    display: flex;
    gap: 6px;
    z-index: 2;
}
.dialogue-tool-btn {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 139, 179, 0.4);
    border-radius: 999px;
    font-size: 0.72rem;
    color: #ad4f7b;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}
.dialogue-tool-btn:hover {
    background: #fff;
    transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════════
   🎉 章节完成结算面板
   ═══════════════════════════════════════════════════════════ */
.chapter-result {
    position: fixed;
    inset: 0;
    z-index: 9600;
    display: none;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, rgba(255, 180, 210, 0.45), rgba(60, 20, 50, 0.75));
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.26s ease;
}
.chapter-result.active {
    opacity: 1;
}
.chapter-result-card {
    width: min(420px, 88vw);
    padding: 32px 28px 24px;
    background: linear-gradient(180deg, #fff 0%, #fff5f8 100%);
    border-radius: 26px;
    box-shadow:
        0 30px 60px -20px rgba(255, 94, 147, 0.4),
        0 0 0 3px rgba(255, 180, 210, 0.35) inset;
    text-align: center;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.chapter-result.active .chapter-result-card {
    transform: scale(1) translateY(0);
}
.result-badge {
    font-size: 3.2rem;
    margin-bottom: 6px;
    filter: drop-shadow(0 4px 10px rgba(255, 139, 179, 0.5));
    animation: badgeFloat 2.4s ease-in-out infinite;
}
@keyframes badgeFloat {
    0%, 100% { transform: translateY(0) rotate(-4deg); }
    50%      { transform: translateY(-6px) rotate(4deg); }
}
.result-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e5548a;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}
.result-chapter {
    font-size: 1.05rem;
    color: #7a4864;
    font-weight: 600;
}
.result-subtitle {
    font-size: 0.85rem;
    color: #b08096;
    margin-top: 2px;
    margin-bottom: 18px;
}
.result-rewards {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin: 4px 0 22px;
    flex-wrap: wrap;
}
.result-reward {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 18px;
    background: linear-gradient(180deg, #fff0f7, #ffe4ef);
    border-radius: 16px;
    min-width: 88px;
    box-shadow: 0 4px 10px rgba(255, 139, 179, 0.15);
}
.reward-icon {
    font-size: 1.6rem;
    margin-bottom: 2px;
}
.reward-val {
    font-size: 1.1rem;
    font-weight: 700;
    color: #e5548a;
}
.reward-lbl {
    font-size: 0.72rem;
    color: #a26381;
    margin-top: 2px;
}
.result-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}
.result-actions .btn-cute {
    min-width: 110px;
}
.btn-cute-ghost {
    background: #fff !important;
    color: #e5548a !important;
    border: 1.5px solid #ffb8d2 !important;
    box-shadow: none !important;
}
.btn-cute-ghost:hover {
    background: #fff5f8 !important;
}

@media (max-width: 480px) {
    .chapter-result-card {
        padding: 26px 20px 20px;
    }
    .result-title { font-size: 1.3rem; }
    .result-badge { font-size: 2.6rem; }
    .result-rewards { gap: 10px; }
    .result-reward {
        min-width: 72px;
        padding: 8px 14px;
    }
}

/* ═══════════════════════════════════════════════════════════
   ✨ UI 动效增强 — 换装 / 场景转场 / 粒子
   ═══════════════════════════════════════════════════════════ */

/* ── 换装闪烁：短暂白闪 + 缩小 ── */
.character-wrap.outfit-changing {
    animation: outfitFlash 0.18s ease-out forwards;
}
@keyframes outfitFlash {
    0%   { filter: drop-shadow(0 16px 32px rgba(255, 94, 147, 0.25)) brightness(1); transform: translateY(0) scale(1); }
    50%  { filter: drop-shadow(0 0 40px rgba(255, 255, 255, 0.9)) brightness(1.6); transform: translateY(0) scale(0.96); }
    100% { filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.5)) brightness(1.3); transform: translateY(0) scale(0.97); }
}

/* ── 换装弹跳：切换完成后弹回 ── */
.character-wrap.outfit-bounce {
    animation: outfitBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes outfitBounce {
    0%   { transform: translateY(0) scale(0.97); filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.5)) brightness(1.3); }
    40%  { transform: translateY(-12px) scale(1.04); filter: drop-shadow(0 20px 36px rgba(255, 94, 147, 0.4)) brightness(1.05); }
    70%  { transform: translateY(3px) scale(0.99); }
    100% { transform: translateY(0) scale(1); filter: drop-shadow(0 16px 32px rgba(255, 94, 147, 0.25)) brightness(1); }
}

/* ── 场景转场：淡出 + 轻微缩放 ── */
.scene-bg.scene-transitioning {
    animation: sceneOut 0.35s ease-out forwards;
}
@keyframes sceneOut {
    0%   { opacity: 1; transform: scale(1); filter: saturate(1.05) brightness(1.02); }
    100% { opacity: 0; transform: scale(1.03); filter: saturate(0.5) brightness(0.7) blur(4px); }
}

/* ── 场景转场闪光覆盖 ── */
.scene-overlay.scene-flash {
    background: rgba(255, 255, 255, 0.6) !important;
    transition: background 0.3s ease;
}
.scene-overlay.scene-flash-in {
    animation: sceneFlashIn 0.4s ease-out forwards;
}
@keyframes sceneFlashIn {
    0%   { background: rgba(255, 255, 255, 0.4); }
    100% { background: transparent; }
}

/* ── 换装粒子特效 ── */
.outfit-particle {
    position: fixed;
    font-size: 1.4rem;
    pointer-events: none;
    z-index: 9999;
    animation: particleBurst 0.75s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    will-change: transform, opacity;
}
@keyframes particleBurst {
    0% {
        transform: translate(0, 0) scale(0.3) rotate(0deg);
        opacity: 1;
    }
    60% {
        opacity: 1;
    }
    100% {
        transform: translate(var(--dx), var(--dy)) scale(1.1) rotate(180deg);
        opacity: 0;
    }
}

/* ── 角色入场动画（首次加载） ── */
.character-wrap.char-entrance {
    animation: charEntrance 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes charEntrance {
    0%   { opacity: 0; transform: translateY(40px) scale(0.9); }
    60%  { opacity: 1; transform: translateY(-8px) scale(1.02); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── 底部Tab切换时的微弹动画 ── */
.tab-btn.tab-switching {
    animation: tabPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes tabPop {
    0%   { transform: translateY(0) scale(1); }
    50%  { transform: translateY(-6px) scale(1.15); }
    100% { transform: translateY(-4px) scale(1); }
}

/* ── 抽屉打开时卡片依次入场 ── */
.panel-content.active .selectable-card,
.panel-content.active .chapter-item {
    animation: cardStagger 0.35s ease-out backwards;
}
.panel-content.active .selectable-card:nth-child(1),
.panel-content.active .chapter-item:nth-child(1) { animation-delay: 0.03s; }
.panel-content.active .selectable-card:nth-child(2),
.panel-content.active .chapter-item:nth-child(2) { animation-delay: 0.06s; }
.panel-content.active .selectable-card:nth-child(3),
.panel-content.active .chapter-item:nth-child(3) { animation-delay: 0.09s; }
.panel-content.active .selectable-card:nth-child(4),
.panel-content.active .chapter-item:nth-child(4) { animation-delay: 0.12s; }
.panel-content.active .selectable-card:nth-child(5),
.panel-content.active .chapter-item:nth-child(5) { animation-delay: 0.15s; }
.panel-content.active .selectable-card:nth-child(6),
.panel-content.active .chapter-item:nth-child(6) { animation-delay: 0.18s; }
@keyframes cardStagger {
    0%   { opacity: 0; transform: translateY(16px) scale(0.92); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── 服装卡片选中时的脉冲光环 ── */
.selectable-card.active {
    animation: cardActivePulse 2s ease-in-out infinite;
}
@keyframes cardActivePulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(255, 94, 147, 0.25), 0 10px 22px rgba(255, 94, 147, 0.4); }
    50%      { box-shadow: 0 0 0 6px rgba(255, 94, 147, 0.15), 0 10px 22px rgba(255, 94, 147, 0.5); }
}

/* ── 用户偏好：减少动效 ── */
@media (prefers-reduced-motion: reduce) {
    .character-wrap.outfit-changing,
    .character-wrap.outfit-bounce,
    .character-wrap.char-entrance,
    .scene-bg.scene-transitioning,
    .outfit-particle,
    .tab-btn.tab-switching,
    .panel-content.active .selectable-card,
    .panel-content.active .chapter-item,
    .selectable-card.active {
        animation: none !important;
    }
}

/* ═══════════════════════════════════════════════════════════
   💖 好感度系统 UI
   ═══════════════════════════════════════════════════════════ */

/* ── 好感度进度条动画增强 ── */
.stat-fill.stat-fill-animating {
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* ── 好感度获得浮动提示 ── */
.toast.affection-toast {
    background: linear-gradient(135deg, #fff0f7, #ffe4ef) !important;
    border-color: var(--pink-main) !important;
    color: var(--pink-deep) !important;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}
.affection-gain-icon {
    font-size: 1.1rem;
    animation: heartPop 0.4s ease-out;
}
.affection-gain-reason {
    font-size: 0.78rem;
    color: var(--text-mid);
    font-weight: 500;
}
@keyframes heartPop {
    0%   { transform: scale(0.5); opacity: 0; }
    50%  { transform: scale(1.3); }
    100% { transform: scale(1); opacity: 1; }
}

/* ── 升级弹窗 ── */
.levelup-overlay {
    position: fixed;
    inset: 0;
    z-index: 9700;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, rgba(255, 180, 210, 0.5), rgba(60, 20, 50, 0.7));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 20px;
}
.levelup-overlay.active {
    opacity: 1;
}
.levelup-card {
    width: min(380px, 88vw);
    padding: 36px 28px 28px;
    background: linear-gradient(180deg, #fff 0%, #fff5f8 100%);
    border-radius: 28px;
    box-shadow:
        0 30px 60px -20px rgba(255, 94, 147, 0.45),
        0 0 0 3px rgba(255, 180, 210, 0.4) inset,
        0 0 80px rgba(255, 139, 179, 0.2);
    text-align: center;
    transform: scale(0.85) translateY(30px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.levelup-overlay.active .levelup-card {
    transform: scale(1) translateY(0);
}
.levelup-sparkle {
    font-size: 2.8rem;
    margin-bottom: 8px;
    animation: sparkleFloat 1.5s ease-in-out infinite;
}
@keyframes sparkleFloat {
    0%, 100% { transform: translateY(0) scale(1); }
    50%      { transform: translateY(-6px) scale(1.08); }
}
.levelup-title {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--pink-deep);
    margin-bottom: 8px;
    letter-spacing: 0.1em;
    text-shadow: 0 2px 8px rgba(255, 94, 147, 0.2);
}
.levelup-level {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
}
.levelup-relation {
    font-size: 1.1rem;
    color: var(--pink-main);
    font-weight: 800;
    margin-bottom: 12px;
    padding: 6px 18px;
    background: linear-gradient(135deg, #fff0f7, #ffe4ef);
    border-radius: var(--radius-round);
    display: inline-block;
}
.levelup-unlock {
    font-size: 0.9rem;
    color: var(--gold);
    font-weight: 700;
    margin-bottom: 18px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 1.5px solid rgba(255, 200, 87, 0.5);
    border-radius: var(--radius-mid);
}
.levelup-close {
    margin-top: 8px;
    min-width: 120px;
}

/* ── 升级弹窗手机端适配 ── */
@media (max-width: 480px) {
    .levelup-card {
        padding: 28px 20px 22px;
    }
    .levelup-sparkle { font-size: 2.2rem; }
    .levelup-title { font-size: 1.3rem; }
    .levelup-level { font-size: 1.1rem; }
}

/* ═══════════════════════════════════════════════════════════
   📱 移动端体验增强
   ═══════════════════════════════════════════════════════════ */

/* ── iOS / Android 底部安全区适配 ── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .bottom-tabbar {
        padding-bottom: calc(6px + env(safe-area-inset-bottom));
    }
    .main-action-btn {
        bottom: calc(92px + env(safe-area-inset-bottom));
    }
    .dialogue-box {
        bottom: calc(110px + env(safe-area-inset-bottom));
    }
    .drawer {
        padding-bottom: env(safe-area-inset-bottom);
    }
    .video-cutscene-skip {
        bottom: calc(32px + env(safe-area-inset-bottom));
    }
    .video-cutscene-hint {
        bottom: calc(20px + env(safe-area-inset-bottom));
    }
}

/* 手机端安全区细化 */
@media (max-width: 640px) {
    @supports (padding-bottom: env(safe-area-inset-bottom)) {
        .bottom-tabbar {
            padding-bottom: calc(8px + env(safe-area-inset-bottom));
        }
        .main-action-btn {
            bottom: calc(80px + env(safe-area-inset-bottom));
        }
        .dialogue-box {
            bottom: calc(86px + env(safe-area-inset-bottom));
        }
    }
}

/* ── 触摸反馈增强：按下态 ── */
@media (hover: none) and (pointer: coarse) {
    /* 触屏设备：取消 hover 效果，改用 active 态 */
    .pill-btn:hover,
    .round-nav-btn:hover,
    .tab-btn:hover,
    .selectable-card:hover,
    .chapter-item:hover,
    .menu-btn:hover,
    .dialogue-choice:hover {
        transform: none;
        box-shadow: inherit;
    }

    /* 按下时的缩放反馈 */
    .pill-btn:active {
        transform: scale(0.9);
        transition: transform 0.08s;
    }
    .round-nav-btn:active {
        transform: scale(0.88);
        transition: transform 0.08s;
    }
    .tab-btn:active {
        transform: scale(0.92);
        transition: transform 0.08s;
    }
    .selectable-card:active {
        transform: scale(0.95);
        transition: transform 0.08s;
        border-color: var(--pink-main);
    }
    .chapter-item:active {
        transform: scale(0.97);
        transition: transform 0.08s;
        border-color: var(--pink-main);
    }
    .menu-btn:active {
        transform: scale(0.97);
        background: linear-gradient(135deg, var(--pink-main), var(--pink-deep));
        color: #fff;
    }
    .dialogue-choice:active {
        transform: scale(0.97);
        background: linear-gradient(135deg, var(--pink-soft), var(--pink-bg));
        border-color: var(--pink-deep);
    }
    .main-action-btn:active {
        transform: scale(0.88);
        transition: transform 0.08s;
    }
    .view-toggle-btn:active {
        transform: scale(0.88);
        transition: transform 0.08s;
    }

    /* 触屏设备上增大点击区域 */
    .drawer-close {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }
    .dialogue-tool-btn {
        padding: 8px 14px;
        font-size: 0.82rem;
    }
}

/* ── 抽屉拖拽手柄增强（触摸设备） ── */
.drawer-handle {
    cursor: grab;
    touch-action: none;
}
.drawer-handle:active {
    cursor: grabbing;
}
.drawer.dragging {
    transition: none !important;
}

/* ── 横屏提示遮罩 ── */
.landscape-warning {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: linear-gradient(135deg, var(--pink-soft), var(--pink-bg));
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    text-align: center;
    padding: 20px;
}
.landscape-warning-icon {
    font-size: 3.5rem;
    animation: rotatePhone 2s ease-in-out infinite;
}
@keyframes rotatePhone {
    0%, 100% { transform: rotate(0deg); }
    25%      { transform: rotate(-90deg); }
    50%      { transform: rotate(-90deg); }
    75%      { transform: rotate(0deg); }
}
.landscape-warning-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.6;
}
.landscape-warning-sub {
    font-size: 0.85rem;
    color: var(--text-mid);
}

/* 仅在手机横屏时显示提示（平板横屏不提示） */
@media (max-height: 500px) and (orientation: landscape) and (max-width: 900px) {
    .landscape-warning {
        display: flex;
    }
}

/* ── 抽屉内滚动优化 ── */
.drawer-body {
    overscroll-behavior: contain;
    scroll-behavior: smooth;
}

/* ── 防止 iOS 橡皮筋效果导致的布局跳动 ── */
.game-root {
    overscroll-behavior: none;
    touch-action: manipulation;
}

/* ── 对话框触摸区域优化 ── */
@media (max-width: 640px) {
    .dialogue-box {
        /* 增大对话框的点击区域，方便拇指操作 */
        min-height: 120px;
        padding-bottom: 38px;
    }
    .dialogue-indicator {
        font-size: 0.85rem;
        right: 16px;
        bottom: 12px;
    }
    .dialogue-choices {
        gap: 8px;
    }
    .dialogue-choice {
        padding: 14px 16px;
        font-size: 1rem;
        /* 增大触摸目标 */
        min-height: 48px;
        display: flex;
        align-items: center;
    }
}

/* ── 超小手机左侧导航微调 ── */
@media (max-width: 480px) {
    .side-nav-left {
        gap: 10px;
    }
    .side-nav-left .round-nav-btn {
        width: 50px;
        height: 50px;
    }
    .side-nav-left .nav-emoji { font-size: 1.3rem; }
    .side-nav-left .lock-badge {
        font-size: 0.55rem;
        padding: 1px 4px;
        top: -3px;
        right: -5px;
    }
}

/* ── 手机端右侧信息卡精简 ── */
@media (max-width: 480px) {
    .side-info-right {
        max-width: 140px;
    }
    .side-info-right .round-nav-btn.round-sm {
        width: 40px;
        height: 40px;
    }
    .side-info-right .round-nav-btn.round-sm .nav-emoji {
        font-size: 1.1rem;
    }
    .info-card {
        padding: 5px 10px 5px 5px;
    }
    .info-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
    .info-name { font-size: 0.75rem; }
    .info-sub { font-size: 0.6rem; }
    .stat-chip {
        padding: 4px 8px 4px 6px;
    }
    .stat-icon { font-size: 0.85rem; }
    .stat-bar { min-width: 40px; height: 6px; }
    .stat-val { font-size: 0.7rem; min-width: 24px; }
}

/* ── 超小手机底部 Tab 栏微调 ── */
@media (max-width: 480px) {
    .bottom-tabbar {
        padding: 8px 4px calc(8px + env(safe-area-inset-bottom, 0px)) 4px;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 18px 18px 0 0;
    }
    .tab-btn {
        min-width: 0;
        padding: 8px 2px;
    }
    .tab-emoji { font-size: 2.0rem; }
    .tab-text { font-size: 1.12rem; }
    .tab-btn-center {
        transform: none;
        padding: 8px 2px;
    }
    .tab-btn-center.active {
        transform: none;
    }
}

/* ── 触摸设备：禁止长按弹出菜单（图片/按钮） ── */
@media (hover: none) {
    .char-part,
    .card-thumbnail img,
    .round-nav-btn,
    .pill-btn,
    .main-action-btn {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
}

/* ════════════════════════════════════════ */
/* 📷 相册预览弹窗                            */
/* ════════════════════════════════════════ */
.album-preview-modal {
    max-width: 420px;
    padding: 20px;
    text-align: center;
}
.album-preview-modal h2 {
    margin: 0 0 12px;
    font-size: 1.2rem;
    color: var(--text-dark);
}
.album-preview-canvas-wrap {
    width: 100%;
    max-height: 55vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    border-radius: var(--radius-mid);
    overflow: hidden;
    background: #f8f0f4;
    box-shadow: 0 4px 16px rgba(255, 139, 179, 0.2);
}
.album-preview-canvas-wrap canvas {
    width: 100%;
    height: auto;
    max-height: 55vh;
    object-fit: contain;
    display: block;
    border-radius: var(--radius-mid);
}
.album-preview-info {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 14px;
    font-size: 0.82rem;
    color: var(--text-mid);
}
.album-preview-outfit,
.album-preview-scene {
    background: rgba(255, 139, 179, 0.12);
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 600;
}
.album-preview-time {
    opacity: 0.7;
    font-size: 0.75rem;
}
.album-preview-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}
.album-preview-actions .btn-cute {
    font-size: 0.82rem;
    padding: 8px 14px;
}

/* ── 相册项增强：悬浮信息条 ── */
.album-item {
    position: relative;
}
.album-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 8px;
    background: linear-gradient(to top, rgba(0,0,0,0.55), transparent);
    border-radius: 0 0 var(--radius-mid) var(--radius-mid);
    opacity: 0;
    transition: opacity 0.2s;
}
.album-item:hover .album-item-overlay {
    opacity: 1;
}
.album-item-outfit {
    color: #fff;
    font-size: 0.7rem;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.album-item-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: linear-gradient(135deg, #ffd5e4, #e8e4ff);
}

/* ── 相册预览弹窗响应式 ── */
@media (max-width: 480px) {
    .album-preview-modal {
        max-width: 95vw;
        padding: 14px;
    }
    .album-preview-canvas-wrap {
        max-height: 45vh;
    }
    .album-preview-canvas-wrap canvas {
        max-height: 45vh;
    }
    .album-preview-actions {
        gap: 6px;
    }
    .album-preview-actions .btn-cute {
        font-size: 0.75rem;
        padding: 6px 10px;
    }
}

/* ════════════════════════════════════════════════════════════ */
/* 🎴 抽卡系统                                                  */
/* ════════════════════════════════════════════════════════════ */

.gacha-panel {
    padding: 8px 4px;
}

/* ── Banner 区 ── */
.gacha-banner {
    position: relative;
    text-align: center;
    padding: 24px 18px 20px;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(168,85,247,0.18), transparent 60%),
        radial-gradient(ellipse at 70% 80%, rgba(244,114,182,0.14), transparent 60%),
        linear-gradient(160deg, rgba(30,20,50,0.9), rgba(20,14,40,0.95));
    border: 1px solid rgba(168,85,247,0.25);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    overflow: hidden;
}
/* 星光粒子装饰 */
.gacha-banner::before {
    content: "✦ ✧ ★ ✦ ✧";
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: space-around;
    font-size: 0.8rem;
    color: rgba(251,191,36,0.15);
    pointer-events: none;
    animation: gachaStarDrift 8s linear infinite;
    letter-spacing: 20px;
}
@keyframes gachaStarDrift {
    0%   { transform: translateY(0) rotate(0deg); opacity: 0.3; }
    50%  { opacity: 0.7; }
    100% { transform: translateY(-6px) rotate(3deg); opacity: 0.3; }
}
.gacha-banner-title {
    position: relative;
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, #f472b6, #c084fc, #fbbf24);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gachaTitleShimmer 4s ease-in-out infinite;
    margin-bottom: 6px;
    letter-spacing: 1px;
}
@keyframes gachaTitleShimmer {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}
.gacha-banner-sub {
    position: relative;
    font-size: 0.82rem;
    color: rgba(209,213,219,0.8);
    margin-bottom: 12px;
}
.gacha-rates {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
}
.rate-tag {
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    border: 1px solid transparent;
    backdrop-filter: blur(4px);
}
.rate-n { background: rgba(107,114,128,0.2); color: #9ca3af; border-color: rgba(107,114,128,0.25); }
.rate-r { background: rgba(96,165,250,0.15); color: #93c5fd; border-color: rgba(96,165,250,0.25); }
.rate-sr { background: rgba(168,85,247,0.15); color: #c4b5fd; border-color: rgba(168,85,247,0.3); }
.rate-ssr { background: rgba(251,191,36,0.15); color: #fde68a; border-color: rgba(251,191,36,0.3); }

/* ── 保底进度 ── */
.gacha-pity {
    position: relative;
    margin-top: 12px;
    font-size: 0.72rem;
    color: rgba(209,213,219,0.7);
}
.gacha-pity-bar {
    margin-top: 6px;
    height: 6px;
    background: rgba(55,65,81,0.6);
    border-radius: 3px;
    overflow: hidden;
}
.gacha-pity-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #a855f7, #f472b6);
    transition: width 0.4s ease;
}

/* ── 抽卡按钮 ── */
.gacha-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}
.gacha-btn {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px 10px;
    border-radius: var(--radius-lg);
    border: 2px solid transparent;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.25s;
    overflow: hidden;
}
.gacha-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.06), transparent);
    pointer-events: none;
}
.gacha-btn-single {
    background: linear-gradient(145deg, rgba(99,102,241,0.25), rgba(139,92,246,0.15));
    border-color: rgba(139,92,246,0.4);
    color: #c4b5fd;
}
.gacha-btn-ten {
    background: linear-gradient(145deg, rgba(251,191,36,0.35), rgba(245,158,11,0.22));
    border-color: rgba(251,191,36,0.6);
    color: #fff;
    text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.gacha-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(139,92,246,0.35);
}
.gacha-btn-ten:hover {
    box-shadow: 0 8px 28px rgba(251,191,36,0.5);
    border-color: rgba(251,191,36,0.8);
    background: linear-gradient(145deg, rgba(251,191,36,0.45), rgba(245,158,11,0.3));
}
.gacha-btn:active { transform: scale(0.96); }
.gacha-btn-label {
    font-size: 1rem;
    font-weight: 700;
}
.gacha-btn-cost {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.82rem;
    font-weight: 600;
    opacity: 0.9;
}
.gacha-btn-discount {
    font-size: 0.62rem;
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(239,68,68,0.8);
    color: #fff;
    font-weight: 700;
}
.gacha-coin-icon {
    width: 16px;
    height: 16px;
}

/* ── 历史记录 ── */
.gacha-history {
    border-top: 1px solid rgba(75,85,99,0.25);
    padding-top: 14px;
}
.gacha-history-title {
    font-size: 0.78rem;
    color: var(--text-mid);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.gacha-history-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
    gap: 6px;
    max-height: 180px;
    overflow-y: auto;
    scrollbar-width: thin;
}
.gacha-history-item {
    position: relative;
    aspect-ratio: 3/4;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #374151;
    transition: transform 0.15s, box-shadow 0.15s;
}
.gacha-history-item:hover {
    transform: scale(1.08);
    z-index: 2;
}
.gacha-history-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.gacha-history-item.rarity-n { border-color: #4b5563; }
.gacha-history-item.rarity-r { border-color: #3b82f6; }
.gacha-history-item.rarity-sr { border-color: #8b5cf6; box-shadow: 0 0 6px rgba(139,92,246,0.3); }
.gacha-history-item.rarity-ssr { border-color: #f59e0b; box-shadow: 0 0 10px rgba(251,191,36,0.4); }

/* ── 结果弹窗 ── */
.gacha-result-modal {
    max-width: 520px;
}
.gacha-result-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px;
    margin: 16px 0;
    max-height: 60vh;
    overflow-y: auto;
}
.gacha-result-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #374151;
    animation: gachaReveal 0.5s ease-out backwards;
    cursor: pointer;
    transition: transform 0.18s, box-shadow 0.18s;
}
.gacha-result-card:hover {
    transform: scale(1.06);
}
.gacha-result-card img {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    display: block;
}
.gacha-result-card .gacha-card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px 6px 5px;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    font-size: 0.68rem;
    color: #fff;
    text-align: center;
    font-weight: 500;
}
.gacha-result-card .gacha-card-rarity {
    position: absolute;
    top: 5px;
    right: 5px;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 0.6rem;
    font-weight: 800;
}
.gacha-result-card.rarity-n  { border-color: #6b7280; }
.gacha-result-card.rarity-r  { border-color: #3b82f6; box-shadow: 0 0 8px rgba(59,130,246,0.3); }
.gacha-result-card.rarity-sr { border-color: #8b5cf6; box-shadow: 0 0 16px rgba(139,92,246,0.45); }
.gacha-result-card.rarity-ssr {
    border-color: #f59e0b;
    box-shadow: 0 0 24px rgba(251,191,36,0.5), inset 0 0 20px rgba(251,191,36,0.08);
    animation: gachaReveal 0.5s ease-out backwards, gachaSSRGlow 2s ease-in-out infinite;
}
@keyframes gachaSSRGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(251,191,36,0.4); }
    50%      { box-shadow: 0 0 32px rgba(251,191,36,0.7), 0 0 60px rgba(251,191,36,0.15); }
}
.gacha-result-card .dup-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    padding: 2px 6px;
    border-radius: 5px;
    font-size: 0.58rem;
    font-weight: 700;
    color: #fff;
    background: rgba(239,68,68,0.85);
}
@keyframes gachaReveal {
    from { opacity: 0; transform: scale(0.5) rotateY(90deg); }
    to   { opacity: 1; transform: scale(1) rotateY(0deg); }
}

/* ════════════════════════════════════════════════════════════ */
/* 🔐 认证 & 用户 UI                                          */
/* ════════════════════════════════════════════════════════════ */

/* 用户胶囊（已登录状态） */
.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--glass-bg);
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-round);
    padding: 4px 12px 4px 4px;
    font-size: 0.78rem;
    color: var(--text-dark);
    cursor: default;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: var(--glass-shadow);
    max-width: 140px;
    overflow: hidden;
    height: clamp(44px, 5vw, 64px);
    box-sizing: border-box;
}

.user-pill-avatar {
    font-size: 0.9rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-pill-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 登录按钮（未登录状态） */
.pill-login {
    animation: pulseSoft 2.5s ease-in-out infinite;
}

@keyframes pulseSoft {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 139, 179, 0); }
    50% { box-shadow: 0 0 0 4px rgba(255, 139, 179, 0.25); }
}

/* 登录弹窗输入框 */
.game-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--glass-border);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.85);
    color: var(--text-dark);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.game-input:focus {
    border-color: var(--pink-main);
    box-shadow: 0 0 0 3px rgba(255, 139, 179, 0.2);
}

.game-input::placeholder {
    color: var(--text-light);
}

/* 登录弹窗在深色模式下的适配 */
@media (prefers-color-scheme: dark) {
    .game-input {
        background: rgba(31, 41, 55, 0.9);
        border-color: var(--border-default, #374151);
        color: var(--text-main, #f3f4f6);
    }
    .game-input:focus {
        border-color: var(--pink-main);
    }
    .game-input::placeholder {
        color: var(--text-muted, #6b7280);
    }
    .user-pill {
        background: rgba(31, 41, 55, 0.8);
        border-color: rgba(55, 65, 81, 0.8);
        color: var(--text-main, #f3f4f6);
    }
}

/* 移动端登录弹窗适配 */
@media (max-width: 480px) {
    #gameLoginModal .modal {
        max-width: 92vw;
        padding: 18px;
    }
    .game-input {
        padding: 12px 14px;
        font-size: 16px; /* 防止 iOS 自动缩放 */
    }
}

/* ═══════════════════════════════════════════════════════════
   💰 付费系统 — 双币图标 + 价格标签 + 购买弹窗
   ═══════════════════════════════════════════════════════════ */

/* ─── 顶部资源栏：币种图标 ─── */
.res-coin-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 2px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}
.resource-pill.res-gold,
.resource-pill.res-normal {
    gap: 3px;
}

/* ─── 服装卡片：锁定状态增强 ─── */
.selectable-card.locked {
    position: relative;
}
.selectable-card.locked .card-thumbnail {
    filter: brightness(0.5) grayscale(0.4);
}
.selectable-card.locked:hover {
    border-color: var(--accent-char);
    cursor: pointer;
    opacity: 1;
}
.selectable-card.locked:hover .card-thumbnail {
    filter: brightness(0.7) grayscale(0.2);
}
.card-lock-icon {
    position: absolute;
    top: 6px;
    left: 6px;
    font-size: 0.9rem;
    z-index: 3;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

/* ─── 服装卡片：价格标签 ─── */
.card-price-tag {
    position: absolute;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 3px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fbbf24;
    white-space: nowrap;
    z-index: 3;
}
.card-price-tag .price-icon {
    width: 14px;
    height: 14px;
    object-fit: contain;
}

/* ─── 购买弹窗 ─── */
.purchase-modal {
    max-width: 400px !important;
    text-align: left;
}
.purchase-outfit-preview {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin: 16px 0;
    padding: 12px;
    background: rgba(31, 41, 55, 0.5);
    border-radius: 12px;
    border: 1px solid var(--border-default);
}
.purchase-thumb {
    width: 80px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    background: rgba(0,0,0,0.3);
    flex-shrink: 0;
}
.purchase-outfit-info {
    flex: 1;
    min-width: 0;
}
.purchase-outfit-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.purchase-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
}
.purchase-rarity {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}
.purchase-rarity.SSR {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.3), rgba(245, 158, 11, 0.3));
    color: #fbbf24;
    text-shadow: 0 0 6px rgba(251, 191, 36, 0.5);
}
.purchase-rarity.SR {
    background: rgba(244, 114, 182, 0.2);
    color: #f472b6;
}
.purchase-rarity.R {
    background: rgba(96, 165, 250, 0.2);
    color: #60a5fa;
}
.purchase-rarity.N {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
}
.purchase-desc {
    font-size: 0.82rem;
    color: var(--text-sub);
    line-height: 1.5;
    margin: 0;
}

/* 价格行 */
.purchase-price-row,
.purchase-balance-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0;
    font-size: 0.9rem;
}
.purchase-price-label,
.purchase-balance-label {
    color: var(--text-sub);
    min-width: 70px;
}
.purchase-price-row .price-icon,
.purchase-balance-row .price-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}
.purchase-price-amount {
    font-weight: 700;
    font-size: 1.1rem;
    color: #fbbf24;
}
.purchase-currency-name {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.purchase-balance-val {
    font-weight: 600;
    color: var(--text-main);
}

/* 错误提示 */
.purchase-error {
    margin: 10px 0;
    padding: 8px 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #f87171;
    font-size: 0.8rem;
    text-align: center;
}

/* 购买弹窗按钮区 */
.purchase-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.purchase-recharge-link {
    text-decoration: none;
    font-size: 0.82rem;
}

/* 购买成功动画 */
@keyframes purchaseSuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}
.selectable-card.just-unlocked {
    animation: purchaseSuccess 0.5s ease;
    border-color: #fbbf24 !important;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
}

/* ─── 即将上线标签 ─── */
.selectable-card.coming-soon {
    opacity: 0.7;
    position: relative;
}
.selectable-card.coming-soon .card-thumbnail {
    filter: brightness(0.4) grayscale(0.5) blur(1px);
}
.selectable-card.coming-soon:hover {
    opacity: 0.85;
    cursor: not-allowed;
}
.card-coming-soon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(139, 92, 246, 0.85);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 10px;
    white-space: nowrap;
    z-index: 5;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

/* ─── 移动端购买弹窗适配 ─── */
@media (max-width: 480px) {
    .purchase-modal {
        max-width: 92vw !important;
    }
    .purchase-outfit-preview {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .purchase-thumb {
        width: 100px;
        height: 120px;
    }
    .purchase-outfit-name-row {
        justify-content: center;
    }
    .purchase-actions {
        justify-content: center;
    }
}

/* ════════════════════════════════════════════════════════════ */
/* 🫳 触摸互动系统                                              */
/* ════════════════════════════════════════════════════════════ */

/* ─── 触摸热区容器 ─── */
.touch-zones {
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
}

/* ─── 单个热区 ─── */
.touch-zone {
    position: absolute;
    pointer-events: auto;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s;
}

/* 开发模式下可视化热区（正式上线去掉） */
.touch-zone:hover {
    background: rgba(244, 114, 182, 0.12);
    box-shadow: 0 0 12px rgba(244, 114, 182, 0.3);
}

.touch-zone:active {
    background: rgba(244, 114, 182, 0.25);
    transform: scale(0.95);
}

/* ─── 各部位热区位置（百分比定位，适配不同尺寸立绘） ─── */
.touch-zone-head {
    top: 2%;
    left: 25%;
    width: 50%;
    height: 18%;
    border-radius: 40%;
}

.touch-zone-face {
    top: 20%;
    left: 30%;
    width: 40%;
    height: 14%;
    border-radius: 50%;
}

.touch-zone-body {
    top: 34%;
    left: 20%;
    width: 60%;
    height: 30%;
    border-radius: 30%;
}

.touch-zone-legs {
    top: 64%;
    left: 15%;
    width: 70%;
    height: 18%;
    border-radius: 30%;
}

/* ─── 台词气泡 ─── */
.touch-bubble {
    position: absolute;
    top: 8%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    color: #1f2937;
    padding: 10px 18px;
    border-radius: 16px;
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.5;
    max-width: 320px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(244, 114, 182, 0.25), 0 2px 6px rgba(0, 0, 0, 0.1);
    border: 1.5px solid rgba(244, 114, 182, 0.3);
    z-index: 20;
    animation: bubbleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    white-space: normal;
    word-break: keep-all;
}

.touch-bubble-tail {
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid rgba(255, 255, 255, 0.95);
}

.touch-bubble.hiding {
    animation: bubbleOut 0.25s ease-in forwards;
}

@keyframes bubbleIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(8px) scale(0.85);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

@keyframes bubbleOut {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-6px) scale(0.9);
    }
}

/* ─── 触摸粒子（爱心飘散） ─── */
.touch-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 15;
    overflow: hidden;
}

.touch-particle {
    position: absolute;
    font-size: 1.2rem;
    animation: particleFloat 1.2s ease-out forwards;
    pointer-events: none;
    opacity: 0;
}

@keyframes particleFloat {
    0% {
        opacity: 1;
        transform: translateY(0) scale(0.5) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: translateY(-30px) scale(1.1) rotate(15deg);
    }
    100% {
        opacity: 0;
        transform: translateY(-60px) scale(0.6) rotate(-10deg);
    }
}

/* ─── 角色触摸动画 ─── */
.character-wrap.anim-shake-head {
    animation: shakeHead 0.5s ease-in-out;
}

.character-wrap.anim-puff-cheeks {
    animation: puffCheeks 0.4s ease-in-out;
}

.character-wrap.anim-flinch {
    animation: flinch 0.35s ease-in-out;
}

.character-wrap.anim-squeeze {
    animation: squeeze 0.5s ease-in-out;
}

@keyframes shakeHead {
    0%, 100% { transform: rotate(0deg); }
    20% { transform: rotate(-3deg); }
    40% { transform: rotate(3deg); }
    60% { transform: rotate(-2deg); }
    80% { transform: rotate(2deg); }
}

@keyframes puffCheeks {
    0%, 100% { transform: scale(1); }
    30% { transform: scale(1.03) translateX(2px); }
    60% { transform: scale(1.02) translateX(-2px); }
}

@keyframes flinch {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px) translateY(-2px); }
    50% { transform: translateX(3px); }
    75% { transform: translateX(-2px); }
}

@keyframes squeeze {
    0%, 100% { transform: scale(1); }
    40% { transform: scale(0.97); }
    70% { transform: scale(1.02); }
}

/* ─── 触摸时角色脸红效果 ─── */
.character-wrap.touch-blush::after {
    content: "";
    position: absolute;
    top: 22%;
    left: 30%;
    width: 40%;
    height: 10%;
    background: radial-gradient(ellipse, rgba(255, 150, 180, 0.35) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: blushFade 2s ease-out forwards;
}

@keyframes blushFade {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* ─── 移动端触摸热区适配 ─── */
@media (max-width: 640px) {
    .touch-bubble {
        font-size: 0.82rem;
        padding: 8px 14px;
        max-width: 75vw;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        /* 防止气泡溢出容器 */
        box-sizing: border-box;
    }

    /* 手机端胸像模式：立绘放大到240%高度，只有上半部分可见
       需要将热区集中在可见区域内（大约容器的前40%是可见的） */
    .touch-zone-head {
        top: 0%;
        left: 20%;
        width: 60%;
        height: 16%;
        border-radius: 40%;
    }

    .touch-zone-face {
        top: 16%;
        left: 25%;
        width: 50%;
        height: 10%;
        border-radius: 50%;
    }

    .touch-zone-body {
        top: 26%;
        left: 15%;
        width: 70%;
        height: 18%;
        border-radius: 30%;
    }

    .touch-zone-legs {
        top: 44%;
        left: 10%;
        width: 80%;
        height: 14%;
        border-radius: 30%;
    }
}

/* 手机端全身模式：热区恢复正常比例 */
@media (max-width: 640px) {
    .character-layer.fullbody .touch-zone-head {
        top: 2%;
        left: 25%;
        width: 50%;
        height: 16%;
    }

    .character-layer.fullbody .touch-zone-face {
        top: 18%;
        left: 30%;
        width: 40%;
        height: 12%;
    }

    .character-layer.fullbody .touch-zone-body {
        top: 30%;
        left: 20%;
        width: 60%;
        height: 28%;
    }

    .character-layer.fullbody .touch-zone-legs {
        top: 58%;
        left: 15%;
        width: 70%;
        height: 22%;
    }
}

/* ════════════════════════════════════════════════════════════ */
/* 🎬 特殊CG画廊                                               */
/* ════════════════════════════════════════════════════════════ */

/* ─── CG画廊弹窗 ─── */
.cg-gallery-modal {
    max-width: 560px !important;
}
.cg-gallery-desc {
    color: var(--text-sub);
    font-size: 0.85rem;
    margin: 0 0 16px;
    text-align: center;
}

/* ─── CG网格 ─── */
.cg-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    max-height: 50vh;
    overflow-y: auto;
    padding: 4px;
}

/* ─── CG卡片 ─── */
.cg-card {
    border-radius: 12px;
    overflow: hidden;
    background: var(--card-bg);
    border: 1.5px solid var(--border-default);
    cursor: pointer;
    transition: all 0.2s ease;
}
.cg-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 114, 182, 0.2);
}
.cg-card.unlocked {
    border-color: rgba(244, 114, 182, 0.4);
}
.cg-card.unlocked:hover {
    border-color: var(--accent-outfit);
}
.cg-card.locked {
    opacity: 0.7;
}
.cg-card.locked:hover {
    opacity: 0.85;
    cursor: not-allowed;
}

/* CG缩略图 */
.cg-card-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: rgba(0, 0, 0, 0.3);
    overflow: hidden;
}
.cg-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 锁定状态 */
.cg-card-lock {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 4px;
}
.cg-lock-icon {
    font-size: 1.5rem;
}
.cg-lock-level {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent-char);
    background: rgba(251, 191, 36, 0.15);
    padding: 2px 8px;
    border-radius: 8px;
}

/* 视频播放标识 */
.cg-card-play {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

/* CG信息 */
.cg-card-info {
    padding: 8px 10px;
}
.cg-card-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 2px;
}
.cg-card-hint {
    font-size: 0.72rem;
    color: var(--text-sub);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ─── CG全屏查看器 ─── */
.cg-viewer {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.cg-viewer.active {
    opacity: 1;
}

.cg-viewer-content {
    max-width: 90vw;
    max-height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cg-viewer-img {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}
.cg-viewer-video {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.cg-viewer-info {
    margin-top: 20px;
    text-align: center;
}
.cg-viewer-title {
    display: block;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}
.cg-viewer-desc {
    display: block;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.cg-viewer-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.cg-viewer-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

/* ─── 移动端CG适配 ─── */
@media (max-width: 480px) {
    .cg-gallery-modal {
        max-width: 95vw !important;
    }
    .cg-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    .cg-viewer-close {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
    }
    .cg-viewer-info {
        padding: 0 16px;
    }
}