/* 用户系统统一样式 */

/* ==================== 登录弹窗 ==================== */
.login-modal {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    z-index: 10001; /* 比防沉迷窗口(10000)高一层 */
    animation: fadeIn 0.3s ease-out;
}

.login-modal.fade-out {
    animation: fadeOut 0.3s ease-out;
}

.login-modal-content {
    background: white;
    border-radius: 24px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease-out;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.login-close-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 36px;
    height: 36px;
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 10;
}

.login-close-btn:hover {
    background: #e0e0e0;
    color: #333;
    transform: rotate(90deg);
}

.login-icon {
    font-size: 64px;
    margin-bottom: 15px;
    animation: bounce 1s ease-in-out infinite;
}

.login-header h2 {
    font-size: 28px;
    color: #333;
    margin-bottom: 8px;
}

.login-subtitle {
    color: #888;
    font-size: 14px;
}

.login-body {
    margin-bottom: 30px;
}

.input-group {
    margin-bottom: 20px;
    position: relative;
}

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

.auth-input {
    width: 100%;
    padding: 15px 20px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.auth-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.auth-input.input-error {
    border-color: #ff4444;
    animation: shake 0.5s ease;
}

.username-input {
    width: 100%;
    padding: 15px 20px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.username-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.username-input.input-error {
    border-color: #ff4444;
    animation: shake 0.5s ease;
}

.mode-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #666;
}

.mode-switch a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    margin-left: 5px;
    transition: all 0.3s ease;
}

.mode-switch a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.input-hint {
    margin-top: 8px;
    font-size: 12px;
    color: #999;
    text-align: center;
}

.error-tip {
    display: none;
    margin-top: 8px;
    padding: 8px 12px;
    background: #ffebee;
    color: #c62828;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}

.login-btn {
    width: 100%;
    padding: 16px;
    font-size: 18px;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.login-btn:active {
    transform: translateY(0);
}

.recent-users {
    margin-bottom: 20px;
}

.recent-users-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    font-weight: 600;
}

.recent-users-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recent-user-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #f8f9ff;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.recent-user-item:hover {
    background: #e8ebff;
    border-color: #667eea;
    transform: translateX(5px);
}

.recent-user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 12px;
}

.recent-user-info {
    flex: 1;
}

.recent-user-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.recent-user-points {
    font-size: 12px;
    color: #888;
}

.login-footer {
    border-top: 1px solid #e0e0e0;
    padding-top: 20px;
}

.feature-tags {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.feature-tag {
    padding: 6px 12px;
    background: #f0f0f0;
    border-radius: 20px;
    font-size: 12px;
    color: #666;
}

/* 欢迎界面 */
.welcome-content {
    text-align: center;
    padding: 20px 0;
}

.welcome-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: scaleIn 0.5s ease-out;
}

.welcome-content h2 {
    font-size: 32px;
    color: #333;
    margin-bottom: 10px;
}

.welcome-name {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 20px;
}

.welcome-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 20px;
}

.welcome-stat {
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #888;
}

.welcome-message {
    font-size: 16px;
    color: #666;
}

/* ==================== 排行榜弹窗 ==================== */
.ranking-modal {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    z-index: 9999;
    animation: fadeIn 0.3s ease-out;
}

.ranking-modal-content {
    background: white;
    border-radius: 20px;
    padding: 0;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.4s ease-out;
}

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

.ranking-modal-header h2 {
    font-size: 24px;
    color: #333;
    margin: 0;
}

.ranking-close-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ranking-close-btn:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
}

.ranking-tabs {
    display: flex;
    padding: 10px 20px;
    gap: 10px;
    border-bottom: 1px solid #f0f0f0;
    overflow-x: auto;
}

.ranking-tab {
    padding: 8px 16px;
    border: none;
    background: #f0f0f0;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.ranking-tab:hover {
    background: #e0e0e0;
}

.ranking-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.ranking-list-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.ranking-item:hover {
    background: #e8ebff;
    transform: translateX(5px);
}

.ranking-item.current-user {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-color: #667eea;
}

