﻿:root {
    --header-h: 56px;
    --banner-h: 90px;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 官方指南推荐变量模板（文档 L217-220） */
:root {
    --page-padding: 16px;
    --control-size: 44px; /* 手机端按钮最小点击区域：44x44px */
    --panel-width: 320px;
    --header-h: 64px;
}

/* 所有主要按钮强制满足 44x44px 最小点击区域（官方文档 L120） */
button,
.nav-link,
.color-opt,
.gigi-opt,
.diy-toggle-btn,
.diy-random-btn,
.quiz-option,
.diff-btn,
.back-to-lobby {
    min-width: var(--control-size);
    min-height: var(--control-size);
}
@media (min-width: 768px) {
    :root { --page-padding: 24px; }
}
@media (min-width: 1100px) {
    :root { --page-padding: 32px; --panel-width: 360px; }
}

/* 官方指南 L123/L164：禁止横向滚动 + 超宽屏内容不过散 */
html {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}
body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    background: #fff5f7;
    color: #333;
    /* 只隐藏横向滚动，纵向滚动由html控制，避免双滚动条 */
    overflow-x: hidden;
    overflow-y: visible;
    /* 官方指南模板：safe-area-inset 四个方向，刘海屏/瀑布屏/侧置摄像头适配 */
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    box-sizing: border-box;
    width: 100%;
    min-height: 100dvh;
}

/* 暗色主题已移除（恢复默认浅色风格） */

body { overflow-x: hidden; }
main { overflow-x: hidden; }
.section { overflow-x: hidden; }

/* 超宽屏上防止内容太散，限制内容最大宽度到 1280px
   只应用到真正的内容容器，不影响蛋糕、轮播等全宽元素 */
.section > .banner,
.section > .banner-countdown {
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
}

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

/* Banner 图：菜单栏上方，网页端3:1，移动端隐藏 */
.top-banner {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    position: relative !important;
    height: 96px !important;
    max-height: 96px !important;
    background: #fff9fb !important;
}
.top-banner-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    user-select: none !important;
    -webkit-user-drag: none !important;
}

.header-content {
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    text-align: center;
}


.header h1 {
    font-size: 2.2rem;
    color: #ff6b6b;
    margin-bottom: 3px;
}

.subtitle {
    color: #888;
    font-size: 0.95rem;
    margin-bottom: 12px;
}

.nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    max-width: 640px;
    margin: 0 auto;
    flex-wrap: nowrap;
}

.nav-link {
    text-decoration: none;
    color: #666;
    padding: 8px 4px;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.85rem;
    white-space: nowrap;
    text-align: center;
    min-width: 0;
}

.nav-link:hover,
.nav-link.active {
    background: linear-gradient(135deg, #ff6b6b, #feca57);
    color: white;
}

main {
    overflow: visible;
    position: relative;
}

.section {
    width: 100%;
    height: auto;
    padding: 48px max(20px, calc((100% - 1200px) / 2));
    display: none;
    overflow: visible;
}

.section.active {
    display: block;
    animation: fadeIn 0.5s ease;
    min-height: 100dvh;
    min-height: 100dvh;
}

.section h2 {
    text-align: center;
    font-size: 1.4rem;
    color: #ff6b6b;
    margin-bottom: 16px;
}

/* ===== 首页：浅色背景 + 细闪 + 酒红色彩带 ===== */
.home-section {
    background: transparent;
    position: relative;
}
.home-greet-section {
    margin-top: 48px;
    margin-bottom: 48px;
}
.home-section-title {
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: #b8002e;
    margin-bottom: 24px;
}

.home-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.sparkle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #ffd93d;
    box-shadow: 0 0 6px 2px rgba(255, 217, 61, 0.6);
    animation: twinkle 2.5s infinite ease-in-out;
}

@keyframes twinkle {
    0%, 100% { opacity: 0; transform: scale(0.4); }
    50% { opacity: 1; transform: scale(1.2); }
}

.confetti-layer {
    opacity: 0;
    transition: opacity 1.2s ease;
}

.confetti-layer.active {
    opacity: 1;
}

.confetti {
    position: absolute;
    top: -20px;
    width: 10px;
    height: 18px;
    border-radius: 2px;
    opacity: 0;
}

.confetti-layer.active .confetti {
    animation: fall linear infinite;
}

@keyframes fall {
    0% { transform: translateY(-20px) rotate(0deg); opacity: 0.9; }
    100% { transform: translateY(110dvh) rotate(720deg); opacity: 0.8; }
}

.home-section > .banner {
    position: relative;
    z-index: 1;
}

/* ===== Banner ===== */
.banner {
    text-align: center;
    margin: 6px auto 36px;
    max-width: 1080px;
    padding: 26px 18px 30px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 12px 32px rgba(217, 33, 33, 0.08);
    position: relative;
    z-index: 1;
}

.banner h2 {
    color: #b8002e;
    margin-bottom: 15px;
    text-shadow: 0 0 14px rgba(217, 33, 33, 0.24);
}

.banner-tip {
    margin-top: 12px;
    color: #666;
    font-size: 0.95rem;
}

.banner-countdown,
.banner-birthday {
    display: none;
}

.banner-countdown.active,
.banner-birthday.active {
    display: block;
    animation: fadeIn 0.6s ease;
}

.countdown {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.countdown-box {
    background: linear-gradient(135deg, #ff6b6b, #ffa751);
    color: #fff;
    padding: 12px 18px;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(255, 107, 107, 0.3);
    min-width: 70px;
}

.countdown-box span:first-child {
    font-size: 1.8rem;
    font-weight: bold;
    display: block;
}

.countdown-box .label {
    font-size: 0.8rem;
    opacity: 0.9;
}

.birthday-title {
    font-size: 2rem;
    color: #ff6b6b;
    margin-bottom: 20px;
}

.birthday-art {
    max-width: 420px;
    margin: 0 auto;
    aspect-ratio: 16 / 9;
    border: 2px dashed #ffb3b3;
    border-radius: 16px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 0.9rem;
    line-height: 1.8;
}

.birthday-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
}

/* ===== 3D 蛋糕（cake-birthday.png 主体 + 蜡烛火焰 + 金色底盘）===== */
.cake-area {
    display: flex;
    justify-content: center;
    margin: 28px 0 24px;
    perspective: 1100px;
}

.cake-3d {
    position: relative;
    width: 280px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transform-style: preserve-3d;
    transform: rotateX(8deg) rotateY(-4deg);
    transition: transform 0.25s ease;
    /* 3D 浮起阴影（粉色光晕 + 地面投影）*/
    filter:
        drop-shadow(0 18px 24px rgba(184, 0, 46, 0.30))
        drop-shadow(0 4px 8px rgba(90, 0, 24, 0.20));
    background: transparent;
    border-radius: 16px;
    overflow: visible;
}

/* 触屏设备（手机/平板/B站App内WebView）降级3D效果 */
/* 官方指南 L277-281：pointer: coarse 判断触摸输入 */
@media (pointer: coarse) {
    .cake-3d {
        transform: none;
        transform-style: flat;
        filter: drop-shadow(0 8px 16px rgba(184, 0, 46, 0.20));
    }
}

/* 支持触摸但也支持hover的设备（如触摸笔记本），适度保留3D但更温和 */
@media (pointer: coarse) and (hover: hover) {
    .cake-3d {
        transform: rotateX(3deg) rotateY(-2deg);
        transform-style: preserve-3d;
    }
}

/* 蛋糕主体：图片完全填充容器，直接显示（不使用 mix-blend-mode 避免不可见）*/
.cake-3d > .cake-photo {
    display: block;
    position: relative;
    width: 100%;
    height: auto;
    object-fit: contain;
    z-index: 1;
    -webkit-user-drag: none;
    user-select: none;
    pointer-events: none;
    filter: drop-shadow(0 4px 6px rgba(184, 0, 46, 0.15));
}

/* 整体蛋糕有一个向上浮起的感觉 */
.cake-3d::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -18px;
    transform: translateX(-50%) scaleX(0.55);
    width: 80%;
    height: 20px;
    background: radial-gradient(ellipse at center, rgba(184, 0, 46, 0.32) 0%, rgba(184, 0, 46, 0.12) 50%, transparent 80%);
    z-index: 0;
    filter: blur(8px);
    pointer-events: none;
}

.cake-3d:active {
    transform: rotateX(10deg) rotateY(-6deg) scale(0.96);
}

/* 蜡烛容器：现在只有1根，用 position:absolute 精确对准图片中央的蜡烛。
   z-index 提升到最顶层，让火焰清晰可见。*/
.candles {
    display: flex;
    justify-content: center;
    position: absolute;
    left: 0;
    right: 0;
    /* 图片比例：蜡烛位于蛋糕奶油顶部（约 12%~15% 处，精确居中）*/
    top: 10%;
    z-index: 999; /* 最顶层 */
    pointer-events: none;
    /* 蓄力前默认隐藏，只显示图片自带的蜡烛 */
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* 蓄力中/点亮后显示，让火焰叠加在图片蜡烛之上 */
.cake-3d.charging .candles,
.cake-3d.lit .candles,
.cake-3d.all-lit .candles {
    opacity: 1;
}

/* 单根蜡烛：完全透明（不显示蜡烛主体，只显示一个火焰盖在图片蜡烛顶端）*/
.candle {
    width: 6px;
    height: 0; /* 隐藏蜡烛身体，只留火焰 */
    position: relative;
    cursor: pointer;
    pointer-events: auto;
}

/* 卡通火焰：用 ::before 做内焰（小亮点），主体 .flame 做外焰，
   再用 .flame::after 做外层虚化光晕营造燃烧感 */
.flame {
    position: absolute;
    top: -14px; /* 贴着蜡烛上方 */
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 12px;
    border-radius: 50% 50% 50% 50% / 70% 70% 30% 30%;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    /* 默认（dim 状态）火焰主体 */
    background: linear-gradient(180deg, #fff5b0 0%, #ffb347 50%, #ff6b35 100%);
}

.candle .flame.dim {
    opacity: 0;
}

.candle.flash .flame.dim {
    opacity: 1;
    animation: flameFlash 0.6s ease;
}

@keyframes flameFlash {
    0% { opacity: 0; transform: translateX(-50%) scale(0.4); }
    35% { opacity: 1; transform: translateX(-50%) scale(1.3); }
    100% { opacity: 0; transform: translateX(-50%) scale(0.9); }
}

/* 点燃状态：火焰主体 + 内焰亮点 + 外层虚化光晕 */
.cake-3d.lit .flame,
.cake-3d.all-lit .flame {
    opacity: 1;
    background: linear-gradient(180deg, #fff8d4 0%, #ffd166 35%, #ff8c2b 70%, #ff5a1f 100%);
    /* 卡通感：清晰边缘 + 微微内阴影 */
    box-shadow:
        inset 0 -2px 3px rgba(255, 90, 31, 0.5),
        inset 0 2px 2px rgba(255, 255, 255, 0.7);
    animation: flameFlicker 0.5s ease-in-out infinite alternate;
}

/* 火焰内部高光（卡通感的小亮点） */
.cake-3d.lit .flame::before,
.cake-3d.all-lit .flame::before {
    content: '';
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 5px;
    border-radius: 50%;
    background: #ffffff;
    opacity: 0.85;
    box-shadow: 0 0 2px rgba(255, 255, 255, 0.8);
}

/* 外层虚化光晕：营造燃烧感，柔和大圈 */
.cake-3d.lit .flame::after,
.cake-3d.all-lit .flame::after {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 26px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, rgba(255, 180, 80, 0.45) 0%, rgba(255, 140, 50, 0.25) 40%, transparent 70%);
    filter: blur(3px);
    z-index: -1;
    animation: glowPulse 1.2s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes flameFlicker {
    0% { transform: translateX(-50%) scale(1, 1) rotate(-3deg); }
    100% { transform: translateX(-50%) scale(0.92, 1.1) rotate(3deg); }
}

@keyframes glowPulse {
    0% { opacity: 0.7; transform: translateX(-50%) scale(1); }
    100% { opacity: 1; transform: translateX(-50%) scale(1.15); }
}

/* 金色底盘 — 放在蛋糕图片下方，从视觉上"托住"蛋糕 */
.cake-plate {
    position: relative;
    width: 88%;
    height: 14px;
    margin: -6% auto 0;
    background: linear-gradient(180deg, #ffe082 0%, #d4a017 45%, #8b6914 100%);
    border-radius: 50%;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25), inset 0 -2px 4px rgba(0, 0, 0, 0.28), inset 0 2px 4px rgba(255, 255, 255, 0.45);
    z-index: 1;
    transform: translateZ(0);
}

/* 蓄力反馈：蛋糕抖动 */
.cake-3d.charging {
    animation: cakeShake 0.3s ease;
}

@keyframes cakeShake {
    0%, 100% { transform: rotateX(10deg) rotateY(-6deg) translateX(0); }
    25% { transform: rotateX(10deg) rotateY(-6deg) translateX(-4px); }
    75% { transform: rotateX(10deg) rotateY(-6deg) translateX(4px); }
}

/* 蓄力满后所有蜡烛持续点亮 */
.cake-3d.all-lit .candle .flame.dim {
    opacity: 1;
    background: radial-gradient(ellipse at center, rgba(255,200,100,0.82) 0%, rgba(255,150,50,0.3) 60%, transparent 100%);
    box-shadow: 0 0 10px 3px rgba(255, 165, 50, 0.4);
    animation: flameFlicker 0.5s ease-in-out infinite alternate;
}

/* ===== 星光蓄力条 ===== */
.star-power {
    max-width: 340px;
    margin: 28px auto 0;
    text-align: center;
}

.star-power-label {
    color: #b8002e;
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.star-power-label #starCount {
    color: #ff6b6b;
    font-size: 1.1rem;
}

.star-power-bar {
    height: 16px;
    background: #ffe8ec;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.08);
    position: relative;
}

.star-power-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ffd93d 0%, #ffa751 50%, #ff6b6b 100%);
    border-radius: 10px;
    transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 10px rgba(255, 217, 61, 0.6);
    position: relative;
}

.star-power-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
    animation: shimmer 1.5s linear infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.star-power-hint {
    color: #999;
    font-size: 0.8rem;
    margin-top: 8px;
}

.star-power-hint.full {
    color: #ff6b6b;
    font-weight: 600;
}

/* ===== 烟花 & 许愿星特效层 ===== */
.fx-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 500;
    overflow: hidden;
}

.firework-particle {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    pointer-events: none;
}

/* 烟花升空尾焰 */
.firework-trail {
    position: absolute;
    width: 4px;
    height: 60px;
    background: linear-gradient(180deg, transparent, #ffd93d, #fff);
    border-radius: 4px;
    pointer-events: none;
    filter: blur(0.5px);
    box-shadow: 0 0 12px #ffa751;
    transform: translate(-50%, -100%);
}

/* 烟花中心闪光 */
.firework-flash {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, rgba(255,220,100,0.5) 30%, transparent 70%);
    transform: translate(-50%, -50%);
    pointer-events: none;
    filter: blur(4px);
}

/* 烟花星星微粒 */
.firework-spark {
    position: absolute;
    font-size: 12px;
    pointer-events: none;
    transform: translate(-50%, -50%);
    text-shadow: 0 0 8px currentColor;
}

.wish-star {
    position: absolute;
    color: #fff;
    font-size: 0.85rem;
    text-shadow: 0 0 8px rgba(255, 217, 61, 0.8), 0 0 16px rgba(255, 107, 107, 0.5);
    white-space: nowrap;
    pointer-events: none;
    animation: wishRise 4s ease-out forwards;
}

.wish-star .star-icon {
    font-size: 1.3rem;
    display: block;
    text-align: center;
    margin-bottom: 4px;
}

@keyframes wishRise {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.5);
    }
    15% {
        opacity: 1;
        transform: translateY(-30px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-60dvh) scale(0.8);
    }
}

/* 生日蛋糕区域更大 */
.birthday-cake .cake {
    width: 240px;
}

.birthday-cake .cake-body {
    width: 220px;
}

.greet-photos {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.greet-photo-item {
    aspect-ratio: 9 / 16;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
    position: relative;
}

.greet-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    -webkit-user-drag: none;
    user-select: none;
    transition: transform 0.4s ease;
}

.greet-photo-item:hover img {
    transform: scale(1.06);
}

/* ===== 媒体灯箱（点击播放，禁止下载）===== */
.media-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 1100;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.media-lightbox.active {
    display: flex;
}

.media-lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.4rem;
    cursor: pointer;
    line-height: 1;
    z-index: 2;
}

.media-lightbox-content {
    width: 100%;
    max-width: 1200px;
    max-height: 85dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.media-lightbox-content img {
    max-width: 90vw;
    max-height: 85dvh;
    object-fit: contain;
    border-radius: 8px;
    -webkit-user-drag: none;
    user-select: none;
}

.media-lightbox-content video {
    max-width: 90vw;
    max-height: 85dvh;
    border-radius: 8px;
}

.bilibili-player-wrapper {
    position: relative;
    flex: 0 0 auto;
    width: min(90vw, 1024px);
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.bilibili-player-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* ===== 弹窗（点亮蛋糕后的语录/祝福卡） ===== */
.popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100dvh;
    background: rgba(255, 235, 242, 0.38);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.popup-overlay.active {
    display: flex;
}

.popup-card {
    background: #fff;
    border-radius: 16px;
    padding: 30px 24px;
    max-width: 380px;
    min-width: 280px;
    width: 85%;
    position: relative;
    box-shadow: 0 18px 44px rgba(217, 33, 33, 0.16);
    animation: slideUp 0.4s ease;
}

.popup-card::before,
.popup-card::after {
    content: '';
    position: absolute;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: url('../momo/images/gigi1.jpg') center / cover no-repeat;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(217, 33, 33, 0.18);
    pointer-events: none;
    z-index: 2;
}

.popup-card::before {
    top: -12px;
    left: -12px;
}

.popup-card::after {
    display: none;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.popup-close {
    position: absolute;
    top: 8px;
    right: 14px;
    background: none;
    border: none;
    font-size: 1.6rem;
    color: #ff6b6b;
    cursor: pointer;
    line-height: 1;
}

.popup-card p {
    color: #555;
    line-height: 1.8;
    font-size: 1.05rem;
    text-align: center;
    word-break: keep-all;
    white-space: normal;
}

/* ===== 留言墙（信纸风格） ===== */
.messages-section {
    background: #FFE0E2;
    min-height: calc(100dvh - var(--header-h) - var(--banner-h));
    min-height: calc(100dvh - var(--header-h) - var(--banner-h));
}

.message-form-container {
    max-width: min(820px, 75vw);
    margin: 0 auto 24px;
}

.message-form {
    background: #fffdf5;
    background-image: repeating-linear-gradient(180deg, transparent 0, transparent 27px, #e6d8b8 27px, #e6d8b8 28px);
    padding: 24px 24px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(180, 140, 80, 0.15);
    border: 1px solid #e8d8a8;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
}

.message-form::before {
    content: '';
    position: absolute;
    left: 36px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(220, 100, 100, 0.3);
}

.message-form input,
.message-form textarea {
    padding: 8px 14px;
    border: none;
    border-bottom: 1px dashed rgba(212, 184, 120, 0.5);
    border-radius: 0;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    font-family: 'Ma Shan Zheng', 'Noto Serif SC', 'PingFang SC', 'Microsoft YaHei', cursive;
    background: transparent;
    color: #4a3516;
    caret-color: #c0392b;
    letter-spacing: 0.3px;
}

.message-form input::placeholder,
.message-form textarea::placeholder {
    color: #c8b490;
    font-style: italic;
    opacity: 0.7;
}

.message-form input:focus,
.message-form textarea:focus {
    outline: none;
    border-bottom-color: rgba(192, 57, 43, 0.6);
    background: rgba(255, 255, 255, 0.35);
    border-radius: 4px 4px 0 0;
}

.message-form textarea {
    resize: none;
    height: 110px;
    line-height: 28px;
    /* 让输入框文字与信纸横线对齐 */
    background-clip: content-box;
    padding-top: 5px;
}

.message-form > button {
    background: linear-gradient(135deg, #ff6b6b, #ffa751);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.message-form > button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.35);
}








/* 字数计数 */
.char-count {
    text-align: right;
    color: #b8a070;
    font-size: 0.8rem;
    margin-top: -4px;
}

/* 弹幕层 */
.danmaku-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 400;
    overflow: hidden;
}

.danmaku-item {
    position: absolute;
    white-space: nowrap;
    padding: 6px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.2);
    color: #d63384;
    font-size: 0.9rem;
    font-weight: 600;
    animation: danmakuFly 12s linear forwards;
}

.danmaku-item .dm-name {
    color: #ff6b6b;
    margin-right: 6px;
}

@keyframes danmakuFly {
    0% { transform: translateX(100vw); }
    100% { transform: translateX(-120%); }
}

/* 星星坠落动画 */
.star-fall {
    position: fixed;
    pointer-events: none;
    z-index: 400;
    color: #ffd93d;
    text-shadow: 0 0 8px rgba(255, 217, 61, 0.6);
    font-size: 0.85rem;
    animation: starFall 4s ease-in forwards;
}

@keyframes starFall {
    0% { transform: translateY(-50px) rotate(0deg); opacity: 0; }
    15% { opacity: 1; }
    100% { transform: translateY(100dvh) rotate(360deg); opacity: 0; }
}


/* ===== 打卡板块 ===== */
.checkin-section {
    background: #0a0e1a;
    min-height: 100dvh;
    min-height: 100dvh;
    padding-top: 60px !important;
}

.vue-checkin-section {
    height: 100dvh;
    height: 100dvh;
    min-height: 100dvh;
    min-height: 100dvh;
    position: relative;
    overflow: hidden;
    padding: 0;
    background: #0a0e1a !important;
}

.vue-checkin-section .app-root {
    height: 100%;
}

.vue-globe-frame {
    width: 100%;
    height: 100%;
    min-height: 0;
    border: 0;
    display: block;
    background: #fff9fb;
}

/* ===== 打卡 Intro 封面页 ===== */
.checkin-intro {
    max-width: 560px;
    margin: 0 auto;
    transition: opacity 0.35s ease;
}

.checkin-intro-card {
    background: #fff;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 8px 28px rgba(184, 0, 46, 0.12);
    text-align: center;
}

.checkin-intro-img {
    width: 100%;
    max-height: 60dvh;
    height: auto;
    /* 使用 contain 完整显示图片，不被裁切 */
    object-fit: contain;
    object-position: center;
    border-radius: 14px;
    display: block;
    margin: 0 auto 18px;
    -webkit-user-drag: none;
    user-select: none;
    background: transparent;
}

.checkin-intro-text {
    color: #b8002e;
    font-size: 1.05rem;
    line-height: 1.7;
    margin: 0 0 22px;
    font-weight: 500;
}

.checkin-intro-btn {
    background: linear-gradient(135deg, #ff6b6b, #ffa751);
    color: #fff;
    border: none;
    padding: 14px 36px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    min-height: 52px;
}

.checkin-intro-btn:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 10px 26px rgba(255, 107, 107, 0.5);
}

/* 移动端：单屏布局，减少padding，缩小图片 */
@media (max-width: 768px) {
    .checkin-intro-card {
        padding: 16px;
        border-radius: 16px;
    }
    .checkin-intro-img {
        max-height: 45dvh;
        margin-bottom: 12px;
    }
    .checkin-intro-text {
        font-size: 0.95rem;
        margin-bottom: 16px;
        line-height: 1.5;
    }
    .checkin-intro-btn {
        padding: 12px 28px;
        font-size: 1rem;
        min-height: 44px;
    }
}

.checkin-intro-btn:active {
    transform: translateY(0) scale(0.98);
}















/* ===== Footer ===== */
.footer {
    background: #fff;
    padding: 18px;
    text-align: center;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.04);
}

.footer p {
    color: #999;
    margin: 3px 0;
    font-size: 0.85rem;
}

/* ===== 动画 ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== 响应式 ===== */
/* 平板 */
@media (max-width: 1024px) {
    .header h1 {
        font-size: 1.9rem;
    }
}

/* 移动端 */
@media (max-width: 768px) {
    .header {
        padding: 0;
    }

    .header h1 {
        font-size: 1.4rem;
    }

    .subtitle {
        font-size: 0.8rem;
        margin-bottom: 8px;
    }

    .nav {
        gap: 2px;
        width: 100%;
    }

    .nav-link {
        padding: 5px 8px;
        font-size: 0.72rem;
        white-space: nowrap;
        flex-shrink: 0;
        min-height: 28px;
        display: flex;
        align-items: center;
        border-radius: 14px;
    }

    .section {
        padding: 20px 14px;
    }

    /* 首页 */
    .countdown-box {
        padding: 8px 12px;
        min-width: 58px;
    }

    .countdown-box span:first-child {
        font-size: 1.4rem;
    }

    .birthday-title {
        font-size: 1.5rem;
    }

    .cake-3d {
        width: 200px;
    }

    .candles {
        gap: 0;
        top: 8%;
    }

    /* 移动端蜡烛仍隐藏主体，只显示火焰 */
    .candle {
        width: 6px;
        height: 0;
    }

    /* 移动端火焰略缩小，位置贴着蜡烛上方 */
    .flame {
        top: -10px;
        width: 7px;
        height: 10px;
    }

    .cake-3d.lit .flame::after,
    .cake-3d.all-lit .flame::after {
        width: 18px;
        height: 20px;
    }

    .birthday-cake .cake-3d {
        width: 230px;
    }

    .star-power {
        max-width: 280px;
    }

    .greet-card {
        padding: 14px 16px;
    }

    .greet-card .greet-text {
        font-size: 0.88rem;
    }

    /* 留言墙 */
    .message-form {
        padding: 16px;
    }

    /* 生贺图：移动端保持 4 列并排（不变成 2 列），缩小 gap 让小屏能放下 */
    .greet-photos {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 6px;
    }
    .greet-photo-item {
        border-radius: 8px;
    }

    /* 名言 popup 卡片在移动端尺寸调整 */
    .popup-card {
        max-width: 320px;
        width: 90%;
        padding: 24px 20px;
    }
}

/* 小屏手机 */
@media (max-width: 380px) {
    .header h1 {
        font-size: 1.2rem;
    }

    .nav {
        gap: 3px;
    }

    .nav-link {
        padding: 5px 8px;
        font-size: 0.7rem;
    }

    .countdown-box {
        padding: 6px 10px;
        min-width: 50px;
    }

    .countdown-box span:first-child {
        font-size: 1.2rem;
    }

}

/* ===== safe-area-inset 兼容（body 已加四向 padding，这里仅对 .nav 加底部安全区，防止 iPhone 底部横条遮挡）===== */
@supports (padding: max(0px)) {
    .nav {
        padding-bottom: max(4px, env(safe-area-inset-bottom));
    }
}

/* ===== 回顾模式：隐藏导航栏，全屏沉浸 ===== */
body.review-mode .header {
    display: none;
}



body.review-mode main {
    height: 100dvh;
    height: 100dvh;
}

body.review-mode .timeline-section {
    height: 100dvh;
    height: 100dvh;
    background: #07091a;
    overflow: hidden;
}


.game-lobby,
.game-view {
    display: none;
    animation: fadeIn 0.4s ease;
}

.game-lobby.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: calc(100dvh - 200px);
    padding: 20px 16px;
}
.game-view.active {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

.game-lobby-tip {
    color: #888;
    margin-bottom: 18px;
    text-align: center;
}

.game-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 14px;
    max-width: 880px;
    margin: 0 auto;
}

.game-card-item {
    background: #fff;
    border-radius: 16px;
    padding: 20px 14px;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.game-card-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 28px rgba(255, 107, 107, 0.2);
    border-color: #ffb3c1;
}

.game-card-icon {
    font-size: 2.2rem;
    margin-bottom: 8px;
}

.game-card-item h3 {
    color: #d63384;
    margin-bottom: 6px;
    font-size: 1.05rem;
}

.game-card-item p {
    color: #999;
    font-size: 0.8rem;
    line-height: 1.5;
}

/* 移动端：卡片固定两列，尽量一屏放下，不做横向/整页翻动 */
@media (max-width: 640px) {
    .game-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .game-card-item {
        padding: 14px 8px;
        border-radius: 14px;
    }
    .game-card-icon {
        font-size: 1.8rem;
        margin-bottom: 6px;
    }
    .game-card-item h3 {
        font-size: 0.95rem;
    }
    .game-card-item p {
        font-size: 0.75rem;
    }
    .games-section {
    padding-top: 100px !important;
}

.games-section h2 {
        font-size: 1.4rem;
        margin-bottom: 10px;
    }
}

.game-card-link {
    position: relative;
}

.game-card-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #ff6b6b, #ffa751);
    color: #fff;
    font-size: 0.7rem;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 10px;
}

