/* ===== KidsHub 主题大厅样式 ===== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    overflow: hidden;
}

.hall {
    --hall-text: #ffffff;
    --sweep-glow: rgba(255, 255, 255, 0.55);
    position: relative;
    width: 100%;
    height: 100%;
    color: var(--hall-text);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 大厅页左右布局（仅大厅使用，其他页面保持纵向） */
.hall.hall-row {
    flex-direction: row;
}

/* ===== 主题背景（魔法淡粉 / 太空深蓝） ===== */
.hall-magic {
    --hall-text: #5c1f30;
    --sweep-glow: rgba(255, 255, 255, 0.9);
    background:
        radial-gradient(ellipse at 70% 12%, rgba(255, 255, 255, 0.4) 0%, transparent 42%),
        radial-gradient(ellipse at 22% 85%, rgba(255, 170, 190, 0.55) 0%, transparent 50%),
        radial-gradient(ellipse at 30% 20%, #ffe2e9 0%, #ffb9c6 48%, #ff9eb5 100%);
}

.hall-space {
    background:
        radial-gradient(ellipse at 72% 22%, #14305e 0%, #0a1a3a 45%, #04070f 100%);
}

.hall-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* ===== 大厅左右布局：左侧导航栏 ===== */
.hall-side {
    position: relative;
    z-index: 2;
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding: 28px 20px 24px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(14px);
    border-right: 1px solid rgba(255, 255, 255, 0.14);
}

.hall-side-user {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 6px 6px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.hall-side-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hall-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px 0;
}

.hall-menu-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 16px;
    text-decoration: none;
    color: var(--hall-text);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: background 0.3s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
}

.hall-menu-item::before {
    content: '';
    position: absolute;
    left: -1px;
    top: 20%;
    height: 60%;
    width: 4px;
    border-radius: 4px;
    background: transparent;
    transition: background 0.3s ease;
}

.hall-menu-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(4px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

.hall-menu-item:hover::before {
    background: #fff;
}

.hall-menu-item.active {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.34);
}

.hall-menu-item.active::before {
    background: #fff;
}

.hall-menu-icon {
    font-size: 2rem;
    line-height: 1;
    transition: transform 0.3s ease;
}

.hall-menu-item:hover .hall-menu-icon {
    transform: translateY(-3px) scale(1.08);
}

.hall-menu-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.hall-menu-name {
    font-size: 1.25rem;
    letter-spacing: 0.04em;
}

.hall-menu-desc {
    font-size: 0.82rem;
    opacity: 0.72;
    letter-spacing: 0.03em;
}

.hall-side-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    color: var(--hall-text);
    text-decoration: none;
    font-size: 1rem;
    letter-spacing: 0.05em;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.1);
    transition: background 0.3s ease, transform 0.3s ease;
}

.hall-side-back:hover {
    background: rgba(255, 255, 255, 0.24);
    transform: translateX(-3px);
}

/* ===== 大厅左右布局：右侧内容区 ===== */
.hall-main {
    position: relative;
    z-index: 2;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 40px 48px 48px;
    overflow-y: auto;
}

.hall-main .hall-title {
    text-align: left;
    margin-top: 0;
    font-size: 3rem;
}

.hall-main .hall-subtitle {
    text-align: left;
    margin-top: 0.5rem;
}

