:root {
  --bg: #070827;
  --panel: rgba(24, 27, 88, 0.72);
  --panel-strong: rgba(32, 35, 120, 0.78);
  --line: #4238ff;
  --line-soft: rgba(54, 77, 255, 0.42);
  --cyan: #21e7ff;
  --mint: #32ffa2;
  --gold: #ffae21;
  --text: #f5f7ff;
  --muted: #a9add0;
  --danger: #ff6a73;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  color: var(--text);
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    Arial,
    sans-serif;
  background:
    radial-gradient(circle at 20% 25%, rgba(44, 55, 170, 0.42), transparent 30%),
    radial-gradient(circle at 78% 60%, rgba(0, 225, 255, 0.18), transparent 26%),
    linear-gradient(120deg, #080827 0%, #11103d 48%, #09092d 100%);
  overflow: hidden;
}

.screen {
  position: relative;
  width: 100vw;
  min-width: 1280px;
  height: 100vh;
  min-height: 720px;
  padding: 34px 38px 30px;
  overflow: hidden;
}

.grid-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.65;
  background:
    repeating-linear-gradient(90deg, transparent 0 78px, rgba(32, 225, 255, 0.1) 79px, transparent 81px),
    repeating-linear-gradient(0deg, transparent 0 78px, rgba(32, 225, 255, 0.08) 79px, transparent 81px);
  transform: perspective(680px) rotateX(58deg) translateY(170px) scale(1.45);
  transform-origin: center bottom;
}

.grid-bg::before,
.grid-bg::after {
  content: "";
  position: absolute;
  width: 1040px;
  height: 620px;
  border: 1px solid rgba(31, 224, 255, 0.18);
  border-radius: 50%;
  left: 8%;
  top: 7%;
  transform: rotate(-14deg);
}

.grid-bg::after {
  width: 900px;
  height: 520px;
  left: 52%;
  top: 46%;
  transform: rotate(10deg);
}

.topbar {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 24px;
  height: 92px;
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 14px;
  font-size: clamp(22px, 2vw, 38px);
  white-space: nowrap;
  overflow: hidden;
}

.brand span {
  color: var(--gold);
  font-weight: 800;
}