.back-to-lobby {
    background: #fff;
    color: #b8002e;
    border: 1px solid #ffd7e0;
    padding: 8px 18px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.back-to-lobby:hover {
    background: #fff5f7;
}

/* ===== 追光抽卡（toy-gacha 独立页面嵌入） ===== */
.gacha-frame {
    width: 100%;
    max-width: 520px;
    height: auto;
    min-height: 500px;
    max-height: 85dvh;
    margin: 0 auto;
    display: block;
    border: 0.75px solid #E8E8E8;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 12px 40px rgba(255, 107, 107, 0.1);
}

/* ===== 拼图游戏 ===== */
.puzzle-tip {
    color: #888;
    margin-bottom: 20px;
}

.puzzle-difficulty {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.diff-btn {
    background: linear-gradient(135deg, #ff6b6b, #ffa751);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 14px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(255,107,107,0.3);
}

.diff-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(255,107,107,0.4);
}

.puzzle-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.puzzle-timer,
.puzzle-moves {
    background: #fff;
    padding: 8px 18px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    font-weight: 600;
    color: #d63384;
}

.puzzle-shuffle {
    background: #fff5f7;
    color: #ff6b6b;
    border: 1px solid #ffb3c1;
    padding: 8px 18px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
}

.puzzle-board {
    display: grid;
    gap: 3px;
    max-width: 360px;
    margin: 0 auto 30px;
    aspect-ratio: 1;
    background: #ffe8ec;
    padding: 6px;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.puzzle-tile {
    background-size: cover;
    background-position: center;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.8);
    font-weight: bold;
    font-size: 1.2rem;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.puzzle-tile:hover {
    transform: scale(0.96);
}

.puzzle-tile.empty {
    background: transparent;
    cursor: default;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,0.4);
}

.puzzle-tile.correct {
    box-shadow: inset 0 0 0 2px rgba(100, 200, 100, 0.5);
}

/* 排行榜 */
.puzzle-leaderboard {
    max-width: 400px;
    margin: 0 auto;
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.lb-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.lb-tab {
    flex: 1;
    background: #f5f5f5;
    border: none;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #888;
    transition: all 0.2s;
}

.lb-tab.active {
    background: linear-gradient(135deg, #ff6b6b, #ffa751);
    color: white;
}

.lb-list {
    text-align: left;
}

.lb-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
}

.lb-item:first-child {
    color: #d63384;
    font-weight: bold;
}

.lb-rank {
    margin-right: 8px;
}

.lb-empty {
    text-align: center;
    color: #ccc;
    padding: 20px;
}

/* ===== 冷知识答题 ===== */
.quiz-tip {
    color: #888;
    margin-bottom: 24px;
}

.quiz-badges {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.quiz-badge {
    background: #fff;
    border-radius: 14px;
    padding: 18px 14px;
    width: 110px;
    text-align: center;
    box-shadow: 0 3px 12px rgba(0,0,0,0.06);
    transition: all 0.3s;
}

.quiz-badge.earned {
    box-shadow: 0 3px 16px rgba(255, 167, 81, 0.4);
    transform: translateY(-4px);
}

.quiz-badge.earned::after {
    content: '✓';
    position: absolute;
}

.quiz-badge span {
    font-size: 2.4rem;
    display: block;
    margin-bottom: 6px;
}

.quiz-badge p {
    font-size: 0.8rem;
    color: #888;
    margin: 2px 0;
}

.quiz-badge.earned p {
    color: #d63384;
    font-weight: 600;
}

.quiz-record {
    color: #999;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.quiz-start-btn {
    background: linear-gradient(135deg, #ffa751, #ff6b6b);
    color: white;
    border: none;
    padding: 14px 40px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 16px rgba(255,107,107,0.3);
}

.quiz-start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(255,107,107,0.4);
}

.quiz-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    color: #888;
    font-size: 0.9rem;
}

.quiz-question {
    background: #fff;
    border-radius: 14px;
    padding: 24px;
    font-size: 1.15rem;
    color: #444;
    margin-bottom: 20px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
    line-height: 1.6;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 500px;
    margin: 0 auto;
}

.quiz-option {
    background: #fff;
    border: 1px solid #E8E8E8;
    border-radius: 12px;
    padding: 14px 20px;
    cursor: pointer;
    font-size: 1rem;
    text-align: left;
    transition: all 0.25s;
    color: #555;
    flex-shrink: 0;
    width: 100%;
}

.quiz-option:hover {
    border-color: #ff6b6b;
    background: #fff5f7;
}

.quiz-option.correct {
    border-color: #51cf66;
    background: #f0fff4;
    color: #2b8a3e;
}

.quiz-option.wrong {
    border-color: #ff6b6b;
    background: #fff5f7;
    color: #c92a2a;
}

.quiz-option:disabled {
    cursor: default;
}

.quiz-feedback {
    text-align: center;
    margin-top: 16px;
    font-size: 1rem;
    font-weight: 600;
    min-height: 24px;
}

.quiz-feedback.right { color: #51cf66; }
.quiz-feedback.wrong { color: #ff6b6b; }

.quiz-end {
    text-align: center;
    padding: 30px 0;
}

.quiz-end h3 {
    color: #d63384;
    margin-bottom: 12px;
}

.quiz-end p {
    color: #888;
    margin-bottom: 20px;
}

.quiz-end-badge {
    font-size: 4rem;
    margin: 16px 0;
}

/* ===== 留言墙 DIY + CUBE墙面 ===== */
/* 表单头部 + 自定义信纸按钮 */
.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.form-title {
    color: #8a5a2a;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Georgia', 'KaiTi', serif;
}

.diy-toggle-btn {
    background: #fff;
    color: #d63384;
    border: 1px solid #ffb3c1;
    padding: 6px 14px;
    border-radius: 18px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.25s;
}

.diy-toggle-btn:hover {
    background: #ffe8ec;
    transform: translateY(-1px);
}

/* 随机配置按钮（右下角圆形🔄） */
.diy-random-btn {
    background: linear-gradient(135deg, #d63384, #ff6b6b);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.15rem;
    cursor: pointer;
    transition: transform 0.5s ease, box-shadow 0.25s ease;
    align-self: flex-end;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(214, 51, 132, 0.25);
}

.diy-random-btn:hover {
    transform: rotate(360deg) scale(1.1);
    box-shadow: 0 4px 16px rgba(214, 51, 132, 0.4);
}

.diy-random-btn:active {
    transform: rotate(180deg) scale(0.95);
}

/* DIY 面板默认收起 */
.paper-diy {
    display: none;
    flex-direction: column;
    gap: 10px;
    margin: 8px 0 4px;
    padding: 16px;
    background: #fff;
    border: none;
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(217, 33, 33, 0.08);
    animation: diyExpand 0.3s ease;
}

.paper-diy.open {
    display: flex;
}

@keyframes diyExpand {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 信纸 textarea 包裹层：配图定位在右下角 */
.paper-textarea-wrap {
    position: relative;
}

.paper-gigi-preview {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    -webkit-user-drag: none;
}

.diy-label {
    color: #8a7050;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 4px;
}

.color-picker {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.color-opt {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    border: 1px solid #E8E8E8;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.color-opt:hover { transform: scale(1.15); }

.color-opt.active {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(217, 33, 33, 0.22);
    transform: scale(1.12);
}

.gigi-picker {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.gigi-opt {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.gigi-opt:hover { transform: scale(1.1); }
.gigi-opt.active {
    border-color: var(--brand);
    box-shadow: 0 0 0 2px rgba(217, 33, 33, 0.22), 0 4px 12px rgba(217, 33, 33, 0.16);
    transform: scale(1.08);
}

.gigi-opt img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* CUBE 一楼墙面 */
.wall-view {
    display: none;
    margin-top: 20px;
}

.wall-view.active { display: block; }

.wall-back-btn {
    background: linear-gradient(135deg, #ff6b6b, #ffa751);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
}

/* 留言墙底部：查看所有留言 */
.wall-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 18px;
}

.view-all-btn {
    background: #fff;
    border: 2px solid #ffb3c1;
    color: #b8002e;
    padding: 10px 26px;
    border-radius: 24px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    min-height: 44px;
    transition: all 0.3s ease;
}

.view-all-btn:hover {
    background: #fff5f7;
    transform: translateY(-2px);
}

/* ==== 桌面端墙面：密集型 columns 布局（不再绝对定位，无右边大空隙）==== */
.wall-notes {
    position: relative;
    min-height: 460px;
    padding: 20px 18px 12px;
    border-radius: 16px;
    border: none;
    background:
        repeating-linear-gradient(0deg, rgba(217, 33, 33, 0.035) 0, rgba(217, 33, 33, 0.035) 56px, rgba(217, 33, 33, 0.06) 56px, rgba(217, 33, 33, 0.06) 112px),
        linear-gradient(160deg, #FFF1F2 0%, #FFE7E9 100%);
    box-shadow: inset 0 0 36px rgba(217, 33, 33, 0.06), 0 8px 24px rgba(217, 33, 33, 0.08);
    overflow: hidden;
    column-count: 5;
    column-gap: 14px;
    column-fill: balance;
}

@media (max-width: 1100px) { .wall-notes { column-count: 4; } }
@media (max-width: 860px)  { .wall-notes { column-count: 3; } }

/* 移动端：改为2列便签网格 */
@media (max-width: 768px) {
    .wall-notes {
        column-count: 2 !important;
        column-gap: 12px;
        padding: 14px 12px 8px;
    }
}

.wall-note {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    display: inline-block;
    width: 100%;
    min-height: 120px;
    padding: 28px 12px 10px;
    margin: 0 0 14px;
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06), 0 8px 18px rgba(217, 33, 33, 0.12);
    font-family: 'Georgia', 'KaiTi', 'STKaiti', serif;
    transition: transform 0.25s, box-shadow 0.25s;
    position: relative;
    box-sizing: border-box;
    cursor: pointer;
    overflow: visible;
    transform: rotate(var(--rot, 0deg));
}

.wall-note.active {
    transform: scale(1.5) rotate(0deg) !important;
    z-index: 9999 !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15), 0 20px 40px rgba(217, 33, 33, 0.25);
}

/* 立体感红色图钉：金属质感 + 光影层次 */
.wall-note .note-pin {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, #ff8a8a 0%, #e23a3a 35%, #c11e1e 65%, #8b0a3d 100%);
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.40),
        0 2px 4px rgba(0, 0, 0, 0.25),
        inset 2px 2px 4px rgba(255, 255, 255, 0.55),
        inset -1px -2px 4px rgba(0, 0, 0, 0.35);
    z-index: 5;
}

.wall-note .note-pin::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 4px;
    width: 8px;
    height: 6px;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    filter: blur(1px);
}

.wall-note .note-pin::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #8b0a3d 0%, #5a0527 50%, #3d0318 100%);
    border-radius: 2px;
    z-index: -1;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
}

.wall-note .note-name {
    color: #d63384;
    font-weight: 600;
    font-size: 0.82rem;
    margin-bottom: 4px;
    line-height: 1.3;
    max-height: 1.3em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 28px;
}

.wall-note .note-text {
    color: #5a4a2a;
    font-size: 0.82rem;
    line-height: 1.45;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding-right: 38px;
    position: relative;
}

.wall-note .note-gigi {
    position: absolute;
    right: 6px;
    bottom: 6px;
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.22);
    z-index: 2;
    background: #fff;
}

@keyframes noteFlyIn {
    0% {
        opacity: 0;
        transform: translateY(240px) rotate(0deg) scale(0.4);
    }
    60% {
        opacity: 1;
        transform: translateY(-18px) rotate(var(--rot, 0deg)) scale(1.06);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotate(var(--rot, 0deg)) scale(1);
    }
}

.wall-note.new-note {
    animation: noteFlyIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.wall-empty {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: min(320px, 86%);
    padding: 30px 24px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(217, 33, 33, 0.12);
    color: #9999AA;
    font-size: 0.95rem;
    text-align: center;
    white-space: normal;
    line-height: 1.6;
}

.wall-empty-gigi {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 4px 14px rgba(217, 33, 33, 0.18);
    background: #fff;
}

.wall-empty-btn {
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 16px;
    padding: 12px 26px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    min-height: 44px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 -2px 4px rgba(0, 0, 0, 0.08), 0 4px 14px rgba(217, 33, 33, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.wall-empty-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(217, 33, 33, 0.25);
}

/* ===== 全部留言列表（ID / 昵称 / 祝福语 / 时间，分页） ===== */
.message-list-area {
    display: none;
    max-width: 780px;
    margin: 0 auto;
}

.message-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.message-list-count {
    color: #888;
    font-size: 0.9rem;
}

.message-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}





.list-empty {
    text-align: center;
    color: #999;
    padding: 40px 0;
}

.message-list-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
}

.page-btn {
    background: linear-gradient(135deg, #ff6b6b, #ffa751);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 22px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    min-height: 44px;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.page-btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-info {
    color: #888;
    font-size: 0.9rem;
    min-width: 70px;
    text-align: center;
}


/* 纸条放大阅读模态框 */
.note-modal-card {
    background: var(--note-bg, #fffdf5);
    background-image: repeating-linear-gradient(180deg, transparent 0, transparent 26px, rgba(217,33,33,0.10) 26px, rgba(217,33,33,0.10) 27px);
    border-radius: 14px;
    padding: 32px 28px 28px;
    max-width: min(620px, 95vw);
    width: 100%;
    max-height: 90dvh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 18px 50px rgba(120, 30, 60, 0.28);
    animation: slideUp 0.4s ease;
}

.note-modal-card::before { content: none !important; 
    content: '';
    position: absolute;
    top: -12px;
    left: -12px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: url('../momo/images/gigi1.jpg') center / cover no-repeat;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(217, 33, 33, 0.18);
    pointer-events: none;
    z-index: 4;
}

.note-modal-close {
    position: absolute;
    top: 6px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.6rem;
    color: #b8002e;
    cursor: pointer;
    line-height: 1;
    z-index: 3;
}

.note-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 8px;
}

.note-modal-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: #d63384;
    margin: 0;
}

.note-modal-time {
    font-size: 0.8rem;
    color: #a08868;
}

.note-modal-body {
    font-size: 0.98rem;
    line-height: 26px;
    color: #4a3516;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: 'Georgia', 'KaiTi', 'STKaiti', serif;
    padding: 4px 0 0;
}

.note-modal-gigi {
    position: absolute;
    right: 18px;
    bottom: 14px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    background: #fff;
    object-fit: cover;
    pointer-events: none;
}

/* 留言墙 DIY / 墙面 移动端适配 */
@media (max-width: 768px) {
    .message-form-container {
        max-width: 100%;
    }

    .form-header {
        flex-wrap: wrap;
        gap: 6px;
    }

    .diy-toggle-btn {
        padding: 5px 12px;
        font-size: 0.75rem;
    }

    .color-opt {
        width: 28px;
        height: 28px;
    }

    .gigi-opt {
        width: 42px;
        height: 42px;
    }

    /* 信纸右下角配图预览 */
    .paper-gigi-preview {
        width: 34px;
        height: 34px;
    }

    /* ==== 移动端墙面：恢复便签网格布局（2-3列紧凑版）==== */
    .wall-view {
        margin-top: 14px;
    }
    .wall-notes {
        width: 100%;
        max-width: 560px;
        min-height: 300px;
        padding: 14px 10px;
        /* 移动端强制 2 列便签网格（用 grid 替代 column，更稳定）*/
        column-count: 0 !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px;
        overflow: visible;
        border-radius: 14px;
    }

    .wall-note {
        break-inside: avoid;
        -webkit-column-break-inside: avoid;
        page-break-inside: avoid;
        display: block;
        width: 100% !important;
        min-height: 96px;
        max-height: 120px;
        padding: 14px 10px 8px;
        margin: 0;
        transform: rotate(var(--rot, 0deg));
        cursor: zoom-in;
        font-size: 0.78rem;
    }

    .wall-note .note-pin {
        width: 12px;
        height: 12px;
        top: -6px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35), inset 1px 1px 2px rgba(255,255,255,0.5);
    }

    .wall-note .note-pin::before {
        width: 4px;
        height: 3px;
        top: 2px;
        left: 2px;
    }

    .wall-note .note-pin::after {
        width: 7px;
        height: 7px;
    }

    .wall-note .note-name {
        font-size: 0.72rem;
        padding-right: 22px;
        margin-bottom: 3px;
    }

    .wall-note .note-text {
        font-size: 0.72rem;
        line-height: 1.35;
        padding-right: 26px;
        /* 移动端 4 行截断 */
        -webkit-line-clamp: 4;
        line-clamp: 4;
    }

    /* 墙面便签配图：右下角小圆图 */
    .wall-note .note-gigi {
        width: 24px;
        height: 24px;
        right: 4px;
        bottom: 4px;
        border-width: 1.5px;
    }

    /* 媒体灯箱 */
    .media-lightbox-close {
        font-size: 2rem;
        top: 10px;
        right: 14px;
    }

    .greet-photos {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

/* ===== 移动端适配（游戏/拼图/答题/信箱） ===== */
@media (max-width: 768px) {
    .game-cards {
        grid-template-columns: 1fr;
        max-width: 320px;
    }

    .puzzle-board {
        max-width: 300px;
    }

    .puzzle-difficulty {
        gap: 8px;
    }

    .diff-btn {
        padding: 12px 16px;
        font-size: 0.9rem;
    }

    .quiz-badge {
        width: 90px;
        padding: 14px 10px;
    }

    .quiz-badge span {
        font-size: 2rem;
    }

    .quiz-question {
        font-size: 1rem;
        padding: 18px;
    }

    .quiz-option {
        padding: 12px 16px;
        font-size: 0.95rem;
    }
}

/* ===== 全局 Toast 提示 ===== */
.toast-container {
    position: fixed;
    top: 90px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    padding: 10px 20px;
    background: rgba(40, 40, 40, 0.92);
    color: #fff;
    border-radius: 20px;
    font-size: 0.9rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
    animation: toastIn 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2);
    max-width: 80vw;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast.warn {
    background: rgba(192, 57, 43, 0.95);
    border-color: rgba(255, 150, 150, 0.3);
}

.toast.success {
    background: rgba(46, 139, 87, 0.95);
    border-color: rgba(150, 255, 180, 0.3);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-10px) scale(0.92); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.toast.out {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastOut {
    to { opacity: 0; transform: translateY(-10px) scale(0.95); }
}

/* ===== 触摸设备 hover 粘住修复 ===== */
/* 触摸设备上 tap 后 hover 会持续，这里重置所有交互元素的 hover 变换 */
@media (hover: none) {
    .nav-link:hover,
    .nav-link:hover.active {
        background: transparent;
        color: #666;
    }
    .nav-link.active:hover {
        background: linear-gradient(135deg, #ff6b6b, #feca57);
        color: white;
    }
    .message-form > button:hover,
    .game-card-item:hover,
    .back-to-lobby:hover,
    .diff-btn:hover,
    .quiz-start-btn:hover,
    .diy-toggle-btn:hover,
    .diy-random-btn:hover,
    .puzzle-tile:hover {
        transform: none !important;
        box-shadow: none !important;
    }
    .color-opt:hover,
    .gigi-opt:hover {
        transform: none !important;
    }
    .greet-photo-item:hover img,
    .card:hover .card-back,
    .quiz-option:hover {
        transform: none !important;
    }
}

/* ===== 键盘焦点可见性 ===== */
/* 只在键盘 Tab 导航时显示焦点环，鼠标点击不显示 */
:focus:not(:focus-visible) {
    outline: none;
}

:focus-visible {
    outline: 2px solid #ff6b6b;
    outline-offset: 2px;
    border-radius: 4px;
}

.nav-link:focus-visible,
button:focus-visible,
.color-opt:focus-visible,
.gigi-opt:focus-visible,
.quiz-option:focus-visible {
    outline: 2px solid #ff6b6b;
    outline-offset: 2px;
}

input:focus-visible,
textarea:focus-visible {
    outline: none;
}

/* ===== 输入方式适配（官方指南模板 L277-291）===== */
/* 触摸设备（手机/平板）：加大按钮间距 + 更清晰的点击反馈 */
@media (pointer: coarse) {
    .nav {
        gap: 16px;
    }
    .nav-link {
        padding: 8px 2px;
    }
    .message-form > button,
    .quiz-start-btn,
    .diff-btn,
    .back-to-lobby {
        min-height: 52px;
        font-size: 1.05rem;
        border-radius: 14px;
    }
    .diy-toggle-btn {
        padding: 10px 18px;
        font-size: 0.9rem;
    }
}

/* 精确指针 + 支持 hover（PC 鼠标用户）：开启悬浮高亮和精致反馈 */
@media (pointer: fine) and (hover: hover) {
    .nav-link:hover:not(.active) {
        background: rgba(255, 107, 107, 0.08);
        color: #ff6b6b;
    }
    .greet-photo-item:hover img {
        transform: scale(1.04);
    }

    .color-opt:hover {
        transform: scale(1.2);
    }
    .gigi-opt:hover {
        transform: scale(1.1);
    }
    .clickable:hover {
        filter: brightness(1.05);
    }
}

/* ================================================================
   Gigi 红全站统一配色体系（以 #fff5f7 为基底，#D92121 为主色，
   #FFE0E2 为过渡色；标题/正文/提示文字分层；卡片、按钮、输入框统一规范）
   ================================================================ */
:root {
    --brand: #D92121;
    --brand-deep: #B51B1B;
    --brand-soft: #FFE0E2;
    --brand-pale: rgba(255, 224, 226, 0.4);
    --bg-base: #FFE0E2;
    --text-title: #2C2C36;
    --text-body: #666677;
    --text-hint: #9999AA;
    --card-bg: #FFFFFF;
    --shadow-soft: 0 8px 24px rgba(217, 33, 33, 0.10);
    --radius: 16px;
}

/* ---- 文字分层 ---- */
body { color: var(--text-body); }
.section h2 { color: var(--text-title); }
.banner h2,
.banner-title-text,
.birthday-title { color: var(--brand); }
.banner-tip,
.game-lobby-tip,
.puzzle-tip,
.quiz-tip,
.star-power-hint,
.message-list-count,
.page-info,
.list-empty,
.wall-empty { color: var(--text-hint); }
.nav-link { color: var(--text-body); }
.footer p { color: var(--text-hint); }

/* ---- 导航：菜单高亮用主色，按钮文字始终居中 ---- */
.nav-link:hover,
.nav-link.active {
    background: var(--brand);
    color: #fff;
    box-shadow: var(--shadow-soft);
}
.nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
}
.nav {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
}

/* ---- 板块标题：短红色装饰线（替代横线/方框分割） ---- */
.section h2 { position: relative; }
.section h2::after {
    content: '';
    display: block;
    width: 56px;
    height: 3px;
    margin: 10px auto 0;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--brand-deep), var(--brand));
}

/* ---- 主按钮：Gigi 红填充、白字、圆角14px ---- */
.diff-btn,
.quiz-start-btn,
.checkin-intro-btn,
.wall-back-btn,
.page-btn,
.message-form > button[type="submit"] {
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 -2px 4px rgba(0, 0, 0, 0.08), 0 4px 14px rgba(217, 33, 33, 0.16);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.diff-btn:hover,
.quiz-start-btn:hover,
.checkin-intro-btn:hover,
.wall-back-btn:hover,
.page-btn:hover:not(:disabled),
.message-form > button[type="submit"]:hover {
    transform: translateY(-2px);
    background: var(--brand-deep);
    box-shadow: 0 4px 16px rgba(217, 33, 33, 0.22);
}

/* ---- 次要线框按钮：细红边框、hover 浅豆沙红 ---- */
.view-all-btn,
.back-to-lobby,
.diy-toggle-btn,
.diy-random-btn,
.puzzle-shuffle,
.lb-tab {
    background: transparent;
    color: var(--brand);
    border: 1px solid var(--brand);
    border-radius: var(--radius);
    box-shadow: none;
    font-weight: 600;
    transition: background 0.2s ease, transform 0.2s ease;
}
.view-all-btn:hover,
.back-to-lobby:hover,
.diy-toggle-btn:hover,
.diy-random-btn:hover,
.puzzle-shuffle:hover,
.lb-tab:hover {
    background: var(--brand-soft);
    transform: translateY(-2px);
    color: var(--brand);
    box-shadow: 0 4px 14px rgba(217, 33, 33, 0.16);
}
.lb-tab.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

/* ---- 统一卡片：14px 圆角 + 柔光阴影 ---- */
.game-card-item,
.quiz-badge,
.countdown-box,
.popup-card,
.message-form,
.note-modal-card,
.checkin-intro-card,
.checkin-intro-card-vue {
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}
.wall-note {
    border-radius: 12px;
}
.game-card-item {
    background: var(--card-bg);
    border: none;
}
.game-card-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(217, 33, 33, 0.14);
}
.game-card-item h3 { color: var(--text-title); }
.game-card-item p { color: var(--text-body); }
.game-card-tag {
    background: var(--brand);
    color: #fff;
}
.star-power-bar { background: var(--brand-soft); }
.star-power-fill {
    background: linear-gradient(90deg, var(--brand-deep), var(--brand));
}
.quiz-badge {
    background: #fff;
    border: none;
}
.quiz-badge p { color: var(--text-body); }
.gacha-frame {
    border-color: rgba(217, 33, 33, 0.25);
    box-shadow: var(--shadow-soft);
}
.countdown-box { background: var(--brand); }
.quiz-question { box-shadow: var(--shadow-soft); }
.quiz-question,
.puzzle-leaderboard {
    border-radius: 16px;
}
.quiz-progress { color: var(--text-hint); }
.quiz-option {
    background: #fff;
    border: 1px solid #E8E8E8;
    color: var(--text-body);
}
.quiz-option:hover {
    border-color: var(--brand);
    background: var(--brand-soft);
}
.quiz-option.correct {
    border-color: var(--brand);
    background: var(--brand-soft);
    color: var(--brand-deep);
}
.quiz-option.wrong {
    border-color: #ccccdd;
    background: #f5f5f7;
    color: var(--text-hint);
}
.danmaku-item {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-soft);
    color: var(--text-title);
}
.danmaku-item .dm-name { color: var(--brand); }

/* ---- 统一输入框：白底 + 细红边框，聚焦微光 ---- */
.message-form input,
.message-form textarea,
.checkin-select,
.checkin-name {
    background: #fff;
    border: 1px solid rgba(217, 33, 33, 0.4);
    border-radius: 10px;
    color: var(--text-body);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.message-form input::placeholder,
.message-form textarea::placeholder,
.checkin-name::placeholder { color: var(--text-hint); }
.message-form input:focus,
.message-form textarea:focus,
.checkin-select:focus,
.checkin-name:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(217, 33, 33, 0.08);
    outline: none;
}

/* ---- 信纸/留言墙：更宽的页边距和信纸感 ---- */
.messages-section {
    padding: 28px clamp(20px, 6vw, 48px) 56px;
}
.message-form {
    background-color: #fff;
    background-image: repeating-linear-gradient(180deg, transparent 0, transparent 27px, rgba(217, 33, 33, 0.12) 27px, rgba(217, 33, 33, 0.12) 28px);
    border: none;
    box-shadow: 0 12px 30px rgba(217, 33, 33, 0.10);
    padding: 28px 28px 24px;
}
.message-form-container {
    position: relative;
    max-width: min(820px, 75vw);
}

/* ---- Banner：底部细红色分割线 ---- */


/* ---- 首页：蛋糕更大、贺频图区更窄留白更多、两列并列 ---- */
.banner { margin-bottom: 26px; }
.cake-3d { width: 320px; }
.greet-track {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px;
    max-width: 720px;
    margin: 0 auto;
    transform: none !important;
    transition: none !important;
}
.greet-photos {
    max-width: 720px;
    margin: 0 auto;
}

/* ---- 游戏乐园：移动端两列、网页端四列，固定一页 ---- */
.game-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    max-width: 760px;
    margin: 0 auto;
}
.game-card-item {
    min-width: 0;
    padding: 18px 12px;
    text-align: center;
}
.game-card-icon { font-size: 2rem; }
@media (max-width: 900px) {
    .game-cards { grid-template-columns: repeat(2, 1fr); }
}

/* ---- 打卡封面：整块圆角矩形盖住上下粉色，图更大 ---- */
@media (max-width: 480px) {
    .cake-3d { width: 250px; }
    .greet-track { grid-template-columns: 1fr !important; }
}

/* ================================================================
   全局 UI 优化 · 移动端补充：
   - 背景再淡一点，避免粉色过重
   - 主操作按钮最小点击宽度 ≥120px
   - 兔子装饰自动缩小，不遮挡文字
   ================================================================ */
@media (max-width: 768px) {
    body { background: #fff5f7; }
    .home-section,
    .games-section,
    .messages-section { background: transparent; }

    .banner {
        padding: 20px 14px 24px;
        border-radius: 20px;
    }

    .diff-btn,
    .quiz-start-btn,
    .checkin-intro-btn,
    .wall-back-btn,
    .view-all-btn,
    .page-btn,
    .back-to-lobby,
    .diy-toggle-btn,
    .message-form > button[type="submit"],
    .wall-empty-btn {
        min-width: 120px;
    }

    .wall-note { border-radius: 10px !important; }

    .wall-empty {
        width: min(280px, 88%);
        padding: 24px 18px;
        gap: 10px;
    }
    .wall-empty-gigi { width: 72px; height: 72px; }

    .popup-card::before {
        width: 34px;
        height: 34px;
        top: -8px;
        left: -8px;
    }
    .popup-card::after {
        width: 26px;
        height: 26px;
        bottom: -8px;
        right: -8px;
    }
    .note-modal-card::before {
        width: 34px;
        height: 34px;
        top: -8px;
        left: -8px;
    }
}

/* ============================================================
   === 品质提升 v2：统一设计变量 + Loading + 汉堡菜单 + 翻页钟 + 过渡动画 + 回顾页优化 ===
   ============================================================ */

/* ---------- 1. 统一设计语言 CSS 变量 ---------- */
:root {
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-pill: 999px;
    --shadow-sm: 0 2px 8px rgba(217, 33, 33, 0.08);
    --shadow-md: 0 4px 16px rgba(217, 33, 33, 0.12);
    --shadow-lg: 0 8px 28px rgba(217, 33, 33, 0.18);
    --shadow-glow: 0 4px 18px rgba(255, 107, 107, 0.35);
    --color-primary: #D92121;
    --color-primary-light: #ff6b6b;
    --color-accent: #ffa751;
    --color-bg: #FFE0E2;
    --color-bg-soft: #fff9fb;
    --color-text: #333;
    --color-text-sub: #666677;
    --color-text-muted: #999;
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ---------- 2. 首屏 Loading 页 ---------- */
.page-loading {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: linear-gradient(135deg, #fff9fb 0%, #ffe8ec 50%, #ffd6da 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}
.page-loading.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.loading-content {
    text-align: center;
    animation: loadingFadeIn 0.8s ease;
}
@keyframes loadingFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.loading-gigi {
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(255, 107, 107, 0.3);
    animation: loadingBounce 1.2s ease-in-out infinite;
}
.loading-gigi img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
@keyframes loadingBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-12px) scale(1.05); }
}
.loading-text {
    color: var(--color-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
    letter-spacing: 1px;
}
.loading-dots {
    display: inline-block;
    animation: loadingDots 1.4s steps(4, end) infinite;
}
@keyframes loadingDots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}
.loading-bar {
    width: 200px;
    height: 6px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-pill);
    margin: 0 auto;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.08);
}
.loading-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-primary-light), var(--color-accent));
    border-radius: var(--radius-pill);
    transition: width 0.3s ease;
    box-shadow: 0 0 8px rgba(255, 107, 107, 0.5);
}

