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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: #f5f5f5;
    position: relative;
    padding-bottom: 60px;
}

.hidden {
    display: none !important;
}

/* 顶部栏 */
.app-header {
    background: #fff;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #eee;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    min-width: 80px;
}

.header-right {
    justify-content: flex-end;
}

.header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
}

.header-avatar span {
    font-size: 18px;
}

.header-title {
    font-size: 17px;
    font-weight: 600;
    color: #333;
}

.vip-btn {
    padding: 6px 12px;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
}

/* 头像侧边栏 */
.avatar-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
}

.drawer-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.drawer-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 280px;
    height: 100%;
    background: #fff;
    padding-top: 60px;
    transform: translateX(-100%);
    transition: transform 0.3s;
}

.avatar-drawer:not(.hidden) .drawer-content {
    transform: translateX(0);
}

.drawer-item {
    padding: 14px 20px;
    font-size: 15px;
    color: #333;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
}

.drawer-item:active {
    background: #f9f9f9;
}

.drawer-item.logout {
    color: #ff4d4f;
}

.drawer-divider {
    height: 8px;
    background: #f5f5f5;
}

/* 主内容区 */
.main-content {
    padding: 12px;
}

.page {
    display: none;
}

.page.active {
    display: block;
}

.page-header {
    background: #fff;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.page-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.page-subtitle {
    font-size: 13px;
    color: #999;
}

.my-rank {
    display: flex;
    align-items: center;
    gap: 8px;
}

.my-rank-label {
    font-size: 14px;
    color: #666;
}

