/* ==========================================================
 * 主页样式
 * ========================================================== */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    background: #2b1710;
    color: #f5e6c8;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    overscroll-behavior: none;
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* 登录态校验遮罩 */
#homeLoading {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #3a2018;
    color: #f5c451;
    font-size: 15px;
    letter-spacing: 1px;
}

.home {
    max-width: 720px;
    margin: 0 auto;
    padding: calc(18px + env(safe-area-inset-top, 0px)) 16px calc(28px + env(safe-area-inset-bottom, 0px));
}

/* 顶部 */
.home-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.brand {
    font-size: 22px;
    font-weight: 700;
    color: #f5c451;
    letter-spacing: 2px;
}

.logout-btn {
    border: 1px solid #8a6a3f;
    border-radius: 18px;
    background: transparent;
    color: #d8b98a;
    font-size: 13px;
    padding: 6px 14px;
}

/* 用户信息 */
.user-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    margin-bottom: 24px;
    border: 1px solid #6b4529;
    border-radius: 14px;
    background: linear-gradient(135deg, #4a2a1c, #362016);
}

.avatar {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5c451;
    color: #3a2018;
    font-size: 28px;
}

.user-info {
    min-width: 0;
}

.nickname {
    font-size: 18px;
    font-weight: 700;
    color: #f5c451;
}

.account {
    margin-top: 4px;
    font-size: 12px;
    color: #b99a72;
}

.user-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 8px;
    font-size: 13px;
    color: #d8b98a;
}

.meta-item b {
    color: #f5c451;
}

/* 关卡选择 */
.section-title {
    margin-bottom: 12px;
    font-size: 16px;
    color: #f5c451;
}

.level-list {
    display: grid;
    gap: 12px;
    margin-bottom: 26px;
}

.level-card {
    position: relative;
    padding: 14px 16px;
    border: 1px solid #6b4529;
    border-radius: 12px;
    background: #3d2117;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.level-card.active {
    border-color: #f5c451;
    box-shadow: 0 0 0 1px #f5c451 inset;
}

.level-card.locked {
    opacity: 0.55;
    cursor: not-allowed;
}

.level-no {
    font-size: 12px;
    color: #b99a72;
}

.level-name {
    margin-top: 4px;
    font-size: 17px;
    font-weight: 700;
    color: #f5e6c8;
}

.level-desc {
    margin-top: 4px;
    font-size: 13px;
    color: #b99a72;
}

.level-tag {
    position: absolute;
    top: 14px;
    right: 14px;
    font-size: 12px;
    color: #7fce8a;
}

.level-tag.locked-tag {
    color: #a88a6a;
}

/* 开始按钮 */
.start-btn {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 26px;
    background: linear-gradient(180deg, #f7d27a, #d99a2b);
    color: #3a2018;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 2px;
}

.start-btn:disabled {
    opacity: 0.5;
}

@media (max-width: 480px) {
    .home {
        padding-left: 14px;
        padding-right: 14px;
    }

    .brand {
        font-size: 20px;
    }

    .user-card {
        padding: 14px;
    }

    .avatar {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
}