/* ---------- 3. 移动端汉堡菜单 + 抽屉 ---------- */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(217, 33, 33, 0.15);
    border-radius: var(--radius-md);
    cursor: pointer;
    padding: 0;
    z-index: 101;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
    touch-action: none;
    -webkit-touch-callout: none;
    cursor: grab;
}
.hamburger-btn span {
    display: block;
    width: 22px;
    height: 2.5px;
    background: var(--color-primary);
    border-radius: 2px;
    transition: all 0.35s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
.hamburger-btn.active span:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}
.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.hamburger-btn.active span:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}
.mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}
.mobile-nav-overlay.active {
    display: block;
    opacity: 1;
}

@media (max-width: 768px) {
    .hamburger-btn {
        display: flex;
        position: fixed;
        top: max(12px, env(safe-area-inset-top));
        right: max(12px, env(safe-area-inset-right));
        z-index: 101;
    }
    .header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 100;
        background: transparent !important;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: none !important;
        pointer-events: none;
    }
    .header-content {
        height: 56px;
        padding: 0 16px;
    }
    .hamburger-btn {
        pointer-events: auto;
        width: 40px;
        height: 40px;
        background: rgba(255,255,255,0.9);
        border-radius: 50%;
        box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    }
    .nav {
        display: flex;
        grid-template-columns: none;
        pointer-events: auto;
        position: fixed;
        top: 0;
        right: -280px;
        width: 260px;
        height: 100dvh;
        background: linear-gradient(180deg, #fff9fb 0%, #fff0f3 100%);
        flex-direction: column;
        justify-content: flex-start;
        padding: 80px 20px 30px;
        gap: 4px;
        box-shadow: -4px 0 24px rgba(0,0,0,0.12);
        transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 100;
        overflow-y: auto;
    }
    .nav.open {
        right: 0;
    }
    .nav-link {
        width: 100%;
        text-align: left;
        padding: 14px 16px;
        border-radius: var(--radius-md);
        font-size: 1rem;
        font-weight: 500;
        transition: all var(--transition-fast);
    }
    .nav-link:hover,
    .nav-link.active {
        background: rgba(217, 33, 33, 0.08);
        color: var(--color-primary);
        transform: translateX(4px);
    }
    .nav-link.active {
        font-weight: 700;
        border-left: 3px solid var(--color-primary);
        padding-left: 13px;
    }
    .top-banner {
        margin-top: 56px;
    }
}

/* ---------- 4. 翻页倒计时 Flip Clock（简化版，更可靠） ---------- */
.flip-clock {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.flip-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.flip-digit {
    position: relative;
    width: 56px;
    height: 72px;
    perspective: 400px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}
/* 隐藏旧的flap层，不再使用 */
.flip-digit .flip-flap-top,
.flip-digit .flip-flap-bottom {
    display: none !important;
}
.flip-digit .flip-top,
.flip-digit .flip-bottom {
    position: absolute;
    left: 0;
    width: 100%;
    height: 50%;
    overflow: hidden;
    text-align: center;
    font-size: 2.2rem;
    font-weight: 800;
    color: #fff;
    backface-visibility: hidden;
}
.flip-digit .flip-top {
    top: 0;
    line-height: 72px; /* 数字高度=容器高度，垂直居中，上半容器显示数字上半 */
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border-bottom: 1px solid rgba(0,0,0,0.2);
    background: linear-gradient(180deg, #ff7a7a 0%, #e84545 100%);
    transform-origin: bottom center;
    z-index: 2;
}
.flip-digit .flip-bottom {
    bottom: 0;
    line-height: 0; /* 行高为0，基线对齐容器顶部，下半容器显示数字下半 */
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    background: linear-gradient(180deg, #c41e1e 0%, #9a1515 100%);
    z-index: 1;
}
/* 翻页动画：上层向下翻到90度，切换内容后翻回来 */
.flip-digit.flipping .flip-top {
    animation: flipTopAnim 0.6s ease-in-out forwards;
}
@keyframes flipTopAnim {
    0% { transform: rotateX(0deg); }
    50% { transform: rotateX(-90deg); }
    100% { transform: rotateX(0deg); }
}
.flip-label {
    font-size: 0.75rem;
    color: var(--color-text-sub);
    font-weight: 600;
    letter-spacing: 1px;
}
.flip-separator {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--color-primary-light);
    padding-bottom: 18px;
    animation: separatorBlink 1s ease-in-out infinite;
}
@keyframes separatorBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

@media (max-width: 480px) {
    .flip-clock { gap: 3px; }
    .flip-digit { width: 42px; height: 54px; }
    .flip-digit .flip-top,
    .flip-digit .flip-bottom {
        font-size: 1.6rem;
    }
    .flip-digit .flip-top { line-height: 54px; }
    .flip-digit .flip-bottom { line-height: 0; }
    .flip-separator { font-size: 1.3rem; padding-bottom: 14px; }
    .flip-label { font-size: 0.65rem; }
}

/* ---------- 5. 页面切换过渡动画 ---------- */
.section {
    display: none;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.45s ease, transform 0.45s ease;
}
.section.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: sectionFadeIn 0.5s ease;
}
@keyframes sectionFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
main {
    position: relative;
}

/* ---------- 7. 按钮统一交互反馈 ---------- */
button,
.nav-link,
.color-opt,
.gigi-opt,
.diy-toggle-btn,
.diy-random-btn,
.quiz-option,
.diff-btn,
.back-to-lobby,
.wall-back-btn,
.view-all-btn,
.page-btn,
.game-card-item,
.wall-note,
.greet-photo-item,
.puzzle-tile,
.lb-tab,
.wall-empty-btn,
.message-form > button[type="submit"] {
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), opacity var(--transition-fast);
}
button:hover:not(:disabled),
.nav-link:hover,
.color-opt:hover,
.gigi-opt:hover,
.diy-toggle-btn:hover,
.diy-random-btn:hover,
.quiz-option:hover:not(:disabled),
.diff-btn:hover,
.back-to-lobby:hover,
.wall-back-btn:hover,
.view-all-btn:hover,
.page-btn:hover:not(:disabled),
.lb-tab:hover,
.wall-empty-btn:hover {
    transform: translateY(-2px);
}
button:active:not(:disabled),
.nav-link:active,
.color-opt:active,
.gigi-opt:active,
.quiz-option:active:not(:disabled),
.diff-btn:active,
.game-card-item:active,
.puzzle-tile:active,
.lb-tab:active {
    transform: scale(0.96);
}

/* 游戏卡片 hover 动效 */
.game-card-item {
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}
.game-card-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(217, 33, 33, 0.18);
    border-color: rgba(217, 33, 33, 0.3);
}
.game-card-item:hover .game-card-icon {
    transform: scale(1.15) rotate(-5deg);
}
.game-card-icon {
    transition: transform var(--transition-base);
}

