﻿:root {
  color-scheme: light;
  --text: #182033;
  --muted: #697386;
  --line: #dce3ef;
  --primary: #2457d6;
  --gold: #f3b51b;
  --silver: #a7b1c2;
  --bronze: #c5783c;
  --fourth: #5a8fcb;
  --fifth: #8f6ad8;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

* { box-sizing: border-box; }

html,
body {
  margin: 0;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

body {
  min-height: 100vh;
  background:
    linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)),
    url("assets/page-background.jpg") center / cover fixed;
  color: var(--text);
}

body.modal-open { overflow: hidden; }
.stats-link-row { display: flex; justify-content: center; margin: 0 0 24px; }
.stats-link { display: inline-flex; align-items: center; gap: 10px; border: 1px solid #cfaa51; border-radius: 999px; padding: 11px 22px; background: #171b24; color: #ffe39c; text-decoration: none; font: inherit; font-weight: 700; cursor: pointer; }
.stats-link span { font-size: 12px; }
.stats-link:hover { background: #30291c; }
.stats-link:focus-visible { outline: 2px solid #ffe39c; outline-offset: 4px; }
.stats-link:disabled { opacity: .6; cursor: wait; }
[hidden] { display: none !important; }

.topbar {
  display: grid;
  grid-template-columns: 120px 1fr 120px;
  align-items: center;
  padding: 0;
  background: #111827;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.title-block {
  position: relative;
  grid-column: 2;
  overflow: hidden;
  text-align: center;
}

.title-block::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 34%;
  transform: translateX(-140%) skewX(-18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.34), transparent);
  animation: titleLightSweep 3.8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes titleLightSweep {
  0%, 25% { transform: translateX(-140%) skewX(-18deg); }
  75%, 100% { transform: translateX(340%) skewX(-18deg); }
}

.title-image {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
}

main {
  width: min(1160px, calc(100% - 32px));
  margin: 28px auto 56px;
}

.data-status {
  margin: 0 0 14px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.summary {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: clamp(4px, 1.5vw, 18px);
  margin-bottom: 22px;
}

.medal {
  position: relative;
  flex: 0 1 clamp(62px, 17vw, 190px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: clamp(62px, 17vw, 190px);
  height: clamp(62px, 17vw, 190px);
  padding: clamp(24px, 6.2vw, 70px) clamp(8px, 3.8vw, 42px) clamp(8px, 3.5vw, 40px);
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  text-align: center;
  transition: transform 160ms ease, filter 160ms ease;
}

.medal:hover,
.medal:focus-visible {
  transform: translateY(-2px);
  filter: brightness(1.08);
  outline: none;
}

.medal::before {
  content: "";
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  pointer-events: none;
}

.medal.gold::before { background-image: url("assets/medal-frame-1.png"); }
.medal.silver::before { background-image: url("assets/medal-frame-2.png"); }
.medal.bronze::before { background-image: url("assets/medal-frame-3.png"); }
.medal.fourth::before { background-image: url("assets/medal-frame-4.png"); }
.medal.fifth::before { background-image: url("assets/medal-frame-5.png"); }

.medal span,
.medal strong {
  position: relative;
  z-index: 1;
  display: block;
}

.medal span {
  margin-top: clamp(6px, 1.6vw, 18px);
  color: #687386;
  font-size: clamp(8px, 1.6vw, 16px);
  font-weight: 900;
}

.medal strong {
  color: #2457d6;
  font-size: clamp(20px, 4.5vw, 54px);
  line-height: 0.95;
}

.gold strong { color: var(--gold); }
.silver strong { color: var(--silver); }
.bronze strong { color: var(--bronze); }
.fourth strong { color: var(--fourth); }
.fifth strong { color: var(--fifth); }

.grade-filter {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: clamp(2px, 1vw, 12px);
  width: 100%;
  margin: 0 0 24px;
}

.grade-button {
  position: relative;
  flex: 0 1 calc((100% - 72px) / 7);
  display: inline-grid;
  place-items: center;
  width: clamp(42px, 13vw, 178px);
  max-width: 178px;
  aspect-ratio: 1.56;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: filter 160ms ease, transform 160ms ease;
}

.grade-button::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--grade-image);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  pointer-events: none;
}

.grade-button:hover,
.grade-button:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.08);
  outline: none;
}

