/* ============================================================
   BIHZ CS Club Online Test — design system in the BASIS style
   Palette / typography extracted from bisz.basischina.com CSS:
   blue #3255a4 · red #dd3b48 · crumb #eaeef6 · weight-900 titles
   ============================================================ */

:root {
  --blue: #3255a4;
  --blue-dark: #27437f;
  --blue-deeper: #1d3260;
  --blue-mask: rgba(50, 85, 164, 0.8);
  --blue-line: rgba(50, 85, 164, 0.2);
  --blue-tint: #eaeef6;
  --blue-tint-2: #f5f7fb;
  --red: #dd3b48;
  --red-light: #ee5a55;
  --ink: #333;
  --ink-sub: #666;
  --ink-light: #999;
  --white: #fff;
  --ok: #2c9a5b;
  --warn: #e2a33b;
  --shadow: 0 4px 24px rgba(50, 85, 164, 0.12);
  --font: "Century Gothic", 方正黑体, gotham, "PingFangSC-Regular", "Helvetica Neue",
    Helvetica, "Microsoft YaHei", "SourceHanSansCN-Normal", SourceHanSansCN, sans-serif;
  --mono: "SF Mono", Menlo, Consolas, "Liberation Mono", "Courier New", monospace;
  --header-h: 72px;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: var(--font); }
html, body { width: 100%; min-height: 100%; }
body {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--white);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
li { list-style: none; }
a { color: inherit; text-decoration: none; -webkit-backface-visibility: hidden; }
img { max-width: 100%; }
button { border: none; background: none; cursor: pointer; color: inherit; font-size: inherit; }
code, pre, textarea.code { font-family: var(--mono); }