.brand strong {
  min-width: 0;
  max-width: 520px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.week-badge {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  height: 38px;
  max-width: 230px;
  padding: 0 18px;
  color: #071033;
  background: linear-gradient(90deg, #ffe35c, var(--gold));
  border: 1px solid rgba(255, 226, 92, 0.7);
  border-radius: 22px;
  box-shadow: 0 0 18px rgba(255, 174, 33, 0.28);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logo-mark {
  position: relative;
  width: 52px;
  height: 52px;
  border: 7px solid var(--gold);
  border-bottom-color: transparent;
  border-radius: 50%;
}

.logo-mark::before,
.logo-mark::after {
  content: "";
  position: absolute;
  background: var(--gold);
}

.logo-mark::before {
  width: 7px;
  height: 19px;
  left: 18px;
  top: 21px;
  border-radius: 8px;
}

.logo-mark::after {
  width: 14px;
  height: 4px;
  left: 15px;
  top: 18px;
  border-radius: 8px;
}

.grade-tabs,
.week-switch {
  display: flex;
  align-items: center;
  gap: 30px;
}

.week-switch {
  justify-content: flex-end;
  gap: 18px;
}

.admin-link,
.back-link {
  display: inline-grid;
  place-items: center;
  min-width: 76px;
  height: 48px;
  color: #f1f4ff;
  text-decoration: none;
  background: rgba(36, 40, 108, 0.58);
  border: 1px solid rgba(91, 95, 255, 0.7);
  font-size: 22px;
}

button {
  font: inherit;
}

.tab {
  min-width: 94px;
  height: 42px;
  padding: 0 18px;
  color: rgba(245, 247, 255, 0.72);
  background: transparent;
  border: 0;
  border-radius: 22px;
  cursor: pointer;
  font-size: 26px;
}

.tab.active {
  color: #fff;
  background: var(--gold);
  box-shadow: 0 0 22px rgba(255, 174, 33, 0.28);
}

.ghost {
  height: 48px;
  min-width: 82px;
  color: #f1f4ff;
  background: rgba(36, 40, 108, 0.58);
  border: 1px solid rgba(91, 95, 255, 0.7);
  cursor: pointer;
  font-size: 22px;
}

.ghost.active {
  color: #4b78ff;
}

.ghost:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.dashboard {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 24.5% 45% 30.5%;
  grid-template-rows: calc(100vh - 156px);
  gap: 28px;
  min-height: 0;
}

.left-col,
.center-col,
.right-col {
  min-height: 0;
}

.left-col,
.right-col {
  display: grid;
  gap: 28px;
}

.left-col {
  grid-template-rows: 46% 54%;
}

.right-col {
  grid-template-rows: 61% 39%;
}

.center-col {
  display: grid;
  grid-template-rows: 98px 1fr 31%;
  gap: 24px;
  min-width: 0;
}

.panel,
.metric {
  position: relative;
  background: var(--panel);
  border: 2px solid var(--line);
  box-shadow:
    inset 0 0 35px rgba(64, 76, 255, 0.18),
    0 0 24px rgba(44, 40, 255, 0.16);
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent 35%, rgba(33, 231, 255, 0.04));
}

h2 {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 26px 20px 18px;
  color: var(--gold);
  font-size: 24px;
  line-height: 1;
  white-space: nowrap;
}

h2 i {
  display: inline-block;
  width: 5px;
  height: 24px;
  background: var(--cyan);
  box-shadow: 0 0 14px var(--cyan);
}

h2 em {
  color: #f2f0ff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  font-weight: 400;
  opacity: 0.92;
}

.ranking-list {
  position: relative;
  z-index: 1;
  height: calc(100% - 74px);
  padding: 0 30px 18px 34px;
  overflow: hidden;
}

.rank-row {
  display: grid;
  grid-template-columns: 38px 62px 1fr 42px;
  align-items: center;
  gap: 14px;
  height: 40px;
  color: #e7ebff;
  font-size: 16px;
}

.medal {
  color: #ffd84a;
  text-align: center;
  font-size: 25px;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(255, 216, 74, 0.45));
}

.class-code {
  color: rgba(241, 245, 255, 0.82);
  font-weight: 700;
}

.bar-track {
  height: 21px;
  border-radius: 18px;
  background: rgba(55, 67, 160, 0.3);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  min-width: 8%;
  border-radius: inherit;
  background: linear-gradient(90deg, #36b8ff, #3cff9a);
  box-shadow: 0 0 16px rgba(48, 246, 180, 0.35);
}

.score {
  color: #f6f8ff;
  font-weight: 700;
}

.winning-panel {
  padding-bottom: 110px;
}

.winning-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  padding: 8px 34px 0;
  max-height: calc(100% - 148px);
  overflow: hidden;
}

.winner-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  align-items: center;
  height: 58px;
  padding: 0 24px;
  color: rgba(38, 225, 255, 0.94);
  background: linear-gradient(120deg, rgba(42, 68, 180, 0.22), rgba(47, 52, 160, 0.64));
  border: 1px solid rgba(68, 85, 255, 0.45);
  border-radius: 8px;
  transform: skewX(-18deg);
}

.winner-row > span,
.winner-row > b {
  display: block;
  transform: skewX(18deg);
}

.winner-row b {
  color: rgba(222, 230, 255, 0.62);
  font-weight: 500;
}