.grade-button.active {
  filter: drop-shadow(0 8px 14px rgba(235, 181, 52, 0.35)) brightness(1.08);
}

.level-filter {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: clamp(2px, 1vw, 12px);
  width: 100%;
  margin: -10px 0 28px;
}

.level-button,
.view-mode-button {
  border-radius: 999px;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.level-button {
  flex: 0 1 calc((100% - 72px) / 7);
  width: clamp(42px, 13vw, 178px);
  max-width: 178px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-width: 0;
  min-height: clamp(34px, 5vw, 48px);
  border: 1px solid rgba(255, 210, 92, 0.5);
  background: rgba(0, 0, 0, 0.78);
  color: #f6e7b0;
  padding: clamp(5px, 0.85vw, 9px) clamp(2px, 0.8vw, 10px);
  text-align: center;
  line-height: 1.05;
  white-space: normal;
}
.level-zh,
.level-ms {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.level-zh {
  font-size: clamp(8px, 1.15vw, 15px);
}

.level-ms {
  margin-top: 2px;
  font-size: clamp(6px, 0.82vw, 10px);
}

.level-button:hover,
.level-button:focus-visible,
.view-mode-button:hover,
.view-mode-button:focus-visible {
  transform: translateY(-1px);
  border-color: var(--gold);
  outline: none;
}

.level-button.active {
  border-color: var(--gold);
  background: linear-gradient(135deg, #f3b51b, #fff0a8, #c78a16);
  color: #071327;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
}

.view-mode-filter {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: clamp(8px, 1.4vw, 18px);
  width: min(100%, 930px);
  margin: -14px auto 30px;
}

.view-mode-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  min-width: 0;
  gap: clamp(6px, 1vw, 10px);
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.86);
  padding: clamp(7px, 1.1vw, 11px) clamp(8px, 1.7vw, 20px);
  font-size: clamp(11px, 1.35vw, 18px);
}
.view-mode-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.08;
}
.statistics-nav-button { text-decoration: none; border-color: #cfaa51; color: #ffe39c; }

.view-mode-zh,
.view-mode-ms {
  display: block;
  overflow: hidden;
  text-align: left;
  text-overflow: clip;
  white-space: nowrap;
}

.view-mode-zh {
  font-size: 1em;
}

.view-mode-ms {
  margin-top: 2px;
  font-size: 0.72em;
}

.view-mode-button strong {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  padding: 3px 9px;
  font-size: 1.05em;
  line-height: 1.1;
}

.view-mode-button.active {
  border-color: var(--gold);
  background: rgba(243, 181, 27, 0.24);
  color: #ffe8a0;
}

.view-mode-button.active strong {
  background: var(--gold);
  color: #071327;
}

.student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}

.student-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  min-height: 260px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.8);
  cursor: pointer;
  text-align: center;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.student-card:hover,
.student-card:focus-visible {
  transform: translateY(-2px);
  border-color: #b7c7ef;
  box-shadow: 0 14px 30px rgba(31, 45, 70, 0.2);
  outline: none;
}

.avatar-frame {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 112px;
  height: 112px;
  justify-self: center;
}

.avatar-window {
  position: absolute;
  z-index: 1;
  width: 82%;
  height: 82%;
  margin-top: -9%;
  overflow: hidden;
  border-radius: 50%;
  background: #dfe8f8;
}

.avatar,
.avatar-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.08);
}

.avatar-initials {
  display: grid;
  place-items: center;
  color: #2457d6;
  font-size: 26px;
  font-weight: 900;
}

