:root {
  --bg: #fffaf4;
  --panel: #ffffff;
  --text: #293241;
  --muted: #62707d;
  --line: #e7e3db;
  --primary: #ff8a5b;
  --primary-2: #ffd17a;
  --accent: #7dd3c7;
  --ok: #2a9d8f;
  --err: #d62828;
  --radius: 14px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 10%, #ffe8d6 0, transparent 25%),
    radial-gradient(circle at 90% 0%, #e0fbfc 0, transparent 22%),
    var(--bg);
}

.container { width: min(1120px, 92vw); margin: 0 auto; }
.page-main { padding: 22px 0 46px; }
.stack, .stack-lg { display: grid; gap: 12px; }
.stack-lg { gap: 18px; }
.grid { display: grid; gap: 14px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; min-height: 62px; }
.brand { text-decoration: none; color: var(--text); font-weight: 700; letter-spacing: .3px; }
.nav-links { display: flex; gap: 12px; }
.nav-links a { text-decoration: none; color: var(--muted); font-size: 14px; }
.nav-links a:hover { color: var(--text); }

.hero {
  margin: 10px 0 16px;
  background: linear-gradient(120deg, #ffd6a5, #caffbf 45%, #9bf6ff);
  border-radius: calc(var(--radius) + 8px);
  padding: clamp(20px, 4vw, 38px);
}
.hero h1 { margin: 0 0 8px; font-size: clamp(1.4rem, 3.6vw, 2.2rem); }
.hero p { margin: 0; color: #324b54; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 8px 18px rgba(28, 39, 54, 0.05);
}

.narrow { max-width: 420px; margin: 0 auto; }

.tests-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.test-card { display: grid; gap: 8px; align-content: start; }
.test-actions { margin-top: 6px; }

.search-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
input, textarea, select {
  width: 100%;
  border: 1px solid #d7d2c6;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
}
textarea { resize: vertical; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  border-radius: 11px;
  padding: 10px 15px;
  font: inherit;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #1f2b2c;
  text-decoration: none;
  font-weight: 600;
}
.btn:hover { filter: brightness(1.03); transform: translateY(-1px); }
.btn-small { padding: 7px 12px; font-size: 13px; }
.btn-lg { width: 100%; min-height: 48px; }
.btn-secondary {
  background: #eef3f8;
  color: #25364a;
  border: 1px solid #d8e1ec;
}

.muted { color: var(--muted); font-size: 14px; }
.preline { white-space: pre-line; }

.progress { height: 10px; background: #f0eee8; border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, #7dd3c7, #82b1ff); transition: width .22s ease; }
.progress-text { margin-top: 8px; color: var(--muted); }
.sticky-head { position: sticky; top: 74px; z-index: 10; }

.option-list { display: grid; gap: 8px; }
.option-item {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
  border: 1px solid #ece7de;
  border-radius: 10px;
  padding: 9px 10px;
}
.option-item input { width: 18px; height: 18px; margin-top: 2px; }
.question-stem { line-height: 1.55; }
.q-step { display: none; }
.q-step.active {
  display: block;
  animation: fadeInStep .18s ease;
}

@keyframes fadeInStep {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.flash-list { margin-bottom: 12px; display: grid; gap: 8px; }
.flash { border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.flash-success { background: #ddf6ef; color: #145f4c; }
.flash-error { background: #fde2e4; color: #8f2525; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { border-bottom: 1px solid #eee7df; text-align: left; padding: 10px 8px; vertical-align: top; }
.table th { color: #44515f; background: #fcfaf6; }

.stat-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stat p { margin: 2px 0 0; font-size: 28px; font-weight: 700; color: #355070; }
.button-row { display: flex; gap: 10px; flex-wrap: wrap; }

.question-admin { border-top: 1px dashed #ddd5ca; padding-top: 12px; margin-top: 12px; }
.inline-form { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; margin: 6px 0; }
.options-admin { margin-top: 8px; }

.answer-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.answer-item { background: #f6f9fc; border: 1px solid #e5edf3; border-radius: 10px; padding: 8px 10px; }
.codebox {
  background: #1f2430;
  color: #c7d2fe;
  border-radius: 12px;
  padding: 12px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.45;
}

.footer { color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); padding: 14px 0 24px; }

@media (max-width: 768px) {
  .topbar-inner { min-height: 56px; }
  .nav-links { font-size: 13px; gap: 8px; }
  .card { padding: 13px; }
  .inline-form { grid-template-columns: 1fr; }
  .sticky-head { top: 62px; }
}
