/* ============================================================
   力聚 2027 年终设计师大赛 · 闪电抢答
   视觉系统：Element UI 风格（浅色 / 4px 圆角 / 品牌红）
   ============================================================ */

:root {
  --primary: #e60012;
  --primary-hover: #f0434f;
  --primary-active: #b8000e;
  --primary-light: #fef0f0;
  --primary-lighter: #fde2e2;

  --success: #67c23a;
  --success-light: #f0f9eb;
  --warning: #e6a23c;
  --warning-light: #fdf6ec;
  --danger: #f56c6c;
  --danger-light: #fef0f0;
  --info: #909399;
  --info-light: #f4f4f5;

  --text: #303133;
  --text-regular: #606266;
  --text-secondary: #909399;
  --text-placeholder: #c0c4cc;

  --border: #dcdfe6;
  --border-light: #e4e7ed;
  --border-lighter: #ebeef5;
  --bg: #f5f7fa;
  --bg-light: #fafafa;
  --white: #ffffff;

  --radius: 4px;
  --shadow-base: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-dialog: 0 12px 32px rgba(0, 0, 0, 0.16);

  --font: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial,
    sans-serif;
  --mono: "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --topbar-h: 60px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, p, ol, ul {
  margin: 0;
  padding: 0;
}

ol, ul {
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

img {
  display: block;
  max-width: 100%;
}

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

em {
  font-style: normal;
}

::selection {
  background: var(--primary-lighter);
  color: var(--primary-active);
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 顶栏 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-h);
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--border-lighter);
  backdrop-filter: saturate(180%) blur(8px);
}

.topbar__inner {
  max-width: 1040px;
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar__logo {
  display: flex;
  align-items: center;
  flex: none;
}

.topbar__logo img {
  height: 32px;
  width: auto;
}

.topbar__divider {
  width: 1px;
  height: 18px;
  background: var(--border-light);
  flex: none;
}

.topbar__name {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.topbar__nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.topbar__nav a {
  font-size: 13px;
  color: var(--text-regular);
  padding: 6px 10px;
  border-radius: var(--radius);
  transition: color 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}

.topbar__nav a:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.topbar__nav a.is-active {
  color: var(--primary);
  background: var(--primary-light);
  font-weight: 500;
}

/* ---------- 页面容器 ---------- */

.page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 20px 20px 48px;
  animation: pageIn 0.32s ease both;
}

.page--narrow {
  max-width: 580px;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.page-head h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.page-head p {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.page-head__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- 卡片 ---------- */

.card {
  background: var(--white);
  border: 1px solid var(--border-lighter);
  border-radius: var(--radius);
  box-shadow: var(--shadow-light);
  padding: 20px;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.grid > .card {
  animation: fadeUp 0.42s ease both;
}

.grid > .card:nth-child(2) {
  animation-delay: 0.06s;
}

.page > .card {
  animation: fadeUp 0.42s ease both;
}

.card + .card {
  margin-top: 16px;
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.card__sub {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 400;
}

.card__link {
  font-size: 12px;
  color: var(--primary);
  transition: opacity 0.2s ease;
}

.card__link:hover {
  opacity: 0.75;
}

.grid {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.grid > .card {
  margin-top: 0;
}

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

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

.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease,
    box-shadow 0.2s ease, transform 0.12s ease;
  user-select: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.btn--primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(230, 0, 18, 0.2);
}

.btn--primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  box-shadow: 0 4px 14px rgba(230, 0, 18, 0.26);
}

.btn--primary:active {
  background: var(--primary-active);
  border-color: var(--primary-active);
}

.btn--plain {
  background: var(--white);
  border-color: var(--border);
  color: var(--text-regular);
}

.btn--plain:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.btn--text {
  background: transparent;
  color: var(--primary);
  padding: 0 10px;
}

.btn--text:hover {
  color: var(--primary-hover);
  background: var(--primary-light);
}

.btn--block {
  display: flex;
  width: 100%;
}

.btn--sm {
  height: 32px;
  padding: 0 14px;
  font-size: 13px;
}

.btn--lg {
  height: 46px;
  font-size: 15px;
  padding: 0 24px;
}

.btn--danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.btn--danger:hover {
  background: #f78989;
  border-color: #f78989;
}

.btn .arrow {
  font-size: 15px;
  transition: transform 0.2s ease;
}

.btn:hover .arrow {
  transform: translateX(3px);
}

/* ---------- 标签 / 徽标 ---------- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  line-height: 1;
  color: var(--text-regular);
  background: var(--white);
  white-space: nowrap;
}

.tag--primary {
  color: var(--primary);
  background: var(--primary-light);
  border-color: var(--primary-lighter);
}

.tag--success {
  color: var(--success);
  background: var(--success-light);
  border-color: #e1f3d8;
}

.tag--warning {
  color: var(--warning);
  background: var(--warning-light);
  border-color: #faecd8;
}

.tag--danger {
  color: var(--danger);
  background: var(--danger-light);
  border-color: #fde2e2;
}

.tag--info {
  color: var(--text-secondary);
  background: var(--info-light);
  border-color: #e9e9eb;
}

.tag--dark {
  color: #fff;
  background: var(--text);
  border-color: var(--text);
}

.tag--live::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: dotPulse 1.6s ease-in-out infinite;
}

/* ---------- 表单 ---------- */

.field {
  display: block;
  margin-top: 16px;
}

.field:first-child {
  margin-top: 0;
}

.field__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text-regular);
}

.field__label i {
  font-style: normal;
  font-size: 11px;
  color: var(--primary);
}

.input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  font-size: 14px;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  appearance: none;
}

.input::placeholder {
  color: var(--text-placeholder);
}

.input:hover {
  border-color: #c0c4cc;
}

.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(230, 0, 18, 0.08);
}