.stamp {
  position: absolute;
  left: 50%;
  bottom: 70px;
  z-index: 2;
  width: 110px;
  height: 110px;
  transform: translateX(-50%) rotate(-9deg);
  display: grid;
  place-items: center;
  color: #ff4f22;
  background: radial-gradient(circle, #fff8de 50%, #fff 51%);
  border: 7px solid #ff8c1a;
  border-radius: 50%;
  font-size: 26px;
  font-weight: 900;
  line-height: 1.25;
  box-shadow: 0 0 24px rgba(255, 127, 24, 0.45);
}

.hint {
  position: absolute;
  left: 34px;
  right: 34px;
  bottom: 24px;
  z-index: 1;
  margin: 0;
  color: var(--cyan);
  text-align: center;
  font-size: 15px;
  line-height: 1.5;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 24px;
}

.metric {
  display: grid;
  place-items: center;
  min-width: 0;
  height: 90px;
  padding: 12px 10px;
  clip-path: polygon(0 0, 90% 0, 100% 16%, 100% 82%, 86% 100%, 0 100%);
}

.metric span {
  color: #f5f7ff;
  font-size: 22px;
  white-space: nowrap;
}

.metric strong {
  max-width: 100%;
  color: var(--cyan);
  font-size: 24px;
  line-height: 1.1;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.heatmap-wrap {
  position: relative;
  min-height: 0;
  padding: 44px 18px 20px 20px;
}

.legend {
  position: absolute;
  right: 22px;
  top: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #30e4ff;
  font-size: 14px;
}

.legend b {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.good-dot {
  background: #38dded;
}

.warn-dot {
  background: #ff6974;
}

.heatmap {
  display: grid;
  grid-template-columns: 44px repeat(8, minmax(58px, 1fr));
  grid-template-rows: 28px repeat(16, minmax(0, 1fr));
  grid-auto-rows: minmax(0, 1fr);
  height: 100%;
  color: rgba(241, 245, 255, 0.82);
  font-size: 13px;
  overflow: hidden;
}

.heat-cell,
.heat-label,
.heat-class {
  display: grid;
  place-items: center;
  min-width: 0;
}

.heat-class {
  justify-content: end;
  padding-right: 12px;
  color: rgba(241, 245, 255, 0.8);
  font-weight: 700;
}

.heat-label {
  align-items: end;
  padding-top: 9px;
  color: rgba(241, 245, 255, 0.82);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
}

.heat-cell {
  position: relative;
  background: rgba(42, 49, 143, 0.32);
  border-bottom: 1px solid rgba(15, 18, 54, 0.3);
}

.heat-cell.good {
  background: rgba(45, 247, 174, 0.16);
}

.heat-cell.warn {
  background: rgba(255, 91, 113, 0.38);
}

.heat-cell.blank:nth-child(2n) {
  background: rgba(37, 44, 132, 0.46);
}

.heat-cell span {
  color: #fff;
  font-weight: 800;
}

.trend-panel {
  padding: 0 28px 20px;
}

.trend-panel h2 {
  margin-left: 0;
  margin-bottom: 8px;
}

#trendChart {
  display: block;
  width: 100%;
  height: calc(100% - 62px);
}

.latest-panel,
.report-panel {
  min-height: 0;
}

.evaluation-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  padding: 0 26px 22px;
  max-height: calc(100% - 76px);
  overflow: hidden;
}

.event-card {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 16px;
  min-height: 54px;
  padding: 11px 14px;
  background: rgba(30, 38, 125, 0.5);
  border-left: 3px solid var(--cyan);
}

.event-card.negative {
  border-left-color: var(--danger);
}

.event-card strong {
  color: #fff;
}

.event-card span {
  color: rgba(235, 240, 255, 0.74);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-card b {
  color: var(--cyan);
  font-size: 19px;
}

.event-card.negative b {
  color: var(--danger);
}

.report-text {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
  padding: 2px 28px 26px;
  color: rgba(242, 246, 255, 0.86);
  font-size: 18px;
  line-height: 1.8;
}

.report-text strong {
  color: var(--gold);
}

.admin-body {
  overflow: auto;
}

.admin-shell {
  position: relative;
  width: 100vw;
  min-width: 1180px;
  min-height: 100vh;
  padding: 34px 44px 44px;
  overflow: hidden;
}

.admin-topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  height: 86px;
}

.back-link {
  width: 112px;
}

.admin-card {
  position: relative;
  z-index: 1;
  background: rgba(24, 27, 88, 0.82);
  border: 2px solid var(--line);
  box-shadow:
    inset 0 0 35px rgba(64, 76, 255, 0.16),
    0 0 24px rgba(44, 40, 255, 0.16);
}

.login-card {
  width: min(460px, 92vw);
  margin: 90px auto 0;
  padding: 42px;
}

.login-card h1 {
  margin: 0 0 32px;
  color: var(--gold);
  font-size: 34px;
  text-align: center;
}

.admin-form,
.report-form {
  display: grid;
  gap: 20px;
}

.admin-form label,
.report-form label {
  display: grid;
  gap: 9px;
  color: rgba(242, 246, 255, 0.88);
  font-size: 17px;
}

.admin-form input,
.report-form input,
.report-form select,
.report-form textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 15px;
  color: #fff;
  font: inherit;
  background: rgba(18, 24, 84, 0.82);
  border: 1px solid rgba(69, 95, 255, 0.72);
  outline: none;
}