.hall-hero {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.hall-hero-badge {
    padding: 12px 22px;
    border-radius: 26px;
    font-size: 1.05rem;
    letter-spacing: 0.04em;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    white-space: nowrap;
}

.hall-hero-badge b {
    font-weight: 600;
    font-size: 1.3rem;
}

/* ===== 大厅右侧：iframe 模块内容区 ===== */
.hall-frame-wrap {
    position: relative;
    z-index: 2;
    flex: 1;
    min-height: 0;
    margin-top: 24px;
}

.hall-frame {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 20px;
    background: transparent;
}

/* ===== embed 模式（iframe 内嵌模块页：透明背景 + 可滚动 + 标题紧凑） ===== */
.hall.hall-embed {
    background: transparent;
    overflow-y: auto;
}

.hall.hall-embed .hall-title {
    margin-top: 0.4rem;
    font-size: 2.2rem;
}

.hall.hall-embed .hall-subtitle {
    margin-top: 0.3rem;
}

/* ===== 公用扫光：hover 一道斜向亮光从左扫到右 ===== */
.sweep {
    position: relative;
    overflow: hidden;
}

.sweep::after {
    content: '';
    position: absolute;
    top: -20%;
    left: -80%;
    width: 55%;
    height: 140%;
    background: linear-gradient(105deg, transparent 15%, var(--sweep-glow) 50%, transparent 85%);
    transform: skewX(-20deg);
    pointer-events: none;
    transition: left 1.4s ease;
}

.sweep:hover::after {
    left: 140%;
}

/* ===== 顶部栏 ===== */
.hall-top {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 34px;
}

.hall-back {
    color: var(--hall-text);
    text-decoration: none;
    font-size: 1.05rem;
    letter-spacing: 0.05em;
    padding: 8px 16px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(6px);
    transition: background 0.3s ease, transform 0.3s ease;
}

.hall-back:hover {
    background: rgba(255, 255, 255, 0.32);
    transform: translateX(-3px);
}

.hall-user {
    display: flex;
    align-items: center;
    gap: 14px;
}

.hall-avatar {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 500;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 18px rgba(255, 255, 255, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hall-avatar:hover {
    transform: scale(1.06);
    box-shadow: 0 0 24px rgba(255, 255, 255, 0.4);
}

.hall-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hall-avatar::after {
    content: '📷';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.hall-avatar:hover::after {
    opacity: 1;
}

.hall-magic .hall-avatar {
    background: rgba(255, 150, 180, 0.45);
}

.hall-space .hall-avatar {
    background: rgba(55, 138, 221, 0.4);
}

.hall-name {
    font-size: 1.25rem;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}

.hall-score {
    display: flex;
    gap: 10px;
}

.score-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9rem;
    opacity: 0.95;
}

.score-item i {
    font-style: normal;
    font-size: 0.95rem;
}

.score-item b {
    font-weight: 500;
}

/* ===== 主标题 ===== */
.hall-title {
    position: relative;
    z-index: 2;
    text-align: center;
    font-size: 3.2rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    margin-top: 2.5rem;
}

.hall-magic .hall-title {
    text-shadow: 0 2px 10px rgba(190, 70, 100, 0.5), 0 0 32px rgba(255, 182, 193, 0.85);
}

.hall-space .hall-title {
    text-shadow: 0 0 28px rgba(133, 183, 235, 0.7);
}

.hall-subtitle {
    position: relative;
    z-index: 2;
    text-align: center;
    margin-top: 0.6rem;
    font-size: 1.05rem;
    letter-spacing: 0.12em;
    opacity: 0.85;
}

/* ===== 模块入口卡片 ===== */
.hall-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 26px;
    max-width: 1080px;
    width: 100%;
    margin: auto;
    padding: 0 34px 40px;
}

.hall-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 34px 16px;
    text-decoration: none;
    color: var(--hall-text);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), background 0.3s ease, box-shadow 0.3s ease;
}

.hall-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.26);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.2);
}

.hall-icon {
    font-size: 3rem;
    line-height: 1;
}

.hall-card-name {
    font-size: 1.3rem;
    letter-spacing: 0.06em;
}

.hall-card-desc {
    font-size: 0.85rem;
    opacity: 0.78;
    letter-spacing: 0.04em;
}

/* ===== 游戏大厅：卡片网格 ===== */
.game-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
    max-width: 1240px;
    width: 100%;
    margin: auto;
    padding: 0 34px 40px;
}

.game-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 46px 20px;
    text-decoration: none;
    color: var(--hall-text);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), background 0.3s ease, box-shadow 0.3s ease;
}

.game-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.26);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.2);
}

.game-icon {
    font-size: 3.8rem;
    line-height: 1;
}

.game-name {
    font-size: 1.45rem;
    letter-spacing: 0.05em;
}

.game-type {
    font-size: 0.8rem;
    opacity: 0.8;
    padding: 4px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.16);
    letter-spacing: 0.04em;
}

.game-empty {
    position: relative;
    z-index: 2;
    margin: auto;
    text-align: center;
    opacity: 0.85;
}

.game-empty-icon {
    font-size: 3.5rem;
    margin-bottom: 12px;
}

/* ===== 游戏游玩页 ===== */
.play-wrap {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 24px 24px;
    min-height: 0;
}

.play-frame {
    width: 100%;
    max-width: 960px;
    height: 100%;
    border: none;
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.25);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* ===== 建设中占位页 ===== */
.soon-box {
    position: relative;
    z-index: 2;
    margin: auto;
    text-align: center;
    padding: 40px;
}