.textarea {
  width: 100%;
  min-height: 110px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  font-size: 13px;
  line-height: 1.7;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(230, 0, 18, 0.08);
}

.field__hint {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.field-row {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

/* ---------- 首页 ---------- */

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 28px;
  position: relative;
  overflow: hidden;
  animation: fadeUp 0.45s ease both;
}

.hero::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -80px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(230, 0, 18, 0.05) 0%, rgba(230, 0, 18, 0) 70%);
  pointer-events: none;
}

.hero__kicker {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.hero__title {
  margin-top: 12px;
  font-size: 26px;
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.hero__title span {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.hero__desc {
  margin-top: 14px;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--text-regular);
  max-width: 560px;
}

.hero__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.hero__facts {
  display: flex;
  gap: 36px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-lighter);
}

.hero__fact b {
  display: block;
  font-family: var(--mono);
  font-size: 24px;
  line-height: 1.2;
  color: var(--text);
}

.hero__fact span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-secondary);
}

.hero__status {
  background: var(--bg-light);
  border: 1px solid var(--border-lighter);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: fadeUp 0.45s ease 0.08s both;
}

.status__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.status__title {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.4;
}

.status__title small {
  display: block;
  margin-top: 4px;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text-secondary);
}

.status__desc {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-regular);
}

.status__actions {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.identity {
  display: flex;
  align-items: center;
  gap: 14px;
}

.identity__avatar {
  width: 48px;
  height: 48px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 18px;
  font-weight: 600;
  transition: transform 0.25s ease;
}

.identity:hover .identity__avatar {
  transform: scale(1.05);
}

.identity__body {
  flex: 1;
  min-width: 0;
}

.identity__body b {
  display: block;
  font-size: 15px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity__body span {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity__action {
  flex: none;
  font-size: 13px;
  color: var(--primary);
  padding: 6px 8px;
  border-radius: var(--radius);
  transition: background 0.2s ease;
}

.identity__action:hover {
  background: var(--primary-light);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stats__item {
  background: var(--bg-light);
  border-radius: var(--radius);
  padding: 14px 8px;
  text-align: center;
}

.stats__item b {
  display: block;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
}

.stats__item span {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.rank-line {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.mini {
  margin-top: 16px;
  border-top: 1px solid var(--border-lighter);
  padding-top: 6px;
}

.mini__row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-lighter);
  font-size: 13px;
  animation: fadeIn 0.35s ease both;
}

.mini__row:last-child {
  border-bottom: 0;
}

.mini__row:nth-child(2) { animation-delay: 0.04s; }
.mini__row:nth-child(3) { animation-delay: 0.08s; }
.mini__row:nth-child(4) { animation-delay: 0.12s; }
.mini__row:nth-child(5) { animation-delay: 0.16s; }

.mini__rank {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
}

.mini__row:nth-child(1) .mini__rank,
.mini__row:nth-child(2) .mini__rank,
.mini__row:nth-child(3) .mini__rank {
  color: var(--primary);
  font-weight: 600;
}

.mini__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-regular);
}

.mini__score {
  font-family: var(--mono);
  font-weight: 600;
  color: var(--text);
}

.mini__empty {
  padding: 20px 0 12px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-secondary);
}

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

.rules-list li {
  position: relative;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-regular);
}