.rank-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
    color: #666;
    margin-right: 15px;
}

.rank-number.top-three {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border-radius: 50%;
    color: white;
}

.rank-username {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.rank-points {
    font-size: 16px;
    font-weight: bold;
    color: #667eea;
    margin-right: 15px;
}

.rank-games {
    font-size: 14px;
    color: #888;
}

/* ==================== 用户信息栏 ==================== */
.user-info-bar {
    position: fixed;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 9999;
    transition: all 0.3s ease;
}

.user-info-bar:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.user-points {
    font-size: 12px;
    color: #667eea;
    font-weight: 600;
}

.shop-btn {
    padding: 6px 12px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border: none;
    border-radius: 15px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.shop-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.5);
}

.points-history-btn {
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 15px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    color: white;
}

.points-history-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

.logout-btn {
    padding: 6px 12px;
    background: #f0f0f0;
    border: none;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: #e0e0e0;
}

/* ==================== 积分明细浮窗样式 ==================== */
/* 积分明细内容区域 */
.points-history-content {
    padding: 20px 30px 30px 30px;
    overflow-y: auto;
    flex: 1;
    max-height: calc(80vh - 80px); /* 减去header的高度 */
}

.points-history-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    padding: 0;
    margin-bottom: 16px;
}

.summary-item {
    text-align: center;
    padding: 12px 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    color: white;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.summary-item::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.summary-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.summary-label {
    font-size: 11px;
    opacity: 0.95;
    margin-bottom: 5px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.summary-value {
    font-size: 22px;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.points-history-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.ph-filter-select {
    padding: 10px 16px;
    border: 2px solid #e0e5ff;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    background: white;
    color: #333;
    outline: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.ph-filter-select:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.ph-filter-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.ph-action-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.25);
}

.ph-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.35);
}

.ph-action-btn:active {
    transform: translateY(0);
}

.ph-loading {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 16px;
}

.ph-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 60px 20px;
    color: #999;
}

.ph-empty div:first-child {
    font-size: 64px;
    opacity: 0.5;
}

.ph-empty div:last-child {
    font-size: 16px;
    color: #aaa;
}

.points-history-list {
    overflow-y: visible; /* 不需要单独滚动，使用父容器滚动 */
    padding-right: 0;
}

/* 自定义滚动条 - 应用到内容区域 */
.points-history-content::-webkit-scrollbar {
    width: 6px;
}

.points-history-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.points-history-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

.points-history-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.points-history-item {
    background: white;
    padding: 16px;
    margin-bottom: 10px;
    border-radius: 12px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

.points-history-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
}

.points-history-item:hover::before {
    width: 6px;
}

.points-history-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.points-history-item.earn {
    border-left-color: #10b981;
    background: linear-gradient(to right, rgba(16, 185, 129, 0.03) 0%, white 10%);
}

.points-history-item.earn::before {
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
}

.points-history-item.spend {
    border-left-color: #ef4444;
    background: linear-gradient(to right, rgba(239, 68, 68, 0.03) 0%, white 10%);
}

.points-history-item.spend::before {
    background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
}

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