/* BASIS-style scrollbars */
::-webkit-scrollbar { width: 10px; height: 8px; }
::-webkit-scrollbar-track-piece { background-color: transparent; }
::-webkit-scrollbar-thumb:vertical {
  background-color: #bbb; border-radius: 4px;
  outline: 2px solid transparent; border: 2px solid rgba(255, 255, 255, 0.6);
}
::-webkit-scrollbar-thumb:hover { background-color: #9f9f9f; }

.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[hidden] { display: none !important; }

/* ---------------- header ---------------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: var(--header-h);
  background: var(--white);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 48px;
  box-shadow: 0 1px 0 var(--blue-line);
}
.site-header .brand { display: flex; align-items: center; gap: 14px; cursor: pointer; }
.brand-mark {
  width: 40px; height: 40px; background: var(--red); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 900; letter-spacing: 0;
  transform: rotate(45deg); border-radius: 6px;
}
.brand-mark span { transform: rotate(-45deg); }
.brand-text .brand-name {
  font-size: 20px; font-weight: 900; color: var(--blue); line-height: 1.15; letter-spacing: 0.5px;
}
.brand-text .brand-sub {
  font-size: 11px; font-weight: 400; color: var(--ink-light); letter-spacing: 2.2px; text-transform: uppercase;
}
.site-header .nav { display: flex; align-items: center; gap: 28px; }
.site-header .nav a { font-size: 14px; color: var(--ink-sub); position: relative; padding: 6px 0; }
.site-header .nav a:hover, .site-header .nav a.active { color: var(--blue); }
.site-header .nav a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 3px; background: var(--red); border-radius: 3px;
}
.page-body { padding-top: var(--header-h); }

/* ---------------- hero (blue mask over pattern, like the photo masks) ---------------- */
.hero {
  position: relative; overflow: hidden;
  background-color: var(--blue);
  background-image:
    radial-gradient(ellipse 90% 70% at 70% -10%, rgba(255, 255, 255, 0.16), transparent 60%),
    linear-gradient(160deg, var(--blue-dark) 0%, var(--blue) 45%, #3f66bd 100%);
  color: #fff;
}
.hero::before {
  content: ""; position: absolute; inset: 0; opacity: 0.35; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
}
.hero::after {
  content: ""; position: absolute; right: -120px; bottom: -180px;
  width: 460px; height: 460px; transform: rotate(45deg);
  background: rgba(221, 59, 72, 0.16); border-radius: 60px; pointer-events: none;
}
.hero-inner { position: relative; z-index: 2; padding: 88px 24px 96px; text-align: center; }

.session-title {
  font-family: var(--font);
  font-weight: 900; text-align: center; color: #fff;
  font-size: 50px; line-height: 1.35; user-select: auto;
}
.session-sub {
  margin-top: 14px; font-size: 18px; font-weight: 200; color: rgba(255, 255, 255, 0.85);
  letter-spacing: 1px;
}
@media screen and (max-height: 580px) { .session-title { font-size: 36px; } }
@media only screen and (max-width: 600px) { .session-title { font-size: 30px; } .session-sub { font-size: 15px; } }

/* ---------------- signature skewed-underline link ---------------- */
.link-arrow {
  display: inline-block; cursor: pointer;
  font-size: 16px; font-weight: 400; color: var(--red); text-align: center;
}
.link-arrow::after {
  content: ""; display: block;
  width: 100%; height: 5px; margin-top: -3px; padding-right: 7px;
  border: 1px solid var(--red); border-top: none; border-left: none;
  transform: skew(30deg);
}
.link-arrow:hover { color: var(--blue); }
.link-arrow:hover::after { border-color: var(--blue); }
.link-arrow.white { color: #fff; }
.link-arrow.white::after { border-color: #fff; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 26px; height: 44px;
  font-size: 15px; font-weight: 600; letter-spacing: 0.5px;
  border-radius: 3px; cursor: pointer; user-select: none;
  transition: background-color 0.15s ease, color 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-blue:hover:not(:disabled) { background: var(--blue-dark); }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover:not(:disabled) { background: #c5303c; }
.btn-outline { background: transparent; color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.btn-outline:hover:not(:disabled) { background: var(--blue-tint); }
.btn-ghost { background: transparent; color: var(--ink-sub); box-shadow: inset 0 0 0 1px #d5dae6; }
.btn-ghost:hover:not(:disabled) { color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.btn-sm { height: 32px; padding: 0 14px; font-size: 13px; font-weight: 400; }
.btn-lg { height: 52px; padding: 0 36px; font-size: 16px; }

/* ---------------- forms ---------------- */
.field { margin-bottom: 20px; text-align: left; }
.field label {
  display: block; margin-bottom: 8px;
  font-size: 13px; color: var(--ink-sub); letter-spacing: 0.4px;
}
.field label b { color: var(--blue); font-weight: 600; }
.input, .field input[type="text"], .field input[type="password"], .field input[type="number"],
.field select, .field textarea {
  width: 100%; height: 44px; padding: 0 14px;
  font-size: 15px; color: var(--ink);
  background: var(--white);
  border: 1px solid #d5dae6; border-radius: 3px;
  outline: none; transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none; -webkit-appearance: none;
}
.field textarea { height: auto; padding: 10px 14px; line-height: 1.6; resize: vertical; }
.field select {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%233255a4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 34px; cursor: pointer;
}
.input:focus, .field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--blue); box-shadow: 0 0 0 3px rgba(50, 85, 164, 0.14);
}
.field .hint { margin-top: 6px; font-size: 12px; color: var(--ink-light); }

/* ---------------- cards ---------------- */
.b-card {
  background: var(--white); border-radius: 4px; box-shadow: var(--shadow);
  overflow: hidden;
}
.bottom-left-badge {
  display: inline-block; padding: 4px 18px;
  background-color: var(--blue); color: #cfd7e9;
  font-size: 14px; letter-spacing: 1px;
}

/* stats band (number + desc, from the honors-box pattern) */
.stat .number {
  font-size: 40px; line-height: 48px; font-weight: 500; color: var(--blue);
  font-family: var(--font); text-align: center;
}
.stat .desc { margin-top: 6px; font-size: 15px; color: rgba(77, 77, 77, 0.6); text-align: center; line-height: 22px; }

/* ---------------- crumb bar ---------------- */
.crumb {
  width: 100%; min-height: 40px; background: var(--blue-tint);
  font-size: 12px; color: var(--ink-sub);
  display: flex; align-items: center; gap: 4px;
  padding: 0 48px;
}
.crumb a { cursor: pointer; }
.crumb a:hover, .crumb .active { color: var(--blue); }
.crumb .split { padding: 0 4px; color: var(--ink-light); }

/* ---------------- tables ---------------- */
.b-table { width: 100%; border-collapse: collapse; background: #fff; }
.b-table th {
  background: var(--blue-tint); color: var(--blue); font-weight: 600;
  font-size: 13px; text-align: left; padding: 12px 16px; white-space: nowrap;
}
.b-table td { padding: 13px 16px; border-bottom: 1px solid #eef1f7; font-size: 14px; vertical-align: middle; }
.b-table tbody tr { transition: background-color 0.12s ease; }
.b-table tbody tr:hover { background: var(--blue-tint-2); }
.b-table .empty { text-align: center; color: var(--ink-light); padding: 40px 16px; }

/* status pills */
.pill {
  display: inline-block; padding: 3px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.5px;
}
.pill-open { background: rgba(44, 154, 91, 0.12); color: var(--ok); }
.pill-draft { background: rgba(0, 0, 0, 0.07); color: var(--ink-sub); }
.pill-closed { background: rgba(221, 59, 72, 0.1); color: var(--red); }
.pill-blue { background: rgba(50, 85, 164, 0.1); color: var(--blue); }
.pill-warn { background: rgba(226, 163, 59, 0.15); color: #a8720d; }

/* join code chip */
.code-chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 15px; font-weight: 700; letter-spacing: 2px;
  color: var(--blue); background: var(--blue-tint); border-radius: 3px; padding: 4px 10px;
  cursor: pointer; white-space: nowrap;
}
.code-chip:hover { background: #dde4f2; }

/* ---------------- modal ---------------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(29, 50, 96, 0.55);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  width: 520px; max-width: 100%; max-height: 86vh; overflow: auto;
  background: #fff; border-radius: 6px; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
  padding: 28px;
}
.modal.wide { width: 900px; }
.modal h3 { font-size: 20px; font-weight: 900; color: var(--blue); margin-bottom: 16px; }
.modal .modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }

/* ---------------- toast ---------------- */
#toast-wrap { position: fixed; top: 90px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast {
  padding: 11px 22px; border-radius: 4px; color: #fff; font-size: 14px;
  background: var(--blue); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  animation: toast-in 0.25s ease;
  max-width: 80vw; text-align: center;
}
.toast.error { background: var(--red); }
.toast.ok { background: var(--ok); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------------- footer ---------------- */
.site-footer { background: #fff; border-top: 1px solid var(--blue-line); }
.site-footer .content-box { padding: 48px; }
.site-footer .name-en { font-size: 26px; font-weight: 400; color: var(--blue); }
.site-footer .name-zh { margin-top: 10px; font-size: 20px; font-weight: 300; color: var(--blue); }
.site-footer .foot-meta {
  margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--blue-line);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-size: 13px; color: var(--ink-light);
}
.site-footer .foot-meta a { color: var(--blue); }
.site-footer .foot-meta a:hover { text-decoration: underline; }

/* ============================================================
   Student index (join page)
   ============================================================ */
.join-wrap { position: relative; z-index: 3; max-width: 460px; margin: -64px auto 0; padding: 0 20px 72px; }
.join-card { background: #fff; border-radius: 6px; box-shadow: var(--shadow); padding: 36px 36px 30px; }
.join-card h2 { font-size: 20px; font-weight: 900; color: var(--blue); text-align: center; margin-bottom: 4px; }
.join-card .sub { text-align: center; color: var(--ink-light); font-size: 13px; margin-bottom: 26px; }
.join-card .code-input input {
  text-transform: uppercase; letter-spacing: 6px; text-align: center;
  font-family: var(--mono); font-size: 20px; font-weight: 700; height: 54px; color: var(--blue);
}
.join-card .btn { width: 100%; margin-top: 6px; }
.join-note { margin-top: 18px; text-align: center; font-size: 12px; color: var(--ink-light); line-height: 1.7; }

.how-band { background: #fff; padding: 64px 24px 26px; }
.how-band .h-title { text-align: center; font-size: 28px; font-weight: 600; color: var(--blue); margin-bottom: 40px; }
.how-grid { display: flex; justify-content: center; gap: 56px; flex-wrap: wrap; max-width: 1000px; margin: 0 auto; }
.how-grid .stat { width: 240px; padding-bottom: 40px; }

/* ============================================================
   Exam page
   ============================================================ */
.exam-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: var(--header-h);
  background: var(--blue);
  background-image: linear-gradient(120deg, var(--blue-dark), var(--blue) 55%, #3a5fb4);
  color: #fff; display: flex; align-items: center; gap: 18px; padding: 0 20px;
}
.exam-topbar .brand-mark { width: 34px; height: 34px; font-size: 18px; flex: none; }
.exam-topbar .exam-titles { min-width: 0; }
.exam-topbar .exam-title { font-size: 17px; font-weight: 900; letter-spacing: 0.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exam-topbar .exam-student { font-size: 12px; color: rgba(255, 255, 255, 0.75); margin-top: 1px; }
.exam-topbar .spacer { flex: 1; }
.save-state { font-size: 12px; color: rgba(255, 255, 255, 0.75); white-space: nowrap; }
.timer-chip {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, 0.14); border-radius: 4px; padding: 7px 16px;
  font-family: var(--mono); font-size: 18px; font-weight: 700; letter-spacing: 1px;
}
.timer-chip.low { background: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.75; } }

.exam-main {
  position: fixed; top: var(--header-h); bottom: 0; left: 0; right: 0;
  display: flex; overflow: hidden; background: var(--blue-tint-2);
}
.pane-problem {
  width: 44%; min-width: 300px; overflow-y: auto; background: #fff;
  border-right: 1px solid var(--blue-line); display: flex; flex-direction: column;
}
.problem-head { padding: 22px 28px 0; }
.q-tag {
  display: inline-block; padding: 4px 16px; background: var(--blue); color: #cfd7e9;
  font-size: 13px; letter-spacing: 1px; margin-bottom: 14px;
}
.problem-title { font-size: 22px; font-weight: 900; color: var(--blue); line-height: 1.35; }
.problem-body { padding: 16px 28px 40px; font-size: 15px; line-height: 1.8; color: var(--ink); }
.problem-body p { margin-bottom: 10px; }
.problem-body ul { margin: 4px 0 12px; }
.problem-body ul li { list-style: disc; margin-left: 22px; margin-bottom: 4px; }
.problem-body code {
  background: var(--blue-tint); color: var(--blue-dark); border-radius: 3px; padding: 1px 6px; font-size: 13.5px;
}
.problem-body pre {
  background: #22314f; color: #e8ecf6; border-radius: 5px; padding: 14px 16px; overflow-x: auto;
  font-size: 13.5px; line-height: 1.65; margin: 12px 0;
}
.problem-body pre code { background: none; color: inherit; padding: 0; }
.problem-body strong { font-weight: 700; color: var(--blue-dark); }

.q-tabs { display: flex; gap: 6px; padding: 14px 28px 0; flex-wrap: wrap; }
.q-tabs button {
  padding: 7px 16px; background: var(--blue-tint); color: var(--blue); border-radius: 3px 3px 0 0;
  font-size: 13px; font-weight: 600;
}
.q-tabs button.active { background: var(--blue); color: #fff; }

.pane-work { flex: 1; min-width: 320px; display: flex; flex-direction: column; overflow: hidden; }
.work-toolbar {
  height: 48px; flex: none; display: flex; align-items: center; gap: 10px;
  padding: 0 16px; background: #fff; border-bottom: 1px solid var(--blue-line);
}
.lang-chip {
  font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--blue);
  background: var(--blue-tint); padding: 4px 10px; border-radius: 3px; letter-spacing: 1px;
}
.work-toolbar .spacer { flex: 1; }
.editor-host { flex: 1; overflow: hidden; position: relative; background: #fff; }
.editor-host .CodeMirror { height: 100%; font-family: var(--mono); font-size: 14px; line-height: 1.6; }
.editor-host .CodeMirror-gutters { background: var(--blue-tint-2); border-right: 1px solid #e4e9f3; }
.editor-host .CodeMirror-linenumber { color: #a6b0c6; }
.editor-host .CodeMirror-activeline-background { background: #f2f5fb; }
.editor-host textarea.fallback-editor {
  width: 100%; height: 100%; border: none; outline: none; resize: none;
  padding: 14px 16px; font-family: var(--mono); font-size: 14px; line-height: 1.6; tab-size: 4;
}

.io-split { flex: none; height: 38%; min-height: 150px; display: flex; flex-direction: column; border-top: 2px solid var(--blue-line); }
.io-tabs { display: flex; align-items: center; background: #22314f; padding: 0 8px; flex: none; }
.io-tabs button {
  padding: 9px 16px; color: #93a1c0; font-size: 12.5px; font-weight: 600; letter-spacing: 0.6px;
}
.io-tabs button.active { color: #fff; box-shadow: inset 0 -2px 0 var(--red); }
.io-tabs .run-hint { margin-left: auto; font-size: 11px; color: #93a1c0; padding-right: 8px; }
.io-body { flex: 1; overflow: hidden; position: relative; background: #1a2740; }
.console-out {
  position: absolute; inset: 0; overflow: auto; padding: 12px 16px;
  font-family: var(--mono); font-size: 13px; line-height: 1.6; color: #d9e1f2; white-space: pre-wrap;
  word-break: break-word;
}
.console-out .err { color: #ff8f97; }
.console-out .sys { color: #7f8db0; font-style: italic; }
.stdin-box {
  position: absolute; inset: 0; width: 100%; height: 100%; border: none; outline: none; resize: none;
  background: #1a2740; color: #d9e1f2; padding: 12px 16px;
  font-family: var(--mono); font-size: 13px; line-height: 1.6;
}

/* mobile: stack panes */
@media only screen and (max-width: 860px) {
  .exam-topbar { gap: 10px; padding: 0 12px; }
  .exam-topbar .brand-mark { display: none; }
  .exam-topbar .btn { height: 36px; padding: 0 14px; font-size: 13px; }
  .timer-chip { font-size: 15px; padding: 6px 10px; }
  .save-state { display: none; }
  .exam-main { flex-direction: column; overflow-y: auto; position: static; min-height: calc(100vh - var(--header-h)); margin-top: var(--header-h); }
  .pane-problem { width: 100%; min-height: 240px; max-height: 45vh; border-right: none; border-bottom: 1px solid var(--blue-line); }
  .pane-work { min-height: 480px; }
  .exam-topbar .exam-student { display: none; }
  .site-header { padding: 0 16px; }
  .crumb { padding: 0 16px; }
}

.divider {
  width: 6px; cursor: col-resize; background: transparent; flex: none; position: relative; z-index: 5;
  margin-left: -3px;
}
.divider:hover, .divider.dragging { background: rgba(50, 85, 164, 0.25); }
@media only screen and (max-width: 860px) { .divider { display: none; } }

/* ============================================================
   Result page
   ============================================================ */
.result-hero { text-align: center; padding: 72px 20px 56px; }
.result-card { max-width: 720px; margin: -30px auto 60px; padding: 0 20px; position: relative; z-index: 3; }
.result-card .b-card { padding: 36px; }
.result-score .number { font-size: 64px; line-height: 1.1; color: var(--blue); font-weight: 500; text-align: center; }
.result-score .of { font-size: 20px; color: var(--ink-light); font-weight: 400; }
.result-score .desc { text-align: center; margin-top: 8px; color: rgba(77, 77, 77, 0.6); }
.review-item { border: 1px solid #e4e9f3; border-radius: 5px; margin-top: 20px; overflow: hidden; position: relative; }
.review-item .rev-head { display: flex; justify-content: space-between; align-items: center; background: var(--blue-tint-2); padding: 10px 16px; font-weight: 600; color: var(--blue); }
.review-item pre {
  margin: 0; padding: 14px 16px; background: #22314f; color: #e8ecf6; overflow-x: auto;
  font-size: 13px; line-height: 1.65; font-family: var(--mono); white-space: pre;
}
.feedback-box { margin-top: 20px; background: var(--blue-tint); border-left: 4px solid var(--blue); padding: 14px 18px; border-radius: 0 4px 4px 0; text-align: left; }
.feedback-box .fb-label { font-size: 12px; font-weight: 700; color: var(--blue); letter-spacing: 1px; margin-bottom: 6px; }

/* ============================================================
   Admin
   ============================================================ */
.admin-login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.admin-login-card { width: 400px; max-width: 100%; background: #fff; border-radius: 6px; box-shadow: var(--shadow); padding: 40px 36px; position: relative; z-index: 3; }
.admin-login-card h2 { text-align: center; font-size: 22px; font-weight: 900; color: var(--blue); margin-bottom: 6px; }
.admin-login-card .sub { text-align: center; font-size: 13px; color: var(--ink-light); margin-bottom: 28px; }
.admin-login-card .btn { width: 100%; }

.admin-body { padding: 26px 48px 80px; max-width: 1200px; margin: 0 auto; }
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.admin-head h1 { font-size: 28px; font-weight: 900; color: var(--blue); line-height: 1.2; }
.admin-head .sub { color: var(--ink-light); font-size: 13px; margin-top: 6px; }
.admin-head .actions { display: flex; gap: 12px; flex-wrap: wrap; }

.panel { background: #fff; border-radius: 5px; box-shadow: var(--shadow); overflow: hidden; margin-bottom: 26px; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 22px; border-bottom: 1px solid #eef1f7;
}
.panel-head h3 { font-size: 16px; font-weight: 900; color: var(--blue); }
.panel-pad { padding: 22px; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 22px; }
.form-grid .full-row { grid-column: 1 / -1; }

.q-editor { border: 1px solid #e4e9f3; border-radius: 5px; margin-bottom: 18px; overflow: hidden; }
.q-editor-head { display: flex; align-items: center; gap: 10px; background: var(--blue-tint-2); padding: 10px 16px; }
.q-editor-head .q-no {
  width: 28px; height: 28px; background: var(--blue); color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center; border-radius: 3px; flex: none;
}
.q-editor-head .spacer { flex: 1; }
.q-editor-head input.q-points { width: 76px; height: 32px; text-align: center; }
.q-editor-body { padding: 16px; }
.icon-btn {
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 3px; color: var(--ink-sub); font-size: 15px;
}
.icon-btn:hover { background: var(--blue-tint); color: var(--blue); }
.icon-btn.danger:hover { background: rgba(221, 59, 72, 0.1); color: var(--red); }

.mono-block {
  background: #22314f; color: #e8ecf6; border-radius: 5px; padding: 14px 16px; overflow-x: auto;
  font-size: 13px; line-height: 1.65; font-family: var(--mono); white-space: pre; position: relative;
}
.copy-float {
  position: absolute; top: 8px; right: 8px; background: rgba(255, 255, 255, 0.12); color: #cfd7e9;
  font-size: 11px; padding: 4px 10px; border-radius: 3px;
}
.copy-float:hover { background: rgba(255, 255, 255, 0.25); color: #fff; }

.grade-row { display: flex; align-items: center; gap: 10px; }
.grade-row input { width: 90px; height: 36px; text-align: center; }
.grade-row .of-pts { color: var(--ink-light); font-size: 13px; }

.table-scroll { overflow-x: auto; }

.tag-mini { font-size: 11px; color: var(--ink-light); }

/* loading dots */
.loading-line { padding: 48px; text-align: center; color: var(--ink-light); }
.loading-line::after { content: "…"; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

@media only screen and (max-width: 768px) {
  .admin-body { padding: 20px 16px 60px; }
  .site-header { padding: 0 16px; }
  .site-header .nav { gap: 16px; }
  .hero-inner { padding: 56px 16px 72px; }
  .site-footer .content-box { padding: 32px 16px; }
}
