* {
  box-sizing: border-box;
}

:root {
  --bg: #f3f6fb;
  --card: #ffffff;
  --text: #0b1b33;
  --muted: rgba(11, 27, 51, 0.62);
  --primary: #2f78ff;
  --primary-weak: rgba(47, 120, 255, 0.12);
  --danger: #ff4d4f;
  --border: rgba(15, 23, 42, 0.08);
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  --sidebar-bg: #0b1220;
  --sidebar-text: rgba(255, 255, 255, 0.78);
  --sidebar-active: rgba(255, 255, 255, 0.12);
}

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

.btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.06s ease, filter 0.06s ease;
}

.btn:active {
  transform: translateY(1px);
  filter: brightness(0.95);
}

.btn.primary {
  background: var(--primary);
  color: #fff;
  width: 100%;
  margin-top: 12px;
}

.btn.danger {
  width: 100%;
  background: var(--danger);
  color: #fff;
  margin-top: 10px;
}

.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #2f78ff 0%, #6aa5ff 50%, var(--bg) 100%);
}

.login-card {
  width: 360px;
  background: #fff;
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
}

.login-title {
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 14px;
}

.form-row {
  margin-top: 10px;
}

.label {
  font-size: 12px;
  color: rgba(11, 27, 51, 0.6);
  margin-bottom: 6px;
}

input {
  width: 100%;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 0 10px;
  background: #fff;
}

.select {
  width: 100%;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 0 10px;
  background: #fff;
  font-weight: 800;
  color: rgba(11, 27, 51, 0.78);
}

.error {
  margin-top: 10px;
  color: #ff4d4f;
  font-size: 12px;
  font-weight: 700;
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: var(--sidebar-bg);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  font-weight: 900;
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 14px;
  padding: 8px 10px;
  letter-spacing: 0.2px;
}

.nav {
  display: block;
  text-decoration: none;
  color: var(--sidebar-text);
  font-weight: 800;
  padding: 10px 12px;
  border-radius: 12px;
  margin-top: 8px;
}

.nav:hover {
  background: rgba(255, 255, 255, 0.08);
}

.nav.active {
  background: var(--sidebar-active);
  color: rgba(255, 255, 255, 0.96);
}

.main {
  flex: 1;
  padding: 20px 22px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 14px;
  z-index: 10;
}

.page-title {
  font-size: 18px;
  font-weight: 900;
}

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

.muted {
  color: var(--muted);
  font-weight: 700;
}

.admin-menu {
  position: relative;
}

.admin-btn {
  list-style: none;
  cursor: pointer;
  background: var(--primary-weak);
  color: var(--primary);
  font-weight: 900;
  padding: 10px 12px;
  border-radius: 12px;
}

.admin-panel {
  position: absolute;
  right: 0;
  top: 46px;
  width: 220px;
  background: #fff;
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
  border: 1px solid var(--border);
}

.avatar-btn {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: linear-gradient(180deg, rgba(106, 165, 255, 0.25) 0%, rgba(47, 120, 255, 0.18) 100%);
  border: 1px solid rgba(47, 120, 255, 0.25);
}

.avatar-btn:hover {
  filter: brightness(0.98);
}

.avatar-btn:active {
  transform: translateY(1px);
}

.avatar-icon {
  width: 20px;
  height: 20px;
  fill: rgba(47, 120, 255, 0.95);
}

.admin-line {
  font-weight: 800;
  color: rgba(11, 27, 51, 0.78);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.table th,
.table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.table th {
  color: rgba(11, 27, 51, 0.68);
  font-weight: 900;
  background: rgba(15, 23, 42, 0.02);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
}

.link {
  color: var(--primary);
  font-weight: 900;
  text-decoration: none;
}

.score-input {
  width: 120px;
}

.tabs {
  display: flex;
  gap: 10px;
}

.tab {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 12px;
  font-weight: 900;
  text-decoration: none;
  color: rgba(11, 27, 51, 0.7);
  background: rgba(11, 27, 51, 0.04);
}

.tab.active {
  background: rgba(47, 120, 255, 0.12);
  color: #2f78ff;
}

.form-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-label {
  font-size: 12px;
  font-weight: 900;
  color: rgba(11, 27, 51, 0.6);
}

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

.field .label {
  margin-top: 0;
}

.json-editor {
  width: 100%;
  height: 520px;
  border-radius: 12px;
  border: 1px solid rgba(11, 27, 51, 0.12);
  padding: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.4;
  resize: vertical;
}

.btn-lite {
  border: 1px solid rgba(11, 27, 51, 0.12);
  border-radius: 10px;
  padding: 8px 12px;
  background: #fff;
  font-weight: 900;
  cursor: pointer;
}

.danger-lite {
  color: #ff4d4f;
  border-color: rgba(255, 77, 79, 0.3);
  background: rgba(255, 77, 79, 0.06);
}

.q-card {
  margin-top: 14px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(11, 27, 51, 0.08);
  background: rgba(11, 27, 51, 0.02);
}

.q-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.q-title {
  font-weight: 900;
  color: rgba(11, 27, 51, 0.78);
}

.q-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
}

.check {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 900;
  color: rgba(11, 27, 51, 0.7);
}

.check-text {
  font-size: 12px;
}

.option-box {
  margin-top: 12px;
}

.option-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 10px;
  margin-top: 10px;
  align-items: center;
}

.img-box {
  margin-top: 12px;
}

.img-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.img-item {
  border: 1px solid rgba(11, 27, 51, 0.08);
  border-radius: 12px;
  padding: 8px;
  background: #fff;
}

.img-thumb {
  width: 100%;
  border-radius: 10px;
  display: block;
}

.file {
  margin-top: 10px;
  height: auto;
  padding: 8px;
}