.report-form textarea {
  min-height: 154px;
  padding: 14px 15px;
  line-height: 1.6;
  resize: vertical;
}

.report-form select {
  appearance: none;
}

.admin-form input:focus,
.report-form input:focus,
.report-form select:focus,
.report-form textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 16px rgba(33, 231, 255, 0.2);
}

.primary-action,
.secondary-action {
  height: 50px;
  padding: 0 28px;
  color: #fff;
  font-weight: 700;
  border: 0;
  cursor: pointer;
}

.primary-action {
  background: linear-gradient(90deg, var(--gold), #ff7d1c);
  box-shadow: 0 0 18px rgba(255, 174, 33, 0.28);
}

.secondary-action {
  background: rgba(44, 54, 151, 0.82);
  border: 1px solid rgba(91, 95, 255, 0.7);
}

.primary-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}

.form-message {
  min-height: 22px;
  margin: 0;
  color: rgba(242, 246, 255, 0.72);
  font-size: 15px;
}

.form-message.error {
  color: var(--danger);
}

.form-message.success {
  color: var(--mint);
}

.hidden {
  display: none !important;
}

.admin-workspace {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 280px minmax(520px, 1fr) 360px;
  gap: 24px;
  margin-top: 28px;
  align-items: start;
}

.account-card,
.upload-card,
.records-card {
  min-height: 620px;
  padding: 0 28px 28px;
}

.account-card h2,
.upload-card h2,
.records-card h2 {
  margin-left: 0;
}

.account-state {
  display: grid;
  gap: 8px;
  margin: 36px 0 28px;
  padding: 28px;
  background: rgba(31, 39, 128, 0.58);
  border: 1px solid rgba(69, 95, 255, 0.48);
}

.account-state strong {
  color: var(--cyan);
  font-size: 30px;
}

.account-state span {
  color: rgba(242, 246, 255, 0.74);
}

.admin-note {
  margin: 0 0 26px;
  color: rgba(242, 246, 255, 0.72);
  font-size: 15px;
  line-height: 1.7;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 18px;
}

.file-drop {
  min-height: 112px;
  place-items: center;
  padding: 18px;
  text-align: center;
  background: rgba(15, 21, 78, 0.7);
  border: 1px dashed rgba(33, 231, 255, 0.6);
  cursor: pointer;
}

.file-drop input {
  display: none;
}

.file-drop strong {
  color: var(--cyan);
  font-size: 21px;
}

.file-drop span {
  color: rgba(242, 246, 255, 0.68);
  font-size: 15px;
}

.excel-drop {
  min-height: 190px;
}

.parse-preview {
  display: grid;
  gap: 8px;
  min-height: 94px;
  padding: 20px;
  background: rgba(31, 39, 128, 0.58);
  border: 1px solid rgba(69, 95, 255, 0.48);
}

.parse-preview strong {
  color: var(--gold);
  font-size: 22px;
}