.home-section {
    background: linear-gradient(180deg, var(--color-bg-soft) 0%, var(--color-bg) 100%);
}
.timeline-section {
    background: #07091a;
    min-height: 100dvh;
    min-height: 100dvh;
}
.messages-section {
    background: transparent;
}
/* 只有便签墙是白色纹理背景，铺满整个区域，无圆角 */
.wall-view.active {
    display: flex !important;
    background: url('../momo/images/wall-bg.png') center/cover no-repeat;
    border-radius: 0;
    padding: 24px 20px;
    min-height: calc(100dvh - 300px);
    margin: 0 -20px;
    width: calc(100% + 40px);
    overflow: visible !important;
}
/* 按钮放在墙外面 */
.wall-footer {
    display: flex !important;
    gap: 14px !important;
    padding: 20px !important;
    position: static !important;
}
    padding: 20px !important;
    position: static !important;
}
    flex-wrap: wrap !important;
    justify-content: center !important;
    margin-top: 20px;
    padding: 0 20px;
}
.games-section {
    background: linear-gradient(180deg, #fff5f7 0%, #ffe8ec 100%);
    min-height: 100dvh;
    min-height: 100dvh;
}
.checkin-section {
    background: var(--color-bg-soft);
    min-height: 100dvh;
    min-height: 100dvh;
}

/* 回顾页内部元素铺满，避免两侧露白 */
/* 游戏页文字颜色适配浅色背景 */
.games-section {
    padding-top: 0 !important;
}

.games-section h2 {
    color: var(--color-primary) !important;
}
.games-section .game-lobby-tip,
.games-section .puzzle-tip,
.games-section .quiz-tip {
    color: var(--color-text-sub) !important;
}
.games-section .game-card-item {
    background: #fff !important;
    border: 1px solid rgba(217, 33, 33, 0.1) !important;
    color: var(--color-text) !important;
}
.games-section .game-card-item h3 {
    color: var(--color-primary) !important;
}
.games-section .game-card-item p {
    color: var(--color-text-sub) !important;
}

/* 自定义滚动条 */
/* 隐藏所有滚动条但保留滚动功能 */
::-webkit-scrollbar {
    width: 0px;
    height: 0px;
    display: none;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: transparent;
}
* {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
   === 留言墙 v3：透明输入框 + 软木板墙面 + 小便利贴 + 爱心 + 两列列表 ===
   ============================================================ */

/* ---------- 1. 输入框透明化 ---------- */
.message-form {
    border: 1px solid rgba(217, 33, 33, 0.12);
    box-shadow: 0 12px 30px rgba(217, 33, 33, 0.10);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.message-form::before {
    display: none !important;
}
.message-form input,
.message-form textarea {
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid rgba(217, 33, 33, 0.15) !important;
    border-radius: 0 !important;
    padding: 8px 4px !important;
    color: #4a3516 !important;
    transition: border-color 0.3s ease !important;
}
.message-form input:focus,
.message-form textarea:focus {
    border-bottom-color: rgba(217, 33, 33, 0.5) !important;
    background: rgba(255, 255, 255, 0.3) !important;
    box-shadow: none !important;
}
.message-form input::placeholder,
.message-form textarea::placeholder {
    color: rgba(153, 130, 90, 0.6) !important;
}
.paper-textarea-wrap {
    position: relative;
}
.paper-gigi-preview {
    opacity: 0.5;
    transition: opacity 0.3s ease;
}
.paper-gigi-preview:hover {
    opacity: 0.8;
}

/* ---------- 便签墙：透明背景，便签直接贴在页面背景上 ---------- */
.wall-notes {
    position: relative !important;
    min-height: 520px !important;
    padding: 24px 20px !important;
    border-radius: 16px !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    column-count: auto !important;
    overflow: visible !important;
}

/* 去掉软木板木纹颗粒感 */
.wall-notes::before {
    display: none !important;
}

/* ---------- 3. 小便利贴样式（迷你版，一墙可放100+张） ---------- */
.wall-note {
    position: absolute !important;
    width: 58px !important;
    min-height: 48px !important;
    max-height: 64px !important;
    padding: 14px 5px 4px !important;
    margin: 0 !important;
    border-radius: 2px !important;
    background-image: repeating-linear-gradient(180deg, transparent 0, transparent 23px, rgba(217, 33, 33, 0.16) 23px, rgba(217, 33, 33, 0.16) 24px) !important;
    box-shadow:
        0 1px 2px rgba(0,0,0,0.15),
        0 3px 8px rgba(0,0,0,0.18) !important;
    font-family: 'Georgia', 'KaiTi', 'STKaiti', serif !important;
    cursor: pointer !important;
    overflow: hidden !important;
    z-index: 2 !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, z-index 0s !important;
    break-inside: auto !important;
    display: block !important;
}
.wall-note.heart-note {
    background-color: #ffdde4 !important;
}
.wall-note::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 10px;
    background: linear-gradient(180deg, rgba(255,255,255,0.25) 0%, transparent 100%);
    pointer-events: none;
}

.wall-note .note-pin {
    top: -5px !important;
    width: 10px !important;
    height: 10px !important;
}
.wall-note .note-name {
    font-size: 0.52rem !important;
    margin-bottom: 2px !important;
    padding-right: 2px !important;
    max-height: 1.1em !important;
    line-height: 1.1 !important;
}
.wall-note .note-text {
    font-size: 0.5rem !important;
    line-height: 1.25 !important;
    -webkit-line-clamp: 3 !important;
    line-clamp: 3 !important;
    padding-right: 2px !important;
}
.wall-note .note-gigi {
    width: 22px !important;
    height: 22px !important;
    right: 4px !important;
    bottom: 4px !important;
    border-width: 2px !important;
}

/* 便利贴颜色变体 */
.wall-note.color-yellow { background: linear-gradient(135deg, #fff9c4 0%, #fff59d 100%); }
.wall-note.color-pink { background: linear-gradient(135deg, #ffcdd2 0%, #ef9a9a 100%); }
.wall-note.color-blue { background: linear-gradient(135deg, #bbdefb 0%, #90caf9 100%); }
.wall-note.color-green { background: linear-gradient(135deg, #c8e6c9 0%, #a5d6a7 100%); }
.wall-note.color-purple { background: linear-gradient(135deg, #e1bee7 0%, #ce93d8 100%); }
.wall-note.color-orange { background: linear-gradient(135deg, #ffe0b2 0%, #ffcc80 100%); }

/* 红色爱心便利贴（固定位置） */
.wall-note.heart-note {
    background: linear-gradient(135deg, #ff5252 0%, #d32f2f 100%) !important;
    box-shadow:
        0 1px 3px rgba(0,0,0,0.2),
        0 4px 14px rgba(211,47,47,0.4) !important;
    z-index: 3 !important;
}
.wall-note.heart-note .note-name,
.wall-note.heart-note .note-text {
    color: #fff !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3) !important;
}
.wall-note.heart-note .note-name {
    text-align: center;
    padding-right: 0 !important;
    font-size: 0.6rem !important;
}
.wall-note.heart-note .note-text {
    text-align: center;
    padding-right: 0 !important;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    letter-spacing: 1px;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.wall-note.heart-note .note-pin {
    background: radial-gradient(circle at 32% 28%, #ff8a8a 0%, #e23a3a 35%, #c11e1e 65%, #8b0a3d 100%) !important;
}

/* 爱心空状态提示 */
.wall-empty {
    position: relative !important;
    z-index: 10 !important;
    background: rgba(255,255,255,0.9) !important;
    border-radius: 12px !important;
    padding: 30px 20px !important;
    max-width: 280px !important;
    margin: 100px auto !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15) !important;
}

/* ---------- 4. 全部留言：两列便利贴列表 ---------- */
.message-list-area {
    max-width: 680px !important;
    margin: 0 auto;
}
.message-list {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
}

@media (max-width: 600px) {
    .message-list {
        grid-template-columns: 1fr !important;
    }
    .wall-note {
        width: 36px !important;
        min-height: 32px !important;
        padding: 9px 2px 2px !important;
    }
    .wall-note .note-name,
    .wall-note .note-text {
        font-size: 0.36rem !important;
    }
    .wall-note .note-pin {
        width: 8px !important;
        height: 8px !important;
        top: -4px !important;
    }
    .wall-note .note-gigi {
        width: 16px !important;
        height: 16px !important;
        right: 3px !important;
        bottom: 3px !important;
        border-width: 1.5px !important;
    }
    .wall-notes {
        min-height: 380px !important;
        padding: 12px 8px !important;
        border-width: 5px !important;
    }
}

/* 留言墙底部按钮 */
.wall-footer {
    position: relative !important;
    z-index: 10 !important;
    margin-top: 20px !important;
}

/* ============================================================
   === 查看全部：简洁列表 + 搜索框（覆盖之前的两列便利贴） ===
   ============================================================ */

/* 搜索框 */
.message-list-search {
    margin-bottom: 14px;
}
.message-list-search input {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid rgba(217, 33, 33, 0.2);
    border-radius: 12px;
    font-size: 0.9rem;
    background: #fff;
    color: #333;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}
.message-list-search input:focus {
    outline: none;
    border-color: rgba(217, 33, 33, 0.5);
    box-shadow: 0 0 0 3px rgba(217, 33, 33, 0.08);
}
.message-list-search input::placeholder {
    color: #aaa;
}

/* 简洁列表：一行一条，不倾斜，不用卡片感觉 */
.message-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(217, 33, 33, 0.08);
}

/* 搜索无结果 */
.list-empty {
    padding: 40px 20px !important;
    text-align: center !important;
    color: #999 !important;
    background: #fff !important;
    border-radius: 12px !important;
}

/* ================================================================
   === 移动端适配 v2：返回大厅按钮 + 页面高度 + 滚动优化 ===
   ============================================================ */
@media (max-width: 768px) {
    /* 返回大厅按钮固定在左上角，圆形图标，和汉堡菜单平齐 */
    .back-to-lobby {
        position: fixed;
        top: 12px;
        left: 12px;
        z-index: 101;
        margin-bottom: 0 !important;
        padding: 0 !important;
        width: 40px !important;
        height: 40px !important;
        border-radius: 50% !important;
        font-size: 16px !important;
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* 游戏页内容顶部留出按钮空间 */
    .games-section .game-view,
    .games-section .game-lobby {
        padding-top: 60px;
    }

    /* 游戏大厅标题上移 */
    .games-section {
    padding-top: 100px !important;
}

.games-section h2 {
        margin-top: 0;
    }

    /* 首页允许正常滚动 */
    .home-section {
        overflow-x: hidden;
    }

    /* 留言墙允许滚动 */
    .messages-section {
        overflow-x: hidden;
    }

    /* 页面切换时禁止横向滚动 */
    body {
        overflow-x: hidden;
    }
}

/* 桌面端页面最小高度 */
@media (min-width: 769px) {
    .games-section,
    .timeline-section,
    .checkin-section {
        min-height: calc(100dvh - 80px);
    }
.home-section,
    .messages-section {
        min-height: calc(100dvh - 80px);
    }
}

/* ================================================================
   成长回顾 · 星空版（替换老版线性回顾）
   ================================================================ */
.timeline-section {
    position: relative;
    overflow: hidden;
    background: #07091a;
    padding: 0;
    max-width: none;
}

.star-map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.star-map #starCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}

.star-map-screen {
    position: absolute;
    inset: 0;
    z-index: 2;
    overflow: hidden;
}

.star-map .page {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.45s ease;
}

.star-map .page.active {
    opacity: 1;
    visibility: visible;
}

/* ---------- 音乐按钮：右下角，避开右上角汉堡菜单 ---------- */
.star-music-btn {
    position: absolute;
    right: calc(18px + env(safe-area-inset-right));
    top: calc(18px + env(safe-area-inset-top));
    z-index: 9;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(160, 180, 240, 0.35);
    background: rgba(16, 21, 44, 0.78);
    color: #9fb0dd;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.star-music-btn.playing {
    color: #ffe9b0;
    border-color: rgba(255, 220, 160, 0.6);
    box-shadow: 0 0 18px rgba(255, 200, 120, 0.45);
}

.star-music-btn.playing .music-icon {
    animation: starMusicSpin 3s linear infinite;
    display: inline-block;
}

.star-music-btn.paused .music-icon {
    opacity: 0.5;
}

@keyframes starMusicSpin {
    to { transform: rotate(360deg); }
}

/* ---------- 导航页：星座星轨 ---------- */
.star-map .nav-page {
    background:
      radial-gradient(600px 400px at 50% 8%, rgba(90,110,190,.10), transparent 70%),
      url('star-review/bg.jpg') center/cover no-repeat;
    background-color: #1a1035;
}

.star-map .nav-header {
    position: relative;
    z-index: 3;
    padding: 20px 24px 0;
    text-align: center;
    pointer-events: none;
}

.star-map #navTitle {
    pointer-events: auto;
    cursor: pointer;
}

.star-map .nav-title {
    font-size: clamp(20px, 5vw, 26px);
    font-weight: 400;
    letter-spacing: 6px;
    color: #eef3ff;
    margin-bottom: 6px;
    text-shadow: 0 0 18px rgba(170, 195, 255, 0.45);
}

.star-map .nav-subtitle {
    font-size: clamp(11px, 2.8vw, 13px);
    font-weight: 300;
    color: #d0d8f0;
    letter-spacing: 2px;
}

.star-map .progress-chip {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 12px;
    border: 1px solid rgba(160, 180, 240, 0.22);
    border-radius: 20px;
    background: rgba(20, 26, 54, 0.55);
    color: #aeb9de;
    font-size: 12px;
    letter-spacing: 1px;
}

.star-map .constellation {
    position: absolute;
    top: 84px;
    left: 50%;
    transform: translateX(-50%);
    width: min(360px, 90vw);
    bottom: 0;
    z-index: 2;
}

.star-map .constellation-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.star-map .track-seg {
    fill: none;
    stroke-linecap: round;
    transition: opacity 0.6s ease;
}

/* 星尘颗粒闪烁 */
.stardust {
    animation: stardustTwinkle 2s ease-in-out infinite;
}
@keyframes stardustTwinkle {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.8; }
}

/* ✨四角星装饰闪烁 */
.sparkle-star {
    animation: sparkleTwinkle 2.5s ease-in-out infinite;
    transform-origin: center;
}
@keyframes sparkleTwinkle {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

.star-map .track-seg.locked {
    stroke: rgba(130, 145, 190, 0.14);
    stroke-width: 1.4;
    stroke-dasharray: 1 9;
}

.star-map .track-seg.done {
    stroke: url(#segGrad);
    stroke-width: 2;
    opacity: 0.9;
    filter: drop-shadow(0 0 6px rgba(160, 190, 255, 0.55));
}

.star-map .track-seg.active {
    stroke: url(#segGrad);
    stroke-width: 2;
    stroke-dasharray: 4 14;
    opacity: 0.8;
    filter: drop-shadow(0 0 6px rgba(160, 190, 255, 0.55));
    animation: starDashFlow 1.6s linear infinite;
}

@keyframes starDashFlow {
    to { stroke-dashoffset: -72; }
}

.star-map .year-node {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    letter-spacing: 0.5px;
    transition: transform 0.3s ease;
    cursor: pointer;
    user-select: none;
    background: rgba(14, 18, 40, 0.82);
    border: 1px solid rgba(130, 145, 190, 0.25);
    color: #6d7696;
    z-index: 2;
}

.star-map .year-node.locked {
    background: rgba(60, 55, 100, 0.75);
    color: rgba(200, 195, 230, 0.9);
    border: 1px solid rgba(150, 140, 200, 0.5);
}

.star-map .year-node.current {
    border-color: #dbe6ff;
    color: #f2f6ff;
    background: rgba(48, 62, 120, 0.75);
    animation: starNodePulse 2.2s ease-in-out infinite;
}

.star-map .year-node.unlocked {
    border-color: rgba(200, 218, 255, 0.85);
    color: #eef3ff;
    background: rgba(70, 92, 168, 0.55);
    box-shadow: 0 0 16px rgba(160, 190, 255, 0.5), inset 0 0 10px rgba(160, 190, 255, 0.18);
    animation: starNodeTwinkle 2.5s ease-in-out infinite;
}

@keyframes starNodeTwinkle {
    0%, 100% {
        box-shadow: 0 0 10px rgba(160, 190, 255, 0.4), inset 0 0 6px rgba(160, 190, 255, 0.15);
        opacity: 0.9;
    }
    50% {
        box-shadow: 0 0 24px rgba(200, 220, 255, 0.8), inset 0 0 14px rgba(200, 220, 255, 0.3);
        opacity: 1;
    }
}

.star-map .year-node.unlocked::after {
    content: "✦";
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 11px;
    color: #ffd882;
    text-shadow: 0 0 8px rgba(255, 216, 130, 0.8);
}

.star-map .year-node:hover {
    transform: translate(-50%, -50%) scale(1.08);
    animation-play-state: paused;
}

.star-map .year-node.shake {
    animation: starNodeShake 0.4s ease;
}

@keyframes starNodePulse {
    0%, 100% { box-shadow: 0 0 8px rgba(160, 190, 255, 0.30); }
    50% { box-shadow: 0 0 24px rgba(160, 190, 255, 0.85); }
}

@keyframes starNodeShake {
    10%, 90% { transform: translate(-50%, -50%) translateX(-2px); }
    20%, 80% { transform: translate(-50%, -50%) translateX(3px); }
    30%, 50%, 70% { transform: translate(-50%, -50%) translateX(-4px); }
    40%, 60% { transform: translate(-50%, -50%) translateX(4px); }
}

.star-map .nav-hint {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 22px;
    text-align: center;
    color: #c5cde8;
    font-size: 12px;
    letter-spacing: 2px;
    z-index: 3;
    pointer-events: none;
}

/* ---------- 相册页 ---------- */
.star-map .album-page {
    background: #07091a;
    min-height: 100dvh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 56px 16px calc(40px + env(safe-area-inset-bottom));
    background: #07091a radial-gradient(700px 500px at 50% 35%, rgba(70, 90, 180, 0.12), transparent 70%);
}

.star-map .back-btn {
    position: absolute;
    top: 22px;
    left: 18px;
    z-index: 4;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 22px;
    font-size: 13px;
    color: #b9c3e2;
    cursor: pointer;
    transition: all 0.3s ease;
}

.star-map .back-btn:hover {
    border-color: rgba(180, 200, 245, 0.6);
    color: #eef3ff;
}

.star-map .nav-back-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
}

.star-map .album-year-tag {
    padding: 5px 16px;
    border: 1px solid rgba(160, 190, 255, 0.4);
    border-radius: 20px;
    background: rgba(50, 64, 130, 0.4);
    color: #dbe6ff;
    font-size: 13px;
    letter-spacing: 2px;
    box-shadow: 0 0 14px rgba(140, 170, 255, 0.25);
}

.star-map .album-title {
    margin-top: 12px;
    font-size: clamp(16px, 4.2vw, 20px);
    font-weight: 400;
    letter-spacing: 1.5px;
    color: #eef3ff;
    text-align: center;
}

.star-map .album-images-wrap {
    position: relative;
    width: min(70%, 280px);
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.star-map .album-images-wrap .album-img {
    width: 100%;
    height: 38dvh;
    max-height: 38dvh;
    object-fit: contain;
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.5s ease, transform 0.6s ease;
}

.star-map .album-images-wrap .album-img.show {
    opacity: 1;
    transform: scale(1);
}

/* 单张图时居中显示 */
.star-map .album-images-wrap.single-img {
    grid-template-columns: 1fr;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 768px) {
    .star-map .album-images-wrap {
        grid-template-columns: repeat(3, 1fr);
        max-width: 560px;
    }
    .star-map .album-images-wrap.single-img {
        max-width: 320px;
    }
}

.star-map .album-story {
    width: min(85%, 380px);
    min-height: 60px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 14.5px;
    line-height: 1.75;
    color: #d3dcf5;
    letter-spacing: 0.4px;
    text-align: justify;
    text-align-last: center;
}

/* 移动端：调整文字排版，避免单字成行 */
@media (max-width: 480px) {
    .star-map .album-story {
        width: min(92%, 380px);
        font-size: 14px;
        letter-spacing: 0.2px;
        line-height: 1.7;
    }
    .star-map .album-images-wrap {
        width: min(80%, 260px);
    }
}

.star-map .album-progress {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    min-height: 8px;
}

.star-map .album-progress .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(140, 155, 200, 0.22);
    transition: all 0.35s ease;
}

.star-map .album-progress .dot.on {
    background: #cfe0ff;
    box-shadow: 0 0 8px rgba(190, 215, 255, 0.8);
}

.star-map .album-hint {
    margin-top: 12px;
    font-size: 12.5px;
    color: #7d88ad;
    letter-spacing: 2px;
}

/* ---------- 结尾页 ---------- */
.star-map .ending-page {
    position: absolute;
    inset: 0;
    display: block;
    text-align: center;
    background: #07091a radial-gradient(700px 500px at 50% 22%, rgba(120, 110, 220, 0.14), transparent 70%);
}

.star-map .ending-title {
    position: absolute;
    top: 36%;
    left: 50%;
    transform: translateX(-50%) translateY(18px);
    width: 90%;
    font-size: clamp(18px, 4.5vw, 26px);
    font-weight: 300;
    letter-spacing: 4px;
    color: #eef3ff;
    text-shadow: 0 0 24px rgba(180, 205, 255, 0.5);
    opacity: 0;
    transition: all 0.9s ease 0.2s;
}

.star-map .ending-title.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.star-map .ending-subtitle {
    position: absolute;
    top: 46%;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    width: 90%;
    margin-top: 0;
    font-size: clamp(13px, 3.4vw, 15px);
    line-height: 1.9;
    color: #8a93b5;
    letter-spacing: 1.5px;
    opacity: 0;
    transition: all 0.9s ease 0.55s;
}

.star-map .ending-subtitle.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.star-map .restart-btn {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 0;
}

.star-map .restart-btn {
    margin-top: 34px;
    padding: 11px 30px;
    border: 1px solid rgba(190, 210, 255, 0.35);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.07);
    color: #c9d4f0;
    font-size: 14px;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(14px);
}

.star-map .restart-btn.show {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.9s ease 0.9s;
}

.star-map .restart-btn:hover {
    border-color: rgba(190, 210, 255, 0.7);
    color: #fff;
    box-shadow: 0 0 18px rgba(160, 190, 255, 0.35);
}

/* ---------- 开场页：水波纹 intro（深色版） ---------- */
.star-map .intro-page {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #07091a radial-gradient(700px 500px at 50% 32%, rgba(90, 110, 190, 0.16), transparent 70%);
}

.star-map .star-ripple {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.star-map .intro-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 24px;
    max-width: 420px;
}

.star-map .intro-title {
    font-size: clamp(26px, 7vw, 34px);
    font-weight: 300;
    letter-spacing: 6px;
    color: #eef3ff;
    text-shadow: 0 0 24px rgba(170, 195, 255, 0.5);
}

.star-map .intro-sub {
    margin-top: 12px;
    font-size: 14px;
    color: #8a93b5;
    letter-spacing: 2px;
}

.star-map .intro-desc {
    margin-top: 18px;
    font-size: 15px;
    line-height: 1.8;
    color: #c9d4f0;
    letter-spacing: 1px;
}

.star-map .intro-start {
    margin-top: 34px;
    padding: 14px 44px;
    border-radius: 30px;
    border: 1px solid rgba(190, 210, 255, 0.4);
    background: linear-gradient(135deg, #3a4a8a, #2c3560);
    color: #fff;
    font-size: 16px;
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(80, 100, 200, 0.35);
    transition: all 0.3s ease;
}

.star-map .intro-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(80, 100, 200, 0.5);
}

/* ---------- 提示浮层 ---------- */
.star-map .hint-toast {
    position: absolute;
    top: 96px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 8;
    padding: 9px 18px;
    border-radius: 22px;
    background: rgba(20, 26, 54, 0.9);
    border: 1px solid rgba(180, 205, 255, 0.3);
    color: #dbe6ff;
    font-size: 13px;
    letter-spacing: 1px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease;
    white-space: nowrap;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

.star-map .hint-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(4px);
}

@media (max-height: 620px) {
    .star-map .year-node {
        width: 40px;
        height: 40px;
        font-size: 12px;
    }
    .star-map .constellation {
        top: 76px;
    }
    .star-map .album-story {
        min-height: 62px;
        font-size: 13.5px;
    }
    .star-map .album-image-wrap {
        height: min(48dvh, 380px);
    }
}

/* ================================================================
   官方指南：只隐藏横向滚动，保留纵向滚动（用 clip 避免产生滚动容器，
   否则部分环境鼠标滚轮/触摸板会失效，只能拖动滚动条）
   ================================================================ */
@supports (overflow: clip) {
    html,
    body,
    main,
    .section {
        overflow-x: clip;
    }
}

/* 固定一页的板块：整屏展示，不出现右侧滚动条 */
.games-section {
    min-height: calc(100dvh - var(--header-h) - var(--banner-h));
    min-height: calc(100dvh - var(--header-h) - var(--banner-h));
    overflow-x: hidden;
    overflow-y: auto;
}

/* ================================================================
   游戏模式：进入具体游戏时隐藏菜单栏，只留左上角返回键
   ================================================================ */


body.game-mode main {
    height: 100dvh;
    height: 100dvh;
}

body.game-mode .games-section {
    height: 100dvh;
    height: 100dvh;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

.games-section .game-view {
    padding-top: 64px;
}

/* 返回大厅：简单圆形箭头，左上角与汉堡键平齐 */
.back-to-lobby {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 9999 !important;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid rgba(217, 33, 33, 0.18);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #b8002e;
    font-size: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    pointer-events: auto !important;
}

.back-to-lobby:hover {
    background: #fff;
}

/* 追光抽卡：去掉外层大框架，只留游戏本体 */
.gacha-frame {
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* ================================================================
   全部留言：便利贴卡片（第一行 ID，下面留言，有间隙）
   ================================================================ */
.message-list {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
    align-items: flex-start;
}

.ml-note {
    flex: 0 1 260px;
    max-width: 280px;
    min-width: 200px;
    padding: 14px 14px 10px;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(217, 33, 33, 0.10), 0 1px 3px rgba(0, 0, 0, 0.06);
    cursor: zoom-in;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    height: auto;
}

.ml-note:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 22px rgba(217, 33, 33, 0.16);
}

.ml-note-id {
    color: #b8002e;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px dashed rgba(184, 0, 46, 0.25);
    word-break: break-all;
    line-height: 1.4;
}

.ml-note-text {
    color: #5a4a2a;
    font-size: 0.9rem;
    line-height: 1.6;
    word-break: break-word;
    white-space: pre-wrap;
}

.ml-note-time {
    margin-top: 10px;
    color: rgba(90, 74, 42, 0.55);
    font-size: 0.72rem;
    text-align: right;
}

/* ===== 生日贺频：卡片列表 ===== */
.greet-item-card {
    background: linear-gradient(145deg, #fff5f6 0%, #fff0f3 100%);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(184, 0, 46, 0.10);
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border: 1px solid rgba(255, 182, 193, 0.3);
}
.greet-item-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(184, 0, 46, 0.18);
}
.greet-item-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #fce4ec;
}
.greet-item-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.greet-item-card:hover .greet-item-cover img {
    transform: scale(1.04);
}
.greet-item-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #b8002e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    padding-left: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, background 0.2s ease;
}
.greet-item-card:hover .greet-item-play {
    transform: translate(-50%, -50%) scale(1.1);
    background: #fff;
}
.greet-item-info {
    padding: 16px 18px 18px;
}
.greet-item-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.4;
}
.greet-item-desc {
    font-size: 0.88rem;
    color: #776666;
    line-height: 1.6;
    margin-bottom: 10px;
}
.greet-item-author {
    font-size: 0.8rem;
    color: #b8002e;
    font-weight: 600;
    opacity: 0.85;
}
@media (max-width: 480px) {
    .greet-item-info { padding: 12px 14px 14px; }
    .greet-item-title { font-size: 0.95rem; }
    .greet-item-desc { font-size: 0.82rem; }
    .greet-item-play { width: 44px; height: 44px; font-size: 1rem; }
}

/* ===== 留言墙：布局均衡化，增加留白 ===== */
.messages-section {
    padding: 48px 20px 64px !important;
}
.messages-section > h2 {
    text-align: center;
    margin-bottom: 32px !important;
    font-size: 1.5rem;
}
.message-form-container {
    margin-bottom: 36px !important;
}
.wall-view {
    margin-top: 28px !important;
}
.wall-notes {
    min-height: 520px !important;
}
@media (max-width: 768px) {
    .messages-section {
        padding: 32px 14px 48px !important;
    }
    .messages-section > h2 {
        margin-bottom: 20px !important;
        font-size: 1.3rem;
    }
    .message-form-container {
        margin-bottom: 24px !important;
    }
    .wall-notes {
        min-height: 400px !important;
    }
}

/* ===== 游戏乐园：布局优化 ===== */
/* 网页端游戏内容适当放大，不再局限移动端宽度 */
.gacha-frame {
    max-width: 100% !important;
    width: 100% !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: 100% !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    margin: 0 !important;
    display: block !important;
}
/* 拼图/答题游戏：网页端全屏展开 */
.game-view .puzzle-play,
.game-view .quiz-play,
.game-view .puzzle-leaderboard,
.game-view .quiz-start,
.game-view .quiz-end {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}
/* 返回大厅按钮：固定左上角，与汉堡键平齐，防止跳动 */
.back-to-lobby {
    position: fixed !important;
    top: max(12px, env(safe-area-inset-top)) !important;
    left: 12px !important;
    z-index: 101 !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 50% !important;
    background: rgba(255,255,255,0.95) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 16px !important;
    line-height: 1 !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
/* 游戏视图顶部留出返回按钮空间 */
.games-section .game-view {
    padding-top: 64px !important;
    padding-left: 16px;
    padding-right: 16px;
    padding-bottom: 24px;
}
/* 确保游戏内容一屏内不溢出 */
body.game-mode .games-section {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}

/* ===== 拼图游戏：新样式 ===== */
.puzzle-title {
    text-align: center;
    font-size: 1.4rem;
    color: #b8002e;
    margin-bottom: 8px;
    font-weight: 800;
}
.quiz-title {
    text-align: center;
    font-size: 1.4rem;
    color: #b8002e;
    margin-bottom: 8px;
    font-weight: 800;
}
.puzzle-setup {
    text-align: center;
    max-width: 480px;
    margin: 0 auto;
}
.puzzle-difficulty {
    display: flex;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 24px 0;
}
.diff-btn {
    padding: 14px 28px;
    border: 2px solid #ffb3c1;
    border-radius: 14px;
    background: #fff;
    color: #b8002e;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    min-width: 140px;
    max-width: 220px;
    transition: all 0.25s ease;
}
.diff-btn:hover {
    background: #fff5f7;
    border-color: #ff8fa3;
    transform: translateY(-2px);
}
.puzzle-lb-btn {
    display: block;
    margin: 16px auto 0;
    padding: 10px 24px;
    border: none;
    border-radius: 20px;
    background: linear-gradient(135deg, #ffd93d, #ff9a3c);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 154, 60, 0.3);
}
.puzzle-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 16px;
    font-size: 0.95rem;
    color: #555;
    font-weight: 600;
    flex-wrap: wrap;
}
.puzzle-timer.warning {
    color: #e74c3c;
    animation: pulse 0.5s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.puzzle-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}
.puzzle-shuffle, .puzzle-give-up {
    padding: 8px 18px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #fff;
    color: #666;
    font-size: 0.85rem;
    cursor: pointer;
}
.puzzle-give-up {
    color: #e74c3c;
    border-color: #ffb3b3;
}
.puzzle-result {
    text-align: center;
    max-width: 400px;
    margin: 0 auto;
    padding: 24px;
}
.puzzle-result-icon {
    font-size: 3.5rem;
    margin-bottom: 12px;
}
.puzzle-result h3 {
    color: #b8002e;
    margin-bottom: 8px;
    font-size: 1.3rem;
}
.puzzle-result p {
    color: #777;
    margin-bottom: 20px;
    font-size: 0.95rem;
}
.puzzle-result-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}
.puzzle-leaderboard {
    max-width: 480px;
    margin: 0 auto;
    text-align: center;
}
.puzzle-leaderboard h3 {
    color: #b8002e;
    margin-bottom: 16px;
}
.lb-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}
.lb-tab {
    padding: 6px 16px;
    border: 1px solid #ffb3c1;
    border-radius: 16px;
    background: #fff;
    color: #999;
    font-size: 0.85rem;
    cursor: pointer;
}
.lb-tab.active {
    background: #b8002e;
    color: #fff;
    border-color: #b8002e;
}
.lb-list {
    text-align: left;
    max-height: 300px;
    overflow-y: auto;
}
.lb-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.88rem;
}
.lb-rank {
    color: #b8002e;
    font-weight: 700;
    margin-right: 6px;
}
.lb-empty {
    text-align: center;
    color: #aaa;
    padding: 24px;
    font-size: 0.9rem;
}

/* ===== Banner 统一修复：网页端/移动端不同尺寸，仅首页显示（JS控制） ===== */
.top-banner {
    aspect-ratio: 3 / 1 !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: hidden;
    line-height: 0;
    display: block;
}
.top-banner-img {
    width: 100% !important;
    max-width: 100% !important;
    height: 100%;
    object-fit: fill;
    object-position: center;
    display: block;
    margin: 0;
    padding: 0;
    border-radius: 0 !important;
}
@media (max-width: 768px) {
    .top-banner {
        aspect-ratio: 4450 / 1000 !important;
        height: 22.5vw !important;
        min-height: 0 !important;
        max-height: 150px;
    }
    .top-banner-img {
        object-fit: fill !important;
    }
}
body.review-mode .top-banner,
body.review-mode .header,
body.game-mode .top-banner,
body.game-mode .header {
    display: none !important;
}

/* ===== 回顾页面：结尾页文字居中，适配安全区 ===== */
.star-map .ending-page {
    justify-content: center !important;
    padding: max(32px, env(safe-area-inset-top)) 24px max(32px, env(safe-area-inset-bottom)) !important;
}
.star-map .restart-btn {
    margin-top: 24px !important;
}
/* 回顾页所有页面文字适配安全区 */
.star-map .page {
    padding-left: max(16px, env(safe-area-inset-left)) !important;
    padding-right: max(16px, env(safe-area-inset-right)) !important;
}

/* ===== 游戏模式：彻底隐藏顶部栏，背景统一粉色主题 ===== */
body.game-mode {
    background: #fff5f7 !important;
}
body.game-mode main {
    padding-top: 0 !important;
}
body.game-mode .games-section {
    background: #fff5f7 !important;
    padding-top: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* ===== 游戏子视图：内容垂直居中，高度适应banner和菜单栏 ===== */
.game-view.active {
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: center !important;
    padding: 24px 16px 40px !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}
.game-view.active > *:not(.back-to-lobby) {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}
.quiz-start, .quiz-play, .quiz-end,
.puzzle-setup, .puzzle-play, .puzzle-result, .puzzle-leaderboard {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

/* ===== 答题游戏磨砂玻璃风格 ===== */
.quiz-question {
    background: rgba(255, 255, 255, 0.55) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 8px 32px rgba(255, 107, 107, 0.1) !important;
    color: #5a2a3a !important;
    font-weight: 600 !important;
}
.quiz-option {
    background: rgba(255, 255, 255, 0.45) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(255, 255, 255, 0.5) !important;
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    text-align: left !important;
    transition: all 0.25s ease !important;
    color: #4a2a35 !important;
}
.quiz-option:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.7) !important;
    border-color: rgba(255, 107, 107, 0.5) !important;
    transform: translateX(4px) !important;
}
.quiz-opt-label {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff8fa3, #ff6b6b);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}
.quiz-opt-text {
    flex: 1;
    font-size: 1rem;
}
.quiz-option.correct {
    background: rgba(209, 250, 229, 0.6) !important;
    border-color: rgba(16, 185, 129, 0.5) !important;
    color: #065f46 !important;
}
.quiz-option.correct .quiz-opt-label {
    background: linear-gradient(135deg, #34d399, #10b981);
}
.quiz-option.wrong {
    background: rgba(254, 226, 226, 0.6) !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
    color: #991b1b !important;
}
.quiz-option.wrong .quiz-opt-label {
    background: linear-gradient(135deg, #f87171, #ef4444);
}
.quiz-progress {
    color: #8a5a6a !important;
    font-weight: 500;
}
.quiz-feedback {
    color: #b8002e !important;
}

/* ===== 留言墙布局优化 ===== */
.messages-section {
    padding-top: 20px !important;
}
.message-list-area {
    width: 100% !important;
    max-width: 720px !important;
    margin: 0 auto !important;
    display: none;
    flex-direction: column;
    gap: 12px;
}
.message-list-area.active {
    display: flex;
}
.message-list {
    width: 100% !important;
    max-width: 100% !important;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.ml-note {
    width: 100% !important;
    max-width: 100% !important;
    padding: 16px 18px !important;
    border-radius: 14px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}
.ml-note:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1) !important;
}
.ml-note-id {
    font-weight: 700 !important;
    font-size: 0.95rem !important;
    color: #5a2a3a !important;
}
.ml-note-text {
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
    color: #4a3a40 !important;
    flex: 1 !important;
}
.ml-note-time {
    font-size: 0.8rem !important;
    color: #9a7a85 !important;
    margin-top: auto !important;
    padding-top: 4px !important;
    border-top: 1px solid rgba(0,0,0,0.06) !important;
}
/* 留言墙视图：固定一页内 */
.wall-view {
    display: none;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 20px !important;
    padding: 20px 0 !important;
}
.wall-view.active {
    display: flex !important;
}
.wall-notes {
    flex: 1 !important;
    width: 100% !important;
    display: block !important;
    column-count: 5;
    column-gap: 16px;
}
@media (max-width: 1100px) { .wall-notes { column-count: 4; } }
@media (max-width: 860px)  { .wall-notes { column-count: 3; } }
@media (max-width: 768px)  { .wall-notes { column-count: 2 !important; } }
.wall-footer {
    display: none !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    margin-top: 20px;
    padding: 0 10px;
}
#wallView.active .wall-footer,
#wallView.active ~ .wall-footer,
.wall-footer.show {
    display: flex !important;
}
.wall-footer .wall-back-btn,
.wall-footer .view-all-btn {
    padding: 10px 18px;
    font-size: 0.85rem;
    min-height: 40px;
    flex-shrink: 0;
}
@media (max-width: 480px) {
    .wall-footer {
        gap: 8px !important;
    }
    .wall-footer .wall-back-btn,
    .wall-footer .view-all-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }
}

/* ===== 成长回顾结束页：比例间距适配 ===== */
.ending-page {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 2dvh !important;
    padding: 5dvh 5vw 18dvh !important;
    text-align: center !important;
}
.ending-title {
    font-size: clamp(1.5rem, 4vw, 2.8rem) !important;
    margin-bottom: 1dvh !important;
    line-height: 1.4 !important;
    opacity: 0;
    transform: translateY(18px);
    transition: all 0.9s ease 0.2s;
}
.ending-title.show {
    opacity: 1;
    transform: translateY(0);
}
.ending-subtitle {
    font-size: clamp(0.95rem, 2vw, 1.3rem) !important;
    line-height: 2 !important;
    margin-bottom: 2dvh !important;
    opacity: 0 !important;
    transform: translateY(16px);
    transition: all 0.9s ease 0.55s;
}
.ending-subtitle.show {
    opacity: 0.85 !important;
    transform: translateY(0);
}
.restart-btn {
    margin-top: 2dvh !important;
    padding: 1.5dvh 4vw !important;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem) !important;
    border-radius: 50px !important;
    opacity: 0;
    transform: translateY(14px);
    transition: all 0.9s ease 0.9s;
}
.restart-btn.show {
    opacity: 1;
    transform: translateY(0);
}

/* ===== 开场视频：独立全屏覆盖层 ===== */
.hero-video-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}
.hero-video-overlay.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.hero-video-overlay .hero-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
/* 开声音按钮：自动播放被拦截时显示 */
.hero-video-unmute {
    position: absolute;
    right: 24px;
    bottom: 70px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    font-size: 0.9rem;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background 0.2s ease, opacity 0.3s ease, visibility 0.3s ease;
    z-index: 3;
    display: none;
}
.hero-video-unmute.show {
    display: block;
}
.hero-video-unmute:hover {
    background: rgba(255, 255, 255, 0.25);
}
.hero-video-overlay .hero-video-skip {
    position: absolute;
    right: 24px;
    bottom: 24px;
    padding: 10px 24px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 24px;
    font-size: 0.95rem;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background 0.2s ease;
    z-index: 2;
}
.hero-video-overlay .hero-video-skip:hover {
    background: rgba(255, 255, 255, 0.25);
}
/* 结尾邀请页：视频播完或跳过时显示 */
.hero-video-ending {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.hero-video-ending.show {
    opacity: 1;
    visibility: visible;
}
/* 蛋糕按钮 */
.hero-cake-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 32px 48px;
    background: linear-gradient(135deg, #ff6b8a 0%, #ff8fa3 50%, #ffb3c1 100%);
    border: none;
    border-radius: 28px;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(255, 107, 138, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: cakeBreath 2s ease-in-out infinite;
}
@keyframes cakeBreath {
    0%, 100% { transform: scale(1); box-shadow: 0 8px 32px rgba(255, 107, 138, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.2) inset; }
    50% { transform: scale(1.05); box-shadow: 0 12px 40px rgba(255, 107, 138, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.3) inset; }
}
.hero-cake-btn:hover {
    transform: scale(1.08);
    animation: none;
}
.hero-cake-btn:active {
    transform: scale(0.98);
}
.cake-emoji {
    font-size: 3.5rem;
    line-height: 1;
    animation: cakeWiggle 1.5s ease-in-out infinite;
}
@keyframes cakeWiggle {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}
.cake-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 1px;
}
/* 移动端：黑底全屏播放 */
@media (max-width: 767px) {
    .hero-video-overlay .hero-video {
        object-fit: contain;
        width: 100vw;
        height: 100dvh;
    }
    .hero-video-overlay .hero-video-skip {
        right: 16px;
        bottom: calc(24px + env(safe-area-inset-bottom));
        font-size: 0.85rem;
        padding: 8px 20px;
    }
    .hero-video-unmute {
        right: 16px;
        bottom: calc(70px + env(safe-area-inset-bottom));
        font-size: 0.8rem;
        padding: 8px 16px;
    }
    .hero-cake-btn {
        padding: 24px 36px;
        border-radius: 22px;
    }
    .cake-emoji {
        font-size: 2.8rem;
    }
    .cake-text {
        font-size: 1rem;
    }
}

/* ================================================================
   按钮统一规范（唯一入口，置于文件末尾保证优先级）
   三级体系：
   primary   —— 主操作：粉橙渐变、白字、圆角 14px
   secondary —— 次操作：白底粉边红字
   图标/返回类（back-to-lobby / back-btn / 关闭等）保持各自圆形样式
   新增按钮请复用以下类，不要单独另写背景/圆角
   ================================================================ */
:root {
    --btn-radius: 14px;
    --btn-min-h: 44px;
    --btn-primary-bg: linear-gradient(135deg, #ff6b6b 0%, #ffa751 100%);
}

/* ---- 公共基础 ---- */
.quiz-start-btn,
.diff-btn,
.wall-back-btn,
.page-btn,
.view-all-btn,
.diy-toggle-btn,
.puzzle-shuffle,
.puzzle-give-up,
.puzzle-lb-btn,
.wall-empty-btn,
.message-form > button[type="submit"] {
    font-family: inherit;
    cursor: pointer;
    min-height: var(--btn-min-h);
    border-radius: var(--btn-radius);
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

/* ---- primary：主操作 ---- */
.quiz-start-btn,
.diff-btn,
.wall-back-btn,
.page-btn,
.wall-empty-btn,
.message-form > button[type="submit"] {
    background: var(--btn-primary-bg) !important;
    color: #fff !important;
    border: none !important;
    box-shadow: 0 6px 18px rgba(255, 107, 107, 0.28);
}
.quiz-start-btn:hover,
.diff-btn:hover,
.wall-back-btn:hover,
.page-btn:hover:not(:disabled),
.wall-empty-btn:hover,
.message-form > button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(255, 107, 107, 0.38);
}
.quiz-start-btn:active,
.diff-btn:active,
.wall-back-btn:active,
.page-btn:active:not(:disabled),
.wall-empty-btn:active,
.message-form > button[type="submit"]:active {
    transform: translateY(0) scale(0.97);
}

/* ---- secondary：次操作 ---- */
.view-all-btn,
.diy-toggle-btn,
.puzzle-shuffle,
.puzzle-give-up,
.puzzle-lb-btn {
    background: #fff !important;
    color: #b8002e !important;
    border: 1.5px solid rgba(217, 33, 33, 0.3) !important;
    box-shadow: 0 2px 10px rgba(217, 33, 33, 0.08);
}
.view-all-btn:hover,
.diy-toggle-btn:hover,
.puzzle-shuffle:hover,
.puzzle-give-up:hover,
.puzzle-lb-btn:hover {
    transform: translateY(-2px);
    border-color: rgba(217, 33, 33, 0.55) !important;
    box-shadow: 0 6px 18px rgba(217, 33, 33, 0.14);
}
.view-all-btn:active,
.diy-toggle-btn:active,
.puzzle-shuffle:active,
.puzzle-give-up:active,
.puzzle-lb-btn:active {
    transform: translateY(0) scale(0.97);
}

/* ===== 留言分页：小屏（≤480px）按钮收缩，避免 320px 屏溢出 ===== */
@media (max-width: 480px) {
    .message-list-pagination {
        gap: 8px;
        width: 100%;
    }
    .page-btn {
        flex: 1;
        min-width: 0;
        padding: 10px 8px;
        font-size: 0.85rem;
        white-space: nowrap;
    }
    .page-info {
        min-width: 0;
        flex-shrink: 0;
        font-size: 0.85rem;
    }
}

/* ================================================================
   视觉修复集中区（置于文件末尾，覆盖旧规则）
   1. 成长回顾结尾页按钮居中（原 .show 丢失了 translateX 居中）
   2. 圆形关闭按钮统一为 40px 点击区 + flex 居中
   3. 留言表单配色优化：白卡片 + 柔和粉边输入框
   4. DIY 调色盘按钮只留 🎨
   5. Gigi 贴纸预览可见化
   ================================================================ */

/* 1. 结尾页：标题/副标题/按钮改为 flex 流式布局，水平居中，整体下移避开 YUQI 星图 */
.star-map .ending-page {
    justify-content: flex-end !important;
    padding: 36dvh 6vw 12dvh !important;
    gap: 2.5dvh !important;
}
@media (max-height: 600px) {
    .star-map .ending-page {
        padding: 22dvh 6vw 10dvh !important;
    }
}
.star-map .ending-title,
.star-map .ending-subtitle,
.star-map .restart-btn {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: auto !important;
    max-width: 90vw !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}
.star-map .ending-title { transform: translateY(18px) !important; }
.star-map .ending-title.show { transform: translateY(0) !important; }
.star-map .ending-subtitle { transform: translateY(16px) !important; }
.star-map .ending-subtitle.show { transform: translateY(0) !important; }
.star-map .restart-btn { transform: translateY(14px) !important; margin-top: 0 !important; }
.star-map .restart-btn.show { transform: translateY(0) !important; }

/* 2. 圆形关闭/图标按钮：统一点击区与居中 */
.popup-close,
.media-lightbox-close,
.note-modal-close {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* 3. 留言表单：信纸底色跟随调色盘（由 JS 设置），输入框保持透明无框线 */
.message-form {
    border: 1px solid rgba(217, 33, 33, 0.12) !important;
    box-shadow: 0 12px 30px rgba(217, 33, 33, 0.10) !important;
}

/* 4. DIY 调色盘按钮：圆形，只留 🎨 */
.diy-toggle-btn {
    width: 44px;
    height: 44px;
    min-width: 44px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    line-height: 1;
}

/* 5. Gigi 贴纸预览：清晰可见，未选择时隐藏 */
.paper-gigi-preview {
    opacity: 1 !important;
    width: 46px !important;
    height: 46px !important;
    border-width: 2.5px !important;
}
.paper-gigi-preview[src=""] {
    display: none;
}

/* ===== 移动端整页固定：banner 全页显示后，板块高度扣除 banner，页面不滚动 ===== */
@media (max-width: 768px) {
    .timeline-section,
    .games-section,
    .vue-checkin-section,
    .messages-section {
        height: calc(100dvh - 56px - 22.5vw);
        height: calc(100dvh - 56px - 22.5vw);
        min-height: 0 !important;
        overflow: hidden;
    }
    /* 所有页面允许滚动，避免内容被裁掉 */
    body {
        overflow-y: auto;
    }
    body.review-mode .timeline-section,
    body.game-mode .games-section {
        height: 100dvh !important;
        height: 100dvh !important;
        min-height: 0 !important;
    }
    /* 游戏大厅内容偏高时在板块内滚动（不带动页面） */
    .games-section {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .games-section::-webkit-scrollbar {
        display: none;
    }
    /* 留言墙：表单/墙面/列表在各自区域内滚动，去掉滚动条 */
    .messages-section.active {
        display: flex;
        flex-direction: column;
        padding: 12px 14px !important;
    }
    .message-form-container,
    .wall-view,
    .message-list-area {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .message-form-container::-webkit-scrollbar,
    .wall-view::-webkit-scrollbar,
    .message-list-area::-webkit-scrollbar,
    .game-view.active::-webkit-scrollbar {
        display: none;
    }
    .wall-view {
        min-height: 0 !important;
    }
}



/* ===== 强制修复：打卡页面粉色空白 ===== */
.checkin-section.active {
    height: 100dvh !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    min-height: 100dvh !important;
    background: #0a0e1a !important;
}

.checkin-section.active .vue-checkin-section {
    height: calc(100dvh - 146px) !important;
    height: calc(100dvh - 146px) !important;
    min-height: calc(100dvh - 146px) !important;
    background: #0a0e1a !important;
}

/* 成长回顾也强制深色背景 */
.timeline-section.active {
    background: #07091a !important;
    min-height: 100dvh !important;
    min-height: 100dvh !important;
}


/* ===== 统一移动端安全距离适配（不影响首页） ===== */
@media (max-width: 768px) {
    /* 主页面统一上下安全距离（首页、打卡页、游戏页除外） */
    .timeline-section,
    .messages-section {
        padding-top: calc(60px + env(safe-area-inset-top, 0px)) !important;
        padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)) !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
        box-sizing: border-box !important;
    }
    /* 游戏页面：去掉顶部padding，避免banner下面空白 */
    .games-section {
        padding-top: 0 !important;
        padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)) !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
        box-sizing: border-box !important;
    }
    /* 打卡页面：全屏，不加padding */
    .checkin-section {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    /* 游戏子页面 */
    .games-section .game-view,
    .games-section .game-lobby {
        padding-top: 56px !important;
        padding-bottom: 20px !important;
        min-height: 100dvh !important;
        box-sizing: border-box !important;
    }
    
    /* 游戏大厅标题和卡片间距 */
    .games-section {
    padding-top: 100px !important;
}

.games-section h2 {
        margin-top: 0 !important;
        margin-bottom: 12px !important;
    }
    .game-lobby-tip {
        margin-bottom: 20px !important;
    }
    .game-cards {
        gap: 12px !important;
    }
    
    /* 留言墙 */
    .messages-section > h2 {
        margin-bottom: 16px !important;
    }
    .message-form-container {
        margin-bottom: 20px !important;
    }
    
    /* 首页内容间距 */
    .home-greet-section {
        margin-top: 24px !important;
        margin-bottom: 24px !important;
    }
}

/* 网页端适配：避免两侧留白过大 */
@media (min-width: 768px) {
    .home-section,
    .timeline-section,
    .messages-section,
    .games-section,
    .checkin-section {
        padding-left: 32px !important;
        padding-right: 32px !important;
        max-width: 100% !important;
    }
    .game-cards {
        max-width: 900px;
        margin: 0 auto;
    }
    .message-form-container,
    .wall-view {
        max-width: min(820px, 75vw);
        margin-left: auto;
        margin-right: auto;
    }
}

/* ===== 拼图游戏按钮强制垂直排列 ===== */
.puzzle-setup {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 12px !important;
}
.puzzle-difficulty {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 280px !important;
}
.diff-btn {
    width: 100% !important;
    min-height: 44px !important;
    padding: 10px 16px !important;
    font-size: 14px !important;
    border-radius: 12px !important;
}

/* ===== 爱心便利贴文字大小调整 ===== */
.wall-note.heart-note .note-text {
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px !important;
    line-height: 1.3 !important;
    -webkit-line-clamp: 3 !important;
    line-clamp: 3 !important;
}

/* ===== 拼图页面内容垂直居中 ===== */
.game-view#gameViewPuzzle {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    min-height: calc(100dvh - 80px) !important;
    padding-top: 40px !important;
    padding-bottom: 40px !important;
}
.puzzle-setup {
    margin: auto !important;
    width: 100% !important;
}
@media (max-width: 768px) {
    .game-view#gameViewPuzzle {
        padding-top: 20px !important;
        padding-bottom: 20px !important;
    }
}

/* ===== 答题页面内容垂直居中 ===== */
.game-view#gameViewQuiz {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    padding-top: 50px !important;
    padding-bottom: 20px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
}
.quiz-start, .quiz-play, .quiz-result {
    width: 100% !important;
    max-width: 500px !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
}
@media (max-width: 768px) {
    .game-view#gameViewQuiz {
        padding-top: 44px !important;
        padding-bottom: 16px !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
        justify-content: flex-start !important;
    }
    .quiz-start h3, .quiz-play h3 {
        margin-bottom: 8px !important;
        font-size: 1.1rem !important;
    }
    .quiz-tip {
        margin-bottom: 12px !important;
        font-size: 0.85rem !important;
    }
    .quiz-record, .quiz-stats {
        margin-bottom: 8px !important;
        font-size: 0.75rem !important;
    }
    .quiz-start-btn {
        margin-top: 12px !important;
        min-height: 48px !important;
        font-size: 1rem !important;
    }
    .quiz-progress {
        margin-bottom: 12px !important;
        font-size: 0.8rem !important;
    }
    .quiz-question {
        padding: 16px !important;
        font-size: 1rem !important;
        margin-bottom: 12px !important;
    }
    .quiz-options {
        gap: 8px !important;
    }
    .quiz-option {
        padding: 12px 14px !important;
        font-size: 0.9rem !important;
        min-height: 44px !important;
    }
}

/* ===== 留言墙爱心便利贴优化 ===== */
.wall-note.heart-note {
    width: 58px !important;
    min-height: 48px !important;
    max-height: 64px !important;
    padding: 10px 4px 4px !important;
}
.wall-note.heart-note .note-text {
    font-size: 0.55rem !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    line-height: 1.25 !important;
    -webkit-line-clamp: 3 !important;
    line-clamp: 3 !important;
}
@media (max-width: 600px) {
    .wall-note.heart-note {
        width: 36px !important;
        min-height: 32px !important;
        padding: 7px 2px 2px !important;
    }
    .wall-note.heart-note .note-text {
        font-size: 0.45rem !important;
    }
}

/* 留言墙占满可用空间，不固定高度 */
.wall-view {
    min-height: 0 !important;
    max-height: none !important;
    flex: 1 !important;
    overflow: hidden !important;
    display: block !important;
    position: relative !important;
}
.wall-view .wall-notes {
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
    overflow: hidden !important;
}
@media (max-width: 600px) {
    .wall-view {
        min-height: 0 !important;
        max-height: none !important;
    }
}


/* ===== 打卡页面背景：地球地图用深色背景 ===== */
.checkin-section.active,
.checkin-section.active .vue-checkin-section,
.checkin-section.active .globe-page {
    background: #0a0e1a !important;
}

/* 打卡页面固定一页显示 */
.checkin-section {
    height: 100vh !important;
    min-height: 100vh !important;
    overflow: hidden !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}
.vue-checkin-section {
    height: 100vh !important;
    min-height: 100vh !important;
}
@media (max-width: 768px) {
    .checkin-section {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }
}


/* ===== 留言列表强制修复：垂直排列、不重叠、根据内容调整高度 ===== */
.message-list-area.active {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 720px !important;
    margin: 0 auto !important;
    padding: 16px !important;
    min-height: 400px !important;
    max-height: 75dvh !important;
    overflow-y: auto !important;
    background: transparent !important;
    box-shadow: none !important;
}
.message-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
}
.ml-note {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: auto !important;
    height: auto !important;
    padding: 14px 16px !important;
    margin: 0 !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 8px rgba(217, 33, 33, 0.08) !important;
    transform: none !important;
    flex: none !important;
}
.ml-note-id {
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    color: #b8002e !important;
    margin-bottom: 6px !important;
}
.ml-note-text {
    font-size: 0.85rem !important;
    color: #333 !important;
    line-height: 1.5 !important;
    margin-bottom: 8px !important;
    word-break: break-word !important;
    white-space: pre-wrap !important;
}
.ml-note-time {
    font-size: 0.75rem !important;
    color: #999 !important;
    text-align: right !important;
}
.message-list-pagination {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 12px !important;
    margin-top: 16px !important;
    padding: 12px !important;
}


/* ===== 留言墙网页端居中适配 ===== */
.messages-section {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}
.wall-view {
    width: 100% !important;
    max-width: 900px !important;
    margin: 0 auto !important;
}
.wall-notes {
    width: 100% !important;
    max-width: 900px !important;
    margin: 0 auto !important;
    column-gap: 16px !important;
}
@media (min-width: 768px) {
    .wall-notes {
        column-count: 4 !important;
    }
}
@media (max-width: 767px) {
    .wall-notes {
        column-count: 2 !important;
    }
}
.wall-footer {
    width: 100% !important;
    max-width: 900px !important;
    margin: 20px auto 0 !important;
    padding: 16px 0 !important;
    display: none !important;
    justify-content: center !important;
    gap: 16px !important;
}
#wallView.active + .wall-footer,
.wall-footer.show {
    display: flex !important;
}


/* ===== 地球打卡页面强制修复：确保容器尺寸正确，兔子能显示 ===== */
.vue-checkin-section {
    height: 100vh !important;
    min-height: 100vh !important;
    overflow: hidden !important;
    position: relative !important;
}
.globe-page {
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    position: relative !important;
    overflow: hidden !important;
}
.globe-page .app-root {
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    position: relative !important;
    overflow: hidden !important;
}
.globe-wrap {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 50 !important;
}
.globe-map {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
}
.three-canvas {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 5 !important;
    pointer-events: none !important;
}


/* ===== 修复：打卡页面地球容器确保可见 ===== */
.checkin-section.active .globe-page,
.checkin-section.active .app-root,
.checkin-section.active .globe-wrap,
.checkin-section.active .globe-map,
.checkin-section.active .three-canvas {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* 打卡页面不显示滚动条 */
.checkin-section.active {
    overflow: hidden !important;
}


/* ===== 修复：打卡和游戏页面banner下面的空白 ===== */
.games-section,
.checkin-section {
    padding-top: 0 !important;
}


/* ===== 最终修复：打卡和游戏页面占满全屏，去掉banner下面空白 ===== */
.checkin-section.active,
.games-section.active {
    min-height: calc(100dvh - 160px) !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
}
/* 游戏子页面保持正常宽度和布局（只对active的game-view生效） */
.games-section.active .game-view.active {
    width: 100% !important;
    max-width: 100% !important;
}

/* 打卡页面内部占满 */
.checkin-section.active .globe-page {
    height: 100% !important;
    min-height: 100% !important;
    background: #0a0e1a !important;
    display: flex !important;
    flex-direction: column !important;
}
.checkin-section.active .vue-checkin-section {
    background: #0a0e1a !important;
}




/* ===== 最终修复：打卡页面占满全屏，不被前面元素推下去（仅移动端打卡页） ===== */
@media (max-width: 768px) {
    .checkin-section.active {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100dvh !important;
        padding-top: 0 !important;
        margin-top: 0 !important;
        overflow: hidden !important;
        z-index: 50 !important;
    }
}

/* 网页端：打卡和游戏页面正常文档流，显示banner和菜单栏，内容垂直居中 */
@media (min-width: 769px) {
    .checkin-section.active,
    .games-section.active {
        position: relative !important;
        top: auto !important;
        height: calc(100dvh - 146px) !important;
        min-height: calc(100dvh - 146px) !important;
        overflow: hidden !important;
        z-index: 1 !important;
        display: flex !important;
        flex-direction: column !important;
    }
    /* 游戏页内容垂直居中 */
    .games-section.active .game-lobby.active {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 20px 16px !important;
    }
    /* 打卡页内容占满高度 */
    .checkin-section.active .vue-checkin-section,
    .checkin-section.active .globe-page {
        flex: 1 !important;
        height: 100% !important;
        min-height: 0 !important;
    }
}

/* 打卡页面内部占满 */
.checkin-section.active .globe-page {
    height: 100% !important;
    min-height: 100% !important;
    background: #0a0e1a !important;
    display: flex !important;
    flex-direction: column !important;
}
.checkin-section.active .vue-checkin-section {
    background: #0a0e1a !important;
}


/* ===== 修复：减少首页生日贺图下面的空白 ===== */
.home-section {
    padding-bottom: 24px !important;
}
.home-greet-section {
    margin-top: 32px !important;
    margin-bottom: 16px !important;
}
.home-section .footer {
    padding-top: 12px !important;
    padding-bottom: 12px !important;
}


/* ===== 最终修复：首页生日贺图下面空白 ===== */
.home-section {
    padding-top: 24px !important;
    padding-bottom: 0 !important;
}
.home-section .home-greet-section:last-of-type {
    margin-bottom: 0 !important;
    padding-bottom: 16px !important;
}
/* 首页footer正常显示，减少padding */
.footer {
    padding-top: 12px !important;
    padding-bottom: 12px !important;
}


/* ===== 关键修复：非active的section必须隐藏，解决首页底部大段空白 ===== */
.section:not(.active) {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
}
.section.active {
    display: block !important;
}
/* 留言墙active时用flex布局 */
.messages-section.active {
    display: flex !important;
}


/* ===== 留言墙网页端适配：增加卡片宽度，背景改成淡粉波点 ===== */
@media (min-width: 769px) {
    .message-list-area {
        max-width: 960px !important;
    }
}
.messages-section {
    background-color: #FFF5F6 !important;
    background-image: radial-gradient(#FFD6DC 1.5px, transparent 1.5px) !important;
    background-size: 22px 22px !important;
    overflow: visible !important;
    min-height: auto !important;
    height: auto !important;
    padding-bottom: 40px !important;
}


/* ===== 游戏视图修复：非active的game-view必须隐藏，解决答题页显示拼图的问题 ===== */
.game-view {
    display: none !important;
}
.game-view.active {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
}
/* 拼图游戏子视图默认隐藏 */
.game-view .puzzle-play,
.game-view .puzzle-result,
.game-view .puzzle-leaderboard {
    display: none;
}


/* ===== 最高优先级：非active的game-view必须隐藏，解决答题页显示拼图的问题 ===== */
.games-section .game-view:not(.active) {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
}
.games-section .game-view.active {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
}


/* ===== 用ID选择器强制隐藏非active游戏视图 ===== */
#gameViewPuzzle:not(.active),
#gameViewQuiz:not(.active),
#gameViewGacha:not(.active) {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
}


/* ===== 移动端背景图适配修复 ===== */
@media (max-width: 767px) {
    .messages-section {
        background-size: cover !important;
        background-position: center !important;
        min-height: 100dvh !important;
    }
    /* 移除：min-height: 100dvh 会导致首页无法滑动 */
}

/* ===== 留言墙便签弹窗放大 ===== */
.note-modal-card {
    max-width: min(620px, 95vw) !important;
    max-height: 90dvh !important;
    padding: 32px 28px 28px !important;
}




/* ===== 查看所有留言页面隐藏"再写一张"按钮 ===== */
.wall-view .wall-header {
    display: none !important;
}

/* ===== 确保弹窗在最上层 ===== */
.popup-overlay {
    z-index: 9999 !important;
}
.note-modal-card {
    z-index: 10000 !important;
}


/* ===== 成长回顾图片显示完整修复 ===== */
.album-img {
    object-fit: contain !important;
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
}
.album-image-wrap {
    overflow: visible !important;
}

/* ===== 首页滑动修复：确保移动端可以正常滚动 ===== */
@media (max-width: 767px) {
    html, body {
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }
    .home-section {
        min-height: auto !important;
        height: auto !important;
    }
}


/* ===== 强制修复首页滚动问题 ===== */
html, body {
    overflow-x: hidden !important;
    overflow-y: scroll !important;
    height: auto !important;
    min-height: 100% !important;
}
.home-section {
    overflow: visible !important;
    height: auto !important;
    min-height: auto !important;
    position: relative !important;
}
.home-section * {
    pointer-events: auto !important;
}
/* 确保背景层不阻止滚动 */
.home-bg, .sparkle-layer, .confetti-layer, .fx-layer {
    pointer-events: none !important;
}





/* ===== 首页滑动强制修复 ===== */
#home.home-section {
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    position: relative !important;
}
#home.home-section * {
    max-height: none !important;
}
body {
    overflow-y: scroll !important;
    overflow-x: hidden !important;
}


/* ===== 确保红色爱心显示在最上层 ===== */
.wall-note.heart-note {
    z-index: 20 !important;
    position: absolute !important;
}


/* ===== 留言墙查看所有留言时隐藏顶部按钮 ===== */
#messageListArea.active ~ #wallView .wall-header,
#messageListArea.active + #wallView .wall-header {
    display: none !important;
}
/* 如果messageListArea在wallView里面 */
#wallView:has(#messageListArea.active) .wall-header {
    display: none !important;
}

/* ===== 成长回顾 - 星座星图 ===== */
.star-review-wrapper{
  position:relative;
  width:100%;
  height:100dvh;
  overflow:hidden;
  background:
    radial-gradient(600px 400px at 50% 8%, rgba(90,110,190,.10), transparent 70%),
    url('star-review/bg.jpg') center/contain no-repeat;
  background-color: #1a1035;
}
.star-review-wrapper .nav-header{
  position:relative;
  z-index:3;
  padding:26px 24px 0;
  text-align:center;
  pointer-events:none;
}
.star-review-wrapper .nav-title{
  font-size:clamp(22px,5.5vw,28px);
  font-weight:300;
  letter-spacing:6px;
  color:#eef3ff;
  margin-bottom:8px;
  text-shadow:0 0 18px rgba(170,195,255,.45);
}
.star-review-wrapper .nav-subtitle{
  font-size:clamp(12px,3vw,14px);
  font-weight:300;
  color:#8a93b5;
  letter-spacing:2px;
}
.star-review-wrapper .progress-chip{
  display:inline-block;
  margin-top:12px;
  padding:5px 12px;
  border:1px solid rgba(160,180,240,.22);
  border-radius:20px;
  background:rgba(20,26,54,.55);
  color:#aeb9de;
  font-size:12px;
  letter-spacing:1px;
  backdrop-filter:blur(4px);
}
.star-review-wrapper .constellation{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
}
.star-review-wrapper .year-node{
  position:absolute;
  transform:translate(-50%,-50%);
  width:46px;
  height:46px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:13px;
  letter-spacing:.5px;
  transition:all .3s ease;
  cursor:pointer;
  user-select:none;
  background:rgba(60,50,100,0.4);
  border:none;
  color:#8a7fb8;
  backdrop-filter:blur(2px);
}
.star-review-wrapper .year-node.locked{
  cursor:not-allowed;
  opacity:.55;
}
.star-review-wrapper .year-node.current{
  color:#fff;
  background:rgba(150,110,200,0.7);
  box-shadow:0 0 20px rgba(255,215,130,0.8), 0 0 40px rgba(180,140,255,0.4);
  animation:nodePulse 2.2s ease-in-out infinite;
}
.star-review-wrapper .year-node.unlocked{
  color:#fff;
  background:rgba(120,90,180,0.55);
  box-shadow:0 0 12px rgba(255,215,130,0.6), inset 0 0 8px rgba(200,170,255,0.2);
}
.star-review-wrapper .year-node.unlocked::after{
  content:"✦";
  position:absolute;
  top:-5px;
  right:-5px;
  font-size:11px;
  color:#ffd882;
  text-shadow:0 0 8px rgba(255,216,130,.8);
}
.star-review-wrapper .nav-hint{
  position:absolute;
  bottom:24px;
  left:50%;
  transform:translateX(-50%);
  color:rgba(255,255,255,0.5);
  font-size:13px;
  letter-spacing:1px;
  z-index:3;
}
@keyframes nodePulse{
  0%,100%{ box-shadow:0 0 10px rgba(255,215,130,0.4), 0 0 20px rgba(180,140,255,0.3); }
  50%{ box-shadow:0 0 25px rgba(255,215,130,0.9), 0 0 50px rgba(180,140,255,0.5); }
}


/* ================================================================
   圆形返回按钮统一规范（覆盖之前的椭圆形样式）
   ================================================================ */
.back-to-lobby {
    position: absolute !important;
    top: 16px !important;
    left: 16px !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.9) !important;
    color: #b8002e !important;
    border: 1.5px solid rgba(217, 33, 33, 0.2) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 18px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    z-index: 100 !important;
    transition: all 0.2s ease !important;
    margin: 0 !important;
}
.back-to-lobby:hover {
    background: #fff !important;
    transform: scale(1.05) !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15) !important;
}
.back-to-lobby:active {
    transform: scale(0.95) !important;
}

/* 游戏子视图需要相对定位，让返回按钮定位正确 */
.game-view {
    position: relative !important;
}


/* ===== 游戏页固定一页：网页端和移动端 ===== */
.games-section.active {
    height: calc(100dvh - 146px) !important;
    min-height: calc(100dvh - 146px) !important;
    max-height: calc(100dvh - 146px) !important;
    overflow: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}

.games-section.active .game-lobby.active {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 16px !important;
    overflow: hidden !important;
    gap: 16px !important;
}

/* 游戏卡片网格自适应，确保一页内显示 */
.games-section.active .game-cards {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: 500px !important;
    margin: 0 auto !important;
    flex-shrink: 0 !important;
}

.games-section.active .game-card-item {
    padding: 16px 12px !important;
    border-radius: 14px !important;
}

.games-section.active .game-card-item h3 {
    font-size: 1rem !important;
    margin: 8px 0 4px !important;
}

.games-section.active .game-card-item p {
    font-size: 0.8rem !important;
    margin: 0 !important;
}

.games-section.active .game-lobby-tip {
    margin-bottom: 14px !important;
    font-size: 0.9rem !important;
}

.games-section.active .game-lobby h2 {
    font-size: 1.3rem !important;
    margin-bottom: 8px !important;
}

/* 网页端游戏卡片一行4个 */
@media (min-width: 769px) {
    .games-section.active .game-cards {
        grid-template-columns: repeat(4, 1fr) !important;
        max-width: 900px !important;
        gap: 18px !important;
    }
    .games-section.active .game-card-item {
        padding: 24px 16px !important;
    }
}

/* 移动端游戏页高度调整（有banner和header） */
@media (max-width: 768px) {
    .games-section.active {
        height: calc(100dvh - 120px) !important;
        min-height: calc(100dvh - 120px) !important;
        max-height: calc(100dvh - 120px) !important;
    }
}


/* ===== GlobePage 打卡页样式（全局确保生效） ===== */
.globe-page {
  width: 100% !important;
  height: 100% !important;
  min-height: calc(100dvh - 146px) !important;
  position: relative !important;
  overflow: hidden !important;
  background: #0a0e1a !important;
  flex: 1 !important;
  align-self: stretch !important;
}

.checkin-intro {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  z-index: 100 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 24px !important;
  margin: 0 !important;
  background: #fff !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.checkin-intro-card {
  width: min(560px, 100%) !important;
  background: transparent !important;
  border-radius: 0 !important;
  padding: 0 !important;
  box-shadow: none !important;
  text-align: center !important;
}

.checkin-intro-img {
  width: auto !important;
  max-width: 320px !important;
  max-height: 50dvh !important;
  height: auto !important;
  object-fit: contain !important;
  object-position: center !important;
  border-radius: 0 !important;
  display: block !important;
  margin: 0 auto 12px !important;
}

.checkin-intro-text {
  color: #b8002e !important;
  font-size: 1rem !important;
  line-height: 1.5 !important;
  margin: 0 0 16px !important;
  font-weight: 500 !important;
}

.checkin-intro-btn {
  background: linear-gradient(135deg, #ff6b6b, #ffa751) !important;
  color: #fff !important;
  border: none !important;
  padding: 14px 36px !important;
  border-radius: 30px !important;
  font-size: 1.1rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4) !important;
  transition: transform 0.25s ease, box-shadow 0.25s ease !important;
  min-height: 52px !important;
}

/* 确保打卡页父容器是flex布局 */
.checkin-section.active {
  display: flex !important;
  flex-direction: column !important;
  height: calc(100dvh - 146px) !important;
  overflow: hidden !important;
  padding-top: 0 !important;
}

@media (max-width: 768px) {
  .checkin-section.active {
    height: 100dvh !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 50 !important;
  }
  .globe-page {
    min-height: 100dvh !important;
  }
}


/* ===== 打卡模式：移动端隐藏banner，网页端显示 ===== */
@media (max-width: 768px) {
    body.checkin-mode .top-banner {
        display: none !important;
    }
    body.checkin-mode .checkin-section.active {
        height: 100vh !important;
        min-height: 100vh !important;
        max-height: 100vh !important;
    }
}
/* 网页端打卡页面显示banner，内容从banner下方开始 */
@media (min-width: 769px) {
    body.checkin-mode .checkin-section.active {
        height: calc(100dvh - 56px - var(--banner-height, 120px)) !important;
        min-height: calc(100dvh - 56px - var(--banner-height, 120px)) !important;
        max-height: calc(100dvh - 56px - var(--banner-height, 120px)) !important;
    }
}


/* ===== 地球打卡地图占满整个区域，去掉黑色边距 ===== */
.checkin-section.active {
    padding: 0 !important;
    margin: 0 !important;
}
.checkin-section.active .vue-checkin-section {
    padding: 0 !important;
    margin: 0 !important;
    height: 100% !important;
}
.checkin-section.active .globe-page {
    padding: 0 !important;
    margin: 0 !important;
    height: 100% !important;
    min-height: 100% !important;
}
.checkin-section.active .globe-wrap {
    padding: 0 !important;
    margin: 0 !important;
}
.checkin-section.active .globe-map {
    padding: 0 !important;
    margin: 0 !important;
}


/* ===== 最终修复：地球打卡和游戏页面空隙问题 ===== */
/* 地球打卡：完全去掉padding，内容占满 */
.checkin-section.active {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin: 0 !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
}
.checkin-section.active .vue-checkin-section {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin: 0 !important;
    height: 100% !important;
    min-height: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
}
.checkin-section.active .globe-page {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin: 0 !important;
    height: 100% !important;
    min-height: 100% !important;
    max-height: 100% !important;
}

/* 游戏页面：完全去掉多余padding，内容居中 */
.games-section.active {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin: 0 !important;
    height: calc(100dvh - var(--header-h) - var(--banner-h)) !important;
    min-height: 0 !important;
    max-height: calc(100dvh - var(--header-h) - var(--banner-h)) !important;
    overflow: hidden !important;
    position: relative !important;
}
.games-section.active .game-view {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    padding-top: 64px !important;
    padding-bottom: 24px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    margin: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
}
.games-section.active .game-lobby {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    margin: 0 !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    overflow: hidden !important;
}


/* ===== 修复：地球打卡intro页面黑色空隙 - 彻底覆盖 ===== */
.checkin-section.active {
    position: relative !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}
.checkin-section.active .vue-checkin-section {
    position: relative !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}
.checkin-section.active .globe-page {
    position: relative !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}
/* intro页面：绝对定位，从最顶部开始，完全覆盖后面的地图 */
.checkin-section.active .checkin-intro {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    max-height: 100% !important;
    background: #fff !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 9999 !important;
    padding: 16px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}
.checkin-section.active .checkin-intro-card {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: 560px !important;
    width: 100% !important;
}
/* 弹幕区域：intro显示时隐藏 */
.checkin-section.active .checkin-intro ~ .danmaku-container,
.checkin-section.active .danmaku-container {
    display: none !important;
}


/* ===== 用ID选择器覆盖内联样式的padding-top ===== */
#checkin.checkin-section {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}
#games.games-section {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}


/* ===== 2026-09-12 最终修复：游戏页面和留言墙 ===== */

/* 游戏模式：网页端显示banner和菜单，仅移动端隐藏 */
@media (min-width: 769px) {
    body.game-mode .top-banner,
    body.game-mode .header {
        display: block !important;
    }
}

/* 游戏页面：正确的高度计算，内容居中 */
.games-section.active {
    height: calc(100dvh - 146px) !important;
    min-height: calc(100dvh - 146px) !important;
    max-height: calc(100dvh - 146px) !important;
    overflow: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}

/* 移动端游戏页面高度 */
@media (max-width: 768px) {
    .games-section.active {
        height: calc(100dvh - 120px) !important;
        min-height: calc(100dvh - 120px) !important;
        max-height: calc(100dvh - 120px) !important;
    }
}

/* 游戏大厅内容垂直居中（不用!important覆盖display，由JS控制显隐） */
.games-section.active .game-lobby.active {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 16px !important;
    overflow: hidden !important;
}

/* 游戏子视图内容垂直居中（不用!important覆盖display，由JS控制显隐） */
.games-section.active .game-view.active {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 16px !important;
    overflow: hidden !important;
}

/* 留言墙：全部留言列表全屏显示 */
.message-list-area.active {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 16px !important;
    min-height: 0 !important;
    max-height: none !important;
    height: 100% !important;
    overflow-y: auto !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* 留言墙区域确保子视图能占满 */
.messages-section.active {
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.messages-section.active .wall-view,
.messages-section.active .message-form-container,
.messages-section.active .message-list-area {
    flex: 1 !important;
    min-height: 0 !important;
}


/* ===== 强制覆盖：留言表单宽度 ===== */
.message-form-container {
    max-width: min(820px, 75vw) !important;
    width: 100% !important;
}
.messages-section.active .message-form-container {
    max-width: min(820px, 75vw) !important;
    width: 100% !important;
}


/* ===== 留言表单4:3比例调整 ===== */
.message-form-container {
    max-width: min(720px, 65vw) !important;
}
.message-form {
    min-height: 540px !important;
    padding: 32px 32px 28px !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
}
.message-form .form-header {
    margin-bottom: 20px !important;
}
.message-form .nick-input {
    min-height: 48px !important;
    font-size: 18px !important;
    margin-bottom: 16px !important;
}
.message-form .msg-textarea {
    flex: 1 !important;
    min-height: 280px !important;
    font-size: 17px !important;
    line-height: 1.8 !important;
    padding: 16px !important;
}
.message-form .form-footer {
    margin-top: 20px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}
.message-form .submit-btn {
    min-height: 52px !important;
    font-size: 18px !important;
    padding: 0 40px !important;
}


/* ===== 强制修复：抽卡iframe全屏显示 ===== */
#gameViewGacha {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
}
#gachaFrame.gacha-frame {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    margin: 0 !important;
    flex: 1 1 auto !important;
}


/* ===== 强制修复：移动端滚动和双滚动条问题 ===== */
@media (max-width: 768px) {
    html {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    body {
        overflow-y: visible !important;
        overflow-x: hidden !important;
    }
    main {
        overflow: visible !important;
    }
    .section {
        overflow: visible !important;
        overflow-x: hidden !important;
    }
    .section.active {
        min-height: auto !important;
    }
    /* 游戏和打卡页面固定一页 */
    .games-section.active,
    .checkin-section.active {
        height: calc(100dvh - 146px) !important;
        min-height: calc(100dvh - 146px) !important;
        max-height: calc(100dvh - 146px) !important;
        overflow: hidden !important;
    }
}


/* ===== 强制隐藏所有滚动条 ===== */
html, body, main, .section, .section.active,
.messages-section, .games-section, .checkin-section,
.message-form-container, .wall-view, .message-list-area,
.game-view, .game-view.active, .game-lobby {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}
html::-webkit-scrollbar,
body::-webkit-scrollbar,
main::-webkit-scrollbar,
.section::-webkit-scrollbar,
.messages-section::-webkit-scrollbar,
.games-section::-webkit-scrollbar,
.checkin-section::-webkit-scrollbar,
.message-form-container::-webkit-scrollbar,
.wall-view::-webkit-scrollbar,
.message-list-area::-webkit-scrollbar,
.game-view::-webkit-scrollbar,
.game-lobby::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}


/* ===== 滚动逻辑：便签墙固定一页，其他可滚动 ===== */
.messages-section.active {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: calc(100dvh - 146px) !important;
    max-height: none !important;
    overflow: visible !important;
    overflow-x: hidden !important;
}

/* 便签墙激活时：固定一页 */
.messages-section.active.wall-mode {
    height: calc(100dvh - 146px) !important;
    min-height: calc(100dvh - 146px) !important;
    max-height: calc(100dvh - 146px) !important;
    overflow: hidden !important;
}

/* 留言表单：可滚动 */
.message-form-container {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
}

/* 便签墙：固定一页，不滚动 */
.wall-view.active {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}
.wall-view .wall-notes {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
    position: relative !important;
}

/* 查看所有留言：可滚动 */
.message-list-area {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
}

/* 首页：可滚动 */
.home-section.active {
    height: auto !important;
    min-height: 100dvh !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* 成长回顾：可滚动 */
.timeline-section.active {
    height: auto !important;
    min-height: 100dvh !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}


/* ===== 抽卡页面：iframe占满，内容垂直居中 ===== */
#gameViewGacha {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 0 !important;
    margin: 0 !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
}
#gameViewGacha .back-to-lobby {
    position: absolute !important;
    top: 12px !important;
    left: 12px !important;
    z-index: 100 !important;
}
#gachaFrame.gacha-frame {
    flex: 1 1 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
}


/* ===== 地球打卡：去掉底部粉色条，占满全屏 ===== */
.checkin-section.active {
    height: calc(100dvh - 146px) !important;
    min-height: calc(100dvh - 146px) !important;
    max-height: calc(100dvh - 146px) !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #0a0e1a !important;
}
.checkin-section .globe-page,
.checkin-section .app-root {
    height: 100% !important;
    min-height: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
    background: #0a0e1a !important;
}
/* intro页面占满 */
.checkin-intro {
    height: 100% !important;
    min-height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    background: #fff !important;
}


/* ===== 成长回顾：图片最大高度，避免文字被挤到底部 ===== */
.star-map .page img,
.star-map .year-content img,
.timeline-section img {
    max-height: 45vh !important;
    width: auto !important;
    max-width: 90% !important;
    object-fit: contain !important;
    display: block !important;
    margin: 0 auto !important;
}
/* 移动端图片更小 */
@media (max-width: 768px) {
    .star-map .page img,
    .star-map .year-content img,
    .timeline-section img {
        max-height: 35vh !important;
    }
}


/* ===== 留言表单：完整显示，可滚动 ===== */
.message-form-container {
    flex: none !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 20px 16px !important;
    box-sizing: border-box !important;
}
.message-form {
    width: 100% !important;
    max-width: min(820px, 90vw) !important;
    margin: 0 auto !important;
    height: auto !important;
    min-height: 540px !important;
    display: flex !important;
    flex-direction: column !important;
}


/* ===== 最高优先级：抽卡页面高度修复 ===== */
/* 问题：#gameViewGacha 高度为0，导致iframe高度为0，内容靠上，底部粉色空白 */

/* 1. 游戏区域父容器：确保有明确高度 */
.games-section.active {
    height: calc(100dvh - 146px) !important;
    min-height: calc(100dvh - 146px) !important;
    max-height: calc(100dvh - 146px) !important;
    overflow: hidden !important;
    display: block !important;
    position: relative !important;
}

/* 2. 所有game-view：确保占满父容器高度 */
.games-section .game-view {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    display: none !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

/* 3. active的game-view：显示并占满 */
.games-section .game-view.active {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
}

/* 4. 抽卡页面：用ID选择器最高优先级 */
#gameViewGacha {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    display: none !important;
    overflow: hidden !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}
#gameViewGacha.active {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
}

