:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --text: #0f172a;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --brand: #2563eb;
  --brand-strong: #1d4ed8;
  --brand-soft: #dbeafe;
  --green: #16a34a;
  --green-soft: #dcfce7;
  --red: #dc2626;
  --red-soft: #fee2e2;
  --amber: #d97706;
  --amber-soft: #fef3c7;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  --radius: 8px;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
}

.boot-screen,
.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 28%),
    linear-gradient(135deg, #f8fafc 0%, #eef4ff 100%);
}

.boot-card,
.login-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  font-size: 20px;
}

.login-card h1,
.boot-card h1 {
  margin: 18px 0 8px;
  font-size: 24px;
}

.login-card p,
.boot-card p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.7;
}

.app-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #0f172a;
  color: #e2e8f0;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.side-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px 8px 18px;
}

.side-brand .brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
}

.side-brand strong {
  display: block;
  color: #fff;
  font-size: 15px;
}

.side-brand span {
  display: block;
  margin-top: 3px;
  color: #94a3b8;
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 4px;
}

.nav button {
  width: 100%;
  text-align: left;
  background: transparent;
  color: #cbd5e1;
  padding: 11px 12px;
  border-radius: 8px;
}

.nav button:hover,
.nav button.active {
  background: rgba(148, 163, 184, 0.14);
  color: #fff;
}

.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 64px;
  background: rgba(255, 255, 255, 0.86);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
}

.topbar h2 {
  margin: 0;
  font-size: 18px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.content {
  padding: 24px 28px 40px;
}

.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.view-header h1 {
  margin: 0 0 6px;
  font-size: 24px;
}

.view-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.grid {
  display: grid;
  gap: 16px;
}

.grid.two {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.55fr);
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-head h3 {
  margin: 0;
  font-size: 16px;
}

.panel-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.panel-body {
  padding: 18px;
}

.metric {
  padding: 18px;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 28px;
}

.metric small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  color: #334155;
  font-weight: 700;
  font-size: 13px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 10px 11px;
  background: #fff;
  color: var(--text);
  outline: none;
}

.field textarea {
  min-height: 74px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.btn:hover {
  background: var(--brand-strong);
}

.btn.secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--line-strong);
}

.btn.secondary:hover {
  background: var(--panel-soft);
}

.btn.danger {
  background: var(--red);
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}

.btn.small {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--panel-soft);
  color: #334155;
  font-size: 12px;
  white-space: nowrap;
}

td {
  color: #1f2937;
}

tr:hover td {
  background: #fbfdff;
}

.tag-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  line-height: 1.5;
}

.tag.green {
  background: var(--green-soft);
  color: #166534;
}

.tag.red {
  background: var(--red-soft);
  color: #991b1b;
}

.tag.amber {
  background: var(--amber-soft);
  color: #92400e;
}

.muted {
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 28px;
  color: var(--muted);
  background: var(--panel-soft);
  text-align: center;
}

.dimension-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.dimension-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dimension-title h3 {
  margin: 0;
  font-size: 16px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.project-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--panel-soft);
}

.project-box h4 {
  margin: 0 0 10px;
}

.checks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  max-height: 250px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #334155;
}

.check input {
  width: 16px;
  height: 16px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(420px, calc(100vw - 44px));
  padding: 13px 15px;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  box-shadow: var(--shadow);
  z-index: 50;
}

.toast.error {
  background: #991b1b;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 40;
}

.modal {
  width: min(720px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.modal .panel-head {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

.student-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.rank-num {
  font-weight: 800;
  color: var(--brand);
}

.subtle-list {
  display: grid;
  gap: 8px;
}

.audit-line {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.audit-line:last-child {
  border-bottom: 0;
}

.audit-line strong {
  color: #111827;
}

.audit-line p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.weight-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px;
  gap: 10px;
  align-items: center;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .grid.two,
  .grid.three,
  .project-grid,
  .form-grid,
  .form-grid.three {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 0 16px;
  }

  .content {
    padding: 18px 16px 32px;
  }
}