.my-rank-value {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.sort-info {
    font-size: 12px;
    color: #999;
}

/* 比赛列表 */
.match-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.match-card {
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.match-card:active {
    transform: scale(0.98);
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.match-league {
    font-size: 12px;
    color: #999;
}

.match-time {
    font-size: 12px;
    color: #999;
}

.match-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.team {
    flex: 1;
    text-align: center;
}

.team-name {
    font-size: 15px;
    font-weight: 500;
    color: #333;
}

.match-vs {
    font-size: 12px;
    color: #999;
    padding: 0 16px;
}

.vote-buttons {
    display: flex;
    gap: 8px;
}

.vote-btn {
    flex: 1;
    padding: 10px 0;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    background: #fff;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.vote-btn:active {
    transform: scale(0.95);
}

.vote-btn.selected {
    color: #fff;
}

.vote-btn.vote-home.selected {
    background: #e8483f;
    border-color: #e8483f;
}

.vote-btn.vote-draw.selected {
    background: #8c8c8c;
    border-color: #8c8c8c;
}

.vote-btn.vote-away.selected {
    background: #1677ff;
    border-color: #1677ff;
}

.vote-btn.selected .vote-count {
    color: rgba(255, 255, 255, 0.8);
}

.vote-flag {
    font-size: 16px;
    display: block;
    margin-bottom: 2px;
}

.flag-red {
    color: #e8483f;
}

.flag-blue {
    color: #1677ff;
}

.vote-btn.selected .vote-flag {
    color: #fff;
}

.vote-count {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

/* 排行榜 */
.rank-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rank-card {
    background: #fff;
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
}

.rank-card:active {
    transform: scale(0.98);
}

.rank-card.my-card {
    border: 2px solid #1677ff;
}

.rank-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-right: 12px;
    flex-shrink: 0;
}

.rank-num.top1 {
    background: linear-gradient(135deg, #ffd700, #ffb800);
    color: #fff;
}

.rank-num.top2 {
    background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
    color: #fff;
}

.rank-num.top3 {
    background: linear-gradient(135deg, #cd7f32, #b8860b);
    color: #fff;
}

.rank-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 12px;
    flex-shrink: 0;
    overflow: hidden;
    background-size: cover;
    background-position: center;
}

.rank-info {
    flex: 1;
    min-width: 0;
}

.rank-name {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.rank-stats {
    font-size: 12px;
    color: #999;
}

.rank-stats span {
    margin-right: 12px;
}

.rank-rate {
    font-size: 16px;
    font-weight: 600;
    color: #52c41a;
    flex-shrink: 0;
}

.rank-rate.negative {
    color: #ff4d4f;
}

/* 我的页面 */
.mine-header {
    background: #fff;
    padding: 24px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.mine-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-right: 16px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
}

.mine-info {
    flex: 1;
}

.mine-nickname {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.mine-stats {
    font-size: 13px;
    color: #666;
}

.mine-stats span {
    margin-right: 16px;
}

.mine-stats span span {
    color: #1677ff;
    font-weight: 500;
}

.mine-tabs {
    background: #fff;
    border-radius: 8px;
    display: flex;
    margin-bottom: 12px;
    overflow: hidden;
}

.mine-tab {
    flex: 1;
    padding: 14px 0;
    text-align: center;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    position: relative;
}

.mine-tab.active {
    color: #1677ff;
    font-weight: 500;
}

.mine-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 3px;
    background: #1677ff;
    border-radius: 2px;
}

.mine-tab-content {
    display: none;
}

.mine-tab-content.active {
    display: block;
}

/* 投票列表 */
.vote-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vote-item {
    background: #fff;
    border-radius: 8px;
    padding: 14px 16px;
}

.vote-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.vote-item-league {
    font-size: 12px;
    color: #999;
}

.vote-item-status {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
}

.vote-item-status.pending {
    background: #fff7e6;
    color: #fa8c16;
}

.vote-item-status.win {
    background: #f6ffed;
    color: #52c41a;
}

.vote-item-status.lose {
    background: #fff1f0;
    color: #ff4d4f;
}

.vote-item-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.vote-item-team {
    flex: 1;
    text-align: center;
    font-size: 14px;
    color: #333;
}

.vote-item-vs {
    font-size: 12px;
    color: #999;
    padding: 0 12px;
}

.vote-item-my-pick {
    font-size: 13px;
    color: #666;
}

.vote-item-my-pick span {
    color: #1677ff;
    font-weight: 500;
}

/* 关注列表 */
.follow-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.follow-item {
    background: #fff;
    border-radius: 8px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.follow-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 12px;
    flex-shrink: 0;
}

.follow-info {
    flex: 1;
}

.follow-name {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.follow-rate {
    font-size: 12px;
    color: #52c41a;
}

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: 60px;
    background: #fff;
    display: flex;
    border-top: 1px solid #eee;
    z-index: 100;
}

.tab-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    font-size: 11px;
    gap: 4px;
}

.tab-btn.active {
    color: #1677ff;
}

.tab-btn svg {
    width: 22px;
    height: 22px;
}

/* 弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

/* 登录注册 */
.auth-form {
    padding: 20px 16px;
}

.auth-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.auth-tab {
    flex: 1;
    padding: 12px 0;
    text-align: center;
    font-size: 15px;
    color: #666;
    cursor: pointer;
    position: relative;
}

.auth-tab.active {
    color: #1677ff;
    font-weight: 500;
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 2px;
    background: #1677ff;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    outline: none;
}

.form-group input:focus {
    border-color: #1677ff;
}

.send-code-btn {
    flex-shrink: 0;
    width: 110px;
    height: 44px;
    background: #fff;
    color: #1677ff;
    border: 1px solid #1677ff;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

.send-code-btn:disabled {
    color: #999;
    border-color: #d9d9d9;
    cursor: not-allowed;
}

.auth-btn {
    width: 100%;
    height: 44px;
    background: #1677ff;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    margin-top: 8px;
}

.auth-btn:active {
    opacity: 0.9;
}

/* 会员中心 */
.vip-modal {
    max-height: 80vh;
    overflow-y: auto;
}

.vip-levels {
    padding: 16px;
}

.vip-card {
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.vip-badge {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: #fff;
    border-radius: 4px;
    font-size: 12px;
    margin-bottom: 12px;
}

.vip-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.vip-price {
    font-size: 24px;
    font-weight: 700;
    color: #ff4d4f;
    margin-bottom: 12px;
}

.vip-buy-btn {
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    margin-top: 12px;
}

.payment-methods {
    margin-bottom: 12px;
}

.payment-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.payment-option:hover {
    border-color: #1677ff;
}

.payment-option.selected {
    border-color: #1677ff;
    background: #e6f7ff;
}

.payment-icon {
    width: 28px;
    height: 28px;
    margin-right: 12px;
}

.wechat-icon {
    color: #07c160;
}

.alipay-icon {
    color: #1677ff;
}

.payment-option span {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.payment-check {
    width: 20px;
    height: 20px;
    border: 2px solid #d9d9d9;
    border-radius: 50%;
    transition: all 0.2s;
}

.payment-option.selected .payment-check {
    background: #1677ff;
    border-color: #1677ff;
}

.payment-option.selected .payment-check::after {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    margin: 4px auto;
}

/* 设置 */
.settings-modal {
    max-height: 80vh;
    overflow-y: auto;
}

.settings-form {
    padding: 16px;
}

.avatar-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.avatar-option {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.avatar-option.selected {
    border-color: #1677ff;
}

/* 玩家详情 */
.player-modal {
    max-height: 80vh;
    overflow-y: auto;
}

.player-detail-header {
    text-align: center;
    padding: 20px 0;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 16px;
}

.player-detail-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #f0f0f0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin-bottom: 12px;
}

.player-detail-name {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.player-detail-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    font-size: 13px;
    color: #666;
}

.player-detail-stats span span {
    color: #1677ff;
    font-weight: 500;
}

.follow-btn {
    width: 100%;
    padding: 10px 0;
    background: #1677ff;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 16px;
}

.follow-btn.following {
    background: #f0f0f0;
    color: #666;
}

.player-votes-title {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    margin: 16px 0 12px;
}

.player-vote-item {
    background: #f9f9f9;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 8px;
}

.player-vote-locked {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 13px;
}

.player-vote-locked a {
    color: #1677ff;
    text-decoration: none;
}

/* Toast */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 999;
    max-width: 80%;
    text-align: center;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}