/* 5. 抽卡iframe：占满整个game-view */
#gachaFrame {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    flex: 1 1 auto !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
}

/* 6. 返回按钮：绝对定位，不占空间 */
#gameViewGacha .back-to-lobby {
    position: absolute !important;
    top: 12px !important;
    left: 12px !important;
    z-index: 100 !important;
}

/* ================================================================
   留言页：一屏布局 + 输入框加大（2026-09-13）
   目标：去掉页面级滚动条，表单/墙面/列表三种视图均在一屏内展示
   ================================================================ */
.messages-section.active {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    box-sizing: border-box !important;
    padding: 12px 16px 14px !important;
    overflow: hidden !important;
    /* 桌面：header 64 + banner 96 (+4px 呼吸空间) */
    height: calc(100dvh - 164px) !important;
    min-height: calc(100dvh - 164px) !important;
    max-height: calc(100dvh - 164px) !important;
}
@media (max-width: 768px) {
    .messages-section.active {
        /* 移动端 header 不占流，banner 96px */
        height: calc(100dvh - 96px) !important;
        min-height: calc(100dvh - 96px) !important;
        max-height: calc(100dvh - 96px) !important;
        padding: 10px 12px 12px !important;
    }
}

/* ---- 表单视图：输入框加大、昵称靠上 ---- */
.messages-section.active .message-form-container {
    flex: 0 1 auto !important;
    margin: 0 auto 8px !important;
    max-width: min(760px, 84vw) !important;
    min-height: 0 !important;
}
.message-form {
    padding: 14px 18px 14px !important;
    gap: 8px !important;
    min-height: 0 !important;
    justify-content: flex-start !important;
}
.form-header {
    margin-bottom: 0 !important;
}
.form-title {
    font-size: 1.05rem !important;
}