.rules-list li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.55;
}

.award-list {
  display: grid;
}

.award-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-lighter);
  font-size: 13px;
  color: var(--text-regular);
}

.award-row:last-child {
  border-bottom: 0;
}

.award-row .tag {
  flex: none;
  min-width: 64px;
  justify-content: center;
}

.award-row__count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border-lighter);
  text-align: center;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.9;
}

.footer img {
  height: 30px;
  width: auto;
  margin: 0 auto 10px;
  opacity: 0.9;
}

/* ---------- 答题页 ---------- */

.play {
  max-width: 580px;
  margin: 0 auto;
  padding: 20px 20px 40px;
  min-height: calc(100vh - var(--topbar-h));
  min-height: calc(100dvh - var(--topbar-h));
  animation: pageIn 0.3s ease both;
}

.play__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.play__eyebrow {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.play__title {
  margin-top: 5px;
  font-size: 20px;
  font-weight: 600;
}

.state {
  background: var(--white);
  border: 1px solid var(--border-lighter);
  border-radius: var(--radius);
  box-shadow: var(--shadow-light);
  padding: 44px 24px;
  text-align: center;
  animation: fadeUp 0.4s ease both;
}

.state__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text-secondary);
}

.state__icon--primary {
  background: var(--primary-light);
  color: var(--primary);
}

.state h2 {
  font-size: 20px;
  font-weight: 600;
}

.state p {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.state .btn {
  margin-top: 20px;
}

.state__actions {
  display: grid;
  gap: 8px;
  max-width: 280px;
  margin: 20px auto 0;
}

.gate {
  background: var(--white);
  border: 1px solid var(--border-lighter);
  border-radius: var(--radius);
  box-shadow: var(--shadow-light);
  padding: 26px 24px;
  animation: fadeUp 0.4s ease both;
}

.gate__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-lighter);
}

.gate__head img {
  height: 28px;
  width: auto;
}

.gate__head span {
  font-size: 12px;
  color: var(--text-secondary);
}

.gate h2 {
  margin-top: 20px;
  font-size: 21px;
  font-weight: 600;
}

.gate__desc {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.gate__note {
  margin-top: 16px;
  padding: 10px 12px;
  border: 1px solid #faecd8;
  border-radius: var(--radius);
  background: var(--warning-light);
  font-size: 12px;
  line-height: 1.7;
  color: #8a5a10;
}

.gate .btn {
  margin-top: 18px;
}

.gate__foot {
  margin-top: 12px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--text-secondary);
  text-align: center;
}

.quiz {
  background: var(--white);
  border: 1px solid var(--border-lighter);
  border-radius: var(--radius);
  box-shadow: var(--shadow-base);
  padding: 22px;
  animation: slideUp 0.35s ease both;
}

.quiz__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

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

.quiz__hint {
  font-size: 12px;
  color: var(--text-secondary);
}

.quiz__timer {
  display: flex;
  align-items: baseline;
  gap: 2px;
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 600;
  color: var(--primary);
  line-height: 1;
  transition: color 0.2s ease;
}

.quiz__timer small {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-secondary);
}

.progress {
  height: 4px;
  border-radius: 2px;
  background: var(--border-lighter);
  overflow: hidden;
}

.progress__bar {
  height: 100%;
  width: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.12s linear, background 0.25s ease;
}

.quiz__stem {
  margin-top: 20px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.7;
  min-height: 56px;
}

.options {
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  text-align: left;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.12s ease,
    box-shadow 0.2s ease;
}