.frame-image {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.student-card > span,
.student-profile-text {
  min-width: 0;
}

.student-name {
  display: block;
  color: #ffffff;
  font-size: 20px;
  font-weight: 950;
  line-height: 1.12;
  white-space: nowrap;
}
.student-card-info { display: flex; flex-direction: column; align-items: center; width: 100%; flex: 1; gap: 8px; }
.student-card .student-name { width: 100%; }
.student-card-counts { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; width: 100%; flex: 1; margin-top: 8px; }
.student-card .medal-summary { justify-content: center; }
.student-card .avatar-frame { flex-shrink: 0; }

.class-name,
.award-total {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
}

.medal-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 7px;
  margin-top: 4px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.medal-summary span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.medal-summary img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.award-total { margin-top: 3px; font-weight: 700; }

.participation-count {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f3b51b, #fff0a8, #c78a16);
  color: #071327;
  padding: 6px 12px;
  font-size: 15px;
  font-weight: 950;
}

.empty-state {
  grid-column: 1 / -1;
  margin: 0;
  padding: 18px;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 800;
  text-align: center;
}

.ghost-button {
  grid-column: 3;
  justify-self: end;
  margin-right: clamp(12px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--primary);
  padding: 10px 14px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.ghost-button.small { padding: 7px 11px; font-size: 14px; }
.detail-back { margin: 0 0 16px; }

.profile {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 18px;
  padding: 24px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.78);
  text-align: center;
}

.profile .avatar-frame {
  width: min(360px, 80vw);
  height: min(360px, 80vw);
}

.profile h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(28px, 4vw, 48px);
}

.award-list {
  display: grid;
  gap: 14px;
}

.level-group {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
}

.level-title,
.rank-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  background: #eef3fb;
  border-bottom: 1px solid var(--line);
}

.level-title h3,
.rank-results-header h2,
.award-name,
.eyebrow {
  margin: 0;
}

.award-item,
.rank-result-item {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.award-item:last-child,
.rank-result-item:last-child { border-bottom: 0; }

.rank-badge {
  position: relative;
  overflow: hidden;
  display: inline-grid;
  place-items: center;
  min-height: 42px;
  border-radius: 999px;
  color: #fff;
  font-weight: 900;
}

.rank-badge::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 30%;
  transform: translateX(-160%) skewX(-20deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  animation: badgeLightSweep 1.45s ease-in-out infinite;
}

@keyframes badgeLightSweep {
  0% { transform: translateX(-160%) skewX(-20deg); }
  100% { transform: translateX(380%) skewX(-20deg); }
}

.rank-gold { background: var(--gold); }
.rank-silver { background: #8d98aa; }
.rank-bronze { background: var(--bronze); }
.rank-fourth { background: var(--fourth); }
.rank-fifth { background: var(--fifth); }
.rank-participation { background: #1f2937; }

.award-name {
  color: #1f2937;
  font-weight: 900;
}

.award-meta,
.award-year {
  margin: 4px 0 0;
  color: #667085;
  font-weight: 700;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(12, 18, 32, 0.52);
}

.modal-panel {
  width: min(920px, 100%);
  max-height: min(86vh, 760px);
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.rank-result-list {
  display: grid;
  max-height: min(62vh, 620px);
  overflow-y: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.rank-result-list::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.eyebrow {
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-footer {
  padding: 22px 16px;
  background: #05070d;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

.site-footer p { margin: 0; }

@media (max-width: 820px) {
  .topbar {
    display: flex;
    justify-content: center;
  }

  .title-block { width: 100%; }
  .ghost-button { align-self: center; }

  .award-item,
  .rank-result-item {
    grid-template-columns: 1fr;
  }

  .rank-results-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  main {
    width: min(100% - 22px, 1160px);
    margin-top: 18px;
  }

  .level-button {
    min-height: 32px;
    padding: 4px 2px;
  }

  .level-zh {
    font-size: 7px;
  }

  .level-ms {
    font-size: 5.5px;
  }

  .view-mode-button {
    gap: 5px;
    padding: 6px 7px;
    font-size: 9.5px;
  }

  .view-mode-button strong {
    min-width: 28px;
    padding: 3px 7px;
  }

  .student-grid { grid-template-columns: 1fr; }
  .student-card { min-height: 242px; }
  .avatar-frame { width: 94px; height: 94px; }
}