.parse-preview span {
  color: rgba(242, 246, 255, 0.72);
  line-height: 1.5;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.report-records {
  display: grid;
  gap: 14px;
}

.record-item,
.empty-record {
  margin: 0;
  padding: 18px;
  background: rgba(31, 39, 128, 0.58);
  border-left: 3px solid var(--cyan);
}

.record-item {
  display: grid;
  gap: 8px;
}

.record-item strong {
  color: var(--gold);
}

.record-item.latest-record {
  border-left-color: var(--gold);
  background: rgba(54, 47, 128, 0.78);
}

.record-item p {
  margin: 0;
  color: #fff;
}

.record-item span,
.empty-record {
  color: rgba(242, 246, 255, 0.68);
  font-size: 14px;
}

@media (max-width: 1500px) {
  .screen {
    min-width: 1180px;
    padding: 22px 24px 12px;
  }

  .dashboard {
    grid-template-columns: 24% 44% 32%;
    grid-template-rows: calc(100vh - 128px);
    gap: 16px;
  }

  h2 {
    margin: 22px 18px 14px;
    font-size: 19px;
  }

  h2 em {
    font-size: 16px;
  }

  .brand {
    gap: 10px;
    font-size: 24px;
  }

  .brand strong {
    max-width: 230px;
  }

  .week-badge {
    height: 34px;
    max-width: 190px;
    padding: 0 14px;
    font-size: 15px;
  }

  .logo-mark {
    width: 44px;
    height: 44px;
    border-width: 6px;
  }

  .logo-mark::before {
    left: 15px;
    top: 18px;
  }

  .logo-mark::after {
    left: 12px;
    top: 16px;
  }

  .topbar {
    height: 82px;
    gap: 14px;
  }

  .grade-tabs {
    gap: 18px;
  }

  .tab {
    min-width: 84px;
    height: 40px;
    font-size: 21px;
  }

  .ghost {
    min-width: 74px;
    height: 44px;
    font-size: 19px;
  }

  .admin-link {
    min-width: 64px;
    height: 44px;
    font-size: 19px;
  }

  .left-col,
  .right-col,
  .center-col {
    gap: 16px;
  }

  .center-col {
    grid-template-rows: 90px minmax(0, 1fr) 30%;
  }

  .metric-row {
    gap: 10px;
  }

  .metric {
    height: 88px;
  }

  .metric span {
    font-size: 18px;
  }

  .metric strong {
    font-size: 21px;
  }

  .rank-row {
    grid-template-columns: 30px 52px 1fr 30px;
    gap: 10px;
    height: 33px;
    font-size: 15px;
  }

  .medal {
    font-size: 22px;
  }

  .ranking-list {
    padding: 0 22px 14px 28px;
  }

  .winning-list {
    gap: 10px;
    padding: 2px 28px 0;
  }

  .winner-row {
    height: 50px;
    padding: 0 20px;
  }

  .stamp {
    bottom: 74px;
    width: 100px;
    height: 100px;
    font-size: 24px;
  }

  .heatmap-wrap {
    padding: 40px 16px 10px 14px;
  }

  .legend {
    right: 14px;
    gap: 9px;
    font-size: 12px;
  }

  .heatmap {
    grid-template-columns: 42px repeat(8, minmax(0, 1fr));
    grid-template-rows: 24px repeat(16, minmax(0, 1fr));
    font-size: 12px;
  }

  .heat-label {
    font-size: 11px;
  }

  .trend-panel {
    padding: 0 20px 16px;
  }

  .event-card {
    grid-template-columns: 60px 1fr 34px;
    gap: 10px;
    min-height: 52px;
    padding: 9px 12px;
  }

  .report-text {
    gap: 10px;
    padding: 0 28px 20px;
    font-size: 16px;
    line-height: 1.65;
  }

  .admin-shell {
    padding: 24px;
  }

  .admin-workspace {
    grid-template-columns: 240px minmax(480px, 1fr) 320px;
    gap: 18px;
  }

  .account-card,
  .upload-card,
  .records-card {
    min-height: 590px;
    padding: 0 22px 22px;
  }
}

@media (max-width: 900px) {
  .admin-shell {
    min-width: 0;
    padding: 18px;
    overflow: visible;
  }

  .admin-topbar {
    height: auto;
    align-items: flex-start;
    flex-direction: column-reverse;
  }

  .admin-topbar .brand {
    white-space: normal;
  }

  .login-card {
    margin-top: 38px;
    padding: 28px;
  }

  .admin-workspace {
    grid-template-columns: 1fr;
    margin-top: 20px;
  }

  .account-card,
  .upload-card,
  .records-card {
    min-height: 0;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-actions {
    display: grid;
  }
}