.option:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.option:active {
  transform: scale(0.995);
}

.option__key {
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--white);
  transition: all 0.2s ease;
}

.option__text {
  flex: 1;
  min-width: 0;
}

.option.is-selected {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 1px var(--primary) inset;
}

.option.is-selected .option__key {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  animation: keyPop 0.22s ease;
}

@keyframes keyPop {
  0% { transform: scale(0.82); }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.option.is-correct {
  border-color: var(--success);
  background: var(--success-light);
  box-shadow: 0 0 0 1px var(--success) inset;
}

.option.is-correct .option__key {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.option.is-wrong {
  border-color: var(--danger);
  background: var(--danger-light);
  box-shadow: 0 0 0 1px var(--danger) inset;
}

.option.is-wrong .option__key {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.option[disabled] {
  cursor: default;
}

.option[disabled]:hover {
  transform: none;
}

.option:disabled:not(.is-selected):not(.is-correct):not(.is-wrong) {
  opacity: 0.65;
}

.quiz__submit {
  margin-top: 20px;
}

.quiz__note {
  margin-top: 10px;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.quiz__timer.is-urgent {
  color: var(--danger);
  animation: numberPulse 1s ease-in-out infinite;
}

.progress__bar.is-urgent {
  background: var(--danger);
}

/* 反馈层 */

.feedback {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.45);
  animation: fadeIn 0.18s ease both;
}

.feedback__card {
  width: min(300px, 78vw);
  background: var(--white);
  border-radius: 8px;
  padding: 28px 22px 24px;
  text-align: center;
  box-shadow: var(--shadow-dialog);
  animation: dialogIn 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.15) both;
}

.feedback__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 26px;
  animation: iconPop 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.3) both;
}

.feedback__icon--ok { background: var(--success); }
.feedback__icon--bad { background: var(--danger); }
.feedback__icon--time { background: var(--warning); }

.feedback__title {
  font-size: 18px;
  font-weight: 600;
}

.feedback__desc {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.feedback__desc b {
  color: var(--text);
  font-family: var(--mono);
}

/* 结果 */

.result {
  background: var(--white);
  border: 1px solid var(--border-lighter);
  border-radius: var(--radius);
  box-shadow: var(--shadow-base);
  padding: 28px 22px;
  animation: fadeUp 0.4s ease both;
}

.result__head {
  text-align: center;
}

.result__big {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 44px;
  font-weight: 600;
  line-height: 1;
  color: var(--text);
  animation: numberPop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.result__big small {
  margin-left: 4px;
  font-size: 18px;
  font-weight: 400;
  color: var(--text-secondary);
}

.result__sub {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.result__stats {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.result__stat {
  background: var(--bg-light);
  border-radius: var(--radius);
  padding: 14px 6px;
  text-align: center;
  animation: fadeUp 0.4s ease both;
}

.result__stat:nth-child(2) { animation-delay: 0.06s; }
.result__stat:nth-child(3) { animation-delay: 0.12s; }

.result__stat b {
  display: block;
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.2;
}

.result__stat span {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-secondary);
}

.result__list {
  margin-top: 22px;
  border-top: 1px solid var(--border-lighter);
  padding-top: 8px;
}

.result__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-lighter);
  font-size: 13px;
}

.result__item:last-child {
  border-bottom: 0;
}

.result__item .tag {
  font-family: var(--mono);
}

.result__item .num {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-secondary);
}

.result__note {
  margin-top: 18px;
  padding: 10px 12px;
  border: 1px solid #faecd8;
  border-radius: var(--radius);
  background: var(--warning-light);
  font-size: 12px;
  line-height: 1.7;
  color: #8a5a10;
}

.result__actions {
  margin-top: 18px;
  display: grid;
  gap: 8px;
}

.result__hint {
  margin-top: 12px;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-secondary);
}

/* 骨架屏 */

.skeleton {
  background: linear-gradient(90deg, #f2f3f5 25%, #e9ebef 37%, #f2f3f5 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius);
}

.skeleton-card {
  padding: 24px;
  background: #fff;
  border: 1px solid var(--border-lighter);
  border-radius: var(--radius);
}

.skeleton-line {
  height: 14px;
  margin-bottom: 12px;
}

.skeleton-line--short {
  width: 40%;
}

.skeleton-line--title {
  height: 22px;
  width: 62%;
}

/* ---------- 排行榜 ---------- */

.board-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 20px 56px;
  animation: pageIn 0.3s ease both;
}

