/* ===== 全局重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    height: 100dvh; /* 移动端适配：动态视口高度 */
    overflow: hidden;
    background: #0a0a0f;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    color: #fff;
    touch-action: none; /* 禁止默认触摸行为（缩放、滚动） */
    -webkit-tap-highlight-color: transparent; /* 去除触摸高亮 */
    -webkit-touch-callout: none; /* 禁止长按菜单 */
    user-select: none; /* 禁止文本选择 */
}

/* ===== 粒子画布 ===== */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* ===== 摄像头预览 ===== */
.camera-preview {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 160px;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.2);
    z-index: 100;
    background: rgba(0,0,0,0.5);
    transition: all 0.3s ease;
}

.camera-preview:hover {
    transform: scale(1.05);
    border-color: rgba(255,255,255,0.5);
}

#previewCanvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-status {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 4px 8px;
    font-size: 11px;
    text-align: center;
    background: rgba(0,0,0,0.7);
    color: #aaa;
}

/* ===== 场景切换器 ===== */
.scene-switcher {
    position: fixed;
    top: 16px;
    left: 16px;
    display: flex;
    gap: 8px;
    z-index: 100;
}

.scene-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    background: rgba(0,0,0,0.4);
    color: #aaa;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.scene-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.4);
    color: #fff;
}

