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

html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    background: #e8e4f8;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #1a1040;
}

.page-wrapper {
    max-width: 480px;
    width: 100%;
    margin: 0 auto;
    background: #f4f2ff;
    min-height: 100vh;
    padding-bottom: 70px;
    position: relative;
    overflow: hidden;
}

/* 顶部导航 */
.topbar {
    background: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #ede8ff;
    position: sticky;
    top: 0;
    z-index: 100;
}
.logo { font-size: 20px; font-weight: 700; color: #5b4fcf; }
.logo span { color: #f0a500; }
.nav-right { display: flex; align-items: center; gap: 8px; }
.coin-pill {
    background: #fff8e6;
    border: 1px solid #f0a500;
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 12px;
    color: #9a6700;
    display: flex;
    align-items: center;
    gap: 5px;
}
.coin-icon {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #f0a500;
    display: inline-block;
    flex-shrink: 0;
}
.btn-login {
    border: 1px solid #5b4fcf;
    color: #5b4fcf;
    background: transparent;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12px;
}
.btn-reg {
    background: #5b4fcf;
    color: #fff;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.reg-bonus {
    background: #f0a500;
    color: #fff;
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 10px;
}
.btn-account {
    background: #ede8ff;
    color: #5b4fcf;
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12px;
}
.btn-logout { color: #999; font-size: 11px; }

/* Hero */
.hero {
    background: #ede9ff;
    padding: 20px 16px 16px;
    border-bottom: 1px solid #e0d8ff;
}
.hero-greeting { font-size: 13px; color: #8a7fc0; margin-bottom: 4px; }
.hero-title { font-size: 20px; font-weight: 700; color: #2d2360; margin-bottom: 14px; line-height: 1.3; }
.plan-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.plan {
    background: #fff;
    border: 1px solid #e0d8ff;
    border-radius: 12px;
    padding: 12px 6px;
    text-align: center;
    cursor: pointer;
    position: relative;
}
.plan.featured { border: 2px solid #5b4fcf; background: #f3f1ff; }
.plan-badge {
    position: absolute;
    top: -9px; left: 50%;
    transform: translateX(-50%);
    background: #5b4fcf;
    color: #fff;
    font-size: 9px;
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
}
.plan-label { font-size: 10px; color: #8a7fc0; margin-bottom: 3px; }
.plan-price { font-size: 18px; font-weight: 700; color: #2d2360; }
.plan-unit { font-size: 9px; color: #b0a8d8; margin-top: 2px; }

/* 筛选 */
.filter-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 16px;
    background: #fff;
    border-bottom: 1px solid #f0ecff;
    -webkit-overflow-scrolling: touch;
}
.filter-scroll::-webkit-scrollbar { display: none; }
.cat-chip {
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 12px;
    white-space: nowrap;
    cursor: pointer;
    border: 1px solid #e0d8ff;
    color: #8a7fc0;
    background: #fff;
    flex-shrink: 0;
}
.cat-chip.active { background: #5b4fcf; border-color: #5b4fcf; color: #fff; }

/* 游戏区块 */
.section { padding: 14px 16px 0; }
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.section-title { font-size: 15px; font-weight: 600; color: #2d2360; }
.see-all { font-size: 12px; color: #5b4fcf; }

.games-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}
.game-card {
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #ede8ff;
    cursor: pointer;
}
.game-thumb {
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    position: relative;
}
.game-info { padding: 5px 7px 7px; }
.game-name {
    font-size: 10px;
    font-weight: 600;
    color: #2d2360;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.game-provider { font-size: 9px; color: #b0a8d8; margin-top: 1px; }
.tag {
    position: absolute;
    top: 5px; right: 5px;
    font-size: 8px;
    padding: 2px 6px;
    border-radius: 20px;
    font-weight: 600;
}
.tag-hot { background: #ff6b35; color: #fff; }
.tag-new { background: #22c55e; color: #fff; }
.tag-vip { background: #5b4fcf; color: #fff; }

/* 签到 */
.checkin-card {
    margin: 0 16px 14px;
    background: #fff;
    border: 1px solid #ede8ff;
    border-radius: 14px;
    padding: 12px 14px;
}
.checkin-title { font-size: 13px; font-weight: 600; color: #2d2360; margin-bottom: 10px; }
.streak-row { display: flex; justify-content: space-between; }
.streak-day { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.streak-circle {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 1px solid #e0d8ff;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; color: #b0a8d8; font-weight: 600;
}
.streak-circle.done { background: #5b4fcf; border-color: #5b4fcf; color: #fff; }
.streak-circle.today { background: #f0a500; border-color: #f0a500; color: #fff; }
.streak-label { font-size: 8px; color: #b0a8d8; }
.streak-coins { font-size: 9px; color: #f0a500; font-weight: 600; }

/* 推荐 */
.refer-card {
    margin: 0 16px 14px;
    background: #f0fff8;
    border: 1px solid #bbf7d0;
    border-radius: 14px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.refer-title { font-size: 13px; font-weight: 600; color: #166534; margin-bottom: 2px; }
.refer-desc { font-size: 11px; color: #15803d; }
.refer-btn {
    background: #22c55e;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 7px 14px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    font-weight: 600;
    flex-shrink: 0;
}

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: #fff;
    border-top: 1px solid #ede8ff;
    display: flex;
    justify-content: space-around;
    padding: 8px 0 6px;
    z-index: 100;
}
.bni {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    text-decoration: none;
}
.bni-icon { width: 22px; height: 22px; border-radius: 5px; background: #e8e4f8; }
.bni.active .bni-icon { background: #5b4fcf; }
.bni-lbl { font-size: 9px; color: #b0a8d8; }
.bni.active .bni-lbl { color: #5b4fcf; font-weight: 600; }
/* 登录注册页面 */
.auth-header {
    background: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #ede8ff;
}
.back-btn {
    font-size: 20px;
    color: #5b4fcf;
    text-decoration: none;
    padding: 4px 8px;
}
.auth-body {
    padding: 24px 20px;
}
.auth-title {
    font-size: 24px;
    font-weight: 700;
    color: #2d2360;
    margin-bottom: 6px;
}
.auth-sub {
    font-size: 14px;
    color: #8a7fc0;
    margin-bottom: 24px;
}
.auth-error {
    background: #fff0f0;
    border: 1px solid #ffcccc;
    color: #cc0000;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 16px;
}
.input-group {
    margin-bottom: 16px;
}
.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #2d2360;
    margin-bottom: 6px;
}
.input-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e0d8ff;
    border-radius: 12px;
    font-size: 14px;
    color: #1a1040;
    background: #fff;
    outline: none;
}
.input-group input:focus {
    border-color: #5b4fcf;
}
.auth-btn {
    width: 100%;
    background: #5b4fcf;
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
}
.auth-divider {
    text-align: center;
    color: #b0a8d8;
    font-size: 13px;
    margin: 20px 0;
    position: relative;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #e0d8ff;
}
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }
.auth-switch {
    text-align: center;
    font-size: 14px;
    color: #8a7fc0;
}
.auth-switch a {
    color: #5b4fcf;
    font-weight: 600;
}