.tabs {
  display: flex;
  gap: 24px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 16px;
}

.tab {
  position: relative;
  padding: 10px 2px 12px;
  font-size: 14px;
  color: var(--text-regular);
  transition: color 0.2s ease;
}

.tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transition: transform 0.25s ease;
}

.tab:hover {
  color: var(--primary);
}

.tab.is-active {
  color: var(--primary);
  font-weight: 500;
}

.tab.is-active::after {
  transform: scaleX(1);
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  min-height: 32px;
}

.round-select {
  display: flex;
  flex: 1;
  min-width: 0;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.round-select::-webkit-scrollbar {
  display: none;
}

.round-select button {
  flex: none;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--white);
  font-size: 12px;
  color: var(--text-regular);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.round-select button:hover {
  color: var(--primary);
  border-color: var(--primary-lighter);
  background: var(--primary-light);
}

.round-select button.is-active {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-light);
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.switch__track {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: #dcdfe6;
  position: relative;
  transition: background 0.2s ease;
}

.switch__track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.switch.is-on .switch__track {
  background: var(--primary);
}

.switch.is-on .switch__track::after {
  transform: translateX(16px);
}

.board {
  background: var(--white);
  border: 1px solid var(--border-lighter);
  border-radius: var(--radius);
  box-shadow: var(--shadow-base);
  overflow: hidden;
}

.board__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-lighter);
}

.board__title {
  font-size: 16px;
  font-weight: 600;
}

.board__stamp {
  text-align: right;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.board__stamp b {
  display: block;
  font-weight: 500;
  color: var(--text-regular);
}

.bhead {
  display: grid;
  grid-template-columns: 44px 1fr 70px 64px;
  gap: 10px;
  padding: 9px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border-lighter);
  font-size: 11.5px;
  color: var(--text-secondary);
}

.bhead span:nth-child(3),
.bhead span:nth-child(4) {
  text-align: right;
}

.bhead.is-total {
  grid-template-columns: 44px 1fr 58px 58px 64px;
}

.bhead.is-total span:nth-child(3),
.bhead.is-total span:nth-child(4),
.bhead.is-total span:nth-child(5) {
  text-align: right;
}

.brow {
  display: grid;
  grid-template-columns: 44px 1fr 70px 64px;
  gap: 10px;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border-lighter);
  font-size: 13.5px;
  transition: background 0.2s ease;
  animation: fadeIn 0.3s ease both;
}

.brow:last-child {
  border-bottom: 0;
}

.brow:hover {
  background: var(--bg);
}

.brow.is-total {
  grid-template-columns: 44px 1fr 58px 58px 64px;
}

.brow.is-me {
  background: var(--primary-light);
}

.brow.is-me:hover {
  background: var(--primary-lighter);
}

.brow:nth-child(1) { animation-delay: 0.02s; }
.brow:nth-child(2) { animation-delay: 0.04s; }
.brow:nth-child(3) { animation-delay: 0.06s; }
.brow:nth-child(4) { animation-delay: 0.08s; }
.brow:nth-child(5) { animation-delay: 0.1s; }
.brow:nth-child(6) { animation-delay: 0.12s; }
.brow:nth-child(7) { animation-delay: 0.14s; }
.brow:nth-child(8) { animation-delay: 0.16s; }
.brow:nth-child(9) { animation-delay: 0.18s; }
.brow:nth-child(10) { animation-delay: 0.2s; }

.rank-badge {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
}

.rank-badge--1 {
  background: var(--primary);
  color: #fff;
}

.rank-badge--2 {
  background: #fdf0e5;
  color: #c26c1f;
}

.rank-badge--3 {
  background: #f4f1ea;
  color: #8a6d3b;
}

.brow__who {
  min-width: 0;
}

.brow__name {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
  font-weight: 500;
  color: var(--text);
}

.brow__nick {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.brow__qq {
  display: block;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-secondary);
}