.scene-btn.active {
    border-color: var(--scene-color, #00ffff);
    color: var(--scene-color, #00ffff);
    background: rgba(255,255,255,0.1);
    box-shadow: 0 0 15px var(--scene-glow, rgba(0,255,255,0.3));
}

.scene-icon {
    font-size: 20px;
}

.scene-label {
    font-size: 11px;
}

/* ===== 主标题 ===== */
.main-title {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    pointer-events: none;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.main-title.hidden {
    opacity: 0;
    transform: translate(-50%, -60%);
}

.main-title h1 {
    font-size: clamp(36px, 8vw, 72px);
    font-weight: 200;
    letter-spacing: 0.2em;
    background: linear-gradient(135deg, #fff 0%, var(--scene-color, #00ffff) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 40px var(--scene-glow, rgba(0,255,255,0.3));
    margin-bottom: 12px;
}

.main-title .subtitle {
    font-size: clamp(14px, 2.5vw, 18px);
    color: rgba(255,255,255,0.6);
    letter-spacing: 0.1em;
}

/* ===== 手势指引 ===== */
.gesture-guide {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 10;
    transition: opacity 0.5s ease;
}

.gesture-guide.hidden {
    opacity: 0;
    pointer-events: none;
}

.guide-animation {
    width: 80px;
    height: 80px;
    position: relative;
}

.hand-icon {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 10px auto;
}

.finger {
    position: absolute;
    width: 8px;
    background: rgba(255,255,255,0.8);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.finger.thumb {
    height: 20px;
    left: 4px;
    top: 30px;
    transform: rotate(-30deg);
    transform-origin: bottom;
    animation: thumbMove 2s ease-in-out infinite;
}

.finger.index {
    height: 28px;
    left: 20px;
    top: 4px;
    transform-origin: bottom;
    animation: indexMove 2s ease-in-out infinite;
}

.finger.middle {
    height: 26px;
    left: 30px;
    top: 6px;
}

.finger.ring {
    height: 24px;
    left: 40px;
    top: 8px;
}

.finger.pinky {
    height: 20px;
    left: 50px;
    top: 12px;
}

@keyframes thumbMove {
    0%, 100% { transform: rotate(-30deg); }
    50% { transform: rotate(-10deg) translate(8px, -4px); }
}

@keyframes indexMove {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(15deg) translate(-4px, 4px); }
}

.guide-text {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    white-space: nowrap;
}

/* ===== 捏合进度 ===== */
.pinch-progress {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.pinch-progress.active {
    opacity: 1;
}

.progress-ring {
    width: 100px;
    height: 100px;
    position: relative;
}

.progress-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-bg {
    fill: none;
    stroke: rgba(255,255,255,0.1);
    stroke-width: 4;
}

.progress-fill {
    fill: none;
    stroke: var(--scene-color, #00ffff);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 0.1s ease;
    filter: drop-shadow(0 0 6px var(--scene-glow, rgba(0,255,255,0.5)));
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    font-weight: 300;
    color: var(--scene-color, #00ffff);
}

/* ===== 塔罗牌展示层 ===== */
.tarot-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 100px;
    padding-bottom: 40px;
    z-index: 50;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.tarot-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.tarot-card-container {
    perspective: 1000px;
    margin-bottom: 24px;
}

.tarot-card {
    width: 160px;
    height: 260px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.tarot-card.flipped {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(0,0,0,0.5);
}

.card-back {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    transform: rotateY(0deg);
    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 12px;
    overflow: hidden;
    box-shadow:
        inset 0 0 20px rgba(0,0,0,0.5),
        0 0 14px rgba(0,0,0,0.3);
}

.card-front {
    transform: rotateY(180deg);
    border: 2px solid var(--scene-color, rgba(255,255,255,0.3));
    border-radius: 12px;
    overflow: hidden;
    box-shadow:
        inset 0 0 20px rgba(0,0,0,0.3),
        0 0 20px var(--scene-glow, rgba(0,255,255,0.2));
}

/* 牌面信息覆盖层 */
.card-info-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 8px;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
    text-align: center;
}

.card-number {
    font-size: 9px;
    color: rgba(255,255,255,0.6);
    margin-bottom: 1px;
    font-family: 'Georgia', serif;
}

.card-name {
    font-size: 13px;
    font-weight: 500;
    color: #fff;
    margin-bottom: 1px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

.card-orientation {
    font-size: 10px;
    padding: 1px 8px;
    border-radius: 8px;
    display: inline-block;
}

.card-orientation.upright {
    background: rgba(100, 255, 100, 0.2);
    color: #6f6;
}

.card-orientation.reversed {
    background: rgba(255, 100, 100, 0.2);
    color: #f66;
}

/* ===== 牌面解读 ===== */
.card-reading {
    max-width: 640px;
    padding: 0 32px;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease 0.4s;
    max-height: 35vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.card-reading::-webkit-scrollbar {
    width: 4px;
}

.card-reading::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
}

.tarot-overlay.active .card-reading {
    opacity: 1;
    transform: translateY(0);
}

.card-reading h3 {
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--scene-color, #fff);
}

.reading-keywords {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-bottom: 16px;
}

.reading-keywords span {
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 12px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
}

.reading-text {
    font-size: 14px;
    line-height: 1.8;
    color: rgba(255,255,255,0.8);
    margin-bottom: 12px;
}

.reading-advice {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    font-style: italic;
    border-left: 2px solid var(--scene-color, rgba(255,255,255,0.3));
    padding-left: 12px;
    text-align: left;
}

/* ===== 关闭按钮 ===== */
.close-btn {
    margin-top: 24px;
    padding: 10px 28px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 24px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.close-btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: var(--scene-color, rgba(255,255,255,0.5));
    box-shadow: 0 0 20px var(--scene-glow, rgba(0,255,255,0.2));
}

/* ===== 调试信息 ===== */
.debug-info {
    position: fixed;
    bottom: 12px;
    left: 16px;
    display: flex;
    gap: 16px;
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    z-index: 100;
    font-family: 'Consolas', monospace;
}

/* ===== 场景配色变量 ===== */
body[data-scene="cyber"] {
    --scene-color: #00ffff;
    --scene-glow: rgba(0, 255, 255, 0.4);
}

body[data-scene="classical"] {
    --scene-color: #ffd700;
    --scene-glow: rgba(255, 215, 0, 0.4);
}

body[data-scene="pixel"] {
    --scene-color: #00ff88;
    --scene-glow: rgba(0, 255, 136, 0.4);
}

body[data-scene="oriental"] {
    --scene-color: #ff6b6b;
    --scene-glow: rgba(255, 107, 107, 0.4);
}

/* ===== 动画 ===== */
@keyframes cardAppear {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(50px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.tarot-card-container {
    animation: cardAppear 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-only {
    display: none;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    /* 用户栏 - 左上角紧凑排列 */
    .user-bar {
        position: fixed;
        top: 8px;
        left: 8px;
        right: auto;
        transform: none;
        gap: 6px;
        padding: 5px 10px;
        border-radius: 20px;
        z-index: 101;
    }
    .user-name {
        display: none;
    }
    .user-coins {
        font-size: 11px;
    }
    .check-in-btn {
        padding: 3px 8px;
        font-size: 10px;
    }
    .login-btn {
        padding: 3px 8px;
        font-size: 10px;
    }
    .camera-toggle-btn {
        padding: 3px 6px;
        font-size: 13px;
    }

    /* 场景切换 - 放在用户栏下方，横向紧凑 */
    .scene-switcher {
        top: 50px;
        left: 8px;
        gap: 4px;
        flex-wrap: wrap;
        max-width: calc(100% - 120px);
    }
    .scene-btn {
        padding: 4px 8px;
        border-radius: 8px;
    }
    .scene-icon {
        font-size: 14px;
    }
    .scene-label {
        font-size: 10px;
    }

    /* 摄像头预览 - 右上角 */
    .camera-preview {
        width: 80px;
        height: 60px;
        top: 8px;
        right: 8px;
        border-radius: 8px;
        border-width: 1px;
    }
    .camera-status {
        font-size: 8px;
        padding: 2px 4px;
    }

    /* 主标题 - 上移避免和下方元素重叠 */
    .main-title {
        top: 42%;
    }
    .main-title h1 {
        font-size: 24px;
        margin-bottom: 8px;
    }
    .main-title .subtitle {
        font-size: 12px;
    }

    /* 手势指引 */
    .gesture-guide {
        bottom: auto;
        top: 58%;
        padding: 0 16px;
    }
    .guide-text {
        font-size: 11px;
        white-space: normal;
        text-align: center;
        line-height: 1.4;
    }

    /* 牌阵选择 - 底部横向滑动 */
    .spread-selector {
        position: fixed;
        top: auto;
        bottom: 16px;
        left: 8px;
        right: 8px;
        transform: none;
        flex-direction: row;
        gap: 8px;
        justify-content: center;
        flex-wrap: wrap;
        z-index: 10;
    }
    .spread-card {
        width: auto;
        min-width: 90px;
        flex: 1;
        max-width: 120px;
        padding: 10px 8px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        text-align: center;
    }
    .spread-icon {
        font-size: 20px;
        margin-bottom: 4px;
    }
    .spread-name {
        font-size: 12px;
        margin-bottom: 2px;
    }
    .spread-desc {
        display: none;
    }
    .spread-cost {
        font-size: 10px;
    }

    /* 塔罗牌展示 */
    .tarot-overlay {
        padding-top: 110px;
        padding-bottom: 20px;
    }
    .tarot-card {
        width: 120px;
        height: 195px;
    }
    .card-name {
        font-size: 16px;
    }
    .card-reading {
        max-width: 90vw;
        padding: 12px;
        max-height: 40vh;
    }
    .card-reading h3 {
        font-size: 16px;
    }

    /* 多张牌 */
    .multi-cards {
        gap: 8px;
        padding: 0 10px;
    }
    .multi-card-img {
        width: 55px;
        height: 90px;
    }
    .multi-card-label {
        font-size: 9px;
    }

    /* 结果操作按钮 */
    .result-actions {
        flex-direction: column;
        gap: 8px;
        width: 90vw;
    }
    .result-actions .action-btn {
        width: 100%;
    }

    /* 弹窗 */
    .modal-content {
        width: 95%;
        max-width: 95vw;
        max-height: 85vh;
        border-radius: 16px;
    }
    .modal-content.small {
        max-width: 95vw;
    }
    .modal-header {
        padding: 16px 20px 0;
    }
    .modal-header h3 {
        font-size: 16px;
    }
    .modal-body {
        padding: 16px 20px;
    }

    /* 侧边菜单 - 移到左侧 */
    .side-menu {
        left: 8px;
        right: auto;
        top: auto;
        bottom: 120px;
        transform: none;
        gap: 6px;
        flex-direction: row;
    }
    .side-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    /* 收藏册 */
    .collection-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    .collection-symbol {
        font-size: 18px;
    }

    /* 排行榜 */
    .leader-item {
        padding: 8px 12px;
    }
    .leader-name {
        font-size: 12px;
    }

    /* 签到弹窗 */
    .checkin-content {
        max-width: 100%;
    }
    .calendar-grid {
        gap: 4px;
    }
    .calendar-day {
        padding: 6px 2px;
    }

    .pc-only {
        display: none;
    }

    /* 调试信息 */
    .debug-info {
        display: none;
    }

    /* 登录/注册弹窗 */
    .auth-tabs {
        gap: 4px;
    }
    .auth-tab {
        padding: 8px;
        font-size: 13px;
    }
}

/* 更小屏幕 */
@media (max-width: 380px) {
    .main-title h1 {
        font-size: 20px;
    }
    .main-title .subtitle {
        font-size: 11px;
    }
    .spread-card {
        min-width: 80px;
        padding: 8px 6px;
    }
    .spread-icon {
        font-size: 18px;
    }
    .spread-name {
        font-size: 11px;
    }
    .tarot-card {
        width: 100px;
        height: 162px;
    }
    .collection-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .side-menu {
        bottom: 110px;
    }
}

/* ===== 用户栏 ===== */
.user-bar {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 20px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 30px;
    backdrop-filter: blur(10px);
    z-index: 100;
    transition: all 0.3s;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.user-info:hover {
    opacity: 0.8;
}

.user-avatar {
    font-size: 24px;
}

.user-name {
    font-size: 14px;
    color: #fff;
    font-weight: 500;
}

.user-coins {
    font-size: 14px;
    color: #ffd700;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(255,215,0,0.3);
}

.check-in-btn {
    padding: 6px 14px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 16px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.check-in-btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: var(--scene-color, rgba(255,255,255,0.4));
}

.check-in-btn.has-reward {
    animation: pulse 2s infinite;
    border-color: #ffd700;
    color: #ffd700;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,215,0,0.4); }
    50% { box-shadow: 0 0 0 8px rgba(255,215,0,0); }
}

.admin-link {
    color: rgba(255,255,255,0.5);
    text-decoration: none;
    font-size: 16px;
    transition: all 0.3s;
}

.admin-link:hover {
    color: var(--scene-color, #fff);
}

/* ===== 牌阵选择器 ===== */
.spread-selector {
    position: fixed;
    top: 72%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 16px;
    z-index: 10;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.spread-selector.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -60%);
}

.spread-card {
    width: 160px;
    padding: 20px 16px;
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.spread-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255,255,255,0.3);
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.04) 100%);
}

.spread-card.active {
    border-color: var(--scene-color, #00ffff);
    box-shadow: 0 0 20px var(--scene-glow, rgba(0,255,255,0.2));
}

.spread-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.spread-name {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.spread-desc {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    margin-bottom: 8px;
}

.spread-cost {
    font-size: 12px;
    color: #ffd700;
    font-weight: 500;
}

.spread-cost.free {
    color: #00ff88;
}

.free-left {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
}

/* ===== 侧边菜单 ===== */
.side-menu {
    position: fixed;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 100;
}

.side-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(0,0,0,0.4);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.side-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--scene-color, rgba(255,255,255,0.4));
    transform: scale(1.1);
}

/* ===== 多张牌展示 ===== */
.multi-cards {
    display: none;
    gap: 16px;
    justify-content: center;
    align-items: flex-start;
    margin-bottom: 20px;
    flex-wrap: wrap;
    max-width: 90vw;
}

.multi-card-wrapper {
    text-align: center;
    animation: cardAppear 0.5s ease backwards;
}

.multi-card-wrapper:nth-child(1) { animation-delay: 0s; }
.multi-card-wrapper:nth-child(2) { animation-delay: 0.15s; }
.multi-card-wrapper:nth-child(3) { animation-delay: 0.3s; }

.multi-card-label {
    font-size: 10px;
    color: var(--scene-color, #fff);
    margin-bottom: 4px;
    font-weight: 500;
}

.multi-card-img {
    width: 85px;
    height: 140px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 3px 14px rgba(0,0,0,0.5);
    transition: all 0.3s;
}

.multi-card-wrapper:hover .multi-card-img {
    transform: translateY(-3px);
    box-shadow: 0 5px 18px rgba(0,0,0,0.6);
}

.multi-card-name {
    font-size: 9px;
    color: rgba(255,255,255,0.7);
    margin-top: 4px;
}

/* ===== 结果操作按钮 ===== */
.result-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease 0.6s;
}

.result-actions .action-btn {
    margin-top: 0;
    padding: 10px 24px;
    font-size: 14px;
    min-width: 110px;
    text-align: center;
}

.tarot-overlay.active .result-actions {
    opacity: 1;
    transform: translateY(0);
}

.action-btn {
    padding: 10px 24px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 24px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

/* 金币弹窗按钮统一宽度 */
.coins-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.coins-actions .action-btn {
    width: 200px;
    margin: 0 auto;
}

/* 广告进度条 */
.ad-progress {
    width: 100%;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
    margin: 20px 0;
}

.ad-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--scene-color, #00ffff), #0088ff);
    border-radius: 4px;
    width: 0%;
    transition: width 0.1s linear;
}

.action-btn:hover {
    background: rgba(255,255,255,0.2);
    border-color: var(--scene-color, rgba(255,255,255,0.5));
    box-shadow: 0 0 20px var(--scene-glow, rgba(0,255,255,0.2));
}

.share-btn {
    background: rgba(0,255,136,0.15);
    border-color: rgba(0,255,136,0.3);
    color: #00ff88;
}

.share-btn:hover {
    background: rgba(0,255,136,0.25);
}

/* ===== 弹窗系统 ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: linear-gradient(135deg, rgba(20,20,35,0.95) 0%, rgba(10,10,20,0.95) 100%);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 20px;
    width: 90%;
    max-width: 520px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-content.small {
    max-width: 360px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 0;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 500;
}

.modal-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-close:hover {
    color: #fff;
}

.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-body.center {
    text-align: center;
}

/* ===== 收藏册 ===== */
.collection-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.collection-item {
    aspect-ratio: 3/4;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.3s;
}

.collection-item.collected {
    background: rgba(0,255,255,0.05);
    border-color: rgba(0,255,255,0.2);
}

.collection-item.locked {
    background: rgba(255,255,255,0.02);
    opacity: 0.4;
}

.collection-symbol {
    font-size: 24px;
}

.collection-card-name {
    font-size: 11px;
    color: rgba(255,255,255,0.7);
}

.collection-count {
    font-size: 10px;
    color: var(--scene-color, #00ffff);
}

.progress-bar-outer {
    background: rgba(255,255,255,0.05);
    height: 12px;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar-inner {
    background: linear-gradient(90deg, var(--scene-color, #00ffff), #0088ff);
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s;
}

/* ===== 成就列表 ===== */
.achievement-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.achieve-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    transition: all 0.3s;
}

.achieve-item.unlocked {
    border-color: rgba(0,255,255,0.3);
    background: rgba(0,255,255,0.05);
}

.achieve-icon {
    font-size: 28px;
}

.achieve-info {
    flex: 1;
}

.achieve-name {
    font-size: 14px;
    font-weight: 500;
}

.achieve-desc {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
}

.achieve-reward {
    font-size: 12px;
    color: #ffd700;
}

.achieve-badge {
    color: #00ff88;
    font-size: 18px;
}

/* ===== 排行榜 ===== */
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.leader-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
    transition: all 0.3s;
}

.leader-item.is-me {
    background: rgba(0,255,255,0.08);
    border: 1px solid rgba(0,255,255,0.2);
}

.leader-rank {
    width: 32px;
    text-align: center;
    font-size: 16px;
}

.leader-avatar {
    font-size: 20px;
}

.leader-name {
    flex: 1;
    font-size: 14px;
}

.leader-coins {
    font-size: 13px;
    color: #ffd700;
    font-weight: 500;
}

/* ===== 签到 ===== */
.checkin-content {
    max-width: 380px;
}

.checkin-reward {
    text-align: center;
    padding: 20px;
}

.checkin-done {
    font-size: 24px;
    color: #00ff88;
}

.checkin-ready {
    font-size: 20px;
    color: #ffd700;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-top: 16px;
}

.calendar-day {
    text-align: center;
    padding: 8px 4px;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
}

.calendar-day.past {
    opacity: 0.4;
}

.calendar-day.today {
    border-color: var(--scene-color, #00ffff);
    background: rgba(255,255,255,0.08);
}

.calendar-day.checked {
    border-color: #00ff88;
    background: rgba(0,255,136,0.1);
}

.day-label {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
    margin-bottom: 4px;
}

.day-reward {
    font-size: 12px;
    color: var(--scene-color, #fff);
    font-weight: 500;
}

.checkin-action-btn {
    width: 100%;
    padding: 12px;
    margin-top: 16px;
    border: 1px solid var(--scene-color, rgba(255,255,255,0.3));
    border-radius: 12px;
    background: var(--scene-color, rgba(255,255,255,0.1));
    color: #000;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.checkin-action-btn:hover {
    opacity: 0.8;
    transform: scale(1.02);
}

/* ===== 头像选择器 ===== */
.avatar-selector {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.avatar-option {
    font-size: 32px;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.avatar-option:hover {
    background: rgba(255,255,255,0.1);
}

.avatar-option.selected {
    border-color: var(--scene-color, #00ffff);
    background: rgba(255,255,255,0.1);
}

.name-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    color: #fff;
    font-size: 16px;
    margin-bottom: 16px;
    outline: none;
}

.name-input:focus {
    border-color: var(--scene-color, rgba(255,255,255,0.5));
}

/* ===== Toast ===== */
.toast-container {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    pointer-events: none;
}

.toast {
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    color: #fff;
    background: rgba(0,0,0,0.8);
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    transform: translateY(-20px);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 320px;
    text-align: center;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-success { border-color: rgba(0,255,136,0.4); background: rgba(0,255,136,0.15); }
.toast-error { border-color: rgba(255,100,100,0.4); background: rgba(255,100,100,0.15); }
.toast-achievement { border-color: rgba(255,215,0,0.4); background: rgba(255,215,0,0.15); color: #ffd700; }
.toast-info { border-color: rgba(0,200,255,0.4); background: rgba(0,200,255,0.15); }
.toast-warning { border-color: rgba(255,200,0,0.4); background: rgba(255,200,0,0.15); color: #ffd700; }

/* ===== 登录按钮 ===== */
.login-btn {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.8);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    margin-left: 8px;
}
.login-btn:hover {
    background: rgba(0,255,255,0.15);
    border-color: rgba(0,255,255,0.3);
    color: #00ffff;
}

/* 摄像头切换按钮 */
.camera-toggle-btn {
    padding: 6px 10px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.6);
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    margin-left: 4px;
}
.camera-toggle-btn:hover {
    background: rgba(0,255,136,0.15);
    border-color: rgba(0,255,136,0.3);
    color: #00ff88;
}
.camera-toggle-btn.active {
    background: rgba(0,255,136,0.2);
    border-color: rgba(0,255,136,0.4);
    color: #00ff88;
}

/* ===== 登录/注册弹窗 ===== */
.auth-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.auth-tab {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.03);
    color: rgba(255,255,255,0.6);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}
.auth-tab.active {
    background: rgba(0,255,255,0.1);
    border-color: rgba(0,255,255,0.3);
    color: #00ffff;
}
.auth-panel {
    display: none;
}
.auth-panel.active {
    display: block;
}
