/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.5;
    overflow-x: hidden;
    max-width: 468px;
    min-width: 320px;
    margin: 0 auto;
    position: relative;
}

/* 顶部导航栏 */
.header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 468px;
    min-width: 320px;
    height: 3.5rem;
    background: #fff;
    border-bottom: 1px solid #eee;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 1rem;
    max-width: 468px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo img {
    height: 2rem;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: bold;
    color: #ff6b35;
}

.header-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.btn-login {
    width: 52px;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
    border-radius: 8px;
    height: 2rem;
    line-height: 2rem;
    text-align: center;
    background: linear-gradient(180deg, #FF8D24 0%, #FFAD1F 100%);
}

.btn-login:active {
    background: #e55a2b;
}

.btn-register {
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    height: 2rem;
    line-height: 2rem;
    transition: background-color 0.3s;
    width: 52px;
    text-align: center;
    background: linear-gradient(180deg, #FF4F4F 0%, #FF7658 100%);
}

.btn-register:active {
    background: #e63946;
}

.btn-menu {
    width: 2rem;
    height: 2rem;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
}

.btn-menu span {
    width: 1.25rem;
    height: 0.125rem;
    background: #333;
    border-radius: 0.0625rem;
}

/* 用户信息样式 */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.wallet-info {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    transition: transform 0.3s ease;
    color: #963;
    font-size: 12px;
    letter-spacing: 0.2px;
    height: 32px;
    padding: 6px 5px;
    border-radius: 8px;
    border: 1px solid rgba(180, 184, 208, 0.30);
   /* background: rgba(254, 161, 74, 0.10);*/
}

.wallet-info:active {
    transform: scale(0.95);
}

.wallet-icon {
    width: 22px;
    height: 22px;
}

.balance {
    font-size: 0.875rem;
    font-weight: 600;
}

.user-profile {
    display: flex;
    align-items: center;
    height: 32px;
    gap: 0.25rem;
    background: white;
    padding: 0.25rem;
    border: 1px solid #eee;
    cursor: pointer;
    transition: transform 0.3s ease;
    border-radius: 8px;
    border: 1px solid rgba(180, 184, 208, 0.30);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.10) 0%, rgba(217, 220, 232, 0.10) 100%);
}

.user-profile:active {
    transform: scale(0.95);
}

.user-avatar {
    width: 22px;
    height: 22px;
}

.user-id {
    font-size: 0.875rem;
    color: #963;
    font-weight: 600;
}

/* 菜单弹出框样式 */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 2000;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 2.7rem .2rem 0 0;
}

.menu-overlay .menu-popup {
    margin-top: 0.5rem;
}

.menu-popup {
    width: 142px;
    background: white;
    border-radius: 12px;
    padding: 0.5rem 0;
    position: relative;
    animation: menuSlideIn 0.3s ease-out;
    box-shadow: 0 2px 8px 0 rgba(120, 116, 112, 0.20);
}

.menu-popup::before {
    content: '';
    position: absolute;
    top: -7px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid white;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.menu-item:hover {
    background: #f5f5f5;
}

.menu-item:active {
    background: #e5e5e5;
}

/* 移动端触摸优化 */
@media (hover: none) and (pointer: coarse) {
    .menu-item:hover {
        background: transparent;
    }

    .menu-item:active {
        background: #e5e5e5;
    }
}

.menu-item.logout {
    color: #ff4757;
}

.menu-item.logout .menu-icon {
    filter: brightness(0) saturate(100%) invert(42%) sepia(93%) saturate(1352%) hue-rotate(316deg) brightness(119%) contrast(119%);
}

.menu-icon {
    width: 1.25rem;
    height: 1.25rem;
}

.menu-text {
    font-size: 0.875rem;
    font-weight: 500;
}

@keyframes menuSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes menuSlideOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
}

/* 公告栏 */
.announcement-bar {
    margin-top: 3.5rem;
    background: #fff;
    border-bottom: 1px solid #eee;
    background: rgba(255, 149, 0, 0.10);
    backdrop-filter: blur(8px);
}

.announcement-content {
    display: flex;
    align-items: center;
    padding: 0.75rem 10px;
    max-width: 468px;
    margin: 0 auto;
}

.notice-icon {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.5rem;
}

.announcement-text {
    flex: 1;
    display: flex;
    align-items: center;
    overflow: hidden;
    position: relative;
}