.soon-icon {
    font-size: 4rem;
    margin-bottom: 16px;
}

.soon-title {
    font-size: 2.2rem;
    font-weight: 500;
    letter-spacing: 0.1em;
}

.soon-desc {
    margin-top: 12px;
    font-size: 1rem;
    opacity: 0.8;
    letter-spacing: 0.08em;
}

.soon-back {
    display: inline-block;
    margin-top: 28px;
    padding: 10px 22px;
    color: var(--hall-text);
    text-decoration: none;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(6px);
    transition: background 0.3s ease;
}

.soon-back:hover {
    background: rgba(255, 255, 255, 0.32);
}

/* ===== 游玩页：剩余时间 ===== */
.play-remaining {
    color: var(--hall-text);
    font-size: 1rem;
    letter-spacing: 0.06em;
    padding: 8px 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(6px);
}

.play-remaining b {
    font-weight: 600;
}

/* ===== 游玩页：结算提示 ===== */
.play-toast {
    position: fixed;
    top: 86px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    z-index: 60;
    padding: 12px 26px;
    border-radius: 30px;
    font-size: 1.05rem;
    letter-spacing: 0.04em;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.play-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ===== 时间到：遮罩（游玩中） ===== */
.timeup-overlay {
    position: fixed;
    inset: 0;
    z-index: 55;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.timeup-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

/* ===== 时间到：页面（独立） ===== */
.timeup-page {
    position: relative;
    z-index: 2;
    margin: auto;
    text-align: center;
    padding: 40px;
    max-width: 520px;
}

.timeup-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    text-align: center;
    padding: 44px 40px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    max-width: 460px;
    margin: 0 auto;
}

.timeup-icon {
    font-size: 4rem;
    line-height: 1;
}

.timeup-title {
    font-size: 1.8rem;
    font-weight: 500;
    letter-spacing: 0.08em;
}

.timeup-desc {
    font-size: 1rem;
    opacity: 0.85;
    letter-spacing: 0.04em;
    line-height: 1.6;
}

.timeup-btn {
    display: inline-block;
    padding: 14px 34px;
    color: var(--hall-text);
    text-decoration: none;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(6px);
    transition: background 0.3s ease, transform 0.3s ease;
}

.timeup-btn:hover {
    background: rgba(255, 255, 255, 0.46);
    transform: translateY(-3px);
}

.timeup-link {
    color: var(--hall-text);
    text-decoration: none;
    font-size: 0.95rem;
    opacity: 0.75;
    letter-spacing: 0.06em;
}

.timeup-link:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ===== 成就徽章页 ===== */
.ach-progress {
    color: var(--hall-text);
    font-size: 1rem;
    letter-spacing: 0.06em;
    padding: 8px 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(6px);
}

.ach-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    max-width: 1080px;
    width: 100%;
    margin: auto;
    padding: 0 34px 40px;
}

.ach-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 32px 16px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.12);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
}

.ach-card.got {
    background: rgba(255, 255, 255, 0.24);
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18);
}

.ach-card.got:hover {
    transform: translateY(-8px);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.24);
}

.ach-card.locked {
    opacity: 0.55;
    filter: grayscale(0.7);
}

.ach-icon {
    font-size: 3.2rem;
    line-height: 1;
}

.ach-name {
    font-size: 1.2rem;
    letter-spacing: 0.05em;
}

.ach-desc {
    font-size: 0.8rem;
    opacity: 0.78;
    letter-spacing: 0.04em;
}

/* ===== 窄屏：卡片两列 ===== */
@media (max-width: 820px) {
    .hall-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
        padding: 0 20px 30px;
    }

    .ach-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
        padding: 0 20px 30px;
    }

    .hall-title {
        font-size: 2.4rem;
        margin-top: 1.5rem;
    }

    .hall-side {
        width: 88px;
        padding: 20px 12px;
    }

    .hall-side-user {
        justify-content: center;
        padding-bottom: 16px;
    }

    .hall-side-info {
        display: none;
    }

    .hall-menu-item {
        justify-content: center;
        padding: 14px;
    }

    .hall-menu-text {
        display: none;
    }

    .hall-menu-icon {
        font-size: 1.7rem;
    }

    .hall-side-back {
        font-size: 0;
        padding: 12px 0;
    }

    .hall-side-back::before {
        content: '‹';
        font-size: 1.7rem;
    }

    .hall-main {
        padding: 28px 24px 32px;
    }
}