.brow__num,
.brow__pts {
  text-align: right;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-regular);
}

.brow__pts {
  font-weight: 600;
  color: var(--text);
}

.brow__badge {
  display: inline-block;
  flex: none;
  margin-left: 2px;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--info-light);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 400;
  vertical-align: 1px;
}

.board__foot {
  padding: 12px 20px;
  border-top: 1px solid var(--border-lighter);
  background: var(--bg-light);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 12px;
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.board-empty {
  padding: 52px 24px;
  text-align: center;
}

.board-empty b {
  display: block;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-regular);
}

.board-empty p {
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.board-foot {
  margin-top: 16px;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.clean-exit {
  display: none;
  position: fixed;
  right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 60;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-base);
  font-size: 12px;
  color: var(--text-regular);
}

body.is-clean {
  background: var(--white);
}

body.is-clean .topbar,
body.is-clean .page-head,
body.is-clean .tabs,
body.is-clean .toolbar,
body.is-clean .board-foot {
  display: none;
}

body.is-clean .clean-exit {
  display: inline-flex;
}

body.is-clean .board-page {
  padding-top: 16px;
}

body.is-clean .board {
  box-shadow: none;
  border-color: var(--border-light);
}

/* ---------- 管理后台 ---------- */

.adminbar {
  position: sticky;
  top: 0;
  z-index: 90;
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border-lighter);
}

.adminbar__inner {
  max-width: 1120px;
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.adminbar__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.adminbar__brand img {
  height: 30px;
  width: auto;
}

.adminbar__brand span {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.adminbar__meta {
  margin-left: 4px;
  display: none;
  font-size: 11.5px;
  color: var(--text-secondary);
  font-family: var(--mono);
}

.adminbar__actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.admin-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 20px 64px;
}

.admin-tabs {
  display: flex;
  gap: 22px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.admin-tabs::-webkit-scrollbar {
  display: none;
}

.admin-tabs button {
  position: relative;
  flex: none;
  padding: 10px 2px 12px;
  font-size: 14px;
  color: var(--text-regular);
  transition: color 0.2s ease;
}

.admin-tabs button::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transition: transform 0.25s ease;
}

.admin-tabs button:hover {
  color: var(--primary);
}

.admin-tabs button.is-active {
  color: var(--primary);
  font-weight: 500;
}

.admin-tabs button.is-active::after {
  transform: scaleX(1);
}

.admin-main {
  display: grid;
  gap: 16px;
  animation: pageIn 0.3s ease both;
}

.panel {
  background: var(--white);
  border: 1px solid var(--border-lighter);
  border-radius: var(--radius);
  box-shadow: var(--shadow-light);
  padding: 18px;
}

.panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel__head h2 {
  font-size: 15px;
  font-weight: 600;
}

.panel__head .sub {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.panel__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

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

.stat-tile {
  background: var(--white);
  border: 1px solid var(--border-lighter);
  border-radius: var(--radius);
  box-shadow: var(--shadow-light);
  padding: 16px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.stat-tile:hover {
  box-shadow: var(--shadow-base);
  transform: translateY(-1px);
}

.stat-tile b {
  display: block;
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
}

.stat-tile span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}

.stat-tile.is-spot {
  border-top: 2px solid var(--primary);
}

.status-line {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px;
  border: 1px solid var(--border-lighter);
  border-radius: var(--radius);
  background: var(--bg-light);
  margin-bottom: 12px;
}

.status-line__title {
  font-size: 14px;
  font-weight: 600;
}

.status-line__meta {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-secondary);
}

.round-list {
  display: grid;
  gap: 12px;
}

.round-item {
  border: 1px solid var(--border-lighter);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--white);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.round-item:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-light);
}

.round-item__top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.round-item__index {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.06em;
}

.round-item__title {
  font-size: 14px;
  font-weight: 600;
}

.round-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.round-item__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.btn-mini {
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  font-size: 12px;
  color: var(--text-regular);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-mini:hover {
  color: var(--primary);
  border-color: var(--primary-lighter);
  background: var(--primary-light);
}

.btn-mini--primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn-mini--primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: #fff;
}

.btn-mini--warn {
  color: var(--warning);
  border-color: #f5dab1;
}

