:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --primary: #7c3aed;
  --primary-dark: #5b21b6;
  --soft: #f3e8ff;
  --danger: #dc2626;
  --shadow: 0 16px 36px rgba(17, 24, 39, .08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

.admin-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 18px 60px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1, h2 { margin: 0; }

.admin-header h1 { font-size: 38px; }

.admin-header p, .login-card p {
  color: var(--muted);
  line-height: 1.7;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 18px;
}

.login-card {
  max-width: 430px;
}

label {
  display: block;
  color: #374151;
  font-weight: 800;
  font-size: 14px;
}

input, select {
  display: block;
  width: 100%;
  margin-top: 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 15px;
  outline: none;
  background: #fff;
}

input:focus, select:focus {
  border-color: rgba(124,58,237,.58);
  box-shadow: 0 0 0 4px rgba(124,58,237,.12);
}

button {
  border: 0;
  border-radius: 12px;
  padding: 11px 15px;
  background: var(--primary);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

button.secondary {
  background: #eef2ff;
  color: #3730a3;
}

button.ghost {
  background: transparent;
  color: var(--primary-dark);
}

button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.error {
  color: var(--danger);
  min-height: 22px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 220px auto auto;
  gap: 14px;
  align-items: end;
}

.table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  margin-bottom: 12px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  background: #fff;
}

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

th {
  background: #f8fafc;
  color: #475569;
}

tbody tr:hover {
  background: #fbf7ff;
}

.badge {
  display: inline-flex;
  border-radius: 999px;
  background: var(--soft);
  color: var(--primary-dark);
  padding: 5px 9px;
  font-weight: 900;
  white-space: nowrap;
}

.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
}

dialog {
  width: min(760px, calc(100vw - 28px));
  border: 0;
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(15, 23, 42, .25);
  padding: 0;
}

dialog::backdrop {
  background: rgba(15, 23, 42, .38);
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

#detailContent {
  padding: 20px;
}

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

.detail-item {
  background: #f8fafc;
  border-radius: 12px;
  padding: 12px;
}

.score-list {
  display: grid;
  gap: 10px;
}

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

.track {
  height: 10px;
  background: #eef1f7;
  border-radius: 999px;
  overflow: hidden;
}

.fill {
  height: 100%;
  background: linear-gradient(90deg, #7c3aed, #0ea5e9);
}

@media (max-width: 780px) {
  .admin-header, .toolbar, .detail-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

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