/* 昵称输入框：加大 */
.message-form #username {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    font-size: 1.05rem !important;
    letter-spacing: 0.5px !important;
    padding: 12px 8px 10px !important;
    background: rgba(255, 255, 255, 0.45) !important;
    border-bottom: 1px solid rgba(217, 33, 33, 0.3) !important;
    border-radius: 8px 8px 0 0 !important;
    line-height: 1.4 !important;
}

/* 留言正文：加大加高，弹性占满剩余空间 */
.paper-textarea-wrap {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
}
.message-form textarea#message {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    height: auto !important;
    min-height: 220px !important;
    max-height: 42vh !important;
    flex: 1 1 auto !important;
    font-size: 1rem !important;
    line-height: 1.75 !important;
    letter-spacing: 0.3px !important;
    padding: 10px 6px !important;
    resize: none !important;
}
.char-count {
    margin-top: 0 !important;
    font-size: 0.85rem !important;
}
.message-form > button[type="submit"] {
    padding: 12px !important;
    font-size: 1.05rem !important;
    border-radius: 12px !important;
}

/* 表单/列表模式下墙面不占空间（覆盖旧的无条件 display:block） */
.messages-section.active .wall-view:not(.active) {
    display: none !important;
}

/* ---- 留言墙视图：填满剩余空间，内部滚动、无滚动条 ---- */
.wall-view.active {
    min-height: 0 !important;
    flex: 1 1 auto !important;
    margin: 0 -16px !important;
    width: calc(100% + 32px) !important;
    padding: 12px 16px !important;
    overflow: hidden !important;
}
.wall-notes {
    min-height: 0 !important;
    height: 100% !important;
    overflow-y: auto !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}
.wall-notes::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
}

/* ---- 列表视图：占满剩余空间，内部滚动、无滚动条 ---- */
.message-list-area.active {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}
.message-list {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}
.message-list::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
}

/* ---- 底部按钮：固定不滚动 ---- */
.wall-footer {
    flex: 0 0 auto !important;
    margin-top: 10px !important;
    padding: 0 !important;
}

/* 移动端微调 */
@media (max-width: 768px) {
    .messages-section.active .message-form-container {
        max-width: 100% !important;
    }
    .wall-view.active {
        margin: 0 -12px !important;
        width: calc(100% + 24px) !important;
        padding: 10px 12px !important;
    }
}

/* ===== 打卡封面：返回首页按钮 ===== */
.checkin-back-btn {
    position: fixed !important;
    top: calc(18px + env(safe-area-inset-top)) !important;
    left: calc(18px + env(safe-area-inset-left)) !important;
    z-index: 10001 !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 8px 14px !important;
    border-radius: 20px !important;
    border: 1px solid rgba(184, 0, 46, 0.22) !important;
    background: rgba(255, 255, 255, 0.88) !important;
    color: #b8002e !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    box-shadow: 0 2px 10px rgba(184, 0, 46, 0.14) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-tap-highlight-color: transparent;
}
.checkin-back-btn:hover {
    background: rgba(255, 255, 255, 1) !important;
    box-shadow: 0 4px 14px rgba(184, 0, 46, 0.22) !important;
}