.ph-item-points {
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ph-item-points.earn {
    color: #10b981;
}

.ph-item-points.earn::before {
    content: '↗';
    font-size: 16px;
}

.ph-item-points.spend {
    color: #ef4444;
}

.ph-item-points.spend::before {
    content: '↘';
    font-size: 16px;
}

.ph-item-time {
    font-size: 12px;
    color: #999;
    background: #f3f4f6;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.ph-item-reason {
    font-size: 14px;
    color: #555;
    margin-bottom: 8px;
    font-weight: 500;
}

.ph-item-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.ph-meta-tag {
    background: linear-gradient(135deg, #e0e5ff 0%, #f0f2ff 100%);
    padding: 4px 10px;
    border-radius: 6px;
    color: #667eea;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid rgba(102, 126, 234, 0.2);
    transition: all 0.2s ease;
}

.ph-meta-tag:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    transform: scale(1.05);
}

/* 分页组件 */
.ph-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.ph-page-btn {
    padding: 6px 14px;
    background: white;
    border: 2px solid #e0e5ff;
    border-radius: 8px;
    color: #667eea;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ph-page-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}

.ph-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.ph-page-info {
    padding: 6px 12px;
    background: linear-gradient(135deg, #e0e5ff 0%, #f0f2ff 100%);
    border-radius: 8px;
    color: #667eea;
    font-size: 13px;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
}

/* ==================== 动画 ==================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

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

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.shake {
    animation: shake 0.5s ease;
}

/* ==================== 响应式设计 ==================== */

/* iPad Pro 横屏优化 (1024px - 1366px) */
@media (min-width: 1024px) and (max-width: 1366px) {
    .login-modal {
        position: fixed !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        z-index: 10001 !important;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .ranking-modal {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }
    
    .login-modal-content {
        max-width: 650px;
        width: 80%;
        padding: 40px;
        margin: 20px auto;
        max-height: calc(100vh - 40px);
        overflow-y: auto;
    }
    
    .login-header h2 {
        font-size: 30px;
    }
    
    .login-icon {
        font-size: 68px;
    }
    
    .auth-input,
    .username-input {
        font-size: 18px;
        padding: 16px 22px;
    }
    
    .login-btn {
        padding: 18px;
        font-size: 20px;
    }
    
    .ranking-modal-content {
        max-width: 750px;
        width: 80%;
        max-height: 85vh;
    }
    
    .ranking-modal-header h2 {
        font-size: 26px;
    }
    
    .user-info-bar {
        top: 12px;
        left: 12px;
        padding: 14px 22px;
    }
    
    .user-avatar {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .user-name {
        font-size: 16px;
    }
    
    .user-points {
        font-size: 14px;
    }
    
    .points-history-content {
        padding: 25px 35px 35px 35px;
    }
    
    .summary-label {
        font-size: 12px;
    }
    
    .summary-value {
        font-size: 24px;
    }
}

/* iPad 竖屏优化 (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .login-modal {
        position: fixed !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        z-index: 10001 !important;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .ranking-modal {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }
    
    .login-modal-content {
        max-width: 600px;
        width: 85%;
        padding: 35px;
        margin: 20px auto;
        max-height: calc(100vh - 40px);
        overflow-y: auto;
    }
    
    .login-header h2 {
        font-size: 26px;
    }
    
    .login-icon {
        font-size: 56px;
    }
    
    .auth-input,
    .username-input {
        font-size: 16px;
        padding: 14px 18px;
    }
    
    .login-btn {
        padding: 15px;
        font-size: 17px;
    }
    
    .ranking-modal-content {
        max-width: 700px;
        width: 85%;
        max-height: 85vh;
    }
    
    .ranking-modal-header h2 {
        font-size: 22px;
    }
    
    .user-info-bar {
        top: 8px;
        left: 8px;
        padding: 10px 16px;
    }
    
    .user-avatar {
        width: 34px;
        height: 34px;
        font-size: 17px;
    }
    
    .user-name {
        font-size: 13px;
    }
    
    .user-points {
        font-size: 11px;
    }
    
    .points-history-content {
        padding: 20px 25px 25px 25px;
    }
}

/* 手机端优化 (< 768px) */
@media (max-width: 767px) {
    .login-modal {
        /* 确保在小屏幕上完全可见 */
        position: fixed !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        z-index: 10001 !important; /* 确保在防沉迷窗口之上 */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .ranking-modal {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }
    
    .login-modal-content {
        padding: 30px 20px;
        width: 90%;
        margin: 10px auto;
        /* 确保不会超出屏幕 */
        max-height: calc(100vh - 20px);
        overflow-y: auto;
    }
    
    .login-header h2 {
        font-size: 24px;
    }
    
    .login-icon {
        font-size: 48px;
    }
    
    .ranking-modal-content {
        max-height: 90vh;
    }
    
    .ranking-modal-header {
        padding: 15px 20px;
    }
    
    .ranking-modal-header h2 {
        font-size: 20px;
    }
    
    .user-info-bar {
        top: 5px;
        left: 5px;
        padding: 8px 12px;
    }
    
    .user-avatar {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    
    .user-name {
        font-size: 12px;
    }
    
    .user-points {
        font-size: 11px;
    }
}

/* 通用触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    /* 增大点击区域 */
    .login-btn,
    .shop-btn,
    .logout-btn,
    .points-history-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* 关闭按钮优化 */
    .login-close-btn,
    .ranking-close-btn {
        width: 44px;
        height: 44px;
        font-size: 26px;
    }
}

/* ==================== 在线人数计数器 ==================== */
.online-counter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-radius: 25px;
    font-size: 14px;
    color: #667eea;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.online-counter:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.5);
}

/* 浮动模式 - 固定在右下角 */
.online-counter-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: slideInUp 0.5s ease-out;
}

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

/* 在线状态指示点 */
.online-dot {
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 0 rgba(16, 185, 129, 0.4);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.online-label {
    font-weight: 500;
    color: #666;
}

.online-count {
    font-size: 18px;
    font-weight: bold;
    color: #667eea;
    min-width: 24px;
    text-align: center;
    transition: all 0.3s ease;
}

.online-count.count-update {
    animation: countBounce 0.4s ease;
}

@keyframes countBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
        color: #764ba2;
    }
}

.online-unit {
    font-size: 13px;
    color: #888;
}

/* 首页在线人数样式 - 内联在副标题下方 */
.home-online-counter {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
}

.home-online-counter .online-counter {
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.1) 0%, rgba(245, 87, 108, 0.1) 100%);
    border-color: rgba(240, 147, 251, 0.3);
    padding: 10px 20px;
}

.home-online-counter .online-counter:hover {
    border-color: rgba(240, 147, 251, 0.5);
    box-shadow: 0 4px 15px rgba(240, 147, 251, 0.2);
}

.home-online-counter .online-dot {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    animation-name: pulsePink;
}

@keyframes pulsePink {
    0% {
        box-shadow: 0 0 0 0 rgba(240, 147, 251, 0.4);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(240, 147, 251, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(240, 147, 251, 0);
    }
}

.home-online-counter .online-count {
    color: #f093fb;
}

/* 游戏页面在线人数样式 */
.game-online-counter {
    display: flex;
    justify-content: center;
    margin: 10px 0;
}

.game-online-counter .online-counter {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 0.5);
    padding: 6px 14px;
    font-size: 13px;
}

.game-online-counter .online-count {
    font-size: 16px;
}

/* iPad Pro 横屏 (1024px - 1366px) */
@media (min-width: 1024px) and (max-width: 1366px) {
    .online-counter-float {
        bottom: 25px;
        right: 25px;
        padding: 10px 20px;
    }
    
    .online-count {
        font-size: 20px;
    }
    
    .home-online-counter .online-counter {
        padding: 12px 24px;
    }
}

/* iPad 竖屏 (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .online-counter-float {
        bottom: 20px;
        right: 20px;
        padding: 8px 16px;
    }
    
    .online-label {
        font-size: 13px;
    }
    
    .online-count {
        font-size: 17px;
    }
}

/* 手机端 (< 768px) */
@media (max-width: 767px) {
    .online-counter-float {
        bottom: 15px;
        right: 15px;
        padding: 6px 12px;
        gap: 6px;
    }
    
    .online-dot {
        width: 8px;
        height: 8px;
    }
    
    .online-label {
        font-size: 12px;
    }
    
    .online-count {
        font-size: 15px;
        min-width: 20px;
    }
    
    .online-unit {
        font-size: 11px;
    }
    
    .home-online-counter .online-counter {
        padding: 8px 14px;
    }
    
    .game-online-counter .online-counter {
        padding: 5px 12px;
        font-size: 12px;
    }
    
    .game-online-counter .online-count {
        font-size: 14px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .online-counter {
        min-height: 40px;
    }
    
    .online-counter-float {
        min-height: 44px;
    }
}
