:root {
  --bg: #080f29;
  --cyan: #00e5ff;
  --cyan-dim: rgba(0, 229, 255, 0.28);
  --text: #e8f6ff;
  --text-dim: #8fa6c9;
  --panel: rgba(13, 29, 80, 0.70);
  --panel-line: rgba(96, 146, 255, 0.26);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(1100px 620px at 50% -10%, rgba(44, 74, 190, 0.42), transparent 62%),
    radial-gradient(900px 520px at 8% 45%, rgba(30, 62, 168, 0.24), transparent 60%),
    radial-gradient(900px 520px at 92% 55%, rgba(52, 84, 205, 0.22), transparent 60%),
    #080f29;
}

/* 网格 + 星点背景 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 229, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.055) 1px, transparent 1px);
  background-size: 46px 46px, 46px 46px;
  mask-image: radial-gradient(circle at 50% 30%, #000 0%, rgba(0, 0, 0, 0.55) 55%, transparent 88%);
  -webkit-mask-image: radial-gradient(circle at 50% 30%, #000 0%, rgba(0, 0, 0, 0.55) 55%, transparent 88%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 18%, rgba(0, 229, 255, 0.7), transparent),
    radial-gradient(1px 1px at 28% 62%, rgba(120, 200, 255, 0.55), transparent),
    radial-gradient(1.4px 1.4px at 46% 12%, rgba(255, 255, 255, 0.5), transparent),
    radial-gradient(1px 1px at 63% 74%, rgba(0, 229, 255, 0.5), transparent),
    radial-gradient(1.2px 1.2px at 81% 26%, rgba(150, 210, 255, 0.6), transparent),
    radial-gradient(1px 1px at 92% 58%, rgba(0, 229, 255, 0.45), transparent),
    radial-gradient(1px 1px at 36% 88%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1.2px 1.2px at 72% 46%, rgba(0, 229, 255, 0.4), transparent);
}

.page {
  position: relative;
  z-index: 2;
  max-width: 1640px;
  margin: 0 auto;
  padding: 14px 26px 30px;
}

/* ------------------------------ 顶部 ------------------------------ */

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 6px 4px 12px;
  position: relative;
}

.semester-tabs {
  display: flex;
  gap: 10px;
  justify-self: start;
}

.sem-tab {
  padding: 6px 20px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-dim);
  border: 1px solid rgba(120, 170, 220, 0.22);
  background: rgba(15, 35, 65, 0.5);
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.sem-tab.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(180deg, #1a8cff, #0a6ad6);
  box-shadow: 0 0 16px rgba(26, 140, 255, 0.55);
}

.school-name {
  justify-self: center;
  margin: 0;
  font-size: 30px;
  letter-spacing: 6px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 18px rgba(0, 229, 255, 0.65), 0 0 46px rgba(0, 140, 255, 0.45);
}

.top-right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 12px;
}

.panel-select {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  border-radius: 4px;
  border: 1px solid rgba(0, 229, 255, 0.35);
  background: rgba(10, 40, 75, 0.65);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}

.panel-select:hover { border-color: rgba(0, 229, 255, 0.7); }

.caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--cyan);
}

.icon-grid {
  width: 34px;
  height: 34px;
  border-radius: 4px;
  border: 1px solid rgba(0, 229, 255, 0.3);
  background: rgba(10, 40, 75, 0.55);
  display: grid;
  grid-template-columns: repeat(2, 6px);
  grid-auto-rows: 6px;
  gap: 3px;
  place-content: center;
  cursor: pointer;
  padding: 0;
}

.icon-grid i {
  display: block;
  border: 1px solid var(--cyan);
  border-radius: 1px;
  opacity: 0.85;
}

/* 年级导航 */
.grade-nav {
  display: flex;
  justify-content: center;
  gap: 40px;
  padding: 10px 0 16px;
  border-bottom: 1px solid rgba(0, 229, 255, 0.1);
  margin-bottom: 16px;
}

.grade-item {
  position: relative;
  font-size: 16px;
  color: #93aac6;
  cursor: pointer;
  padding-bottom: 8px;
  transition: color 0.2s;
  user-select: none;
}

.grade-item:hover { color: #cfe9ff; }

.grade-item.active {
  color: var(--cyan);
  font-weight: 600;
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.6);
}

.grade-item.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 34px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  box-shadow: 0 0 10px var(--cyan);
}

/* ------------------------------ 卡片通用 ------------------------------ */

.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 6px;
  padding: 12px 16px 14px;
  backdrop-filter: blur(3px);
  box-shadow: inset 0 0 40px rgba(0, 120, 200, 0.08);
}

.card::before,
.card::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(0, 229, 255, 0.75);
  pointer-events: none;
}

