* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* 全局防拖拽设置 */
*:not(input):not(textarea) {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-drag: none;
    -webkit-user-drag: none;
    -moz-user-drag: none;
    -ms-user-drag: none;
}

/* 底部导航专用防拖拽强化 */
.bottom-nav,
.bottom-nav *,
.nav-item,
.nav-item *,
.nav-icon,
.nav-label {
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-drag: none !important;
    -webkit-user-drag: none !important;
    -moz-user-drag: none !important;
    -ms-user-drag: none !important;
    -webkit-touch-callout: none !important;
    -webkit-tap-highlight-color: transparent !important;
    touch-action: manipulation !important;
}

html {
    height: 100%;
    overflow: hidden;
    -webkit-overflow-scrolling: auto;
    overscroll-behavior: none;
    -webkit-overscroll-behavior: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0f0f23, #1a1a2e, #16213e);
    min-height: 100vh;
    height: 100%;
    color: #fff;
    overflow: hidden;
    position: relative;
    margin: 0;
    padding: 0;
    -webkit-overflow-scrolling: auto;
    overscroll-behavior: none;
    -webkit-overscroll-behavior: none;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.15) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* 顶部导航 */
.header {
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 15px 20px;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100%;
    height: 80px;
    z-index: 9998;
    border-bottom: 1px solid rgba(120, 119, 198, 0.3);
    box-shadow: 0 4px 20px rgba(120, 119, 198, 0.1);
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    touch-action: none;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 100%;
}

.logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.wallet-info {
    display: flex;
    align-items: center;
}

.wallet-btn {
    background: linear-gradient(135deg, #7877c6, #5855a6);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 10px rgba(120, 119, 198, 0.3);
    min-width: 120px;
    justify-content: center;
    text-align: center;
}

.wallet-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
}

.wallet-btn:hover {
    background: linear-gradient(135deg, #8987d3, #6b68b8);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(120, 119, 198, 0.5);
}

.wallet-btn.connected {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}

.wallet-btn.connected:hover {
    background: linear-gradient(135deg, #34d399, #10b981);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.5);
}

.wallet-icon {
    font-size: 14px;
}

.wallet-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}



/* 主要内容 */
.main-content {
    position: fixed;
    top: 80px;
    bottom: 60px;
    left: 0;
    right: 0;
    padding: 0 20px;
    z-index: 1;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: none;
    overscroll-behavior-y: none;
    -webkit-overscroll-behavior: none;
    -webkit-overscroll-behavior-y: none;
    touch-action: pan-y;
    scroll-behavior: smooth;
}

.page {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
    min-height: 100%;
}

.page.active {
    display: block;
    min-height: 100%;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.page-content {
    padding: 20px 0 100px 0;
    min-height: calc(100vh - 80px);
    position: relative;
}

/* 为内容较少的页面添加额外空间 */
.page-content::after {
    content: '';
    display: block;
    height: 50px;
    width: 100%;
}

/* 卡片样式 */
.balance-card,
.stake-card,
.team-stats,
.referral-card,
.team-list,
.withdraw-balance,
.withdraw-card,
.withdraw-history {
    background: rgba(15, 15, 35, 0.8);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(120, 119, 198, 0.3);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(120, 119, 198, 0.1),
        inset 0 1px 0 rgba(120, 119, 198, 0.1);
    position: relative;
    overflow: hidden;
}

.balance-card::before,
.stake-card::before,
.team-stats::before,
.referral-card::before,
.team-list::before,
.withdraw-balance::before,
.withdraw-card::before,
.withdraw-history::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(120, 119, 198, 0.8), transparent);
}

.balance-card h2,
.stake-card h3,
.team-stats h2,
.referral-card h3,
.team-list h3,
.withdraw-balance h2,
.withdraw-card h3,
.withdraw-history h3 {
    margin-bottom: 15px;
    font-size: 18px;
    color: #fff;
}

/* 余额显示 */
.balance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.balance-item:last-child {
    border-bottom: none;
}