.announcement-label {
    color: #ff6b35;
    font-size: 0.875rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.announcement-scroll {
    color: #666;
    font-size: 0.875rem;
    margin: 0 0.5rem;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.announcement-scroll-content {
    display: inline-block;
    white-space: nowrap;
    will-change: transform;
}

/* 主横幅 */
.hero-banner {
    position: relative;
    padding: 12px 1rem;
    padding-bottom: 2rem;
    background-color: #fff;
}

.banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    max-width: 468px;
    margin: 0 auto;
}

.banner-text {
    flex: 1;
    z-index: 2;
}

.banner-title {
    font-size: 2.5rem;
    font-weight: bold;
    color: white;
    margin-bottom: 0.5rem;
}

.banner-subtitle {
    font-size: 1rem;
    color: white;
    opacity: 0.9;
}

.banner-image {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.banner-image:active {
    cursor: grabbing;
}

.banner-image img {
    width: 100%;
    height: 100%;
    display: block;
}

.btn-bet {
    position: absolute;
    bottom: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.75rem 2rem;
    background: white;
    color: #ff6b35;
    border: none;
    border-radius: 2rem;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 3;
}

.btn-bet:active {
    transform: translateX(-50%) scale(0.95);
}

.banner-dots {
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    z-index: 4;
}

.dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    opacity: 0.3;
    background: linear-gradient(180deg, #FF8D24 0%, #FFAD1F 100%);
}

.dot.active {
    width: 12px;
    height: 4px;
    opacity: 1;
    border-radius: 2px;
    background: linear-gradient(180deg, #FF8D24 0%, #FFAD1F 100%);
}

/* 功能图标 */
.feature-icons {
    padding: 12px;
    background: white;
    /* margin-bottom: 1rem; */
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    max-width: 468px;
    margin: 0 auto;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.feature-icon {
    width: 52px;
    height: 52px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s;
    position: relative;
}
.red-dot {
    width: 14px;
    height: 14px;
    background: #ff4757;
    border-radius: 50%;
    position: absolute;
    top: -6px;
    right: -6px;
    border: 3px solid #fff;
}
.feature-icon:active {
    transform: scale(0.95);
}

.feature-icon img {
    width: 100%;
    height: 100%;
}


.feature-text {
    font-size: 0.75rem;
    color: #666;
    text-align: center;
}

/* 章节标题 */
.section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1rem 0.5rem 0;
    max-width: 468px;
    margin: 0 auto;
}

.section-bar {
    width: 5px;
    height: 14px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, #FF8D24 0%, #FFAD1F 100%);
}

.section-title {
    font-size: 1rem;
    font-weight: bold;
    color: #333;
}

/* 热门玩法 */
.hot-play {
    background: white;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    max-width: 468px;
    margin: 0 auto;
    padding-bottom: 12px;
}

.game-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: transform 0.3s;
}

.game-item:active {
    transform: scale(0.95);
}

.game-item img {
    width: 52px;
    height: 52px;
    border-radius: 0.5rem;
}

.game-name {
    font-size: 0.75rem;
    color: #666;
    text-align: center;
}

/* 超多福利 */
.benefits {
    background: white;
}

.benefits-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 0 1rem 1rem;
    max-width: 468px;
    margin: 0 auto;
}

.benefit-card {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s;
}

.benefit-card:active {
    transform: scale(0.95);
}

.benefit-card img {
    display: flex;
    width: 100%;
    height: auto;
}

.benefit-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    padding: 1rem 0.75rem 0.75rem;
}

.benefit-title {
    font-size: 0.875rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.benefit-subtitle {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* 活动返利 */
.rebate {
    background: white;
}

.rebate-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 0 1rem 1rem;
    max-width: 468px;
    margin: 0 auto;
}

.rebate-card {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s;
}

.rebate-card:active {
    transform: scale(0.95);
}

.rebate-card img {
    display: flex;
    width: 100%;
    height: auto;
}

.rebate-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    padding: 1rem 0.75rem 0.75rem;
}

.rebate-title {
    font-size: 0.875rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.rebate-subtitle {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* 底部链接 */
.footer-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    margin-bottom: 4rem;
}

.footer-link {
    color: #8F949F;
    text-decoration: none;
    font-size: 0.875rem;
    cursor: pointer;
}

.footer-link:active {
    color: #ff6b35;
}

/* 底部导航栏 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 468px;
    min-width: 320px;
    height: 4rem;
    background: white;
    border-top: 1px solid #eee;
    display: flex;
    z-index: 1000;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    cursor: pointer;
    transition: background-color 0.3s;
    position: relative;
}

.nav-item:active {
    background: #f5f5f5;
}

.nav-item.active .nav-icon {
    opacity: 1;
}

.nav-icon {
    width: 1.5rem;
    height: 1.5rem;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.nav-text {
    font-size: 0.75rem;
    color: #666;
}

.nav-item.active .nav-text {
    color: #ff6b35;
}

.nav-badge {
    position: absolute;
    top: 0px;
    right: 21px;
    background: #ff4757;
    color: white;
    font-size: 0.625rem;
    padding: 0.125rem 0.375rem;
    border-radius: 0.75rem;
    min-width: 1rem;
    text-align: center;
}

/* 响应式设计 */
@media (max-width: 375px) {
    html {
        font-size: 14px;
    }

    .banner-title {
        font-size: 2rem;
    }

    .banner-image img {
        width: 6rem;
    }
}

@media (max-width: 320px) {
    html {
        font-size: 12px;
    }

    .banner-title {
        font-size: 1.75rem;
    }

    .banner-image img {
        width: 5rem;
    }
}

/* 触摸优化 */
@media (hover: none) and (pointer: coarse) {

    .btn-login:hover,
    .btn-register:hover,
    .btn-bet:hover,
    .feature-icon:hover,
    .game-item:hover,
    .benefit-card:hover,
    .rebate-card:hover,
    .nav-item:hover {
        transform: none;
    }
}

/* 滚动优化 */
body {
    -webkit-overflow-scrolling: touch;
}

/* 防止文本选择 */
.header,
.bottom-nav,
.feature-icons,
.hot-play,
.benefits,
.rebate {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* PC端适配 */
@media (min-width: 469px) {
    html {
        background-color: #f0f0f0;
    }

    body {
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
        background-color: #f5f5f5;
    }
}
