/* 全局重置与基础样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft Yahei", sans-serif;
}

body {
  /* ====== 背景图配置 - 在此替换 URL ====== */
  background-image: url('https://p1.ssl.qhimgs1.com/sdr/400__/t04cc913c170111406b.png'),
  radial-gradient(
    circle at center, 
    /* 替换这里：第一个占位符填中间色号（比如浅米色 #F8F5F0） */
    var(--center-color, #983956), 
    /* 替换这里：第二个占位符填两侧色号（比如极浅灰 #F2F2F2） */
    var(--edge-color, #C3445E)
  );
  /* ======================================== */
  
  background-size: contain;
  background-position: center top;
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-color: #f5f5f7;  /* 苹果灰，比纯白更有质感 */
  
  padding: 40px 20px;
  color: #1d1d1f;
  min-height: 100vh;
  line-height: 1.6;
}

/* 遮罩层 - 降低背景干扰 */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* background: rgba(245, 245, 247, 0.7);
  z-index: -1; */
}

/* 容器样式 - 增加质感 */
.container {
  max-width: 960px;
  margin: 0 auto;
  background: rgba(245, 245, 247, 0.95);
  padding: 48px 40px 8px 40px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 
    0 4px 24px rgba(0, 0, 0, 0.06),
    0 1px 3px rgba(0, 0, 0, 0.03);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* 头部样式 */
header {
  margin-bottom: 10px;
  text-align: center;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

header h1 {
  color: #1d1d1f;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.3px;
  /* margin-bottom: 14px; */
  background: linear-gradient(135deg, #1d1d1f 0%, #4a4a4a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.disclaimer {
  color: #86868b;
  font-size: 13px;
  max-width: 600px;
  margin: 10px auto;
  line-height: 1.7;
  text-align: center;
}

/* PB艺术字样式 */
.pb-logo {
  position: relative;
  display: inline-block;
  /* vertical-align: middle; */
  height: 1em;
   /* 核心1：对齐h1文字的基线 */
  vertical-align: baseline;
  /* 核心2：消除图片默认的空白间隙 */
  line-height: 1;
  /* 可选：微调图片与文字的间距 */
  margin: 0 4px 0 0;
}

.pb-logo img {
  /* vertical-align: middle; */
  vertical-align: baseline;
  /* 核心4：高度匹配h1文字大小，避免错位 */
  height: 1em;
  max-height: none; /* 覆盖行内样式的max-height */
  width: auto; /* 保持宽高比 */
}

.pb-logo .fallback-text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  font-weight: inherit;
   font-size: 1em;
  line-height: 1;
}

/* 当图片加载成功时，隐藏后备文字 */
.pb-logo img[src]:not([src=""]) + .fallback-text {
  display: none;
}

/* 加载动画样式 */
.loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(245, 245, 247, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.loading.active {
  opacity: 1;
  visibility: visible;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top: 3px solid #1d1d1f;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading p {
  color: #6e6e73;
  font-size: 14px;
  font-weight: 500;
}

/* 搜索框样式 - 增加精致感 */
.search-bar {
  margin: 32px 0;
  text-align: center;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.search-bar input {
  padding: 14px 24px;
  width: 100%;
  max-width: 300px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  font-size: 15px;
  outline: none;
  background: #fafafa;
  transition: all 0.25s ease;
  color: #1d1d1f;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.search-bar input:focus {
  border-color: rgba(0, 0, 0, 0.25);
  background: #ffffff;
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.06),
    0 0 0 3px rgba(0, 0, 0, 0.04);
  transform: translateY(-1px);
}

.search-bar input::placeholder {
  color: #a1a1a6;
}

/* 筛选按钮栏样式 */
.filter-bar {
  margin: 24px 0 32px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.filter-bar button {
  padding: 9px 18px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f9f9fb 100%);
  color: #3a3a3c;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.filter-bar button:hover {
  background: linear-gradient(180deg, #f5f5f7 0%, #efeff1 100%);
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.filter-bar button:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.filter-bar select {
  padding: 9px 16px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f9f9fb 100%);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: #3a3a3c;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.filter-bar select:hover {
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.filter-bar select:focus {
  outline: none;
  border-color: rgba(0, 0, 0, 0.25);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
}

/* 排名表格样式 */
.ranking-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  border-radius: 12px;
  overflow: hidden;
}

.ranking-table th, .ranking-table td {
  padding: 16px 14px;
  text-align: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.ranking-table th {
  background: linear-gradient(180deg, #fafafa 0%, #f5f5f7 100%);
  color: #6e6e73;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.ranking-table tbody tr {
  transition: all 0.2s ease;
}

.ranking-table tbody tr:hover {
  background: linear-gradient(180deg, #fafafa 0%, #f5f5f7 100%);
  transform: scale(1.005);
}

/* 选中时成绩列变红 */
.ranking-table tbody tr.selected .pb {
  color: #ff3b30;
  font-weight: 800;
  font-size: 16px;
}

.ranking-table .pb {
  font-weight: 600;
  color: #1d1d1f;
  font-size: 15px;
  letter-spacing: -0.3px;
}

/* 排名数字样式 */
.ranking-table td:first-child {
  font-weight: 600;
  color: #6e6e73;
  font-size: 15px;
}

/* 前三名特殊样式 - 精致金属色 */
.ranking-table .gold-medal td:first-child {
  color: #c9a962;
  text-shadow: 0 0 1px rgba(201, 169, 98, 0.3);
}

.ranking-table .silver-medal td:first-child {
  color: #a8a8a8;
  text-shadow: 0 0 1px rgba(168, 168, 168, 0.3);
}

.ranking-table .bronze-medal td:first-child {
  color: #b88a6a;
  text-shadow: 0 0 1px rgba(184, 138, 106, 0.3);
}

/* 前三名成绩特殊颜色 */
.ranking-table .gold-medal .pb {
  color: #c9a962;
  text-shadow: 0 0 1px rgba(201, 169, 98, 0.3);
}

.ranking-table .silver-medal .pb {
  color: #a8a8a8;
  text-shadow: 0 0 1px rgba(168, 168, 168, 0.3);
}

.ranking-table .bronze-medal .pb {
  color: #b88a6a;
  text-shadow: 0 0 1px rgba(184, 138, 106, 0.3);
}

/* 分页控件样式 */
.pagination {
  margin: 40px 0 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.pagination button {
  padding: 9px 18px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f9f9fb 100%);
  color: #3a3a3c;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.pagination button:hover:not(:disabled) {
  background: linear-gradient(180deg, #f5f5f7 0%, #efeff1 100%);
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.pagination button:disabled {
  color: #d2d2d7;
  cursor: not-allowed;
  border-color: rgba(0, 0, 0, 0.05);
  background: #fafafa;
  box-shadow: none;
}

.pagination #pageInfo {
  color: #6e6e73;
  font-size: 14px;
  font-weight: 500;
  padding: 9px 16px;
  background: #f5f5f7;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

/* 响应式适配 */
@media (max-width: 768px) {
  .container {
    padding: 32px 24px;
  }

  header h1 {
    font-size: 26px;
  }

  /* 优化移动端搜索框 */
  .search-bar {
    margin: 20px 0;
  }

  .search-bar input {
    padding: 12px 20px;
    font-size: 14px;
    max-width: 100%;
  }

  .filter-bar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    margin: 16px 0 24px;
  }

  .filter-bar button,
  .filter-bar select {
    width: calc(50% - 5px);
    padding: 8px 16px;
    font-size: 12px;
  }

  .ranking-table th, .ranking-table td {
    padding: 14px 10px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 20px 12px;
  }

  .container {
    padding: 24px 16px;
  }

  /* 进一步优化小屏幕搜索框 */
  .search-bar {
    margin: 16px 0;
  }

  .search-bar input {
    padding: 10px 16px;
    font-size: 13px;
  }

  .filter-bar {
    margin: 12px 0 20px;
  }

  .ranking-table th:nth-child(7),
  .ranking-table td:nth-child(7) {
    display: none;
  }
}

/* 滚动条样式 - 精致版 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f5f5f7;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: #d2d2d7;
  border-radius: 4px;
  transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: #a1a1a6;
}