.btn-mini--warn:hover {
  background: var(--warning-light);
  color: var(--warning);
  border-color: #f5dab1;
}

.btn-mini--danger {
  color: var(--danger);
  border-color: #fbc4c4;
}

.btn-mini--danger:hover {
  background: var(--danger-light);
  color: var(--danger);
  border-color: #fbc4c4;
}

.btn-mini--ok {
  color: var(--success);
  border-color: #c2e7b0;
}

.btn-mini--ok:hover {
  background: var(--success-light);
  color: var(--success);
  border-color: #c2e7b0;
}

.linkbox {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.linkbox input {
  flex: 1;
  min-width: 0;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border-lighter);
  border-radius: var(--radius);
  background: var(--bg-light);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-regular);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-lighter);
  border-radius: var(--radius);
  -webkit-overflow-scrolling: touch;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  min-width: 640px;
}

table.data th,
table.data td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border-lighter);
  white-space: nowrap;
}

table.data th {
  background: var(--bg);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-secondary);
}

table.data tbody tr {
  transition: background 0.2s ease;
}

table.data tbody tr:hover {
  background: var(--bg);
}

table.data tr:last-child td {
  border-bottom: 0;
}

table.data td.num,
table.data th.num {
  text-align: right;
  font-family: var(--mono);
}

table.data .flag {
  color: var(--danger);
  font-size: 11px;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-regular);
  cursor: pointer;
}

.checkline input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--info-light);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 400;
}

.badge--gold { background: #fdf6ec; color: #b88230; }
.badge--ok { background: var(--success-light); color: var(--success); }
.badge--warn { background: var(--warning-light); color: #b88230; }
.badge--live { background: var(--primary-light); color: var(--primary); }

.audit-list {
  display: grid;
  gap: 8px;
  font-size: 12px;
  color: var(--text-regular);
}

.audit-list li {
  display: flex;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-lighter);
  line-height: 1.6;
}

.audit-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.audit-list time {
  flex: none;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-secondary);
}

.empty {
  padding: 32px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-light);
  line-height: 1.8;
}

/* 登录 */

.login-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.login-card {
  width: min(400px, 100%);
  background: var(--white);
  border: 1px solid var(--border-lighter);
  border-radius: 8px;
  box-shadow: var(--shadow-base);
  padding: 32px 28px;
  animation: fadeUp 0.4s ease both;
}

.login-card__logo {
  height: 40px;
  width: auto;
  margin: 0 auto 20px;
}

.login-card h1 {
  font-size: 20px;
  font-weight: 600;
  text-align: center;
}

.login-card__desc {
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--text-secondary);
  text-align: center;
}

.login-card .field {
  margin-top: 24px;
}

.login-card .btn {
  margin-top: 20px;
}

.login-card__foot {
  margin-top: 14px;
  font-size: 11.5px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.7;
}

/* 题库编辑 */

.qedit {
  border: 1px solid var(--border-lighter);
  border-radius: var(--radius);
  padding: 14px;
  margin-top: 12px;
  background: var(--bg-light);
}

.qedit__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
}

.qedit .textarea {
  min-height: 76px;
  background: #fff;
}

.opt-edit {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.opt-edit input[type="radio"] {
  width: 16px;
  height: 16px;
  flex: none;
  accent-color: var(--success);
}

.opt-edit .letter {
  width: 16px;
  flex: none;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.opt-edit .input {
  height: 34px;
  font-size: 13px;
  background: #fff;
}

/* 二维码 */

.qr-box {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--border-lighter);
  border-radius: var(--radius);
  background: var(--bg-light);
}

.qr-box img {
  width: 200px;
  height: 200px;
  image-rendering: pixelated;
  background: #fff;
  border-radius: var(--radius);
}

.qr-url {
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.7;
  color: var(--text-secondary);
  word-break: break-all;
  text-align: center;
}

/* ---------- 弹层 / 消息 ---------- */

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.2s ease both;
}

.modal {
  width: min(640px, 100%);
  max-height: 92vh;
  max-height: 92dvh;
  overflow: auto;
  background: var(--white);
  border-radius: 8px 8px 0 0;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-dialog);
  animation: sheetUp 0.28s cubic-bezier(0.2, 0.8, 0.3, 1) both;
  -webkit-overflow-scrolling: touch;
}

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