.card::before { left: -1px; top: -1px; border-right: 0; border-bottom: 0; }
.card::after { right: -1px; bottom: -1px; border-left: 0; border-top: 0; }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #eaf8ff;
  letter-spacing: 0.5px;
}

.card-title::before {
  content: "";
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--cyan), rgba(0, 229, 255, 0.1));
  box-shadow: 0 0 8px var(--cyan);
}

.more-link {
  font-size: 12px;
  color: #7fa8cc;
  cursor: pointer;
  text-decoration: none;
}

.more-link:hover { color: var(--cyan); }

.mini-select {
  font-size: 12px;
  color: #a8c6e2;
  border: 1px solid rgba(0, 229, 255, 0.28);
  background: rgba(8, 30, 58, 0.85);
  border-radius: 3px;
  padding: 3px 6px;
  font-family: inherit;
  outline: none;
}

/* ------------------------------ 星级区 ------------------------------ */

.stars-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 18px 26px;
  margin-bottom: 14px;
}

.ring-group {
  display: flex;
  gap: 18px;
  align-items: center;
  flex: 1;
}

.ring-group.right { justify-content: flex-end; }

.ring {
  width: 150px;
  text-align: center;
}

.ring-body {
  position: relative;
  width: 118px;
  height: 118px;
  margin: 0 auto;
}

.ring-chart { width: 100%; height: 100%; }

.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.ring-value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  font-family: "DIN Alternate", "Bahnschrift", Arial, sans-serif;
}

.ring-badge {
  position: relative;
  width: 26px;
  height: 26px;
  margin-bottom: 2px;
}

.ring-name {
  margin-top: 8px;
  font-size: 13px;
  color: #b9d6ee;
  letter-spacing: 1px;
  white-space: nowrap;
}

.ring-count {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-dim);
}

.ring-count b { color: #cfe9ff; font-weight: 600; }

.radar-wrap {
  flex: 0 0 460px;
  height: 262px;
  position: relative;
}

/* ------------------------------ 第二屏 ------------------------------ */

.grid-main {
  display: grid;
  grid-template-columns: 1fr 1.65fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.grid-sub {
  display: grid;
  grid-template-columns: 1fr 2.65fr;
  gap: 14px;
}

/* 优秀榜 */
.top-list {
  list-style: none;
  margin: 0;
  padding: 2px 0 0;
}

.top-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 2px;
  border-bottom: 1px dashed rgba(0, 229, 255, 0.1);
}

.top-item:last-child { border-bottom: 0; }

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex: 0 0 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #eaf8ff;
  background: linear-gradient(145deg, #1567b8, #0b3a6b);
  border: 1px solid rgba(0, 229, 255, 0.45);
  box-shadow: 0 0 10px rgba(0, 180, 255, 0.28);
  overflow: hidden;
  object-fit: cover;
}

.top-name { font-size: 14px; color: #eaf8ff; }
.top-class { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* 班级排行 */
.rank-list {
  list-style: none;
  margin: 0;
  padding: 2px 0 0;
}

.rank-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px dashed rgba(0, 229, 255, 0.1);
}

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

.medal {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #06131f;
  flex: 0 0 26px;
}

.medal.m1 { background: linear-gradient(145deg, #ffd76e, #e1a021); box-shadow: 0 0 12px rgba(255, 200, 70, 0.55); }
.medal.m2 { background: linear-gradient(145deg, #cfe3f5, #8aa7bf); box-shadow: 0 0 12px rgba(180, 210, 240, 0.45); }
.medal.m3 { background: linear-gradient(145deg, #e2a06a, #b06c33); box-shadow: 0 0 12px rgba(220, 150, 90, 0.45); }
.medal.mn { background: rgba(120, 170, 220, 0.18); color: #a8c6e2; box-shadow: none; border: 1px solid rgba(0, 229, 255, 0.25); }

.rank-name { flex: 1; font-size: 14px; color: #e4f4ff; }
.rank-score {
  font-size: 15px;
  font-weight: 700;
  color: var(--cyan);
  font-family: "DIN Alternate", "Bahnschrift", Arial, sans-serif;
}

.chart { width: 100%; }

#trendChart { height: 232px; }
#levelChart { height: 210px; }
#usageChart { height: 210px; }

.empty-tip {
  color: var(--text-dim);
  font-size: 13px;
  padding: 24px 0;
  text-align: center;
}

.watermark {
  margin-top: 18px;
  text-align: center;
  font-size: 11px;
  color: rgba(140, 175, 210, 0.42);
  letter-spacing: 1px;
}

/* 全屏时略微放大留白 */
body:fullscreen .page { max-width: none; padding: 22px 34px; }