/* ===== 留言墙居中修复 ===== */
.messages-section.active {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    box-sizing: border-box !important;
}

.messages-section > h2 {
    text-align: center !important;
    width: 100% !important;
}

.wall-view {
    width: 100% !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
    align-items: center !important;
    justify-content: center !important;
}

.wall-notes {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    display: block !important;
    column-count: 5;
    column-gap: 16px;
    column-fill: balance !important;
}

/* 便签在列中居中 */
.wall-note, .note-item, .sticky-note {
    break-inside: avoid !important;
    margin: 0 auto 16px auto !important;
    display: block !important;
}

/* 网页端留言墙最大宽度限制，避免过宽 */
@media (min-width: 1200px) {
    .wall-notes {
        max-width: 1100px !important;
    }
}


/* ===== 查看所有留言：修复显示数量 + 宽度调整 ===== */
.message-list-area {
    width: 100% !important;
    max-width: none !important;
    margin: 0 auto !important;
    padding: 0 16px !important;
    box-sizing: border-box !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    overflow-y: visible !important;
    display: none !important;
    flex-direction: column !important;
    gap: 12px !important;
}
.message-list-area.active {
    display: flex !important;
}

/* 网页端：两边各留白20%，即内容宽度60% */
@media (min-width: 1024px) {
    .message-list-area {
        max-width: 60% !important;
        padding: 0 !important;
    }
}

/* 平板端：两边各留白10% */
@media (min-width: 768px) and (max-width: 1023px) {
    .message-list-area {
        max-width: 80% !important;
        padding: 0 !important;
    }
}

.message-list {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
}

.ml-note {
    width: 100% !important;
    max-width: 100% !important;
    min-height: auto !important;
    height: auto !important;
    padding: 16px 18px !important;
    border-radius: 14px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
    box-sizing: border-box !important;
}

/* 分页按钮区域 */
.list-pagination {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 16px !important;
    padding: 20px 0 !important;
    flex-wrap: wrap !important;
}


/* ===== 抽卡页面布局修复：按钮不要贴底 ===== */
#gameViewGacha {
    justify-content: flex-start !important;
    padding-top: 20px !important;
    padding-bottom: 20px !important;
}

/* 抽卡iframe内部布局：通过CSS变量控制 */
#gachaFrame {
    height: 100% !important;
}




/* ===== 游戏页面修复（移动端适配） ===== */

/* 抽卡iframe：移动端占满可用高度，按钮完整显示 */
@media (max-width: 768px) {
    .gacha-frame {
        max-width: 100% !important;
        width: 100% !important;
        min-height: calc(100dvh - 200px) !important;
        max-height: calc(100dvh - 200px) !important;
        height: calc(100dvh - 200px) !important;
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
    }
    .game-view.active {
        padding: 0 !important;
    }
    .back-to-lobby {
        margin: 10px 0 10px 12px !important;
    }
}

/* 答题按钮：跟随窗口大小变化 */
.quiz-start-btn,
.quiz-option {
    width: 100% !important;
    max-width: min(320px, 80vw) !important;
    min-height: 48px !important;
    font-size: clamp(0.9rem, 2.5vw, 1.1rem) !important;
}

/* 拼图按钮：跟随窗口大小变化 */
.diff-btn,
.puzzle-lb-btn,
.puzzle-shuffle,
.puzzle-give-up {
    width: 100% !important;
    max-width: min(280px, 80vw) !important;
    min-height: 48px !important;
    font-size: clamp(0.85rem, 2.5vw, 1rem) !important;
}

/* 查看所有留言：允许滚动 */
.message-list-area {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    max-height: calc(100dvh - 200px) !important;
}
.message-list {
    overflow-y: visible !important;
}


/* ===== 修复：查看所有留言页面滚动 ===== */
.messages-section.active {
    height: calc(100dvh - 146px) !important;
    min-height: calc(100dvh - 146px) !important;
    max-height: calc(100dvh - 146px) !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

.message-list-area.active {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
}

@media (max-width: 768px) {
    .messages-section.active {
        height: calc(100dvh - 120px) !important;
        min-height: calc(100dvh - 120px) !important;
        max-height: calc(100dvh - 120px) !important;
    }
}


/* ===== 游戏页面布局修复：返回按钮不遮挡内容，内容垂直居中 ===== */
.games-section .game-view.active {
    padding-top: 70px !important;
    padding-bottom: 24px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    justify-content: center !important;
}

/* 返回按钮确保在最上层，不被iframe遮挡 */
.game-view .back-to-lobby {
    z-index: 9999 !important;
    position: fixed !important;
    top: max(16px, env(safe-area-inset-top)) !important;
    left: 16px !important;
}

/* 追光抽卡iframe确保不遮挡返回按钮 */
.game-view .gacha-frame {
    z-index: 1 !important;
    position: relative !important;
}

/* 拼图和答题内容确保在返回按钮下方 */
.game-view .puzzle-setup,
.game-view .puzzle-play,
.game-view .puzzle-leaderboard,
.game-view .quiz-start,
.game-view .quiz-play,
.game-view .quiz-end {
    margin-top: 0 !important;
    width: 100% !important;
    max-width: 500px !important;
}

/* 拼图游戏底部按钮确保完整显示 */
.game-view .puzzle-play .puzzle-controls {
    margin-top: 16px !important;
    flex-shrink: 0 !important;
}


/* ===== 追光抽卡游戏（合并自独立页面） ===== */

* {margin:0;padding:0;box-sizing:border-box}
html {height:100%;background:var(--bg);}
body {height:100%}
:root {
  --pink:#ff6b6b;       
  --gold:#feca57;       
  --bg:#fff5f7;         
  --card-bg:#fff;       
  --text:#555;          
  --text-light:#999;    
  --border:rgba(255,107,107,0.15); 
}
body {
  font-family:'Microsoft YaHei','PingFang SC',sans-serif;
  background:var(--bg);
  height:100%;
  min-height:100%;
  max-height:100%;
  overflow:hidden;
  padding:0;
  margin:0;
  user-select:none;
  border:none;
}
.gacha-game .game {
  height:100%;
  min-height:100%;
  max-height:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:10px;
  background:transparent;
  border-radius:0;
  padding:16px;
  max-width:100%;
  width:100%;
  text-align:center;
  border:none !important;
  box-shadow:none !important;
  backdrop-filter:none;
  box-sizing:border-box;
  overflow:hidden;
  margin:0;
}
.gacha-game .game .title {padding-left:0; text-align:center;}
@media(min-width:768px){
.gacha-game .game {padding:24px 32px}
.gacha-game .game .title {padding-left:0}
.gacha-game .cards-grid {max-width:900px;margin:0 auto 16px}
}
.gacha-game .title {font-size:24px;font-weight:700;background:linear-gradient(135deg,var(--pink),var(--gold));-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;margin-bottom:4px}
.gacha-game .subtitle {font-size:13px;color:var(--text-light);margin-bottom:8px}
.gacha-game .user-info {display:flex;align-items:center;justify-content:space-evenly;gap:6px;margin-bottom:8px;font-size:12px;color:var(--text-light)}
.gacha-game .stats {display:flex;justify-content:space-evenly;gap:32px;margin:4px 0 8px}
.gacha-game .stat-item {text-align:center}
.gacha-game .stat-num {font-size:28px;font-weight:700;color:var(--pink)}
.gacha-game .stat-label {font-size:11px;color:var(--text-light);margin-top:2px;cursor:pointer}
.gacha-game .stat-label:hover {color:var(--pink)}
.gacha-game .card-area {position:relative;width:min(200px,50vw);aspect-ratio:637/1003;margin:8px auto 12px;cursor:default;perspective:1200px;transform-style:preserve-3d;transition:transform .1s ease}


.gacha-game .card-placeholder {width:min(140px,38vw);aspect-ratio:3/4;margin:4px auto 8px;display:flex;flex-direction:column;align-items:center;justify-content:center}
.gacha-game .card-back, .gacha-game .card-front {position:absolute;inset:0;border-radius:16px;backface-visibility:hidden;transition:transform .6s cubic-bezier(0.34,1.56,0.64,1)}
.gacha-game .card-back {
  background: #ffffff;
  background-image:none;
  background-size:100% 100%;background-repeat:no-repeat;background-position:center;
  border:none;border-radius:16px;
  box-shadow:0 8px 28px rgba(255,107,107,0.15)
}
.gacha-game .card-front {
  background:var(--card-bg);border:2px solid rgba(254,202,87,0.4);
  transform:rotateY(180deg);display:flex;flex-direction:column;
  align-items:center;justify-content:flex-end;padding:12px;overflow:hidden;
  background-size:cover;background-position:center
}
.gacha-game .card-flipped .card-back {transform:rotateY(180deg)}
.gacha-game .card-flipped .card-front {transform:rotateY(0deg)}


@keyframes cardSpin{
.gacha-game 0% {transform:rotateY(0deg)}
.gacha-game 100% {transform:rotateY(360deg)}
}
.gacha-game .shaking {animation:shake .2s ease-in-out 3}
@keyframes shake{0%,100%{transform:translateX(0)}25%{transform:translateX(-6px) rotate(-2deg)}75%{transform:translateX(6px) rotate(2deg)}}
.gacha-game .effect-glow {position:absolute;inset:-20px;border-radius:36px;pointer-events:none;opacity:0;z-index:-1}
.gacha-game .effect-glow.SSR {background:radial-gradient(circle,rgba(255,215,0,0.35),transparent 70%);animation:glowPulse 1s ease-in-out infinite;opacity:1}
.gacha-game .effect-glow.SR {background:radial-gradient(circle,rgba(255,107,107,0.25),transparent 70%);animation:glowPulse 1.5s ease-in-out infinite;opacity:1}
@keyframes glowPulse{0%,100%{opacity:.3;transform:scale(1)}50%{opacity:1;transform:scale(1.05)}}
.gacha-game .card-rarity {position:absolute;top:8px;right:8px;padding:2px 8px;border-radius:12px;font-size:10px;font-weight:600;z-index:5}
.gacha-game .card-rarity.R {background:rgba(100,181,246,0.15);color:#4A90D9;border:1px solid rgba(100,181,246,0.25)}
.gacha-game .card-rarity.SR {background:rgba(236,64,122,0.15);color:#EC407A;border:1px solid rgba(236,64,122,0.25)}
.gacha-game .card-rarity.SSR {background:rgba(254,202,87,0.2);color:#E6A817;border:1px solid rgba(254,202,87,0.3)}
.modal-overlay {display:none;position:fixed;inset:0;background:rgba(255,107,107,0.15);backdrop-filter:blur(8px);z-index:999;align-items:center;justify-content:space-evenly;animation:fadeIn .3s ease;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
.modal-overlay.top {z-index:1000}
.modal-overlay.show {display:flex}
.modal-box {background:linear-gradient(180deg,#fff,#fff5f7);border-radius:24px;padding:32px 24px 24px;max-width:min(360px,85vw);width:90%;text-align:center;border:1px solid var(--border);animation:slideUp .4s cubic-bezier(0.34,1.56,0.64,1);box-shadow:0 16px 48px rgba(255,107,107,0.15)}
@keyframes slideUp{from{opacity:0;transform:translateY(40px) scale(.95)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
.modal-title {font-size:clamp(18px,6vw,22px);font-weight:700;background:linear-gradient(135deg,var(--pink),var(--gold));-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;margin-bottom:12px}
.modal-desc {font-size:14px;color:var(--text);margin-bottom:8px;line-height:1.6}
.gacha-game .actions {display:flex;gap:12px;justify-content:space-evenly;margin-top:0}
.gacha-game .btn {padding:max(14px,min(4vw,16px)) max(24px,min(6vw,32px));border:none;border-radius:14px;font-size:clamp(14px,4.5vw,16px);font-weight:600;cursor:pointer;transition:all .2s ease;min-height:44px}
.gacha-game .btn-gacha {background:linear-gradient(135deg,var(--pink),var(--gold));color:#fff;flex:1;box-shadow:0 6px 24px rgba(255,107,107,0.25)}
.gacha-game .btn-gacha:hover {transform:translateY(-2px);box-shadow:0 8px 32px rgba(255,107,107,0.35)}
.gacha-game .btn-gacha:disabled {opacity:.3;transform:none;cursor:not-allowed;box-shadow:none}
.gacha-game .btn-share {background:rgba(255,107,107,0.06);color:var(--text-light);border:1px solid var(--border);padding:max(14px,min(4vw,16px)) 16px;font-size:clamp(13px,4vw,14px)}


.gacha-game .ticket-actions {display:flex;flex-direction:column;gap:10px;margin-bottom:16px}
.gacha-game .ticket-btn {display:flex;align-items:center;gap:12px;width:100%;padding:14px;border:none;border-radius:14px;background:rgba(255,107,107,0.04);border:1px solid var(--border);cursor:pointer;text-align:left;transition:all .2s}
.gacha-game .ticket-btn:active {transform:scale(.98);background:rgba(255,107,107,0.08)}
.gacha-game .ticket-icon {font-size:26px;flex-shrink:0}
.gacha-game .ticket-text {display:flex;flex-direction:column}
.gacha-game .ticket-text b {color:var(--pink);font-size:15px;margin-bottom:2px}
.gacha-game .ticket-text small {color:var(--text-light);font-size:11px}


#cardViewModal {position:fixed;inset:0;z-index:99999;background:rgba(0,0,0,0.95);backdrop-filter:blur(8px);display:none;align-items:center;justify-content:space-evenly;flex-direction:column;cursor:grab;width:100vw;height:100vh}
#cardViewModal.show {display:flex}
#cardViewModal.dragging {cursor:grabbing}
.gacha-game .view-card {width:min(280px,42vw);aspect-ratio:637/1003;perspective:1600px;margin:0 auto;flex-shrink:0}
.gacha-game .view-card-inner {position:relative;width:100%;height:100%;transform-style:preserve-3d;transition:transform .1s ease-out}
.gacha-game .view-front, .gacha-game .view-back {position:absolute;inset:0;border-radius:20px;backface-visibility:hidden;display:flex;align-items:center;justify-content:space-evenly;overflow:hidden;background:var(--card-bg);border:3px solid var(--border);box-shadow:0 20px 60px rgba(0,0,0,0.5)}
.gacha-game .view-front {border-color:rgba(254,202,87,0.5)}
.gacha-game .view-back {transform:rotateY(180deg)}
.gacha-game .view-front img, .gacha-game .view-back img {width:100%;height:100%;object-fit:contain;display:block}
.gacha-game .view-card-info {color:#fff;text-align:center;margin-top:24px;font-size:16px;opacity:0.9;max-width:90vw}
.gacha-game .view-card-hint {color:rgba(255,255,255,0.5);text-align:center;margin-top:12px;font-size:13px}
.gacha-game .view-card-close {position:absolute;top:20px;right:20px;width:44px;height:44px;border-radius:50%;background:rgba(255,255,255,0.15);border:none;color:#fff;font-size:22px;cursor:pointer;display:flex;align-items:center;justify-content:space-evenly;z-index:10;transition:background .2s}
.gacha-game .view-card-close:hover {background:rgba(255,255,255,0.3)}


.gacha-game #toast {position:fixed;top:15%;left:50%;transform:translate(-50%,-50%);z-index:9999;padding:12px 22px;border-radius:12px;background:linear-gradient(135deg,var(--pink),var(--gold));color:#fff;font-size:14px;font-weight:600;pointer-events:none;opacity:0;transition:opacity .3s;white-space:nowrap;box-shadow:0 4px 20px rgba(255,107,107,0.3)}
.gacha-game #toast.show {opacity:1}


@media(min-width:768px){
.gacha-game .game {max-width:100% !important;width:100% !important}
}
.gacha-game .grid-card {position:relative;height:0;padding-top:157.4%;cursor:pointer;perspective:800px;transform-style:preserve-3d;transition:transform .4s ease,opacity .4s ease;animation:cardEnter .4s ease backwards}
.gacha-game .grid-card:nth-child(1) {animation-delay:0s}.grid-card:nth-child(2){animation-delay:.06s}.grid-card:nth-child(3){animation-delay:.12s}
.gacha-game .grid-card:nth-child(4) {animation-delay:.18s}.grid-card:nth-child(5){animation-delay:.24s}.grid-card:nth-child(6){animation-delay:.3s}
@keyframes cardEnter{from{opacity:0;transform:translateY(20px) scale(.8)}to{opacity:1;transform:translateY(0) scale(1)}}

@supports not (aspect-ratio: 1) {
  .card-area,
.gacha-game .card-placeholder { height: 79vw; max-height: 380px; }
.gacha-game .view-card { height: 71vw; max-height: 470px; }
  @media (min-width: 768px) {
    .card-area,
.gacha-game .card-placeholder { height: 378px; max-height: none; }
.gacha-game .view-card { height: 470px; max-height: none; }
  }
}
.gacha-game .grid-card-inner {position:absolute;inset:0;width:100%;height:100%;transform-style:preserve-3d;transition:transform .6s cubic-bezier(0.34,1.56,0.64,1)}
.gacha-game .grid-card.flipped .grid-card-inner {transform:rotateY(180deg)}
.gacha-game .grid-card.faded {opacity:0;transform:scale(.5);pointer-events:none}
.gacha-game .grid-card.selected {transform:scale(1.3);z-index:10}
.gacha-game .grid-card-back, .gacha-game .grid-card-front {position:absolute;inset:0;border-radius:12px;backface-visibility:hidden;background-size:cover;background-position:center}
.gacha-game .grid-card-back {background-color:transparent;border:none;box-shadow:none}

.gacha-game .gacha-card-back {
  background: linear-gradient(135deg, #ff6b6b, #ff8fa3) !important;
  border: 2px solid #ff8fa3 !important;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  overflow: hidden !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 8px !important;
}

.gacha-game .gacha-card-back::before {
  display:none;
}

.gacha-game .gacha-card-back::after {
  content:'✦  ✧  ✦  ✧  ✦  ✧  ✦';
  position:absolute;
  top:-12%;right:-18%;
  width:140%;
  font-size:0.85rem;
  color:rgba(255,255,255,0.75);
  letter-spacing:7px;
  transform:rotate(-38deg);
  transform-origin:center;
  white-space:nowrap;
  pointer-events:none;
  z-index:2;
  text-shadow:0 0 10px rgba(255,220,160,0.5);
}
.gacha-game .gacha-card-back-text {
  font-size: clamp(1.8rem, 7vw, 2.8rem);
  font-weight: 800;
  color: #fff !important;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3) !important;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  z-index: 3;
  letter-spacing: 2px;
  white-space: nowrap;
  display: inline-block;
}
@media(min-width:768px){
.gacha-game .gacha-card-back-text {font-size:clamp(2rem, 3vw, 3.2rem)}
}
.gacha-game .grid-card-front {transform:rotateY(180deg);background:var(--card-bg);border:2px solid rgba(254,202,87,0.4);display:flex;align-items:center;justify-content:space-evenly;overflow:hidden}
.gacha-game .grid-card-front img {width:100%;height:100%;object-fit:cover}
.gacha-game .grid-card .card-rarity {top:4px;right:4px;padding:1px 6px;font-size:9px}


.gacha-game .drag-hint {text-align:center;font-size:12px;color:var(--text-light);margin-bottom:12px;animation:pulse 2s ease-in-out infinite}
@keyframes pulse{0%,100%{opacity:.5}50%{opacity:1}}


@media(min-width:768px) and (max-width:1099px){
.gacha-game .game {max-width:100%;padding:40px 32px}
.gacha-game .card-area {width:240px;height:auto;aspect-ratio:3/4}
.gacha-game .stats {gap:48px}
}


@media(min-width:1100px){
body {background:transparent}
.gacha-game .game {max-width:100%;padding:40px 32px}
.gacha-game .card-area {width:240px;height:auto;aspect-ratio:3/4}
}


@media(pointer:coarse){
.gacha-game .btn {min-height:48px}
.gacha-game .card-area {cursor:default}
.gacha-game .stat-num {font-size:30px}
}


@media(pointer:fine) and (hover:hover){
.gacha-game .btn-gacha:not(:disabled):hover {transform:translateY(-2px);box-shadow:0 8px 32px rgba(255,107,107,0.35)}
}


@media(orientation:landscape) and (max-height:500px){
.gacha-game .game {padding:12px 24px}
.gacha-game .subtitle {margin-bottom:8px}
.gacha-game .stats {margin-bottom:8px;gap:16px}
.gacha-game .card-area {width:140px;height:196px;margin-bottom:8px}
.gacha-game .stat-num {font-size:20px}
}


.gacha-game .game {
  height: 100dvh !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 8px 16px !important;
  padding-top: calc(10px + env(safe-area-inset-top, 0px)) !important;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

.gacha-game .subtitle { 
  margin-bottom: 8px !important; 
  font-size: 13px !important; 
  flex-shrink: 0 !important;
}
.gacha-game .stats { 
  margin-bottom: 20px !important; 
  gap: 24px !important; 
  flex-shrink: 0 !important;
}
.gacha-game .stat-num { font-size: 18px !important; }
.gacha-game .stat-label { font-size: 11px !important; }
.gacha-game .card-placeholder, .gacha-game .card-area { 
  width: min(90px, 24vw) !important; 
  margin: 0 auto 16px !important;
  flex-shrink: 0 !important;
}

.gacha-game .card-placeholder {
  flex: 1 1 auto !important;
  min-height: 0 !important;
}


.gacha-game .cards-grid {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: grid;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 14px !important;
  width: 100% !important;
  max-width: 180px !important;
  margin: 0 auto !important;
  align-content: center !important;
  justify-content: center !important;
  overflow: visible !important;
  perspective: 1000px !important;
}
@media (min-width: 768px) {
.gacha-game .cards-grid {
    grid-template-columns: repeat(6, 1fr) !important;
    max-width: 540px !important;
    gap: 20px !important;
  }
}

.gacha-game .grid-card {
  aspect-ratio: 3 / 4 !important;
  width: 100% !important;
  height: auto !important;
  padding-top: 0 !important;
  cursor: pointer;
  position: relative !important;
}
.gacha-game .grid-card-inner {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
}
.gacha-game .grid-card-back, .gacha-game .grid-card-front {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 8px !important;
}

.gacha-game .actions {
  margin-top: auto !important;
  flex-shrink: 0 !important;
  max-width: 260px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  width: 100%;
  display: flex !important;
  gap: 12px !important;
  position: relative !important;
  z-index: 10 !important;
}
.gacha-game .btn { 
  min-height: 44px !important; 
  padding: 10px 16px !important; 
  font-size: 13px !important; 
  flex: 1 !important;
  border-radius: 10px !important;
}
@media (min-width: 768px) {
.gacha-game .actions { max-width: 360px !important; }
}


.gacha-game .game .title {margin-bottom:2px !important;}
.gacha-game .game .subtitle {margin-bottom:8px !important;}
.gacha-game .game .stats {margin-bottom:8px !important;}
.gacha-game .game .card-placeholder {margin:0 auto !important;}
.gacha-game .game .card-area {margin:0 auto !important;}
.gacha-game .game .actions {margin-top:auto !important;max-width:280px !important;}
.gacha-game .game .drag-hint {margin:4px 0 !important;}



@media (max-width: 768px) {
.gacha-game .game {
    padding: 8px 12px !important;
    gap: 6px !important;
  }
.gacha-game .title {
    font-size: 20px !important;
    margin-bottom: 2px !important;
  }
.gacha-game .subtitle {
    font-size: 12px !important;
    margin-bottom: 4px !important;
  }
.gacha-game .stats {
    gap: 24px !important;
    margin: 2px 0 4px !important;
  }
.gacha-game .stat-num {
    font-size: 22px !important;
  }
.gacha-game .card-area {
    width: min(160px, 42vw) !important;
    margin: 4px auto 8px !important;
  }
.gacha-game .card-placeholder {
    width: min(120px, 32vw) !important;
    margin: 2px auto 4px !important;
  }
.gacha-game .actions {
    margin-top: 4px !important;
    width: 100% !important;
    max-width: 320px !important;
  }
.gacha-game .btn {
    min-height: 44px !important;
    padding: 10px 20px !important;
    font-size: 14px !important;
  }
}




.gacha-game .game {
  justify-content: center !important;
  gap: 12px !important;
  padding: 16px !important;
}


.gacha-game .title {
  margin-bottom: 2px !important;
  font-size: 22px !important;
}
.gacha-game .subtitle {
  margin-bottom: 4px !important;
  font-size: 12px !important;
}
.gacha-game .user-info {
  margin-bottom: 4px !important;
  font-size: 11px !important;
}
.gacha-game .stats {
  margin: 4px 0 !important;
  gap: 32px !important;
}
.gacha-game .stat-num {
  font-size: 24px !important;
}


.gacha-game .cards-grid {
  flex: 0 0 auto !important;
  max-width: 200px !important;
  gap: 12px !important;
  margin: 8px auto !important;
}
@media (min-width: 768px) {
.gacha-game .cards-grid {
    max-width: 480px !important;
    gap: 16px !important;
  }
}


.gacha-game .card-area, .gacha-game .card-placeholder {
  flex: 0 0 auto !important;
  width: min(120px, 32vw) !important;
  margin: 8px auto !important;
}


.gacha-game .actions {
  margin-top: 8px !important;
  flex: 0 0 auto !important;
  max-width: 220px !important;
}
.gacha-game .btn {
  min-height: 42px !important;
  padding: 10px 20px !important;
  font-size: 14px !important;
}




.gacha-game .game {
  justify-content: center !important;
  gap: 8px !important;
}


.gacha-game .card-placeholder {
  flex: 0 0 auto !important;
  min-height: 100px !important;
  width: min(120px, 32vw) !important;
  margin: 4px auto !important;
}


.gacha-game .cards-grid {
  flex: 0 0 auto !important;
  margin: 4px auto !important;
}


.gacha-game .actions {
  margin-top: 4px !important;
  flex: 0 0 auto !important;
}


.gacha-game .stats {
  margin: 2px 0 !important;
  gap: 24px !important;
}
.gacha-game .stat-num {
  font-size: 22px !important;
}



/* ===== 修复：雨琦冷知识进度文字位置 ===== */
.game-view .quiz-play .quiz-progress {
    width: 100% !important;
    max-width: 500px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding-left: 50px !important;
    padding-right: 16px !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
}

/* ===== 修复：拼图游戏固定一页 ===== */
.game-view .puzzle-play {
    width: 100% !important;
    max-width: 500px !important;
    gap: 10px !important;
    flex-shrink: 0 !important;
}

.game-view .puzzle-play .puzzle-stats {
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding-left: 50px !important;
    padding-right: 16px !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
}

.game-view .puzzle-play .puzzle-board {
    flex: 0 0 auto !important;
    max-width: min(320px, 80vw) !important;
    width: 100% !important;
    margin: 0 auto !important;
}

.game-view .puzzle-play .puzzle-controls {
    width: 100% !important;
    max-width: 400px !important;
    display: flex !important;
    gap: 10px !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
}

.game-view .puzzle-play .puzzle-controls button {
    flex: 1 !important;
    min-height: 40px !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
}

/* 拼图选难度页也固定一页 */
.game-view .puzzle-setup {
    width: 100% !important;
    max-width: 400px !important;
    gap: 12px !important;
}

.game-view .puzzle-setup .puzzle-difficulty {
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}

.game-view .puzzle-setup .diff-btn {
    width: 100% !important;
    min-height: 44px !important;
    padding: 10px !important;
    font-size: 14px !important;
}


/* ===== 修复：雨琦冷知识进度文字全部右移 ===== */
.game-view .quiz-play .quiz-progress {
    justify-content: flex-end !important;
    gap: 20px !important;
    padding-left: 60px !important;
    text-align: right !important;
}

.game-view .quiz-play .quiz-progress span:first-child {
    order: 2 !important;
}

.game-view .quiz-play .quiz-progress span:last-child {
    order: 1 !important;
}


/* ===== 拼图游戏更紧凑布局，确保固定一页 ===== */
.game-view .puzzle-play {
    gap: 8px !important;
    padding: 0 16px !important;
    max-height: calc(100dvh - 140px) !important;
    overflow: hidden !important;
}

.game-view .puzzle-play .puzzle-stats {
    padding-left: 50px !important;
    padding-right: 16px !important;
    margin-bottom: 4px !important;
    font-size: 13px !important;
}

.game-view .puzzle-play .puzzle-stats > * {
    font-size: 13px !important;
    padding: 4px 10px !important;
}

.game-view .puzzle-play .puzzle-board {
    max-width: min(280px, 70vw) !important;
    max-height: min(280px, 50vh) !important;
    width: 100% !important;
    aspect-ratio: 1 !important;
    margin: 0 auto !important;
    flex-shrink: 0 !important;
}

.game-view .puzzle-play .puzzle-board .puzzle-cell {
    font-size: 12px !important;
}

.game-view .puzzle-play .puzzle-controls {
    gap: 8px !important;
    margin-top: 4px !important;
    max-width: 360px !important;
}

.game-view .puzzle-play .puzzle-controls button {
    min-height: 36px !important;
    padding: 6px 10px !important;
    font-size: 12px !important;
}

/* 拼图选难度页也压缩 */
.game-view .puzzle-setup {
    gap: 10px !important;
    max-height: calc(100dvh - 140px) !important;
    overflow: hidden !important;
}

.game-view .puzzle-setup h2 {
    font-size: 20px !important;
    margin: 0 !important;
}

.game-view .puzzle-setup > p {
    font-size: 13px !important;
    margin: 0 !important;
}

.game-view .puzzle-setup .puzzle-difficulty {
    gap: 8px !important;
    max-width: 300px !important;
}

.game-view .puzzle-setup .diff-btn {
    min-height: 40px !important;
    padding: 8px !important;
    font-size: 13px !important;
}

.game-view .puzzle-setup .puzzle-lb-btn {
    min-height: 36px !important;
    padding: 6px 16px !important;
    font-size: 13px !important;
    margin-top: 4px !important;
}


/* ===== 修复：强制隐藏题号，答题页面垂直居中 ===== */
.game-view .quiz-play .quiz-progress {
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 500px !important;
    padding: 0 16px 0 60px !important;
    margin: 0 !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
}

/* 隐藏题号（如果存在） */
.game-view .quiz-play .quiz-progress > span:first-child {
    display: none !important;
}

/* 答题页面垂直居中 */
.game-view.active#gameViewQuiz {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    padding-top: 70px !important;
    padding-bottom: 20px !important;
    min-height: 100dvh !important;
    box-sizing: border-box !important;
}

.game-view .quiz-play[style*="display: block"],
.game-view .quiz-play[style*="display:block"] {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 14px !important;
    width: 100% !important;
    max-width: 500px !important;
    margin: 0 auto !important;
    flex: 1 !important;
}

.game-view .quiz-play .quiz-question {
    width: 100% !important;
    max-width: 460px !important;
    flex-shrink: 0 !important;
}

.game-view .quiz-play .quiz-options {
    width: 100% !important;
    max-width: 460px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    flex-shrink: 0 !important;
}

.game-view .quiz-play .quiz-option {
    width: 100% !important;
    min-height: 48px !important;
    padding: 12px 16px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    box-sizing: border-box !important;
}

.game-view .quiz-play .quiz-feedback {
    flex-shrink: 0 !important;
    min-height: 20px !important;
}


/* ===== 修复：抽卡游戏布局垂直居中，消除色差矩形 ===== */
.game-view.active#gameViewGacha {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    min-height: 100dvh !important;
    height: 100dvh !important;
    padding-top: 70px !important;
    padding-bottom: 20px !important;
    box-sizing: border-box !important;
    background: transparent !important;
    overflow: hidden !important;
}

.game-view.active#gameViewGacha .gacha-game {
    width: 100% !important;
    max-width: 500px !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    background: transparent !important;
    margin: 0 auto !important;
}

.game-view.active#gameViewGacha .gacha-game .game {
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    padding: 16px !important;
    gap: 12px !important;
    background: transparent !important;
    overflow: visible !important;
}

/* 抽卡券弹窗也修复 */
.game-view.active#gameViewGacha .modal-overlay {
    background: rgba(0,0,0,0.5) !important;
}

.game-view.active#gameViewGacha .modal-box {
    background: #fff !important;
    border-radius: 16px !important;
    padding: 20px !important;
}


/* ===== 彻底修复：抽卡游戏布局 ===== */
/* 覆盖之前的高度限制 */
.game-view.active#gameViewGacha .gacha-game .game {
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    padding: 0 !important;
    gap: 14px !important;
    background: transparent !important;
    overflow: visible !important;
}

/* 确保gacha-game容器透明 */
.game-view.active#gameViewGacha .gacha-game {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

/* 抽卡游戏各元素间距调整 */
.game-view.active#gameViewGacha .gacha-game .title {
    margin-bottom: 2px !important;
}

.game-view.active#gameViewGacha .gacha-game .subtitle {
    margin-bottom: 8px !important;
}

.game-view.active#gameViewGacha .gacha-game .stats {
    margin: 8px 0 !important;
    gap: 40px !important;
}

.game-view.active#gameViewGacha .gacha-game .card-placeholder {
    margin: 12px auto !important;
}

.game-view.active#gameViewGacha .gacha-game .card-area {
    margin: 12px auto !important;
}

.game-view.active#gameViewGacha .gacha-game .actions {
    margin-top: 12px !important;
    gap: 10px !important;
}

.game-view.active#gameViewGacha .gacha-game .btn {
    min-height: 48px !important;
    padding: 12px 24px !important;
    font-size: 15px !important;
}