.modal__head h2 {
  font-size: 17px;
  font-weight: 600;
}

.modal__head p {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.modal__close {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 14px;
  color: var(--text-secondary);
  transition: background 0.2s ease, color 0.2s ease;
}

.modal__close:hover {
  background: var(--bg);
  color: var(--text);
}

.modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.toast-root {
  position: fixed;
  top: calc(var(--topbar-h) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  width: min(420px, calc(100vw - 32px));
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 11px 14px;
  border: 1px solid var(--border-lighter);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-base);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-regular);
  animation: messageIn 0.28s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}

.toast::before {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 10px;
  color: #fff;
  background: var(--info);
}

.toast--ok::before {
  content: "✓";
  background: var(--success);
}

.toast--bad::before {
  content: "!";
  background: var(--danger);
}

.toast--info::before {
  content: "i";
  background: var(--info);
}

/* ---------- 动画 ---------- */

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

@keyframes dialogIn {
  from { opacity: 0; transform: scale(0.92) translateY(8px); }
  to { opacity: 1; transform: none; }
}

@keyframes sheetUp {
  from { opacity: 0.6; transform: translateY(32px); }
  to { opacity: 1; transform: none; }
}

@keyframes messageIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: none; }
}

@keyframes iconPop {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes numberPop {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes numberPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@keyframes shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  width: 20px;
  height: 20px;
  margin: 0 auto 12px;
  border: 2px solid var(--border-lighter);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ---------- 响应式 ---------- */

@media (min-width: 640px) {
  .grid--2 {
    grid-template-columns: 1fr 1fr;
  }

  .field-row {
    grid-template-columns: 1fr 1fr;
  }

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

  .modal-mask {
    align-items: center;
    padding: 24px;
  }

  .modal {
    border-radius: 8px;
    padding-bottom: 20px;
  }

  .adminbar__meta {
    display: block;
  }

  .stat-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
    padding: 32px;
  }

  .hero__title {
    font-size: 28px;
  }

  .topbar__inner,
  .adminbar__inner {
    padding: 0 24px;
  }

  .card:hover {
    box-shadow: var(--shadow-base);
  }
}

@media (max-width: 520px) {
  .topbar__inner {
    padding: 0 14px;
    gap: 10px;
  }

  .topbar__name {
    display: none;
  }

  .topbar__divider {
    display: none;
  }

  .topbar__logo img {
    height: 28px;
  }

  .topbar__nav a {
    padding: 6px 8px;
  }

  .page,
  .board-page,
  .play {
    padding-left: 14px;
    padding-right: 14px;
  }

  .hero {
    padding: 22px 18px;
  }

  .hero__title {
    font-size: 22px;
  }

  .hero__facts {
    gap: 20px;
  }

  .hero__fact b {
    font-size: 21px;
  }

  .card {
    padding: 16px;
  }

  .status__title {
    font-size: 17px;
  }

  .bhead,
  .brow {
    grid-template-columns: 40px 1fr 58px 54px;
    padding-left: 14px;
    padding-right: 14px;
    gap: 8px;
  }

  .bhead.is-total,
  .brow.is-total {
    grid-template-columns: 38px 1fr 48px 48px 56px;
  }

  .board__head {
    padding: 14px;
  }

  .board__foot {
    padding: 12px 14px;
  }

  .quiz {
    padding: 18px 16px;
  }

  .quiz__stem {
    font-size: 16.5px;
  }

  .option {
    padding: 12px;
    font-size: 13.5px;
  }

  .result__big {
    font-size: 38px;
  }

  .adminbar__brand span {
    display: none;
  }

  .adminbar__inner {
    padding: 0 14px;
  }

  .admin-wrap {
    padding: 14px 14px 56px;
  }

  .panel {
    padding: 16px;
  }

  .panel__head {
    flex-direction: column;
  }

  .panel__actions {
    justify-content: flex-start;
  }

  .stat-grid {
    gap: 10px;
  }

  .stat-tile {
    padding: 14px;
  }

  .stat-tile b {
    font-size: 22px;
  }

  .field-row--3 {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