.amount {
    font-weight: 600;
    color: #fff;
}

.amount.reward {
    color: #4ade80;
}

/* 输入组 */
.input-group {
    margin-bottom: 15px;
    position: relative;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #ffcccc;
}

.input-group input {
    width: 100%;
    padding: 15px;
    border: 1px solid rgba(120, 119, 198, 0.3);
    border-radius: 12px;
    background: rgba(15, 15, 35, 0.6);
    color: #fff;
    font-size: 16px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.input-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.input-group input:focus {
    outline: none;
    border-color: #7877c6;
    background: rgba(15, 15, 35, 0.8);
    box-shadow: 0 0 20px rgba(120, 119, 198, 0.3);
    transform: translateY(-1px);
}

.max-btn {
    position: absolute;
    right: 10px;
    top: 35px;
    background: linear-gradient(135deg, #7877c6, #5855a6);
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(120, 119, 198, 0.3);
}

.max-btn:hover {
    background: linear-gradient(135deg, #8987d3, #6b68b8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(120, 119, 198, 0.5);
}

/* 质押信息 */
.stake-info,
.withdraw-info {
    margin: 15px 0;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    color: #ffcccc;
}

.rate {
    color: #4ade80;
    font-weight: 600;
}

/* 按钮样式 */
.stake-btn,
.withdraw-btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stake-btn {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    box-shadow: 
        0 4px 15px rgba(16, 185, 129, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.withdraw-btn {
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    color: #fff;
    box-shadow: 
        0 4px 15px rgba(59, 130, 246, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.stake-btn:hover,
.withdraw-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.stake-btn:hover {
    box-shadow: 
        0 8px 25px rgba(16, 185, 129, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.withdraw-btn:hover {
    box-shadow: 
        0 8px 25px rgba(59, 130, 246, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* 团队统计 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: rgba(15, 15, 35, 0.6);
    border-radius: 12px;
    border: 1px solid rgba(120, 119, 198, 0.2);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.stat-item:hover {
    background: rgba(15, 15, 35, 0.8);
    border-color: rgba(120, 119, 198, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(120, 119, 198, 0.2);
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 12px;
    color: #ffcccc;
}

/* 邀请链接 */
.referral-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.referral-info {
    background: rgba(120, 119, 198, 0.1);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid rgba(120, 119, 198, 0.3);
}

.referral-info p {
    margin: 0 0 10px 0;
    color: #e2e2e2;
    font-size: 14px;
    line-height: 1.5;
}

.reward-tip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 215, 0, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.tip-icon {
    font-size: 16px;
}

.reward-tip span:last-child {
    font-size: 12px;
    color: #ffd700;
    font-weight: 500;
}

.referral-link {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.referral-link input {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    text-align: center;
    padding: 18px 15px;
    border: 2px solid rgba(120, 119, 198, 0.4);
    border-radius: 12px;
    background: rgba(15, 15, 35, 0.8);
    color: #7877c6;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.referral-link input:focus {
    outline: none;
    border-color: #7877c6;
    background: rgba(15, 15, 35, 0.9);
    box-shadow: 0 0 25px rgba(120, 119, 198, 0.4);
}

.referral-link button {
    background: linear-gradient(135deg, #7877c6, #5855a6);
    color: #fff;
    border: none;
    padding: 15px 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(120, 119, 198, 0.3);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 16px;
}

.referral-link button:hover {
    background: linear-gradient(135deg, #8987d3, #6b68b8);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(120, 119, 198, 0.5);
}

.copy-icon {
    font-size: 14px;
}

.referral-link button:active {
    transform: translateY(0);
}

/* 团队成员 */
.team-member {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(15, 15, 35, 0.6);
    border-radius: 12px;
    margin-bottom: 10px;
    border: 1px solid rgba(120, 119, 198, 0.2);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.team-member:hover {
    background: rgba(15, 15, 35, 0.8);
    border-color: rgba(120, 119, 198, 0.4);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(120, 119, 198, 0.2);
}

.member-info {
    flex: 1;
}

.member-address {
    display: block;
    font-size: 14px;
    color: #fff;
    margin-bottom: 5px;
    font-family: 'Courier New', monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px;
}

.member-level {
    font-size: 12px;
    color: #4ade80;
}

.member-stake {
    font-weight: 600;
    color: #fff;
}

/* 提现余额 */
.balance-amount {
    font-size: 32px;
    font-weight: 700;
    text-align: center;
    color: #fff;
    margin: 20px 0;
}

/* 提现记录 */
.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(15, 15, 35, 0.6);
    border-radius: 12px;
    margin-bottom: 10px;
    border: 1px solid rgba(120, 119, 198, 0.2);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.history-item:hover {
    background: rgba(15, 15, 35, 0.8);
    border-color: rgba(120, 119, 198, 0.4);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(120, 119, 198, 0.2);
}

.history-amount {
    font-weight: 600;
    color: #fff;
    margin-bottom: 5px;
}

.history-time {
    font-size: 12px;
    color: #ffcccc;
}

.history-status {
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
}

.history-status.success {
    background: #4ade80;
    color: #fff;
}

/* 空状态 */
.empty-state {
    text-align: center;
    color: #ffcccc;
    padding: 20px;
    font-style: italic;
}

/* 底部导航 */
.bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 60px !important;
    background: rgba(15, 15, 35, 0.95) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex !important;
    align-items: center !important;
    padding: 5px 0 !important;
    z-index: 9999 !important;
    border-top: 1px solid rgba(120, 119, 198, 0.3);
    box-shadow: 0 -4px 20px rgba(120, 119, 198, 0.1);
    transform: translateZ(0) !important;
    -webkit-transform: translateZ(0) !important;
    will-change: transform !important;
    -webkit-overflow-scrolling: auto !important;
    overscroll-behavior: none !important;
    touch-action: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-drag: none !important;
    -webkit-user-drag: none !important;
    -moz-user-drag: none !important;
    -ms-user-drag: none !important;
    pointer-events: auto !important;
}

.nav-item {
    flex: 1;
    text-align: center;
    padding: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-drag: none !important;
    -webkit-user-drag: none !important;
    -moz-user-drag: none !important;
    -ms-user-drag: none !important;
    touch-action: manipulation !important;
    pointer-events: auto !important;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, #7877c6, #ff77c6);
    border-radius: 2px;
}

.nav-item.active .nav-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px rgba(120, 119, 198, 0.8));
}

.nav-item.active .nav-label {
    color: #7877c6;
    text-shadow: 0 0 8px rgba(120, 119, 198, 0.5);
}

.nav-icon {
    font-size: 20px;
    margin-bottom: 3px;
    transition: all 0.3s ease;
}

.nav-label {
    font-size: 11px;
    color: #ccc;
    transition: all 0.3s ease;
    font-weight: 500;
}

/* 消息提示 */
.message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 15px 25px;
    border-radius: 10px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.message.show {
    opacity: 1;
    visibility: visible;
}

/* 响应式优化 */
@media (max-width: 375px) {
    .header-content {
        padding: 0 15px;
    }
    
    .main-content {
        padding: 0 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .balance-amount {
        font-size: 28px;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

/* 强制底部导航固定 - 移动端优化 */
@supports (-webkit-overflow-scrolling: touch) {
    .bottom-nav {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        -webkit-transform: translate3d(0, 0, 0) !important;
        transform: translate3d(0, 0, 0) !important;
    }
}

/* 禁止页面缩放影响固定元素 */
@media screen and (max-width: 768px) {
    .bottom-nav {
        position: fixed !important;
        bottom: 0 !important;
        -webkit-transform: translate3d(0, 0, 0) !important;
        transform: translate3d(0, 0, 0) !important;
        backface-visibility: hidden !important;
        -webkit-backface-visibility: hidden !important;
    }
    
    body {
        position: relative !important;
        -webkit-overflow-scrolling: touch !important;
    }
}