/* 确保整个游戏视图没有多余背景 */
.game-view.active#gameViewGacha {
    background: transparent !important;
}


/* ===== 修复：消除游戏页面底部色差矩形 ===== */
/* 游戏模式下body背景改成纯色，不要渐变 */
body.game-mode {
    background: #fff5f7 !important;
}

/* 游戏大厅占满剩余高度，背景和body一致 */
.game-lobby.active {
    min-height: calc(100dvh - 140px) !important;
    background: #fff5f7 !important;
}

/* 所有游戏视图背景和body一致 */
.games-section.active {
    background: #fff5f7 !important;
    min-height: 100dvh !important;
}

/* 确保游戏视图没有多余背景 */
.game-view.active {
    background: transparent !important;
}


/* ===== 最终修复：games-section背景改成纯色，消除色差矩形 ===== */
.games-section {
    background: #fff5f7 !important;
}

/* 确保游戏大厅和游戏视图都占满高度 */
.game-lobby.active {
    min-height: calc(100dvh - 140px) !important;
    background: #fff5f7 !important;
}

.game-view.active {
    background: #fff5f7 !important;
    min-height: 0 !important;
}


/* ===== 彻底修复：统一游戏页面所有背景色，消除色差 ===== */
body {
    background: #fff5f7 !important;
}

.games-section,
.games-section.active {
    background: #fff5f7 !important;
    min-height: 100dvh !important;
}

.game-lobby,
.game-lobby.active {
    background: #fff5f7 !important;
    min-height: 0 !important;
}

.game-view,
.game-view.active {
    background: #fff5f7 !important;
}

/* 抽卡游戏容器也统一 */
.game-view.active#gameViewGacha,
.game-view.active#gameViewGacha .gacha-game,
.game-view.active#gameViewGacha .gacha-game .game {
    background: #fff5f7 !important;
}


/* ===== 综合修复：雨琦冷知识、追光抽卡、地球打卡 ===== */

/* 1. 雨琦冷知识：确保选项宽度和题目一致 */
.game-view .quiz-play .quiz-question,
.game-view .quiz-play .quiz-options {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.game-view .quiz-play .quiz-option {
    width: 100% !important;
    box-sizing: border-box !important;
}

/* 2. 雨琦冷知识：确保进度条显示 */
.game-view .quiz-play .quiz-progress {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin-bottom: 16px !important;
}

/* 3. 雨琦冷知识：答题页面整体布局 */
.game-view .quiz-play {
    width: 100% !important;
    max-width: 500px !important;
    padding: 0 16px !important;
    box-sizing: border-box !important;
}

/* 4. 追光抽卡：确保标题和统计信息显示 */
.game-view.active#gameViewGacha .gacha-game .title,
.game-view.active#gameViewGacha .gacha-game .subtitle,
.game-view.active#gameViewGacha .gacha-game .stats {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* 5. 追光抽卡：弹窗遮罩铺满 */
.game-view.active#gameViewGacha .modal-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
}

/* 6. 地球打卡：图片放大 */
.checkin-intro .checkin-rabbit,
.checkin-section .checkin-rabbit {
    max-width: 380px !important;
    width: 80% !important;
}


/* ===== 修复：抽卡统计信息不换行 + 底部矩形遮挡 ===== */

/* 1. 统计信息不换行 */
.game-view.active#gameViewGacha .gacha-game .stats {
    display: flex !important;
    justify-content: center !important;
    gap: 40px !important;
    margin: 16px 0 !important;
}

.game-view.active#gameViewGacha .gacha-game .stat-item {
    text-align: center !important;
    min-width: 60px !important;
}

.game-view.active#gameViewGacha .gacha-game .stat-label {
    white-space: nowrap !important;
    font-size: 12px !important;
}

/* 2. 确保页面背景色一致，没有矩形遮挡 */
.game-view.active#gameViewGacha {
    background: #fff5f7 !important;
    min-height: 0 !important;
    height: auto !important;
}

.game-view.active#gameViewGacha .gacha-game {
    background: transparent !important;
    width: 100% !important;
    min-height: 100% !important;
}

/* 3. 抽卡页面内容垂直居中 */
.game-view.active#gameViewGacha .gacha-game .game {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    min-height: calc(100dvh - 80px) !important;
    padding: 20px 16px !important;
    box-sizing: border-box !important;
    gap: 12px !important;
}

/* 4. 确保按钮完整显示 */
.game-view.active#gameViewGacha .gacha-game .actions {
    width: 100% !important;
    max-width: 320px !important;
    margin-top: 16px !important;
    flex-shrink: 0 !important;
}


/* ===== 最终修复：雨琦冷知识答题页面固定一页，消除遮挡和滚动 ===== */
.game-view.active#gameViewQuiz {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    height: calc(100dvh - 140px) !important;
    min-height: calc(100dvh - 140px) !important;
    max-height: calc(100dvh - 140px) !important;
    overflow: hidden !important;
    padding: 60px 16px 20px !important;
    box-sizing: border-box !important;
    position: relative !important;
}

.game-view.active#gameViewQuiz .quiz-start,
.game-view.active#gameViewQuiz .quiz-play,
.game-view.active#gameViewQuiz .quiz-end {
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 460px !important;
    height: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
    gap: 12px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
}

.game-view.active#gameViewQuiz .quiz-play .quiz-progress {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    font-size: 13px !important;
}

.game-view.active#gameViewQuiz .quiz-play .quiz-question {
    width: 100% !important;
    max-width: 100% !important;
    padding: 16px !important;
    margin: 0 !important;
    font-size: 1rem !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
}

.game-view.active#gameViewQuiz .quiz-play .quiz-options {
    width: 100% !important;
    max-width: 100% !important;
    gap: 8px !important;
    margin: 0 !important;
    flex-shrink: 1 !important;
    overflow-y: auto !important;
    min-height: 0 !important;
}

.game-view.active#gameViewQuiz .quiz-play .quiz-option {
    width: 100% !important;
    min-height: 44px !important;
    padding: 10px 14px !important;
    font-size: 0.95rem !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
}

.game-view.active#gameViewQuiz .quiz-play .quiz-feedback {
    margin: 0 !important;
    min-height: 20px !important;
    flex-shrink: 0 !important;
    font-size: 0.9rem !important;
}

.game-view.active#gameViewQuiz .quiz-start .quiz-title {
    font-size: 1.3rem !important;
    margin-bottom: 4px !important;
}

.game-view.active#gameViewQuiz .quiz-start .quiz-tip {
    margin-bottom: 12px !important;
    font-size: 0.9rem !important;
}

.game-view.active#gameViewQuiz .quiz-start .quiz-badges {
    gap: 12px !important;
    margin-bottom: 12px !important;
}

.game-view.active#gameViewQuiz .quiz-start .quiz-badge {
    width: 90px !important;
    padding: 12px 8px !important;
}

.game-view.active#gameViewQuiz .quiz-start .quiz-badge span {
    font-size: 2rem !important;
}

.game-view.active#gameViewQuiz .quiz-start .quiz-record {
    margin-bottom: 12px !important;
    font-size: 0.85rem !important;
}

.game-view.active#gameViewQuiz .quiz-start-btn,
.game-view.active#gameViewQuiz .quiz-end .quiz-start-btn {
    padding: 12px 32px !important;
    font-size: 1rem !important;
    flex-shrink: 0 !important;
}

/* 返回按钮确保在最上层 */
.game-view.active#gameViewQuiz .back-to-lobby {
    z-index: 9999 !important;
    position: fixed !important;
    top: max(16px, env(safe-area-inset-top)) !important;
    left: 16px !important;
}


/* ===== 最终强制：game-view显隐控制（解决页面串扰） ===== */
.game-view:not(.active) {
    display: none !important;
    visibility: hidden !important;
    z-index: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
.game-view.active {
    display: flex !important;
    visibility: visible !important;
    z-index: 10 !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}


/* ===== 游戏页面统一修复：消除底部色差、固定一页、内容居中 ===== */
.game-view.active {
    background: #fff5f7 !important;
}

/* 确保game-view占满父容器 */
.games-section.active .game-view.active {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    max-height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    overflow: hidden !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

/* 抽卡iframe占满整个容器 */
.games-section.active .game-view.active #gachaFrame.gacha-frame {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    max-height: 100% !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 1 !important;
}

/* 拼图和答题内容在返回按钮下方，有适当间距 */
.games-section.active .game-view.active .puzzle-setup,
.games-section.active .game-view.active .puzzle-play,
.games-section.active .game-view.active .puzzle-leaderboard,
.games-section.active .game-view.active .quiz-start,
.games-section.active .game-view.active .quiz-play,
.games-section.active .game-view.active .quiz-end {
    padding-top: 60px !important;
    padding-bottom: 24px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 460px !important;
    margin: 0 auto !important;
}

/* 返回按钮统一位置 */
.game-view.active .back-to-lobby {
    position: absolute !important;
    top: 16px !important;
    left: 16px !important;
    z-index: 100 !important;
}

/* 游戏内容容器统一 */
.game-view.active > *:not(.back-to-lobby) {
    width: 100% !important;
    max-width: 460px !important;
    margin: 0 auto !important;
}


/* ===== 最终修复：game-view高度由父容器决定，不超出games-section ===== */
.games-section.active .game-view.active {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    width: 100% !important;
    overflow: hidden !important;
}
.games-section.active .game-view.active #gachaFrame {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
}


/* ===== 游戏页面高度修复：具体游戏页面占满整个屏幕，返回按钮悬浮 ===== */
body.game-mode .games-section.active {
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 100 !important;
}
body.game-mode .games-section.active .game-view.active {
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
}


/* 宽屏适配：地球打卡内容垂直居中 */
.globe-page .app-root {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100%;
    height: 100%;
}


/* ===== 拼图参考图弹窗 ===== */
.puzzle-ref-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(102,126,234,0.3);
}
.puzzle-ref-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102,126,234,0.4);
}
.puzzle-ref-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    padding: 20px;
    box-sizing: border-box;
}
.puzzle-ref-content {
    background: white;
    border-radius: 16px;
    padding: 20px;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.puzzle-ref-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}
.puzzle-ref-content img {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 8px;
}
.puzzle-ref-close {
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    color: white;
    border: none;
    padding: 10px 30px;
    border-radius: 12px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s;
}
.puzzle-ref-close:hover {
    transform: translateY(-2px);
}
@media (max-width: 768px) {
    .puzzle-ref-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }
    .puzzle-ref-content {
        padding: 16px;
    }
    .puzzle-ref-content img {
        max-height: 50vh;
    }
}

.puzzle-change-btn {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(245,87,108,0.3);
}
.puzzle-change-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(245,87,108,0.4);
}
@media (max-width: 768px) {
    .puzzle-change-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
}


/* ===== 拼图游戏按钮两行布局 ===== */
.puzzle-actions {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 10px !important;
    margin-top: 16px !important;
    flex-wrap: nowrap !important;
}
.puzzle-actions-row {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.puzzle-action-btn {
    padding: 8px 20px !important;
    border: 1px solid #ddd !important;
    border-radius: 10px !important;
    background: #fff !important;
    color: #666 !important;
    font-size: 0.85rem !important;
    cursor: pointer !important;
    min-width: 100px !important;
    text-align: center !important;
    box-shadow: none !important;
    background-image: none !important;
}
.puzzle-action-btn:hover {
    background: #f8f8f8 !important;
    transform: translateY(-1px) !important;
}


/* ===== 答题游戏页面高度修复：不需要banner留白，全屏居中 ===== */
.game-view#gameViewQuiz.active {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    min-height: 100dvh !important;
    height: 100dvh !important;
    padding: 20px 16px !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
}

/* 游戏模式下重置games-section的padding，避免内容被推下去 */
body.game-mode .games-section {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* 答题开始页和游戏页都垂直居中 */
.game-view#gameViewQuiz .quiz-start,
.game-view#gameViewQuiz .quiz-play,
.game-view#gameViewQuiz .quiz-end {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

/* 移动端答题页面优化：垂直居中，紧凑间距 */
@media (max-width: 768px) {
    .game-view#gameViewQuiz.active {
        padding: 50px 12px 20px !important;
        justify-content: center !important;
        align-items: center !important;
    }
    .game-view#gameViewQuiz .quiz-start {
        padding-top: 0;
    }
    .game-view#gameViewQuiz .quiz-title {
        font-size: 1.2rem !important;
        margin-bottom: 10px !important;
    }
    .game-view#gameViewQuiz .quiz-tip {
        font-size: 0.85rem !important;
        margin-bottom: 14px !important;
    }
    .game-view#gameViewQuiz .quiz-badges {
        gap: 8px !important;
        margin-bottom: 14px !important;
    }
    .game-view#gameViewQuiz .quiz-badge {
        padding: 10px 6px !important;
    }
    .game-view#gameViewQuiz .quiz-badge span {
        font-size: 1.5rem !important;
    }
    .game-view#gameViewQuiz .quiz-badge p {
        font-size: 0.7rem !important;
    }
    .game-view#gameViewQuiz .quiz-question {
        padding: 14px !important;
        font-size: 0.95rem !important;
        margin-bottom: 12px !important;
    }
    .game-view#gameViewQuiz .quiz-option {
        padding: 10px 14px !important;
        font-size: 0.85rem !important;
        margin-bottom: 8px !important;
    }
    .game-view#gameViewQuiz .quiz-progress {
        margin-bottom: 10px !important;
        font-size: 0.8rem !important;
    }
    .game-view#gameViewQuiz .quiz-start-btn {
        margin-top: 14px !important;
        padding: 10px 24px !important;
        font-size: 0.95rem !important;
    }
    .game-view#gameViewQuiz .quiz-feedback {
        margin-top: 8px !important;
        font-size: 0.85rem !important;
    }
}


/* 表单小提示 */
.form-tip {
    text-align: center;
    font-size: 12px;
    color: #ff6b6b;
    margin-top: 6px;
    opacity: 0.8;
}


/* 最高优先级：选中的便签绝对在最上层 */
.wall-note.active,
.wall-note.active.heart-note {
    z-index: 9999 !important;
}


/* 强制：查看所有留言列表网页端70%居中，移动端100% */
#messageListArea,
#messageListScroll,
#messageList {
    max-width: 100% !important;
}
@media (min-width: 768px) {
    #messageListArea {
        max-width: 70% !important;
        margin: 0 auto !important;
        padding: 0 20px !important;
    }
}


/* 修复：留言墙容器不裁剪便签，所有便签完整显示 */
#wallNotes,
.wall-container {
    overflow: visible !important;
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
    left: 0 !important;
    transform: none !important;
    margin: 0 !important;
    padding: 0 !important;
}


/* 强制：留言墙section完全占满宽度，左右没有多余空白 */
section#messages,
#messages {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}
#wallNotes {
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}



/* 最高优先级：图钉大小10px，完整显示，不裁剪 */
#wallNotes .wall-note .note-pin,
.wall-view .wall-note .note-pin {
    width: 10px !important;
    height: 10px !important;
    top: -5px !important;
    overflow: visible !important;
    display: block !important;
}
/* 确保所有容器都不裁掉图钉 */
.wall-view,
#wallNotes,
#wallView {
    overflow: visible !important;
}


/* 强制图钉8px，完整显示 */
#wallNotes .wall-note .note-pin,
.wall-view .wall-note .note-pin,
.wall-note .note-pin {
    width: 8px !important;
    height: 8px !important;
    top: -3px !important;
    overflow: visible !important;
    display: block !important;
}
.wall-note {
    overflow: visible !important;
}


/* 恢复图钉原本的圆形带针脚样式，整体缩小到8px */
.wall-note .note-pin {
    width: 8px !important;
    height: 8px !important;
    top: -4px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    border-radius: 50% !important;
    background: radial-gradient(circle at 32% 28%, #ff8a8a 0%, #e23a3a 35%, #c11e1e 65%, #8b0a3d 100%) !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3), inset 1px 1px 2px rgba(255,255,255,0.5) !important;
}
.wall-note .note-pin::before {
    width: 2px !important;
    height: 2px !important;
    top: 1px !important;
    left: 1px !important;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.85) 0%, transparent 70%) !important;
}
.wall-note .note-pin::after {
    width: 4px !important;
    height: 4px !important;
    bottom: -2px !important;
    left: 50% !important;
    transform: translateX(-50%) rotate(45deg) !important;
    background: linear-gradient(135deg, #8b0a3d 0%, #5a0527 50%, #3d0318 100%) !important;
    border-radius: 1px !important;
}


/* 最终版：小图钉，覆盖所有旧样式 */
* .wall-note .note-pin {
    all: unset !important;
    position: absolute !important;
    width: 8px !important;
    height: 8px !important;
    top: -4px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    border-radius: 50% !important;
    background: radial-gradient(circle at 32% 28%, #ff8a8a 0%, #e23a3a 35%, #c11e1e 65%, #8b0a3d 100%) !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3), inset 1px 1px 2px rgba(255,255,255,0.5) !important;
    z-index: 5 !important;
}
* .wall-note .note-pin::before {
    all: unset !important;
    content: '' !important;
    position: absolute !important;
    width: 2px !important;
    height: 2px !important;
    top: 1px !important;
    left: 1px !important;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.85) 0%, transparent 70%) !important;
    border-radius: 50% !important;
}
* .wall-note .note-pin::after {
    all: unset !important;
    content: '' !important;
    position: absolute !important;
    width: 4px !important;
    height: 4px !important;
    bottom: -2px !important;
    left: 50% !important;
    transform: translateX(-50%) rotate(45deg) !important;
    background: linear-gradient(135deg, #8b0a3d 0%, #5a0527 50%, #3d0318 100%) !important;
    border-radius: 1px !important;
    z-index: -1 !important;
}


/* 最终版：纯红色小圆点图钉，没有多余针脚 */
* .wall-note .note-pin {
    all: unset !important;
    position: absolute !important;
    width: 8px !important;
    height: 8px !important;
    top: -4px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    border-radius: 50% !important;
    background: radial-gradient(circle at 32% 28%, #ff8a8a 0%, #e23a3a 35%, #c11e1e 65%, #8b0a3d 100%) !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3) !important;
    z-index: 5 !important;
}
* .wall-note .note-pin::before,
* .wall-note .note-pin::after {
    content: none !important;
    display: none !important;
}


/* 图钉位置往下挪，刚好在便签顶部 */
* .wall-note .note-pin {
    top: 0px !important;
}


/* 调整弹窗贴纸：在内容最末尾右对齐，长留言不卡中间 */
.note-modal-card {
    padding: 32px 28px 32px !important;
}
.note-modal-gigi {
    position: static !important;
    display: block !important;
    margin: 16px 0 0 auto !important;
    width: 56px !important;
    height: 56px !important;
    border-radius: 50% !important;
    border: 3px solid #fff !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2) !important;
    background: #fff !important;
    object-fit: cover !important;
    pointer-events: none !important;
}
