﻿*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
body{
touch-action: none; /* 禁用浏览器的默认触摸行为 */
}
/* 头部操作区域 */
.header-actions {
display: flex;
justify-content: space-between;
align-items: center; /* 垂直居中对齐 */
width: 100%;
max-width: 500px;
margin-bottom: 10px;
}
/* 排行榜和登录注册按钮 */
.header-actions div {
color: #8f7a66;
font-size: 16px;
cursor: pointer;
transition: color 0.2s ease;
display: flex;
align-items: center; /* 垂直居中对齐 */
height: 100%; /* 确保高度一致 */
}

.header-actions div:hover {
color: #7b6a5a;
}

/* 用户信息区域 */
.user-info {
display: flex;
align-items: center; /* 垂直居中对齐 */
gap: 10px; /* 头像和名称之间的间距 */
}
.userinfo {
display: flex;
align-items: center; /* 垂直居中对齐 */
gap: 10px; /* 头像和名称之间的间距 */
}

.user-info img {
width: 30px;
height: 30px;
border-radius: 50%;
}

/* 登录/注册按钮 */
.login-btn {
display: flex;
align-items: center; /* 垂直居中对齐 */
}

/* 遮罩层样式 */
.overlay {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
justify-content: center;
align-items: center;
z-index: 10000;
}

/* 排行榜弹窗样式 */
.leaderboard-popup {
background-color: #faf8ef;
padding: 20px;
border-radius: 10px;
width: 90%;
max-width: 375px;
position: relative;
max-height: 80vh; /* 限制弹窗最大高度 */
overflow: hidden; /* 隐藏超出部分 */
display: flex;
flex-direction: column;
}

/* 关闭按钮 */
.leaderboard-close-btn {
position: absolute;
top: 5px;
right: 10px;
font-size: 24px;
cursor: pointer;
color: #8f7a66;
transition: color 0.2s ease;
}

.leaderboard-close-btn:hover {
color: #7b6a5a;
}

/* 排行榜分类标签 */
.ranking-tabs {
display: flex;
justify-content: space-around;
margin-bottom: 10px;
}

.ranking-tabs .tab {
padding: 10px 20px;
cursor: pointer;
color: #8f7a66;
border-radius: 5px;
transition: background-color 0.2s ease, color 0.2s ease;
}

.ranking-tabs .tab.active {
background-color: #8f7a66;
color: white;
}

.ranking-tabs .tab:hover {
background-color: #7b6a5a;
color: white;
}

/* 表格容器 */
.table-container {
flex: 1; /* 填充剩余空间 */
overflow-y: auto; /* 允许内容滚动 */
padding-right: 10px; /* 避免内容被滚动条遮挡 */
margin-right: -10px; /* 抵消 padding-right 的影响 */
margin-top:10px;
}

/* 隐藏滚动条 */
.table-container::-webkit-scrollbar {
width: 0; /* 隐藏滚动条 */
}

/* 表格样式 */
.table-container table {
width: 100%;
border-collapse: collapse;
}

.table-container table td {
padding: 12px;
color:#776e65;
text-align: center;
border-bottom: 1px solid #ddd; /* 行间隔线 */
}

/* 不同名次颜色 */
.table-container table tr:nth-child(1) {
background-color: #fff3cd; /* 第一名 */
}

.table-container table tr:nth-child(2) {
background-color: #f3e5f5; /* 第二名 */
}

.table-container table tr:nth-child(3) {
background-color: #e2e3e5; /* 第三名 */
}

.table-container table tr:nth-child(n+4) {
background-color: white; /* 其他名次 */
}

/* 当前用户突出显示 */
.table-container table tr.current-user {
background-color: #8f7a66 !important; /* 覆盖其他名次颜色 */
color: white;
}

.table-container table tr.current-user .user-info span,.table-container table tr.current-user td {
color: white;
}
